inform_join_creation_contract.go 1.3 KB
package command

import (
	"fmt"

	"github.com/beego/beego/v2/core/validation"
)

type InformJoinCreationContractCommand struct {
	// 接收方用户id
	UserId     int64 `json:"userId"`
	CompanyId  int64 `json:"companyId"`
	UserBaseId int64 `json:"userBaseId" valid:"Required"`
	OrgId      int64 `json:"orgId"`
	// 共创项目id
	CreationProjectId int64 `json:"creationProjectId" valid:"Required"`
	// 共创项目名称
	CreationProjectName string `json:"creationProjectName" valid:"Required"`
	// 共创项目编号
	CreationProjectNumber string `json:"creationProjectNumber" valid:"Required"`
	// 共创合约id
	CreationContractId int64 `json:"creationContractId" valid:"Required"`
	// 共创合约名称
	CreationContractName string `json:"creationContractName" valid:"Required"`
	// 共创合约编号
	CreationContractNumber string `json:"creationContractNumber" valid:"Required"`
}

func (informJoinCreationContractCommand *InformJoinCreationContractCommand) Valid(validation *validation.Validation) {

}

func (informJoinCreationContractCommand *InformJoinCreationContractCommand) ValidateCommand() error {
	valid := validation.Validation{}
	b, err := valid.Valid(informJoinCreationContractCommand)
	if err != nil {
		return err
	}
	if !b {
		for _, validErr := range valid.Errors {
			return fmt.Errorf("%s  %s", validErr.Key, validErr.Message)
		}
	}
	return nil
}