service/api/message/request/HYG10010001Req.go

76 lines
4.1 KiB
Go
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package request
import (
"service/api/message"
"service/library/validator"
)
// 下发(打款)报文
type HYG10010001Req struct {
*HYGBaseReq
Timestamp string `json:"timestamp"` // 时间戳
WorkerName string `json:"workerName"` // 收款人姓名
ReceiptChannel int `json:"receiptChannel"` // 收款渠道
WorkerAccount string `json:"workerAccount"` // 收款人账号
WorkerType int `json:"workerType"` // 职业者证件类型
IdNumber string `json:"idNumber"` // 职业者身份证号码
WorkerMobile string `json:"workerMobile"` // 职业者手机号码
DistributeAmount string `json:"distributeAmount"` // 打款金额
RequestNo string `json:"requestNo"` // 下发请求单号
CallbackUrl string `json:"callbackUrl"` // 下发结果回调地址
Remark string `json:"remark"` // 备注
WorkerContent string `json:"workerContent"` // 任务描述
WageStatement string `json:"wageStatement"` // 服务费说明
WorkTime string `json:"workTime"` // 服务时间
PositionId string `json:"positionId"` // 任务ID
WeChatAppId string `json:"weChatAppId"` // 微信下发指定AppID
}
func (req *HYG10010001Req) GetArgList() []*message.JsonParamEntry {
list := make([]*message.JsonParamEntry, 0)
list = append(list, &message.JsonParamEntry{Name: "cooperatorId", Value: req.HYGBaseReq.CooperatorId})
list = append(list, &message.JsonParamEntry{Name: "timestamp", Value: req.Timestamp})
list = append(list, &message.JsonParamEntry{Name: "workerName", Value: req.WorkerName})
list = append(list, &message.JsonParamEntry{Name: "receiptChannel", Value: req.ReceiptChannel})
list = append(list, &message.JsonParamEntry{Name: "workerAccount", Value: req.WorkerAccount})
list = append(list, &message.JsonParamEntry{Name: "workerType", Value: req.WorkerType})
list = append(list, &message.JsonParamEntry{Name: "idNumber", Value: req.IdNumber})
list = append(list, &message.JsonParamEntry{Name: "workerMobile", Value: req.WorkerMobile})
list = append(list, &message.JsonParamEntry{Name: "distributeAmount", Value: req.DistributeAmount})
list = append(list, &message.JsonParamEntry{Name: "requestNo", Value: req.RequestNo})
if req.CallbackUrl != "" {
list = append(list, &message.JsonParamEntry{Name: "callbackUrl", Value: req.CallbackUrl})
}
if req.Remark != "" {
list = append(list, &message.JsonParamEntry{Name: "remark", Value: req.Remark})
}
if req.WorkerContent != "" {
list = append(list, &message.JsonParamEntry{Name: "workerContent", Value: req.WorkerContent})
}
if req.WageStatement != "" {
list = append(list, &message.JsonParamEntry{Name: "wageStatement", Value: req.WageStatement})
}
if req.WorkTime != "" {
list = append(list, &message.JsonParamEntry{Name: "workTime", Value: req.WorkTime})
}
list = append(list, &message.JsonParamEntry{Name: "positionId", Value: req.PositionId})
if req.WeChatAppId != "" {
list = append(list, &message.JsonParamEntry{Name: "weChatAppId", Value: req.WeChatAppId})
}
return list
}
func (p *HYG10010001Req) ProvideNotNullValue() (params []*validator.JsonParam) {
params = make([]*validator.JsonParam, 0)
params = append(params, validator.NewStringParam("商户id不可为空", p.GetCooperatorId()))
params = append(params, validator.NewStringParam("时间戳不可为空!", p.Timestamp))
params = append(params, validator.NewStringParam("收款人姓名不可为空!", p.WorkerName))
params = append(params, validator.NewStringParam("收款人账号不可为空!", p.WorkerAccount))
params = append(params, validator.NewStringParam("职业者身份证号码不可为空!", p.IdNumber))
params = append(params, validator.NewStringParam("职业者手机号码不可为空!", p.WorkerMobile))
params = append(params, validator.NewStringParam("打款金额不可为空!", p.DistributeAmount))
params = append(params, validator.NewStringParam("下发请求单号不可为空!", p.RequestNo))
params = append(params, validator.NewStringParam("任务ID不可为空", p.PositionId))
return params
}