Documentation
¶
Index ¶
Constants ¶
View Source
const (
// PassWordCost 密码加密难度
PassWordCost = 12
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseModel ¶
type BaseModel struct { ID int `gorm:"primary_key;unique" json:"id"` CreatedAt time.Time `gorm:"type:datetime;not null" json:"created_at"` UpdatedAt time.Time `gorm:"type:datetime;not null" json:"updated_at"` DeletedAt *time.Time `sql:"index" json:"deleted_at"` Status int `gorm:"not null;default:0" json:"status"` }
BaseModel model base
type Group ¶
type Group struct { BaseModel Name string `gorm:"not null;comment:'组名称'"` Code string `gorm:"not null;comment:'组编码'"` }
Group 组
type Module ¶
type Module struct { BaseModel Name string `gorm:"not null comment:'模块名称'"` // 模块名称 Code string `gorm:"not null comment:'模块编码'"` // 模块编码 }
Module 模块
type Office ¶
type Office struct { BaseModel ParentID int `gorm:"not null;comment:'上级ID';default:0"` // 上级ID Name string `gorm:"not null;comment:'组织名称'"` // 组织名称 Type int `gorm:"not null;comment:'组织类型'"` // 组织类型 }
Office 组织
type Position ¶
type Position struct { BaseModel ParentID int `gorm:"not null;comment:'上级ID';default:0"` // 上级ID OfficeID int `gorm:"not null;comment:'组织ID'"` // 组织ID Name string `gorm:"not null;comment:'职位名称'"` // 职位名称 Code string `gorm:"not null;comment:'职位编码'"` //职位编码 }
Position 身份,职位
type Proxy ¶
type Proxy struct { BaseModel Path string `gorm:"not null comment:'路由路径'"` Method string `gorm:"not null comment:'路由方法'"` ModuleID int `gorm:"not null comment:'模块ID'"` HostID int `gorm:"not null comment:'主机ID'"` }
Proxy 代理资源模型
type ProxyHost ¶
type ProxyHost struct { BaseModel URLScheme string `gorm:"not null comment:'目标协议'"` URLHost string `gorm:"not null comment:'目标地址'"` URLPath string `gorm:"not null comment:'目标路径'"` Host string `gorm:"not null comment:'头地址'"` }
代理主机模型
type ResRelation ¶
type ResRelation struct { BaseModel S int `gorm:"not null;comment:'主体'"` T rrt.ResRelationType `gorm:"not null;comment:'类型'"` O int `gorm:"not null;comment:'受体'"` }
ResRelation 资源关联
type RoleRouter ¶
type RoleRouter struct { BaseModel RoleID int `gorm:"not null comment:'角色ID'"` RouterID int `gorm:"not null comment:'路由ID'"` }
RoleRouter 角色路由关联
type User ¶
type User struct { BaseModel UserName string `gorm:"not null;comment:'用户名'"` PasswordDigest string `gorm:"not null;comment:'密码摘要'"` Nickname string `gorm:"not null;comment:'昵称'"` Avatar string `gorm:"size:1000;comment:'头像'"` PositionID int `gorm:"not null;comment:'身份ID'"` }
User 用户模型
func (*User) CheckPassword ¶
CheckPassword 校验密码
Click to show internal directories.
Click to hide internal directories.