1
This commit is contained in:
@@ -28,17 +28,6 @@ func TestImWaiterStatusModify(t *testing.T) {
|
||||
api.ImWaiterStatusModify(1, "19854102", 1)
|
||||
}
|
||||
|
||||
func TestImMsgChange(t *testing.T) {
|
||||
data := &JdParamJsonObj{
|
||||
StatusId: "",
|
||||
BillId: "320406",
|
||||
ExtendJsonData: "{\"ver\":\"4.2\",\"fromChannelId\":-1,\"mid\":376841421,\"body\":{\"chatinfo\":{\"venderId\":\"store_10352814_1000051632\",\"firstMsg\":true,\"source\":\"jimitwo_service_smart_sdk\",\"IMService\":false,\"repeatConsult\":1,\"sid\":\"8b457541accd5e63eb4845f94c4852e8\",\"oGroupId\":113057083,\"askType\":\"o2o\",\"appId\":\"im.waiter\",\"verification\":\"slide\",\"repeatHuman\":1,\"isJdSuperMarket\":\"0\",\"deviceNo\":\"dd_dvc_aes_73FF2098F02392E999FE00A26817AE212E55DF89C9D405370B4B09A908F3A355\",\"label\":1,\"storeId\":\"1000051632\",\"oSid\":\"9ec16e789610328114db937025384666\",\"distinguishPersonJimi\":2,\"proVer\":\"smart_android_15.2.90\",\"entry\":\"sdk_recent\",\"askAllocateType\":\"multiChat\",\"leaveMsgTable\":1,\"venderName\":\"京西菜市-新都三河店\",\"disputeId\":-1,\"ddSessionType\":\"1\",\"systemVer\":\"android_12_BRA-AL00\",\"eidtoken\":\"jdd01SVZE72NCBZ6AXTRFHLIRLNUSF25PCOYF4OPNU3BOITK5SR62TUHMBIDGFBOYGQ7TWY7WRDPLHA3LP6NME42NE5IQNXASKIGJA6ULRAI01234567\",\"region\":\"CN\"},\"llmStream\":0,\"thumbnail\":\"\",\"param\":{\"$ref\":\"$.body.chatinfo\"},\"type\":\"text\",\"requestData\":{\"entry\":\"sdk_recent\",\"venderId\":\"store_10352814_1000051632\"},\"content\":\"低处不胜暖\",\"sid\":\"8b457541accd5e63eb4845f94c4852e8\"},\"type\":\"chat_message\",\"clientTime\":1765873013013,\"datetime\":1765873013299,\"len\":0,\"from\":{\"app\":\"im.customer\",\"art\":\"\",\"clientType\":\"android\",\"pin\":\"jd_52db6569f724f\"},\"subType\":\"text\",\"id\":\"bdf9475389e94265835d90c41912629c\",\"to\":{\"app\":\"im.waiter\",\"pin\":\"liyang12345ly\"},\"lang\":\"zh_CN\",\"timestamp\":1765873013299}",
|
||||
StoreId: "11998833",
|
||||
Timestamp: "2025-12-16 16:16:53",
|
||||
}
|
||||
ImMsgChange(data, "msChatMessage")
|
||||
}
|
||||
|
||||
func Test(t *testing.T) {
|
||||
api.MessagePushService(&ContextMsg{
|
||||
Id: "1766037788592184572_Q12",
|
||||
|
||||
@@ -179,11 +179,11 @@ func TestProcessQuestionPic(t *testing.T) {
|
||||
for _, v := range [][]string{
|
||||
[]string{
|
||||
"http://img10.360buyimg.com/o2o/jfs/a.jpg",
|
||||
",,,jfs/a.jpg",
|
||||
",jfs/a.jpg",
|
||||
},
|
||||
[]string{
|
||||
"http://img10.360buyimg.com/o2o/jfs/a.jpg,https://img10.360buyimg.com/o2o/jfs/b.jpg",
|
||||
" , ,, jfs/a.jpg,https:jfs/b.jpg",
|
||||
" , , jfs/a.jpg,https:jfs/b.jpg",
|
||||
},
|
||||
[]string{
|
||||
"https://img10.360buyimg.com/o2o/jfs/a.jpg",
|
||||
|
||||
@@ -129,6 +129,11 @@ func TestNewAddSku(t *testing.T) {
|
||||
globals.SugarLogger.Debugf("--------result := %v", err)
|
||||
}
|
||||
|
||||
func TestUpdateCurrentQty(t *testing.T) {
|
||||
err1 := api.UpdateCurrentQty(utils.Int64ToStr(time.Now().Unix()), "23988364", 2023436550, 9999)
|
||||
fmt.Println(err1)
|
||||
}
|
||||
|
||||
func TestNewAddSku2(t *testing.T) {
|
||||
param := map[string]interface{}{
|
||||
"traceId": "33F7CD45502711F190B1525400E86DC0,18981810340",
|
||||
|
||||
@@ -410,12 +410,11 @@ type JDSkuList struct {
|
||||
func (a *API) UnBindStoreGoods(skuId int64) {
|
||||
jdParams := map[string]interface{}{
|
||||
"skuId": skuId,
|
||||
"stationNo": "14986394",
|
||||
"stationNo": "23988364",
|
||||
"opPin": "liulei",
|
||||
}
|
||||
data, err := a.AccessAPINoPage("StoreGoodsPlatformService/unBindStoreGoods", jdParams, nil, nil, genNoPageResultParser("code", "msg", "data", "0"))
|
||||
_, err := a.AccessAPINoPage("StoreGoodsPlatformService/unBindStoreGoods", jdParams, nil, nil, genNoPageResultParser("code", "msg", "data", "0"))
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
fmt.Println(data)
|
||||
}
|
||||
|
||||
@@ -2,10 +2,9 @@ package jdapi
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"sync"
|
||||
"testing"
|
||||
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -126,47 +125,38 @@ func TestBatchUpdateCurrentQtys(t *testing.T) {
|
||||
//baseapi.SugarLogger.Debug(utils.Format4Output(result, false))
|
||||
}
|
||||
|
||||
type Object2222 struct {
|
||||
Clients map[string]int
|
||||
*sync.RWMutex
|
||||
}
|
||||
var data = []int64{}
|
||||
|
||||
func NewTcpClient222() *Object2222 {
|
||||
t := &Object2222{
|
||||
Clients: make(map[string]int),
|
||||
}
|
||||
t.RWMutex = new(sync.RWMutex)
|
||||
return t
|
||||
}
|
||||
func TestLock(t *testing.T) {
|
||||
obj := NewTcpClient222()
|
||||
go func() {
|
||||
fmt.Println("1")
|
||||
for i := 0; i < 100000; i++ {
|
||||
obj.setParam(utils.Int2Str(i), i)
|
||||
}
|
||||
}()
|
||||
|
||||
go func() {
|
||||
fmt.Println("2")
|
||||
for i := 0; i < 100000; i++ {
|
||||
fmt.Println(obj.getParam(utils.Int2Str(i)))
|
||||
}
|
||||
}()
|
||||
|
||||
for i := 0; i < 100000; i++ {
|
||||
fmt.Println(obj.Clients[utils.Int2Str(i)])
|
||||
func TestUnBindStoreGoods(t *testing.T) {
|
||||
for _, v := range data {
|
||||
api.UnBindStoreGoods(v)
|
||||
fmt.Println(v)
|
||||
time.Sleep(200 * time.Microsecond)
|
||||
}
|
||||
}
|
||||
|
||||
func (t *Object2222) setParam(key string, v int) {
|
||||
t.Lock()
|
||||
defer t.Unlock()
|
||||
t.Clients[key] = v
|
||||
}
|
||||
var data2 = []int64{}
|
||||
|
||||
func (t *Object2222) getParam(key string) int {
|
||||
t.RLock()
|
||||
defer t.RUnlock()
|
||||
return t.Clients[key]
|
||||
func TestUpdateSku2(t *testing.T) {
|
||||
i2 := len(data2) % 50
|
||||
if i2 != 0 {
|
||||
i2 = len(data2)/50 + 1
|
||||
} else {
|
||||
i2 = len(data2) / 50
|
||||
}
|
||||
|
||||
for i := 0; i < i2; i++ {
|
||||
|
||||
bility := make([]*StockVendibility, 0, 50)
|
||||
for _, v := range data2 {
|
||||
bility = append(bility, &StockVendibility{OutSkuId: utils.Int64ToStr(v), DoSale: false})
|
||||
fmt.Println(v)
|
||||
}
|
||||
|
||||
_, err := api.BatchUpdateVendibility("liulei", "", "23988364", bility, "test")
|
||||
if err != nil {
|
||||
fmt.Println(err.Error())
|
||||
}
|
||||
time.Sleep(200 * time.Microsecond)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user