This commit is contained in:
邹宗楠
2023-07-13 10:19:05 +08:00
parent 762367f26f
commit 6078b3bd22
4 changed files with 9 additions and 14 deletions

View File

@@ -5,7 +5,6 @@ import (
"errors"
"fmt"
"git.rosy.net.cn/baseapi/utils"
"git.rosy.net.cn/jx-callback/globals"
"time"
)
@@ -182,7 +181,6 @@ func (a *API) CancelOrder(req *CancelOrderReq) (err error) {
orderHead["business_data"] = string(business)
data, err := a.AccessAPI(ApiURL, "cancelOrder", RequestPost, orderHead)
globals.SugarLogger.Debugf("======data : %s", utils.Format4Output(data, false))
if err != nil {
return err
}

View File

@@ -18,7 +18,7 @@ import (
// "authority_id": ""
//}`
var token = `{"access_token":"09e5b626-418f-4780-ab33-857ba8f69b49","expires_in":1684077242,"scope":"SCOPE","shop_id":57939570,"shop_name":"京西菜市速食","refresh_token":"04a82701-a439-4dad-a20a-48299b0dffcd","authority_id":""}`
var token = `{"access_token":"ec2e3053-73dc-4e39-87ba-db081bbb55df","expires_in":1689492851,"scope":"SCOPE","shop_id":57939570,"shop_name":"京西菜市速食","refresh_token":"f7d2e88c-28c6-46bd-b63a-3d3c49ce0c76","authority_id":""}`
//var token = `{"access_token":"e3173e9f-266f-4d87-88e7-e7cd837bc9d9","expires_in":1672882632,"scope":"SCOPE","shop_id":68023619,"shop_name":"京西到家","refresh_token":"5070aae2-493f-46bd-b5d6-6ea0cd64729f","authority_id":""}`

View File

@@ -404,6 +404,7 @@ type YunDecrypt struct {
// OrderUserInfoDecrypt 用户信息解密(此接口转入云鼎服务器,将不再直接通信)
func (a *API) OrderUserInfoDecrypt(orderId, name, tel, address string) (string, string, string, error) {
url := "http://ddy.jxc4.com/tt/decrypt"
//url := "http://180.184.32.54:8080/tt/decrypt"
accessToken, err := json.Marshal(a.accessTokenObj.CreateTokenData)
if err != nil {
return "", "", "", err

View File

@@ -111,20 +111,16 @@ func TestEditStoreCommodity2(t *testing.T) {
})
}
// 下架
func TestProductSetOffline(t *testing.T) {
token := `{"access_token":"a1746210-a8a3-4497-a87b-09d1f10dbb95","expires_in":1665652230,"scope":"SCOPE","shop_id":"","shop_name":"小时达开放平台对接专用店","refresh_token":"c1cf8d88-0983-4f2a-b969-3746fae6b0cd","authority_id":""}`
a := New("7136048270014416392", "c397aa9f-3927-47c4-8cfe-4d84e02602e0", token)
a.ProductSetOffline(3576377564144516403)
}
// 解密购买用户电话,名字,地址
func TestBatchDecrypt(t *testing.T) {
a := New("7136048270014416392", "c397aa9f-3927-47c4-8cfe-4d84e02602e0", token)
encrypt_post_tel := "##mjApaTO5LNGFDnAU2UmRwu1zhlDQH2+NjIc9kTlQzUYpf1XXrxyxUzd1nWdTPb9H3iFNAdFG66zReSdhf6qUtNVBwNEn5RnIM8wQapxFjh4v+g==*CgkIARCtHCABKAESPgo81dqD65kMclp62fAJBLUpNOP22AKtaL8/7CHDPtDCS8wVtCp/TWhRNLsuFrq/Pmhhz+fe3GDtG8R/L0O0GgA=#1##"
encrypt_post_receiver := "##Cg8e7Ks78U0rSX7AO6NxoD9pPtISczJdulakYdCJDNqXLsFMfhG/0mz7CoxJJyY7zRvx1dkFKahgRk0NCsAxApns7NaaGDu9tyEXloBu9Sc=*CgkIARCtHCABKAESPgo8ja2mXE+INEhReF2W0+deMN0qb/ZoPtaxS98YbR4a1smRO4WPj+jSiYsBv00+DxiXfJTW3DdxusF6TVS3GgA=#1##"
encrypt_post_name := ``
name, tel, address, err := a.OrderUserInfoDecrypt("6917547162766021688", encrypt_post_name, encrypt_post_tel, encrypt_post_receiver)
orderID := "6919995408850359976"
order, err := a.GetTiktokOrderDetail(orderID)
if err != nil || order == nil {
globals.SugarLogger.Debugf("GetTiktokOrderDetail err := %s", utils.Format4Output(order, false))
return
}
name, tel, address, _ := a.OrderUserInfoDecrypt(orderID, order.EncryptPostReceiver, order.EncryptPostTel, order.PostAddr.EncryptDetail)
fmt.Println(name)
fmt.Println(tel)
fmt.Println(address)