Documentation
¶
Index ¶
- type PointRecord
- type User
- func (u *User) Delete(ctx context.Context, id int64) error
- func (u *User) GetUserInfoByID(ctx context.Context, id int64) (*User, error)
- func (u *User) GetUserInfoByMobile(ctx context.Context, mobile string) (*User, error)
- func (u *User) GetUserInfoByOpenID(ctx context.Context, openId string) (*User, error)
- func (u *User) Register(ctx context.Context, in *User) (*User, error)
- func (u *User) Update(ctx context.Context, id int64, updateInfo *User) error
- func (u *User) UpdateMobile(ctx context.Context, id int64, mobile string) error
- func (u *User) UpdatePwd(ctx context.Context, mobile, password string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PointRecord ¶
type PointRecord struct {
gorm.Model
UserId int64 `json:"user_id" gorm:"column:user_id;type:int(11);index;comment:用户ID"`
ChangeType string `json:"change_type" gorm:"column:change_type;type:varchar(30);comment:积分变动类型"`
Amount int64 `json:"amount" gorm:"column:amount;type:int(11);comment:积分变动数量"`
Balance int64 `json:"balance" gorm:"column:balance;type:int(11);comment:操作后的积分余额"`
OperationTime time.Time `json:"operation_time" gorm:"column:operation_time;type:datetime;comment:操作时间"`
Description string `json:"description" gorm:"column:description;type:varchar(50);comment:积分操作描述"`
Source string `json:"source" gorm:"column:source;type:varchar(30);comment:积分来源"`
OrderID int64 `json:"order_id" gorm:"column:order_id;type:int(11);comment:订单来源"`
}
PointRecord
func NewPointRecord ¶
func NewPointRecord() *PointRecord
func (*PointRecord) CreatePointsRecord ¶
func (p *PointRecord) CreatePointsRecord(ctx context.Context, in *PointRecord) (*User, error)
CreatePointsRecord 创建积分变动记录
type User ¶
type User struct {
gorm.Model
Mobile string `json:"mobile" gorm:"column:mobile;type:char(11);unique;comment:手机号"`
Password string `json:"password" gorm:"column:password;type:varchar(50);comment:密码"`
Nickname string `json:"nickname" gorm:"column:nickname;type:varchar(30);comment:昵称"`
Sex int64 `json:"sex" gorm:"column:sex;type:tinyint(1);comment:性别 0-未知, 1-男, 2-女"`
Birthday string `json:"birthday" gorm:"column:birthday;type:varchar(255);comment:出生日期"`
Email string `json:"email" gorm:"column:email;type:varchar(255);comment:邮箱"`
Avatar string `json:"avatar" gorm:"column:avatar;type:varchar(255);comment:头像"`
Salt string `json:"salt" gorm:"column:salt;type:varchar(255);comment:加盐"`
Openid string `json:"openid" gorm:"column:openid;type:varchar(50);comment:开放ID"`
Unionid string `json:"unionid" gorm:"column:unionid;type:varchar(50);comment:微信登录唯一标识"`
State int64 `json:"state" gorm:"column:state;type:tinyint(1);comment:状态 0封禁 1 正常 "`
LoginSource string `json:"login_source" gorm:"column:login_source;type:varchar(10);comment:登录来源"`
Points int64 `json:"points" gorm:"column:points;type:int(11);comment:用户积分"`
}
User 用户表
func (*User) GetUserInfoByID ¶
func (*User) GetUserInfoByMobile ¶
func (*User) GetUserInfoByOpenID ¶
func (*User) UpdateMobile ¶
Click to show internal directories.
Click to hide internal directories.