Skip to content

Commit

Permalink
チーム登録時にplayerも登録できるように
Browse files Browse the repository at this point in the history
  • Loading branch information
Shugo Kawamura committed Aug 12, 2023
1 parent 5b28c05 commit fe70881
Show file tree
Hide file tree
Showing 7 changed files with 101 additions and 89 deletions.
5 changes: 4 additions & 1 deletion backend/gqlgen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,7 @@ models:

DateTime:
model:
- github.com/99designs/gqlgen/graphql.Time
- github.com/99designs/gqlgen/graphql.Time
SteamID:
model:
- github.com/99designs/gqlgen/graphql.Uint64
8 changes: 3 additions & 5 deletions backend/graph/converter.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package graph

import (
"strconv"

"github.com/FlowingSPDG/get5loader/backend/entity"
"github.com/FlowingSPDG/get5loader/backend/graph/model"
)
Expand Down Expand Up @@ -53,7 +51,7 @@ func convertPlayer(player *entity.Player) *model.Player {
return &model.Player{
ID: string(player.ID),
TeamID: string(player.TeamID),
SteamID: strconv.Itoa(int(player.SteamID)),
SteamID: uint64(player.SteamID),
Name: player.Name,
}
}
Expand Down Expand Up @@ -123,7 +121,7 @@ func convertPlayerstat(playerstat *entity.PlayerStat) *model.PlayerStats {
ID: string(playerstat.ID),
MatchID: string(playerstat.MatchID),
MapstatsID: string(playerstat.MapID),
SteamID: strconv.Itoa(int(playerstat.SteamID)),
SteamID: uint64(playerstat.SteamID),
Name: playerstat.Name,
Kills: int(playerstat.Kills),
Assists: int(playerstat.Assists),
Expand Down Expand Up @@ -163,7 +161,7 @@ func convertPlayerstats(playerstats []*entity.PlayerStat) []*model.PlayerStats {
func convertUser(user *entity.User) *model.User {
return &model.User{
ID: string(user.ID),
SteamID: strconv.Itoa(int(user.SteamID)),
SteamID: uint64(user.SteamID),
Name: user.Name,
Admin: false,
Gameservers: convertGameServers(user.Servers),
Expand Down
41 changes: 28 additions & 13 deletions backend/graph/generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions backend/graph/model/models_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 8 additions & 7 deletions backend/graph/qls/schema.graphqls
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
scalar DateTime
scalar SteamID

# User Operations
type User {
id: ID!
steamId: String!
steamId: SteamID!
name: String!
admin: Boolean!
gameservers: [GameServer!]!
Expand All @@ -12,14 +13,14 @@ type User {
}

input NewUser {
steamId: String!
steamId: SteamID!
name: String!
password: String!
admin: Boolean!
}

input UserLoginSteamID {
steamId: String!
steamId: SteamID!
password: String!
}

Expand Down Expand Up @@ -57,18 +58,18 @@ input NewTeam {
type Player {
id: ID!
teamId: ID!
steamId: String!
steamId: SteamID!
name: String!
}

input NewPlayer {
steamId: String!
steamId: SteamID!
name: String!
teamid: ID!
}

input NewPlayerForTeam {
steamId: String!
steamId: SteamID!
name: String!
}

Expand Down Expand Up @@ -164,7 +165,7 @@ type PlayerStats {
id: ID!
matchId: ID!
mapstatsId: ID!
steamId: String!
steamId: SteamID!
name: String!

kills: Int!
Expand Down
19 changes: 18 additions & 1 deletion backend/graph/schema.resolvers.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit fe70881

Please sign in to comment.