tests in console

This commit is contained in:
Laurent Le Houerou 2024-06-06 09:52:09 +04:00
parent 57d157df6f
commit 2e1b00f306

View File

@ -31,39 +31,48 @@ func main() {
ctx := context.Background()
si, err := api.ShopItems.Get(ctx, sorare.ShopItemsParams{
Types: []sorare.ShopItemType{sorare.ShopItemTypeLevelUp},
UnlockedOnly: true,
})
p, err := api.Football.Player.Get(ctx, graphql.SlugParams{Slug: "joshua-kimmich"})
if err != nil {
panic(err)
}
for _, item := range si {
log.Printf(
"%s %d %d %s %s",
item.TypeName,
item.ShopItemInterface.MyBalance,
item.ShopItemInterface.Price,
item.LevelUpShopItem.Rarity,
time.Until(item.ShopItemInterface.MyLimitResetAt).String(),
)
}
log.Printf("%+v", p)
cu, err := api.Users.CurrentUser.Get(ctx, graphql.EmptyParams{})
if err != nil {
panic(err)
}
log.Printf("%d", cu.CoinBalance)
// cu, err := api.Users.FootballCards("gigiz22").Get(ctx, football.CardsParams{
// si, err := api.ShopItems.Get(ctx, sorare.ShopItemsParams{
// Types: []sorare.ShopItemType{sorare.ShopItemTypeLevelUp},
// UnlockedOnly: true,
// })
// if err != nil {
// panic(err)
// }
// for _, item := range si {
// log.Printf(
// "%s %d %d %s %s",
// item.TypeName,
// item.ShopItemInterface.MyBalance,
// item.ShopItemInterface.Price,
// item.LevelUpShopItem.Rarity,
// time.Until(item.ShopItemInterface.MyLimitResetAt).String(),
// )
// }
// cu, err := api.Users.CurrentUser.Get(ctx, graphql.EmptyParams{})
// if err != nil {
// panic(err)
// }
// log.Printf("%d", cu.CoinBalance)
// cards, err := api.Users.FootballCards("gigiz22").Get(ctx, football.CardsParams{
// Rarities: []types.Rarity{types.RarityLimited},
// })
// if err != nil {
// panic(err)
// }
// sort.Slice(cu, func(i, j int) bool {
// return cu[i].XpNeededForNextGrade-cu[i].Xp > cu[j].XpNeededForNextGrade-cu[j].Xp
// sort.Slice(cards, func(i, j int) bool {
// return cards[i].XpNeededForNextGrade-cards[i].Xp > cards[j].XpNeededForNextGrade-cards[j].Xp
// })
// for _, card := range cu {
// for _, card := range cards {
// if !card.InSeasonEligible {
// continue
// }
// log.Printf(
// "%60s %2d %6d %6d %6d (%d/%d)",
// card.Token.Name,