45 lines
		
	
	
		
			2.0 KiB
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			45 lines
		
	
	
		
			2.0 KiB
		
	
	
	
		
			Go
		
	
	
	
	
	
| package models
 | |
| 
 | |
| import (
 | |
| 	"go-admin/common/models"
 | |
| 	"time"
 | |
| 
 | |
| 	"github.com/shopspring/decimal"
 | |
| )
 | |
| 
 | |
| type SmsPhone struct {
 | |
| 	models.Model
 | |
| 
 | |
| 	PlatformCode    string          `json:"platformCode" gorm:"type:varchar(20);comment:平台code"`
 | |
| 	UserId          int             `json:"userId" gorm:"type:bigint;comment:用户Id"`
 | |
| 	Service         string          `json:"service" gorm:"type:varchar(50);comment:sms 服务"`
 | |
| 	ServiceCode     string          `json:"serviceCode" gorm:"type:varchar(30);comment:服务code"`
 | |
| 	Type            int             `json:"type" gorm:"type:tinyint;comment:类型 0-短效 1-长效"`
 | |
| 	Period          int             `json:"period" gorm:"type:int;comment:时长(月)"`
 | |
| 	Phone           string          `json:"phone" gorm:"type:varchar(30);comment:号码"`
 | |
| 	ActivationId    string          `json:"activationId" gorm:"type:varchar(50);comment:激活码id"`
 | |
| 	NewActivationId string          `json:"newActivationId" gorm:"type:varchar(50);comment:新激活码id 每次获取验证码会刷新"`
 | |
| 	MessageId       string          `json:"messageId" gorm:"type:varchar(50);comment:短信模板id"`
 | |
| 	Code            string          `json:"code" gorm:"type:varchar(10);comment:验证码"`
 | |
| 	Status          int             `json:"status" gorm:"type:tinyint;comment:状态 1-等待验证码 2-已获取"`
 | |
| 	ExpireTime      *time.Time      `json:"expireTime" gorm:"type:datetime;comment:过期时间"`
 | |
| 	Actived         int             `json:"actived" gorm:"type:tinyint;comment:是否激活(长期租赁如果第一次没接收到验证码 则不会激活号码) 1-未激活 2-已激活 3-已失效"`
 | |
| 	Price           decimal.Decimal `json:"price" gorm:"type:decimal(10,2);comment:价格"`
 | |
| 	AutoRenewal     int             `json:"autoRenewal" gorm:"type:tinyint;comment:是否自动续费 1-自动续费 2-手动续费"`
 | |
| 	models.ModelTime
 | |
| 	models.ControlBy
 | |
| }
 | |
| 
 | |
| func (SmsPhone) TableName() string {
 | |
| 	return "sms_phone"
 | |
| }
 | |
| 
 | |
| func (e *SmsPhone) Generate() models.ActiveRecord {
 | |
| 	o := *e
 | |
| 	return &o
 | |
| }
 | |
| 
 | |
| func (e *SmsPhone) GetId() interface{} {
 | |
| 	return e.Id
 | |
| }
 |