service/app/mix/controller/account_cancellation_op.go

38 lines
900 B
Go
Raw Normal View History

2024-03-07 01:18:41 +08:00
package controller
import (
"service/api/consts"
"service/api/errcode"
account_cancellationproto "service/api/proto/account_cancellation/proto"
"service/app/mix/service"
"service/bizcommon/util"
"service/library/logger"
"github.com/gin-gonic/gin"
)
func OpGetAccountCancellationList(ctx *gin.Context) {
req := ctx.MustGet("client_req").(*account_cancellationproto.OpListReq)
//设置默认页长
if req.Limit == 0 {
req.Limit = consts.DefaultPageSize
}
list, ec := service.DefaultService.OpGetAccountCancellationList(ctx, req)
if ec != errcode.ErrCodeAccountCancellationSrvOk {
logger.Error("OpGetAccountCancellationList fail, req: %v, ec: %v", util.ToJson(req), ec)
ReplyErrCodeMsg(ctx, ec)
return
}
data := &account_cancellationproto.OpListData{
List: list,
Offset: req.Offset + len(list),
}
if len(list) >= req.Limit {
data.More = 1
}
ReplyOk(ctx, data)
}