platform.go 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. package model
  2. import "go-common/library/time"
  3. // const .
  4. var (
  5. // PlatformMap 平台
  6. PlatformMap = map[string]string{"android": "android", "ios": "ios", "pc": "pc", "public": "public"}
  7. // Device 对应设备
  8. DeviceMap = map[string]string{"pad": "pad", "phone": "phone"}
  9. // MobiAPPIDIosMap iOS
  10. MobiAPPIDIosMap = map[string]string{"iphone": "iphone", "ipad": "ipad", "iphone_b": "iphone_b"}
  11. // MobiAPPIDAndroidMap Android
  12. MobiAPPIDAndroidMap = map[string]string{"android": "android", "android_tv_yst": "android_tv_yst", "android_tv": "android_tv", "android_i": "android_i", "android_b": "android_b"}
  13. )
  14. // ConfPlatform struct .
  15. type ConfPlatform struct {
  16. ID int64 `gorm:"column:id" json:"id" form:"id"`
  17. PlatformName string `gorm:"column:platform_name" json:"platform_name" form:"platform_name" validate:"required"`
  18. Platform string `gorm:"column:platform" json:"platform" form:"platform" validate:"required"`
  19. Device string `gorm:"column:device" json:"device" form:"device"`
  20. MobiApp string `gorm:"column:mobi_app" json:"mobi_app" form:"mobi_app"`
  21. PanelType string `gorm:"column:panel_type" json:"panel_type" form:"panel_type" default:"normal"`
  22. IsDel int8 `gorm:"column:is_del" json:"is_del" form:"is_del"`
  23. Operator string `gorm:"column:operator" json:"operator" form:"operator"`
  24. Ctime time.Time `gorm:"column:ctime" json:"ctime" form:"ctime"`
  25. Mtime time.Time `gorm:"column:mtime" json:"mtime" form:"mtime"`
  26. }
  27. // TableName for grom.
  28. func (s *ConfPlatform) TableName() string {
  29. return "vip_platform_config"
  30. }
  31. // TypePlatform struct .
  32. type TypePlatform struct {
  33. ID int64 `json:"id"`
  34. PlatformName string `json:"platform_name"`
  35. }