refactor: openapi - update Tribe schema
This commit is contained in:
parent
cde03857a2
commit
a863c7af2e
|
@ -813,6 +813,28 @@ components:
|
|||
$ref: "#/components/schemas/Building"
|
||||
wood:
|
||||
$ref: "#/components/schemas/Building"
|
||||
TribeOpponentsDefeated:
|
||||
type: object
|
||||
required:
|
||||
- rankAtt
|
||||
- scoreAtt
|
||||
- rankDef
|
||||
- scoreDef
|
||||
- rankTotal
|
||||
- scoreTotal
|
||||
properties:
|
||||
rankAtt:
|
||||
type: integer
|
||||
scoreAtt:
|
||||
type: integer
|
||||
rankDef:
|
||||
type: integer
|
||||
scoreDef:
|
||||
type: integer
|
||||
rankTotal:
|
||||
type: integer
|
||||
scoreTotal:
|
||||
type: integer
|
||||
Tribe:
|
||||
type: object
|
||||
required:
|
||||
|
@ -826,12 +848,7 @@ components:
|
|||
- numVillages
|
||||
- rank
|
||||
- dominance
|
||||
- rankAtt
|
||||
- scoreAtt
|
||||
- rankDef
|
||||
- scoreDef
|
||||
- rankTotal
|
||||
- scoreTotal
|
||||
- opponentsDefeated
|
||||
- bestRank
|
||||
- bestRankAt
|
||||
- mostVillages
|
||||
|
@ -862,18 +879,8 @@ components:
|
|||
dominance:
|
||||
type: number
|
||||
format: double
|
||||
rankAtt:
|
||||
type: integer
|
||||
scoreAtt:
|
||||
type: integer
|
||||
rankDef:
|
||||
type: integer
|
||||
scoreDef:
|
||||
type: integer
|
||||
rankTotal:
|
||||
type: integer
|
||||
scoreTotal:
|
||||
type: integer
|
||||
opponentsDefeated:
|
||||
$ref: "#/components/schemas/TribeOpponentsDefeated"
|
||||
bestRank:
|
||||
type: integer
|
||||
bestRankAt:
|
||||
|
|
|
@ -4,6 +4,17 @@ import (
|
|||
"gitea.dwysokinski.me/twhelp/corev3/internal/domain"
|
||||
)
|
||||
|
||||
func NewTribeOpponentsDefeated(od domain.OpponentsDefeated) TribeOpponentsDefeated {
|
||||
return TribeOpponentsDefeated{
|
||||
RankAtt: od.RankAtt(),
|
||||
RankDef: od.RankDef(),
|
||||
RankTotal: od.RankTotal(),
|
||||
ScoreAtt: od.ScoreAtt(),
|
||||
ScoreDef: od.ScoreDef(),
|
||||
ScoreTotal: od.ScoreTotal(),
|
||||
}
|
||||
}
|
||||
|
||||
func NewTribe(t domain.Tribe) Tribe {
|
||||
converted := Tribe{
|
||||
AllPoints: t.AllPoints(),
|
||||
|
@ -22,12 +33,7 @@ func NewTribe(t domain.Tribe) Tribe {
|
|||
Points: t.Points(),
|
||||
ProfileUrl: t.ProfileURL().String(),
|
||||
Rank: t.Rank(),
|
||||
RankAtt: t.OD().RankAtt(),
|
||||
RankDef: t.OD().RankDef(),
|
||||
RankTotal: t.OD().RankTotal(),
|
||||
ScoreAtt: t.OD().ScoreAtt(),
|
||||
ScoreDef: t.OD().ScoreDef(),
|
||||
ScoreTotal: t.OD().ScoreTotal(),
|
||||
OpponentsDefeated: NewTribeOpponentsDefeated(t.OD()),
|
||||
Tag: t.Tag(),
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue