Added AddParticipant and DeleteParticipant
This commit is contained in:
parent
4d40159772
commit
f7dd1bc806
6 changed files with 60 additions and 1 deletions
|
@ -65,3 +65,19 @@ func (h *ContestHandlers) DeleteTask(ctx context.Context, req *contestv1.DeleteT
|
|||
}
|
||||
return &emptypb.Empty{}, nil
|
||||
}
|
||||
|
||||
func (h *ContestHandlers) AddParticipant(ctx context.Context, req *contestv1.AddParticipantRequest) (*contestv1.AddParticipantResponse, error) {
|
||||
id, err := h.contestUC.AddParticipant(ctx, req.GetContestId(), req.GetUserId())
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &contestv1.AddParticipantResponse{Id: id}, nil
|
||||
}
|
||||
|
||||
func (h *ContestHandlers) DeleteParticipant(ctx context.Context, req *contestv1.DeleteParticipantRequest) (*emptypb.Empty, error) {
|
||||
err := h.contestUC.DeleteParticipant(ctx, req.GetParticipantId())
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &emptypb.Empty{}, nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue