This commit is contained in:
邹宗楠
2023-09-22 10:20:53 +08:00
parent c20d32e975
commit f5c35458c3
4 changed files with 21 additions and 6 deletions

View File

@@ -26,8 +26,8 @@ func init() {
//api = New("4123", "df2c88338b85f830cebce2a9eab56628", "", "")
//商超
//api = New("5873", "41c479790a76f86326f89e8048964739", "", "token_izAHEkoEl4lV-w4JdJFNww") //token_n4TwqCntWWuvQwAawzxC0w
api = New("5873", "41c479790a76f86326f89e8048964739", "", "token_r36FEse6_ywebQI65FNNWA") //token_n4TwqCntWWuvQwAawzxC0w
api = New("5873", "41c479790a76f86326f89e8048964739", "", "token_nngsVP37s-HXY86xe85H7Q") //token_n4TwqCntWWuvQwAawzxC0w
//api = New("5873", "41c479790a76f86326f89e8048964739", "", "token_r36FEse6_ywebQI65FNNWA") //token_n4TwqCntWWuvQwAawzxC0w
cookieStr := `
acctId=57396785; token=0bWbK5VbK50E2BmIhIH2zHB-am_y7mB37yXHm6RLZWx4*; wmPoiId=-1;
`

View File

@@ -17,9 +17,20 @@ func TestOrderViewStatus(t *testing.T) {
}
t.Log(result)
}
func TestTimne(t *testing.T) {
fmt.Println(utils.Interface2Int64WithDefault(1695292241, 0))
fmt.Println(getTimeFromTimestamp(utils.Interface2Int64WithDefault(1695292241, 0)))
}
func getTimeFromTimestamp(timeStamp int64) time.Time {
if timeStamp < 1538103149 { // 立即达订单给的是1而不是空01538103149不是特殊值只是一个任意之前的时间这样写可以处理
return utils.DefaultTimeValue
}
return utils.Timestamp2Time(timeStamp)
}
func TestOrderGetOrderDetail(t *testing.T) {
result, err := api.OrderGetOrderDetail(1100692033635137950, false)
result, err := api.OrderGetOrderDetail(1000732590328335860, false)
if err != nil {
t.Fatal(err)
}

View File

@@ -189,7 +189,11 @@ func (a *API) RetailCatUpdate(poiCode, catName string, updateParams *Param4Updat
params["category_name"] = catName
time.Sleep(200 * time.Millisecond)
_, err = a.AccessAPI("retailCat/update", false, params)
revtel, err := a.AccessAPI("retailCat/update", false, params)
if err != nil {
globals.SugarLogger.Debugf("=======RetailCatUpdate : %v", err)
globals.SugarLogger.Debugf("=======RetailCatUpdate : %v", revtel)
}
return err
}

View File

@@ -26,7 +26,7 @@ func TestRetailCatUpdate(t *testing.T) {
// 测试获取门店分类列表
func TestRetailCatList(t *testing.T) {
result, err := api.RetailCatList("12663480")
result, err := api.RetailCatList("18900165")
if err != nil {
t.Fatal(err)
}
@@ -94,7 +94,7 @@ func TestRetailCatDelete(t *testing.T) {
}
func TestRetailList(t *testing.T) {
result, err := api.RetailList("8967897"+
result, err := api.RetailList("18900165"+
"", 0, 20)
if err != nil {
t.Fatal(err)