|
@@ -0,0 +1,72 @@
|
|
|
+package v1
|
|
|
+
|
|
|
+import (
|
|
|
+ "demo/internal/model/entity"
|
|
|
+ "github.com/gogf/gf/v2/frame/g"
|
|
|
+ "github.com/gogf/gf/v2/os/gtime"
|
|
|
+)
|
|
|
+
|
|
|
+type CreateReq struct {
|
|
|
+ g.Meta `path:"/activity" method:"post" tags:"Activity" summary:"Create activity"`
|
|
|
+ Id string `v:"required" dc:"活动id"`
|
|
|
+ Name string `v:"required" dc:"活动名称"`
|
|
|
+ StartTime *gtime.Time `v:"required|datetime" dc:"活动开始时间:2024-04-13 00:00:00"`
|
|
|
+ EndTime *gtime.Time `v:"required|datetime" dc:"活动结束时间:2024-05-27 23:59:59"`
|
|
|
+ LotteryStartTime string `v:"required-if:mold,2,mold,1|date-format:H:i:s" dc:"抽奖开始时间:0:00:00"`
|
|
|
+ LotteryEndTime string `v:"required-if:mold,2,mold,1|date-format:H:i:s" dc:"抽奖结束时间:23:59:59"`
|
|
|
+ Cost int `v:"required-if:mold,2,mold,1" dc:"'抽奖花费:1、默X个剑鱼币兑换1次抽奖机会;传X 2、订单抽奖: 抽奖次数动态根据下单次数判断 传-1'"`
|
|
|
+ DailyNum int `v:"required|min:0" dc:" 每人每个身份每天抽奖次数限制"`
|
|
|
+ DeviceNum int `v:"required|min:0" dc:" 每个设备每天抽奖次数限制"`
|
|
|
+ IpNum int `v:"required|min:0" dc:" 每个IP每天抽奖次数限制"`
|
|
|
+ Pic string `v:"required-if:mold,2,mold,1" dc:" 活动图片"`
|
|
|
+ Rule string `v:"required" dc:" 活动规则:[ { \"text\": \"活动时间:2024.5.13-2024.5.31,00:00至24:00。\" }]"`
|
|
|
+ ShareCopy string `v:"required|json" dc:" 分享文案:{ \"PC\": { \"title\": \"\", \"subtitle\": \"\", \"pic\": \"\", \"href\": \"\" }, \"APP\": { \"title\": \"\", \"subtitle\": \"\", \"pic\": \"\", \"href\": \"\" }, \"H5\": { \"title\": \"\", \"subtitle\": \"!\", \"pic\": \"\", \"href\": \"\" }, \"WX\": { \"title\": \"\", \"subtitle\": \"\", \"pic\": \"\", \"href\": \"\" }}"`
|
|
|
+ State int `v:"required|in:0,1" dc:" 活动状态默认0:有效;1:已取消"`
|
|
|
+ Mold int `v:"required|in:0,1,2" dc:" 活动类型 0:购买奖励;1:剑鱼币抽奖;2:订单抽奖"`
|
|
|
+ OrderType string `v:"required-if:mold,2|in:m_1,v_1,v_2,v_3" dc:"订单类型: 该字段仅当mold值为2时生效;m_1-大会员购买; v_1-购买超级订阅;v_2-续费超级订阅;v_3-升级超级订阅 支持多个时使用英文逗号分割"`
|
|
|
+}
|
|
|
+type CreateRes struct {
|
|
|
+}
|
|
|
+type Status int
|
|
|
+
|
|
|
+const (
|
|
|
+ StatusOK Status = 0 // User is OK.
|
|
|
+ StatusDisabled Status = 1 // User is disabled.
|
|
|
+)
|
|
|
+
|
|
|
+type UpdateReq struct {
|
|
|
+ g.Meta `path:"/activity/{id}" method:"put" tags:"Activity" summary:"Update activity"`
|
|
|
+ Id int64 `v:"required" dc:"活动 id"`
|
|
|
+ StartTime *gtime.Time `v:"datetime" dc:"活动开始时间"`
|
|
|
+ EndTime *gtime.Time `v:"datetime" dc:"活动结束时间"`
|
|
|
+ LotteryStartTime string `v:"date-format:H:i:s" dc:"抽奖开始时间:00:00:00"`
|
|
|
+ LotteryEndTime string `v:"date-format:H:i:s" dc:"抽奖结束时间:09:00:00"`
|
|
|
+ Cost int `dc:"'抽奖花费:1、默X个剑鱼币兑换1次抽奖机会;传X 2、订单抽奖: 抽奖次数动态根据下单次数判断 传-1"`
|
|
|
+ DailyNum int `v:"min:0" dc:" 每人每个身份每天抽奖次数限制"`
|
|
|
+ DeviceNum int `v:"min:0" dc:" 每个设备每天抽奖次数限制"`
|
|
|
+ IpNum int `v:"min:0" dc:" 每个IP每天抽奖次数限制"`
|
|
|
+ Pic string `dc:"活动图片"`
|
|
|
+ Rule string `dc:"活动规则:[ { \"text\": \"活动时间:2024.5.13-2024.5.31,00:00至24:00。\" }]"`
|
|
|
+ ShareCopy string `v:"json" dc:"分享文案:{ \"PC\": { \"title\": \"\", \"subtitle\": \"\", \"pic\": \"\", \"href\": \"\" }, \"APP\": { \"title\": \"\", \"subtitle\": \"\", \"pic\": \"\", \"href\": \"\" }, \"H5\": { \"title\": \"\", \"subtitle\": \"!\", \"pic\": \"\", \"href\": \"\" }, \"WX\": { \"title\": \"\", \"subtitle\": \"\", \"pic\": \"\", \"href\": \"\" }}"`
|
|
|
+ State int `v:"in:0,1" dc:" 活动状态默认0:有效;1:已取消"`
|
|
|
+}
|
|
|
+type UpdateRes struct{}
|
|
|
+type GetListReq struct {
|
|
|
+ g.Meta `path:"/activity" method:"get" tags:"Activity" summary:"Get Activitys"`
|
|
|
+ StartTime *gtime.Time `v:"datetime" dc:"活动开始时间"`
|
|
|
+ EndTime *gtime.Time `v:"datetime" dc:"活动结束时间"`
|
|
|
+ State int `v:"in:0,1" dc:" 活动状态默认0:有效;1:已取消"`
|
|
|
+ Mold int `v:"in:0,1,2" dc:" 活动类型 0:购买奖励;1:剑鱼币抽奖;2:订单抽奖"`
|
|
|
+ Name string `dc:"活动名称"`
|
|
|
+ Id int
|
|
|
+ Offset int `d:"0" dc:"分页开始条数"`
|
|
|
+ Limit int `d:"10" dc:"每页条数"`
|
|
|
+}
|
|
|
+type GetListRes struct {
|
|
|
+ List []*entity.ActivityInfo `json:"list" dc:"Activity list"`
|
|
|
+ Total int `json:"total" dc:"Activity list total"`
|
|
|
+}
|
|
|
+type GetActivityConfigReq struct {
|
|
|
+ g.Meta `path:"/activity-config" method:"get" tags:"ActivityConfig" summary:"Get Activitys config"`
|
|
|
+}
|
|
|
+type GetActivityConfigRes map[string]interface{}
|