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.

33 lines
711 B

  1. package upload
  2. import (
  3. "gin-vue-admin/global"
  4. "mime/multipart"
  5. )
  6. //@author: [ccfish86](https://github.com/ccfish86)
  7. //@author: [SliverHorn](https://github.com/SliverHorn)
  8. //@interface_name: OSS
  9. //@description: OSS接口
  10. type OSS interface {
  11. UploadFile(file *multipart.FileHeader) (string, string, error)
  12. DeleteFile(key string) error
  13. }
  14. //@author: [ccfish86](https://github.com/ccfish86)
  15. //@author: [SliverHorn](https://github.com/SliverHorn)
  16. //@function: NewOss
  17. //@description: OSS接口
  18. //@description: OSS的实例化方法
  19. //@return: OSS
  20. func NewOss() OSS {
  21. switch global.GVA_CONFIG.System.OssType {
  22. case "local":
  23. return &Local{}
  24. case "qiniu":
  25. return &Qiniu{}
  26. default:
  27. return &Local{}
  28. }
  29. }