修改项目为前后端分离方案

This commit is contained in:
2026-03-28 23:30:02 +08:00
parent d8536354d4
commit 7a7d3aeaaa
77 changed files with 1447 additions and 23765 deletions

View File

@@ -13,15 +13,21 @@ import (
// ============================================================================
// User 用户表模型
// 此表只存储普通用户管理员账号存储在settings表中
// 存储所有账号包括超级管理员Role=0和子账号Role=1等
// CreatedAt/UpdatedAt 由 GORM 自动维护
type User struct {
ID uint `gorm:"primaryKey;comment:用户ID自增主键"`
UUID string `gorm:"uniqueIndex;size:36;not null;comment:用户的唯一标识符" json:"uuid"`
Username string `gorm:"uniqueIndex;size:64;not null;comment:用户名,唯一索引"`
ID uint `gorm:"primaryKey;comment:账号ID自增主键"`
UUID string `gorm:"uniqueIndex;size:36;not null;comment:唯一标识符" json:"uuid"`
Username string `gorm:"uniqueIndex;size:64;not null;comment:账号名,唯一索引" json:"username"`
Password string `gorm:"size:255;not null;comment:密码哈希值"`
PasswordSalt string `gorm:"size:64;not null;comment:密码加密盐值"`
CreatedAt time.Time `gorm:"comment:创建时间"`
Status int `gorm:"not null;default:1;comment:状态0禁用1启用" json:"status"`
Role int `gorm:"not null;default:2;comment:角色类型0超级管理员1代理成员2普通成员" json:"role"`
Permissions string `gorm:"size:255;comment:权限列表,逗号分隔" json:"permissions"`
Nickname string `gorm:"size:64;comment:用户昵称" json:"nickname"`
Remark string `gorm:"size:255;comment:备注信息" json:"remark"`
Avatar string `gorm:"size:255;comment:用户头像URL" json:"avatar"`
CreatedAt time.Time `gorm:"autoCreateTime;comment:创建时间" json:"created_at"`
UpdatedAt time.Time `gorm:"comment:更新时间"`
}