Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Address ¶
type Address struct { Id string `gorm:"primary_key;unique;not null;index;type:varchar(32)" json:"id"` // 地址ID Uid string `gorm:"not null;index;type:varchar(32)" json:"uid"` // 用户ID, 与默认地址联合唯一,用户只能有一个唯一的收货地址 Name string `gorm:"not null;index;type:varchar(32)" json:"name"` // 收货人 Phone string `gorm:"not null;index;type:varchar(32)" json:"phone"` // 收货人电话 ProvinceCode string `gorm:"not null;index;type:varchar(2)" json:"province_code"` // 省份代码 CityCode string `gorm:"not null;index;type:varchar(4)" json:"city_code"` // 城市代码 AreaCode string `gorm:"not null;index;type:varchar(6)" json:"area_code"` // 地区代码 StreetCode string `gorm:"not null;index;type:varchar(9)" json:"street_code"` // 街道代码 Address string `gorm:"not null;index;type:varchar(32)" json:"address"` // 详细地址 IsDefault bool `gorm:"not null;index;" json:"is_default"` // 是否为默认地址, 跟 UID 联合唯一 Note *string `gorm:"null;index;type:varchar(12)" json:"note"` // 备注, 通常备注是 家/公司/学校 等 CreatedAt time.Time UpdatedAt time.Time DeletedAt *time.Time `sql:"index"` }
type Admin ¶
type Admin struct { Id int64 `gorm:"primary_key" json:"id"` // 用户ID Username string `gorm:"not null;unique;index;type:varchar(36)" json:"username"` // 用户名, 用于登陆 Name string `gorm:"not null;index;type:varchar(36)" json:"name"` // 管理员名 Password string `gorm:"not null;type:varchar(36)" json:"password"` // 登陆密码 IsSuper bool `gorm:"not null;" json:"is_super"` // 是否是超级管理员, 超级管理员全站应该只有一个 Status AdminStatus `gorm:"not null;" json:"status"` // 状态 CreatedAt time.Time UpdatedAt time.Time DeletedAt *time.Time }
type AdminStatus ¶
type AdminStatus int32
const ( AdminStatusBanned AdminStatus = -100 // 账号被禁用 AdminStatusInactivated AdminStatus = -1 // 账号未激活 AdminStatusInit AdminStatus = 0 // 初始化状态 )
Click to show internal directories.
Click to hide internal directories.