module.go 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. package user
  2. import (
  3. "go-common/library/time"
  4. )
  5. // modules
  6. const (
  7. USER = "USER"
  8. ECODE = "ECODE"
  9. DATABUS = "DATABUS"
  10. DAPPER = "DAPPER"
  11. CONFIG = "CONFIG"
  12. CANAL = "CANAL"
  13. DISCOVERY = "DISCOVERY"
  14. APP = "APP"
  15. PLATFORM = "PLATFORM"
  16. CACHE = "CACHE"
  17. OPEN = "OPEN"
  18. NEED = "NEED"
  19. PERFORMANCE = "PERFORMANCE"
  20. BFS = "BFS"
  21. )
  22. // Modules modules
  23. var (
  24. Modules = map[string]*Permission{
  25. USER: {Name: "USER", Permit: PermitSuper, Des: "用户管理"},
  26. ECODE: {Name: "ECODE", Permit: PermitDefault, Des: "错误码管理"},
  27. DATABUS: {Name: "DATABUS", Permit: PermitDefault, Des: "DATABUS管理"},
  28. DAPPER: {Name: "DAPPER", Permit: PermitDefault, Des: "DAPPER查询"},
  29. CONFIG: {Name: "CONFIG", Permit: PermitDefault, Des: "配置中心"},
  30. CANAL: {Name: "CANAL", Permit: PermitDefault, Des: "CANAL管理"},
  31. DISCOVERY: {Name: "DISCOVERY", Permit: PermitDefault, Des: "DISCOVERY管理"},
  32. APP: {Name: "APP", Permit: PermitDefault, Des: "APP管理"},
  33. PLATFORM: {Name: "PLATFORM", Permit: PermitAuth, Des: "平台管理"},
  34. CACHE: {Name: "CACHE", Permit: PermitDefault, Des: "缓存集群"},
  35. OPEN: {Name: "OPEN", Permit: PermitDefault, Des: "open鉴权管理"},
  36. NEED: {Name: "NEED", Permit: PermitDefault, Des: "需求管理"},
  37. PERFORMANCE: {Name: "PERFORMANCE", Permit: PermitDefault, Des: "性能管理"},
  38. BFS: {Name: "BFS", Permit: PermitAuth, Des: "BFS管理"},
  39. }
  40. )
  41. // var (
  42. // Modules = map[string]string{
  43. // USER: "用户管理",
  44. // ECODE: "错误码管理",
  45. // DATABUS: "DATABUS管理",
  46. // DAPPER: "DAPPER查询",
  47. // CONFIG: "配置中心",
  48. // CANAL: "CANAL管理",
  49. // DISCOVERY: "DISCOVERY管理",
  50. // APP: "APP管理",
  51. // PLATFORM: "平台管理",
  52. // CACHE: "缓存集群",
  53. // OPEN: "open鉴权管理",
  54. // NEED: "需求管理",
  55. // }
  56. // DefaultModules = []string{ECODE, DATABUS, DAPPER, CONFIG, CANAL, DISCOVERY, APP, CACHE, OPEN}
  57. // )
  58. // TableName case tablename
  59. func (*Module) TableName() string {
  60. return "user_module"
  61. }
  62. // Module module model
  63. type Module struct {
  64. ID int64 `gorm:"column:id" json:"id"`
  65. UserID int64 `gorm:"column:user_id" json:"user_id"`
  66. Module string `gorm:"column:module" json:"module"`
  67. Ctime time.Time `gorm:"column:ctime" json:"ctime"`
  68. Mtime time.Time `gorm:"column:mtime" json:"-"`
  69. }