正在显示
2 个修改的文件
包含
13 行增加
和
1 行删除
... | ... | @@ -3,6 +3,7 @@ package socialwork_sdk |
3 | 3 | import ( |
4 | 4 | "encoding/base64" |
5 | 5 | "encoding/json" |
6 | + "fmt" | |
6 | 7 | "gitlab.workai.com.cn/chenang/socialwork-sdk/model" |
7 | 8 | "log" |
8 | 9 | ) |
... | ... | @@ -16,6 +17,10 @@ type OrderClient struct { |
16 | 17 | IP string `json:"ip"` |
17 | 18 | } |
18 | 19 | |
20 | +func HelloWorld() { | |
21 | + fmt.Println("欢迎使用小爱,socialwork-sdk") | |
22 | +} | |
23 | + | |
19 | 24 | func NewOrderClient(key, iv, customerPrivateKey, publicKey, ip string) *OrderClient { |
20 | 25 | return &OrderClient{ |
21 | 26 | Key: key, |
... | ... | @@ -84,7 +89,13 @@ func (o *OrderClient) SendRequest(businessCode, reqBody string) (string, error) |
84 | 89 | return "", err |
85 | 90 | } |
86 | 91 | |
87 | - return respBody, nil | |
92 | + orderRes := model.OrderModel{} | |
93 | + json.Unmarshal([]byte(respBody), &orderRes) | |
94 | + _respBody, err := o.DecryptAndVerySign(orderRes.Data, orderRes.Sign) | |
95 | + if err != nil { | |
96 | + return "", err | |
97 | + } | |
98 | + return string(_respBody), nil | |
88 | 99 | } |
89 | 100 | |
90 | 101 | func (o *OrderClient) checkParams(businessCode, reqBody string) error { | ... | ... |
请
注册
或
登录
后发表评论