service/app/mix/controller/vas_op.go

93 lines
2.4 KiB
Go
Raw Permalink Normal View History

2024-01-04 18:10:19 +08:00
package controller
import (
"github.com/gin-gonic/gin"
2024-01-17 21:57:45 +08:00
"service/api/errcode"
vasproto "service/api/proto/vas/proto"
2024-04-29 17:39:49 +08:00
zoneproto "service/api/proto/zone/proto"
2024-01-17 21:57:45 +08:00
"service/app/mix/service"
"service/bizcommon/util"
"service/library/logger"
2024-01-04 18:10:19 +08:00
)
2024-03-21 16:02:41 +08:00
func OpCoinOrderList(ctx *gin.Context) {
2024-01-17 21:57:45 +08:00
req := ctx.MustGet("client_req").(*vasproto.OpCoinOrderListReq)
2024-03-21 16:02:41 +08:00
if req.Limit <= 0 {
req.Limit = 1000
}
2024-01-17 21:57:45 +08:00
list, ec := service.DefaultService.OpCoinOrderList(ctx, req)
if ec != errcode.ErrCodeVasSrvOk {
logger.Error("OpCoinOrderList fail, req: %v, ec: %v", util.ToJson(req), ec)
ReplyErrCodeMsg(ctx, ec)
return
}
data := &vasproto.OpCoinOrderListData{
List: list,
}
ReplyOk(ctx, data)
2024-01-04 18:10:19 +08:00
}
2024-03-21 16:02:41 +08:00
func OpOrderList(ctx *gin.Context) {
req := ctx.MustGet("client_req").(*vasproto.OpOrderListReq)
if req.Limit <= 0 {
req.Limit = 1000
}
list, ec := service.DefaultService.OpOrderList(ctx, req)
if ec != errcode.ErrCodeVasSrvOk {
logger.Error("OpOrderList fail, req: %v, ec: %v", util.ToJson(req), ec)
ReplyErrCodeMsg(ctx, ec)
return
}
data := &vasproto.OpOrderListData{
List: list,
}
ReplyOk(ctx, data)
}
2024-04-29 17:39:49 +08:00
func OpZoneRefundList(ctx *gin.Context) {
req := ctx.MustGet("client_req").(*zoneproto.OpZoneRefundListParam)
if req.Limit <= 0 {
req.Limit = 1000
}
list, ec := service.DefaultService.OpZoneRefundList(ctx, req)
if ec != errcode.ErrCodeVasSrvOk {
logger.Error("OpOrderList fail, req: %v, ec: %v", util.ToJson(req), ec)
ReplyErrCodeMsg(ctx, ec)
return
}
data := &zoneproto.OpZoneRefundListData{
List: list,
}
ReplyOk(ctx, data)
}
2024-05-29 15:26:24 +08:00
func OpManualUnlockWechat(ctx *gin.Context) {
req := ctx.MustGet("client_req").(*zoneproto.OpManualUnlockWechatParam)
ec, err := service.DefaultService.OpManualUnlockWechat(ctx, req)
if ec != errcode.ErrCodeVasSrvOk {
logger.Error("RefundOrder fail, req: %v, ec: %v", util.ToJson(req), ec)
if err != nil {
ReplyErrorMsg(ctx, err.Error())
return
}
ReplyErrCodeMsg(ctx, ec)
return
}
ReplyOk(ctx, nil)
}
2024-07-17 17:51:08 +08:00
2024-07-19 11:02:34 +08:00
func OpRollbackZoneAdmissionExitStatus(ctx *gin.Context) {
req := ctx.MustGet("client_req").(*zoneproto.OpRollbackZoneExitStatusParam)
ec, err := service.DefaultService.OpRollbackZoneAdmissionExitStatus(ctx, req)
2024-07-17 17:51:08 +08:00
if ec != errcode.ErrCodeVasSrvOk {
2024-07-19 17:46:33 +08:00
logger.Error("OpRollbackZoneAdmissionExitStatus fail, req: %v, ec: %v", util.ToJson(req), ec)
2024-07-17 17:51:08 +08:00
if err != nil {
ReplyErrorMsg(ctx, err.Error())
return
}
ReplyErrCodeMsg(ctx, ec)
return
}
ReplyOk(ctx, nil)
}