This commit is contained in:
邹宗楠
2023-07-28 20:09:57 +08:00
parent 86d1bc5bee
commit 78887ca68a
5 changed files with 34 additions and 18 deletions

View File

@@ -2,6 +2,7 @@ package jdapi
import ( import (
"errors" "errors"
"git.rosy.net.cn/jx-callback/globals"
"strings" "strings"
"git.rosy.net.cn/baseapi" "git.rosy.net.cn/baseapi"
@@ -452,6 +453,14 @@ func (a *API) OrderAcceptOperate(orderId string, isAgreed bool, userName string)
"operator": utils.GetAPIOperator(userName), "operator": utils.GetAPIOperator(userName),
} }
_, err := a.AccessAPINoPage("ocs/orderAcceptOperate", jdParams, nil, nil, orderOperationResultParser) _, err := a.AccessAPINoPage("ocs/orderAcceptOperate", jdParams, nil, nil, orderOperationResultParser)
if err != nil {
printParam := map[string]interface{}{
"orderId": utils.Str2Int64(orderId),
}
result, err := a.AccessAPINoPage("bm/open/api/order/printOrder", printParam, nil, nil, nil)
globals.SugarLogger.Debugf("============result := %s", utils.Format4Output(result, false))
globals.SugarLogger.Debugf("============result := %s", utils.Format4Output(err, false))
}
return err return err
} }

View File

@@ -11,6 +11,7 @@ import (
"git.rosy.net.cn/baseapi/utils" "git.rosy.net.cn/baseapi/utils"
"git.rosy.net.cn/jx-callback/globals" "git.rosy.net.cn/jx-callback/globals"
"strconv" "strconv"
"strings"
"testing" "testing"
"time" "time"
) )
@@ -224,3 +225,12 @@ func TestQueryBillList(t *testing.T) {
globals.SugarLogger.Debugf("data:= %s", utils.Format4Output(data, false)) globals.SugarLogger.Debugf("data:= %s", utils.Format4Output(data, false))
} }
func TestName2(t *testing.T) {
emoji := `【右上角关注点亮⭐️】`
a := replaceContentOther(emoji)
fmt.Println(a)
}
func replaceContentOther(content string) string {
return strings.ReplaceAll(strings.ReplaceAll(content, "⃣️", " "), "•", "-")
}

View File

@@ -169,8 +169,8 @@ func TestStoreSkuStock(t *testing.T) {
func TestGetSkuDetaul(t *testing.T) { func TestGetSkuDetaul(t *testing.T) {
result, err := apiTao.QueryStoreSKu(&request585.AlibabaWdkSkuQueryRequest{Param: &domain585.AlibabaWdkSkuQuerySkuQueryDo{ result, err := apiTao.QueryStoreSKu(&request585.AlibabaWdkSkuQueryRequest{Param: &domain585.AlibabaWdkSkuQuerySkuQueryDo{
SkuCodes: &[]string{"84671"}, SkuCodes: &[]string{"39083"},
OuCode: utils.String2Pointer("JX668998"), OuCode: utils.String2Pointer("JX666678"),
}}) }})
globals.SugarLogger.Debugf("err := %s ", utils.Format4Output(err, false)) globals.SugarLogger.Debugf("err := %s ", utils.Format4Output(err, false))
globals.SugarLogger.Debugf("result := %s ", utils.Format4Output(result, false)) globals.SugarLogger.Debugf("result := %s ", utils.Format4Output(result, false))
@@ -189,6 +189,9 @@ func uploadImg(api *API, imgs []string) *string {
continue continue
} }
body, _ := ioutil.ReadAll(resp.Body) body, _ := ioutil.ReadAll(resp.Body)
if strings.Contains(string(body), "Document not found") {
continue
}
if newImg, _ := api.UploadImg(&request1475.AlibabaWdkPictureUploadRequest{ if newImg, _ := api.UploadImg(&request1475.AlibabaWdkPictureUploadRequest{
PictureCategoryId: utils.Int64ToPointer(0), PictureCategoryId: utils.Int64ToPointer(0),
Img: &body, Img: &body,

View File

@@ -46,9 +46,16 @@ func TestGetStoreCategory(t *testing.T) {
} }
func TestGetStoreAllCategory(t *testing.T) { func TestGetStoreAllCategory(t *testing.T) {
data, err := apiTao.GetStoreAllCategory() data, _ := apiTao.GetStoreAllCategory()
globals.SugarLogger.Debugf("data := %s", utils.Format4Output(data, false)) for _, v := range data {
globals.SugarLogger.Debugf("err := %s", utils.Format4Output(err, false)) if v.ChildCategorys != nil {
for _, v2 := range v.ChildCategorys {
globals.SugarLogger.Debugf("%s", utils.Format4Output(v2, false))
}
}
}
} }
func TestAddCategory(t *testing.T) { func TestAddCategory(t *testing.T) {

View File

@@ -1,7 +1,6 @@
package tiktok_api package tiktok_api
import ( import (
"crypto/md5"
"fmt" "fmt"
"git.rosy.net.cn/baseapi/utils" "git.rosy.net.cn/baseapi/utils"
"git.rosy.net.cn/jx-callback/globals" "git.rosy.net.cn/jx-callback/globals"
@@ -40,15 +39,3 @@ func TestGetSkuDetailLocalID(t *testing.T) {
globals.SugarLogger.Debugf("data=%s", utils.Format4Output(data, false)) globals.SugarLogger.Debugf("data=%s", utils.Format4Output(data, false))
globals.SugarLogger.Debugf("data=%s", err) globals.SugarLogger.Debugf("data=%s", err)
} }
//
func TestName(t *testing.T) {
body := `[{
"tag": "101",
"msg_id": "69793528590852580050:0:101:1670233754:1024588978:7136048270014416392",
"data": "{\"biz\":2,\"order_status\":2,\"order_type\":0,\"p_id\":5008525809582539796,\"pay_amount\":2640,\"pay_time\":1670233752,\"pay_type\":1,\"s_ids\":[5008525809582539796],\"shop_id\":57939570}"
}]`
signParam := a.appKey + body + a.appSecret
sign := fmt.Sprintf("%X", md5.Sum([]byte(signParam)))
fmt.Println(sign)
}