From 2e74866bbe110edee8b7c2a84581aa5180249320 Mon Sep 17 00:00:00 2001 From: renzhiyuan <465386466@qq.com> Date: Thu, 23 Jul 2026 18:13:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=96=87=E4=BB=B6:=20ymt=5Fv?= =?UTF-8?q?3/types.go?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ymt_v3/types.go | 98 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 ymt_v3/types.go diff --git a/ymt_v3/types.go b/ymt_v3/types.go new file mode 100644 index 0000000..4a11c88 --- /dev/null +++ b/ymt_v3/types.go @@ -0,0 +1,98 @@ +package ymt_v3 + +// CommonResponse 公共响应结构 +type CommonResponse struct { + Code int32 `json:"code"` + Message string `json:"message"` + Reason string `json:"reason,omitempty"` + Data *CommonData `json:"data,omitempty"` +} + +// CommonData 公共响应数据(包含加密的ciphertext) +type CommonData struct { + Ciphertext string `json:"ciphertext"` +} + +// KeyOrderRequest 获取券码请求业务参数 +type KeyOrderRequest struct { + OutBizNo string `json:"out_biz_no"` + ActivityNo string `json:"activity_no"` + Account string `json:"account,omitempty"` + NotifyURL string `json:"notify_url,omitempty"` +} + +// KeyOrderResponse 获取券码/券码查询响应业务参数 +type KeyOrderResponse struct { + OutBizNo string `json:"out_biz_no"` + TradeNo string `json:"trade_no"` + Key string `json:"key,omitempty"` + URL string `json:"url,omitempty"` + ValidBeginTime string `json:"valid_begin_time,omitempty"` + ValidEndTime string `json:"valid_end_time,omitempty"` + UsableNum uint32 `json:"usable_num"` + UsageNum uint32 `json:"usage_num"` + Status uint32 `json:"status"` + SettlementPrice float64 `json:"settlement_price,omitempty"` + Account string `json:"account,omitempty"` +} + +// KeyQueryRequest 券码查询请求业务参数 +type KeyQueryRequest struct { + OutBizNo string `json:"out_biz_no,omitempty"` + TradeNo string `json:"trade_no,omitempty"` +} + +// KeyDiscardRequest 券码作废请求业务参数 +type KeyDiscardRequest struct { + OutBizNo string `json:"out_biz_no,omitempty"` + TradeNo string `json:"trade_no,omitempty"` +} + +// KeyDiscardResponse 券码作废响应业务参数 +type KeyDiscardResponse struct { + OutBizNo string `json:"out_biz_no"` + TradeNo string `json:"trade_no"` + Status uint32 `json:"status"` +} + +// BatchOrderRequest 批量发卡请求业务参数 +type BatchOrderRequest struct { + OutBizNo string `json:"out_biz_no"` + ActivityNo string `json:"activity_no"` + Number int32 `json:"number"` + NotifyURL string `json:"notify_url,omitempty"` +} + +// BatchOrderResponse 批量发卡响应业务参数 +type BatchOrderResponse struct { + OutBizNo string `json:"out_biz_no"` + TradeNo string `json:"trade_no"` + Status string `json:"status"` +} + +// BatchQueryRequest 批量查询请求业务参数 +type BatchQueryRequest struct { + OutBizNo string `json:"out_biz_no,omitempty"` + TradeNo string `json:"trade_no,omitempty"` +} + +// BatchQueryResponse 批量查询响应业务参数 +type BatchQueryResponse struct { + OutBizNo string `json:"out_biz_no"` + TradeNo string `json:"trade_no"` + Status string `json:"status"` + DownloadURL string `json:"download_url,omitempty"` + ZipPassword string `json:"zip_password,omitempty"` +} + +// NotifyPayload 回调通知的body结构 +type NotifyPayload struct { + Data *CommonData `json:"data"` +} + +// NotifyHeader 回调通知的header +type NotifyHeader struct { + Appid string `json:"Appid"` + Timestamp string `json:"Timestamp"` + Sign string `json:"Sign"` +} \ No newline at end of file