address.go 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. package model
  2. import (
  3. "time"
  4. )
  5. type Address struct {
  6. Id int64 `excel:"name=用户地址id " xorm:"pk autoincr notnull comment('用户地址id')" json:"id" binding:"required"` //用户地址id
  7. MemberId int64 `excel:"name=用户id " xorm:"pk notnull comment('用户id')" json:"memberId" binding:"required"` //用户id
  8. Name string `excel:"name=收货人姓名 " xorm:"varchar(32) notnull comment('收货人姓名')" json:"name" binding:"required"` //收货人姓名
  9. Phone string `excel:"name=收货人电话 " xorm:"varchar(16) notnull comment('收货人电话')" json:"phone" binding:"required"` //收货人电话
  10. Province string `excel:"name=收货人所在省 " xorm:"varchar(64) notnull comment('收货人所在省')" json:"province" binding:"required"` //收货人所在省
  11. City string `excel:"name=收货人所在市 " xorm:"varchar(64) notnull comment('收货人所在市')" json:"city" binding:"required"` //收货人所在市
  12. AreaCode string `excel:"name=城市编码 " xorm:"varchar(64) notnull comment('城市编码')" json:"areaCode" binding:"required"` //城市编码
  13. District string `excel:"name=收货人所在区 " xorm:"varchar(64) notnull comment('收货人所在区')" json:"district" binding:"required"` //收货人所在区
  14. Detail string `excel:"name=收货人详细地址 " xorm:"varchar(256) notnull comment('收货人详细地址')" json:"detail" binding:"required"` //收货人详细地址
  15. PostCode string `excel:"name=邮编 " xorm:"varchar(20) notnull comment('邮编')" json:"postCode" binding:"required"` //邮编
  16. Longitude string `excel:"name=经度 " xorm:"varchar(16) notnull default('0') comment('经度')" json:"longitude" binding:"required"` //经度
  17. Latitude string `excel:"name=纬度 " xorm:"varchar(16) notnull default('0') comment('纬度')" json:"latitude" binding:"required"` //纬度
  18. IsDefault int `excel:"name=是否默认 ,format=1=是,2=否" xorm:"pk notnull default(1) comment('是否默认')" json:"isDefault" binding:"required,oneof=1 2 "` //是否默认(1是 2否)
  19. IsDel int `excel:"name=是否删除 ,format=1=是,2=否" xorm:"pk notnull default(1) comment('是否删除')" json:"isDel" binding:"required,oneof=1 2 "` //是否删除(1是 2否)
  20. CreateTime time.Time `excel:"name=创建时间 " xorm:"created comment('创建时间')" json:"createTime" binding:"required"` //创建时间
  21. UpdateTime time.Time `excel:"name=更新时间 " xorm:"updated comment('更新时间')" json:"updateTime" ` //更新时间
  22. }
  23. func (this Address) TableName() string {
  24. return "sys_member_address"
  25. }
  26. func (this *Address) Key() int64 {
  27. return this.Id
  28. }
  29. func (this *Address) Model() interface{} {
  30. return this
  31. }
  32. func (this *Address) BeforeUpdate() {
  33. }
  34. func (this *Address) BeforeInsert() {
  35. }