feat: add characters
This commit is contained in:
@@ -8,6 +8,7 @@ type Carpet struct {
|
||||
Title string `json:"title"`
|
||||
PriceCoins int64 `json:"price_coins"`
|
||||
VIP bool `json:"vip"`
|
||||
Img string `json:"img"` // URL کاملِ تصویرِ فرش (خالی برای classic که تصویری ندارد)
|
||||
Owned bool `json:"owned"`
|
||||
}
|
||||
|
||||
@@ -28,6 +29,9 @@ func (s *Service) Carpets(ctx context.Context, userID int64) ([]Carpet, error) {
|
||||
return nil, err
|
||||
}
|
||||
c.VIP = vip == 1
|
||||
if c.ID != "classic" {
|
||||
c.Img = s.imgURL("carpets", c.ID+".jpg")
|
||||
}
|
||||
carpets = append(carpets, c)
|
||||
}
|
||||
if err := rows.Err(); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user