12345678910111213141516171819202122232425262728293031323334353637383940 |
- /*
- * @description:合同目录视图模型
- * @Author: CP
- * @Date: 2020-10-27 17:07:50
- * @FilePath: \construction_management\web\viewmodels\tree_contract.go
- */
- package viewmodels
- import validation "github.com/go-ozzo/ozzo-validation/v3"
- type TreeContract struct {
- Id string `form:"id" json:"id" `
- Name string `form:"name" json:"name"`
- ProjectId string `form:"projectId" json:"projectId"`
- BidsectionId string `form:"bidsectionId" json:"bidsectionId"`
- ParentId string `form:"parentId" json:"parentId"`
- Depth int `form:"depth" json:"depth"`
- Serial string `form:"serial" json:"serial"`
- Attribution string `form:"attribution" json:"attribution"`
- Isfolder int `form:"isfolder" json:"isfolder"`
- CreateTime string `form:"createTime" json:"createTime"`
- UpdateTime string `form:"updateTime" json:"updateTime"`
- TargetFolderId string `form:"targetFolderId" json:"targetFolderId"`
- Ancounts int `form:"ancounts" json:"ancounts"`
- Csrf string `form:"csrf" json:"csrf"`
- // Leaf bool `json:"leaf" `
- HasFolder bool `json:"hasFolder" `
- IsBid bool `json:"isBid" `
- IsEnd bool `json:"isEnd"`
- ChildsTotal int `json:"childsTotal"`
- Children []*TreeContract `json:"children"`
- }
- func (l TreeContract) Validate() error {
- return validation.ValidateStruct(&l,
- validation.Field(&l.Id, validation.Required.Error("文件夹ID不能为空")),
- validation.Field(&l.Name, validation.Required.Error("文件夹名称不能为空"), validation.Length(1, 60).Error("最多 15 个字符")),
- )
- }
|