model

package
v0.0.0-...-9c0293a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 11, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const TableNameUser = "user"

Variables

This section is empty.

Functions

This section is empty.

Types

type User

type User struct {
	ID           int64          `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
	CreatedAt    time.Time      `gorm:"column:created_at" json:"created_at"`
	UpdatedAt    time.Time      `gorm:"column:updated_at" json:"updated_at"`
	DeletedAt    gorm.DeletedAt `gorm:"column:deleted_at" json:"deleted_at"`
	UserID       int64          `gorm:"column:user_id;not null" json:"user_id"`                     // '全局自增唯一ID'
	UserName     string         `gorm:"column:user_name;not null;default:Douglas" json:"user_name"` // '用户名,登录使用'
	NikeName     string         `gorm:"column:nike_name;not null;default:Douglas" json:"nike_name"` // '昵称'
	Avatar       string         `gorm:"column:avatar" json:"avatar"`                                // '头像'
	Gender       int64          `gorm:"column:gender;default:1" json:"gender"`                      // '性别,0,男;1,女;2,未知;'
	DistrictCode int64          `gorm:"column:district_code;default:1" json:"district_code"`        // '地区码,留作快速查找'
	Country      string         `gorm:"column:country;default:China" json:"country"`                // '国家'
	Province     string         `gorm:"column:province;default:Shanghai" json:"province"`           // '省份'
	City         string         `gorm:"column:city;default:Shanghai" json:"city"`                   // '城市'
	Region       string         `gorm:"column:region;default:Xuhui" json:"region"`                  // '地区'
	Email        string         `gorm:"column:email" json:"email"`                                  // '电子邮件'
	Mobile       string         `gorm:"column:mobile" json:"mobile"`                                // '手机号'
	Birthday     time.Time      `gorm:"column:birthday;default:2020-01-01" json:"birthday"`         // '生日'
	Passwd       string         `gorm:"column:passwd" json:"passwd"`                                // '密码'
}

User mapped from table <user>

func (*User) TableName

func (*User) TableName() string

TableName User's table name

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL