credit_account_payment.go
1.1 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
package command
import (
"fmt"
"github.com/beego/beego/v2/core/validation"
)
type CreditAccountPaymentCommand struct {
// 接收方用户id
UserId int64 `json:"userId"`
UserBaseId int64 `json:"userBaseId" valid:"Required"`
CompanyId int64 `json:"companyId"`
OrgId int64 `json:"orgId"`
// 结算单号
CreditAccountOrderNum string `json:"creditAccountOrderNum" valid:"Required"`
// 结算金额
SettlementAmount string `json:"settlementAmount" valid:"Required"`
// 实际支付金额
ActuallyPaidAmount string `json:"actuallyPaidAmount"`
//结算单id
CreditAccountId int64 `json:"creditAccountId"`
}
func (creditAccountPaymentCommand *CreditAccountPaymentCommand) Valid(validation *validation.Validation) {
}
func (creditAccountPaymentCommand *CreditAccountPaymentCommand) ValidateCommand() error {
valid := validation.Validation{}
b, err := valid.Valid(creditAccountPaymentCommand)
if err != nil {
return err
}
if !b {
for _, validErr := range valid.Errors {
return fmt.Errorf("%s %s", validErr.Key, validErr.Message)
}
}
return nil
}