sdk is working now with api v0.8
This commit is contained in:
parent
abf60bdf85
commit
0fb6430054
2
go.mod
2
go.mod
|
@ -5,5 +5,5 @@ go 1.14
|
||||||
require (
|
require (
|
||||||
github.com/Kichiyaki/gqlgen-client v0.0.0-20200604145848-274796c104f4
|
github.com/Kichiyaki/gqlgen-client v0.0.0-20200604145848-274796c104f4
|
||||||
github.com/pkg/errors v0.9.1
|
github.com/pkg/errors v0.9.1
|
||||||
github.com/tribalwarshelp/shared v0.0.0-20200621115742-5ae0d5ec33f2
|
github.com/tribalwarshelp/shared v0.0.0-20200623144748-aa834a01dce6
|
||||||
)
|
)
|
||||||
|
|
2
go.sum
2
go.sum
|
@ -25,6 +25,8 @@ github.com/tribalwarshelp/shared v0.0.0-20200621113135-f37b4069eaaf h1:FoZBGciPI
|
||||||
github.com/tribalwarshelp/shared v0.0.0-20200621113135-f37b4069eaaf/go.mod h1:tf+2yTHasV6jAF3V2deZ9slNoCyBzC0fMdTjI7clf6Y=
|
github.com/tribalwarshelp/shared v0.0.0-20200621113135-f37b4069eaaf/go.mod h1:tf+2yTHasV6jAF3V2deZ9slNoCyBzC0fMdTjI7clf6Y=
|
||||||
github.com/tribalwarshelp/shared v0.0.0-20200621115742-5ae0d5ec33f2 h1:xHR69AkeSO34WkjYlTSzD6v2X37hY68e53o6GEoIyFs=
|
github.com/tribalwarshelp/shared v0.0.0-20200621115742-5ae0d5ec33f2 h1:xHR69AkeSO34WkjYlTSzD6v2X37hY68e53o6GEoIyFs=
|
||||||
github.com/tribalwarshelp/shared v0.0.0-20200621115742-5ae0d5ec33f2/go.mod h1:tf+2yTHasV6jAF3V2deZ9slNoCyBzC0fMdTjI7clf6Y=
|
github.com/tribalwarshelp/shared v0.0.0-20200621115742-5ae0d5ec33f2/go.mod h1:tf+2yTHasV6jAF3V2deZ9slNoCyBzC0fMdTjI7clf6Y=
|
||||||
|
github.com/tribalwarshelp/shared v0.0.0-20200623144748-aa834a01dce6 h1:WZ1oxHysFtiPjHa2ADUqiGrzwcN3j0YpiVg/V2e/74o=
|
||||||
|
github.com/tribalwarshelp/shared v0.0.0-20200623144748-aa834a01dce6/go.mod h1:tf+2yTHasV6jAF3V2deZ9slNoCyBzC0fMdTjI7clf6Y=
|
||||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||||
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo=
|
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo=
|
||||||
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||||
|
|
2
main.go
2
main.go
|
@ -89,7 +89,7 @@ func main() {
|
||||||
log.Println(tribe.ID, tribe.Name, tribe.Tag, tribe.RankAtt, tribe.RankDef)
|
log.Println(tribe.ID, tribe.Name, tribe.Tag, tribe.RankAtt, tribe.RankDef)
|
||||||
}
|
}
|
||||||
|
|
||||||
village, err := api.Villages.Read("pl151", 28299, &sdk.VillageInclude{
|
village, err := api.Villages.Read("pl151", 28120, &sdk.VillageInclude{
|
||||||
Player: true,
|
Player: true,
|
||||||
PlayerInclude: sdk.PlayerInclude{
|
PlayerInclude: sdk.PlayerInclude{
|
||||||
Tribe: true,
|
Tribe: true,
|
||||||
|
|
|
@ -31,6 +31,8 @@ var (
|
||||||
points
|
points
|
||||||
rank
|
rank
|
||||||
exist
|
exist
|
||||||
|
dailyGrowth
|
||||||
|
joinedAt
|
||||||
%s
|
%s
|
||||||
`, playerODFields)
|
`, playerODFields)
|
||||||
tribeFields = fmt.Sprintf(`
|
tribeFields = fmt.Sprintf(`
|
||||||
|
@ -43,6 +45,8 @@ var (
|
||||||
allPoints
|
allPoints
|
||||||
rank
|
rank
|
||||||
exist
|
exist
|
||||||
|
dominance
|
||||||
|
createdAt
|
||||||
%s
|
%s
|
||||||
`, commonODFields)
|
`, commonODFields)
|
||||||
villageFields = `
|
villageFields = `
|
||||||
|
|
|
@ -38,10 +38,14 @@ func (ss *Servers) Read(key string, incl *ServerInclude) (*models.Server, error)
|
||||||
query := fmt.Sprintf(`
|
query := fmt.Sprintf(`
|
||||||
query server($key: String!) {
|
query server($key: String!) {
|
||||||
server(key: $key) {
|
server(key: $key) {
|
||||||
id
|
|
||||||
key
|
key
|
||||||
status
|
status
|
||||||
dataUpdatedAt
|
dataUpdatedAt
|
||||||
|
historyUpdatedAt
|
||||||
|
statsUpdatedAt
|
||||||
|
numberOfTribes
|
||||||
|
numberOfPlayers
|
||||||
|
numberOfVillages
|
||||||
%s
|
%s
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -73,10 +77,11 @@ func (ss *Servers) Browse(filter *models.ServerFilter, incl *ServerInclude) (*Se
|
||||||
query servers($filter: ServerFilter) {
|
query servers($filter: ServerFilter) {
|
||||||
servers(filter: $filter) {
|
servers(filter: $filter) {
|
||||||
items {
|
items {
|
||||||
id
|
|
||||||
key
|
key
|
||||||
status
|
status
|
||||||
dataUpdatedAt
|
dataUpdatedAt
|
||||||
|
historyUpdatedAt
|
||||||
|
statsUpdatedAt
|
||||||
%s
|
%s
|
||||||
}
|
}
|
||||||
total
|
total
|
||||||
|
|
Reference in New Issue
Block a user