golang-im聊天
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

cloud_upload.go 724 B

2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
12345678910111213141516171819202122232425
  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. }