refactor: openapi - update Tribe schema
This commit is contained in:
parent
cde03857a2
commit
a863c7af2e
|
@ -813,6 +813,28 @@ components:
|
||||||
$ref: "#/components/schemas/Building"
|
$ref: "#/components/schemas/Building"
|
||||||
wood:
|
wood:
|
||||||
$ref: "#/components/schemas/Building"
|
$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:
|
Tribe:
|
||||||
type: object
|
type: object
|
||||||
required:
|
required:
|
||||||
|
@ -826,12 +848,7 @@ components:
|
||||||
- numVillages
|
- numVillages
|
||||||
- rank
|
- rank
|
||||||
- dominance
|
- dominance
|
||||||
- rankAtt
|
- opponentsDefeated
|
||||||
- scoreAtt
|
|
||||||
- rankDef
|
|
||||||
- scoreDef
|
|
||||||
- rankTotal
|
|
||||||
- scoreTotal
|
|
||||||
- bestRank
|
- bestRank
|
||||||
- bestRankAt
|
- bestRankAt
|
||||||
- mostVillages
|
- mostVillages
|
||||||
|
@ -862,18 +879,8 @@ components:
|
||||||
dominance:
|
dominance:
|
||||||
type: number
|
type: number
|
||||||
format: double
|
format: double
|
||||||
rankAtt:
|
opponentsDefeated:
|
||||||
type: integer
|
$ref: "#/components/schemas/TribeOpponentsDefeated"
|
||||||
scoreAtt:
|
|
||||||
type: integer
|
|
||||||
rankDef:
|
|
||||||
type: integer
|
|
||||||
scoreDef:
|
|
||||||
type: integer
|
|
||||||
rankTotal:
|
|
||||||
type: integer
|
|
||||||
scoreTotal:
|
|
||||||
type: integer
|
|
||||||
bestRank:
|
bestRank:
|
||||||
type: integer
|
type: integer
|
||||||
bestRankAt:
|
bestRankAt:
|
||||||
|
|
|
@ -4,31 +4,37 @@ import (
|
||||||
"gitea.dwysokinski.me/twhelp/corev3/internal/domain"
|
"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 {
|
func NewTribe(t domain.Tribe) Tribe {
|
||||||
converted := Tribe{
|
converted := Tribe{
|
||||||
AllPoints: t.AllPoints(),
|
AllPoints: t.AllPoints(),
|
||||||
BestRank: t.BestRank(),
|
BestRank: t.BestRank(),
|
||||||
BestRankAt: t.BestRankAt(),
|
BestRankAt: t.BestRankAt(),
|
||||||
CreatedAt: t.CreatedAt(),
|
CreatedAt: t.CreatedAt(),
|
||||||
Dominance: t.Dominance(),
|
Dominance: t.Dominance(),
|
||||||
Id: t.ID(),
|
Id: t.ID(),
|
||||||
MostPoints: t.MostPoints(),
|
MostPoints: t.MostPoints(),
|
||||||
MostPointsAt: t.MostPointsAt(),
|
MostPointsAt: t.MostPointsAt(),
|
||||||
MostVillages: t.MostVillages(),
|
MostVillages: t.MostVillages(),
|
||||||
MostVillagesAt: t.MostVillagesAt(),
|
MostVillagesAt: t.MostVillagesAt(),
|
||||||
Name: t.Name(),
|
Name: t.Name(),
|
||||||
NumMembers: t.NumMembers(),
|
NumMembers: t.NumMembers(),
|
||||||
NumVillages: t.NumVillages(),
|
NumVillages: t.NumVillages(),
|
||||||
Points: t.Points(),
|
Points: t.Points(),
|
||||||
ProfileUrl: t.ProfileURL().String(),
|
ProfileUrl: t.ProfileURL().String(),
|
||||||
Rank: t.Rank(),
|
Rank: t.Rank(),
|
||||||
RankAtt: t.OD().RankAtt(),
|
OpponentsDefeated: NewTribeOpponentsDefeated(t.OD()),
|
||||||
RankDef: t.OD().RankDef(),
|
Tag: t.Tag(),
|
||||||
RankTotal: t.OD().RankTotal(),
|
|
||||||
ScoreAtt: t.OD().ScoreAtt(),
|
|
||||||
ScoreDef: t.OD().ScoreDef(),
|
|
||||||
ScoreTotal: t.OD().ScoreTotal(),
|
|
||||||
Tag: t.Tag(),
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if deletedAt := t.DeletedAt(); !deletedAt.IsZero() {
|
if deletedAt := t.DeletedAt(); !deletedAt.IsZero() {
|
||||||
|
|
Loading…
Reference in New Issue