golang-im聊天
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 
 
 

26 rindas
724 B

  1. package app
  2. import (
  3. "context"
  4. "fmt"
  5. svc "gim/internal/business/comm/service"
  6. "gim/pkg/grpclib"
  7. )
  8. type cloudUpload struct{}
  9. var CloudUpload = new(cloudUpload)
  10. // FileReqUpload 请求文件上传
  11. func (*cloudUpload) FileReqUpload(ctx context.Context, uid, dirName, fName string, fSize int64) (interface{}, error) {
  12. masterId, _ := grpclib.GetCtxMasterId(ctx)
  13. callbackUrl := svc.SysCfgGet("-1", "cloud_file_upload_call_back_url")
  14. fileBucketHost := svc.SysCfgGet(masterId, "file_bucket_host")
  15. fileBucketScheme := svc.SysCfgGet("-1", "file_bucket_scheme")
  16. callbackUrl = fmt.Sprintf(callbackUrl, masterId, fileBucketHost, fileBucketScheme)
  17. return svc.FileReqUpload(ctx, uid, dirName, fName, callbackUrl, fSize)
  18. }