site.go 2.6 KB

12345678910111213141516171819202122232425262728293031323334
  1. package model
  2. import (
  3. "time"
  4. )
  5. type Site struct {
  6. Id int64 `excel:"name=id " xorm:"pk autoincr notnull comment('id')" json:"id" binding:"required"` //id
  7. Label string `excel:"name=站点名称 " xorm:"varchar(64) notnull comment('站点名称')" json:"label" binding:"required"` //站点名称
  8. Code string `excel:"name=站点标识 " xorm:"varchar(255) notnull comment('站点标识')" json:"code" binding:"required"` //站点标识
  9. Describe string `excel:"name=站点描述 " xorm:"varchar(255) comment('站点描述')" json:"describe" ` //站点描述
  10. Kewords string `excel:"name=关键字 " xorm:"varchar(255) comment('关键字')" json:"kewords" ` //关键字
  11. Image string `excel:"name=封面图 " xorm:"varchar(255) comment('封面图')" json:"image" ` //封面图
  12. Content string `excel:"name=教程 " xorm:"text comment('教程')" json:"content" ` //教程
  13. Price int64 `excel:"name=价格 " xorm:"bigint(20) notnull default(0) comment('价格')" json:"price" binding:"required"` //价格
  14. Status int `excel:"name=状态 ,format=1=停用,2=启用" xorm:"int(11) notnull comment('状态')" json:"status" binding:"required,oneof=1 2 "` //状态(1停用 2启用)
  15. Sort int `excel:"name=排序 " xorm:"int(11) notnull comment('排序')" json:"sort" binding:"required"` //排序
  16. CreateTime time.Time `excel:"name=创建时间 " xorm:"datetime comment('创建时间')" json:"createTime" ` //创建时间
  17. CreateBy string `excel:"name=创建人 " xorm:"varchar(255) comment('创建人')" json:"createBy" ` //创建人
  18. UpdateTime time.Time `excel:"name=更新时间 " xorm:"datetime comment('更新时间')" json:"updateTime" ` //更新时间
  19. UpdateBy string `excel:"name=更新人 " xorm:"varchar(255) comment('更新人')" json:"updateBy" ` //更新人
  20. }
  21. func (this Site) TableName() string {
  22. return "site"
  23. }
  24. func (this *Site) Key() int64 {
  25. return this.Id
  26. }
  27. func (this *Site) Model() interface{} {
  28. return this
  29. }