fix(jpush): correct SendNo field type from int64 to string in PushResponse
The JPush API returns sendno as a string value in the JSON response, but the struct field was incorrectly typed as int64. This fix updates both the struct field type and the corresponding zap logger call to use string type, ensuring proper JSON parsing and logging.
This commit is contained in:
@@ -86,7 +86,7 @@ type PushOptions struct {
|
|||||||
|
|
||||||
type PushResponse struct {
|
type PushResponse struct {
|
||||||
MsgID string `json:"msg_id"`
|
MsgID string `json:"msg_id"`
|
||||||
SendNo int64 `json:"sendno"`
|
SendNo string `json:"sendno"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type RateLimitInfo struct {
|
type RateLimitInfo struct {
|
||||||
@@ -208,7 +208,7 @@ func (c *Client) Push(payload map[string]any) (*PushResponse, *RateLimitInfo, er
|
|||||||
} else {
|
} else {
|
||||||
c.logger.Debug("jpush push response",
|
c.logger.Debug("jpush push response",
|
||||||
zap.String("msg_id", result.MsgID),
|
zap.String("msg_id", result.MsgID),
|
||||||
zap.Int64("send_no", result.SendNo),
|
zap.String("send_no", result.SendNo),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
return result, rateLimit, parseErr
|
return result, rateLimit, parseErr
|
||||||
|
|||||||
Reference in New Issue
Block a user