init: web_hgcg_server 初始化提交
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,67 @@
|
||||
package web_card
|
||||
|
||||
import (
|
||||
"videoweb/pub/common"
|
||||
"videoweb/pub/common/srvdef"
|
||||
"videoweb/web/service/srv_viporder"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
// @Tags 会员卡管理
|
||||
// @Summary 查询充值订单列表
|
||||
// @Description 分页查询充值订单,支持按 OrderType 筛选:1会员 2金币;不传 orderType 则返回全部类型
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param param body srv_viporder.VipOrderReq true "查询参数"
|
||||
// @Success 200 {object} srv_viporder.VipOrderResp "成功"
|
||||
// @Failure 400 {string} string "参数错误"
|
||||
// @Security ApiKeyAuth
|
||||
// @Router /api/web/card/order/list [POST]
|
||||
func GetOrders(ctx *gin.Context) {
|
||||
var req srv_viporder.VipOrderReq
|
||||
if err := ctx.ShouldBindJSON(&req); err != nil {
|
||||
common.ServerJSON(ctx, srvdef.ErrParamError, nil)
|
||||
return
|
||||
}
|
||||
if req.PageNum < 1 {
|
||||
req.PageNum = 1
|
||||
}
|
||||
if req.PageSize < 1 || req.PageSize > 100 {
|
||||
req.PageSize = 20
|
||||
}
|
||||
|
||||
resp, serr := srv_viporder.GetOrders(ctx, &req)
|
||||
if serr != nil {
|
||||
common.ServerJSON(ctx, serr.Code, serr.Tips)
|
||||
return
|
||||
}
|
||||
common.ServerJSON(ctx, srvdef.Success, resp)
|
||||
}
|
||||
|
||||
// SyncDistrictCode web端同步历史订单渠道码
|
||||
// @Tags 会员卡管理
|
||||
// @Summary 同步历史订单渠道码
|
||||
// @Description 将历史订单中空的渠道码,按用户当前 districtCode 回填。可重复调用,hasMore 为 true 时继续请求。
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param param body srv_viporder.SyncDistrictCodeReq false "同步参数"
|
||||
// @Success 200 {object} srv_viporder.SyncDistrictCodeResp "成功"
|
||||
// @Failure 400 {string} string "参数错误"
|
||||
// @Security ApiKeyAuth
|
||||
// @Router /api/web/card/order/district/sync [POST]
|
||||
func SyncDistrictCode(ctx *gin.Context) {
|
||||
var req srv_viporder.SyncDistrictCodeReq
|
||||
if ctx.Request.ContentLength > 0 {
|
||||
if err := ctx.ShouldBindJSON(&req); err != nil {
|
||||
common.ServerJSON(ctx, srvdef.ErrParamError, nil)
|
||||
return
|
||||
}
|
||||
}
|
||||
resp, serr := srv_viporder.SyncDistrictCode(ctx, &req)
|
||||
if serr != nil {
|
||||
common.ServerJSON(ctx, serr.Code, serr.Tips)
|
||||
return
|
||||
}
|
||||
common.ServerJSON(ctx, srvdef.Success, resp)
|
||||
}
|
||||
Reference in New Issue
Block a user