diff --git a/app/mix/service/service.go b/app/mix/service/service.go index ede0f25f..1a285b24 100644 --- a/app/mix/service/service.go +++ b/app/mix/service/service.go @@ -2051,6 +2051,29 @@ func (s *Service) OpGetUserWxAddCheckList(ctx *gin.Context, req *userwxaddcheckp return } +func (s *Service) MediaAuth(ctx *gin.Context, req *mediaproto.MediaAuthReq) (policyToken *mediaproto.PolicyToken, ec errcode.ErrCode) { + ec = errcode.ErrCodeMediaSrvOk + policyToken, err := _DefaultMedia.GetPolicyToken(req.Mtype) + if err != nil { + logger.Error("GetPolicyToken fail, req: %v, err: %v", util.ToJson(req), err) + ec = errcode.ErrCodeMediaSrvFail + return + } + return +} + +func (s *Service) CUpload(ctx *gin.Context, req *mediaproto.CUploadReq) (ret interface{}, ec errcode.ErrCode) { + ec = errcode.ErrCodeMediaSrvOk + + ret, err := _DefaultMedia.Upload(ctx, req.Mtype, req.Item) + if err != nil { + logger.Error("Upload fail, req: %v, err: %v", util.ToJson(req), err) + ec = errcode.ErrCodeMediaUploadFail + return + } + return +} + // 媒体 func (s *Service) GetImageByIds(ctx *gin.Context, req *mediaproto.ImageListReq) (list []*dbstruct.Image, ec errcode.ErrCode) { ec = errcode.ErrCodeMediaSrvOk