Added AddTask and DeleteTask. Without db tests
This commit is contained in:
parent
568ccea09a
commit
4d40159772
6 changed files with 59 additions and 0 deletions
|
@ -49,3 +49,19 @@ func (h *ContestHandlers) DeleteContest(ctx context.Context, req *contestv1.Dele
|
|||
}
|
||||
return &emptypb.Empty{}, nil
|
||||
}
|
||||
|
||||
func (h *ContestHandlers) AddTask(ctx context.Context, req *contestv1.AddTaskRequest) (*contestv1.AddTaskResponse, error) {
|
||||
id, err := h.contestUC.AddTask(ctx, req.GetContestId(), req.GetProblemId())
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &contestv1.AddTaskResponse{Id: id}, nil
|
||||
}
|
||||
|
||||
func (h *ContestHandlers) DeleteTask(ctx context.Context, req *contestv1.DeleteTaskRequest) (*emptypb.Empty, error) {
|
||||
err := h.contestUC.DeleteTask(ctx, req.GetTaskId())
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &emptypb.Empty{}, nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue