49 lines
1.5 KiB
Go
49 lines
1.5 KiB
Go
|
package controller
|
||
|
|
||
|
import (
|
||
|
"service/api/consts"
|
||
|
"service/api/errcode"
|
||
|
streamerauthapprovaldetailshisproto "service/api/proto/streamerauthapprovaldetailshis/proto"
|
||
|
"service/app/mix/service"
|
||
|
"service/bizcommon/util"
|
||
|
"service/library/logger"
|
||
|
"service/library/mediafiller"
|
||
|
|
||
|
"github.com/gin-gonic/gin"
|
||
|
)
|
||
|
|
||
|
func OpGetStreamerAuthApprovalDetailsHisList(ctx *gin.Context) {
|
||
|
req := ctx.MustGet("client_req").(*streamerauthapprovaldetailshisproto.OpListReq)
|
||
|
|
||
|
//设置默认页长
|
||
|
if req.Limit == 0 {
|
||
|
req.Limit = consts.DefaultPageSize
|
||
|
}
|
||
|
|
||
|
list, ec := service.DefaultService.OpGetStreamerAuthApprovalDetailsHisList(ctx, req)
|
||
|
if ec != errcode.ErrCodeStreamerAuthApprovalDetailsSrvOk {
|
||
|
logger.Error("OpGetStreamerAuthApprovalDetailsList fail, req: %v, ec: %v", util.ToJson(req), ec)
|
||
|
ReplyErrCodeMsg(ctx, ec)
|
||
|
return
|
||
|
}
|
||
|
|
||
|
//填充媒体切片
|
||
|
objectMediaNum := 3 // 单个女神认证审批服务总共3个媒体类
|
||
|
mediaFillableList := make([]mediafiller.MediaFillable, len(list)*objectMediaNum)
|
||
|
for i, streamerauthapprovaldetails := range list {
|
||
|
mediaFillableList[objectMediaNum*i+0] = streamerauthapprovaldetails.Cover
|
||
|
mediaFillableList[objectMediaNum*i+1] = streamerauthapprovaldetails.Shorts
|
||
|
mediaFillableList[objectMediaNum*i+2] = streamerauthapprovaldetails.Album
|
||
|
}
|
||
|
mediafiller.FillList(ctx, mediaFillableList)
|
||
|
|
||
|
data := &streamerauthapprovaldetailshisproto.OpListData{
|
||
|
List: list,
|
||
|
Offset: req.Offset + len(list),
|
||
|
}
|
||
|
if len(list) >= req.Limit {
|
||
|
data.More = 1
|
||
|
}
|
||
|
ReplyOk(ctx, data)
|
||
|
}
|