service/app/mix/controller/streamerauthapproval_detail...

78 lines
2.7 KiB
Go
Raw Permalink Normal View History

2024-07-02 05:49:27 +08:00
package controller
import (
"service/api/errcode"
streamerauthapprovaldetailsproto "service/api/proto/streamerauthapprovaldetails/proto"
"service/app/mix/service"
"service/bizcommon/util"
"service/library/logger"
"service/library/mediafiller"
"github.com/gin-gonic/gin"
)
func ApiCreateStreamerAuthApprovalDetails(ctx *gin.Context) {
req := ctx.MustGet("client_req").(*streamerauthapprovaldetailsproto.ApiCreateReq)
ec := service.DefaultService.ApiCreateStreamerAuthApprovalDetails(ctx, req)
2024-07-05 16:47:36 +08:00
if ec != errcode.ErrCodeStreamerAuthApprovalDetailsSrvOk {
2024-07-02 05:49:27 +08:00
logger.Error("ApiCreateStreamerAuthApproval fail, req: %v, ec: %v", util.ToJson(req), ec)
ReplyErrCodeMsg(ctx, ec)
return
}
ReplyOk(ctx, nil)
}
func ApiDeleteStreamerAuthApprovalDetails(ctx *gin.Context) {
req := ctx.MustGet("client_req").(*streamerauthapprovaldetailsproto.ApiDeleteReq)
ec := service.DefaultService.ApiDeleteStreamerAuthApprovalDetails(ctx, req)
if ec != errcode.ErrCodeStreamerAuthApprovalDetailsSrvOk {
logger.Error("ApiDeleteStreamerAuthApproval fail, req: %v, ec: %v", util.ToJson(req), ec)
ReplyErrCodeMsg(ctx, ec)
return
}
ReplyOk(ctx, nil)
}
func ApiGetStreamerAuthApprovalDetailsList(ctx *gin.Context) {
req := ctx.MustGet("client_req").(*streamerauthapprovaldetailsproto.ApiListReq)
streamerauthapprovaldetails, ec := service.DefaultService.ApiGetStreamerAuthApprovalDetailsList(ctx, req)
2024-07-05 16:47:36 +08:00
if ec != errcode.ErrCodeStreamerAuthApprovalDetailsSrvOk {
2024-07-02 05:49:27 +08:00
logger.Error("ApiGetStreamerAuthApprovalList fail, req: %v, ec: %v", util.ToJson(req), ec)
ReplyErrCodeMsg(ctx, ec)
return
}
//填充媒体切片
2024-07-09 21:02:18 +08:00
objectMediaNum := 3 // 单个女神认证审批服务总共3个媒体类
2024-07-02 05:49:27 +08:00
mediaFillableList := make([]mediafiller.MediaFillable, objectMediaNum)
mediaFillableList[0] = streamerauthapprovaldetails.Cover
mediaFillableList[1] = streamerauthapprovaldetails.Shorts
mediaFillableList[2] = streamerauthapprovaldetails.Album
mediafiller.FillList(ctx, mediaFillableList)
data := &streamerauthapprovaldetailsproto.ApiListData{
StreamerAuthApprovalDetailsApiVO: streamerauthapprovaldetails,
}
ReplyOk(ctx, data)
}
2024-07-05 16:47:36 +08:00
func ApiGetStreamerAuthApprovalApproveStatuses(ctx *gin.Context) {
req := ctx.MustGet("client_req").(*streamerauthapprovaldetailsproto.ApiGetApproveStatusesReq)
basicStatus, detailsStatus, ec := service.DefaultService.GetStreamerAuthApprovalStatuses(ctx, req)
if ec != errcode.ErrCodeStreamerAuthApprovalDetailsSrvOk {
logger.Error("GetStreamerAuthApprovalStatuses fail, req: %v, ec: %v", util.ToJson(req), ec)
ReplyErrCodeMsg(ctx, ec)
return
}
data := &streamerauthapprovaldetailsproto.ApiGetApproveStatusesData{
BasicStatus: basicStatus,
DetailsStatus: detailsStatus,
}
ReplyOk(ctx, data)
}