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