package controller import ( "service/api/errcode" streamerauthapprovalbasicproto "service/api/proto/streamerauthapprovalbasic/proto" "service/app/mix/service" "service/bizcommon/util" "service/library/logger" "service/library/mediafiller" "github.com/gin-gonic/gin" ) func ApiCreateStreamerAuthApprovalBasic(ctx *gin.Context) { req := ctx.MustGet("client_req").(*streamerauthapprovalbasicproto.ApiCreateReq) ec := service.DefaultService.ApiCreateStreamerAuthApprovalBasic(ctx, req) if ec != errcode.ErrCodeStreamerAuthApprovalBasicSrvOk { logger.Error("ApiCreateStreamerAuthApproval fail, req: %v, ec: %v", util.ToJson(req), ec) ReplyErrCodeMsg(ctx, ec) return } ReplyOk(ctx, nil) } func ApiDeleteStreamerAuthApprovalBasic(ctx *gin.Context) { req := ctx.MustGet("client_req").(*streamerauthapprovalbasicproto.ApiDeleteReq) ec := service.DefaultService.ApiDeleteStreamerAuthApprovalBasic(ctx, req) if ec != errcode.ErrCodeStreamerAuthApprovalBasicSrvOk { logger.Error("ApiDeleteStreamerAuthApproval fail, req: %v, ec: %v", util.ToJson(req), ec) ReplyErrCodeMsg(ctx, ec) return } ReplyOk(ctx, nil) } func ApiGetStreamerAuthApprovalBasicList(ctx *gin.Context) { req := ctx.MustGet("client_req").(*streamerauthapprovalbasicproto.ApiListReq) streamerauthapprovalbasic, ec := service.DefaultService.ApiGetStreamerAuthApprovalBasicList(ctx, req) if ec != errcode.ErrCodeStreamerAuthApprovalBasicSrvOk { logger.Error("ApiGetStreamerAuthApprovalList fail, req: %v, ec: %v", util.ToJson(req), ec) ReplyErrCodeMsg(ctx, ec) return } //填充媒体切片 objectMediaNum := 2 // 单个女神认证审批服务总共5个媒体类 mediaFillableList := make([]mediafiller.MediaFillable, objectMediaNum) mediaFillableList[0] = streamerauthapprovalbasic.Avatar mediaFillableList[1] = streamerauthapprovalbasic.AccountShot mediafiller.FillList(ctx, mediaFillableList) data := &streamerauthapprovalbasicproto.ApiListData{ StreamerAuthApprovalBasicApiVO: streamerauthapprovalbasic, } ReplyOk(ctx, data) }