diff --git a/app/admin/apis/lotterymanage/lottery.go b/app/admin/apis/lotterymanage/lottery.go new file mode 100644 index 0000000..f115e5d --- /dev/null +++ b/app/admin/apis/lotterymanage/lottery.go @@ -0,0 +1,570 @@ +package lotterymanage + +import ( + "encoding/json" + "errors" + "fmt" + "github.com/gin-gonic/gin" + model "go-admin/app/admin/models" + orm "go-admin/common/global" + "go-admin/tools/app" + "gorm.io/gorm" + "net/http" + "time" +) + +// GetPublicLotteryConfigHandler 查询抽奖配置(公开接口) +// @Summary 查询抽奖模块配置(公开) +// @Tags 积分抽奖,V1.5.0 +// @Produce json +// @Success 200 {object} models.LotteryConfig +// @Router /api/v1/lottery/config/public [post] +func GetPublicLotteryConfigHandler(c *gin.Context) { + cfg, err := model.GetLotteryConfig() + if err != nil { + app.Error(c, http.StatusInternalServerError, nil, "获取抽奖配置失败") + return + } + + app.OK(c, cfg, "配置更新成功") +} + +// UpdateLotteryConfig 更新抽奖参数配置 +// @Summary 更新积分抽奖参数配置 +// @Tags 积分抽奖,V1.5.0 +// @Accept json +// @Produce json +// @Param data body models.UpdateLotteryConfigRequest true "抽奖配置" +// @Success 200 {object} app.Response +// @Router /api/v1/lottery/config/update [post] +func UpdateLotteryConfig(c *gin.Context) { + var req model.UpdateLotteryConfigRequest + if err := c.ShouldBindJSON(&req); err != nil { + app.Error(c, http.StatusBadRequest, nil, "参数错误: "+err.Error()) + return + } + + // 转为 JSON 字符串 + valueBytes, err := json.Marshal(req) + if err != nil { + app.Error(c, http.StatusInternalServerError, nil, "配置序列化失败") + return + } + + // 尝试读取是否已有记录 + var config model.Config + tx := orm.Eloquent + err = tx.Where("name = ?", model.ConfigNameLotteryLimit).First(&config).Error + + if errors.Is(err, gorm.ErrRecordNotFound) { + // 不存在则创建 + newCfg := model.Config{ + Name: model.ConfigNameLotteryLimit, + Value: string(valueBytes), + } + if err := tx.Create(&newCfg).Error; err != nil { + app.Error(c, http.StatusInternalServerError, nil, "创建配置失败: "+err.Error()) + return + } + } else if err != nil { + app.Error(c, http.StatusInternalServerError, nil, "查询配置失败: "+err.Error()) + return + } else { + // 存在则更新 + if err := tx.Model(&config). + Update("value", string(valueBytes)).Error; err != nil { + app.Error(c, http.StatusInternalServerError, nil, "更新配置失败: "+err.Error()) + return + } + } + + app.OK(c, nil, "配置更新成功") +} + +// CreateLotteryPrize 创建奖品 +// @Summary 创建奖品 +// @Tags 积分抽奖,V1.5.0 +// @Accept json +// @Produce json +// @Param data body models.CreatePrizeRequest true "奖品信息" +// @Success 200 {object} models.CreatePrizeResp +// @Router /api/v1/lottery/prize/create [post] +func CreateLotteryPrize(c *gin.Context) { + var req model.CreatePrizeRequest + if err := c.ShouldBindJSON(&req); err != nil { + app.Error(c, http.StatusBadRequest, nil, "参数错误: "+err.Error()) + return + } + + prize := model.LotteryPrize{ + Name: req.Name, + PrizeType: req.PrizeType, + PrizeValue: req.PrizeValue, + Level: req.Level, + Weight: req.Weight, + Stock: req.Stock, + Status: req.Status, + UnlockUserCount: req.UnlockUserCount, + UnlockTotalCount: req.UnlockTotalCount, + Images: req.Images, + } + + if err := orm.Eloquent.Create(&prize).Error; err != nil { + app.Error(c, http.StatusInternalServerError, nil, "创建失败: "+err.Error()) + return + } + + app.OK(c, model.CreatePrizeResp{ID: prize.ID}, "创建成功") +} + +// UpdateLotteryPrize 编辑奖品 +// @Summary 编辑奖品 +// @Tags 积分抽奖,V1.5.0 +// @Accept json +// @Produce json +// @Param data body models.UpdatePrizeRequest true "奖品信息" +// @Success 200 {object} models.CreatePrizeResp +// @Router /api/v1/lottery/prize/update [post] +func UpdateLotteryPrize(c *gin.Context) { + var req model.UpdatePrizeRequest + if err := c.ShouldBindJSON(&req); err != nil { + app.Error(c, http.StatusBadRequest, nil, "参数错误: "+err.Error()) + return + } + + var prize model.LotteryPrize + if err := orm.Eloquent.First(&prize, req.ID).Error; err != nil { + app.Error(c, http.StatusNotFound, nil, "未找到该奖品") + return + } + + // 更新字段 + prize.Name = req.Name + prize.PrizeType = req.PrizeType + prize.PrizeValue = req.PrizeValue + prize.Level = req.Level + prize.Weight = req.Weight + prize.Stock = req.Stock + prize.Status = req.Status + prize.UnlockUserCount = req.UnlockUserCount + prize.UnlockTotalCount = req.UnlockTotalCount + prize.Images = req.Images + + if err := orm.Eloquent.Save(&prize).Error; err != nil { + app.Error(c, http.StatusInternalServerError, nil, "更新失败: "+err.Error()) + return + } + + app.OK(c, model.CreatePrizeResp{ID: prize.ID}, "编辑成功") +} + +// DeleteLotteryPrize 删除奖品 +// @Summary 删除奖品 +// @Tags 积分抽奖,V1.5.0 +// @Accept json +// @Produce json +// @Param data body models.DeletePrizeRequest true "奖品ID" +// @Success 200 {object} app.Response +// @Router /api/v1/lottery/prize/delete [post] +func DeleteLotteryPrize(c *gin.Context) { + var req model.DeletePrizeRequest + if err := c.ShouldBindJSON(&req); err != nil { + app.Error(c, http.StatusBadRequest, nil, "参数错误: "+err.Error()) + return + } + + if err := orm.Eloquent.Delete(&model.LotteryPrize{}, req.ID).Error; err != nil { + app.Error(c, http.StatusInternalServerError, nil, "删除失败: "+err.Error()) + return + } + + app.OK(c, nil, "删除成功") +} + +// LotteryPrizeList 查询奖品列表(分页) +// @Summary 查询奖品列表 +// @Tags 积分抽奖,V1.5.0 +// @Accept json +// @Produce json +// @Param data body models.PrizeListRequest true "查询参数" +// @Success 200 {object} models.PrizeListResponse +// @Router /api/v1/lottery/prize/list [post] +func LotteryPrizeList(c *gin.Context) { + var req model.PrizeListRequest + if err := c.ShouldBindJSON(&req); err != nil { + app.Error(c, http.StatusBadRequest, nil, "参数错误") + return + } + + if req.Page <= 0 { + req.Page = 1 + } + if req.PageSize <= 0 { + req.PageSize = 10 + } + + // 查询启用状态奖品的总权重(或根据筛选条件的权重) + weightDB := orm.Eloquent.Model(&model.LotteryPrize{}) + if req.Status != 0 { + weightDB = weightDB.Where("status = ?", req.Status) + } + if req.Level > 0 { + weightDB = weightDB.Where("level = ?", req.Level) + } + if req.Name != "" { + weightDB = weightDB.Where("name LIKE ?", "%"+req.Name+"%") + } + + var totalWeight int64 + row := weightDB.Select("SUM(weight)").Row() + if err := row.Scan(&totalWeight); err != nil { + app.Error(c, http.StatusInternalServerError, nil, "计算总权重失败") + return + } + + // 查询分页数据 + db := orm.Eloquent.Model(&model.LotteryPrize{}) + if req.Name != "" { + db = db.Where("name LIKE ?", "%"+req.Name+"%") + } + if req.Status != 0 { + db = db.Where("status = ?", req.Status) + } + if req.Level > 0 { + db = db.Where("level = ?", req.Level) + } + + var total int64 + if err := db.Count(&total).Error; err != nil { + app.Error(c, http.StatusInternalServerError, nil, "查询总数失败") + return + } + + var list []model.LotteryPrize + if err := db.Order("id ASC"). + Offset((req.Page - 1) * req.PageSize). + Limit(req.PageSize). + Find(&list).Error; err != nil { + app.Error(c, http.StatusInternalServerError, nil, "查询失败") + return + } + + // 动态计算中奖概率,避免小概率显示为 0.00% + if totalWeight > 0 { + for i := range list { + rate := float64(list[i].Weight) / float64(totalWeight) * 100 + switch { + case rate >= 1: + list[i].Probability = fmt.Sprintf("%.2f%%", rate) + case rate >= 0.01: + list[i].Probability = fmt.Sprintf("%.4f%%", rate) + default: + list[i].Probability = fmt.Sprintf("%.6f%%", rate) + } + list[i].Probability = model.TrimTrailingZerosFromPercent(list[i].Probability) + } + } else { + for i := range list { + list[i].Probability = "0.000000%" + } + } + + resp := model.PrizeListResponse{ + List: list, + Total: total, + Page: req.Page, + PageSize: req.PageSize, + } + app.OK(c, resp, "查询成功") +} + +// LotteryRecordList 查询抽奖记录列表 +// @Summary 查询抽奖记录列表 +// @Tags 积分抽奖,V1.5.0 +// @Accept json +// @Produce json +// @Param data body models.LotteryRecordListRequest true "查询参数" +// @Success 200 {object} models.LotteryRecordListResponse +// @Router /api/v1/lottery/record/list [post] +func LotteryRecordList(c *gin.Context) { + var req model.LotteryRecordListRequest + if err := c.ShouldBindJSON(&req); err != nil { + app.Error(c, http.StatusBadRequest, nil, "参数错误") + return + } + + if req.Page <= 0 { + req.Page = 1 + } + if req.PageSize <= 0 { + req.PageSize = 10 + } + + db := orm.Eloquent.Model(&model.LotteryRecord{}). + Select(`lottery_record.id, + lottery_record.created_at, + lottery_record.updated_at, + lottery_record.deleted_at, + lottery_record.uid, + lottery_record.prize_id, + lottery_record.prize_name, + lottery_record.prize_type, + lottery_record.prize_level, + lottery_record.prize_value, + lottery_record.status, + lottery_record.is_win, + user.tel, + user.store_id as store_id, + user.member_level, + store.name as store_name`). + Joins("LEFT JOIN user ON user.uid = lottery_record.uid"). + Joins("LEFT JOIN store ON store.id = user.store_id") + + // 构建基础查询 + query := orm.Eloquent.Model(&model.LotteryRecord{}). + Select(`lottery_record.id, + lottery_record.created_at, + lottery_record.updated_at, + lottery_record.deleted_at, + lottery_record.uid, + lottery_record.prize_id, + lottery_record.prize_name, + lottery_record.prize_type, + lottery_record.prize_level, + lottery_record.prize_value, + lottery_record.status, + lottery_record.is_win, + user.tel, + user.store_id as store_id, + user.member_level, + store.name as store_name`). + Joins("LEFT JOIN user ON user.uid = lottery_record.uid"). + Joins("LEFT JOIN store ON store.id = user.store_id") + + // 条件过滤 + if req.Uid > 0 { + db = db.Where("lottery_record.uid = ?", req.Uid) + query = query.Where("lottery_record.uid = ?", req.Uid) + } + if req.Tel != "" { + db = db.Where("user.tel = ?", req.Tel) + query = query.Where("user.tel = ?", req.Tel) + } + if req.StoreId > 0 { + db = db.Where("user.store_id = ?", req.StoreId) + query = query.Where("user.store_id = ?", req.StoreId) + } + if req.MemberLevel > 0 { + db = db.Where("user.member_level = ?", req.MemberLevel) + query = query.Where("user.member_level = ?", req.MemberLevel) + } + if req.PrizeLevel > 0 { + db = db.Where("lottery_record.prize_level = ?", req.PrizeLevel) + query = query.Where("lottery_record.prize_level = ?", req.PrizeLevel) + } + if req.StartTime != "" { + if t, err := time.Parse("2006-01-02", req.StartTime); err == nil { + db = db.Where("lottery_record.created_at >= ?", t) + query = query.Where("lottery_record.created_at >= ?", t) + } + } + // 根据 win_status 筛选记录:0=全部,1=已中奖,2=未中奖 + switch req.WinStatus { + case 1: + db = db.Where("lottery_record.is_win = ?", true) + case 2: + db = db.Where("lottery_record.is_win = ?", false) + } + if req.EndTime != "" { + if t, err := time.Parse("2006-01-02", req.EndTime); err == nil { + db = db.Where("lottery_record.created_at <= ?", t.Add(24*time.Hour)) + query = query.Where("lottery_record.created_at <= ?", t.Add(24*time.Hour)) + } + } + + var total int64 + if err := query.Count(&total).Error; err != nil { + app.Error(c, http.StatusInternalServerError, nil, "统计失败") + return + } + + var list []model.LotteryRecordWithUserInfo + if err := db.Order("lottery_record.id DESC"). + Offset((req.Page - 1) * req.PageSize). + Limit(req.PageSize). + Scan(&list).Error; err != nil { + app.Error(c, http.StatusInternalServerError, nil, "查询失败") + return + } + + app.OK(c, model.LotteryRecordListResponse{ + List: list, + Total: total, + Page: req.Page, + PageSize: req.PageSize, + }, "查询成功") +} + +// LotteryPrizeOrderList 查询抽奖订单列表 +// @Summary 查询抽奖订单列表 +// @Tags 积分抽奖,V1.5.0 +// @Accept json +// @Produce json +// @Param data body models.LotteryPrizeOrderListRequest true "查询参数" +// @Success 200 {object} models.LotteryPrizeOrderListResponse +// @Router /api/v1/lottery/prize_order/list [post] +func LotteryPrizeOrderList(c *gin.Context) { + var req model.LotteryPrizeOrderListRequest + if err := c.ShouldBindJSON(&req); err != nil { + app.Error(c, http.StatusBadRequest, nil, "参数错误") + return + } + + if req.Page <= 0 { + req.Page = 1 + } + if req.PageSize <= 0 { + req.PageSize = 10 + } + + db := orm.Eloquent.Model(&model.LotteryPrizeOrder{}). + Select(`lottery_prize_order.*, + user.tel, + user.store_id as store_id, + user.member_level, + store.name as store_name`). + Joins("LEFT JOIN user ON user.uid = lottery_prize_order.uid"). + Joins("LEFT JOIN store ON store.id = user.store_id") + + // 筛选条件 + if req.Uid > 0 { + db = db.Where("lottery_prize_order.uid = ?", req.Uid) + } + if req.Tel != "" { + db = db.Where("lottery_prize_order.tel = ?", req.Tel) + } + if req.StoreId > 0 { + db = db.Where("user.store_id = ?", req.StoreId) + } + if req.MemberLevel > 0 { + db = db.Where("user.member_level = ?", req.MemberLevel) + } + if req.PrizeName != "" { + db = db.Where("lottery_prize_order.prize_name LIKE ?", "%"+req.PrizeName+"%") + } + if req.Status != model.LotteryPrizeOrderStatusAll { + db = db.Where("lottery_prize_order.status = ?", req.Status) + } + if req.StartTime != "" { + if t, err := time.Parse("2006-01-02", req.StartTime); err == nil { + db = db.Where("lottery_prize_order.created_at >= ?", t) + } + } + if req.EndTime != "" { + if t, err := time.Parse("2006-01-02", req.EndTime); err == nil { + db = db.Where("lottery_prize_order.created_at <= ?", t.Add(24*time.Hour)) + } + } + + // 分页统计 + var total int64 + if err := db.Count(&total).Error; err != nil { + app.Error(c, http.StatusInternalServerError, nil, "统计失败") + return + } + + var list []model.LotteryPrizeOrderItem + if err := db.Order("lottery_prize_order.id DESC"). + Offset((req.Page - 1) * req.PageSize). + Limit(req.PageSize). + Scan(&list).Error; err != nil { + app.Error(c, http.StatusInternalServerError, nil, "查询失败") + return + } + + app.OK(c, model.LotteryPrizeOrderListResponse{ + List: list, + Total: total, + Page: req.Page, + PageSize: req.PageSize, + }, "查询成功") +} + +// GetLotteryPrizeOrderDetail 查询抽奖订单详情 +// @Summary 查询抽奖订单详情 +// @Tags 积分抽奖,V1.5.0 +// @Accept json +// @Produce json +// @Param data body models.GetLotteryPrizeOrderDetailRequest true "查询参数" +// @Success 200 {object} models.LotteryPrizeOrderDetailResponse +// @Router /api/v1/lottery/prize_order/detail [post] +func GetLotteryPrizeOrderDetail(c *gin.Context) { + var req model.GetLotteryPrizeOrderDetailRequest + if err := c.ShouldBindJSON(&req); err != nil || req.OrderID == 0 { + app.Error(c, http.StatusBadRequest, nil, "参数错误:order_id 必传") + return + } + + var detail model.LotteryPrizeOrderDetailResponse + db := orm.Eloquent.Table("lottery_prize_order"). + Select(`lottery_prize_order.*, + user.wx_name as nickname, + user.tel, + user.member_level, + store.name as store_name, + lottery_prize.prize_type, + lottery_prize.level as prize_level, + lottery_prize.prize_value`). + Joins("LEFT JOIN user ON user.uid = lottery_prize_order.uid"). + Joins("LEFT JOIN store ON store.id = user.store_id"). + Joins("LEFT JOIN lottery_prize ON lottery_prize.id = lottery_prize_order.prize_id"). + Where("lottery_prize_order.id = ?", req.OrderID) + + if err := db.First(&detail).Error; err != nil { + app.Error(c, http.StatusNotFound, nil, "未找到对应的订单记录") + return + } + + app.OK(c, detail, "查询成功") +} + +// ShipLotteryPrizeOrder 抽奖订单发货 +// @Summary 抽奖订单发货 +// @Tags 积分抽奖,V1.5.0 +// @Accept json +// @Produce json +// @Param data body models.ShipLotteryPrizeOrderRequest true "查询参数" +// @Success 200 {object} app.Response +// @Router /api/v1/lottery/prize_order/ship [post] +func ShipLotteryPrizeOrder(c *gin.Context) { + var req model.ShipLotteryPrizeOrderRequest + if err := c.ShouldBindJSON(&req); err != nil { + app.Error(c, http.StatusBadRequest, nil, "参数错误:"+err.Error()) + return + } + + var order model.LotteryPrizeOrder + if err := orm.Eloquent.First(&order, req.OrderID).Error; err != nil { + app.Error(c, http.StatusNotFound, nil, "订单不存在") + return + } + + if order.Status != 0 { + app.Error(c, http.StatusBadRequest, nil, "订单状态不为待发货,无法发货") + return + } + + err := orm.Eloquent.Model(&order).Updates(map[string]interface{}{ + "logistics_company": req.LogisticsCompany, + "logistics_number": req.LogisticsNumber, + "shipped_at": time.Now(), + "status": 1, // 已发货 + }).Error + + if err != nil { + app.Error(c, http.StatusInternalServerError, nil, "发货失败:"+err.Error()) + return + } + + app.OK(c, nil, "发货成功") +} diff --git a/app/admin/apis/message/bus_message.go b/app/admin/apis/message/bus_message.go index 85485fd..11e4e01 100644 --- a/app/admin/apis/message/bus_message.go +++ b/app/admin/apis/message/bus_message.go @@ -13,7 +13,7 @@ import ( // BusMessageCreate 业务消息-新增 // @Summary 业务消息-新增 -// @Tags 消息中心,V1.5.0 +// @Tags 消息中心 // @Produce json // @Accept json // @Param request body models.BusMessageCreateReq true "新增业务消息模型" @@ -64,7 +64,7 @@ func BusMessageCreate(c *gin.Context) { // BusMessageList 业务消息-列表 // @Summary 业务消息-列表 -// @Tags 消息中心,V1.5.0 +// @Tags 消息中心 // @Accept json // @Produce json // @Param request body models.BusMessageListReq true "查询条件" @@ -177,7 +177,7 @@ func BusMessageList(c *gin.Context) { // BusMessageSetStatus 业务消息-设置状态(启用/禁用) // @Summary 业务消息-设置状态(启用/禁用) -// @Tags 消息中心,V1.5.0 +// @Tags 消息中心 // @Accept json // @Produce json // @Param request body models.BusMessageSetStatusReq true "状态更新请求" @@ -225,7 +225,7 @@ func BusMessageSetStatus(c *gin.Context) { // BusMessageDelete 业务消息-删除(禁用状态可删) // @Summary 业务消息-删除(禁用状态可删) -// @Tags 消息中心,V1.5.0 +// @Tags 消息中心 // @Accept json // @Produce json // @Param request body models.BusMessageDeleteReq true "删除业务消息" @@ -279,7 +279,7 @@ func BusMessageDelete(c *gin.Context) { // BusMessageEdit 业务消息-编辑 // @Summary 业务消息-编辑 -// @Tags 消息中心,V1.5.0 +// @Tags 消息中心 // @Accept json // @Produce json // @Param request body models.BusMessageEditReq true "编辑业务消息" @@ -337,7 +337,7 @@ func BusMessageEdit(c *gin.Context) { // BusMessageDetail 业务消息-详情 // @Summary 业务消息-详情 -// @Tags 消息中心,V1.5.0 +// @Tags 消息中心 // @Accept json // @Produce json // @Param request body models.BusMessageDetailReq true "业务消息ID" @@ -396,7 +396,7 @@ func BusMessageDetail(c *gin.Context) { // GetBizTypes 业务消息-查询业务类型 // @Summary 业务消息-查询业务类型 -// @Tags 消息中心,V1.5.0 +// @Tags 消息中心 // @Accept json // @Produce json // @Param request body models.BizTypeListReq true "分页请求" @@ -453,7 +453,7 @@ func GetBizTypes(c *gin.Context) { // GetEventsByBizType 业务消息-查询事件类型 // @Summary 业务消息-查询事件类型 -// @Tags 消息中心,V1.5.0 +// @Tags 消息中心 // @Accept json // @Produce json // @Param request body models.EventListReq true "分页请求" @@ -504,7 +504,7 @@ func GetEventsByBizType(c *gin.Context) { // GetTemplateVariables 业务消息-查询模板变量 // @Summary 业务消息-查询模板变量 -// @Tags 消息中心,V1.5.0 +// @Tags 消息中心 // @Accept json // @Produce json // @Param request body models.TemplateVarReq true "模板变量请求参数" diff --git a/app/admin/apis/message/sys_message.go b/app/admin/apis/message/sys_message.go index 1eb7653..1764285 100644 --- a/app/admin/apis/message/sys_message.go +++ b/app/admin/apis/message/sys_message.go @@ -12,7 +12,7 @@ import ( // SysMessageCreate 公告消息-新增 // @Summary 公告消息-新增 -// @Tags 消息中心,V1.5.0 +// @Tags 消息中心 // @Produce json // @Accept json // @Param request body models.SysMessageCreateReq true "新增公告消息模型" @@ -142,7 +142,7 @@ func SysMessageCreate(c *gin.Context) { // SysMessageEdit 公告消息-编辑 // @Summary 公告消息-编辑 -// @Tags 消息中心,V1.5.0 +// @Tags 消息中心 // @Accept json // @Produce json // @Param request body models.SysMessageEditReq true "编辑公告消息模型" @@ -292,7 +292,7 @@ func SysMessageEdit(c *gin.Context) { // SysMessageSetStatus 公告消息-设置公告消息状态(启用/禁用) // @Summary 公告消息-设置公告消息状态(启用/禁用) -// @Tags 消息中心,V1.5.0 +// @Tags 消息中心 // @Accept json // @Produce json // @Param request body models.SysMessageSetStatusReq true "状态更新请求" @@ -420,7 +420,7 @@ func SysMessageSetStatus(c *gin.Context) { // SysMessageDelete 公告消息-删除(草稿/禁用/过期状态可删) // @Summary 公告消息-删除(草稿/禁用/过期状态可删) -// @Tags 消息中心,V1.5.0 +// @Tags 消息中心 // @Accept json // @Produce json // @Param request body models.SysMessageDeleteReq true "删除公告请求" @@ -484,7 +484,7 @@ func SysMessageDelete(c *gin.Context) { // SysMessageList 公告消息-列表 // @Summary 公告消息-列表 -// @Tags 消息中心,V1.5.0 +// @Tags 消息中心 // @Accept json // @Produce json // @Param request body models.SysMessageListReq true "查询条件" @@ -586,7 +586,7 @@ func SysMessageList(c *gin.Context) { // SysMessageDetail 公告消息-详情 // @Summary 公告消息-详情 -// @Tags 消息中心,V1.5.0 +// @Tags 消息中心 // @Accept json // @Produce json // @Param request body models.SysMessageDetailReq true "公告消息ID" diff --git a/app/admin/apis/message/user_message.go b/app/admin/apis/message/user_message.go index d58449d..cd9bfad 100644 --- a/app/admin/apis/message/user_message.go +++ b/app/admin/apis/message/user_message.go @@ -13,7 +13,7 @@ import ( // UserMessageList 用户消息-列表 // @Summary 用户消息-列表 // @Description 获取当前用户的消息记录 -// @Tags 消息中心,V1.5.0 +// @Tags 消息中心 // @Accept json // @Produce json // @Param data body models.UserMessageListReq true "消息查询参数" @@ -121,7 +121,7 @@ func UserMessageList(c *gin.Context) { // UserMessageSetStatus 用户消息-设置已读(支持单条或全部) // @Summary 用户消息-设置已读(支持单条或全部) // @Description 设为单条或全部已读 -// @Tags 消息中心,V1.5.0 +// @Tags 消息中心 // @Accept json // @Produce json // @Param data body models.UserMessageSetStatusReq true "设置参数" @@ -164,7 +164,7 @@ func UserMessageSetStatus(c *gin.Context) { // UserMessageDelete 用户消息-删除(支持单条、批量或全部) // @Summary 用户消息-删除(支持单条、批量或全部) // @Description 删除指定消息、批量消息或全部消息(逻辑删除,限当前用户) -// @Tags 消息中心,V1.5.0 +// @Tags 消息中心 // @Accept json // @Produce json // @Param data body models.UserMessageDeleteReq true "删除参数" diff --git a/app/admin/models/dispose_config.go b/app/admin/models/dispose_config.go index f4f820b..9a1b15e 100644 --- a/app/admin/models/dispose_config.go +++ b/app/admin/models/dispose_config.go @@ -48,6 +48,7 @@ const ( ConfigErpOrderShowInfo = "erp_order_show_config" // 零售订单显示设置 ConfigSystemSmsCount = "sms_config" // 获取系统每月短信限额 ConfigTestUserInfo = "test_user_Info" // 获取测试用户uid + ConfigNameLotteryLimit = "lottery_config" // 积分抽奖配置 ) func PayConfigInfo() (*PayConfig, error) { @@ -630,3 +631,27 @@ func GetTestUserConfig() ([]UserInfo, error) { return users, nil } + +type LotteryConfig struct { + CostPerDraw uint `json:"cost_per_draw"` // 单次抽奖积分 + DailyLimit uint `json:"daily_limit"` // 每日抽奖上限 + LotteryEnabled bool `json:"lottery_enabled"` // 是否开启抽奖功能 +} + +func GetLotteryConfig() (*LotteryConfig, error) { + var config Config + err := orm.Eloquent.Table("config").Where("name=?", ConfigNameLotteryLimit).Find(&config).Error + if err != nil { + logger.Errorf("读取配置失败:", err) + return nil, err + } + + var lotteryCfg LotteryConfig + err = json.Unmarshal([]byte(config.Value), &lotteryCfg) + if err != nil { + logger.Errorf("配置解析失败:", err) + return nil, err + } + + return &lotteryCfg, nil +} diff --git a/app/admin/models/lottery.go b/app/admin/models/lottery.go new file mode 100644 index 0000000..8ba191c --- /dev/null +++ b/app/admin/models/lottery.go @@ -0,0 +1,213 @@ +package models + +import ( + "strings" + "time" +) + +const ( + LotteryPrizeOrderStatusAll = 4 // 全部 +) + +// LotteryPrize 奖品信息表(抽奖) +type LotteryPrize struct { + Model + + Name string `json:"name"` // 奖品名称 + PrizeType int `json:"prize_type"` // 奖品类型:1-积分 2-优惠券 3-实物 0-谢谢参与 + PrizeValue int `json:"prize_value"` // 奖品值(积分数或券ID等) + Level int `json:"level"` // 奖品等级,如1等奖、2等奖等 + Weight int `json:"weight"` // 抽奖权重 + Stock int `json:"stock"` // 剩余库存 + Status int `json:"status"` // 奖品状态:1-启用 2-禁用 + UnlockUserCount int `json:"unlock_user_count"` // 解锁条件:用户个人抽奖次数 + UnlockTotalCount int `json:"unlock_total_count"` // 解锁条件:所有用户总抽奖次数 + Images string `json:"images"` // 奖品图片 + Probability string `json:"probability" gorm:"-"` // 中奖概率(例如 0.001%) +} + +// LotteryRecord 抽奖记录 +type LotteryRecord struct { + Model + + Uid uint `json:"uid"` // 用户ID + PrizeId uint `json:"prize_id"` // 奖品ID + PrizeName string `json:"prize_name"` // 奖品名称 + PrizeType int `json:"prize_type"` // 奖品类型 + PrizeLevel int `json:"prize_level"` // 奖品等级 + PrizeValue int `json:"prize_value"` // 奖品值(积分数或券ID等) + Status int `json:"status"` // 状态:0-待处理 1-已发放 2-处理中 3-失败 + IsWin bool `json:"is_win"` // 是否中奖(false 表示“谢谢参与”等无奖项) +} + +// LotteryPrizeOrder 抽奖奖品订单(包含用户收件信息、物流信息、发货状态) +type LotteryPrizeOrder struct { + Model + + RecordId uint `json:"record_id"` // 抽奖记录ID + Uid uint `json:"uid"` // 用户ID + Tel string `json:"tel"` // 用户手机号 + PrizeId uint `json:"prize_id"` // 奖品ID + PrizeName string `json:"prize_name"` // 奖品名称 + + // 用户提交的收货信息 + ReceiverName string `json:"receiver_name"` // 收件人 + ReceiverPhone string `json:"receiver_phone"` // 收件人手机号 + ReceiverAddr string `json:"receiver_addr"` // 收件地址 + + // 发货信息 + LogisticsCompany string `json:"logistics_company"` // 快递公司 + LogisticsNumber string `json:"logistics_number"` // 快递单号 + ShippedAt time.Time `json:"shipped_at"` // 发货时间 + ReceivedAt time.Time `json:"received_at"` // 收货时间 + + Status int `json:"status"` // 发货状态:0-待发货 1-已发货 2-已收货 3-取消 +} + +type UpdateLotteryConfigRequest struct { + CostPerDraw uint `json:"cost_per_draw" binding:"required"` + DailyLimit uint `json:"daily_limit" binding:"required"` + LotteryEnabled bool `json:"lottery_enabled"` +} + +type CreatePrizeRequest struct { + Name string `json:"name" binding:"required"` // 奖品名称 + PrizeType int `json:"prize_type" binding:"required"` // 奖品类型:1-积分,2-优惠券,3-实物,0-谢谢参与 + PrizeValue int `json:"prize_value"` // 奖品值:积分数或优惠券ID等 + Level int `json:"level"` // 奖品等级:如1表示一等奖,2表示二等奖 + Weight int `json:"weight" binding:"required"` // 抽奖权重:数值越大,概率越高 + Stock int `json:"stock"` // 库存数量:表示奖品剩余可发放数量 + Status int `json:"status"` // 奖品状态:1-启用,2-禁用 + UnlockUserCount int `json:"unlock_user_count"` // 解锁条件:用户个人累计抽奖次数达到该值后解锁 + UnlockTotalCount int `json:"unlock_total_count"` // 解锁条件:平台所有用户累计抽奖次数达到该值后解锁 + Images string `json:"images"` // 奖品图片 +} + +type UpdatePrizeRequest struct { + ID uint `json:"id" binding:"required"` // 奖品ID + Name string `json:"name"` // 奖品名称 + PrizeType int `json:"prize_type"` // 奖品类型:1-积分,2-优惠券,3-实物,0-谢谢参与 + PrizeValue int `json:"prize_value"` // 奖品值:积分数或优惠券ID等 + Level int `json:"level"` // 奖品等级:如1表示一等奖 + Weight int `json:"weight"` // 抽奖权重:用于控制中奖概率 + Stock int `json:"stock"` // 剩余库存 + Status int `json:"status"` // 奖品状态:1-启用,2-禁用 + UnlockUserCount int `json:"unlock_user_count"` // 用户抽奖次数达到该值后解锁该奖品 + UnlockTotalCount int `json:"unlock_total_count"` // 全部用户总抽奖次数达到该值后解锁奖品 + Images string `json:"images"` // 奖品图片 +} + +// CreatePrizeResp 创建成功响应 +type CreatePrizeResp struct { + ID uint32 `json:"id"` +} + +type DeletePrizeRequest struct { + ID uint `json:"id" binding:"required"` // 奖品ID +} + +type PrizeListRequest struct { + Page int `json:"page_index"` // 页码 + PageSize int `json:"page_size"` // 每页条数 + Name string `json:"name"` // 奖品名称(模糊搜索) + Status int `json:"status"` // 奖品状态:1-启用,2-禁用(不传则全部) + Level int `json:"level"` // 奖品等级(如 1 表示一等奖) +} + +type PrizeListResponse struct { + List []LotteryPrize `json:"list"` // 奖品列表 + Total int64 `json:"total"` // 总数 + Page int `json:"page_index"` // 页码 + PageSize int `json:"page_size"` // 每页条数 +} + +type LotteryRecordListRequest struct { + Page int `json:"page_index"` // 页码 + PageSize int `json:"page_size"` // 每页条数 + Uid uint `json:"uid"` // 用户ID + Tel string `json:"tel"` // 手机号 + StoreId uint64 `json:"store_id"` // 门店ID + MemberLevel uint32 `json:"member_level"` // 会员等级 + StartTime string `json:"start_time"` // 抽奖开始时间 + EndTime string `json:"end_time"` // 抽奖结束时间 + PrizeLevel int `json:"prize_level"` // 奖品等级 + WinStatus int `json:"win_status"` // 新增字段:0=全部,1=已中奖,2=未中奖 +} + +type LotteryRecordWithUserInfo struct { + LotteryRecord + Tel string `json:"tel"` + MemberLevel uint32 `json:"member_level"` // 会员等级 + StoreId uint64 `json:"store_id"` // 门店id + StoreName string `json:"store_name"` // 门店名称 +} + +type LotteryRecordListResponse struct { + List []LotteryRecordWithUserInfo `json:"list"` + Total int64 `json:"total"` + Page int `json:"page_index"` // 页码 + PageSize int `json:"page_size"` // 每页条数 +} + +type LotteryPrizeOrderListRequest struct { + Page int `json:"page_index"` // 页码 + PageSize int `json:"page_size"` // 每页条数 + Uid uint `json:"uid"` // 用户ID + Tel string `json:"tel"` // 手机号 + StoreId uint64 `json:"store_id"` // 门店ID + MemberLevel uint32 `json:"member_level"` // 用户会员等级 + PrizeName string `json:"prize_name"` // 奖品名称模糊搜索 + Status int `json:"status"` // 发货状态筛选:0-待发货 1-已发货 2-已收货 3-取消 4-全部 + StartTime string `json:"start_time"` // 抽奖时间开始 + EndTime string `json:"end_time"` // 抽奖时间结束 +} + +type LotteryPrizeOrderItem struct { + LotteryPrizeOrder + + StoreId uint64 `json:"store_id"` // 门店ID + StoreName string `json:"store_name"` // 门店名 + MemberLevel uint32 `json:"member_level"` // 会员等级 +} + +type LotteryPrizeOrderListResponse struct { + List []LotteryPrizeOrderItem `json:"list"` + Total int64 `json:"total"` + Page int `json:"page_index"` // 页码 + PageSize int `json:"page_size"` // 每页条数 +} + +type GetLotteryPrizeOrderDetailRequest struct { + OrderID uint `json:"order_id" binding:"required"` // 奖品订单ID +} + +type LotteryPrizeOrderDetailResponse struct { + LotteryPrizeOrder + + // 用户信息 + Nickname string `json:"nickname"` // 用户昵称 + Tel string `json:"tel"` // 用户手机号 + MemberLevel uint32 `json:"member_level"` // 当前会员等级 + StoreName string `json:"store_name"` // 所属门店 + + // 奖品信息(扩展字段) + PrizeType int `json:"prize_type"` // 奖品类型 + PrizeLevel int `json:"prize_level"` // 奖品等级 + PrizeValue int `json:"prize_value"` // 奖品值 +} + +type ShipLotteryPrizeOrderRequest struct { + OrderID uint `json:"order_id" binding:"required"` // 奖品订单ID + LogisticsCompany string `json:"logistics_company" binding:"required"` // 快递公司 + LogisticsNumber string `json:"logistics_number" binding:"required"` // 快递单号 +} + +func TrimTrailingZerosFromPercent(s string) string { + // 去掉最后的 "%" + s = strings.TrimSuffix(s, "%") + // 去掉小数部分末尾的 0 + s = strings.TrimRight(s, "0") + // 如果小数点在最后,也去掉 + s = strings.TrimRight(s, ".") + return s + "%" +} diff --git a/app/admin/router/lottery.go b/app/admin/router/lottery.go new file mode 100644 index 0000000..d5395d1 --- /dev/null +++ b/app/admin/router/lottery.go @@ -0,0 +1,24 @@ +package router + +import ( + "github.com/gin-gonic/gin" + "go-admin/app/admin/apis/lotterymanage" + "go-admin/app/admin/middleware" + jwt "go-admin/pkg/jwtauth" +) + +func registerLotteryRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) { + router := v1.Group("/lottery").Use(authMiddleware.MiddlewareFunc()).Use(middleware.AuthCheckRole()) + { + router.POST("/config/public", lotterymanage.GetPublicLotteryConfigHandler) // 公开查询抽奖配置 + router.POST("/config/update", lotterymanage.UpdateLotteryConfig) // 设置积分抽奖参数 + router.POST("/prize/create", lotterymanage.CreateLotteryPrize) // 新增奖品 + router.POST("/prize/update", lotterymanage.UpdateLotteryPrize) // 编辑奖品 + router.POST("/prize/delete", lotterymanage.DeleteLotteryPrize) // 删除奖品 + router.POST("/prize/list", lotterymanage.LotteryPrizeList) // 奖品列表 + router.POST("/record/list", lotterymanage.LotteryRecordList) // 查询抽奖记录列表 + router.POST("/prize_order/list", lotterymanage.LotteryPrizeOrderList) // 查询抽奖订单列表 + router.POST("/prize_order/detail", lotterymanage.GetLotteryPrizeOrderDetail) // 查询抽奖订单详情 + router.POST("/prize_order/ship", lotterymanage.ShipLotteryPrizeOrder) // 抽奖订单发货 + } +} diff --git a/app/admin/router/router.go b/app/admin/router/router.go index 37513df..2096fad 100644 --- a/app/admin/router/router.go +++ b/app/admin/router/router.go @@ -121,4 +121,6 @@ func examplesCheckRoleRouter(r *gin.Engine, authMiddleware *jwtauth.GinJWTMiddle registerRepairRouter(v1, authMiddleware) // 消息中心 registerMessageCenterRouter(v1, authMiddleware) + // 积分抽奖 + registerLotteryRouter(v1, authMiddleware) } diff --git a/docs/docs.go b/docs/docs.go index c98ad28..bb549ce 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -24,7 +24,7 @@ const docTemplate = `{ "application/json" ], "tags": [ - "消息中心,V1.5.0" + "消息中心" ], "summary": "业务消息-查询业务类型", "parameters": [ @@ -57,7 +57,7 @@ const docTemplate = `{ "application/json" ], "tags": [ - "消息中心,V1.5.0" + "消息中心" ], "summary": "业务消息-新增", "parameters": [ @@ -90,7 +90,7 @@ const docTemplate = `{ "application/json" ], "tags": [ - "消息中心,V1.5.0" + "消息中心" ], "summary": "业务消息-删除(禁用状态可删)", "parameters": [ @@ -123,7 +123,7 @@ const docTemplate = `{ "application/json" ], "tags": [ - "消息中心,V1.5.0" + "消息中心" ], "summary": "业务消息-详情", "parameters": [ @@ -156,7 +156,7 @@ const docTemplate = `{ "application/json" ], "tags": [ - "消息中心,V1.5.0" + "消息中心" ], "summary": "业务消息-编辑", "parameters": [ @@ -189,7 +189,7 @@ const docTemplate = `{ "application/json" ], "tags": [ - "消息中心,V1.5.0" + "消息中心" ], "summary": "业务消息-查询事件类型", "parameters": [ @@ -222,7 +222,7 @@ const docTemplate = `{ "application/json" ], "tags": [ - "消息中心,V1.5.0" + "消息中心" ], "summary": "业务消息-列表", "parameters": [ @@ -255,7 +255,7 @@ const docTemplate = `{ "application/json" ], "tags": [ - "消息中心,V1.5.0" + "消息中心" ], "summary": "业务消息-设置状态(启用/禁用)", "parameters": [ @@ -288,7 +288,7 @@ const docTemplate = `{ "application/json" ], "tags": [ - "消息中心,V1.5.0" + "消息中心" ], "summary": "业务消息-查询模板变量", "parameters": [ @@ -5166,6 +5166,322 @@ const docTemplate = `{ } } }, + "/api/v1/lottery/config/public": { + "post": { + "produces": [ + "application/json" + ], + "tags": [ + "积分抽奖,V1.5.0" + ], + "summary": "查询抽奖模块配置(公开)", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/models.LotteryConfig" + } + } + } + } + }, + "/api/v1/lottery/config/update": { + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "积分抽奖,V1.5.0" + ], + "summary": "更新积分抽奖参数配置", + "parameters": [ + { + "description": "抽奖配置", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.UpdateLotteryConfigRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/app.Response" + } + } + } + } + }, + "/api/v1/lottery/prize/create": { + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "积分抽奖,V1.5.0" + ], + "summary": "创建奖品", + "parameters": [ + { + "description": "奖品信息", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.CreatePrizeRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/models.CreatePrizeResp" + } + } + } + } + }, + "/api/v1/lottery/prize/delete": { + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "积分抽奖,V1.5.0" + ], + "summary": "删除奖品", + "parameters": [ + { + "description": "奖品ID", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.DeletePrizeRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/app.Response" + } + } + } + } + }, + "/api/v1/lottery/prize/list": { + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "积分抽奖,V1.5.0" + ], + "summary": "查询奖品列表", + "parameters": [ + { + "description": "查询参数", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.PrizeListRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/models.PrizeListResponse" + } + } + } + } + }, + "/api/v1/lottery/prize/update": { + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "积分抽奖,V1.5.0" + ], + "summary": "编辑奖品", + "parameters": [ + { + "description": "奖品信息", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.UpdatePrizeRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/models.CreatePrizeResp" + } + } + } + } + }, + "/api/v1/lottery/prize_order/detail": { + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "积分抽奖,V1.5.0" + ], + "summary": "查询抽奖订单详情", + "parameters": [ + { + "description": "查询参数", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.GetLotteryPrizeOrderDetailRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/models.LotteryPrizeOrderDetailResponse" + } + } + } + } + }, + "/api/v1/lottery/prize_order/list": { + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "积分抽奖,V1.5.0" + ], + "summary": "查询抽奖订单列表", + "parameters": [ + { + "description": "查询参数", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.LotteryPrizeOrderListRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/models.LotteryPrizeOrderListResponse" + } + } + } + } + }, + "/api/v1/lottery/prize_order/ship": { + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "积分抽奖,V1.5.0" + ], + "summary": "抽奖订单发货", + "parameters": [ + { + "description": "查询参数", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.ShipLotteryPrizeOrderRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/app.Response" + } + } + } + } + }, + "/api/v1/lottery/record/list": { + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "积分抽奖,V1.5.0" + ], + "summary": "查询抽奖记录列表", + "parameters": [ + { + "description": "查询参数", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.LotteryRecordListRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/models.LotteryRecordListResponse" + } + } + } + } + }, "/api/v1/mall/goods/create": { "post": { "consumes": [ @@ -7573,7 +7889,7 @@ const docTemplate = `{ "application/json" ], "tags": [ - "消息中心,V1.5.0" + "消息中心" ], "summary": "公告消息-新增", "parameters": [ @@ -7606,7 +7922,7 @@ const docTemplate = `{ "application/json" ], "tags": [ - "消息中心,V1.5.0" + "消息中心" ], "summary": "公告消息-删除(草稿/禁用/过期状态可删)", "parameters": [ @@ -7639,7 +7955,7 @@ const docTemplate = `{ "application/json" ], "tags": [ - "消息中心,V1.5.0" + "消息中心" ], "summary": "公告消息-详情", "parameters": [ @@ -7672,7 +7988,7 @@ const docTemplate = `{ "application/json" ], "tags": [ - "消息中心,V1.5.0" + "消息中心" ], "summary": "公告消息-编辑", "parameters": [ @@ -7705,7 +8021,7 @@ const docTemplate = `{ "application/json" ], "tags": [ - "消息中心,V1.5.0" + "消息中心" ], "summary": "公告消息-列表", "parameters": [ @@ -7738,7 +8054,7 @@ const docTemplate = `{ "application/json" ], "tags": [ - "消息中心,V1.5.0" + "消息中心" ], "summary": "公告消息-设置公告消息状态(启用/禁用)", "parameters": [ @@ -8202,7 +8518,7 @@ const docTemplate = `{ "application/json" ], "tags": [ - "消息中心,V1.5.0" + "消息中心" ], "summary": "用户消息-删除(支持单条、批量或全部)", "parameters": [ @@ -8236,7 +8552,7 @@ const docTemplate = `{ "application/json" ], "tags": [ - "消息中心,V1.5.0" + "消息中心" ], "summary": "用户消息-列表", "parameters": [ @@ -8270,7 +8586,7 @@ const docTemplate = `{ "application/json" ], "tags": [ - "消息中心,V1.5.0" + "消息中心" ], "summary": "用户消息-设置已读(支持单条或全部)", "parameters": [ @@ -10360,6 +10676,64 @@ const docTemplate = `{ } } }, + "models.CreatePrizeRequest": { + "type": "object", + "required": [ + "name", + "prize_type", + "weight" + ], + "properties": { + "images": { + "description": "奖品图片", + "type": "string" + }, + "level": { + "description": "奖品等级:如1表示一等奖,2表示二等奖", + "type": "integer" + }, + "name": { + "description": "奖品名称", + "type": "string" + }, + "prize_type": { + "description": "奖品类型:1-积分,2-优惠券,3-实物,0-谢谢参与", + "type": "integer" + }, + "prize_value": { + "description": "奖品值:积分数或优惠券ID等", + "type": "integer" + }, + "status": { + "description": "奖品状态:1-启用,2-禁用", + "type": "integer" + }, + "stock": { + "description": "库存数量:表示奖品剩余可发放数量", + "type": "integer" + }, + "unlock_total_count": { + "description": "解锁条件:平台所有用户累计抽奖次数达到该值后解锁", + "type": "integer" + }, + "unlock_user_count": { + "description": "解锁条件:用户个人累计抽奖次数达到该值后解锁", + "type": "integer" + }, + "weight": { + "description": "抽奖权重:数值越大,概率越高", + "type": "integer" + } + } + }, + "models.CreatePrizeResp": { + "type": "object", + "properties": { + "id": { + "type": "integer" + } + } + }, "models.DailyReport": { "type": "object", "properties": { @@ -10671,6 +11045,18 @@ const docTemplate = `{ } } }, + "models.DeletePrizeRequest": { + "type": "object", + "required": [ + "id" + ], + "properties": { + "id": { + "description": "奖品ID", + "type": "integer" + } + } + }, "models.DemandData": { "type": "object", "properties": { @@ -16756,6 +17142,18 @@ const docTemplate = `{ } } }, + "models.GetLotteryPrizeOrderDetailRequest": { + "type": "object", + "required": [ + "order_id" + ], + "properties": { + "order_id": { + "description": "奖品订单ID", + "type": "integer" + } + } + }, "models.GetSupplierRequest": { "type": "object", "properties": { @@ -18760,6 +19158,456 @@ const docTemplate = `{ } } }, + "models.LotteryConfig": { + "type": "object", + "properties": { + "cost_per_draw": { + "description": "单次抽奖积分", + "type": "integer" + }, + "daily_limit": { + "description": "每日抽奖上限", + "type": "integer" + }, + "lottery_enabled": { + "description": "是否开启抽奖功能", + "type": "boolean" + } + } + }, + "models.LotteryPrize": { + "type": "object", + "properties": { + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "id": { + "description": "数据库记录编号", + "type": "integer" + }, + "images": { + "description": "奖品图片", + "type": "string" + }, + "level": { + "description": "奖品等级,如1等奖、2等奖等", + "type": "integer" + }, + "name": { + "description": "奖品名称", + "type": "string" + }, + "prize_type": { + "description": "奖品类型:1-积分 2-优惠券 3-实物 0-谢谢参与", + "type": "integer" + }, + "prize_value": { + "description": "奖品值(积分数或券ID等)", + "type": "integer" + }, + "probability": { + "description": "中奖概率(例如 0.001%)", + "type": "string" + }, + "status": { + "description": "奖品状态:1-启用 2-禁用", + "type": "integer" + }, + "stock": { + "description": "剩余库存", + "type": "integer" + }, + "unlock_total_count": { + "description": "解锁条件:所有用户总抽奖次数", + "type": "integer" + }, + "unlock_user_count": { + "description": "解锁条件:用户个人抽奖次数", + "type": "integer" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + }, + "weight": { + "description": "抽奖权重", + "type": "integer" + } + } + }, + "models.LotteryPrizeOrderDetailResponse": { + "type": "object", + "properties": { + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "id": { + "description": "数据库记录编号", + "type": "integer" + }, + "logistics_company": { + "description": "发货信息", + "type": "string" + }, + "logistics_number": { + "description": "快递单号", + "type": "string" + }, + "member_level": { + "description": "当前会员等级", + "type": "integer" + }, + "nickname": { + "description": "用户信息", + "type": "string" + }, + "prize_id": { + "description": "奖品ID", + "type": "integer" + }, + "prize_level": { + "description": "奖品等级", + "type": "integer" + }, + "prize_name": { + "description": "奖品名称", + "type": "string" + }, + "prize_type": { + "description": "奖品信息(扩展字段)", + "type": "integer" + }, + "prize_value": { + "description": "奖品值", + "type": "integer" + }, + "received_at": { + "description": "收货时间", + "type": "string" + }, + "receiver_addr": { + "description": "收件地址", + "type": "string" + }, + "receiver_name": { + "description": "用户提交的收货信息", + "type": "string" + }, + "receiver_phone": { + "description": "收件人手机号", + "type": "string" + }, + "record_id": { + "description": "抽奖记录ID", + "type": "integer" + }, + "shipped_at": { + "description": "发货时间", + "type": "string" + }, + "status": { + "description": "发货状态:0-待发货 1-已发货 2-已收货 3-取消", + "type": "integer" + }, + "store_name": { + "description": "所属门店", + "type": "string" + }, + "tel": { + "description": "用户手机号", + "type": "string" + }, + "uid": { + "description": "用户ID", + "type": "integer" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + } + } + }, + "models.LotteryPrizeOrderItem": { + "type": "object", + "properties": { + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "id": { + "description": "数据库记录编号", + "type": "integer" + }, + "logistics_company": { + "description": "发货信息", + "type": "string" + }, + "logistics_number": { + "description": "快递单号", + "type": "string" + }, + "member_level": { + "description": "会员等级", + "type": "integer" + }, + "prize_id": { + "description": "奖品ID", + "type": "integer" + }, + "prize_name": { + "description": "奖品名称", + "type": "string" + }, + "received_at": { + "description": "收货时间", + "type": "string" + }, + "receiver_addr": { + "description": "收件地址", + "type": "string" + }, + "receiver_name": { + "description": "用户提交的收货信息", + "type": "string" + }, + "receiver_phone": { + "description": "收件人手机号", + "type": "string" + }, + "record_id": { + "description": "抽奖记录ID", + "type": "integer" + }, + "shipped_at": { + "description": "发货时间", + "type": "string" + }, + "status": { + "description": "发货状态:0-待发货 1-已发货 2-已收货 3-取消", + "type": "integer" + }, + "store_id": { + "description": "门店ID", + "type": "integer" + }, + "store_name": { + "description": "门店名", + "type": "string" + }, + "tel": { + "description": "用户手机号", + "type": "string" + }, + "uid": { + "description": "用户ID", + "type": "integer" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + } + } + }, + "models.LotteryPrizeOrderListRequest": { + "type": "object", + "properties": { + "end_time": { + "description": "抽奖时间结束", + "type": "string" + }, + "member_level": { + "description": "用户会员等级", + "type": "integer" + }, + "page_index": { + "description": "页码", + "type": "integer" + }, + "page_size": { + "description": "每页条数", + "type": "integer" + }, + "prize_name": { + "description": "奖品名称模糊搜索", + "type": "string" + }, + "start_time": { + "description": "抽奖时间开始", + "type": "string" + }, + "status": { + "description": "发货状态筛选:0-待发货 1-已发货 2-已收货 3-取消 4-全部", + "type": "integer" + }, + "store_id": { + "description": "门店ID", + "type": "integer" + }, + "tel": { + "description": "手机号", + "type": "string" + }, + "uid": { + "description": "用户ID", + "type": "integer" + } + } + }, + "models.LotteryPrizeOrderListResponse": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/models.LotteryPrizeOrderItem" + } + }, + "page_index": { + "description": "页码", + "type": "integer" + }, + "page_size": { + "description": "每页条数", + "type": "integer" + }, + "total": { + "type": "integer" + } + } + }, + "models.LotteryRecordListRequest": { + "type": "object", + "properties": { + "end_time": { + "description": "抽奖结束时间", + "type": "string" + }, + "member_level": { + "description": "会员等级", + "type": "integer" + }, + "page_index": { + "description": "页码", + "type": "integer" + }, + "page_size": { + "description": "每页条数", + "type": "integer" + }, + "prize_level": { + "description": "奖品等级", + "type": "integer" + }, + "start_time": { + "description": "抽奖开始时间", + "type": "string" + }, + "store_id": { + "description": "门店ID", + "type": "integer" + }, + "tel": { + "description": "手机号", + "type": "string" + }, + "uid": { + "description": "用户ID", + "type": "integer" + }, + "win_status": { + "description": "新增字段:0=全部,1=已中奖,2=未中奖", + "type": "integer" + } + } + }, + "models.LotteryRecordListResponse": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/models.LotteryRecordWithUserInfo" + } + }, + "page_index": { + "description": "页码", + "type": "integer" + }, + "page_size": { + "description": "每页条数", + "type": "integer" + }, + "total": { + "type": "integer" + } + } + }, + "models.LotteryRecordWithUserInfo": { + "type": "object", + "properties": { + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "id": { + "description": "数据库记录编号", + "type": "integer" + }, + "is_win": { + "description": "是否中奖(false 表示“谢谢参与”等无奖项)", + "type": "boolean" + }, + "member_level": { + "description": "会员等级", + "type": "integer" + }, + "prize_id": { + "description": "奖品ID", + "type": "integer" + }, + "prize_level": { + "description": "奖品等级", + "type": "integer" + }, + "prize_name": { + "description": "奖品名称", + "type": "string" + }, + "prize_type": { + "description": "奖品类型", + "type": "integer" + }, + "prize_value": { + "description": "奖品值(积分数或券ID等)", + "type": "integer" + }, + "status": { + "description": "状态:0-待处理 1-已发放 2-处理中 3-失败", + "type": "integer" + }, + "store_id": { + "description": "门店id", + "type": "integer" + }, + "store_name": { + "description": "门店名称", + "type": "string" + }, + "tel": { + "type": "string" + }, + "uid": { + "description": "用户ID", + "type": "integer" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + } + } + }, "models.MallUserVmRecordData": { "type": "object", "properties": { @@ -19446,6 +20294,10 @@ const docTemplate = `{ "description": "订单编号", "type": "string" }, + "overdue_flag": { + "description": "超期处理标志:1", + "type": "integer" + }, "pay_price": { "description": "实际付款金额(包含运费)", "type": "integer" @@ -19459,6 +20311,7 @@ const docTemplate = `{ "type": "string" }, "phone_ext": { + "description": "用户手机号后四位", "type": "string" }, "pickup_code": { @@ -19490,6 +20343,7 @@ const docTemplate = `{ "type": "string" }, "revert_shopper_code": { + "description": "店员识别码", "type": "string" }, "revert_store_id": { @@ -19973,6 +20827,55 @@ const docTemplate = `{ } } }, + "models.PrizeListRequest": { + "type": "object", + "properties": { + "level": { + "description": "奖品等级(如 1 表示一等奖)", + "type": "integer" + }, + "name": { + "description": "奖品名称(模糊搜索)", + "type": "string" + }, + "page_index": { + "description": "页码", + "type": "integer" + }, + "page_size": { + "description": "每页条数", + "type": "integer" + }, + "status": { + "description": "奖品状态:1-启用,2-禁用(不传则全部)", + "type": "integer" + } + } + }, + "models.PrizeListResponse": { + "type": "object", + "properties": { + "list": { + "description": "奖品列表", + "type": "array", + "items": { + "$ref": "#/definitions/models.LotteryPrize" + } + }, + "page_index": { + "description": "页码", + "type": "integer" + }, + "page_size": { + "description": "每页条数", + "type": "integer" + }, + "total": { + "description": "总数", + "type": "integer" + } + } + }, "models.ProductInfo": { "type": "object", "properties": { @@ -21581,6 +22484,28 @@ const docTemplate = `{ } } }, + "models.ShipLotteryPrizeOrderRequest": { + "type": "object", + "required": [ + "logistics_company", + "logistics_number", + "order_id" + ], + "properties": { + "logistics_company": { + "description": "快递公司", + "type": "string" + }, + "logistics_number": { + "description": "快递单号", + "type": "string" + }, + "order_id": { + "description": "奖品订单ID", + "type": "integer" + } + } + }, "models.ShopperPromotionCode": { "type": "object", "properties": { @@ -23324,6 +24249,76 @@ const docTemplate = `{ } } }, + "models.UpdateLotteryConfigRequest": { + "type": "object", + "required": [ + "cost_per_draw", + "daily_limit" + ], + "properties": { + "cost_per_draw": { + "type": "integer" + }, + "daily_limit": { + "type": "integer" + }, + "lottery_enabled": { + "type": "boolean" + } + } + }, + "models.UpdatePrizeRequest": { + "type": "object", + "required": [ + "id" + ], + "properties": { + "id": { + "description": "奖品ID", + "type": "integer" + }, + "images": { + "description": "奖品图片", + "type": "string" + }, + "level": { + "description": "奖品等级:如1表示一等奖", + "type": "integer" + }, + "name": { + "description": "奖品名称", + "type": "string" + }, + "prize_type": { + "description": "奖品类型:1-积分,2-优惠券,3-实物,0-谢谢参与", + "type": "integer" + }, + "prize_value": { + "description": "奖品值:积分数或优惠券ID等", + "type": "integer" + }, + "status": { + "description": "奖品状态:1-启用,2-禁用", + "type": "integer" + }, + "stock": { + "description": "剩余库存", + "type": "integer" + }, + "unlock_total_count": { + "description": "全部用户总抽奖次数达到该值后解锁奖品", + "type": "integer" + }, + "unlock_user_count": { + "description": "用户抽奖次数达到该值后解锁该奖品", + "type": "integer" + }, + "weight": { + "description": "抽奖权重:用于控制中奖概率", + "type": "integer" + } + } + }, "models.UserInfo": { "type": "object", "properties": { diff --git a/docs/swagger.json b/docs/swagger.json index bb7b43d..cac5697 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -13,7 +13,7 @@ "application/json" ], "tags": [ - "消息中心,V1.5.0" + "消息中心" ], "summary": "业务消息-查询业务类型", "parameters": [ @@ -46,7 +46,7 @@ "application/json" ], "tags": [ - "消息中心,V1.5.0" + "消息中心" ], "summary": "业务消息-新增", "parameters": [ @@ -79,7 +79,7 @@ "application/json" ], "tags": [ - "消息中心,V1.5.0" + "消息中心" ], "summary": "业务消息-删除(禁用状态可删)", "parameters": [ @@ -112,7 +112,7 @@ "application/json" ], "tags": [ - "消息中心,V1.5.0" + "消息中心" ], "summary": "业务消息-详情", "parameters": [ @@ -145,7 +145,7 @@ "application/json" ], "tags": [ - "消息中心,V1.5.0" + "消息中心" ], "summary": "业务消息-编辑", "parameters": [ @@ -178,7 +178,7 @@ "application/json" ], "tags": [ - "消息中心,V1.5.0" + "消息中心" ], "summary": "业务消息-查询事件类型", "parameters": [ @@ -211,7 +211,7 @@ "application/json" ], "tags": [ - "消息中心,V1.5.0" + "消息中心" ], "summary": "业务消息-列表", "parameters": [ @@ -244,7 +244,7 @@ "application/json" ], "tags": [ - "消息中心,V1.5.0" + "消息中心" ], "summary": "业务消息-设置状态(启用/禁用)", "parameters": [ @@ -277,7 +277,7 @@ "application/json" ], "tags": [ - "消息中心,V1.5.0" + "消息中心" ], "summary": "业务消息-查询模板变量", "parameters": [ @@ -5155,6 +5155,322 @@ } } }, + "/api/v1/lottery/config/public": { + "post": { + "produces": [ + "application/json" + ], + "tags": [ + "积分抽奖,V1.5.0" + ], + "summary": "查询抽奖模块配置(公开)", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/models.LotteryConfig" + } + } + } + } + }, + "/api/v1/lottery/config/update": { + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "积分抽奖,V1.5.0" + ], + "summary": "更新积分抽奖参数配置", + "parameters": [ + { + "description": "抽奖配置", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.UpdateLotteryConfigRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/app.Response" + } + } + } + } + }, + "/api/v1/lottery/prize/create": { + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "积分抽奖,V1.5.0" + ], + "summary": "创建奖品", + "parameters": [ + { + "description": "奖品信息", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.CreatePrizeRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/models.CreatePrizeResp" + } + } + } + } + }, + "/api/v1/lottery/prize/delete": { + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "积分抽奖,V1.5.0" + ], + "summary": "删除奖品", + "parameters": [ + { + "description": "奖品ID", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.DeletePrizeRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/app.Response" + } + } + } + } + }, + "/api/v1/lottery/prize/list": { + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "积分抽奖,V1.5.0" + ], + "summary": "查询奖品列表", + "parameters": [ + { + "description": "查询参数", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.PrizeListRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/models.PrizeListResponse" + } + } + } + } + }, + "/api/v1/lottery/prize/update": { + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "积分抽奖,V1.5.0" + ], + "summary": "编辑奖品", + "parameters": [ + { + "description": "奖品信息", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.UpdatePrizeRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/models.CreatePrizeResp" + } + } + } + } + }, + "/api/v1/lottery/prize_order/detail": { + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "积分抽奖,V1.5.0" + ], + "summary": "查询抽奖订单详情", + "parameters": [ + { + "description": "查询参数", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.GetLotteryPrizeOrderDetailRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/models.LotteryPrizeOrderDetailResponse" + } + } + } + } + }, + "/api/v1/lottery/prize_order/list": { + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "积分抽奖,V1.5.0" + ], + "summary": "查询抽奖订单列表", + "parameters": [ + { + "description": "查询参数", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.LotteryPrizeOrderListRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/models.LotteryPrizeOrderListResponse" + } + } + } + } + }, + "/api/v1/lottery/prize_order/ship": { + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "积分抽奖,V1.5.0" + ], + "summary": "抽奖订单发货", + "parameters": [ + { + "description": "查询参数", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.ShipLotteryPrizeOrderRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/app.Response" + } + } + } + } + }, + "/api/v1/lottery/record/list": { + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "积分抽奖,V1.5.0" + ], + "summary": "查询抽奖记录列表", + "parameters": [ + { + "description": "查询参数", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.LotteryRecordListRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/models.LotteryRecordListResponse" + } + } + } + } + }, "/api/v1/mall/goods/create": { "post": { "consumes": [ @@ -7562,7 +7878,7 @@ "application/json" ], "tags": [ - "消息中心,V1.5.0" + "消息中心" ], "summary": "公告消息-新增", "parameters": [ @@ -7595,7 +7911,7 @@ "application/json" ], "tags": [ - "消息中心,V1.5.0" + "消息中心" ], "summary": "公告消息-删除(草稿/禁用/过期状态可删)", "parameters": [ @@ -7628,7 +7944,7 @@ "application/json" ], "tags": [ - "消息中心,V1.5.0" + "消息中心" ], "summary": "公告消息-详情", "parameters": [ @@ -7661,7 +7977,7 @@ "application/json" ], "tags": [ - "消息中心,V1.5.0" + "消息中心" ], "summary": "公告消息-编辑", "parameters": [ @@ -7694,7 +8010,7 @@ "application/json" ], "tags": [ - "消息中心,V1.5.0" + "消息中心" ], "summary": "公告消息-列表", "parameters": [ @@ -7727,7 +8043,7 @@ "application/json" ], "tags": [ - "消息中心,V1.5.0" + "消息中心" ], "summary": "公告消息-设置公告消息状态(启用/禁用)", "parameters": [ @@ -8191,7 +8507,7 @@ "application/json" ], "tags": [ - "消息中心,V1.5.0" + "消息中心" ], "summary": "用户消息-删除(支持单条、批量或全部)", "parameters": [ @@ -8225,7 +8541,7 @@ "application/json" ], "tags": [ - "消息中心,V1.5.0" + "消息中心" ], "summary": "用户消息-列表", "parameters": [ @@ -8259,7 +8575,7 @@ "application/json" ], "tags": [ - "消息中心,V1.5.0" + "消息中心" ], "summary": "用户消息-设置已读(支持单条或全部)", "parameters": [ @@ -10349,6 +10665,64 @@ } } }, + "models.CreatePrizeRequest": { + "type": "object", + "required": [ + "name", + "prize_type", + "weight" + ], + "properties": { + "images": { + "description": "奖品图片", + "type": "string" + }, + "level": { + "description": "奖品等级:如1表示一等奖,2表示二等奖", + "type": "integer" + }, + "name": { + "description": "奖品名称", + "type": "string" + }, + "prize_type": { + "description": "奖品类型:1-积分,2-优惠券,3-实物,0-谢谢参与", + "type": "integer" + }, + "prize_value": { + "description": "奖品值:积分数或优惠券ID等", + "type": "integer" + }, + "status": { + "description": "奖品状态:1-启用,2-禁用", + "type": "integer" + }, + "stock": { + "description": "库存数量:表示奖品剩余可发放数量", + "type": "integer" + }, + "unlock_total_count": { + "description": "解锁条件:平台所有用户累计抽奖次数达到该值后解锁", + "type": "integer" + }, + "unlock_user_count": { + "description": "解锁条件:用户个人累计抽奖次数达到该值后解锁", + "type": "integer" + }, + "weight": { + "description": "抽奖权重:数值越大,概率越高", + "type": "integer" + } + } + }, + "models.CreatePrizeResp": { + "type": "object", + "properties": { + "id": { + "type": "integer" + } + } + }, "models.DailyReport": { "type": "object", "properties": { @@ -10660,6 +11034,18 @@ } } }, + "models.DeletePrizeRequest": { + "type": "object", + "required": [ + "id" + ], + "properties": { + "id": { + "description": "奖品ID", + "type": "integer" + } + } + }, "models.DemandData": { "type": "object", "properties": { @@ -16745,6 +17131,18 @@ } } }, + "models.GetLotteryPrizeOrderDetailRequest": { + "type": "object", + "required": [ + "order_id" + ], + "properties": { + "order_id": { + "description": "奖品订单ID", + "type": "integer" + } + } + }, "models.GetSupplierRequest": { "type": "object", "properties": { @@ -18749,6 +19147,456 @@ } } }, + "models.LotteryConfig": { + "type": "object", + "properties": { + "cost_per_draw": { + "description": "单次抽奖积分", + "type": "integer" + }, + "daily_limit": { + "description": "每日抽奖上限", + "type": "integer" + }, + "lottery_enabled": { + "description": "是否开启抽奖功能", + "type": "boolean" + } + } + }, + "models.LotteryPrize": { + "type": "object", + "properties": { + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "id": { + "description": "数据库记录编号", + "type": "integer" + }, + "images": { + "description": "奖品图片", + "type": "string" + }, + "level": { + "description": "奖品等级,如1等奖、2等奖等", + "type": "integer" + }, + "name": { + "description": "奖品名称", + "type": "string" + }, + "prize_type": { + "description": "奖品类型:1-积分 2-优惠券 3-实物 0-谢谢参与", + "type": "integer" + }, + "prize_value": { + "description": "奖品值(积分数或券ID等)", + "type": "integer" + }, + "probability": { + "description": "中奖概率(例如 0.001%)", + "type": "string" + }, + "status": { + "description": "奖品状态:1-启用 2-禁用", + "type": "integer" + }, + "stock": { + "description": "剩余库存", + "type": "integer" + }, + "unlock_total_count": { + "description": "解锁条件:所有用户总抽奖次数", + "type": "integer" + }, + "unlock_user_count": { + "description": "解锁条件:用户个人抽奖次数", + "type": "integer" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + }, + "weight": { + "description": "抽奖权重", + "type": "integer" + } + } + }, + "models.LotteryPrizeOrderDetailResponse": { + "type": "object", + "properties": { + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "id": { + "description": "数据库记录编号", + "type": "integer" + }, + "logistics_company": { + "description": "发货信息", + "type": "string" + }, + "logistics_number": { + "description": "快递单号", + "type": "string" + }, + "member_level": { + "description": "当前会员等级", + "type": "integer" + }, + "nickname": { + "description": "用户信息", + "type": "string" + }, + "prize_id": { + "description": "奖品ID", + "type": "integer" + }, + "prize_level": { + "description": "奖品等级", + "type": "integer" + }, + "prize_name": { + "description": "奖品名称", + "type": "string" + }, + "prize_type": { + "description": "奖品信息(扩展字段)", + "type": "integer" + }, + "prize_value": { + "description": "奖品值", + "type": "integer" + }, + "received_at": { + "description": "收货时间", + "type": "string" + }, + "receiver_addr": { + "description": "收件地址", + "type": "string" + }, + "receiver_name": { + "description": "用户提交的收货信息", + "type": "string" + }, + "receiver_phone": { + "description": "收件人手机号", + "type": "string" + }, + "record_id": { + "description": "抽奖记录ID", + "type": "integer" + }, + "shipped_at": { + "description": "发货时间", + "type": "string" + }, + "status": { + "description": "发货状态:0-待发货 1-已发货 2-已收货 3-取消", + "type": "integer" + }, + "store_name": { + "description": "所属门店", + "type": "string" + }, + "tel": { + "description": "用户手机号", + "type": "string" + }, + "uid": { + "description": "用户ID", + "type": "integer" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + } + } + }, + "models.LotteryPrizeOrderItem": { + "type": "object", + "properties": { + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "id": { + "description": "数据库记录编号", + "type": "integer" + }, + "logistics_company": { + "description": "发货信息", + "type": "string" + }, + "logistics_number": { + "description": "快递单号", + "type": "string" + }, + "member_level": { + "description": "会员等级", + "type": "integer" + }, + "prize_id": { + "description": "奖品ID", + "type": "integer" + }, + "prize_name": { + "description": "奖品名称", + "type": "string" + }, + "received_at": { + "description": "收货时间", + "type": "string" + }, + "receiver_addr": { + "description": "收件地址", + "type": "string" + }, + "receiver_name": { + "description": "用户提交的收货信息", + "type": "string" + }, + "receiver_phone": { + "description": "收件人手机号", + "type": "string" + }, + "record_id": { + "description": "抽奖记录ID", + "type": "integer" + }, + "shipped_at": { + "description": "发货时间", + "type": "string" + }, + "status": { + "description": "发货状态:0-待发货 1-已发货 2-已收货 3-取消", + "type": "integer" + }, + "store_id": { + "description": "门店ID", + "type": "integer" + }, + "store_name": { + "description": "门店名", + "type": "string" + }, + "tel": { + "description": "用户手机号", + "type": "string" + }, + "uid": { + "description": "用户ID", + "type": "integer" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + } + } + }, + "models.LotteryPrizeOrderListRequest": { + "type": "object", + "properties": { + "end_time": { + "description": "抽奖时间结束", + "type": "string" + }, + "member_level": { + "description": "用户会员等级", + "type": "integer" + }, + "page_index": { + "description": "页码", + "type": "integer" + }, + "page_size": { + "description": "每页条数", + "type": "integer" + }, + "prize_name": { + "description": "奖品名称模糊搜索", + "type": "string" + }, + "start_time": { + "description": "抽奖时间开始", + "type": "string" + }, + "status": { + "description": "发货状态筛选:0-待发货 1-已发货 2-已收货 3-取消 4-全部", + "type": "integer" + }, + "store_id": { + "description": "门店ID", + "type": "integer" + }, + "tel": { + "description": "手机号", + "type": "string" + }, + "uid": { + "description": "用户ID", + "type": "integer" + } + } + }, + "models.LotteryPrizeOrderListResponse": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/models.LotteryPrizeOrderItem" + } + }, + "page_index": { + "description": "页码", + "type": "integer" + }, + "page_size": { + "description": "每页条数", + "type": "integer" + }, + "total": { + "type": "integer" + } + } + }, + "models.LotteryRecordListRequest": { + "type": "object", + "properties": { + "end_time": { + "description": "抽奖结束时间", + "type": "string" + }, + "member_level": { + "description": "会员等级", + "type": "integer" + }, + "page_index": { + "description": "页码", + "type": "integer" + }, + "page_size": { + "description": "每页条数", + "type": "integer" + }, + "prize_level": { + "description": "奖品等级", + "type": "integer" + }, + "start_time": { + "description": "抽奖开始时间", + "type": "string" + }, + "store_id": { + "description": "门店ID", + "type": "integer" + }, + "tel": { + "description": "手机号", + "type": "string" + }, + "uid": { + "description": "用户ID", + "type": "integer" + }, + "win_status": { + "description": "新增字段:0=全部,1=已中奖,2=未中奖", + "type": "integer" + } + } + }, + "models.LotteryRecordListResponse": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/models.LotteryRecordWithUserInfo" + } + }, + "page_index": { + "description": "页码", + "type": "integer" + }, + "page_size": { + "description": "每页条数", + "type": "integer" + }, + "total": { + "type": "integer" + } + } + }, + "models.LotteryRecordWithUserInfo": { + "type": "object", + "properties": { + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "id": { + "description": "数据库记录编号", + "type": "integer" + }, + "is_win": { + "description": "是否中奖(false 表示“谢谢参与”等无奖项)", + "type": "boolean" + }, + "member_level": { + "description": "会员等级", + "type": "integer" + }, + "prize_id": { + "description": "奖品ID", + "type": "integer" + }, + "prize_level": { + "description": "奖品等级", + "type": "integer" + }, + "prize_name": { + "description": "奖品名称", + "type": "string" + }, + "prize_type": { + "description": "奖品类型", + "type": "integer" + }, + "prize_value": { + "description": "奖品值(积分数或券ID等)", + "type": "integer" + }, + "status": { + "description": "状态:0-待处理 1-已发放 2-处理中 3-失败", + "type": "integer" + }, + "store_id": { + "description": "门店id", + "type": "integer" + }, + "store_name": { + "description": "门店名称", + "type": "string" + }, + "tel": { + "type": "string" + }, + "uid": { + "description": "用户ID", + "type": "integer" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + } + } + }, "models.MallUserVmRecordData": { "type": "object", "properties": { @@ -19435,6 +20283,10 @@ "description": "订单编号", "type": "string" }, + "overdue_flag": { + "description": "超期处理标志:1", + "type": "integer" + }, "pay_price": { "description": "实际付款金额(包含运费)", "type": "integer" @@ -19448,6 +20300,7 @@ "type": "string" }, "phone_ext": { + "description": "用户手机号后四位", "type": "string" }, "pickup_code": { @@ -19479,6 +20332,7 @@ "type": "string" }, "revert_shopper_code": { + "description": "店员识别码", "type": "string" }, "revert_store_id": { @@ -19962,6 +20816,55 @@ } } }, + "models.PrizeListRequest": { + "type": "object", + "properties": { + "level": { + "description": "奖品等级(如 1 表示一等奖)", + "type": "integer" + }, + "name": { + "description": "奖品名称(模糊搜索)", + "type": "string" + }, + "page_index": { + "description": "页码", + "type": "integer" + }, + "page_size": { + "description": "每页条数", + "type": "integer" + }, + "status": { + "description": "奖品状态:1-启用,2-禁用(不传则全部)", + "type": "integer" + } + } + }, + "models.PrizeListResponse": { + "type": "object", + "properties": { + "list": { + "description": "奖品列表", + "type": "array", + "items": { + "$ref": "#/definitions/models.LotteryPrize" + } + }, + "page_index": { + "description": "页码", + "type": "integer" + }, + "page_size": { + "description": "每页条数", + "type": "integer" + }, + "total": { + "description": "总数", + "type": "integer" + } + } + }, "models.ProductInfo": { "type": "object", "properties": { @@ -21570,6 +22473,28 @@ } } }, + "models.ShipLotteryPrizeOrderRequest": { + "type": "object", + "required": [ + "logistics_company", + "logistics_number", + "order_id" + ], + "properties": { + "logistics_company": { + "description": "快递公司", + "type": "string" + }, + "logistics_number": { + "description": "快递单号", + "type": "string" + }, + "order_id": { + "description": "奖品订单ID", + "type": "integer" + } + } + }, "models.ShopperPromotionCode": { "type": "object", "properties": { @@ -23313,6 +24238,76 @@ } } }, + "models.UpdateLotteryConfigRequest": { + "type": "object", + "required": [ + "cost_per_draw", + "daily_limit" + ], + "properties": { + "cost_per_draw": { + "type": "integer" + }, + "daily_limit": { + "type": "integer" + }, + "lottery_enabled": { + "type": "boolean" + } + } + }, + "models.UpdatePrizeRequest": { + "type": "object", + "required": [ + "id" + ], + "properties": { + "id": { + "description": "奖品ID", + "type": "integer" + }, + "images": { + "description": "奖品图片", + "type": "string" + }, + "level": { + "description": "奖品等级:如1表示一等奖", + "type": "integer" + }, + "name": { + "description": "奖品名称", + "type": "string" + }, + "prize_type": { + "description": "奖品类型:1-积分,2-优惠券,3-实物,0-谢谢参与", + "type": "integer" + }, + "prize_value": { + "description": "奖品值:积分数或优惠券ID等", + "type": "integer" + }, + "status": { + "description": "奖品状态:1-启用,2-禁用", + "type": "integer" + }, + "stock": { + "description": "剩余库存", + "type": "integer" + }, + "unlock_total_count": { + "description": "全部用户总抽奖次数达到该值后解锁奖品", + "type": "integer" + }, + "unlock_user_count": { + "description": "用户抽奖次数达到该值后解锁该奖品", + "type": "integer" + }, + "weight": { + "description": "抽奖权重:用于控制中奖概率", + "type": "integer" + } + } + }, "models.UserInfo": { "type": "object", "properties": { diff --git a/docs/swagger.yaml b/docs/swagger.yaml index 7d50bac..4afa031 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -1444,6 +1444,48 @@ definitions: description: 备注 type: string type: object + models.CreatePrizeRequest: + properties: + images: + description: 奖品图片 + type: string + level: + description: 奖品等级:如1表示一等奖,2表示二等奖 + type: integer + name: + description: 奖品名称 + type: string + prize_type: + description: 奖品类型:1-积分,2-优惠券,3-实物,0-谢谢参与 + type: integer + prize_value: + description: 奖品值:积分数或优惠券ID等 + type: integer + status: + description: 奖品状态:1-启用,2-禁用 + type: integer + stock: + description: 库存数量:表示奖品剩余可发放数量 + type: integer + unlock_total_count: + description: 解锁条件:平台所有用户累计抽奖次数达到该值后解锁 + type: integer + unlock_user_count: + description: 解锁条件:用户个人累计抽奖次数达到该值后解锁 + type: integer + weight: + description: 抽奖权重:数值越大,概率越高 + type: integer + required: + - name + - prize_type + - weight + type: object + models.CreatePrizeResp: + properties: + id: + type: integer + type: object models.DailyReport: properties: category_sales: @@ -1674,6 +1716,14 @@ definitions: description: 用户名 type: string type: object + models.DeletePrizeRequest: + properties: + id: + description: 奖品ID + type: integer + required: + - id + type: object models.DemandData: properties: erp_category_id: @@ -6087,6 +6137,14 @@ definitions: total_page: type: integer type: object + models.GetLotteryPrizeOrderDetailRequest: + properties: + order_id: + description: 奖品订单ID + type: integer + required: + - order_id + type: object models.GetSupplierRequest: properties: cooperativeBusinessId: @@ -7535,6 +7593,335 @@ definitions: description: 用户名 type: string type: object + models.LotteryConfig: + properties: + cost_per_draw: + description: 单次抽奖积分 + type: integer + daily_limit: + description: 每日抽奖上限 + type: integer + lottery_enabled: + description: 是否开启抽奖功能 + type: boolean + type: object + models.LotteryPrize: + properties: + createdAt: + description: 创建时间 + type: string + id: + description: 数据库记录编号 + type: integer + images: + description: 奖品图片 + type: string + level: + description: 奖品等级,如1等奖、2等奖等 + type: integer + name: + description: 奖品名称 + type: string + prize_type: + description: 奖品类型:1-积分 2-优惠券 3-实物 0-谢谢参与 + type: integer + prize_value: + description: 奖品值(积分数或券ID等) + type: integer + probability: + description: 中奖概率(例如 0.001%) + type: string + status: + description: 奖品状态:1-启用 2-禁用 + type: integer + stock: + description: 剩余库存 + type: integer + unlock_total_count: + description: 解锁条件:所有用户总抽奖次数 + type: integer + unlock_user_count: + description: 解锁条件:用户个人抽奖次数 + type: integer + updatedAt: + description: 更新时间 + type: string + weight: + description: 抽奖权重 + type: integer + type: object + models.LotteryPrizeOrderDetailResponse: + properties: + createdAt: + description: 创建时间 + type: string + id: + description: 数据库记录编号 + type: integer + logistics_company: + description: 发货信息 + type: string + logistics_number: + description: 快递单号 + type: string + member_level: + description: 当前会员等级 + type: integer + nickname: + description: 用户信息 + type: string + prize_id: + description: 奖品ID + type: integer + prize_level: + description: 奖品等级 + type: integer + prize_name: + description: 奖品名称 + type: string + prize_type: + description: 奖品信息(扩展字段) + type: integer + prize_value: + description: 奖品值 + type: integer + received_at: + description: 收货时间 + type: string + receiver_addr: + description: 收件地址 + type: string + receiver_name: + description: 用户提交的收货信息 + type: string + receiver_phone: + description: 收件人手机号 + type: string + record_id: + description: 抽奖记录ID + type: integer + shipped_at: + description: 发货时间 + type: string + status: + description: 发货状态:0-待发货 1-已发货 2-已收货 3-取消 + type: integer + store_name: + description: 所属门店 + type: string + tel: + description: 用户手机号 + type: string + uid: + description: 用户ID + type: integer + updatedAt: + description: 更新时间 + type: string + type: object + models.LotteryPrizeOrderItem: + properties: + createdAt: + description: 创建时间 + type: string + id: + description: 数据库记录编号 + type: integer + logistics_company: + description: 发货信息 + type: string + logistics_number: + description: 快递单号 + type: string + member_level: + description: 会员等级 + type: integer + prize_id: + description: 奖品ID + type: integer + prize_name: + description: 奖品名称 + type: string + received_at: + description: 收货时间 + type: string + receiver_addr: + description: 收件地址 + type: string + receiver_name: + description: 用户提交的收货信息 + type: string + receiver_phone: + description: 收件人手机号 + type: string + record_id: + description: 抽奖记录ID + type: integer + shipped_at: + description: 发货时间 + type: string + status: + description: 发货状态:0-待发货 1-已发货 2-已收货 3-取消 + type: integer + store_id: + description: 门店ID + type: integer + store_name: + description: 门店名 + type: string + tel: + description: 用户手机号 + type: string + uid: + description: 用户ID + type: integer + updatedAt: + description: 更新时间 + type: string + type: object + models.LotteryPrizeOrderListRequest: + properties: + end_time: + description: 抽奖时间结束 + type: string + member_level: + description: 用户会员等级 + type: integer + page_index: + description: 页码 + type: integer + page_size: + description: 每页条数 + type: integer + prize_name: + description: 奖品名称模糊搜索 + type: string + start_time: + description: 抽奖时间开始 + type: string + status: + description: 发货状态筛选:0-待发货 1-已发货 2-已收货 3-取消 4-全部 + type: integer + store_id: + description: 门店ID + type: integer + tel: + description: 手机号 + type: string + uid: + description: 用户ID + type: integer + type: object + models.LotteryPrizeOrderListResponse: + properties: + list: + items: + $ref: '#/definitions/models.LotteryPrizeOrderItem' + type: array + page_index: + description: 页码 + type: integer + page_size: + description: 每页条数 + type: integer + total: + type: integer + type: object + models.LotteryRecordListRequest: + properties: + end_time: + description: 抽奖结束时间 + type: string + member_level: + description: 会员等级 + type: integer + page_index: + description: 页码 + type: integer + page_size: + description: 每页条数 + type: integer + prize_level: + description: 奖品等级 + type: integer + start_time: + description: 抽奖开始时间 + type: string + store_id: + description: 门店ID + type: integer + tel: + description: 手机号 + type: string + uid: + description: 用户ID + type: integer + win_status: + description: 新增字段:0=全部,1=已中奖,2=未中奖 + type: integer + type: object + models.LotteryRecordListResponse: + properties: + list: + items: + $ref: '#/definitions/models.LotteryRecordWithUserInfo' + type: array + page_index: + description: 页码 + type: integer + page_size: + description: 每页条数 + type: integer + total: + type: integer + type: object + models.LotteryRecordWithUserInfo: + properties: + createdAt: + description: 创建时间 + type: string + id: + description: 数据库记录编号 + type: integer + is_win: + description: 是否中奖(false 表示“谢谢参与”等无奖项) + type: boolean + member_level: + description: 会员等级 + type: integer + prize_id: + description: 奖品ID + type: integer + prize_level: + description: 奖品等级 + type: integer + prize_name: + description: 奖品名称 + type: string + prize_type: + description: 奖品类型 + type: integer + prize_value: + description: 奖品值(积分数或券ID等) + type: integer + status: + description: 状态:0-待处理 1-已发放 2-处理中 3-失败 + type: integer + store_id: + description: 门店id + type: integer + store_name: + description: 门店名称 + type: string + tel: + type: string + uid: + description: 用户ID + type: integer + updatedAt: + description: 更新时间 + type: string + type: object models.MallUserVmRecordData: properties: after_vm: @@ -8029,6 +8416,9 @@ definitions: order_sn: description: 订单编号 type: string + overdue_flag: + description: 超期处理标志:1 + type: integer pay_price: description: 实际付款金额(包含运费) type: integer @@ -8039,6 +8429,7 @@ definitions: description: 支付时间 type: string phone_ext: + description: 用户手机号后四位 type: string pickup_code: description: 取货码 @@ -8062,6 +8453,7 @@ definitions: description: 归还物流单号 type: string revert_shopper_code: + description: 店员识别码 type: string revert_store_id: description: 归还门店id @@ -8403,6 +8795,41 @@ definitions: description: 总条数 type: integer type: object + models.PrizeListRequest: + properties: + level: + description: 奖品等级(如 1 表示一等奖) + type: integer + name: + description: 奖品名称(模糊搜索) + type: string + page_index: + description: 页码 + type: integer + page_size: + description: 每页条数 + type: integer + status: + description: 奖品状态:1-启用,2-禁用(不传则全部) + type: integer + type: object + models.PrizeListResponse: + properties: + list: + description: 奖品列表 + items: + $ref: '#/definitions/models.LotteryPrize' + type: array + page_index: + description: 页码 + type: integer + page_size: + description: 每页条数 + type: integer + total: + description: 总数 + type: integer + type: object models.ProductInfo: properties: pay_count: @@ -9571,6 +9998,22 @@ definitions: user_share_card_bill_id: type: integer type: object + models.ShipLotteryPrizeOrderRequest: + properties: + logistics_company: + description: 快递公司 + type: string + logistics_number: + description: 快递单号 + type: string + order_id: + description: 奖品订单ID + type: integer + required: + - logistics_company + - logistics_number + - order_id + type: object models.ShopperPromotionCode: properties: code: @@ -10832,6 +11275,56 @@ definitions: description: 角色id type: integer type: object + models.UpdateLotteryConfigRequest: + properties: + cost_per_draw: + type: integer + daily_limit: + type: integer + lottery_enabled: + type: boolean + required: + - cost_per_draw + - daily_limit + type: object + models.UpdatePrizeRequest: + properties: + id: + description: 奖品ID + type: integer + images: + description: 奖品图片 + type: string + level: + description: 奖品等级:如1表示一等奖 + type: integer + name: + description: 奖品名称 + type: string + prize_type: + description: 奖品类型:1-积分,2-优惠券,3-实物,0-谢谢参与 + type: integer + prize_value: + description: 奖品值:积分数或优惠券ID等 + type: integer + status: + description: 奖品状态:1-启用,2-禁用 + type: integer + stock: + description: 剩余库存 + type: integer + unlock_total_count: + description: 全部用户总抽奖次数达到该值后解锁奖品 + type: integer + unlock_user_count: + description: 用户抽奖次数达到该值后解锁该奖品 + type: integer + weight: + description: 抽奖权重:用于控制中奖概率 + type: integer + required: + - id + type: object models.UserInfo: properties: appOpenID: @@ -11414,7 +11907,7 @@ paths: $ref: '#/definitions/models.BizTypeListResp' summary: 业务消息-查询业务类型 tags: - - 消息中心,V1.5.0 + - 消息中心 /api/v1/bus_message/create: post: consumes: @@ -11435,7 +11928,7 @@ paths: $ref: '#/definitions/models.BusMessageCreateResp' summary: 业务消息-新增 tags: - - 消息中心,V1.5.0 + - 消息中心 /api/v1/bus_message/delete: post: consumes: @@ -11456,7 +11949,7 @@ paths: $ref: '#/definitions/app.Response' summary: 业务消息-删除(禁用状态可删) tags: - - 消息中心,V1.5.0 + - 消息中心 /api/v1/bus_message/detail: post: consumes: @@ -11477,7 +11970,7 @@ paths: $ref: '#/definitions/models.BusMessageItem' summary: 业务消息-详情 tags: - - 消息中心,V1.5.0 + - 消息中心 /api/v1/bus_message/edit: post: consumes: @@ -11498,7 +11991,7 @@ paths: $ref: '#/definitions/app.Response' summary: 业务消息-编辑 tags: - - 消息中心,V1.5.0 + - 消息中心 /api/v1/bus_message/events: post: consumes: @@ -11519,7 +12012,7 @@ paths: $ref: '#/definitions/models.EventListResp' summary: 业务消息-查询事件类型 tags: - - 消息中心,V1.5.0 + - 消息中心 /api/v1/bus_message/list: post: consumes: @@ -11540,7 +12033,7 @@ paths: $ref: '#/definitions/models.BusMessageListResp' summary: 业务消息-列表 tags: - - 消息中心,V1.5.0 + - 消息中心 /api/v1/bus_message/set_status: post: consumes: @@ -11561,7 +12054,7 @@ paths: $ref: '#/definitions/app.Response' summary: 业务消息-设置状态(启用/禁用) tags: - - 消息中心,V1.5.0 + - 消息中心 /api/v1/bus_message/template_variables: post: consumes: @@ -11582,7 +12075,7 @@ paths: $ref: '#/definitions/models.TemplateVarListResp' summary: 业务消息-查询模板变量 tags: - - 消息中心,V1.5.0 + - 消息中心 /api/v1/cashier/create: post: consumes: @@ -14672,6 +15165,207 @@ paths: summary: 登录日志列表 tags: - system/日志 + /api/v1/lottery/config/public: + post: + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/models.LotteryConfig' + summary: 查询抽奖模块配置(公开) + tags: + - 积分抽奖,V1.5.0 + /api/v1/lottery/config/update: + post: + consumes: + - application/json + parameters: + - description: 抽奖配置 + in: body + name: data + required: true + schema: + $ref: '#/definitions/models.UpdateLotteryConfigRequest' + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/app.Response' + summary: 更新积分抽奖参数配置 + tags: + - 积分抽奖,V1.5.0 + /api/v1/lottery/prize/create: + post: + consumes: + - application/json + parameters: + - description: 奖品信息 + in: body + name: data + required: true + schema: + $ref: '#/definitions/models.CreatePrizeRequest' + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/models.CreatePrizeResp' + summary: 创建奖品 + tags: + - 积分抽奖,V1.5.0 + /api/v1/lottery/prize/delete: + post: + consumes: + - application/json + parameters: + - description: 奖品ID + in: body + name: data + required: true + schema: + $ref: '#/definitions/models.DeletePrizeRequest' + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/app.Response' + summary: 删除奖品 + tags: + - 积分抽奖,V1.5.0 + /api/v1/lottery/prize/list: + post: + consumes: + - application/json + parameters: + - description: 查询参数 + in: body + name: data + required: true + schema: + $ref: '#/definitions/models.PrizeListRequest' + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/models.PrizeListResponse' + summary: 查询奖品列表 + tags: + - 积分抽奖,V1.5.0 + /api/v1/lottery/prize/update: + post: + consumes: + - application/json + parameters: + - description: 奖品信息 + in: body + name: data + required: true + schema: + $ref: '#/definitions/models.UpdatePrizeRequest' + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/models.CreatePrizeResp' + summary: 编辑奖品 + tags: + - 积分抽奖,V1.5.0 + /api/v1/lottery/prize_order/detail: + post: + consumes: + - application/json + parameters: + - description: 查询参数 + in: body + name: data + required: true + schema: + $ref: '#/definitions/models.GetLotteryPrizeOrderDetailRequest' + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/models.LotteryPrizeOrderDetailResponse' + summary: 查询抽奖订单详情 + tags: + - 积分抽奖,V1.5.0 + /api/v1/lottery/prize_order/list: + post: + consumes: + - application/json + parameters: + - description: 查询参数 + in: body + name: data + required: true + schema: + $ref: '#/definitions/models.LotteryPrizeOrderListRequest' + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/models.LotteryPrizeOrderListResponse' + summary: 查询抽奖订单列表 + tags: + - 积分抽奖,V1.5.0 + /api/v1/lottery/prize_order/ship: + post: + consumes: + - application/json + parameters: + - description: 查询参数 + in: body + name: data + required: true + schema: + $ref: '#/definitions/models.ShipLotteryPrizeOrderRequest' + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/app.Response' + summary: 抽奖订单发货 + tags: + - 积分抽奖,V1.5.0 + /api/v1/lottery/record/list: + post: + consumes: + - application/json + parameters: + - description: 查询参数 + in: body + name: data + required: true + schema: + $ref: '#/definitions/models.LotteryRecordListRequest' + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/models.LotteryRecordListResponse' + summary: 查询抽奖记录列表 + tags: + - 积分抽奖,V1.5.0 /api/v1/mall/goods/create: post: consumes: @@ -16106,7 +16800,7 @@ paths: $ref: '#/definitions/models.SysMessageCreateResp' summary: 公告消息-新增 tags: - - 消息中心,V1.5.0 + - 消息中心 /api/v1/sys_message/delete: post: consumes: @@ -16127,7 +16821,7 @@ paths: $ref: '#/definitions/app.Response' summary: 公告消息-删除(草稿/禁用/过期状态可删) tags: - - 消息中心,V1.5.0 + - 消息中心 /api/v1/sys_message/detail: post: consumes: @@ -16148,7 +16842,7 @@ paths: $ref: '#/definitions/models.SysMessageDetailResp' summary: 公告消息-详情 tags: - - 消息中心,V1.5.0 + - 消息中心 /api/v1/sys_message/edit: post: consumes: @@ -16169,7 +16863,7 @@ paths: $ref: '#/definitions/models.SysMessageCreateResp' summary: 公告消息-编辑 tags: - - 消息中心,V1.5.0 + - 消息中心 /api/v1/sys_message/list: post: consumes: @@ -16190,7 +16884,7 @@ paths: $ref: '#/definitions/models.SysMessageListResp' summary: 公告消息-列表 tags: - - 消息中心,V1.5.0 + - 消息中心 /api/v1/sys_message/set_status: post: consumes: @@ -16211,7 +16905,7 @@ paths: $ref: '#/definitions/app.Response' summary: 公告消息-设置公告消息状态(启用/禁用) tags: - - 消息中心,V1.5.0 + - 消息中心 /api/v1/sysUser: get: description: 获取JSON @@ -16619,7 +17313,7 @@ paths: $ref: '#/definitions/app.Response' summary: 用户消息-删除(支持单条、批量或全部) tags: - - 消息中心,V1.5.0 + - 消息中心 /api/v1/user_message/list: post: consumes: @@ -16641,7 +17335,7 @@ paths: $ref: '#/definitions/models.UserMessageListResp' summary: 用户消息-列表 tags: - - 消息中心,V1.5.0 + - 消息中心 /api/v1/user_message/set_status: post: consumes: @@ -16663,7 +17357,7 @@ paths: $ref: '#/definitions/app.Response' summary: 用户消息-设置已读(支持单条或全部) tags: - - 消息中心,V1.5.0 + - 消息中心 /login: post: consumes: