76 lines
3.4 KiB
Go
76 lines
3.4 KiB
Go
package discount_area_mod
|
||
|
||
import (
|
||
"91porn-server/models/commod"
|
||
"go.mongodb.org/mongo-driver/bson/primitive"
|
||
"time"
|
||
)
|
||
|
||
type WebDiscountAreaListReq struct {
|
||
}
|
||
|
||
type WebDiscountAreaListResp struct {
|
||
List []DiscountArea `json:"list"`
|
||
}
|
||
|
||
type WebDiscountAreaAddReq struct {
|
||
Title string `json:"title" form:"title" binding:"required"` // 专区名
|
||
Desc string `json:"desc" form:"desc"` //专区描述
|
||
Discount uint `json:"discount" form:"discount" binding:"min=0,max=100"` // 折扣,1折 10,1.5折 15
|
||
Status uint `json:"status" form:"status,omitempty"` // 0-未开启 1-开启
|
||
SortCode uint `json:"sortCode" form:"sortCode"` //排序字段
|
||
RecommendNum uint `json:"recommendNum" form:"recommendNum"` // 推荐展示个数
|
||
}
|
||
|
||
type WebDiscountAreaUpdateReq struct {
|
||
Id string `json:"id" form:"id" binding:"required"` // 专区名
|
||
WebDiscountAreaUpdateData
|
||
}
|
||
|
||
type WebDiscountAreaUpdateData struct {
|
||
Title *string `json:"title" bson:"title,omitempty" form:"title"` // 专区名
|
||
Desc *string `json:"desc" bson:"desc,omitempty" form:"desc"` //专区描述
|
||
Discount *uint `json:"discount" bson:"discount,omitempty" form:"discount,omitempty"` // 折扣,1折 10,1.5折 15
|
||
Status *uint `json:"status" bson:"status,omitempty" form:"status,omitempty"` // 0-未开启 1-开启
|
||
SortCode *uint `json:"sortCode" bson:"sortCode,omitempty" form:"sortCode"` //排序字段
|
||
RecommendNum *uint `json:"recommendNum" bson:"recommendNum,omitempty" form:"recommendNum"` // 推荐展示个数
|
||
}
|
||
|
||
type WebDiscountAreaDeleteReq struct {
|
||
ID string `json:"id" form:"id" binding:"required"`
|
||
}
|
||
|
||
type WebDiscountAreaAddVidReq struct {
|
||
DiscountAreaId primitive.ObjectID `json:"discountAreaId" form:"discountAreaId" binding:"required"`
|
||
VIds []primitive.ObjectID `json:"vids" form:"vids" binding:"required"`
|
||
}
|
||
|
||
type WebDiscountAreaDeleteVidReq struct {
|
||
Ids []primitive.ObjectID `json:"ids" form:"ids" binding:"required"`
|
||
}
|
||
|
||
type WebDiscountAreaVidsReq struct {
|
||
commod.Page
|
||
DiscountAreaId string `json:"discountAreaId" form:"discountAreaId"` // 折扣专区id
|
||
Vid string `json:"vid" form:"vid"` // 视频id
|
||
}
|
||
|
||
type WebDiscountAreaVidsResp struct {
|
||
List []WebDiscountAreaVideo `json:"list"`
|
||
Total int64 `json:"total"`
|
||
}
|
||
|
||
type WebDiscountAreaVideo struct {
|
||
Id primitive.ObjectID `json:"id"` // 记录id
|
||
VideoID primitive.ObjectID `json:"videoID"` // 视频ID
|
||
Title string `json:"title"` // 标题
|
||
PublisherID uint64 `json:"publisherID"` // 发布用户ID
|
||
Cover string `json:"cover"` // 视频封面图
|
||
DiscountAreaTitle string `json:"discountAreaTitle"` // 折扣专区标题
|
||
DiscountAreaId primitive.ObjectID `json:"discountAreaId"` // 折扣专区id
|
||
OriginalPrice int64 `json:"originalPrice"` // 原价
|
||
DiscountedPrice int64 `json:"discountedPrice"` // 折扣区价格
|
||
UpdatedAt time.Time `json:"updatedAt"` // 更新时间
|
||
CreatedAt time.Time `json:"createdAt"` // 创建时间
|
||
}
|