service/app/mix/controller/daily_statement_op.go

38 lines
860 B
Go
Raw Normal View History

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