FileDict.php 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | Niucloud-admin 企业快速开发的saas管理平台
  4. // +----------------------------------------------------------------------
  5. // | 官方网址:https://www.niucloud.com
  6. // +----------------------------------------------------------------------
  7. // | niucloud团队 版权所有 开源版本可自由商用
  8. // +----------------------------------------------------------------------
  9. // | Author: Niucloud Team
  10. // +----------------------------------------------------------------------
  11. namespace app\dict\sys;
  12. class FileDict
  13. {
  14. //上传方式 图片
  15. public const IMAGE = 'image';
  16. //上传方式 视频
  17. public const VIDEO = 'video';
  18. //上传方式 文件
  19. public const DOCUMENT = 'document';
  20. public const LOCAL = 'local';//本地存储
  21. public const QINIU = 'qiniu';//七牛云
  22. public const ALIYUN = 'aliyun';//阿里云
  23. public const QCLOUD = 'qcloud';//腾讯云
  24. public const WECHAT = 'wechat';
  25. public const APPLET = 'applet';
  26. public const BIG = 'big';//微信支付
  27. public const MID = 'mid';//小程序上传
  28. public const SMALL = 'small';
  29. public const EXCEL = 'excel';//excel导入
  30. /**
  31. * 附件类型
  32. * @return array
  33. */
  34. public static function getType()
  35. {
  36. return [
  37. self::IMAGE => get_lang('dict_file.type_image'),//图片
  38. self::VIDEO => get_lang('dict_file.type_video'),//视频
  39. ];
  40. }
  41. /**
  42. * 存储方式
  43. * @return array
  44. */
  45. public static function getStorageType()
  46. {
  47. return [
  48. self::LOCAL => get_lang('dict_file.storage_type_local'),//本地存储
  49. self::QINIU => get_lang('dict_file.storage_type_qiniu'),//七牛云
  50. self::ALIYUN => get_lang('dict_file.storage_type_image'),//阿里云
  51. self::QCLOUD => get_lang('dict_file.storage_type_qcloud'),//腾讯云
  52. ];
  53. }
  54. /**
  55. * 获取上传的场景
  56. * @return array
  57. */
  58. public static function getSceneType()
  59. {
  60. return [
  61. self::WECHAT,//微信相关上传
  62. self::ALIYUN,//阿里云相关上传
  63. self::IMAGE,//图片上传
  64. self::VIDEO,//视频上传
  65. self::APPLET,//小程序包上传
  66. self::EXCEL,//excel导入
  67. ];
  68. }
  69. /**
  70. * 缩略图规格
  71. * @return string[]
  72. */
  73. public static function getThumbType()
  74. {
  75. return [
  76. self::BIG,//微信相关上传
  77. self::MID,//阿里云相关上传
  78. self::SMALL,//图片上传
  79. ];
  80. }
  81. }