package app import ( "context" "fmt" svc "gim/internal/business/comm/service" "gim/pkg/grpclib" ) type cloudUpload struct{} var CloudUpload = new(cloudUpload) // FileReqUpload 请求文件上传 func (*cloudUpload) FileReqUpload(ctx context.Context, uid, dirName, fName string, fSize int64) (interface{}, error) { masterId, _ := grpclib.GetCtxMasterId(ctx) callbackUrl := svc.SysCfgGet("-1", "cloud_file_upload_call_back_url") fileBucketHost := svc.SysCfgGet(masterId, "file_bucket_host") fileBucketScheme := svc.SysCfgGet("-1", "file_bucket_scheme") callbackUrl = fmt.Sprintf(callbackUrl, masterId, fileBucketHost, fileBucketScheme) return svc.FileReqUpload(ctx, uid, dirName, fName, callbackUrl, fSize) }