代码推送

This commit is contained in:
2026-09-09 02:39:57 +08:00
parent a112893947
commit 5e47757c73
24 changed files with 1156 additions and 226 deletions

View File

@@ -10,8 +10,8 @@ import (
type User struct {
ID uint `gorm:"primaryKey" json:"id"`
Username string `gorm:"size:50;uniqueIndex;not null" json:"username"`
Password string `gorm:"size:255;not null" json:"-"` // bcrypt 哈希,不返回前端
Phone string `gorm:"size:20;index" json:"phone"` // 手机号
Password string `gorm:"size:255;not null" json:"-"` // bcrypt 哈希,不返回前端
Phone string `gorm:"size:20;index" json:"phone"` // 手机号
Role string `gorm:"size:20;default:user;not null" json:"role"` // admin | user
Avatar string `gorm:"size:255" json:"avatar"` // 头像 URL
Status int `gorm:"default:1;not null" json:"status"` // 1=正常 0=禁用