diff --git a/README.md b/README.md index e55da517..40604546 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/alipay/client.go b/alipay/client.go index 1a3f2b48..d0da7bbb 100644 --- a/alipay/client.go +++ b/alipay/client.go @@ -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) diff --git a/body_map.go b/body_map.go index 9a2c4591..22d870ad 100644 --- a/body_map.go +++ b/body_map.go @@ -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 @@ -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() diff --git a/constant.go b/constant.go index 7d2add18..886e96d2 100644 --- a/constant.go +++ b/constant.go @@ -7,7 +7,7 @@ const ( OK = "OK" DebugOff = 0 DebugOn = 1 - Version = "1.5.29" + Version = "1.5.30" ) type DebugSwitch int8 diff --git a/release_note.txt b/release_note.txt index 56d3bc4d..1a96d451 100644 --- a/release_note.txt +++ b/release_note.txt @@ -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 修改记录: