fix: issues
This commit is contained in:
@@ -1,16 +1,16 @@
|
||||
package wechat
|
||||
|
||||
type Response struct {
|
||||
ErrCode int `json:"errcode"`
|
||||
ErrMsg int `json:"errmsg"`
|
||||
ErrDescribe int `json:"-"`
|
||||
type ErrorResponse struct {
|
||||
ErrCode int `json:"errcode,omitempty"`
|
||||
ErrMsg string `json:"errmsg,omitempty"`
|
||||
}
|
||||
|
||||
func (r *Response) Error() error {
|
||||
return translateError(r.ErrCode)
|
||||
func (r *ErrorResponse) Error() error {
|
||||
return translateError(r.ErrCode, r.ErrMsg)
|
||||
}
|
||||
|
||||
type AccessTokenResponse struct {
|
||||
AccessToken string `json:"access_token"`
|
||||
ExpiresIn int `json:"expires_in"` // seconds
|
||||
ErrorResponse
|
||||
AccessToken string `json:"access_token,omitempty"`
|
||||
ExpiresIn int `json:"expires_in,omitempty"` // seconds
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user