bidsection.go 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. * @description:标段
  3. * @Author: CP
  4. * @Date: 2020-09-28 10:56:55
  5. * @FilePath: \construction_management\web\viewmodels\bidsection.go
  6. */
  7. package viewmodels
  8. import (
  9. validation "github.com/go-ozzo/ozzo-validation/v3"
  10. )
  11. type Bidsection struct {
  12. Id string `form:"id" json:"id"`
  13. Name string `form:"name" json:"name"`
  14. ProjectId string `form:"projectId" json:"projectId"`
  15. CreateTime string `form:"createTime" json:"createTime"`
  16. FolderId string `form:"folderId" json:"folderId"`
  17. // Status int `xorm:"comment('状态') TINYINT(1)"`
  18. // UserId int `xorm:"comment('用户id') INT(11)"`
  19. // Category string `xorm:"comment('分类属性') VARCHAR(1024)"`
  20. // Type int `xorm:"comment('标段类型') TINYINT(2)"`
  21. // LedgerTimes int `xorm:"not null default 0 comment('台账审批次数') TINYINT(4)"`
  22. // LedgerStatus int `xorm:"not null default 1 comment('台账审批状态') TINYINT(4)"`
  23. // MRule string `xorm:"VARCHAR(1024)"`
  24. // Times int `xorm:"comment('审批次数') TINYINT(4)"`
  25. // CRule string `xorm:"comment('变更令-规则') VARCHAR(1024)"`
  26. // CConnector int `xorm:"comment('变更令-连接符') TINYINT(4)"`
  27. // CRuleFirst int `xorm:"comment('变更令规则第一次出现') TINYINT(1)"`
  28. // MeasureType string `xorm:"VARCHAR(11)"`
  29. // SImType string `xorm:"comment('期,中间计量,模式') VARCHAR(11)"`
  30. // Cooperation string `xorm:"comment('协作人员和功能列表') TEXT"`
  31. // Valuation int `xorm:"comment('计价规范') TINYINT(4)"`
  32. // TotalPrice string `xorm:"comment('0号台账 -- 金额') DECIMAL(12,2)"`
  33. // DealTp string `xorm:"comment('签约 -- 金额') DECIMAL(12,2)"`
  34. // Uuid string `xorm:"comment('更新时间') VARCHAR(64)"`
  35. }
  36. func (l Bidsection) Validate() error {
  37. return validation.ValidateStruct(&l,
  38. // Code cannot be empty, and the length must between 5 and 50
  39. validation.Field(&l.Name, validation.Required.Error("标段名称不能为空"), validation.Length(2, 128).Error("项目编号最少要输入 2 个字符")),
  40. validation.Field(&l.FolderId, validation.Required.Error("目录ID不能为空")),
  41. )
  42. }