folder_contract.go 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. * @description:合同目录视图模型
  3. * @Author: CP
  4. * @Date: 2020-10-27 17:07:50
  5. * @FilePath: \construction_management\web\viewmodels\folder_contract.go
  6. */
  7. package viewmodels
  8. import validation "github.com/go-ozzo/ozzo-validation/v3"
  9. type FolderContract 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. // 安全巡检字段-后期做接口后移动-TODO
  24. SafeTotal int `form:"safeTotal" json:"safeTotal"`
  25. SafeRectification int `form:"safeRectification" json:"safeRectification"`
  26. SafeRectificationIn int `form:"safeRectificationIn" json:"safeRectificationIn"`
  27. Csrf string `form:"csrf" json:"csrf"`
  28. // Leaf bool `json:"leaf" `
  29. HasFolder bool `json:"hasFolder" `
  30. IsBid bool `json:"isBid" `
  31. IsEnd bool `json:"isEnd"`
  32. ChildsTotal int `json:"childsTotal"`
  33. Children []*FolderContract `json:"children"`
  34. }
  35. func (l FolderContract) Validate() error {
  36. return validation.ValidateStruct(&l,
  37. validation.Field(&l.Id, validation.Required.Error("文件夹ID不能为空")),
  38. validation.Field(&l.Name, validation.Required.Error("文件夹名称不能为空"), validation.Length(1, 60).Error("最多 15 个字符")),
  39. )
  40. }
  41. // Depth int `form:"depth" json:"depth"`
  42. // Serial string `form:"serial" json:"serial"`
  43. // Attribution string `form:"attribution" json:"attribution"`
  44. // CreateTime string `form:"createTime" json:"createTime"`
  45. // UpdateTime string `form:"updateTime" json:"updateTime"`
  46. // TargetFolderId string `form:"targetFolderId" json:"targetFolderId"`
  47. // Ancounts int `form:"ancounts" json:"ancounts"`