| 123456789101112131415161718192021222324252627282930313233 |
- package model
- import (
- "time"
- "github.com/shopspring/decimal"
- )
- type User struct {
- Id uint `gorm:"primarykey"`
- Code string `gorm:"column:code;type:char(16);comment:客户号;NOT NULL" json:"code"`
- Amount decimal.Decimal `gorm:"column:amount;type:decimal(20,4) unsigned;default:0.00;comment:账户余额;NOT NULL" json:"amount"`
- InvoicableAmount decimal.Decimal `gorm:"column:invoicable_amount;type:decimal(20,4);default:0.00;comment:可开票金额;NOT NULL" json:"invoicable_amount"`
- UserName string `gorm:"column:user_name;type:varchar(20);comment:用户名;NOT NULL" json:"user_name"`
- Password string `gorm:"column:password;type:char(40);comment:登录密码(SHA1( MD5 (明文密码) + 盐值);NOT NULL" json:"password"`
- Salt string `gorm:"column:salt;type:varchar(10);comment:盐值;NOT NULL" json:"salt"`
- Icon string `gorm:"column:icon;type:varchar(255);comment:图像链接;NOT NULL" json:"icon"`
- Type uint `gorm:"column:type;type:tinyint(1) unsigned;default:1;comment:用户类型(1:个人用户(默认)2:企业用户);NOT NULL" json:"type"`
- Environment uint `gorm:"column:environment;type:tinyint(1) unsigned;default:1;comment:环境类型(1:国内 2:国际);NOT NULL" json:"environment"`
- PhoneNumber string `gorm:"column:phone_number;type:varchar(20);comment:手机号;NOT NULL" json:"phone_number"`
- Email string `gorm:"column:email;type:varchar(64);comment:电子邮箱;NOT NULL" json:"email"`
- Description string `gorm:"column:description;type:text;comment:个人介绍" json:"description"`
- UpdatedAt time.Time `gorm:"<-:false"`
- CreatedAt time.Time `gorm:"<-:false"`
- IsDeleted uint `gorm:"column:is_deleted;type:tinyint(1) unsigned;default:2;comment:是否删除(1:是 2:否);NOT NULL" json:"is_deleted"`
- }
- type UserSimple struct {
- Id uint `gorm:"primarykey"`
- Code string `gorm:"column:code;type:char(16);comment:客户号;NOT NULL" json:"code"`
- UserName string `gorm:"column:user_name;type:varchar(20);comment:用户名;NOT NULL" json:"user_name"`
- Password string `gorm:"column:password;type:char(40);comment:登录密码(SHA1( MD5 (明文密码) + 盐值);NOT NULL" json:"password"`
- }
|