| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- package entity
- //=============| 用户与权限 |================
- type User struct {
- Id int64 `json:"id" xorm:"pk autoincr 'id'"` // 用户Id,主键,自增长
- Name string `json:"name" xorm:"'name' notnull"` // 用户名,非空
- Username string `json:"username" xorm:"'username' unique notnull"` // 用户账号,唯一,非空
- Password string `json:"password" xorm:"'password' notnull"` // 用户密码,非空
- Email string `json:"email" xorm:"'email' notnull"` // 用户邮箱,非空
- Phone string `json:"phone" xorm:"'phone' notnull"` // 用户手机,非空
- Status int64 `json:"status" xorm:"'status' notnull"` // 用户状态,非空
- CreateTime int64 `json:"createTime" xorm:"created"` // 创建时间,自动填充
- UpdateTime int64 `json:"updateTime" xorm:"updated"` // 更新时间,自动填充
- Role string `json:"role" xorm:"'role' notnull"` // 用户角色,非空
- }
- type UserRole struct {
- Id int64 `json:"id" xorm:"pk autoincr 'id'"` // 用户角色Id,主键,自增长
- UserId int64 `json:"userId" xorm:"'user_id' notnull"` // 用户Id,非空
- RoleId int64 `json:"roleId" xorm:"'role_id' notnull"` // 角色Id,非空
- CreateTime int64 `json:"createTime" xorm:"created"` // 创建时间,自动填充
- UpdateTime int64 `json:"updateTime" xorm:"updated"` // 更新时间,自动填充
- Role string `json:"role" xorm:"'role' notnull"` // 角色,非空
- }
- type Role struct {
- Id int64 `json:"id" xorm:"pk autoincr 'id'"` // 角色Id,主键,自增长
- Name string `json:"name" xorm:"'name' notnull"` // 角色名称,非空
- CreateTime int64 `json:"createTime" xorm:"created"` // 创建时间,自动填充
- UpdateTime int64 `json:"updateTime" xorm:"updated"` // 更新时间,自动填充
- }
- type RoleMenu struct {
- Id int64 `json:"id" xorm:"pk autoincr 'id'"` // 角色菜单Id,主键,自增长
- RoleId int64 `json:"roleId" xorm:"'role_id' notnull"` // 角色Id,非空
- MenuId int64 `json:"menuId" xorm:"'menu_id' notnull"` // 菜单Id,非空
- CreateTime int64 `json:"createTime" xorm:"created"` // 创建时间,自动填充
- UpdateTime int64 `json:"updateTime" xorm:"updated"` // 更新时间,自动填充
- Menu string `json:"menu" xorm:"'menu' notnull"` // 菜单,非空
- }
- type Menu struct {
- Id int64 `json:"id" xorm:"pk autoincr 'id'"` // 菜单Id,主键,自增长
- Name string `json:"name" xorm:"'name' notnull"` // 菜单名称,非空
- Url string `json:"url" xorm:"'url' notnull"` // 菜单URL,非空
- CreateTime int64 `json:"createTime" xorm:"created"` // 创建时间,自动填充
- UpdateTime int64 `json:"updateTime" xorm:"updated"` // 更新时间,自动填充
- }
- //=============| 文件管理 |================
- type File struct {
- Id int64 `json:"id" xorm:"pk autoincr 'id'"` // 文件Id,主键,自增长
- Name string `json:"name" xorm:"'name' notnull"` // 文件名,非空
- Url string `json:"url" xorm:"'url' notnull"` // 文件URL,非空
- Size int64 `json:"size" xorm:"'size' notnull"` // 文件大小,非空
- Type string `json:"type" xorm:"'type' notnull"` // 文件类型,非空
- MD5 string `json:"md5" xorm:"'md5' notnull"` // 文件MD5,非空
- ParentId string `json:"parentId" xorm:"'parent_id' notnull"` // 父级Id,非空
- Extension string `json:"extension" xorm:"'extension' notnull"` // 文件扩展名,非空
- Access string `json:"access" xorm:"'access' notnull"` // 文件访问权限,非空
- CreateUser int64 `json:"createUser" xorm:"'create_user' notnull"` // 创建用户Id,非空
- CreateTime int64 `json:"createTime" xorm:"created"` // 创建时间,自动填充
- UpdateTime int64 `json:"updateTime" xorm:"updated"` // 更新时间,自动填充
- }
- type FileAccess struct {
- Id int64 `json:"id" xorm:"pk autoincr 'id'"` // 文件访问记录Id,主键,自增长
- FileId int64 `json:"fileId" xorm:"'file_id' notnull"` // 文件Id,非空
- CreateId int64 `json:"createId" xorm:"'create_id' notnull"` // 创建人,非空
- AccessReadUserId string `json:"accessReadUserId" xorm:"'access_read_user_id'"` // 可读用户Id
- AccessWriteUserId string `json:"accessWriteUserId" xorm:"'access_write_user_id'"` // 可写用户Id
- AccessDeleteUserId string `json:"accessDeleteUserId" xorm:"'access_delete_user_id'"` // 可删用户Id
- CreateTime int64 `json:"createTime" xorm:"created"` // 创建时间,自动填充
- }
|