Skip to content

Commit

Permalink
v1.5.30
Browse files Browse the repository at this point in the history
  • Loading branch information
iGoogle-ink committed Mar 3, 2021
1 parent 4bbd339 commit 7441e81
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 11 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#### QQ、微信、支付宝的Golang版本SDK

[![Golang](https://img.shields.io/badge/golang-1.13+-brightgreen.svg)](https://golang.google.cn)
[![Golang](https://img.shields.io/badge/golang-1.14+-brightgreen.svg)](https://golang.google.cn)
[![GoDoc](https://img.shields.io/badge/doc-go.dev-informational.svg)](https://pkg.go.dev/github.com/iGoogle-ink/gopay)
[![Drone CI](https://cloud.drone.io/api/badges/iGoogle-ink/gopay/status.svg)](https://cloud.drone.io/iGoogle-ink/gopay)
[![GitHub Release](https://img.shields.io/github/v/release/iGoogle-ink/gopay)](https://github.com/iGoogle-ink/gopay/releases)
Expand Down
2 changes: 1 addition & 1 deletion alipay/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func (a *Client) PostAliPayAPISelfV2(bm gopay.BodyMap, method string, aliRsp int
bs, bodyBs []byte
)
// check if there is biz_content
bz := bm.Get("biz_content")
bz := bm.GetInterface("biz_content")
if bzBody, ok := bz.(gopay.BodyMap); ok {
if bodyBs, err = json.Marshal(bzBody); err != nil {
return fmt.Errorf("json.Marshal(%v):%w", bzBody, err)
Expand Down
21 changes: 13 additions & 8 deletions body_map.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,9 @@ func (bm BodyMap) SetFormFile(fieldName string, filePath string) (err error) {
return nil
}

// 获取原始参数
func (bm BodyMap) Get(key string) interface{} {
if bm == nil {
return nil
}
mu.RLock()
defer mu.RUnlock()
return bm[key]
// 获取参数,同 GetString()
func (bm BodyMap) Get(key string) string {
return bm.GetString(key)
}

// 获取参数转换string
Expand All @@ -97,6 +92,16 @@ func (bm BodyMap) GetString(key string) string {
return v
}

// 获取原始参数
func (bm BodyMap) GetInterface(key string) interface{} {
if bm == nil {
return nil
}
mu.RLock()
defer mu.RUnlock()
return bm[key]
}

// 删除参数
func (bm BodyMap) Remove(key string) {
mu.Lock()
Expand Down
2 changes: 1 addition & 1 deletion constant.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const (
OK = "OK"
DebugOff = 0
DebugOn = 1
Version = "1.5.29"
Version = "1.5.30"
)

type DebugSwitch int8
5 changes: 5 additions & 0 deletions release_note.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
版本号:Release 1.5.30
修改记录:
(1) BodyMap:恢复 bm.Get() 方法获取的是string类型,增加 bm.GetInterface()
(2) 微信:新增V3版本退款查询接口

版本号:Release 1.5.29
发布时间:2021/02/27 22:49
修改记录:
Expand Down

0 comments on commit 7441e81

Please sign in to comment.