agree_join_creation_project.go
961 字节
package command
import (
"fmt"
"github.com/beego/beego/v2/core/validation"
)
type AgreeJoinCreationProjectCommand struct {
// 接收方用户id
UserId int64 `json:"userId" valid:"Required"`
// 共创项目id
CreationProjectId int64 `json:"creationProjectId" valid:"Required"`
// 共创项目名称
CreationProjectName string `json:"creationProjectName" valid:"Required"`
// 共创项目编号
CreationProjectNumber string `json:"creationProjectNumber" valid:"Required"`
}
func (agreeJoinCreationProjectCommand *AgreeJoinCreationProjectCommand) Valid(validation *validation.Validation) {
}
func (agreeJoinCreationProjectCommand *AgreeJoinCreationProjectCommand) ValidateCommand() error {
valid := validation.Validation{}
b, err := valid.Valid(agreeJoinCreationProjectCommand)
if err != nil {
return err
}
if !b {
for _, validErr := range valid.Errors {
return fmt.Errorf("%s %s", validErr.Key, validErr.Message)
}
}
return nil
}