You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
689 B
20 lines
689 B
package model
|
|
|
|
import (
|
|
"time"
|
|
)
|
|
|
|
// Profile 用户个人资料模型
|
|
type Profile struct {
|
|
Id int64 `gorm:"column:id;primaryKey;autoIncrement" json:"id"`
|
|
UserId int64 `gorm:"column:user_id;not null;uniqueIndex" json:"userId"` // 关联用户ID
|
|
Avatar string `gorm:"column:avatar;type:varchar(255);default:''" json:"avatar"` // 头像URL
|
|
Bio string `gorm:"column:bio;type:text" json:"bio"` // 个人简介
|
|
CreatedAt time.Time `gorm:"column:created_at;autoCreateTime" json:"createdAt"`
|
|
UpdatedAt time.Time `gorm:"column:updated_at;autoUpdateTime" json:"updatedAt"`
|
|
}
|
|
|
|
// TableName 指定表名
|
|
func (Profile) TableName() string {
|
|
return "profile"
|
|
}
|
|
|