Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdminUsers ¶
type AdminUsers struct { Id int32 `json:"id" gorm:"column:id;primaryKey;autoIncrement" validate:"required,numeric"` Username string `json:"username" gorm:"column:username" validate:"required,max=255"` // 用户名称 Password string `json:"password" gorm:"column:password" validate:"required,max=255"` // 密码 CreatedAt time.Time `json:"created_at" gorm:"column:created_at" validate:"omitempty,datetime"` UpdatedAt time.Time `json:"updated_at" gorm:"column:updated_at" validate:"omitempty,datetime"` }
func NewAdminUsers ¶
func NewAdminUsers() *AdminUsers
func (*AdminUsers) TableName ¶
func (a *AdminUsers) TableName() string
type Policies ¶
type Policies struct { Id uint32 `json:"id" gorm:"column:id;primaryKey;autoIncrement" validate:"required,numeric"` RoleId uint32 `json:"role_id" gorm:"column:role_id" validate:"required,numeric"` // 角色id ResourceId uint32 `json:"resource_id" gorm:"column:resource_id" validate:"required,numeric"` // 资源id Action string `json:"action" gorm:"column:action" validate:"required,max=6"` // 操作 Effect string `json:"effect" gorm:"column:effect" validate:"required,max=5"` // 影响:ALLOW-允许、DENY-拒绝 CreatedAt time.Time `json:"created_at" gorm:"column:created_at" validate:"omitempty,datetime"` UpdatedAt time.Time `json:"updated_at" gorm:"column:updated_at" validate:"omitempty,datetime"` }
func NewPolicies ¶
func NewPolicies() *Policies
type Resources ¶
type Resources struct { Id uint32 `json:"id" gorm:"column:id;primaryKey;autoIncrement" validate:"required,numeric"` Name string `json:"name" gorm:"column:name" validate:"required,max=255"` // 资源名称 Type uint8 `json:"type" gorm:"column:type" validate:"required,numeric"` // 资源类型 CreatedAt time.Time `json:"created_at" gorm:"column:created_at" validate:"omitempty,datetime"` UpdatedAt time.Time `json:"updated_at" gorm:"column:updated_at" validate:"omitempty,datetime"` }
func NewResources ¶
func NewResources() *Resources
type Roles ¶
type Roles struct { Id uint32 `json:"id" gorm:"column:id;primaryKey;autoIncrement" validate:"required,numeric"` Name string `json:"name" gorm:"column:name" validate:"required,max=255"` // 角色名称 CreatedAt time.Time `json:"created_at" gorm:"column:created_at" validate:"omitempty,datetime"` UpdatedAt time.Time `json:"updated_at" gorm:"column:updated_at" validate:"omitempty,datetime"` }
type User ¶
type User struct { Id int32 `json:"id" gorm:"column:id;primaryKey;autoIncrement" validate:"required,numeric"` Username string `json:"username" gorm:"column:username" validate:"required,max=100"` // 用户名称 Password string `json:"password" gorm:"column:password" validate:"required,max=60"` // 密码 Avatar string `json:"avatar" gorm:"column:avatar" validate:"required,max=255"` // 头像 Phone string `json:"phone" gorm:"column:phone" validate:"required,max=11"` // 电话号码 Email string `json:"email" gorm:"column:email" validate:"required,max=255"` // 邮箱 Gender uint8 `json:"gender" gorm:"column:gender" validate:"required,numeric"` // 性别:0-未知、1-男、2-女 CreatedAt time.Time `json:"created_at" gorm:"column:created_at" validate:"omitempty,datetime"` UpdatedAt time.Time `json:"updated_at" gorm:"column:updated_at" validate:"omitempty,datetime"` }
Click to show internal directories.
Click to hide internal directories.