This commit is contained in:
2026-07-28 20:38:03 +07:00
parent f6934e9d5b
commit 20662dc9da
20 changed files with 729 additions and 233 deletions
+51 -5
View File
@@ -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
}
+6 -4
View File
@@ -9,10 +9,12 @@ func mapTeam(
o *game_service.Team,
) *proto.Team {
return &proto.Team{
Id: int32(o.ID),
Name: o.Name,
Status: o.Status,
Password: o.Password,
Id: int32(o.ID),
Name: o.Name,
Status: o.Status,
Password: o.Password,
ActionsCount: int32(o.ActionsCount),
Applications: mapApplications(o.Applications),
}
}