|
@@ -11,7 +11,6 @@ import (
|
|
|
|
|
|
validation "github.com/go-ozzo/ozzo-validation/v3"
|
|
|
"go.mod/models"
|
|
|
- "go.mod/web/viewmodels"
|
|
|
)
|
|
|
|
|
|
type Safe struct {
|
|
@@ -45,22 +44,25 @@ type SafeDetail struct {
|
|
|
Id string `form:"id" json:"id" `
|
|
|
BidsectionId string `form:"bidsectionId" json:"bidsectionId"`
|
|
|
|
|
|
- Code string `form:"code" json:"code"`
|
|
|
- CreateTime time.Time `form:"createTime" json:"createTime"`
|
|
|
- Position string `form:"position" json:"position"`
|
|
|
- Inspection string `form:"inspection" json:"inspection"`
|
|
|
- InspectionDetail string `form:"inspectionDetail" json:"inspectionDetail"`
|
|
|
- Demand string `form:"demand" json:"demand"`
|
|
|
- Status int `form:"status" json:"status"`
|
|
|
- AuditName string `form:"auditName" json:"auditName"`
|
|
|
- FileList []viewmodels.AnnexListView `form:"files" json:"files"`
|
|
|
- Auditors []Auditors `form:"auditors" json:"auditors"`
|
|
|
- auditorHistory []models.CmSafeAudit `form:"auditorHistory" json:"auditorHistory"`
|
|
|
+ Code string `form:"code" json:"code"`
|
|
|
+ CreateTime time.Time `form:"createTime" json:"createTime"`
|
|
|
+ Position string `form:"position" json:"position"`
|
|
|
+ Inspection string `form:"inspection" json:"inspection"`
|
|
|
+ InspectionDetail string `form:"inspectionDetail" json:"inspectionDetail"`
|
|
|
+ Demand string `form:"demand" json:"demand"`
|
|
|
+ Status int `form:"status" json:"status"`
|
|
|
+ AuditName string `form:"auditName" json:"auditName"`
|
|
|
+ FileList []AnnexListView `form:"files" json:"files"`
|
|
|
+ Auditors []Auditors `form:"auditors" json:"auditors"`
|
|
|
+ auditorHistory []models.CmSafeAudit `form:"auditorHistory" json:"auditorHistory"`
|
|
|
}
|
|
|
|
|
|
type SafeFile struct {
|
|
|
- Name string `from:"name" json:"name"`
|
|
|
- CreateTime time.Time `from:"create_time" json:""`
|
|
|
+ FileName string `from:"filename" json:"filename"`
|
|
|
+ FilePath string `from:"filepath" json:"filepath"`
|
|
|
+ AccountName string `from:"account_name" json:"acountName"`
|
|
|
+ AccountId string `from:"account_id" json:"acountId"`
|
|
|
+ CreateTime time.Time `from:"create_time" json:"createTime"`
|
|
|
}
|
|
|
type Auditors struct {
|
|
|
Name string
|
|
@@ -92,22 +94,3 @@ func (l Safe) ValidateDelete() error {
|
|
|
validation.Field(&l.Id, validation.Required.Error("检查项目不能为空")),
|
|
|
)
|
|
|
}
|
|
|
-
|
|
|
-type FileList struct {
|
|
|
- FileName string `from:"filename" josn:"filename"`
|
|
|
- FilePath string `from:"filepath" josn:"filepath"`
|
|
|
- CreateTime string `form:"createTime" json:"createTime"`
|
|
|
-}
|
|
|
-type File struct {
|
|
|
- BidsectionId string `form:"bidsectionId" json:"bidsectionId"`
|
|
|
- SaveId string `form:"saveId" json:"saveId"`
|
|
|
- FileList []FileList `from:"fileList" json:"fileList"`
|
|
|
-}
|
|
|
-
|
|
|
-func (l File) ValidateFile() error {
|
|
|
- return validation.ValidateStruct(&l,
|
|
|
- validation.Field(&l.BidsectionId, validation.Required.Error("标段ID不能为空")),
|
|
|
- validation.Field(&l.FileList, validation.Required.Error("上传的文件不能为空")),
|
|
|
- validation.Field(&l.SaveId, validation.Required.Error("巡检id不能为空")),
|
|
|
- )
|
|
|
-}
|