作者 tangxuhui

去除 未定义验证错误

... ... @@ -29,7 +29,7 @@ type CreateCompanyCommand struct {
}
func (createCompanyCommand *CreateCompanyCommand) Valid(validation *validation.Validation) {
validation.SetError("CustomValid", "未实现的自定义认证")
}
func (createCompanyCommand *CreateCompanyCommand) ValidateCommand() error {
... ...
... ... @@ -19,7 +19,7 @@ type AuditCooperationApplicationCommand struct {
}
func (auditCooperationApplicationCommand *AuditCooperationApplicationCommand) Valid(validation *validation.Validation) {
validation.SetError("CustomValid", "未实现的自定义认证")
}
func (auditCooperationApplicationCommand *AuditCooperationApplicationCommand) ValidateCommand() error {
... ...
... ... @@ -16,7 +16,7 @@ type GetCooperationApplicationQuery struct {
}
func (getCooperationApplicationQuery *GetCooperationApplicationQuery) Valid(validation *validation.Validation) {
validation.SetError("CustomValid", "未实现的自定义认证")
}
func (getCooperationApplicationQuery *GetCooperationApplicationQuery) ValidateQuery() error {
... ...
... ... @@ -85,7 +85,7 @@ type CreateCooperationContractCommand struct {
}
func (createCooperationContractCommand *CreateCooperationContractCommand) Valid(validation *validation.Validation) {
validation.SetError("CustomValid", "未实现的自定义认证")
}
func (createCooperationContractCommand *CreateCooperationContractCommand) ValidateCommand() error {
... ...
... ... @@ -86,7 +86,7 @@ type UpdateCooperationContractCommand struct {
}
func (updateCooperationContractCommand *UpdateCooperationContractCommand) Valid(validation *validation.Validation) {
validation.SetError("CustomValid", "未实现的自定义认证")
}
func (updateCooperationContractCommand *UpdateCooperationContractCommand) ValidateCommand() error {
... ...
... ... @@ -2,6 +2,7 @@ package command
import (
"fmt"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
"github.com/beego/beego/v2/core/validation"
... ... @@ -17,7 +18,7 @@ type MenuFavoriteCommand struct {
}
func (menuFavoriteCommand *MenuFavoriteCommand) Valid(validation *validation.Validation) {
validation.SetError("CustomValid", "未实现的自定义认证")
}
func (menuFavoriteCommand *MenuFavoriteCommand) ValidateCommand() error {
... ...
... ... @@ -22,7 +22,7 @@ type MenuUpdateCommand struct {
}
func (menuUpdateQuery *MenuUpdateCommand) Valid(validation *validation.Validation) {
validation.SetError("CustomValid", "未实现的自定义认证")
}
func (menuUpdateQuery *MenuUpdateCommand) ValidateQuery() error {
... ...
... ... @@ -15,7 +15,7 @@ type RemoveDividendsOrderCommand struct {
}
func (removeDividendsOrderCommand *RemoveDividendsOrderCommand) Valid(validation *validation.Validation) {
validation.SetError("CustomValid", "未实现的自定义认证")
}
func (removeDividendsOrderCommand *RemoveDividendsOrderCommand) ValidateCommand() error {
... ...
... ... @@ -15,7 +15,7 @@ type GetDividendsOrderQuery struct {
}
func (getDividendsOrderQuery *GetDividendsOrderQuery) Valid(validation *validation.Validation) {
validation.SetError("CustomValid", "未实现的自定义认证")
}
func (getDividendsOrderQuery *GetDividendsOrderQuery) ValidateQuery() error {
... ...
... ... @@ -14,7 +14,7 @@ type ListDividendsOrdersQuery struct {
}
func (listDividendsOrdersQuery *ListDividendsOrdersQuery) Valid(validation *validation.Validation) {
validation.SetError("CustomValid", "未实现的自定义认证")
}
func (listDividendsOrdersQuery *ListDividendsOrdersQuery) ValidateQuery() error {
... ...
... ... @@ -21,7 +21,7 @@ type SearchDividendsOrderQuery struct {
}
func (searchDividendsOrderQuery *SearchDividendsOrderQuery) Valid(validation *validation.Validation) {
validation.SetError("CustomValid", "未实现的自定义认证")
}
func (searchDividendsOrderQuery *SearchDividendsOrderQuery) ValidateQuery() error {
... ...
... ... @@ -15,7 +15,7 @@ type OrgGetQuery struct {
}
func (orgGetQuery *OrgGetQuery) Valid(validation *validation.Validation) {
validation.SetError("CustomValid", "未实现的自定义认证")
}
func (orgGetQuery *OrgGetQuery) ValidateQuery() error {
... ...
... ... @@ -2,6 +2,7 @@ package query
import (
"fmt"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
"github.com/beego/beego/v2/core/validation"
... ... @@ -15,7 +16,7 @@ type RoleMenuBeforeEditQuery struct {
}
func (roleMenuBeforeEditQuery *RoleMenuBeforeEditQuery) Valid(validation *validation.Validation) {
validation.SetError("CustomValid", "未实现的自定义认证")
}
func (roleMenuBeforeEditQuery *RoleMenuBeforeEditQuery) ValidateQuery() error {
... ...
... ... @@ -2,6 +2,7 @@ package query
import (
"fmt"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
"github.com/beego/beego/v2/core/validation"
... ... @@ -15,7 +16,7 @@ type RoleUserBeforeEditQuery struct {
}
func (roleUserBeforeEditQuery *RoleUserBeforeEditQuery) Valid(validation *validation.Validation) {
//validation.SetError("CustomValid", "未实现的自定义认证")
}
func (roleUserBeforeEditQuery *RoleUserBeforeEditQuery) ValidateQuery() error {
... ...
... ... @@ -15,7 +15,7 @@ type RoleUserInfoQuery struct {
}
func (roleUserInfoQuery *RoleUserInfoQuery) Valid(validation *validation.Validation) {
validation.SetError("CustomValid", "未实现的自定义认证")
}
func (roleUserInfoQuery *RoleUserInfoQuery) ValidateQuery() error {
... ...
... ... @@ -33,7 +33,7 @@ type CompanyUserAddCommand struct {
}
func (companyUserAddCommand *CompanyUserAddCommand) Valid(validation *validation.Validation) {
validation.SetError("CustomValid", "未实现的自定义认证")
}
func (companyUserAddCommand *CompanyUserAddCommand) ValidateCommand() error {
... ...
... ... @@ -17,7 +17,7 @@ type CompanyUserEnableCommand struct {
}
func (companyUserEnableCommand *CompanyUserEnableCommand) Valid(validation *validation.Validation) {
validation.SetError("CustomValid", "未实现的自定义认证")
}
func (companyUserEnableCommand *CompanyUserEnableCommand) ValidateCommand() error {
... ...
... ... @@ -14,7 +14,7 @@ type CompanyUserResetPasswordCommand struct {
}
func (companyUserResetPasswordCommand *CompanyUserResetPasswordCommand) Valid(validation *validation.Validation) {
validation.SetError("CustomValid", "未实现的自定义认证")
}
func (companyUserResetPasswordCommand *CompanyUserResetPasswordCommand) ValidateCommand() error {
... ...
... ... @@ -42,7 +42,7 @@ type Role struct {
}
func (companyUserUpdateCommand *CompanyUserUpdateCommand) Valid(validation *validation.Validation) {
validation.SetError("CustomValid", "未实现的自定义认证")
}
func (companyUserUpdateCommand *CompanyUserUpdateCommand) ValidateCommand() error {
... ...
... ... @@ -196,3 +196,35 @@ func (gateway HttplibAlliedCreationCooperation) DividendsReturnedOrderGet(param
err = gateway.GetResponseData(result, &data)
return &data, err
}
// DividendsReturnedOrderBatchRemove 批量移除分红退货单
func (gateway HttplibAlliedCreationCooperation) DividendsReturnedOrderBatchRemove(param ReqDividendsReturnedOrderRemove) (
*DataDividendsReturnedOrderRemove, error) {
url := gateway.baseUrL + "/dividends-returned-orders/batch-remove"
method := "POST"
req := gateway.CreateRequest(url, method)
log.Logger.Debug("向业务模块请求数据:批量移除分红退货单。", map[string]interface{}{
"api": method + ":" + url,
"param": param,
})
req, err := req.JSONBody(param)
if err != nil {
return nil, fmt.Errorf("请求批量移除分红退货单失败:%w", err)
}
byteResult, err := req.Bytes()
if err != nil {
return nil, fmt.Errorf("获取批量移除分红退货单失败:%w", err)
}
log.Logger.Debug("获取业务模块请求数据:批量移除分红退货单。", map[string]interface{}{
"result": string(byteResult),
})
var result service_gateway.GatewayResponse
err = json.Unmarshal(byteResult, &result)
if err != nil {
return nil, fmt.Errorf("解析移除分红退货单:%w", err)
}
var data DataDividendsReturnedOrderRemove
err = gateway.GetResponseData(result, &data)
return &data, err
}
... ...