Sure! Pl
This commit is contained in:
Executable
+27
@@ -0,0 +1,27 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type User struct {
|
||||
ID uint `gorm:"primarykey" json:"id"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`
|
||||
|
||||
OpenID string `gorm:"uniqueIndex;size:100" json:"open_id"`
|
||||
UnionID string `gorm:"size:100" json:"union_id,omitempty"`
|
||||
NickName string `gorm:"size:100" json:"nickname"`
|
||||
AvatarURL string `gorm:"size:500" json:"avatar_url"`
|
||||
Gender int `gorm:"default:0" json:"gender"`
|
||||
Phone string `gorm:"size:20" json:"phone,omitempty"`
|
||||
|
||||
SessionKey string `gorm:"size:100" json:"-"`
|
||||
}
|
||||
|
||||
func (User) TableName() string {
|
||||
return "users"
|
||||
}
|
||||
Reference in New Issue
Block a user