update_project_module_files.go
890 字节
package command
import (
"fmt"
"github.com/astaxie/beego/validation"
)
type UpdateProjectModuleFilesCommand struct {
// 项目文件编号
ProjectModuleFilesId int64 `json:"projectModuleFilesId" valid:"Required"`
// 代码块
CodeBlock string `json:"codeBlock" valid:"Required"`
// 备注信息
Remark string `json:"remark,omitempty"`
}
func (updateProjectModuleFilesCommand *UpdateProjectModuleFilesCommand) Valid(validation *validation.Validation) {
validation.SetError("CustomValid", "未实现的自定义认证")
}
func (updateProjectModuleFilesCommand *UpdateProjectModuleFilesCommand) ValidateCommand() error {
valid := validation.Validation{}
b, err := valid.Valid(updateProjectModuleFilesCommand)
if err != nil {
return err
}
if !b {
for _, validErr := range valid.Errors {
return fmt.Errorf("%s %s", validErr.Key, validErr.Message)
}
}
return nil
}