get_cooperation_contract.go
674 字节
package query
import (
"fmt"
"github.com/beego/beego/v2/core/validation"
)
type GetCooperationContractQuery struct {
// 共创合约ID
CooperationContractId int64 `json:"cooperationContractId" valid:"Required"`
}
func (getCooperationContractQuery *GetCooperationContractQuery) Valid(validation *validation.Validation) {
}
func (getCooperationContractQuery *GetCooperationContractQuery) ValidateQuery() error {
valid := validation.Validation{}
b, err := valid.Valid(getCooperationContractQuery)
if err != nil {
return err
}
if !b {
for _, validErr := range valid.Errors {
return fmt.Errorf("%s %s", validErr.Key, validErr.Message)
}
}
return nil
}