| 123456789101112131415161718192021222324252627282930313233343536373839 | 
							- package models
 
- import "time"
 
- type Role struct {
 
- 	Id          int64
 
- 	PastureId   int64     `xorm:"pastureid"`
 
- 	Name        string    `xorm:"name"`
 
- 	Sort        int32     `xorm:"sort"`
 
- 	Enable      int64     `xorm:"enable"`
 
- 	CreatedOn   int64     `xorm:"created_on"`
 
- 	ModifiedOn  int64     `xorm:"modified_on"`
 
- 	DeletedOn   int64     `xorm:"deleted_on"`
 
- 	DataRole    int32     `xorm:"datarole"`
 
- 	IsGroups    int32     `xorm:"isgroups"`
 
- 	Remark      string    `xorm:"remark"`
 
- 	Createmp    string    `xorm:"createmp"`
 
- 	CreatedTime time.Time `xorm:"createdtime"`
 
- }
 
- func (r *Role) TableName() string {
 
- 	return "role"
 
- }
 
- func NewDefaultRole(pastureId int64) *Role {
 
- 	return &Role{
 
- 		PastureId:   pastureId,
 
- 		Name:        "集团下发超级管理员",
 
- 		Enable:      1,
 
- 		CreatedOn:   time.Now().Unix(),
 
- 		ModifiedOn:  0,
 
- 		DeletedOn:   0,
 
- 		DataRole:    0,
 
- 		IsGroups:    0,
 
- 		Remark:      "集团下发",
 
- 		Createmp:    "管理员",
 
- 		CreatedTime: time.Now(),
 
- 	}
 
- }
 
 
  |