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
+7 -5
View File
@@ -419,9 +419,9 @@ service EveningDetectiveServer {
}; };
} }
rpc GetTeamActions(GetTeamActionsReq) returns (GetTeamActionsRsp) { rpc GetTeamStory(GetTeamStoryReq) returns (GetTeamStoryRsp) {
option (google.api.http) = { option (google.api.http) = {
get: "/api/teams/{id}/actions" get: "/api/teams/{id}/story"
}; };
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
security: { security: {
@@ -753,6 +753,8 @@ message Team {
string name = 2; string name = 2;
string status = 3; string status = 3;
string password = 4; string password = 4;
int32 actions_count = 5;
repeated Application applications = 6;
} }
message GetGameReq { message GetGameReq {
@@ -819,14 +821,14 @@ message GiveTeamApplicationsRsp {
string error = 1; string error = 1;
} }
message GetTeamActionsReq { message GetTeamStoryReq {
int64 id = 1; int64 id = 1;
string password = 2; string password = 2;
} }
message GetTeamActionsRsp { message GetTeamStoryRsp {
string error = 1; string error = 1;
repeated Place places = 2; Story story = 2;
} }
message AddTeamActionReq { message AddTeamActionReq {
+15 -1
View File
@@ -4,10 +4,14 @@ import (
"context" "context"
_ "embed" _ "embed"
"evening_detective_server/internal/app" "evening_detective_server/internal/app"
"evening_detective_server/internal/modules/cleaner"
"evening_detective_server/internal/modules/email_sender" "evening_detective_server/internal/modules/email_sender"
"evening_detective_server/internal/modules/file_storage" "evening_detective_server/internal/modules/file_storage"
"evening_detective_server/internal/modules/password_generator" "evening_detective_server/internal/modules/password_generator"
"evening_detective_server/internal/modules/processor_jwt" "evening_detective_server/internal/modules/processor_jwt"
"evening_detective_server/internal/modules/storytelling"
"evening_detective_server/internal/repos/actions_repo"
"evening_detective_server/internal/repos/applications_repo"
"evening_detective_server/internal/repos/games_repo" "evening_detective_server/internal/repos/games_repo"
"evening_detective_server/internal/repos/refresh_tokens_repo" "evening_detective_server/internal/repos/refresh_tokens_repo"
"evening_detective_server/internal/repos/scenarios_repo" "evening_detective_server/internal/repos/scenarios_repo"
@@ -75,18 +79,28 @@ func main() {
} }
fileService := file_service.NewFileService(fileStorage) fileService := file_service.NewFileService(fileStorage)
scenariosRepo := scenarios_repo.NewScenariosRepo(dbpool) scenariosRepo := scenarios_repo.NewScenariosRepo(dbpool)
cleaner := cleaner.NewCleaner()
scenarioService := scenarios_service.NewScenarioService( scenarioService := scenarios_service.NewScenarioService(
scenariosRepo, scenariosRepo,
cleaner,
os.Getenv("FILE_PREFIX_DOMAIN"), os.Getenv("FILE_PREFIX_DOMAIN"),
) )
gameRepo := games_repo.NewGamesRepo(dbpool) gameRepo := games_repo.NewGamesRepo(dbpool)
teamRepo := teams_repo.NewTeamsRepo(dbpool) teamRepo := teams_repo.NewTeamsRepo(dbpool)
storyteller := storytelling.NewStory()
actionsRepo := actions_repo.NewActionsRepo(dbpool)
applicationsRepo := applications_repo.NewApplicationsRepo(dbpool)
gameService := game_service.NewGameService( gameService := game_service.NewGameService(
gameRepo, gameRepo,
teamRepo, teamRepo,
scenariosRepo, scenariosRepo,
scenarioService,
os.Getenv("FILE_PREFIX_DOMAIN"), os.Getenv("FILE_PREFIX_DOMAIN"),
passwordGenerator, passwordGenerator,
storyteller,
cleaner,
actionsRepo,
applicationsRepo,
) )
// Create a listener on TCP port // Create a listener on TCP port
@@ -109,7 +123,7 @@ func main() {
"/crabs.evening_detective_server.EveningDetectiveServer/DownloadFile": true, "/crabs.evening_detective_server.EveningDetectiveServer/DownloadFile": true,
"/crabs.evening_detective_server.EveningDetectiveServer/GetScenario": true, "/crabs.evening_detective_server.EveningDetectiveServer/GetScenario": true,
"/crabs.evening_detective_server.EveningDetectiveServer/GetScenariosCatalog": true, "/crabs.evening_detective_server.EveningDetectiveServer/GetScenariosCatalog": true,
"/crabs.evening_detective_server.EveningDetectiveServer/GetTeamActions": true, "/crabs.evening_detective_server.EveningDetectiveServer/GetTeamStory": true,
"/crabs.evening_detective_server.EveningDetectiveServer/AddTeamAction": true, "/crabs.evening_detective_server.EveningDetectiveServer/AddTeamAction": true,
}, },
processorJWT, processorJWT,
+57 -48
View File
@@ -903,47 +903,6 @@
} }
}, },
"/api/teams/{id}/actions": { "/api/teams/{id}/actions": {
"get": {
"summary": "Получить ходы",
"operationId": "EveningDetectiveServer_GetTeamActions",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/evening_detective_serverGetTeamActionsRsp"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/rpcStatus"
}
}
},
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"type": "string",
"format": "int64"
},
{
"name": "password",
"in": "query",
"required": false,
"type": "string"
}
],
"tags": [
"Ходы"
],
"security": [
{
"": []
}
]
},
"post": { "post": {
"summary": "Сделать ход", "summary": "Сделать ход",
"operationId": "EveningDetectiveServer_AddTeamAction", "operationId": "EveningDetectiveServer_AddTeamAction",
@@ -1065,6 +1024,49 @@
] ]
} }
}, },
"/api/teams/{id}/story": {
"get": {
"summary": "Получить ходы",
"operationId": "EveningDetectiveServer_GetTeamStory",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/evening_detective_serverGetTeamStoryRsp"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/rpcStatus"
}
}
},
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"type": "string",
"format": "int64"
},
{
"name": "password",
"in": "query",
"required": false,
"type": "string"
}
],
"tags": [
"Ходы"
],
"security": [
{
"": []
}
]
}
},
"/api/test/echo": { "/api/test/echo": {
"post": { "post": {
"summary": "Проверить обработку данных", "summary": "Проверить обработку данных",
@@ -1745,18 +1747,14 @@
} }
} }
}, },
"evening_detective_serverGetTeamActionsRsp": { "evening_detective_serverGetTeamStoryRsp": {
"type": "object", "type": "object",
"properties": { "properties": {
"error": { "error": {
"type": "string" "type": "string"
}, },
"places": { "story": {
"type": "array", "$ref": "#/definitions/evening_detective_serverStory"
"items": {
"type": "object",
"$ref": "#/definitions/evening_detective_serverPlace"
}
} }
} }
}, },
@@ -2002,6 +2000,17 @@
}, },
"password": { "password": {
"type": "string" "type": "string"
},
"actionsCount": {
"type": "integer",
"format": "int32"
},
"applications": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/evening_detective_serverApplication"
}
} }
} }
}, },
+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") 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) { func (s *server) GetTeamStory(ctx context.Context, req *proto.GetTeamStoryReq) (*proto.GetTeamStoryRsp, error) {
panic("unimplemented") 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) { 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) { 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") 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
} }
+2
View File
@@ -13,6 +13,8 @@ func mapTeam(
Name: o.Name, Name: o.Name,
Status: o.Status, Status: o.Status,
Password: o.Password, Password: o.Password,
ActionsCount: int32(o.ActionsCount),
Applications: mapApplications(o.Applications),
} }
} }
+103
View File
@@ -0,0 +1,103 @@
package actions_repo
import (
"context"
"github.com/jackc/pgx/v5/pgxpool"
)
type ActionsRepo struct {
pool *pgxpool.Pool
}
func NewActionsRepo(pool *pgxpool.Pool) *ActionsRepo {
return &ActionsRepo{
pool: pool,
}
}
func (r *ActionsRepo) AddAction(ctx context.Context, teamId int, code string) (int, error) {
id := 0
err := r.pool.QueryRow(
ctx,
`INSERT INTO actions (code, team_id)
VALUES ($1, $2)
RETURNING id`,
code,
teamId,
).Scan(&id)
if err != nil {
return 0, err
}
return id, nil
}
func (r *ActionsRepo) GetActionsByTeamID(ctx context.Context, teamId int) ([]string, error) {
rows, err := r.pool.Query(
ctx,
`SELECT
code
FROM actions
WHERE team_id = $1
ORDER BY created_at ASC`,
teamId,
)
if err != nil {
return nil, err
}
defer rows.Close()
var codes []string
for rows.Next() {
code := ""
err := rows.Scan(
&code,
)
if err != nil {
return nil, err
}
codes = append(codes, code)
}
if err := rows.Err(); err != nil {
return nil, err
}
return codes, nil
}
func (r *ActionsRepo) GetActionsCountByTeamIDs(ctx context.Context, teamIds []int) (map[int]int, error) {
rows, err := r.pool.Query(
ctx,
`SELECT
team_id,
count(*)
FROM actions
WHERE team_id = ANY($1)
GROUP BY team_id`,
teamIds,
)
if err != nil {
return nil, err
}
defer rows.Close()
res := make(map[int]int, len(teamIds))
for rows.Next() {
id := 0
count := 0
err := rows.Scan(
&id,
&count,
)
if err != nil {
return nil, err
}
res[id] = count
}
if err := rows.Err(); err != nil {
return nil, err
}
return res, nil
}
+7
View File
@@ -0,0 +1,7 @@
package repos
type Application struct {
Name string
Image string
TeamId int
}
+81
View File
@@ -0,0 +1,81 @@
package applications_repo
import (
"context"
"evening_detective_server/internal/repos"
"github.com/jackc/pgx/v5/pgxpool"
)
type ApplicationsRepo struct {
pool *pgxpool.Pool
}
func NewApplicationsRepo(pool *pgxpool.Pool) *ApplicationsRepo {
return &ApplicationsRepo{
pool: pool,
}
}
func (r *ApplicationsRepo) AddApplication(
ctx context.Context,
teamId int,
name string,
image string,
) (int, error) {
id := 0
err := r.pool.QueryRow(
ctx,
`INSERT INTO applications (name, image, team_id)
VALUES ($1, $2, $3)
RETURNING id`,
name,
image,
teamId,
).Scan(&id)
if err != nil {
return 0, err
}
return id, nil
}
func (r *ApplicationsRepo) GetApplicationsByTeamIDsAndState(
ctx context.Context,
teamIds []int,
state string,
) (map[int][]*repos.Application, error) {
rows, err := r.pool.Query(
ctx,
`SELECT
name,
image,
team_id
FROM applications
WHERE team_id = ANY($1)`,
teamIds,
)
if err != nil {
return nil, err
}
defer rows.Close()
res := make(map[int][]*repos.Application, len(teamIds))
for rows.Next() {
application := &repos.Application{}
err := rows.Scan(
&application.Name,
&application.Image,
&application.TeamId,
)
if err != nil {
return nil, err
}
res[application.TeamId] = append(res[application.TeamId], application)
}
if err := rows.Err(); err != nil {
return nil, err
}
return res, nil
}
+1
View File
@@ -5,4 +5,5 @@ type Team struct {
Name string Name string
Status string Status string
Password string Password string
ScenarioId int
} }
+32
View File
@@ -5,6 +5,7 @@ import (
"errors" "errors"
"evening_detective_server/internal/repos" "evening_detective_server/internal/repos"
"github.com/jackc/pgx/v5"
"github.com/jackc/pgx/v5/pgxpool" "github.com/jackc/pgx/v5/pgxpool"
) )
@@ -22,6 +23,37 @@ func NewTeamsRepo(pool *pgxpool.Pool) *TeamsRepo {
} }
} }
func (r *TeamsRepo) GetTeamByID(ctx context.Context, id int) (*repos.Team, error) {
team := &repos.Team{}
row := r.pool.QueryRow(
ctx,
`SELECT
id,
name,
status,
password,
scenario_id
FROM teams
WHERE id = $1`,
id,
)
err := row.Scan(
&team.ID,
&team.Name,
&team.Status,
&team.Password,
&team.ScenarioId,
)
if err != nil {
if errors.Is(err, pgx.ErrNoRows) {
return nil, ErrTeamNotFound
}
return nil, err
}
return team, nil
}
func (r *TeamsRepo) GetTeamsByGameID( func (r *TeamsRepo) GetTeamsByGameID(
ctx context.Context, ctx context.Context,
gameId int, gameId int,
@@ -0,0 +1,6 @@
package game_service
type Application struct {
Name string
Image string
}
@@ -0,0 +1,21 @@
package game_service
import (
"evening_detective_server/internal/modules/storytelling"
"evening_detective_server/internal/repos"
)
func mapApplications(o []*repos.Application) []*storytelling.Application {
res := make([]*storytelling.Application, 0, len(o))
for _, item := range o {
res = append(res, mapApplication(item))
}
return res
}
func mapApplication(o *repos.Application) *storytelling.Application {
return &storytelling.Application{
Name: o.Name,
Image: o.Image,
}
}
+115 -1
View File
@@ -2,10 +2,15 @@ package game_service
import ( import (
"context" "context"
"evening_detective_server/internal/modules/cleaner"
"evening_detective_server/internal/modules/password_generator" "evening_detective_server/internal/modules/password_generator"
"evening_detective_server/internal/modules/storytelling"
"evening_detective_server/internal/repos/actions_repo"
"evening_detective_server/internal/repos/applications_repo"
"evening_detective_server/internal/repos/games_repo" "evening_detective_server/internal/repos/games_repo"
"evening_detective_server/internal/repos/scenarios_repo" "evening_detective_server/internal/repos/scenarios_repo"
"evening_detective_server/internal/repos/teams_repo" "evening_detective_server/internal/repos/teams_repo"
"evening_detective_server/internal/services/scenarios_service"
"time" "time"
) )
@@ -13,23 +18,38 @@ type GameService struct {
gamesRepo *games_repo.GamesRepo gamesRepo *games_repo.GamesRepo
teamsRepo *teams_repo.TeamsRepo teamsRepo *teams_repo.TeamsRepo
scenariosRepo *scenarios_repo.ScenariosRepo scenariosRepo *scenarios_repo.ScenariosRepo
scenarioService *scenarios_service.ScenarioService
domain string domain string
passwordGenerator password_generator.IPasswordGenerator passwordGenerator password_generator.IPasswordGenerator
storyteller storytelling.IStory
cleaner cleaner.ICleaner
actionsRepo *actions_repo.ActionsRepo
applicationsRepo *applications_repo.ApplicationsRepo
} }
func NewGameService( func NewGameService(
gamesRepo *games_repo.GamesRepo, gamesRepo *games_repo.GamesRepo,
teamsRepo *teams_repo.TeamsRepo, teamsRepo *teams_repo.TeamsRepo,
scenariosRepo *scenarios_repo.ScenariosRepo, scenariosRepo *scenarios_repo.ScenariosRepo,
scenarioService *scenarios_service.ScenarioService,
domain string, domain string,
passwordGenerator password_generator.IPasswordGenerator, passwordGenerator password_generator.IPasswordGenerator,
storyteller storytelling.IStory,
cleaner cleaner.ICleaner,
actionsRepo *actions_repo.ActionsRepo,
applicationsRepo *applications_repo.ApplicationsRepo,
) *GameService { ) *GameService {
return &GameService{ return &GameService{
gamesRepo: gamesRepo, gamesRepo: gamesRepo,
teamsRepo: teamsRepo, teamsRepo: teamsRepo,
scenariosRepo: scenariosRepo, scenariosRepo: scenariosRepo,
scenarioService: scenarioService,
domain: domain, domain: domain,
passwordGenerator: passwordGenerator, passwordGenerator: passwordGenerator,
storyteller: storyteller,
cleaner: cleaner,
actionsRepo: actionsRepo,
applicationsRepo: applicationsRepo,
} }
} }
@@ -65,7 +85,30 @@ func (s *GameService) GetGame(
return nil, err return nil, err
} }
game.Teams = teams game.Teams = teams
return mapGame(game, s.domain), nil
res := mapGame(game, s.domain)
teamIds := make([]int, 0, len(game.Teams))
for _, team := range game.Teams {
teamIds = append(teamIds, team.ID)
}
actionsCountByTeamIDs, err := s.actionsRepo.GetActionsCountByTeamIDs(ctx, teamIds)
if err != nil {
return nil, err
}
needApplicationsByTeamIDs, err := s.applicationsRepo.GetApplicationsByTeamIDsAndState(ctx, teamIds, "need")
if err != nil {
return nil, err
}
for _, team := range res.Teams {
team.ActionsCount = actionsCountByTeamIDs[team.ID]
team.Applications = mapApplications(needApplicationsByTeamIDs[team.ID])
}
return res, nil
} }
func (s *GameService) DeleteGame( func (s *GameService) DeleteGame(
@@ -121,3 +164,74 @@ func (s *GameService) UpdateTeam(ctx context.Context, teamId int, name string) e
func (s *GameService) DeleteTeam(ctx context.Context, teamId int) error { func (s *GameService) DeleteTeam(ctx context.Context, teamId int) error {
return s.teamsRepo.DeleteTeam(ctx, teamId) return s.teamsRepo.DeleteTeam(ctx, teamId)
} }
func (s *GameService) GiveTeamApplications(ctx context.Context, teamId int, name string) error {
panic("unimplemented")
}
func (s *GameService) GetTeamActions(ctx context.Context, teamId int, password string) (*storytelling.Story, error) {
team, err := s.teamsRepo.GetTeamByID(ctx, teamId)
if err != nil {
return nil, err
}
if team.Password != password {
return nil, teams_repo.ErrTeamNotFound
}
actions, err := s.actionsRepo.GetActionsByTeamID(ctx, teamId)
if err != nil {
return nil, err
}
scenario, err := s.scenarioService.GetFullScenarioByID(ctx, team.ScenarioId)
if err != nil {
return nil, err
}
return s.storyteller.GetStory(scenario.Story, actions), nil
}
func (s *GameService) AddTeamAction(ctx context.Context, teamId int, password string, actionCode string) error {
team, err := s.teamsRepo.GetTeamByID(ctx, teamId)
if err != nil {
return err
}
if team.Password != password {
return teams_repo.ErrTeamNotFound
}
code := s.cleaner.ClearCode(actionCode)
_, err = s.actionsRepo.AddAction(ctx, teamId, code)
if err != nil {
return err
}
actions, err := s.actionsRepo.GetActionsByTeamID(ctx, teamId)
if err != nil {
return err
}
scenario, err := s.scenarioService.GetFullScenarioByID(ctx, team.ScenarioId)
if err != nil {
return err
}
teamStory := s.storyteller.GetStory(scenario.Story, actions)
lastPlace := teamStory.Places[len(teamStory.Places)-1]
for _, application := range lastPlace.Applications {
_, err := s.applicationsRepo.AddApplication(ctx, teamId, application.Name, application.Image)
if err != nil {
return err
}
}
return nil
}
func (s *GameService) DeleteLastTeamAction(ctx context.Context, teamId int) error {
panic("unimplemented")
}
+4
View File
@@ -1,8 +1,12 @@
package game_service package game_service
import "evening_detective_server/internal/modules/storytelling"
type Team struct { type Team struct {
ID int ID int
Name string Name string
Status string Status string
Password string Password string
ActionsCount int
Applications []*storytelling.Application
} }
@@ -3,6 +3,7 @@ package scenarios_service
import ( import (
"context" "context"
"errors" "errors"
"evening_detective_server/internal/modules/cleaner"
"evening_detective_server/internal/modules/storytelling" "evening_detective_server/internal/modules/storytelling"
"evening_detective_server/internal/repos/scenarios_repo" "evening_detective_server/internal/repos/scenarios_repo"
"strings" "strings"
@@ -10,15 +11,18 @@ import (
type ScenarioService struct { type ScenarioService struct {
scenariosRepo *scenarios_repo.ScenariosRepo scenariosRepo *scenarios_repo.ScenariosRepo
cleaner cleaner.ICleaner
domain string domain string
} }
func NewScenarioService( func NewScenarioService(
scenariosRepo *scenarios_repo.ScenariosRepo, scenariosRepo *scenarios_repo.ScenariosRepo,
cleaner cleaner.ICleaner,
domain string, domain string,
) *ScenarioService { ) *ScenarioService {
return &ScenarioService{ return &ScenarioService{
scenariosRepo: scenariosRepo, scenariosRepo: scenariosRepo,
cleaner: cleaner,
domain: domain, domain: domain,
} }
} }
@@ -167,7 +171,8 @@ func (s *ScenarioService) getStory(ctx context.Context, id int) (*storytelling.S
func (s *ScenarioService) updateStory(ctx context.Context, id int, story *storytelling.Story) error { func (s *ScenarioService) updateStory(ctx context.Context, id int, story *storytelling.Story) error {
mapCodes := map[string]struct{}{} mapCodes := map[string]struct{}{}
for _, place := range story.Places { for _, place := range story.Places {
mapCodes[place.Code] = struct{}{} code := s.cleaner.ClearCode(place.Code)
mapCodes[code] = struct{}{}
place.Image = strings.TrimPrefix(place.Image, s.domain) place.Image = strings.TrimPrefix(place.Image, s.domain)
} }
if len(mapCodes) != len(story.Places) { if len(mapCodes) != len(story.Places) {
@@ -176,9 +181,11 @@ func (s *ScenarioService) updateStory(ctx context.Context, id int, story *storyt
cleanPlaces := make([]*storytelling.Place, 0, len(story.Places)) cleanPlaces := make([]*storytelling.Place, 0, len(story.Places))
for _, place := range story.Places { for _, place := range story.Places {
if place.Code == "" { code := s.cleaner.ClearCode(place.Code)
if code == "" {
continue continue
} }
place.Code = code
cleanPlaces = append(cleanPlaces, place) cleanPlaces = append(cleanPlaces, place)
} }
story.Places = cleanPlaces story.Places = cleanPlaces
@@ -0,0 +1,13 @@
-- +goose Up
CREATE TABLE
IF NOT EXISTS actions (
id SERIAL PRIMARY KEY,
code TEXT,
team_id INTEGER,
created_at TIMESTAMP NOT NULL DEFAULT NOW (),
CONSTRAINT fk_actions_team FOREIGN KEY (team_id) REFERENCES teams (id) ON DELETE CASCADE
);
-- +goose Down
DROP TABLE IF EXISTS actions;
@@ -0,0 +1,15 @@
-- +goose Up
CREATE TABLE
IF NOT EXISTS applications (
id SERIAL PRIMARY KEY,
name TEXT,
image TEXT,
team_id INTEGER,
status VARCHAR(50) DEFAULT 'need',
created_at TIMESTAMP NOT NULL DEFAULT NOW (),
CONSTRAINT fk_applications_team FOREIGN KEY (team_id) REFERENCES teams (id) ON DELETE CASCADE
);
-- +goose Down
DROP TABLE IF EXISTS applications;
+139 -120
View File
@@ -3131,6 +3131,8 @@ type Team struct {
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
Status string `protobuf:"bytes,3,opt,name=status,proto3" json:"status,omitempty"` Status string `protobuf:"bytes,3,opt,name=status,proto3" json:"status,omitempty"`
Password string `protobuf:"bytes,4,opt,name=password,proto3" json:"password,omitempty"` Password string `protobuf:"bytes,4,opt,name=password,proto3" json:"password,omitempty"`
ActionsCount int32 `protobuf:"varint,5,opt,name=actions_count,json=actionsCount,proto3" json:"actions_count,omitempty"`
Applications []*Application `protobuf:"bytes,6,rep,name=applications,proto3" json:"applications,omitempty"`
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
} }
@@ -3193,6 +3195,20 @@ func (x *Team) GetPassword() string {
return "" return ""
} }
func (x *Team) GetActionsCount() int32 {
if x != nil {
return x.ActionsCount
}
return 0
}
func (x *Team) GetApplications() []*Application {
if x != nil {
return x.Applications
}
return nil
}
type GetGameReq struct { type GetGameReq struct {
state protoimpl.MessageState `protogen:"open.v1"` state protoimpl.MessageState `protogen:"open.v1"`
Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
@@ -3873,7 +3889,7 @@ func (x *GiveTeamApplicationsRsp) GetError() string {
return "" return ""
} }
type GetTeamActionsReq struct { type GetTeamStoryReq struct {
state protoimpl.MessageState `protogen:"open.v1"` state protoimpl.MessageState `protogen:"open.v1"`
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"`
@@ -3881,20 +3897,20 @@ type GetTeamActionsReq struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
} }
func (x *GetTeamActionsReq) Reset() { func (x *GetTeamStoryReq) Reset() {
*x = GetTeamActionsReq{} *x = GetTeamStoryReq{}
mi := &file_main_proto_msgTypes[76] mi := &file_main_proto_msgTypes[76]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
func (x *GetTeamActionsReq) String() string { func (x *GetTeamStoryReq) String() string {
return protoimpl.X.MessageStringOf(x) return protoimpl.X.MessageStringOf(x)
} }
func (*GetTeamActionsReq) ProtoMessage() {} func (*GetTeamStoryReq) ProtoMessage() {}
func (x *GetTeamActionsReq) ProtoReflect() protoreflect.Message { func (x *GetTeamStoryReq) ProtoReflect() protoreflect.Message {
mi := &file_main_proto_msgTypes[76] mi := &file_main_proto_msgTypes[76]
if x != nil { if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@@ -3906,47 +3922,47 @@ func (x *GetTeamActionsReq) ProtoReflect() protoreflect.Message {
return mi.MessageOf(x) return mi.MessageOf(x)
} }
// Deprecated: Use GetTeamActionsReq.ProtoReflect.Descriptor instead. // Deprecated: Use GetTeamStoryReq.ProtoReflect.Descriptor instead.
func (*GetTeamActionsReq) Descriptor() ([]byte, []int) { func (*GetTeamStoryReq) Descriptor() ([]byte, []int) {
return file_main_proto_rawDescGZIP(), []int{76} return file_main_proto_rawDescGZIP(), []int{76}
} }
func (x *GetTeamActionsReq) GetId() int64 { func (x *GetTeamStoryReq) GetId() int64 {
if x != nil { if x != nil {
return x.Id return x.Id
} }
return 0 return 0
} }
func (x *GetTeamActionsReq) GetPassword() string { func (x *GetTeamStoryReq) GetPassword() string {
if x != nil { if x != nil {
return x.Password return x.Password
} }
return "" return ""
} }
type GetTeamActionsRsp struct { type GetTeamStoryRsp struct {
state protoimpl.MessageState `protogen:"open.v1"` state protoimpl.MessageState `protogen:"open.v1"`
Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"`
Places []*Place `protobuf:"bytes,2,rep,name=places,proto3" json:"places,omitempty"` Story *Story `protobuf:"bytes,2,opt,name=story,proto3" json:"story,omitempty"`
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
} }
func (x *GetTeamActionsRsp) Reset() { func (x *GetTeamStoryRsp) Reset() {
*x = GetTeamActionsRsp{} *x = GetTeamStoryRsp{}
mi := &file_main_proto_msgTypes[77] mi := &file_main_proto_msgTypes[77]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
func (x *GetTeamActionsRsp) String() string { func (x *GetTeamStoryRsp) String() string {
return protoimpl.X.MessageStringOf(x) return protoimpl.X.MessageStringOf(x)
} }
func (*GetTeamActionsRsp) ProtoMessage() {} func (*GetTeamStoryRsp) ProtoMessage() {}
func (x *GetTeamActionsRsp) ProtoReflect() protoreflect.Message { func (x *GetTeamStoryRsp) ProtoReflect() protoreflect.Message {
mi := &file_main_proto_msgTypes[77] mi := &file_main_proto_msgTypes[77]
if x != nil { if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@@ -3958,21 +3974,21 @@ func (x *GetTeamActionsRsp) ProtoReflect() protoreflect.Message {
return mi.MessageOf(x) return mi.MessageOf(x)
} }
// Deprecated: Use GetTeamActionsRsp.ProtoReflect.Descriptor instead. // Deprecated: Use GetTeamStoryRsp.ProtoReflect.Descriptor instead.
func (*GetTeamActionsRsp) Descriptor() ([]byte, []int) { func (*GetTeamStoryRsp) Descriptor() ([]byte, []int) {
return file_main_proto_rawDescGZIP(), []int{77} return file_main_proto_rawDescGZIP(), []int{77}
} }
func (x *GetTeamActionsRsp) GetError() string { func (x *GetTeamStoryRsp) GetError() string {
if x != nil { if x != nil {
return x.Error return x.Error
} }
return "" return ""
} }
func (x *GetTeamActionsRsp) GetPlaces() []*Place { func (x *GetTeamStoryRsp) GetStory() *Story {
if x != nil { if x != nil {
return x.Places return x.Story
} }
return nil return nil
} }
@@ -4360,12 +4376,14 @@ const file_main_proto_rawDesc = "" +
"\bstart_at\x18\x04 \x01(\v2\x1a.google.protobuf.TimestampR\astartAt\x12\x16\n" + "\bstart_at\x18\x04 \x01(\v2\x1a.google.protobuf.TimestampR\astartAt\x12\x16\n" +
"\x06status\x18\x05 \x01(\tR\x06status\x12D\n" + "\x06status\x18\x05 \x01(\tR\x06status\x12D\n" +
"\bscenario\x18\x06 \x01(\v2(.crabs.evening_detective_server.ScenarioR\bscenario\x12:\n" + "\bscenario\x18\x06 \x01(\v2(.crabs.evening_detective_server.ScenarioR\bscenario\x12:\n" +
"\x05teams\x18\a \x03(\v2$.crabs.evening_detective_server.TeamR\x05teams\"^\n" + "\x05teams\x18\a \x03(\v2$.crabs.evening_detective_server.TeamR\x05teams\"\xd4\x01\n" +
"\x04Team\x12\x0e\n" + "\x04Team\x12\x0e\n" +
"\x02id\x18\x01 \x01(\x05R\x02id\x12\x12\n" + "\x02id\x18\x01 \x01(\x05R\x02id\x12\x12\n" +
"\x04name\x18\x02 \x01(\tR\x04name\x12\x16\n" + "\x04name\x18\x02 \x01(\tR\x04name\x12\x16\n" +
"\x06status\x18\x03 \x01(\tR\x06status\x12\x1a\n" + "\x06status\x18\x03 \x01(\tR\x06status\x12\x1a\n" +
"\bpassword\x18\x04 \x01(\tR\bpassword\"\x1c\n" + "\bpassword\x18\x04 \x01(\tR\bpassword\x12#\n" +
"\ractions_count\x18\x05 \x01(\x05R\factionsCount\x12O\n" +
"\fapplications\x18\x06 \x03(\v2+.crabs.evening_detective_server.ApplicationR\fapplications\"\x1c\n" +
"\n" + "\n" +
"GetGameReq\x12\x0e\n" + "GetGameReq\x12\x0e\n" +
"\x02id\x18\x01 \x01(\x05R\x02id\"\\\n" + "\x02id\x18\x01 \x01(\x05R\x02id\"\\\n" +
@@ -4406,13 +4424,13 @@ const file_main_proto_rawDesc = "" +
"\x02id\x18\x01 \x01(\x03R\x02id\x12\x12\n" + "\x02id\x18\x01 \x01(\x03R\x02id\x12\x12\n" +
"\x04name\x18\x02 \x01(\tR\x04name\"/\n" + "\x04name\x18\x02 \x01(\tR\x04name\"/\n" +
"\x17GiveTeamApplicationsRsp\x12\x14\n" + "\x17GiveTeamApplicationsRsp\x12\x14\n" +
"\x05error\x18\x01 \x01(\tR\x05error\"?\n" + "\x05error\x18\x01 \x01(\tR\x05error\"=\n" +
"\x11GetTeamActionsReq\x12\x0e\n" + "\x0fGetTeamStoryReq\x12\x0e\n" +
"\x02id\x18\x01 \x01(\x03R\x02id\x12\x1a\n" + "\x02id\x18\x01 \x01(\x03R\x02id\x12\x1a\n" +
"\bpassword\x18\x02 \x01(\tR\bpassword\"h\n" + "\bpassword\x18\x02 \x01(\tR\bpassword\"d\n" +
"\x11GetTeamActionsRsp\x12\x14\n" + "\x0fGetTeamStoryRsp\x12\x14\n" +
"\x05error\x18\x01 \x01(\tR\x05error\x12=\n" + "\x05error\x18\x01 \x01(\tR\x05error\x12;\n" +
"\x06places\x18\x02 \x03(\v2%.crabs.evening_detective_server.PlaceR\x06places\"R\n" + "\x05story\x18\x02 \x01(\v2%.crabs.evening_detective_server.StoryR\x05story\"R\n" +
"\x10AddTeamActionReq\x12\x0e\n" + "\x10AddTeamActionReq\x12\x0e\n" +
"\x02id\x18\x01 \x01(\x03R\x02id\x12\x1a\n" + "\x02id\x18\x01 \x01(\x03R\x02id\x12\x1a\n" +
"\bpassword\x18\x02 \x01(\tR\bpassword\x12\x12\n" + "\bpassword\x18\x02 \x01(\tR\bpassword\x12\x12\n" +
@@ -4422,7 +4440,7 @@ const file_main_proto_rawDesc = "" +
"\x17DeleteLastTeamActionReq\x12\x0e\n" + "\x17DeleteLastTeamActionReq\x12\x0e\n" +
"\x02id\x18\x01 \x01(\x03R\x02id\"/\n" + "\x02id\x18\x01 \x01(\x03R\x02id\"/\n" +
"\x17DeleteLastTeamActionRsp\x12\x14\n" + "\x17DeleteLastTeamActionRsp\x12\x14\n" +
"\x05error\x18\x01 \x01(\tR\x05error2\x88>\n" + "\x05error\x18\x01 \x01(\tR\x05error2\x80>\n" +
"\x16EveningDetectiveServer\x12\xa6\x01\n" + "\x16EveningDetectiveServer\x12\xa6\x01\n" +
"\x04Ping\x12'.crabs.evening_detective_server.PingReq\x1a'.crabs.evening_detective_server.PingRsp\"L\x92A3\x12)Проверить доступностьb\x06\n" + "\x04Ping\x12'.crabs.evening_detective_server.PingReq\x1a'.crabs.evening_detective_server.PingRsp\"L\x92A3\x12)Проверить доступностьb\x06\n" +
"\x04\n" + "\x04\n" +
@@ -4514,11 +4532,11 @@ const file_main_proto_rawDesc = "" +
"DeleteTeam\x12-.crabs.evening_detective_server.DeleteTeamReq\x1a-.crabs.evening_detective_server.DeleteTeamRsp\"I\x92A/\n" + "DeleteTeam\x12-.crabs.evening_detective_server.DeleteTeamReq\x1a-.crabs.evening_detective_server.DeleteTeamRsp\"I\x92A/\n" +
"\x0eКоманда\x12\x1dУдалить команду\x82\xd3\xe4\x93\x02\x11*\x0f/api/teams/{id}\x12\xdd\x01\n" + "\x0eКоманда\x12\x1dУдалить команду\x82\xd3\xe4\x93\x02\x11*\x0f/api/teams/{id}\x12\xdd\x01\n" +
"\x14GiveTeamApplications\x127.crabs.evening_detective_server.GiveTeamApplicationsReq\x1a7.crabs.evening_detective_server.GiveTeamApplicationsRsp\"S\x92A)\n" + "\x14GiveTeamApplications\x127.crabs.evening_detective_server.GiveTeamApplicationsReq\x1a7.crabs.evening_detective_server.GiveTeamApplicationsRsp\"S\x92A)\n" +
"\x0eКоманда\x12\x17Выдать улику\x82\xd3\xe4\x93\x02!:\x01*\"\x1c/api/teams/{id}/applications\x12\xc7\x01\n" + "\x0eКоманда\x12\x17Выдать улику\x82\xd3\xe4\x93\x02!:\x01*\"\x1c/api/teams/{id}/applications\x12\xbf\x01\n" +
"\x0eGetTeamActions\x121.crabs.evening_detective_server.GetTeamActionsReq\x1a1.crabs.evening_detective_server.GetTeamActionsRsp\"O\x92A-\n" + "\fGetTeamStory\x12/.crabs.evening_detective_server.GetTeamStoryReq\x1a/.crabs.evening_detective_server.GetTeamStoryRsp\"M\x92A-\n" +
"\bХоды\x12\x19Получить ходыb\x06\n" + "\bХоды\x12\x19Получить ходыb\x06\n" +
"\x04\n" + "\x04\n" +
"\x00\x12\x00\x82\xd3\xe4\x93\x02\x19\x12\x17/api/teams/{id}/actions\x12\xc3\x01\n" + "\x00\x12\x00\x82\xd3\xe4\x93\x02\x17\x12\x15/api/teams/{id}/story\x12\xc3\x01\n" +
"\rAddTeamAction\x120.crabs.evening_detective_server.AddTeamActionReq\x1a0.crabs.evening_detective_server.AddTeamActionRsp\"N\x92A)\n" + "\rAddTeamAction\x120.crabs.evening_detective_server.AddTeamActionReq\x1a0.crabs.evening_detective_server.AddTeamActionRsp\"N\x92A)\n" +
"\bХоды\x12\x15Сделать ходb\x06\n" + "\bХоды\x12\x15Сделать ходb\x06\n" +
"\x04\n" + "\x04\n" +
@@ -4625,8 +4643,8 @@ var file_main_proto_goTypes = []any{
(*DeleteTeamRsp)(nil), // 73: crabs.evening_detective_server.DeleteTeamRsp (*DeleteTeamRsp)(nil), // 73: crabs.evening_detective_server.DeleteTeamRsp
(*GiveTeamApplicationsReq)(nil), // 74: crabs.evening_detective_server.GiveTeamApplicationsReq (*GiveTeamApplicationsReq)(nil), // 74: crabs.evening_detective_server.GiveTeamApplicationsReq
(*GiveTeamApplicationsRsp)(nil), // 75: crabs.evening_detective_server.GiveTeamApplicationsRsp (*GiveTeamApplicationsRsp)(nil), // 75: crabs.evening_detective_server.GiveTeamApplicationsRsp
(*GetTeamActionsReq)(nil), // 76: crabs.evening_detective_server.GetTeamActionsReq (*GetTeamStoryReq)(nil), // 76: crabs.evening_detective_server.GetTeamStoryReq
(*GetTeamActionsRsp)(nil), // 77: crabs.evening_detective_server.GetTeamActionsRsp (*GetTeamStoryRsp)(nil), // 77: crabs.evening_detective_server.GetTeamStoryRsp
(*AddTeamActionReq)(nil), // 78: crabs.evening_detective_server.AddTeamActionReq (*AddTeamActionReq)(nil), // 78: crabs.evening_detective_server.AddTeamActionReq
(*AddTeamActionRsp)(nil), // 79: crabs.evening_detective_server.AddTeamActionRsp (*AddTeamActionRsp)(nil), // 79: crabs.evening_detective_server.AddTeamActionRsp
(*DeleteLastTeamActionReq)(nil), // 80: crabs.evening_detective_server.DeleteLastTeamActionReq (*DeleteLastTeamActionReq)(nil), // 80: crabs.evening_detective_server.DeleteLastTeamActionReq
@@ -4659,90 +4677,91 @@ var file_main_proto_depIdxs = []int32{
82, // 21: crabs.evening_detective_server.Game.start_at:type_name -> google.protobuf.Timestamp 82, // 21: crabs.evening_detective_server.Game.start_at:type_name -> google.protobuf.Timestamp
36, // 22: crabs.evening_detective_server.Game.scenario:type_name -> crabs.evening_detective_server.Scenario 36, // 22: crabs.evening_detective_server.Game.scenario:type_name -> crabs.evening_detective_server.Scenario
61, // 23: crabs.evening_detective_server.Game.teams:type_name -> crabs.evening_detective_server.Team 61, // 23: crabs.evening_detective_server.Game.teams:type_name -> crabs.evening_detective_server.Team
60, // 24: crabs.evening_detective_server.GetGameRsp.game:type_name -> crabs.evening_detective_server.Game 39, // 24: crabs.evening_detective_server.Team.applications:type_name -> crabs.evening_detective_server.Application
82, // 25: crabs.evening_detective_server.UpdateGameReq.start_at:type_name -> google.protobuf.Timestamp 60, // 25: crabs.evening_detective_server.GetGameRsp.game:type_name -> crabs.evening_detective_server.Game
38, // 26: crabs.evening_detective_server.GetTeamActionsRsp.places:type_name -> crabs.evening_detective_server.Place 82, // 26: crabs.evening_detective_server.UpdateGameReq.start_at:type_name -> google.protobuf.Timestamp
0, // 27: crabs.evening_detective_server.EveningDetectiveServer.Ping:input_type -> crabs.evening_detective_server.PingReq 37, // 27: crabs.evening_detective_server.GetTeamStoryRsp.story:type_name -> crabs.evening_detective_server.Story
2, // 28: crabs.evening_detective_server.EveningDetectiveServer.Echo:input_type -> crabs.evening_detective_server.EchoReq 0, // 28: crabs.evening_detective_server.EveningDetectiveServer.Ping:input_type -> crabs.evening_detective_server.PingReq
4, // 29: crabs.evening_detective_server.EveningDetectiveServer.Signup:input_type -> crabs.evening_detective_server.SignupReq 2, // 29: crabs.evening_detective_server.EveningDetectiveServer.Echo:input_type -> crabs.evening_detective_server.EchoReq
6, // 30: crabs.evening_detective_server.EveningDetectiveServer.RefreshPassword:input_type -> crabs.evening_detective_server.RefreshPasswordReq 4, // 30: crabs.evening_detective_server.EveningDetectiveServer.Signup:input_type -> crabs.evening_detective_server.SignupReq
8, // 31: crabs.evening_detective_server.EveningDetectiveServer.Login:input_type -> crabs.evening_detective_server.LoginReq 6, // 31: crabs.evening_detective_server.EveningDetectiveServer.RefreshPassword:input_type -> crabs.evening_detective_server.RefreshPasswordReq
10, // 32: crabs.evening_detective_server.EveningDetectiveServer.Refresh:input_type -> crabs.evening_detective_server.RefreshReq 8, // 32: crabs.evening_detective_server.EveningDetectiveServer.Login:input_type -> crabs.evening_detective_server.LoginReq
12, // 33: crabs.evening_detective_server.EveningDetectiveServer.GetUsers:input_type -> crabs.evening_detective_server.GetUsersReq 10, // 33: crabs.evening_detective_server.EveningDetectiveServer.Refresh:input_type -> crabs.evening_detective_server.RefreshReq
15, // 34: crabs.evening_detective_server.EveningDetectiveServer.GetUserById:input_type -> crabs.evening_detective_server.GetUserByIdReq 12, // 34: crabs.evening_detective_server.EveningDetectiveServer.GetUsers:input_type -> crabs.evening_detective_server.GetUsersReq
17, // 35: crabs.evening_detective_server.EveningDetectiveServer.GetMe:input_type -> crabs.evening_detective_server.GetMeReq 15, // 35: crabs.evening_detective_server.EveningDetectiveServer.GetUserById:input_type -> crabs.evening_detective_server.GetUserByIdReq
19, // 36: crabs.evening_detective_server.EveningDetectiveServer.AddUserRole:input_type -> crabs.evening_detective_server.AddUserRoleReq 17, // 36: crabs.evening_detective_server.EveningDetectiveServer.GetMe:input_type -> crabs.evening_detective_server.GetMeReq
21, // 37: crabs.evening_detective_server.EveningDetectiveServer.DeleteUserRole:input_type -> crabs.evening_detective_server.DeleteUserRoleReq 19, // 37: crabs.evening_detective_server.EveningDetectiveServer.AddUserRole:input_type -> crabs.evening_detective_server.AddUserRoleReq
23, // 38: crabs.evening_detective_server.EveningDetectiveServer.GetPermissions:input_type -> crabs.evening_detective_server.GetPermissionsReq 21, // 38: crabs.evening_detective_server.EveningDetectiveServer.DeleteUserRole:input_type -> crabs.evening_detective_server.DeleteUserRoleReq
25, // 39: crabs.evening_detective_server.EveningDetectiveServer.UploadFile:input_type -> crabs.evening_detective_server.UploadFileReq 23, // 39: crabs.evening_detective_server.EveningDetectiveServer.GetPermissions:input_type -> crabs.evening_detective_server.GetPermissionsReq
27, // 40: crabs.evening_detective_server.EveningDetectiveServer.DownloadFile:input_type -> crabs.evening_detective_server.DownloadFileReq 25, // 40: crabs.evening_detective_server.EveningDetectiveServer.UploadFile:input_type -> crabs.evening_detective_server.UploadFileReq
28, // 41: crabs.evening_detective_server.EveningDetectiveServer.AddScenario:input_type -> crabs.evening_detective_server.AddScenarioReq 27, // 41: crabs.evening_detective_server.EveningDetectiveServer.DownloadFile:input_type -> crabs.evening_detective_server.DownloadFileReq
30, // 42: crabs.evening_detective_server.EveningDetectiveServer.GetMyScenarios:input_type -> crabs.evening_detective_server.GetMyScenariosReq 28, // 42: crabs.evening_detective_server.EveningDetectiveServer.AddScenario:input_type -> crabs.evening_detective_server.AddScenarioReq
32, // 43: crabs.evening_detective_server.EveningDetectiveServer.GetScenariosCatalog:input_type -> crabs.evening_detective_server.GetScenariosCatalogReq 30, // 43: crabs.evening_detective_server.EveningDetectiveServer.GetMyScenarios:input_type -> crabs.evening_detective_server.GetMyScenariosReq
34, // 44: crabs.evening_detective_server.EveningDetectiveServer.GetFullScenario:input_type -> crabs.evening_detective_server.GetScenarioReq 32, // 44: crabs.evening_detective_server.EveningDetectiveServer.GetScenariosCatalog:input_type -> crabs.evening_detective_server.GetScenariosCatalogReq
34, // 45: crabs.evening_detective_server.EveningDetectiveServer.GetScenario:input_type -> crabs.evening_detective_server.GetScenarioReq 34, // 45: crabs.evening_detective_server.EveningDetectiveServer.GetFullScenario:input_type -> crabs.evening_detective_server.GetScenarioReq
42, // 46: crabs.evening_detective_server.EveningDetectiveServer.UpdateScenario:input_type -> crabs.evening_detective_server.UpdateScenarioReq 34, // 46: crabs.evening_detective_server.EveningDetectiveServer.GetScenario:input_type -> crabs.evening_detective_server.GetScenarioReq
44, // 47: crabs.evening_detective_server.EveningDetectiveServer.PublicScenario:input_type -> crabs.evening_detective_server.PublicScenarioReq 42, // 47: crabs.evening_detective_server.EveningDetectiveServer.UpdateScenario:input_type -> crabs.evening_detective_server.UpdateScenarioReq
46, // 48: crabs.evening_detective_server.EveningDetectiveServer.DraftScenario:input_type -> crabs.evening_detective_server.DraftScenarioReq 44, // 48: crabs.evening_detective_server.EveningDetectiveServer.PublicScenario:input_type -> crabs.evening_detective_server.PublicScenarioReq
48, // 49: crabs.evening_detective_server.EveningDetectiveServer.DeleteScenario:input_type -> crabs.evening_detective_server.DeleteScenarioReq 46, // 49: crabs.evening_detective_server.EveningDetectiveServer.DraftScenario:input_type -> crabs.evening_detective_server.DraftScenarioReq
50, // 50: crabs.evening_detective_server.EveningDetectiveServer.AddScenarioPlace:input_type -> crabs.evening_detective_server.AddScenarioPlaceReq 48, // 50: crabs.evening_detective_server.EveningDetectiveServer.DeleteScenario:input_type -> crabs.evening_detective_server.DeleteScenarioReq
52, // 51: crabs.evening_detective_server.EveningDetectiveServer.UpdateScenarioPlace:input_type -> crabs.evening_detective_server.UpdateScenarioPlaceReq 50, // 51: crabs.evening_detective_server.EveningDetectiveServer.AddScenarioPlace:input_type -> crabs.evening_detective_server.AddScenarioPlaceReq
54, // 52: crabs.evening_detective_server.EveningDetectiveServer.DeleteScenarioPlace:input_type -> crabs.evening_detective_server.DeleteScenarioPlaceReq 52, // 52: crabs.evening_detective_server.EveningDetectiveServer.UpdateScenarioPlace:input_type -> crabs.evening_detective_server.UpdateScenarioPlaceReq
56, // 53: crabs.evening_detective_server.EveningDetectiveServer.AddGame:input_type -> crabs.evening_detective_server.AddGameReq 54, // 53: crabs.evening_detective_server.EveningDetectiveServer.DeleteScenarioPlace:input_type -> crabs.evening_detective_server.DeleteScenarioPlaceReq
58, // 54: crabs.evening_detective_server.EveningDetectiveServer.GetGames:input_type -> crabs.evening_detective_server.GetGamesReq 56, // 54: crabs.evening_detective_server.EveningDetectiveServer.AddGame:input_type -> crabs.evening_detective_server.AddGameReq
62, // 55: crabs.evening_detective_server.EveningDetectiveServer.GetGame:input_type -> crabs.evening_detective_server.GetGameReq 58, // 55: crabs.evening_detective_server.EveningDetectiveServer.GetGames:input_type -> crabs.evening_detective_server.GetGamesReq
64, // 56: crabs.evening_detective_server.EveningDetectiveServer.UpdateGame:input_type -> crabs.evening_detective_server.UpdateGameReq 62, // 56: crabs.evening_detective_server.EveningDetectiveServer.GetGame:input_type -> crabs.evening_detective_server.GetGameReq
66, // 57: crabs.evening_detective_server.EveningDetectiveServer.DeleteGame:input_type -> crabs.evening_detective_server.DeleteGameReq 64, // 57: crabs.evening_detective_server.EveningDetectiveServer.UpdateGame:input_type -> crabs.evening_detective_server.UpdateGameReq
68, // 58: crabs.evening_detective_server.EveningDetectiveServer.AddTeam:input_type -> crabs.evening_detective_server.AddTeamReq 66, // 58: crabs.evening_detective_server.EveningDetectiveServer.DeleteGame:input_type -> crabs.evening_detective_server.DeleteGameReq
70, // 59: crabs.evening_detective_server.EveningDetectiveServer.UpdateTeam:input_type -> crabs.evening_detective_server.UpdateTeamReq 68, // 59: crabs.evening_detective_server.EveningDetectiveServer.AddTeam:input_type -> crabs.evening_detective_server.AddTeamReq
72, // 60: crabs.evening_detective_server.EveningDetectiveServer.DeleteTeam:input_type -> crabs.evening_detective_server.DeleteTeamReq 70, // 60: crabs.evening_detective_server.EveningDetectiveServer.UpdateTeam:input_type -> crabs.evening_detective_server.UpdateTeamReq
74, // 61: crabs.evening_detective_server.EveningDetectiveServer.GiveTeamApplications:input_type -> crabs.evening_detective_server.GiveTeamApplicationsReq 72, // 61: crabs.evening_detective_server.EveningDetectiveServer.DeleteTeam:input_type -> crabs.evening_detective_server.DeleteTeamReq
76, // 62: crabs.evening_detective_server.EveningDetectiveServer.GetTeamActions:input_type -> crabs.evening_detective_server.GetTeamActionsReq 74, // 62: crabs.evening_detective_server.EveningDetectiveServer.GiveTeamApplications:input_type -> crabs.evening_detective_server.GiveTeamApplicationsReq
78, // 63: crabs.evening_detective_server.EveningDetectiveServer.AddTeamAction:input_type -> crabs.evening_detective_server.AddTeamActionReq 76, // 63: crabs.evening_detective_server.EveningDetectiveServer.GetTeamStory:input_type -> crabs.evening_detective_server.GetTeamStoryReq
80, // 64: crabs.evening_detective_server.EveningDetectiveServer.DeleteLastTeamAction:input_type -> crabs.evening_detective_server.DeleteLastTeamActionReq 78, // 64: crabs.evening_detective_server.EveningDetectiveServer.AddTeamAction:input_type -> crabs.evening_detective_server.AddTeamActionReq
1, // 65: crabs.evening_detective_server.EveningDetectiveServer.Ping:output_type -> crabs.evening_detective_server.PingRsp 80, // 65: crabs.evening_detective_server.EveningDetectiveServer.DeleteLastTeamAction:input_type -> crabs.evening_detective_server.DeleteLastTeamActionReq
3, // 66: crabs.evening_detective_server.EveningDetectiveServer.Echo:output_type -> crabs.evening_detective_server.EchoRsp 1, // 66: crabs.evening_detective_server.EveningDetectiveServer.Ping:output_type -> crabs.evening_detective_server.PingRsp
5, // 67: crabs.evening_detective_server.EveningDetectiveServer.Signup:output_type -> crabs.evening_detective_server.SignupRsp 3, // 67: crabs.evening_detective_server.EveningDetectiveServer.Echo:output_type -> crabs.evening_detective_server.EchoRsp
7, // 68: crabs.evening_detective_server.EveningDetectiveServer.RefreshPassword:output_type -> crabs.evening_detective_server.RefreshPasswordRsp 5, // 68: crabs.evening_detective_server.EveningDetectiveServer.Signup:output_type -> crabs.evening_detective_server.SignupRsp
9, // 69: crabs.evening_detective_server.EveningDetectiveServer.Login:output_type -> crabs.evening_detective_server.LoginRsp 7, // 69: crabs.evening_detective_server.EveningDetectiveServer.RefreshPassword:output_type -> crabs.evening_detective_server.RefreshPasswordRsp
11, // 70: crabs.evening_detective_server.EveningDetectiveServer.Refresh:output_type -> crabs.evening_detective_server.RefreshRsp 9, // 70: crabs.evening_detective_server.EveningDetectiveServer.Login:output_type -> crabs.evening_detective_server.LoginRsp
13, // 71: crabs.evening_detective_server.EveningDetectiveServer.GetUsers:output_type -> crabs.evening_detective_server.GetUsersRsp 11, // 71: crabs.evening_detective_server.EveningDetectiveServer.Refresh:output_type -> crabs.evening_detective_server.RefreshRsp
16, // 72: crabs.evening_detective_server.EveningDetectiveServer.GetUserById:output_type -> crabs.evening_detective_server.GetUserByIdRsp 13, // 72: crabs.evening_detective_server.EveningDetectiveServer.GetUsers:output_type -> crabs.evening_detective_server.GetUsersRsp
18, // 73: crabs.evening_detective_server.EveningDetectiveServer.GetMe:output_type -> crabs.evening_detective_server.GetMeRsp 16, // 73: crabs.evening_detective_server.EveningDetectiveServer.GetUserById:output_type -> crabs.evening_detective_server.GetUserByIdRsp
20, // 74: crabs.evening_detective_server.EveningDetectiveServer.AddUserRole:output_type -> crabs.evening_detective_server.AddUserRoleRsp 18, // 74: crabs.evening_detective_server.EveningDetectiveServer.GetMe:output_type -> crabs.evening_detective_server.GetMeRsp
22, // 75: crabs.evening_detective_server.EveningDetectiveServer.DeleteUserRole:output_type -> crabs.evening_detective_server.DeleteUserRoleRsp 20, // 75: crabs.evening_detective_server.EveningDetectiveServer.AddUserRole:output_type -> crabs.evening_detective_server.AddUserRoleRsp
24, // 76: crabs.evening_detective_server.EveningDetectiveServer.GetPermissions:output_type -> crabs.evening_detective_server.GetPermissionsRsp 22, // 76: crabs.evening_detective_server.EveningDetectiveServer.DeleteUserRole:output_type -> crabs.evening_detective_server.DeleteUserRoleRsp
26, // 77: crabs.evening_detective_server.EveningDetectiveServer.UploadFile:output_type -> crabs.evening_detective_server.UploadFileRsp 24, // 77: crabs.evening_detective_server.EveningDetectiveServer.GetPermissions:output_type -> crabs.evening_detective_server.GetPermissionsRsp
83, // 78: crabs.evening_detective_server.EveningDetectiveServer.DownloadFile:output_type -> google.api.HttpBody 26, // 78: crabs.evening_detective_server.EveningDetectiveServer.UploadFile:output_type -> crabs.evening_detective_server.UploadFileRsp
29, // 79: crabs.evening_detective_server.EveningDetectiveServer.AddScenario:output_type -> crabs.evening_detective_server.AddScenarioRsp 83, // 79: crabs.evening_detective_server.EveningDetectiveServer.DownloadFile:output_type -> google.api.HttpBody
31, // 80: crabs.evening_detective_server.EveningDetectiveServer.GetMyScenarios:output_type -> crabs.evening_detective_server.GetMyScenariosRsp 29, // 80: crabs.evening_detective_server.EveningDetectiveServer.AddScenario:output_type -> crabs.evening_detective_server.AddScenarioRsp
33, // 81: crabs.evening_detective_server.EveningDetectiveServer.GetScenariosCatalog:output_type -> crabs.evening_detective_server.GetScenariosCatalogRsp 31, // 81: crabs.evening_detective_server.EveningDetectiveServer.GetMyScenarios:output_type -> crabs.evening_detective_server.GetMyScenariosRsp
35, // 82: crabs.evening_detective_server.EveningDetectiveServer.GetFullScenario:output_type -> crabs.evening_detective_server.GetScenarioRsp 33, // 82: crabs.evening_detective_server.EveningDetectiveServer.GetScenariosCatalog:output_type -> crabs.evening_detective_server.GetScenariosCatalogRsp
35, // 83: crabs.evening_detective_server.EveningDetectiveServer.GetScenario:output_type -> crabs.evening_detective_server.GetScenarioRsp 35, // 83: crabs.evening_detective_server.EveningDetectiveServer.GetFullScenario:output_type -> crabs.evening_detective_server.GetScenarioRsp
43, // 84: crabs.evening_detective_server.EveningDetectiveServer.UpdateScenario:output_type -> crabs.evening_detective_server.UpdateScenarioRsp 35, // 84: crabs.evening_detective_server.EveningDetectiveServer.GetScenario:output_type -> crabs.evening_detective_server.GetScenarioRsp
45, // 85: crabs.evening_detective_server.EveningDetectiveServer.PublicScenario:output_type -> crabs.evening_detective_server.PublicScenarioRsp 43, // 85: crabs.evening_detective_server.EveningDetectiveServer.UpdateScenario:output_type -> crabs.evening_detective_server.UpdateScenarioRsp
47, // 86: crabs.evening_detective_server.EveningDetectiveServer.DraftScenario:output_type -> crabs.evening_detective_server.DraftScenarioRsp 45, // 86: crabs.evening_detective_server.EveningDetectiveServer.PublicScenario:output_type -> crabs.evening_detective_server.PublicScenarioRsp
49, // 87: crabs.evening_detective_server.EveningDetectiveServer.DeleteScenario:output_type -> crabs.evening_detective_server.DeleteScenarioRsp 47, // 87: crabs.evening_detective_server.EveningDetectiveServer.DraftScenario:output_type -> crabs.evening_detective_server.DraftScenarioRsp
51, // 88: crabs.evening_detective_server.EveningDetectiveServer.AddScenarioPlace:output_type -> crabs.evening_detective_server.AddScenarioPlaceRsp 49, // 88: crabs.evening_detective_server.EveningDetectiveServer.DeleteScenario:output_type -> crabs.evening_detective_server.DeleteScenarioRsp
53, // 89: crabs.evening_detective_server.EveningDetectiveServer.UpdateScenarioPlace:output_type -> crabs.evening_detective_server.UpdateScenarioPlaceRsp 51, // 89: crabs.evening_detective_server.EveningDetectiveServer.AddScenarioPlace:output_type -> crabs.evening_detective_server.AddScenarioPlaceRsp
55, // 90: crabs.evening_detective_server.EveningDetectiveServer.DeleteScenarioPlace:output_type -> crabs.evening_detective_server.DeleteScenarioPlaceRsp 53, // 90: crabs.evening_detective_server.EveningDetectiveServer.UpdateScenarioPlace:output_type -> crabs.evening_detective_server.UpdateScenarioPlaceRsp
57, // 91: crabs.evening_detective_server.EveningDetectiveServer.AddGame:output_type -> crabs.evening_detective_server.AddGameRsp 55, // 91: crabs.evening_detective_server.EveningDetectiveServer.DeleteScenarioPlace:output_type -> crabs.evening_detective_server.DeleteScenarioPlaceRsp
59, // 92: crabs.evening_detective_server.EveningDetectiveServer.GetGames:output_type -> crabs.evening_detective_server.GetGamesRsp 57, // 92: crabs.evening_detective_server.EveningDetectiveServer.AddGame:output_type -> crabs.evening_detective_server.AddGameRsp
63, // 93: crabs.evening_detective_server.EveningDetectiveServer.GetGame:output_type -> crabs.evening_detective_server.GetGameRsp 59, // 93: crabs.evening_detective_server.EveningDetectiveServer.GetGames:output_type -> crabs.evening_detective_server.GetGamesRsp
65, // 94: crabs.evening_detective_server.EveningDetectiveServer.UpdateGame:output_type -> crabs.evening_detective_server.UpdateGameRsp 63, // 94: crabs.evening_detective_server.EveningDetectiveServer.GetGame:output_type -> crabs.evening_detective_server.GetGameRsp
67, // 95: crabs.evening_detective_server.EveningDetectiveServer.DeleteGame:output_type -> crabs.evening_detective_server.DeleteGameRsp 65, // 95: crabs.evening_detective_server.EveningDetectiveServer.UpdateGame:output_type -> crabs.evening_detective_server.UpdateGameRsp
69, // 96: crabs.evening_detective_server.EveningDetectiveServer.AddTeam:output_type -> crabs.evening_detective_server.AddTeamRsp 67, // 96: crabs.evening_detective_server.EveningDetectiveServer.DeleteGame:output_type -> crabs.evening_detective_server.DeleteGameRsp
71, // 97: crabs.evening_detective_server.EveningDetectiveServer.UpdateTeam:output_type -> crabs.evening_detective_server.UpdateTeamRsp 69, // 97: crabs.evening_detective_server.EveningDetectiveServer.AddTeam:output_type -> crabs.evening_detective_server.AddTeamRsp
73, // 98: crabs.evening_detective_server.EveningDetectiveServer.DeleteTeam:output_type -> crabs.evening_detective_server.DeleteTeamRsp 71, // 98: crabs.evening_detective_server.EveningDetectiveServer.UpdateTeam:output_type -> crabs.evening_detective_server.UpdateTeamRsp
75, // 99: crabs.evening_detective_server.EveningDetectiveServer.GiveTeamApplications:output_type -> crabs.evening_detective_server.GiveTeamApplicationsRsp 73, // 99: crabs.evening_detective_server.EveningDetectiveServer.DeleteTeam:output_type -> crabs.evening_detective_server.DeleteTeamRsp
77, // 100: crabs.evening_detective_server.EveningDetectiveServer.GetTeamActions:output_type -> crabs.evening_detective_server.GetTeamActionsRsp 75, // 100: crabs.evening_detective_server.EveningDetectiveServer.GiveTeamApplications:output_type -> crabs.evening_detective_server.GiveTeamApplicationsRsp
79, // 101: crabs.evening_detective_server.EveningDetectiveServer.AddTeamAction:output_type -> crabs.evening_detective_server.AddTeamActionRsp 77, // 101: crabs.evening_detective_server.EveningDetectiveServer.GetTeamStory:output_type -> crabs.evening_detective_server.GetTeamStoryRsp
81, // 102: crabs.evening_detective_server.EveningDetectiveServer.DeleteLastTeamAction:output_type -> crabs.evening_detective_server.DeleteLastTeamActionRsp 79, // 102: crabs.evening_detective_server.EveningDetectiveServer.AddTeamAction:output_type -> crabs.evening_detective_server.AddTeamActionRsp
65, // [65:103] is the sub-list for method output_type 81, // 103: crabs.evening_detective_server.EveningDetectiveServer.DeleteLastTeamAction:output_type -> crabs.evening_detective_server.DeleteLastTeamActionRsp
27, // [27:65] is the sub-list for method input_type 66, // [66:104] is the sub-list for method output_type
27, // [27:27] is the sub-list for extension type_name 28, // [28:66] is the sub-list for method input_type
27, // [27:27] is the sub-list for extension extendee 28, // [28:28] is the sub-list for extension type_name
0, // [0:27] is the sub-list for field type_name 28, // [28:28] is the sub-list for extension extendee
0, // [0:28] is the sub-list for field type_name
} }
func init() { file_main_proto_init() } func init() { file_main_proto_init() }
+19 -19
View File
@@ -1266,11 +1266,11 @@ func local_request_EveningDetectiveServer_GiveTeamApplications_0(ctx context.Con
return msg, metadata, err return msg, metadata, err
} }
var filter_EveningDetectiveServer_GetTeamActions_0 = &utilities.DoubleArray{Encoding: map[string]int{"id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} var filter_EveningDetectiveServer_GetTeamStory_0 = &utilities.DoubleArray{Encoding: map[string]int{"id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}}
func request_EveningDetectiveServer_GetTeamActions_0(ctx context.Context, marshaler runtime.Marshaler, client EveningDetectiveServerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { func request_EveningDetectiveServer_GetTeamStory_0(ctx context.Context, marshaler runtime.Marshaler, client EveningDetectiveServerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var ( var (
protoReq GetTeamActionsReq protoReq GetTeamStoryReq
metadata runtime.ServerMetadata metadata runtime.ServerMetadata
err error err error
) )
@@ -1288,16 +1288,16 @@ func request_EveningDetectiveServer_GetTeamActions_0(ctx context.Context, marsha
if err := req.ParseForm(); err != nil { if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
} }
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_EveningDetectiveServer_GetTeamActions_0); err != nil { if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_EveningDetectiveServer_GetTeamStory_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
} }
msg, err := client.GetTeamActions(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) msg, err := client.GetTeamStory(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err return msg, metadata, err
} }
func local_request_EveningDetectiveServer_GetTeamActions_0(ctx context.Context, marshaler runtime.Marshaler, server EveningDetectiveServerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { func local_request_EveningDetectiveServer_GetTeamStory_0(ctx context.Context, marshaler runtime.Marshaler, server EveningDetectiveServerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var ( var (
protoReq GetTeamActionsReq protoReq GetTeamStoryReq
metadata runtime.ServerMetadata metadata runtime.ServerMetadata
err error err error
) )
@@ -1312,10 +1312,10 @@ func local_request_EveningDetectiveServer_GetTeamActions_0(ctx context.Context,
if err := req.ParseForm(); err != nil { if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
} }
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_EveningDetectiveServer_GetTeamActions_0); err != nil { if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_EveningDetectiveServer_GetTeamStory_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
} }
msg, err := server.GetTeamActions(ctx, &protoReq) msg, err := server.GetTeamStory(ctx, &protoReq)
return msg, metadata, err return msg, metadata, err
} }
@@ -2109,25 +2109,25 @@ func RegisterEveningDetectiveServerHandlerServer(ctx context.Context, mux *runti
} }
forward_EveningDetectiveServer_GiveTeamApplications_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) forward_EveningDetectiveServer_GiveTeamApplications_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
}) })
mux.Handle(http.MethodGet, pattern_EveningDetectiveServer_GetTeamActions_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { mux.Handle(http.MethodGet, pattern_EveningDetectiveServer_GetTeamStory_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context()) ctx, cancel := context.WithCancel(req.Context())
defer cancel() defer cancel()
var stream runtime.ServerTransportStream var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/crabs.evening_detective_server.EveningDetectiveServer/GetTeamActions", runtime.WithHTTPPathPattern("/api/teams/{id}/actions")) annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/crabs.evening_detective_server.EveningDetectiveServer/GetTeamStory", runtime.WithHTTPPathPattern("/api/teams/{id}/story"))
if err != nil { if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return return
} }
resp, md, err := local_request_EveningDetectiveServer_GetTeamActions_0(annotatedContext, inboundMarshaler, server, req, pathParams) resp, md, err := local_request_EveningDetectiveServer_GetTeamStory_0(annotatedContext, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil { if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return return
} }
forward_EveningDetectiveServer_GetTeamActions_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) forward_EveningDetectiveServer_GetTeamStory_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
}) })
mux.Handle(http.MethodPost, pattern_EveningDetectiveServer_AddTeamAction_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { mux.Handle(http.MethodPost, pattern_EveningDetectiveServer_AddTeamAction_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context()) ctx, cancel := context.WithCancel(req.Context())
@@ -2804,22 +2804,22 @@ func RegisterEveningDetectiveServerHandlerClient(ctx context.Context, mux *runti
} }
forward_EveningDetectiveServer_GiveTeamApplications_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) forward_EveningDetectiveServer_GiveTeamApplications_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
}) })
mux.Handle(http.MethodGet, pattern_EveningDetectiveServer_GetTeamActions_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { mux.Handle(http.MethodGet, pattern_EveningDetectiveServer_GetTeamStory_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context()) ctx, cancel := context.WithCancel(req.Context())
defer cancel() defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/crabs.evening_detective_server.EveningDetectiveServer/GetTeamActions", runtime.WithHTTPPathPattern("/api/teams/{id}/actions")) annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/crabs.evening_detective_server.EveningDetectiveServer/GetTeamStory", runtime.WithHTTPPathPattern("/api/teams/{id}/story"))
if err != nil { if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return return
} }
resp, md, err := request_EveningDetectiveServer_GetTeamActions_0(annotatedContext, inboundMarshaler, client, req, pathParams) resp, md, err := request_EveningDetectiveServer_GetTeamStory_0(annotatedContext, inboundMarshaler, client, req, pathParams)
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil { if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return return
} }
forward_EveningDetectiveServer_GetTeamActions_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) forward_EveningDetectiveServer_GetTeamStory_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
}) })
mux.Handle(http.MethodPost, pattern_EveningDetectiveServer_AddTeamAction_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { mux.Handle(http.MethodPost, pattern_EveningDetectiveServer_AddTeamAction_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context()) ctx, cancel := context.WithCancel(req.Context())
@@ -2894,7 +2894,7 @@ var (
pattern_EveningDetectiveServer_UpdateTeam_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"api", "teams", "id"}, "")) pattern_EveningDetectiveServer_UpdateTeam_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"api", "teams", "id"}, ""))
pattern_EveningDetectiveServer_DeleteTeam_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"api", "teams", "id"}, "")) pattern_EveningDetectiveServer_DeleteTeam_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"api", "teams", "id"}, ""))
pattern_EveningDetectiveServer_GiveTeamApplications_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3}, []string{"api", "teams", "id", "applications"}, "")) pattern_EveningDetectiveServer_GiveTeamApplications_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3}, []string{"api", "teams", "id", "applications"}, ""))
pattern_EveningDetectiveServer_GetTeamActions_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3}, []string{"api", "teams", "id", "actions"}, "")) pattern_EveningDetectiveServer_GetTeamStory_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3}, []string{"api", "teams", "id", "story"}, ""))
pattern_EveningDetectiveServer_AddTeamAction_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3}, []string{"api", "teams", "id", "actions"}, "")) pattern_EveningDetectiveServer_AddTeamAction_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3}, []string{"api", "teams", "id", "actions"}, ""))
pattern_EveningDetectiveServer_DeleteLastTeamAction_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3}, []string{"api", "teams", "id", "last-actions"}, "")) pattern_EveningDetectiveServer_DeleteLastTeamAction_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3}, []string{"api", "teams", "id", "last-actions"}, ""))
) )
@@ -2935,7 +2935,7 @@ var (
forward_EveningDetectiveServer_UpdateTeam_0 = runtime.ForwardResponseMessage forward_EveningDetectiveServer_UpdateTeam_0 = runtime.ForwardResponseMessage
forward_EveningDetectiveServer_DeleteTeam_0 = runtime.ForwardResponseMessage forward_EveningDetectiveServer_DeleteTeam_0 = runtime.ForwardResponseMessage
forward_EveningDetectiveServer_GiveTeamApplications_0 = runtime.ForwardResponseMessage forward_EveningDetectiveServer_GiveTeamApplications_0 = runtime.ForwardResponseMessage
forward_EveningDetectiveServer_GetTeamActions_0 = runtime.ForwardResponseMessage forward_EveningDetectiveServer_GetTeamStory_0 = runtime.ForwardResponseMessage
forward_EveningDetectiveServer_AddTeamAction_0 = runtime.ForwardResponseMessage forward_EveningDetectiveServer_AddTeamAction_0 = runtime.ForwardResponseMessage
forward_EveningDetectiveServer_DeleteLastTeamAction_0 = runtime.ForwardResponseMessage forward_EveningDetectiveServer_DeleteLastTeamAction_0 = runtime.ForwardResponseMessage
) )
+15 -15
View File
@@ -55,7 +55,7 @@ const (
EveningDetectiveServer_UpdateTeam_FullMethodName = "/crabs.evening_detective_server.EveningDetectiveServer/UpdateTeam" EveningDetectiveServer_UpdateTeam_FullMethodName = "/crabs.evening_detective_server.EveningDetectiveServer/UpdateTeam"
EveningDetectiveServer_DeleteTeam_FullMethodName = "/crabs.evening_detective_server.EveningDetectiveServer/DeleteTeam" EveningDetectiveServer_DeleteTeam_FullMethodName = "/crabs.evening_detective_server.EveningDetectiveServer/DeleteTeam"
EveningDetectiveServer_GiveTeamApplications_FullMethodName = "/crabs.evening_detective_server.EveningDetectiveServer/GiveTeamApplications" EveningDetectiveServer_GiveTeamApplications_FullMethodName = "/crabs.evening_detective_server.EveningDetectiveServer/GiveTeamApplications"
EveningDetectiveServer_GetTeamActions_FullMethodName = "/crabs.evening_detective_server.EveningDetectiveServer/GetTeamActions" EveningDetectiveServer_GetTeamStory_FullMethodName = "/crabs.evening_detective_server.EveningDetectiveServer/GetTeamStory"
EveningDetectiveServer_AddTeamAction_FullMethodName = "/crabs.evening_detective_server.EveningDetectiveServer/AddTeamAction" EveningDetectiveServer_AddTeamAction_FullMethodName = "/crabs.evening_detective_server.EveningDetectiveServer/AddTeamAction"
EveningDetectiveServer_DeleteLastTeamAction_FullMethodName = "/crabs.evening_detective_server.EveningDetectiveServer/DeleteLastTeamAction" EveningDetectiveServer_DeleteLastTeamAction_FullMethodName = "/crabs.evening_detective_server.EveningDetectiveServer/DeleteLastTeamAction"
) )
@@ -99,7 +99,7 @@ type EveningDetectiveServerClient interface {
UpdateTeam(ctx context.Context, in *UpdateTeamReq, opts ...grpc.CallOption) (*UpdateTeamRsp, error) UpdateTeam(ctx context.Context, in *UpdateTeamReq, opts ...grpc.CallOption) (*UpdateTeamRsp, error)
DeleteTeam(ctx context.Context, in *DeleteTeamReq, opts ...grpc.CallOption) (*DeleteTeamRsp, error) DeleteTeam(ctx context.Context, in *DeleteTeamReq, opts ...grpc.CallOption) (*DeleteTeamRsp, error)
GiveTeamApplications(ctx context.Context, in *GiveTeamApplicationsReq, opts ...grpc.CallOption) (*GiveTeamApplicationsRsp, error) GiveTeamApplications(ctx context.Context, in *GiveTeamApplicationsReq, opts ...grpc.CallOption) (*GiveTeamApplicationsRsp, error)
GetTeamActions(ctx context.Context, in *GetTeamActionsReq, opts ...grpc.CallOption) (*GetTeamActionsRsp, error) GetTeamStory(ctx context.Context, in *GetTeamStoryReq, opts ...grpc.CallOption) (*GetTeamStoryRsp, error)
AddTeamAction(ctx context.Context, in *AddTeamActionReq, opts ...grpc.CallOption) (*AddTeamActionRsp, error) AddTeamAction(ctx context.Context, in *AddTeamActionReq, opts ...grpc.CallOption) (*AddTeamActionRsp, error)
DeleteLastTeamAction(ctx context.Context, in *DeleteLastTeamActionReq, opts ...grpc.CallOption) (*DeleteLastTeamActionRsp, error) DeleteLastTeamAction(ctx context.Context, in *DeleteLastTeamActionReq, opts ...grpc.CallOption) (*DeleteLastTeamActionRsp, error)
} }
@@ -462,10 +462,10 @@ func (c *eveningDetectiveServerClient) GiveTeamApplications(ctx context.Context,
return out, nil return out, nil
} }
func (c *eveningDetectiveServerClient) GetTeamActions(ctx context.Context, in *GetTeamActionsReq, opts ...grpc.CallOption) (*GetTeamActionsRsp, error) { func (c *eveningDetectiveServerClient) GetTeamStory(ctx context.Context, in *GetTeamStoryReq, opts ...grpc.CallOption) (*GetTeamStoryRsp, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(GetTeamActionsRsp) out := new(GetTeamStoryRsp)
err := c.cc.Invoke(ctx, EveningDetectiveServer_GetTeamActions_FullMethodName, in, out, cOpts...) err := c.cc.Invoke(ctx, EveningDetectiveServer_GetTeamStory_FullMethodName, in, out, cOpts...)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@@ -531,7 +531,7 @@ type EveningDetectiveServerServer interface {
UpdateTeam(context.Context, *UpdateTeamReq) (*UpdateTeamRsp, error) UpdateTeam(context.Context, *UpdateTeamReq) (*UpdateTeamRsp, error)
DeleteTeam(context.Context, *DeleteTeamReq) (*DeleteTeamRsp, error) DeleteTeam(context.Context, *DeleteTeamReq) (*DeleteTeamRsp, error)
GiveTeamApplications(context.Context, *GiveTeamApplicationsReq) (*GiveTeamApplicationsRsp, error) GiveTeamApplications(context.Context, *GiveTeamApplicationsReq) (*GiveTeamApplicationsRsp, error)
GetTeamActions(context.Context, *GetTeamActionsReq) (*GetTeamActionsRsp, error) GetTeamStory(context.Context, *GetTeamStoryReq) (*GetTeamStoryRsp, error)
AddTeamAction(context.Context, *AddTeamActionReq) (*AddTeamActionRsp, error) AddTeamAction(context.Context, *AddTeamActionReq) (*AddTeamActionRsp, error)
DeleteLastTeamAction(context.Context, *DeleteLastTeamActionReq) (*DeleteLastTeamActionRsp, error) DeleteLastTeamAction(context.Context, *DeleteLastTeamActionReq) (*DeleteLastTeamActionRsp, error)
mustEmbedUnimplementedEveningDetectiveServerServer() mustEmbedUnimplementedEveningDetectiveServerServer()
@@ -649,8 +649,8 @@ func (UnimplementedEveningDetectiveServerServer) DeleteTeam(context.Context, *De
func (UnimplementedEveningDetectiveServerServer) GiveTeamApplications(context.Context, *GiveTeamApplicationsReq) (*GiveTeamApplicationsRsp, error) { func (UnimplementedEveningDetectiveServerServer) GiveTeamApplications(context.Context, *GiveTeamApplicationsReq) (*GiveTeamApplicationsRsp, error) {
return nil, status.Error(codes.Unimplemented, "method GiveTeamApplications not implemented") return nil, status.Error(codes.Unimplemented, "method GiveTeamApplications not implemented")
} }
func (UnimplementedEveningDetectiveServerServer) GetTeamActions(context.Context, *GetTeamActionsReq) (*GetTeamActionsRsp, error) { func (UnimplementedEveningDetectiveServerServer) GetTeamStory(context.Context, *GetTeamStoryReq) (*GetTeamStoryRsp, error) {
return nil, status.Error(codes.Unimplemented, "method GetTeamActions not implemented") return nil, status.Error(codes.Unimplemented, "method GetTeamStory not implemented")
} }
func (UnimplementedEveningDetectiveServerServer) AddTeamAction(context.Context, *AddTeamActionReq) (*AddTeamActionRsp, error) { func (UnimplementedEveningDetectiveServerServer) AddTeamAction(context.Context, *AddTeamActionReq) (*AddTeamActionRsp, error) {
return nil, status.Error(codes.Unimplemented, "method AddTeamAction not implemented") return nil, status.Error(codes.Unimplemented, "method AddTeamAction not implemented")
@@ -1310,20 +1310,20 @@ func _EveningDetectiveServer_GiveTeamApplications_Handler(srv interface{}, ctx c
return interceptor(ctx, in, info, handler) return interceptor(ctx, in, info, handler)
} }
func _EveningDetectiveServer_GetTeamActions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { func _EveningDetectiveServer_GetTeamStory_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetTeamActionsReq) in := new(GetTeamStoryReq)
if err := dec(in); err != nil { if err := dec(in); err != nil {
return nil, err return nil, err
} }
if interceptor == nil { if interceptor == nil {
return srv.(EveningDetectiveServerServer).GetTeamActions(ctx, in) return srv.(EveningDetectiveServerServer).GetTeamStory(ctx, in)
} }
info := &grpc.UnaryServerInfo{ info := &grpc.UnaryServerInfo{
Server: srv, Server: srv,
FullMethod: EveningDetectiveServer_GetTeamActions_FullMethodName, FullMethod: EveningDetectiveServer_GetTeamStory_FullMethodName,
} }
handler := func(ctx context.Context, req interface{}) (interface{}, error) { handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(EveningDetectiveServerServer).GetTeamActions(ctx, req.(*GetTeamActionsReq)) return srv.(EveningDetectiveServerServer).GetTeamStory(ctx, req.(*GetTeamStoryReq))
} }
return interceptor(ctx, in, info, handler) return interceptor(ctx, in, info, handler)
} }
@@ -1512,8 +1512,8 @@ var EveningDetectiveServer_ServiceDesc = grpc.ServiceDesc{
Handler: _EveningDetectiveServer_GiveTeamApplications_Handler, Handler: _EveningDetectiveServer_GiveTeamApplications_Handler,
}, },
{ {
MethodName: "GetTeamActions", MethodName: "GetTeamStory",
Handler: _EveningDetectiveServer_GetTeamActions_Handler, Handler: _EveningDetectiveServer_GetTeamStory_Handler,
}, },
{ {
MethodName: "AddTeamAction", MethodName: "AddTeamAction",