generated from VLADIMIR/template
add game
This commit is contained in:
+51
-5
@@ -605,15 +605,51 @@ func (s *server) GiveTeamApplications(ctx context.Context, req *proto.GiveTeamAp
|
||||
return nil, status.Errorf(codes.PermissionDenied, "permission denied")
|
||||
}
|
||||
|
||||
panic("unimplemented")
|
||||
err := s.gameService.GiveTeamApplications(
|
||||
ctx,
|
||||
int(req.Id),
|
||||
req.Name,
|
||||
)
|
||||
if err != nil {
|
||||
return &proto.GiveTeamApplicationsRsp{
|
||||
Error: err.Error(),
|
||||
}, nil
|
||||
}
|
||||
|
||||
return &proto.GiveTeamApplicationsRsp{}, nil
|
||||
}
|
||||
|
||||
func (s *server) GetTeamActions(ctx context.Context, req *proto.GetTeamActionsReq) (*proto.GetTeamActionsRsp, error) {
|
||||
panic("unimplemented")
|
||||
func (s *server) GetTeamStory(ctx context.Context, req *proto.GetTeamStoryReq) (*proto.GetTeamStoryRsp, error) {
|
||||
story, err := s.gameService.GetTeamActions(
|
||||
ctx,
|
||||
int(req.Id),
|
||||
req.Password,
|
||||
)
|
||||
if err != nil {
|
||||
return &proto.GetTeamStoryRsp{
|
||||
Error: err.Error(),
|
||||
}, nil
|
||||
}
|
||||
|
||||
return &proto.GetTeamStoryRsp{
|
||||
Story: mapStory(story),
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (s *server) AddTeamAction(ctx context.Context, req *proto.AddTeamActionReq) (*proto.AddTeamActionRsp, error) {
|
||||
panic("unimplemented")
|
||||
err := s.gameService.AddTeamAction(
|
||||
ctx,
|
||||
int(req.Id),
|
||||
req.Password,
|
||||
req.Code,
|
||||
)
|
||||
if err != nil {
|
||||
return &proto.AddTeamActionRsp{
|
||||
Error: err.Error(),
|
||||
}, nil
|
||||
}
|
||||
|
||||
return &proto.AddTeamActionRsp{}, nil
|
||||
}
|
||||
|
||||
func (s *server) DeleteLastTeamAction(ctx context.Context, req *proto.DeleteLastTeamActionReq) (*proto.DeleteLastTeamActionRsp, error) {
|
||||
@@ -622,5 +658,15 @@ func (s *server) DeleteLastTeamAction(ctx context.Context, req *proto.DeleteLast
|
||||
return nil, status.Errorf(codes.PermissionDenied, "permission denied")
|
||||
}
|
||||
|
||||
panic("unimplemented")
|
||||
err := s.gameService.DeleteLastTeamAction(
|
||||
ctx,
|
||||
int(req.Id),
|
||||
)
|
||||
if err != nil {
|
||||
return &proto.DeleteLastTeamActionRsp{
|
||||
Error: err.Error(),
|
||||
}, nil
|
||||
}
|
||||
|
||||
return &proto.DeleteLastTeamActionRsp{}, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user