Skip to content

Commit

Permalink
fix(WXResponse): add ReponseBase for WX base return fields (#76)
Browse files Browse the repository at this point in the history
Co-authored-by: Matrix-X <[email protected]>
  • Loading branch information
WalleV and Matrix-X authored Mar 15, 2022
1 parent 6b3ae49 commit 19167c2
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/kernel/response/wx.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
package response

type ResponseBase struct {
Code string `json:"code,omitempty"`
Message string `json:"message,omitempty"`
}

type ResponseWork struct {
*ResponseBase

ErrCode int `json:"errcode"`
ErrMSG string `json:"errmsg,omitempty"`
}

type ResponsePayment struct {
*ResponseBase

ReturnCode string `json:"return_code"`
ReturnMSG string `json:"return_msg,omitempty"`

Expand All @@ -16,6 +25,8 @@ type ResponsePayment struct {
}

type ResponseMiniProgram struct {
*ResponseBase

Msg string `json:"msg,omitempty"` // 小程序直播的部分接口会把错误提示抛在msg字段
ErrCode int `json:"errcode"`
ErrMSG string `json:"errmsg,omitempty"`
Expand All @@ -25,6 +36,8 @@ type ResponseMiniProgram struct {
}

type ResponseOfficialAccount struct {
*ResponseBase

ErrCode int `json:"errcode"`
ErrMSG string `json:"errmsg,omitempty"`

Expand Down

0 comments on commit 19167c2

Please sign in to comment.