You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
771 B

2 years ago
package biz
import (
"database/sql"
"gorm.io/gorm"
)
const CustomerSecret = "123456"
const CustomerDuration = 2 * 30 * 24 * 3600
type Customer struct {
CustomerWork
CustomerToken
gorm.Model
}
type CustomerWork struct {
Telephone string `gorm:"type:varchar(15);uniqueIndex;" json:"telephone"`
Name sql.NullString `gorm:"type:varchar(255);uniqueIndex;" json:"name"`
Email sql.NullString `gorm:"type:varchar(255);uniqueIndex;" json:"email"`
Wechat sql.NullString `gorm:"type:varchar(255);uniqueIndex;" json:"wechat"`
CityID uint `gorm:"index;" json:"city_id"`
}
type CustomerToken struct {
Token string `gorm:"type:varchar(4095);" json:"token"`
TokenCreatedAt sql.NullTime `gorm:"" json:"token_created_at"`
}