tree_contract.go 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. * @description:合同目录视图模型
  3. * @Author: CP
  4. * @Date: 2020-10-27 17:07:50
  5. * @FilePath: \construction_management\web\viewmodels\tree_contract.go
  6. */
  7. package viewmodels
  8. import validation "github.com/go-ozzo/ozzo-validation/v3"
  9. type TreeContract struct {
  10. Id string `form:"id" json:"id" `
  11. Name string `form:"name" json:"name"`
  12. ProjectId string `form:"projectId" json:"projectId"`
  13. BidsectionId string `form:"bidsectionId" json:"bidsectionId"`
  14. ParentId string `form:"parentId" json:"parentId"`
  15. Isfolder int `form:"isfolder" json:"isfolder"`
  16. Contracts int `form:"contracts" json:"contracts"`
  17. ContractsIncome string `form:"contractsIncome" json:"contractsIncome"`
  18. ContractsReturned string `form:"contractsReturned" json:"contractsReturned"`
  19. ContractsIncomeProgress string `form:"contractsIncomeProgress" json:"contractsIncomeProgress"`
  20. ContractsPay string `form:"contractsPay" json:"contractsPay"`
  21. ContractsPaid string `form:"contractsPaid" json:"contractsPaid"`
  22. ContractsPayProgress string `form:"contractsPayProgress" json:"contractsPayProgress"`
  23. Csrf string `form:"csrf" json:"csrf"`
  24. // Leaf bool `json:"leaf" `
  25. HasFolder bool `json:"hasFolder" `
  26. IsBid bool `json:"isBid" `
  27. IsEnd bool `json:"isEnd"`
  28. ChildsTotal int `json:"childsTotal"`
  29. Children []*TreeContract `json:"children"`
  30. }
  31. func (l TreeContract) Validate() error {
  32. return validation.ValidateStruct(&l,
  33. validation.Field(&l.Id, validation.Required.Error("文件夹ID不能为空")),
  34. validation.Field(&l.Name, validation.Required.Error("文件夹名称不能为空"), validation.Length(1, 60).Error("最多 15 个字符")),
  35. )
  36. }
  37. // Depth int `form:"depth" json:"depth"`
  38. // Serial string `form:"serial" json:"serial"`
  39. // Attribution string `form:"attribution" json:"attribution"`
  40. // CreateTime string `form:"createTime" json:"createTime"`
  41. // UpdateTime string `form:"updateTime" json:"updateTime"`
  42. // TargetFolderId string `form:"targetFolderId" json:"targetFolderId"`
  43. // Ancounts int `form:"ancounts" json:"ancounts"`