fix: 修复 Gateway 流量卡接口路径、响应模型和时间戳与上游文档不一致
- 时间戳从 UnixMilli (13位) 改为 Unix (10位秒级) - 实名状态接口路径 /realname-status → /realName - 实名链接接口路径 /realname-link → /RealNameVerification - RealnameStatusResp: status string → realStatus bool + iccid - FlowUsageResp: usedFlow int64 → used float64 + iccid - RealnameLinkResp: link → url
This commit is contained in:
@@ -72,7 +72,7 @@ func (c *Client) doRequest(ctx context.Context, path string, businessData interf
|
||||
return nil, err
|
||||
}
|
||||
|
||||
timestamp := time.Now().UnixMilli()
|
||||
timestamp := time.Now().Unix()
|
||||
sign := generateSign(c.appID, encryptedData, timestamp, c.appSecret)
|
||||
|
||||
reqBody := map[string]interface{}{
|
||||
|
||||
@@ -58,7 +58,7 @@ func (c *Client) QueryRealnameStatus(ctx context.Context, req *CardStatusReq) (*
|
||||
},
|
||||
}
|
||||
|
||||
resp, err := c.doRequest(ctx, "/flow-card/realname-status", businessData)
|
||||
resp, err := c.doRequest(ctx, "/flow-card/realName", businessData)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -109,7 +109,7 @@ func (c *Client) GetRealnameLink(ctx context.Context, req *CardStatusReq) (*Real
|
||||
},
|
||||
}
|
||||
|
||||
resp, err := c.doRequest(ctx, "/flow-card/realname-link", businessData)
|
||||
resp, err := c.doRequest(ctx, "/flow-card/RealNameVerification", businessData)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -32,9 +32,9 @@ type FlowQueryReq struct {
|
||||
|
||||
// FlowUsageResp 是查询流量使用的响应
|
||||
type FlowUsageResp struct {
|
||||
UsedFlow int64 `json:"usedFlow" description:"已用流量"`
|
||||
Unit string `json:"unit" description:"流量单位(MB)"`
|
||||
Extend string `json:"extend,omitempty" description:"扩展字段(广电国网特殊参数)"`
|
||||
ICCID string `json:"iccid" description:"ICCID"`
|
||||
Used float64 `json:"used" description:"当月已用流量(MB)"`
|
||||
Unit string `json:"unit" description:"流量单位(MB)"`
|
||||
}
|
||||
|
||||
// CardOperationReq 是停机/复机请求
|
||||
@@ -45,14 +45,13 @@ type CardOperationReq struct {
|
||||
|
||||
// RealnameStatusResp 是实名认证状态的响应
|
||||
type RealnameStatusResp struct {
|
||||
Status string `json:"status" description:"实名认证状态"`
|
||||
Extend string `json:"extend,omitempty" description:"扩展字段(广电国网特殊参数)"`
|
||||
ICCID string `json:"iccid" description:"ICCID"`
|
||||
RealStatus bool `json:"realStatus" description:"实名状态(true=已实名, false=未实名)"`
|
||||
}
|
||||
|
||||
// RealnameLinkResp 是实名认证链接的响应
|
||||
type RealnameLinkResp struct {
|
||||
Link string `json:"link" description:"实名认证跳转链接(HTTPS URL)"`
|
||||
Extend string `json:"extend,omitempty" description:"扩展字段(广电国网特殊参数)"`
|
||||
URL string `json:"url" description:"实名认证跳转链接(HTTPS URL)"`
|
||||
}
|
||||
|
||||
// BatchQueryReq 是批量查询的请求
|
||||
|
||||
Reference in New Issue
Block a user