remove_project_module_version.go
855 字节
package command
import (
"fmt"
"github.com/astaxie/beego/validation"
)
type RemoveProjectModuleVersionCommand struct {
ProjectModuleVersionId int64 `json:"projectModuleVersionId" valid:"Required"`
// 项目版本编号
ProjectModuleVersion int64 `json:"projectModuleVersion" valid:"Required"`
}
func (removeProjectModuleVersionCommand *RemoveProjectModuleVersionCommand) Valid(validation *validation.Validation) {
validation.SetError("CustomValid", "未实现的自定义认证")
}
func (removeProjectModuleVersionCommand *RemoveProjectModuleVersionCommand) ValidateCommand() error {
valid := validation.Validation{}
b, err := valid.Valid(removeProjectModuleVersionCommand)
if err != nil {
return err
}
if !b {
for _, validErr := range valid.Errors {
return fmt.Errorf("%s %s", validErr.Key, validErr.Message)
}
}
return nil
}