wz-golang-server/server/modules/user/entity/user.go

26 lines
1.3 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// Package entity 数据实体
package entity
import "time"
// User 用户基础信息
type User struct {
ID int64 `gorm:"column:id;primaryKey;autoIncrement;comment:全局唯一用户ID自增" json:"id"`
Username string `gorm:"column:username;comment:用户名(可选,后台管理用)" json:"username"`
Nickname string `gorm:"column:nickname;comment:用户昵称(各平台统一)" json:"nickname"`
AvatarURL string `gorm:"column:avatar_url;comment:用户头像URL" json:"avatarUrl"`
Phone *string `gorm:"column:phone;comment:手机号脱敏存储如138****1234" json:"phone"`
Password *string `gorm:"column:password;comment:登录密码" json:"-"`
Salt *string `gorm:"column:salt;comment:密码盐值" json:"-"`
Gender int8 `gorm:"column:gender;comment:性别0-未知1-男2-女" json:"gender"`
Status int8 `gorm:"column:status;comment:状态0-禁用1-正常" json:"status"`
CreateTime time.Time `gorm:"column:create_time;autoCreateTime;comment:创建时间" json:"createTime"`
UpdateTime time.Time `gorm:"column:update_time;autoUpdateTime;comment:更新时间" json:"updateTime"`
Deleted int8 `gorm:"column:deleted;comment:软删除0-未删1-已删" json:"deleted"`
}
// TableName 指定表名
func (User) TableName() string {
return "t_user"
}