sms.go 1.5 KB

12345678910111213141516171819202122232425262728293031323334
  1. package model
  2. import (
  3. "time"
  4. )
  5. type Sms struct {
  6. Id int64 `excel:"name= " xorm:"pk autoincr notnull comment('')" json:"id" binding:"required"` //
  7. Code string `excel:"name=验证码 " xorm:"varchar(12) comment('验证码')" json:"code" binding:"required"` //验证码
  8. Phone string `excel:"name=手机号码 " xorm:"varchar(11) comment('手机号码')" json:"phone" binding:"required"` //手机号码
  9. State int `excel:"name=状态 ,format=1=未使用,2=已使用,3=已过期" xorm:"tinyint(4) comment('状态')" json:"state" binding:"required,oneof=1 2 3 "` //状态
  10. Mode string `excel:"name=消息类型 ,format=1=验证码,2=其它" xorm:"varchar(32) comment('消息类型')" json:"mode" binding:"required,oneof=1 2 "` //消息类型(1验证码 2其它)
  11. CreateTime time.Time `excel:"name=创建时间 " xorm:"created comment('创建时间')" json:"createTime" ` //创建时间
  12. UpdateTime time.Time `excel:"name=更新时间 " xorm:"updated comment('更新时间')" json:"updateTime" ` //更新时间
  13. }
  14. func (this Sms) TableName() string {
  15. return "sys_sms"
  16. }
  17. func (this *Sms) Key() int64 {
  18. return this.Id
  19. }
  20. func (this *Sms) Model() interface{} {
  21. return this
  22. }
  23. func (this *Sms) BeforeUpdate() {
  24. }
  25. func (this *Sms) BeforeInsert() {
  26. }