role.go 964 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. package models
  2. import "time"
  3. type Role struct {
  4. Id int64
  5. PastureId int64 `xorm:"pastureid"`
  6. Name string `xorm:"name"`
  7. Sort int32 `xorm:"sort"`
  8. Enable int64 `xorm:"enable"`
  9. CreatedOn int64 `xorm:"created_on"`
  10. ModifiedOn int64 `xorm:"modified_on"`
  11. DeletedOn int64 `xorm:"deleted_on"`
  12. DataRole int32 `xorm:"datarole"`
  13. IsGroups int32 `xorm:"isgroups"`
  14. Remark string `xorm:"remark"`
  15. Createmp string `xorm:"createmp"`
  16. CreatedTime time.Time `xorm:"createdtime"`
  17. }
  18. func (r *Role) TableName() string {
  19. return "role"
  20. }
  21. func NewDefaultRole(pastureId int64) *Role {
  22. return &Role{
  23. PastureId: pastureId,
  24. Name: "集团下发超级管理员",
  25. Enable: 1,
  26. CreatedOn: time.Now().Unix(),
  27. ModifiedOn: 0,
  28. DeletedOn: 0,
  29. DataRole: 0,
  30. IsGroups: 0,
  31. Remark: "集团下发",
  32. Createmp: "管理员",
  33. CreatedTime: time.Now(),
  34. }
  35. }