dir.go 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. package model
  2. import xtime "go-common/library/time"
  3. // DirConfig dir config
  4. type DirConfig struct {
  5. Pic DirPicConfig `json:"dir_pic_config"`
  6. Rate DirRateConfig `json:"dir_rate_config"`
  7. }
  8. // DirPicConfig pic config
  9. type DirPicConfig struct {
  10. FileSize uint `json:"file_size"` //文件大小上限 单位 Byte
  11. MaxPixelWidthSize uint `json:"max_pixel_width_size"` //像素宽上限
  12. MinPixelWidthSize uint `json:"min_pixel_width_size"` //像素高下限
  13. MaxPixelHeightSize uint `json:"max_pixel_height_size"` //像素高上限
  14. MinPixelHeightSize uint `json:"min_pixel_height_size"` //像素宽下限
  15. MaxAspectRatio float64 `json:"max_aspect_ratio"` //最大宽高比
  16. MinAspectRatio float64 `json:"min_aspect_ratio"` //最小宽高比
  17. AllowType string `json:"allow_type"` //允许的MIME类型
  18. }
  19. // DirRateConfig rate config
  20. type DirRateConfig struct {
  21. // SecondQPS 接受 CountQPS 个请求
  22. SecondQPS uint `json:"second_qps"`
  23. CountQPS uint `json:"count_qps"`
  24. }
  25. // DirLimit table dir_limit ORM
  26. type DirLimit struct {
  27. ID int `json:"id" gorm:"column:id"`
  28. BucketName string `json:"bucket_name" gorm:"column:bucket_name"`
  29. Dir string `json:"dir" gorm:"column:dir"`
  30. ConfigPic string `json:"config_pic" gorm:"column:config_pic"`
  31. ConfigRate string `json:"config_rate" gorm:"column:config_rate"`
  32. CTime xtime.Time `json:"ctime" gorm:"column:ctime"`
  33. MTime xtime.Time `json:"mtime" gorm:"column:mtime"`
  34. }
  35. // TableName dir_limit
  36. func (dl DirLimit) TableName() string {
  37. return "dir_limit"
  38. }