inform_expected_dividends.go
1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package command
import (
"fmt"
"github.com/beego/beego/v2/core/validation"
)
type InformExpectedDividendsCommand struct {
// 用户id
UserId int64 `json:"userId"`
CompanyId int64 `json:"companyId"`
OrgId int64 `json:"orgId"`
UserBaseId int64 `json:"userBaseId" valid:"Required"`
// 共创项目id
CreationProjectId int64 `json:"creationProjectId" valid:"Required"`
//共创项目编号
CreationProjectNumber string `json:"creationProjectNumber" valid:"Required"`
// 共创项目名称
CreationProjectName string `json:"creationProjectName" valid:"Required"`
// 共创合约id
CreationContractId int64 `json:"creationContractId" valid:"Required"`
// 共创合约名称
CreationContractName string `json:"creationContractName" valid:"Required"`
// 共创合约编号
CreationContractNumber string `json:"creationContractNumber" valid:"Required"`
// 产品名称
ProductName []string `json:"productName" valid:"Required"`
//分红预算id
DividendsEstimateId int64 `json:"dividendsEstimateId" valid:"Required"`
//预算金额
DividendsAmount string `json:"dividendsAmount" valid:"Required"`
}
func (informExpectedDividendsCommand *InformExpectedDividendsCommand) Valid(validation *validation.Validation) {
}
func (informExpectedDividendsCommand *InformExpectedDividendsCommand) ValidateCommand() error {
valid := validation.Validation{}
b, err := valid.Valid(informExpectedDividendsCommand)
if err != nil {
return err
}
if !b {
for _, validErr := range valid.Errors {
return fmt.Errorf("%s %s", validErr.Key, validErr.Message)
}
}
return nil
}