1、新增抽奖订单自提接口;
This commit is contained in:
parent
13b2214c00
commit
cad3551f6d
|
@ -7,6 +7,7 @@ import (
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
model "go-admin/app/admin/models"
|
model "go-admin/app/admin/models"
|
||||||
orm "go-admin/common/global"
|
orm "go-admin/common/global"
|
||||||
|
"go-admin/logger"
|
||||||
"go-admin/tools/app"
|
"go-admin/tools/app"
|
||||||
"gorm.io/gorm"
|
"gorm.io/gorm"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
@ -106,6 +107,7 @@ func CreateLotteryPrize(c *gin.Context) {
|
||||||
Status: req.Status,
|
Status: req.Status,
|
||||||
UnlockUserCount: req.UnlockUserCount,
|
UnlockUserCount: req.UnlockUserCount,
|
||||||
UnlockTotalCount: req.UnlockTotalCount,
|
UnlockTotalCount: req.UnlockTotalCount,
|
||||||
|
DailyAmountLimit: req.DailyAmountLimit,
|
||||||
Images: req.Images,
|
Images: req.Images,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -148,6 +150,7 @@ func UpdateLotteryPrize(c *gin.Context) {
|
||||||
prize.Status = req.Status
|
prize.Status = req.Status
|
||||||
prize.UnlockUserCount = req.UnlockUserCount
|
prize.UnlockUserCount = req.UnlockUserCount
|
||||||
prize.UnlockTotalCount = req.UnlockTotalCount
|
prize.UnlockTotalCount = req.UnlockTotalCount
|
||||||
|
prize.DailyAmountLimit = req.DailyAmountLimit
|
||||||
prize.Images = req.Images
|
prize.Images = req.Images
|
||||||
|
|
||||||
if err := orm.Eloquent.Save(&prize).Error; err != nil {
|
if err := orm.Eloquent.Save(&prize).Error; err != nil {
|
||||||
|
@ -363,7 +366,8 @@ func LotteryRecordList(c *gin.Context) {
|
||||||
query = query.Where("lottery_record.prize_level = ?", req.PrizeLevel)
|
query = query.Where("lottery_record.prize_level = ?", req.PrizeLevel)
|
||||||
}
|
}
|
||||||
if req.StartTime != "" {
|
if req.StartTime != "" {
|
||||||
if t, err := time.Parse("2006-01-02", req.StartTime); err == nil {
|
t, err := time.Parse(model.QueryTimeFormat, req.StartTime)
|
||||||
|
if err == nil {
|
||||||
db = db.Where("lottery_record.created_at >= ?", t)
|
db = db.Where("lottery_record.created_at >= ?", t)
|
||||||
query = query.Where("lottery_record.created_at >= ?", t)
|
query = query.Where("lottery_record.created_at >= ?", t)
|
||||||
}
|
}
|
||||||
|
@ -376,7 +380,8 @@ func LotteryRecordList(c *gin.Context) {
|
||||||
db = db.Where("lottery_record.is_win = ?", false)
|
db = db.Where("lottery_record.is_win = ?", false)
|
||||||
}
|
}
|
||||||
if req.EndTime != "" {
|
if req.EndTime != "" {
|
||||||
if t, err := time.Parse("2006-01-02", req.EndTime); err == nil {
|
t, err := time.Parse(model.QueryTimeFormat, req.EndTime)
|
||||||
|
if err == nil {
|
||||||
db = db.Where("lottery_record.created_at <= ?", t.Add(24*time.Hour))
|
db = db.Where("lottery_record.created_at <= ?", t.Add(24*time.Hour))
|
||||||
query = query.Where("lottery_record.created_at <= ?", t.Add(24*time.Hour))
|
query = query.Where("lottery_record.created_at <= ?", t.Add(24*time.Hour))
|
||||||
}
|
}
|
||||||
|
@ -456,12 +461,14 @@ func LotteryPrizeOrderList(c *gin.Context) {
|
||||||
db = db.Where("lottery_prize_order.status = ?", req.Status)
|
db = db.Where("lottery_prize_order.status = ?", req.Status)
|
||||||
}
|
}
|
||||||
if req.StartTime != "" {
|
if req.StartTime != "" {
|
||||||
if t, err := time.Parse("2006-01-02", req.StartTime); err == nil {
|
t, err := time.Parse(model.QueryTimeFormat, req.StartTime)
|
||||||
|
if err == nil {
|
||||||
db = db.Where("lottery_prize_order.created_at >= ?", t)
|
db = db.Where("lottery_prize_order.created_at >= ?", t)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if req.EndTime != "" {
|
if req.EndTime != "" {
|
||||||
if t, err := time.Parse("2006-01-02", req.EndTime); err == nil {
|
t, err := time.Parse(model.QueryTimeFormat, req.EndTime)
|
||||||
|
if err == nil {
|
||||||
db = db.Where("lottery_prize_order.created_at <= ?", t.Add(24*time.Hour))
|
db = db.Where("lottery_prize_order.created_at <= ?", t.Add(24*time.Hour))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -543,6 +550,13 @@ func ShipLotteryPrizeOrder(c *gin.Context) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sysUser, err := model.GetSysUserByCtx(c)
|
||||||
|
if err != nil {
|
||||||
|
logger.Error("sys user err:", logger.Field("err", err))
|
||||||
|
app.Error(c, http.StatusInternalServerError, err, "操作失败")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
var order model.LotteryPrizeOrder
|
var order model.LotteryPrizeOrder
|
||||||
if err := orm.Eloquent.First(&order, req.OrderID).Error; err != nil {
|
if err := orm.Eloquent.First(&order, req.OrderID).Error; err != nil {
|
||||||
app.Error(c, http.StatusNotFound, nil, "订单不存在")
|
app.Error(c, http.StatusNotFound, nil, "订单不存在")
|
||||||
|
@ -554,11 +568,13 @@ func ShipLotteryPrizeOrder(c *gin.Context) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
err := orm.Eloquent.Model(&order).Updates(map[string]interface{}{
|
err = orm.Eloquent.Model(&order).Updates(map[string]interface{}{
|
||||||
"logistics_company": req.LogisticsCompany,
|
"deliver_shopper_code": sysUser.UserId,
|
||||||
"logistics_number": req.LogisticsNumber,
|
"deliver_shopper_name": sysUser.NickName,
|
||||||
"shipped_at": time.Now(),
|
"logistics_company": req.LogisticsCompany,
|
||||||
"status": 1, // 已发货
|
"logistics_number": req.LogisticsNumber,
|
||||||
|
"shipped_at": time.Now(),
|
||||||
|
"status": 1, // 已发货
|
||||||
}).Error
|
}).Error
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -568,3 +584,72 @@ func ShipLotteryPrizeOrder(c *gin.Context) {
|
||||||
|
|
||||||
app.OK(c, nil, "发货成功")
|
app.OK(c, nil, "发货成功")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// PickupLotteryPrizeOrder 抽奖订单门店自提
|
||||||
|
// @Summary 抽奖订单门店自提
|
||||||
|
// @Tags 积分抽奖,V1.5.0
|
||||||
|
// @Accept json
|
||||||
|
// @Produce json
|
||||||
|
// @Param data body models.PickupLotteryPrizeOrderRequest true "查询参数"
|
||||||
|
// @Success 200 {object} app.Response
|
||||||
|
// @Router /api/v1/lottery/prize_order/pickup [post]
|
||||||
|
func PickupLotteryPrizeOrder(c *gin.Context) {
|
||||||
|
var req model.PickupLotteryPrizeOrderRequest
|
||||||
|
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
|
||||||
|
}
|
||||||
|
|
||||||
|
sysUser, err := model.GetSysUserByCtx(c)
|
||||||
|
if err != nil {
|
||||||
|
logger.Error("sys user err:", logger.Field("err", err))
|
||||||
|
app.Error(c, http.StatusInternalServerError, err, "操作失败")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 开启事务,保证订单和记录一起更新
|
||||||
|
tx := orm.Eloquent.Begin()
|
||||||
|
|
||||||
|
// 更新订单状态为已收货
|
||||||
|
if err = tx.Model(&order).Updates(map[string]interface{}{
|
||||||
|
"deliver_shopper_code": sysUser.UserId,
|
||||||
|
"deliver_shopper_name": sysUser.NickName,
|
||||||
|
"status": 2, // 已收货
|
||||||
|
"received_at": time.Now(),
|
||||||
|
"shipped_at": time.Now(),
|
||||||
|
"logistics_company": "门店自提",
|
||||||
|
}).Error; err != nil {
|
||||||
|
tx.Rollback()
|
||||||
|
app.Error(c, http.StatusInternalServerError, nil, "更新订单状态失败:"+err.Error())
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 更新对应的 LotteryRecord 状态为已发放
|
||||||
|
if err = tx.Model(&model.LotteryRecord{}).
|
||||||
|
Where("id = ?", order.RecordId).
|
||||||
|
Update("status", 1).Error; err != nil {
|
||||||
|
tx.Rollback()
|
||||||
|
app.Error(c, http.StatusInternalServerError, nil, "更新抽奖记录状态失败:"+err.Error())
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
err = tx.Commit().Error
|
||||||
|
if err != nil {
|
||||||
|
tx.Rollback()
|
||||||
|
app.Error(c, http.StatusInternalServerError, nil, "更新状态失败:"+err.Error())
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
app.OK(c, nil, "门店自提成功")
|
||||||
|
}
|
||||||
|
|
|
@ -13,17 +13,18 @@ const (
|
||||||
type LotteryPrize struct {
|
type LotteryPrize struct {
|
||||||
Model
|
Model
|
||||||
|
|
||||||
Name string `json:"name"` // 奖品名称
|
Name string `json:"name"` // 奖品名称
|
||||||
PrizeType int `json:"prize_type"` // 奖品类型:1-积分 2-优惠券 3-实物 0-谢谢参与
|
PrizeType int `json:"prize_type"` // 奖品类型:1-积分 2-优惠券 3-实物 4-租卡会员兑换码(30天)0-谢谢参与
|
||||||
PrizeValue int `json:"prize_value"` // 奖品值(积分数或券ID等)
|
PrizeValue int `json:"prize_value"` // 奖品值(积分数或券ID等)
|
||||||
Level int `json:"level"` // 奖品等级,如1等奖、2等奖等
|
Level int `json:"level"` // 奖品等级,如1等奖、2等奖等
|
||||||
Weight int `json:"weight"` // 抽奖权重
|
Weight int `json:"weight"` // 抽奖权重
|
||||||
Stock int `json:"stock"` // 剩余库存
|
Stock int `json:"stock"` // 剩余库存
|
||||||
Status int `json:"status"` // 奖品状态:1-启用 2-禁用
|
Status int `json:"status"` // 奖品状态:1-启用 2-禁用
|
||||||
UnlockUserCount int `json:"unlock_user_count"` // 解锁条件:用户个人抽奖次数
|
UnlockUserCount int `json:"unlock_user_count"` // 解锁条件:用户个人抽奖次数
|
||||||
UnlockTotalCount int `json:"unlock_total_count"` // 解锁条件:所有用户总抽奖次数
|
UnlockTotalCount int `json:"unlock_total_count"` // 解锁条件:所有用户总抽奖次数
|
||||||
Images string `json:"images"` // 奖品图片
|
DailyAmountLimit float64 `json:"daily_amount_limit"` // 当天消费金额限制(0 表示不限制)
|
||||||
Probability string `json:"probability" gorm:"-"` // 中奖概率(例如 0.001%)
|
Images string `json:"images"` // 奖品图片
|
||||||
|
Probability string `json:"probability" gorm:"-"` // 中奖概率(例如 0.001%)
|
||||||
}
|
}
|
||||||
|
|
||||||
// LotteryRecord 抽奖记录
|
// LotteryRecord 抽奖记录
|
||||||
|
@ -56,10 +57,12 @@ type LotteryPrizeOrder struct {
|
||||||
ReceiverAddr string `json:"receiver_addr"` // 收件地址
|
ReceiverAddr string `json:"receiver_addr"` // 收件地址
|
||||||
|
|
||||||
// 发货信息
|
// 发货信息
|
||||||
LogisticsCompany string `json:"logistics_company"` // 快递公司
|
LogisticsCompany string `json:"logistics_company"` // 快递公司
|
||||||
LogisticsNumber string `json:"logistics_number"` // 快递单号
|
LogisticsNumber string `json:"logistics_number"` // 快递单号
|
||||||
ShippedAt time.Time `json:"shipped_at"` // 发货时间
|
DeliverShopperCode uint32 `json:"deliver_shopper_code"` // 发货店员用户ID
|
||||||
ReceivedAt time.Time `json:"received_at"` // 收货时间
|
DeliverShopperName string `json:"deliver_shopper_name"` // 发货店员名称
|
||||||
|
ShippedAt *time.Time `json:"shipped_at"` // 发货时间
|
||||||
|
ReceivedAt *time.Time `json:"received_at"` // 收货时间
|
||||||
|
|
||||||
Status int `json:"status"` // 发货状态:0-待发货 1-已发货 2-已收货 3-取消
|
Status int `json:"status"` // 发货状态:0-待发货 1-已发货 2-已收货 3-取消
|
||||||
}
|
}
|
||||||
|
@ -71,30 +74,32 @@ type UpdateLotteryConfigRequest struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
type CreatePrizeRequest struct {
|
type CreatePrizeRequest struct {
|
||||||
Name string `json:"name" binding:"required"` // 奖品名称
|
Name string `json:"name" binding:"required"` // 奖品名称
|
||||||
PrizeType int `json:"prize_type" binding:"required"` // 奖品类型:1-积分,2-优惠券,3-实物,0-谢谢参与
|
PrizeType int `json:"prize_type" binding:"required"` // 奖品类型:1-积分,2-优惠券,3-实物,4-租卡会员兑换码(30天),0-谢谢参与
|
||||||
PrizeValue int `json:"prize_value"` // 奖品值:积分数或优惠券ID等
|
PrizeValue int `json:"prize_value"` // 奖品值:积分数或优惠券ID等
|
||||||
Level int `json:"level"` // 奖品等级:如1表示一等奖,2表示二等奖
|
Level int `json:"level"` // 奖品等级:如1表示一等奖,2表示二等奖
|
||||||
Weight int `json:"weight" binding:"required"` // 抽奖权重:数值越大,概率越高
|
Weight int `json:"weight" binding:"required"` // 抽奖权重:数值越大,概率越高
|
||||||
Stock int `json:"stock"` // 库存数量:表示奖品剩余可发放数量
|
Stock int `json:"stock"` // 库存数量:表示奖品剩余可发放数量
|
||||||
Status int `json:"status"` // 奖品状态:1-启用,2-禁用
|
Status int `json:"status"` // 奖品状态:1-启用,2-禁用
|
||||||
UnlockUserCount int `json:"unlock_user_count"` // 解锁条件:用户个人累计抽奖次数达到该值后解锁
|
UnlockUserCount int `json:"unlock_user_count"` // 解锁条件:用户个人累计抽奖次数达到该值后解锁
|
||||||
UnlockTotalCount int `json:"unlock_total_count"` // 解锁条件:平台所有用户累计抽奖次数达到该值后解锁
|
UnlockTotalCount int `json:"unlock_total_count"` // 解锁条件:平台所有用户累计抽奖次数达到该值后解锁
|
||||||
Images string `json:"images"` // 奖品图片
|
DailyAmountLimit float64 `json:"daily_amount_limit"` // 当天消费金额限制(0 表示不限制)
|
||||||
|
Images string `json:"images"` // 奖品图片
|
||||||
}
|
}
|
||||||
|
|
||||||
type UpdatePrizeRequest struct {
|
type UpdatePrizeRequest struct {
|
||||||
ID uint `json:"id" binding:"required"` // 奖品ID
|
ID uint `json:"id" binding:"required"` // 奖品ID
|
||||||
Name string `json:"name"` // 奖品名称
|
Name string `json:"name"` // 奖品名称
|
||||||
PrizeType int `json:"prize_type"` // 奖品类型:1-积分,2-优惠券,3-实物,0-谢谢参与
|
PrizeType int `json:"prize_type"` // 奖品类型:1-积分,2-优惠券,3-实物,4-租卡会员兑换码(30天),0-谢谢参与
|
||||||
PrizeValue int `json:"prize_value"` // 奖品值:积分数或优惠券ID等
|
PrizeValue int `json:"prize_value"` // 奖品值:积分数或优惠券ID等
|
||||||
Level int `json:"level"` // 奖品等级:如1表示一等奖
|
Level int `json:"level"` // 奖品等级:如1表示一等奖
|
||||||
Weight int `json:"weight"` // 抽奖权重:用于控制中奖概率
|
Weight int `json:"weight"` // 抽奖权重:用于控制中奖概率
|
||||||
Stock int `json:"stock"` // 剩余库存
|
Stock int `json:"stock"` // 剩余库存
|
||||||
Status int `json:"status"` // 奖品状态:1-启用,2-禁用
|
Status int `json:"status"` // 奖品状态:1-启用,2-禁用
|
||||||
UnlockUserCount int `json:"unlock_user_count"` // 用户抽奖次数达到该值后解锁该奖品
|
UnlockUserCount int `json:"unlock_user_count"` // 用户抽奖次数达到该值后解锁该奖品
|
||||||
UnlockTotalCount int `json:"unlock_total_count"` // 全部用户总抽奖次数达到该值后解锁奖品
|
UnlockTotalCount int `json:"unlock_total_count"` // 全部用户总抽奖次数达到该值后解锁奖品
|
||||||
Images string `json:"images"` // 奖品图片
|
DailyAmountLimit float64 `json:"daily_amount_limit"` // 当天消费金额限制(0 表示不限制)
|
||||||
|
Images string `json:"images"` // 奖品图片
|
||||||
}
|
}
|
||||||
|
|
||||||
// CreatePrizeResp 创建成功响应
|
// CreatePrizeResp 创建成功响应
|
||||||
|
@ -211,3 +216,7 @@ func TrimTrailingZerosFromPercent(s string) string {
|
||||||
s = strings.TrimRight(s, ".")
|
s = strings.TrimRight(s, ".")
|
||||||
return s + "%"
|
return s + "%"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type PickupLotteryPrizeOrderRequest struct {
|
||||||
|
OrderID uint `json:"order_id" binding:"required"` // 奖品订单ID
|
||||||
|
}
|
||||||
|
|
|
@ -20,5 +20,6 @@ func registerLotteryRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddle
|
||||||
router.POST("/prize_order/list", lotterymanage.LotteryPrizeOrderList) // 查询抽奖订单列表
|
router.POST("/prize_order/list", lotterymanage.LotteryPrizeOrderList) // 查询抽奖订单列表
|
||||||
router.POST("/prize_order/detail", lotterymanage.GetLotteryPrizeOrderDetail) // 查询抽奖订单详情
|
router.POST("/prize_order/detail", lotterymanage.GetLotteryPrizeOrderDetail) // 查询抽奖订单详情
|
||||||
router.POST("/prize_order/ship", lotterymanage.ShipLotteryPrizeOrder) // 抽奖订单发货
|
router.POST("/prize_order/ship", lotterymanage.ShipLotteryPrizeOrder) // 抽奖订单发货
|
||||||
|
router.POST("/prize_order/pickup", lotterymanage.PickupLotteryPrizeOrder) // 抽奖订单门店自提
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
79
docs/docs.go
79
docs/docs.go
|
@ -5416,6 +5416,39 @@ const docTemplate = `{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"/api/v1/lottery/prize_order/pickup": {
|
||||||
|
"post": {
|
||||||
|
"consumes": [
|
||||||
|
"application/json"
|
||||||
|
],
|
||||||
|
"produces": [
|
||||||
|
"application/json"
|
||||||
|
],
|
||||||
|
"tags": [
|
||||||
|
"积分抽奖,V1.5.0"
|
||||||
|
],
|
||||||
|
"summary": "抽奖订单门店自提",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"description": "查询参数",
|
||||||
|
"name": "data",
|
||||||
|
"in": "body",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/models.PickupLotteryPrizeOrderRequest"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "OK",
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/app.Response"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"/api/v1/lottery/prize_order/ship": {
|
"/api/v1/lottery/prize_order/ship": {
|
||||||
"post": {
|
"post": {
|
||||||
"consumes": [
|
"consumes": [
|
||||||
|
@ -10684,6 +10717,10 @@ const docTemplate = `{
|
||||||
"weight"
|
"weight"
|
||||||
],
|
],
|
||||||
"properties": {
|
"properties": {
|
||||||
|
"daily_amount_limit": {
|
||||||
|
"description": "当天消费金额限制(0 表示不限制)",
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
"images": {
|
"images": {
|
||||||
"description": "奖品图片",
|
"description": "奖品图片",
|
||||||
"type": "string"
|
"type": "string"
|
||||||
|
@ -10697,7 +10734,7 @@ const docTemplate = `{
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"prize_type": {
|
"prize_type": {
|
||||||
"description": "奖品类型:1-积分,2-优惠券,3-实物,0-谢谢参与",
|
"description": "奖品类型:1-积分,2-优惠券,3-实物,4-租卡会员兑换码(30天),0-谢谢参与",
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
},
|
},
|
||||||
"prize_value": {
|
"prize_value": {
|
||||||
|
@ -19182,6 +19219,10 @@ const docTemplate = `{
|
||||||
"description": "创建时间",
|
"description": "创建时间",
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"daily_amount_limit": {
|
||||||
|
"description": "当天消费金额限制(0 表示不限制)",
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
"id": {
|
"id": {
|
||||||
"description": "数据库记录编号",
|
"description": "数据库记录编号",
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
|
@ -19199,7 +19240,7 @@ const docTemplate = `{
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"prize_type": {
|
"prize_type": {
|
||||||
"description": "奖品类型:1-积分 2-优惠券 3-实物 0-谢谢参与",
|
"description": "奖品类型:1-积分 2-优惠券 3-实物 4-租卡会员兑换码(30天)0-谢谢参与",
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
},
|
},
|
||||||
"prize_value": {
|
"prize_value": {
|
||||||
|
@ -19243,6 +19284,14 @@ const docTemplate = `{
|
||||||
"description": "创建时间",
|
"description": "创建时间",
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"deliver_shopper_code": {
|
||||||
|
"description": "发货店员用户ID",
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"deliver_shopper_name": {
|
||||||
|
"description": "发货店员名称",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"id": {
|
"id": {
|
||||||
"description": "数据库记录编号",
|
"description": "数据库记录编号",
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
|
@ -19336,6 +19385,14 @@ const docTemplate = `{
|
||||||
"description": "创建时间",
|
"description": "创建时间",
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"deliver_shopper_code": {
|
||||||
|
"description": "发货店员用户ID",
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"deliver_shopper_name": {
|
||||||
|
"description": "发货店员名称",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"id": {
|
"id": {
|
||||||
"description": "数据库记录编号",
|
"description": "数据库记录编号",
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
|
@ -20597,6 +20654,18 @@ const docTemplate = `{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"models.PickupLotteryPrizeOrderRequest": {
|
||||||
|
"type": "object",
|
||||||
|
"required": [
|
||||||
|
"order_id"
|
||||||
|
],
|
||||||
|
"properties": {
|
||||||
|
"order_id": {
|
||||||
|
"description": "奖品订单ID",
|
||||||
|
"type": "integer"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"models.Post": {
|
"models.Post": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
@ -24273,6 +24342,10 @@ const docTemplate = `{
|
||||||
"id"
|
"id"
|
||||||
],
|
],
|
||||||
"properties": {
|
"properties": {
|
||||||
|
"daily_amount_limit": {
|
||||||
|
"description": "当天消费金额限制(0 表示不限制)",
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
"id": {
|
"id": {
|
||||||
"description": "奖品ID",
|
"description": "奖品ID",
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
|
@ -24290,7 +24363,7 @@ const docTemplate = `{
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"prize_type": {
|
"prize_type": {
|
||||||
"description": "奖品类型:1-积分,2-优惠券,3-实物,0-谢谢参与",
|
"description": "奖品类型:1-积分,2-优惠券,3-实物,4-租卡会员兑换码(30天),0-谢谢参与",
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
},
|
},
|
||||||
"prize_value": {
|
"prize_value": {
|
||||||
|
|
|
@ -5405,6 +5405,39 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"/api/v1/lottery/prize_order/pickup": {
|
||||||
|
"post": {
|
||||||
|
"consumes": [
|
||||||
|
"application/json"
|
||||||
|
],
|
||||||
|
"produces": [
|
||||||
|
"application/json"
|
||||||
|
],
|
||||||
|
"tags": [
|
||||||
|
"积分抽奖,V1.5.0"
|
||||||
|
],
|
||||||
|
"summary": "抽奖订单门店自提",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"description": "查询参数",
|
||||||
|
"name": "data",
|
||||||
|
"in": "body",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/models.PickupLotteryPrizeOrderRequest"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "OK",
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/app.Response"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"/api/v1/lottery/prize_order/ship": {
|
"/api/v1/lottery/prize_order/ship": {
|
||||||
"post": {
|
"post": {
|
||||||
"consumes": [
|
"consumes": [
|
||||||
|
@ -10673,6 +10706,10 @@
|
||||||
"weight"
|
"weight"
|
||||||
],
|
],
|
||||||
"properties": {
|
"properties": {
|
||||||
|
"daily_amount_limit": {
|
||||||
|
"description": "当天消费金额限制(0 表示不限制)",
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
"images": {
|
"images": {
|
||||||
"description": "奖品图片",
|
"description": "奖品图片",
|
||||||
"type": "string"
|
"type": "string"
|
||||||
|
@ -10686,7 +10723,7 @@
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"prize_type": {
|
"prize_type": {
|
||||||
"description": "奖品类型:1-积分,2-优惠券,3-实物,0-谢谢参与",
|
"description": "奖品类型:1-积分,2-优惠券,3-实物,4-租卡会员兑换码(30天),0-谢谢参与",
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
},
|
},
|
||||||
"prize_value": {
|
"prize_value": {
|
||||||
|
@ -19171,6 +19208,10 @@
|
||||||
"description": "创建时间",
|
"description": "创建时间",
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"daily_amount_limit": {
|
||||||
|
"description": "当天消费金额限制(0 表示不限制)",
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
"id": {
|
"id": {
|
||||||
"description": "数据库记录编号",
|
"description": "数据库记录编号",
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
|
@ -19188,7 +19229,7 @@
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"prize_type": {
|
"prize_type": {
|
||||||
"description": "奖品类型:1-积分 2-优惠券 3-实物 0-谢谢参与",
|
"description": "奖品类型:1-积分 2-优惠券 3-实物 4-租卡会员兑换码(30天)0-谢谢参与",
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
},
|
},
|
||||||
"prize_value": {
|
"prize_value": {
|
||||||
|
@ -19232,6 +19273,14 @@
|
||||||
"description": "创建时间",
|
"description": "创建时间",
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"deliver_shopper_code": {
|
||||||
|
"description": "发货店员用户ID",
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"deliver_shopper_name": {
|
||||||
|
"description": "发货店员名称",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"id": {
|
"id": {
|
||||||
"description": "数据库记录编号",
|
"description": "数据库记录编号",
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
|
@ -19325,6 +19374,14 @@
|
||||||
"description": "创建时间",
|
"description": "创建时间",
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"deliver_shopper_code": {
|
||||||
|
"description": "发货店员用户ID",
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"deliver_shopper_name": {
|
||||||
|
"description": "发货店员名称",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"id": {
|
"id": {
|
||||||
"description": "数据库记录编号",
|
"description": "数据库记录编号",
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
|
@ -20586,6 +20643,18 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"models.PickupLotteryPrizeOrderRequest": {
|
||||||
|
"type": "object",
|
||||||
|
"required": [
|
||||||
|
"order_id"
|
||||||
|
],
|
||||||
|
"properties": {
|
||||||
|
"order_id": {
|
||||||
|
"description": "奖品订单ID",
|
||||||
|
"type": "integer"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"models.Post": {
|
"models.Post": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
@ -24262,6 +24331,10 @@
|
||||||
"id"
|
"id"
|
||||||
],
|
],
|
||||||
"properties": {
|
"properties": {
|
||||||
|
"daily_amount_limit": {
|
||||||
|
"description": "当天消费金额限制(0 表示不限制)",
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
"id": {
|
"id": {
|
||||||
"description": "奖品ID",
|
"description": "奖品ID",
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
|
@ -24279,7 +24352,7 @@
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"prize_type": {
|
"prize_type": {
|
||||||
"description": "奖品类型:1-积分,2-优惠券,3-实物,0-谢谢参与",
|
"description": "奖品类型:1-积分,2-优惠券,3-实物,4-租卡会员兑换码(30天),0-谢谢参与",
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
},
|
},
|
||||||
"prize_value": {
|
"prize_value": {
|
||||||
|
|
|
@ -1446,6 +1446,9 @@ definitions:
|
||||||
type: object
|
type: object
|
||||||
models.CreatePrizeRequest:
|
models.CreatePrizeRequest:
|
||||||
properties:
|
properties:
|
||||||
|
daily_amount_limit:
|
||||||
|
description: 当天消费金额限制(0 表示不限制)
|
||||||
|
type: number
|
||||||
images:
|
images:
|
||||||
description: 奖品图片
|
description: 奖品图片
|
||||||
type: string
|
type: string
|
||||||
|
@ -1456,7 +1459,7 @@ definitions:
|
||||||
description: 奖品名称
|
description: 奖品名称
|
||||||
type: string
|
type: string
|
||||||
prize_type:
|
prize_type:
|
||||||
description: 奖品类型:1-积分,2-优惠券,3-实物,0-谢谢参与
|
description: 奖品类型:1-积分,2-优惠券,3-实物,4-租卡会员兑换码(30天),0-谢谢参与
|
||||||
type: integer
|
type: integer
|
||||||
prize_value:
|
prize_value:
|
||||||
description: 奖品值:积分数或优惠券ID等
|
description: 奖品值:积分数或优惠券ID等
|
||||||
|
@ -7610,6 +7613,9 @@ definitions:
|
||||||
createdAt:
|
createdAt:
|
||||||
description: 创建时间
|
description: 创建时间
|
||||||
type: string
|
type: string
|
||||||
|
daily_amount_limit:
|
||||||
|
description: 当天消费金额限制(0 表示不限制)
|
||||||
|
type: number
|
||||||
id:
|
id:
|
||||||
description: 数据库记录编号
|
description: 数据库记录编号
|
||||||
type: integer
|
type: integer
|
||||||
|
@ -7623,7 +7629,7 @@ definitions:
|
||||||
description: 奖品名称
|
description: 奖品名称
|
||||||
type: string
|
type: string
|
||||||
prize_type:
|
prize_type:
|
||||||
description: 奖品类型:1-积分 2-优惠券 3-实物 0-谢谢参与
|
description: 奖品类型:1-积分 2-优惠券 3-实物 4-租卡会员兑换码(30天)0-谢谢参与
|
||||||
type: integer
|
type: integer
|
||||||
prize_value:
|
prize_value:
|
||||||
description: 奖品值(积分数或券ID等)
|
description: 奖品值(积分数或券ID等)
|
||||||
|
@ -7655,6 +7661,12 @@ definitions:
|
||||||
createdAt:
|
createdAt:
|
||||||
description: 创建时间
|
description: 创建时间
|
||||||
type: string
|
type: string
|
||||||
|
deliver_shopper_code:
|
||||||
|
description: 发货店员用户ID
|
||||||
|
type: integer
|
||||||
|
deliver_shopper_name:
|
||||||
|
description: 发货店员名称
|
||||||
|
type: string
|
||||||
id:
|
id:
|
||||||
description: 数据库记录编号
|
description: 数据库记录编号
|
||||||
type: integer
|
type: integer
|
||||||
|
@ -7724,6 +7736,12 @@ definitions:
|
||||||
createdAt:
|
createdAt:
|
||||||
description: 创建时间
|
description: 创建时间
|
||||||
type: string
|
type: string
|
||||||
|
deliver_shopper_code:
|
||||||
|
description: 发货店员用户ID
|
||||||
|
type: integer
|
||||||
|
deliver_shopper_name:
|
||||||
|
description: 发货店员名称
|
||||||
|
type: string
|
||||||
id:
|
id:
|
||||||
description: 数据库记录编号
|
description: 数据库记录编号
|
||||||
type: integer
|
type: integer
|
||||||
|
@ -8629,6 +8647,14 @@ definitions:
|
||||||
uid:
|
uid:
|
||||||
type: integer
|
type: integer
|
||||||
type: object
|
type: object
|
||||||
|
models.PickupLotteryPrizeOrderRequest:
|
||||||
|
properties:
|
||||||
|
order_id:
|
||||||
|
description: 奖品订单ID
|
||||||
|
type: integer
|
||||||
|
required:
|
||||||
|
- order_id
|
||||||
|
type: object
|
||||||
models.Post:
|
models.Post:
|
||||||
properties:
|
properties:
|
||||||
createBy:
|
createBy:
|
||||||
|
@ -11289,6 +11315,9 @@ definitions:
|
||||||
type: object
|
type: object
|
||||||
models.UpdatePrizeRequest:
|
models.UpdatePrizeRequest:
|
||||||
properties:
|
properties:
|
||||||
|
daily_amount_limit:
|
||||||
|
description: 当天消费金额限制(0 表示不限制)
|
||||||
|
type: number
|
||||||
id:
|
id:
|
||||||
description: 奖品ID
|
description: 奖品ID
|
||||||
type: integer
|
type: integer
|
||||||
|
@ -11302,7 +11331,7 @@ definitions:
|
||||||
description: 奖品名称
|
description: 奖品名称
|
||||||
type: string
|
type: string
|
||||||
prize_type:
|
prize_type:
|
||||||
description: 奖品类型:1-积分,2-优惠券,3-实物,0-谢谢参与
|
description: 奖品类型:1-积分,2-优惠券,3-实物,4-租卡会员兑换码(30天),0-谢谢参与
|
||||||
type: integer
|
type: integer
|
||||||
prize_value:
|
prize_value:
|
||||||
description: 奖品值:积分数或优惠券ID等
|
description: 奖品值:积分数或优惠券ID等
|
||||||
|
@ -15324,6 +15353,27 @@ paths:
|
||||||
summary: 查询抽奖订单列表
|
summary: 查询抽奖订单列表
|
||||||
tags:
|
tags:
|
||||||
- 积分抽奖,V1.5.0
|
- 积分抽奖,V1.5.0
|
||||||
|
/api/v1/lottery/prize_order/pickup:
|
||||||
|
post:
|
||||||
|
consumes:
|
||||||
|
- application/json
|
||||||
|
parameters:
|
||||||
|
- description: 查询参数
|
||||||
|
in: body
|
||||||
|
name: data
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/models.PickupLotteryPrizeOrderRequest'
|
||||||
|
produces:
|
||||||
|
- application/json
|
||||||
|
responses:
|
||||||
|
"200":
|
||||||
|
description: OK
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/app.Response'
|
||||||
|
summary: 抽奖订单门店自提
|
||||||
|
tags:
|
||||||
|
- 积分抽奖,V1.5.0
|
||||||
/api/v1/lottery/prize_order/ship:
|
/api/v1/lottery/prize_order/ship:
|
||||||
post:
|
post:
|
||||||
consumes:
|
consumes:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user