api/internal/api/merch/dto.go

109 lines
2.4 KiB
Go
Raw Normal View History

2025-09-15 14:52:39 +03:00
package merch
2025-12-15 17:34:01 +03:00
import (
"merch-parser-api/internal/api/merch/origins"
"time"
)
2025-11-02 21:10:49 +03:00
2025-09-15 17:56:16 +03:00
type merchBundle struct {
2025-09-18 17:09:39 +03:00
Merch *Merch
2025-12-15 17:34:01 +03:00
Surugaya *origins.OriginSurugaya
Mandarake *origins.OriginMandarake
Amiami *origins.OriginAmiami
2025-09-15 17:56:16 +03:00
}
2025-09-15 14:52:39 +03:00
type MerchDTO struct {
2025-09-15 15:13:35 +03:00
MerchUuid string `json:"merch_uuid"`
Name string `json:"name"`
OriginSurugaya SurugayaDTO `json:"origin_surugaya"`
OriginMandarake MandarakeDTO `json:"origin_mandarake"`
2025-12-15 17:34:01 +03:00
OriginAmiami AmiamiDTO `json:"origin_amiami"`
2025-10-29 20:56:26 +03:00
Labels []string `json:"labels,omitempty" gorm:"-"`
2025-09-15 14:52:39 +03:00
}
2025-12-15 17:34:01 +03:00
type OriginDTO struct {
2025-09-23 17:28:11 +03:00
Link string `json:"link"`
2025-09-15 14:52:39 +03:00
}
2025-12-15 17:34:01 +03:00
type SurugayaDTO struct {
OriginDTO
}
2025-09-15 15:13:35 +03:00
type MandarakeDTO struct {
2025-12-15 17:34:01 +03:00
OriginDTO
}
type AmiamiDTO struct {
OriginDTO
2025-09-15 14:52:39 +03:00
}
2025-09-15 17:56:16 +03:00
type SingleMerchResponse struct {
MerchUuid string `json:"merch_uuid"`
Name string `json:"name"`
Origins []any `json:"origins"`
}
type ListResponse struct {
2025-10-28 21:46:40 +03:00
MerchUuid string `json:"merch_uuid"`
Name string `json:"name"`
Labels []string `json:"labels,omitempty" gorm:"-"`
2025-09-15 17:56:16 +03:00
}
2025-09-24 20:28:36 +03:00
type PriceEntry struct {
2025-09-25 18:33:09 +03:00
CreatedAt int64 `json:"created_at"`
Value int `json:"value"`
2025-09-24 20:28:36 +03:00
}
type OriginWithPrices struct {
2025-12-15 17:34:01 +03:00
Origin origins.Origin `json:"origins"`
2025-09-24 20:28:36 +03:00
Prices []PriceEntry
}
type PricesResponse struct {
Name string `json:"name"`
MerchUuid string `json:"merch_uuid"`
Origins []OriginWithPrices `json:"origins"`
}
2025-10-01 11:00:39 +03:00
type UpdateMerchDTO struct {
MerchUuid string `json:"merch_uuid"`
Name string `json:"name"`
2025-12-15 17:34:01 +03:00
Origin string `json:"origins"`
2025-10-01 11:00:39 +03:00
Link string `json:"link"`
}
2025-10-15 19:46:10 +03:00
type ImageLink struct {
Link string `json:"link"`
2025-10-17 23:47:48 +03:00
ETag string `json:"etag"`
2025-10-15 19:46:10 +03:00
}
2025-10-28 20:06:32 +03:00
type LabelDTO struct {
2025-10-28 20:29:14 +03:00
Name string `json:"name"`
Color string `json:"color,omitempty"`
BgColor string `json:"bg_color,omitempty"`
}
type LabelsList struct {
2025-10-28 20:06:32 +03:00
LabelUuid string `json:"label_uuid"`
Name string `json:"name"`
2025-10-28 20:29:14 +03:00
Color string `json:"color,omitempty"`
BgColor string `json:"bg_color,omitempty"`
2025-10-28 20:06:32 +03:00
}
type LabelLink struct {
MerchUuid string `json:"merch_uuid"`
LabelUuid string `json:"label_uuid"`
}
2025-11-02 21:10:49 +03:00
type ZeroPrice struct {
2025-12-15 17:34:01 +03:00
Id int `json:"id"`
CreatedAt time.Time `json:"created_at"`
MerchUuid string `json:"merch_uuid"`
Name string `json:"name"`
Origin origins.Origin `json:"origins"`
2025-11-02 21:10:49 +03:00
}
type DeleteZeroPrices struct {
2025-11-02 23:27:23 +03:00
Id uint `json:"id"`
MerchUuid string `json:"merch_uuid"`
2025-11-02 21:10:49 +03:00
}