test.go 808 B

123456789101112131415161718192021222324
  1. package model
  2. import (
  3. "ulink-admin/pkg/base"
  4. )
  5. type Test struct {
  6. base.BaseModel `xorm:"extends"`
  7. Label string `excel:"name=名称 " xorm:"varchar(30) comment('名称')" json:"label" binding:"required"` //名称
  8. Image string `excel:"name=图片 " xorm:"varchar(200) comment('图片')" json:"image" binding:"required"` //图片
  9. IsDel int `excel:"name=删除 ,format=1=是,2=否" xorm:"tinyint(1) comment('删除')" json:"isDel" binding:"required,oneof=1 2 "` //删除(1是 2否) ` //更新时间
  10. }
  11. func (this Test) TableName() string {
  12. return "test"
  13. }
  14. func (this *Test) Key() int64 {
  15. return this.Id
  16. }
  17. func (this *Test) Model() interface{} {
  18. return this
  19. }