From eaaf58cb23e17d66edf0a044f43db4a5a1f20637 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=AE=97=E6=A5=A0?= Date: Wed, 15 Jan 2025 14:23:28 +0800 Subject: [PATCH] 1 --- platformapi/ebaiapi/order_test.go | 21 +++++++++++++--- platformapi/fnpsapi/fn_test.go | 4 +-- platformapi/jdapi/store_page_test.go | 11 +++++++++ platformapi/mtwmapi/retail.go | 26 +++++++++---------- platformapi/mtwmapi/retail_test.go | 37 ---------------------------- 5 files changed, 44 insertions(+), 55 deletions(-) diff --git a/platformapi/ebaiapi/order_test.go b/platformapi/ebaiapi/order_test.go index 8dd67127..13e2b5ec 100644 --- a/platformapi/ebaiapi/order_test.go +++ b/platformapi/ebaiapi/order_test.go @@ -5,6 +5,7 @@ import ( "fmt" "git.rosy.net.cn/jx-callback/globals" "io/ioutil" + "math" "net/http" "strings" "testing" @@ -18,7 +19,7 @@ func TestCancelOrder(t *testing.T) { } func TestOrderGet(t *testing.T) { - result, err := api.OrderGet("4052380171183237731") + result, err := api.OrderGet("4016706010217879061") products := result["products"].([]interface{})[0].([]interface{}) for _, product2 := range products { product := product2.(map[string]interface{}) @@ -316,6 +317,20 @@ func TestGetMtData(t *testing.T) { } -func Test1(t *testing.T) { - fmt.Println(time.Now().AddDate(0, 0, 1).Sub(time.Now()).Seconds()) +func Test2222(t *testing.T) { + fmt.Println(utils.Str2Float64("33.9") * 100) +} + +func Test1(t *testing.T) { + str := "1000,8,10:1001,14,10:1002,9,10:1006,12,10:1008,20,3:1009,8,2:1010,14,10:1011,8,10:1012,12,10:1013,8,10:1014,11,10:1015,8,10:1016,17,5:1017,14,10:1018,12,10:1019,9,10:1020,11,10:1021,8,10:1022,9,10:1023,8,10:1024,9,10:1025,12,10:1026,8,10:1027,8,10:1028,8,10:1029,12,10:1030,8,10:1031,11,10:1032,11,10:1033,8,10:1034,9,10:1035,8,10:1036,8,10:1037,9,10:1038,11,10:1039,12,10:1040,9,10:1041,9,10:1042,8,10:1043,9,10:1044,7,10:1045,11,10:1046,12,10:1047,8,10:1048,8,10:1049,8,10:1050,6,10:1051,6,10:1052,12,10:1053,9,10:1054,8,10:1055,8,10:1056,12,10:1057,14,10:2408,14,10:1058,12,10:1059,8,10:1060,8,10:1061,8,10:1062,8,10:1063,8,10:1064,11,10:1065,12,10:1066,7,10:1067,15,10:1068,8,10:1069,3,100:1070,6,10:1071,8,10:1072,17,5:1073,9,10:1074,12,10:1075,8,10:1076,8,10:1077,9,10:1078,14,10:1079,14,10:1080,10,10:1081,11,10:1082,2,100:1083,12,10:1084,9,10:1085,9,10:1086,9,10:1087,15,3:1088,14,10:1089,11,10:1090,9,10:1091,6,10:1092,37,1:1093,30,2:1094,24,3:1095,23,3:1096,17,3:1097,20,3:1098,20,3:1099,20,3:1100,17,3:1101,17,3:1102,20,3:1103,32,1:1104,25,3:1105,23,3:1106,17,3:1107,17,3:1108,14,10:1109,11,10:1110,14,10:1111,14,10:1112,20,5:1113,21,5:1114,23,3:1115,18,5:1116,23,5:1117,23,5:1118,20,5:1119,20,5:1120,32,1:1121,38,1:1122,35,1:1123,30,2:1124,25,2:1125,30,2:1126,25,2:1127,27,2:1128,27,2:1129,31,2:1130,27,2:1131,50,1:1132,25,2:1133,8,10:1134,8,10:1135,8,10:1136,5,100:1137,14,10:1138,8,10:1139,11,10:1140,21,5:1141,38,1:1142,28,3:1143,6,50:1144,11,10:1145,9,10:1146,15,10:1147,14,10:1148,15,10:1149,15,10:1150,15,10:1151,9,10:1152,21,5:1153,8,10:1154,8,10:1155,9,10:1156,32,1:1157,17,5:1158,32,1:1159,28,2:1160,12,10:1161,33,1:1162,33,1:1163,50,1:1164,35,1:1165,25,2:1166,38,1:1167,8,10:1168,8,10:1169,9,10:1170,12,10:1171,12,10:1172,24,2:1173,9,10:1174,11,10:1175,11,10:1176,8,10:1177,12,10:1178,44,1:1179,23,2:1180,17,3:1181,9,10:1182,21,2:1183,18,2:1184,18,2:1185,20,2:1186,21,2:1187,25,2:1188,26,2:1189,27,2:1190,28,2:1191,32,2:1192,38,1:1193,48,1:1194,50,1:1195,54,1:1196,47,1:1197,41,1:1198,23,2:1199,23,2:1200,75,1:1201,82,1:1202,23,2:1203,15,3:1204,14,10:1205,17,3:1206,41,1:1207,9,10:1208,21,3:1209,20,3:1210,26,2:1211,38,1:1212,32,2:1213,25,2:1214,54,1:1215,10,10:1216,18,2:1217,17,2:1218,18,2:1219,15,5:1220,35,1:1221,33,1:2409,6.6,1:2410,6.6,1:2411,9,1:2412,9,1:2413,6.6,1:2414,6.6,1:2415,9,1:2416,18.6,1:2417,9,10:2418,9,10:2419,9,10:2420,17,3:1500,1.6,100:1501,2.4,100:1502,3.6,50:1508,6,1:1510,1.2,120:1511,1.2,120:1512,2.4,10:1513,2.4,15:1514,2.4,50:1515,2.4,50:1523,3.9,20:1560,1.6,144:1561,4.2,10:1838,8.4,10:1839,63.9,2:1840,37.5,5:1841,45,5:1842,6.9,10:1843,11.4,12:1844,9.9,12:1845,3.9,24:1846,2.8,12:1847,1.6,20:1848,2.4,20:1849,2,24:1850,2.4,19:1851,2.8,16:1852,4.2,10:1853,4.2,10:1854,3,50:1855,3,20:1856,4.2,20:1857,5.7,20:1858,8.7,10:1859,3,20:1860,0.5,200:1861,6,5:1862,6.9,10:1863,3.3,10:1864,1.2,40:1865,3.9,10:1866,1.6,200:1867,13.2,10:1868,4.8,10:1869,1.6,50:1870,7.5,10:1871,6,10:1872,2.4,50:1873,3.9,20:1874,24.3,5:1875,15,5:1876,18.9,5:1877,9.3,12:1878,5.1,12:1879,5.7,12:1880,5.7,10:1881,18.9,5:1882,9.3,10:1883,6,10:1884,6.9,10:1885,3.9,24:1886,3.2,20:1887,6.9,20:1888,3.3,20:1889,9.3,5:1890,9.3,10:1891,6,5:1892,8.4,5:1893,9,5:1894,3.9,20:1895,3.9,20:1896,15,10:1897,3.9,20:1898,3,20:1899,11.4,5:1900,4.5,10:1901,7.5,10:1902,9.3,5:1903,3.2,20:1904,5.7,10:1905,4.8,10:1906,2.4,10:1907,3.9,20:1908,5.7,10:1909,3.9,20:1910,9.3,5:1911,2.4,20:1912,10.5,5:1913,9.3,10:1914,3,20:1915,3.9,20:1916,3.9,20:1917,18.9,10:1918,18.9,10:1919,4.8,20:1920,8.4,20:1921,33.9,5:1922,37.5,5:1923,7.5,10:1924,4.8,5:1925,4.5,5:1926,3.9,20:1927,7.5,10:1928,3,20:1929,3.2,20:1930,4.8,10:1931,4.2,10:1932,3.2,10:1933,3,10:1934,3.9,10:1935,3,10:1936,3.9,10:1937,7.5,20:1938,13.2,5:1939,15,5:1940,3.9,10:1941,5.7,10:1942,7.5,5:1943,11.4,5:1944,15,10:1945,18.9,10:1946,3.9,20:1947,3.9,40:1948,9.3,10:1949,3.9,20:1950,3.2,20:1952,16.8,5:1953,20.7,5:1954,3.9,10:1955,4.8,10:1956,69.3,5:1957,33.9,2:1958,3,20:1959,3,20:1960,3,20:1961,2.4,100:1962,3.3,20:1963,3.3,20:1964,15,10:1965,13.2,10:1966,2.8,60:1967,3.2,60:1968,3.3,10:1969,3.6,20:1970,9.3,20:1971,14.4,1:1972,18.9,5:1973,18.9,5:1974,3.9,20:1975,3,20:1976,4.8,10:1977,4.8,10:1978,3.9,20:1979,4.5,20:1980,9.3,10:1981,13.2,10:1982,5.7,20:1983,5.7,20:1984,3.2,20:1985,3.9,25:1986,3,25:1987,8.4,10:1988,1.2,20:1989,2.4,20:1990,3,20:1991,3.2,20:1992,3.3,20:1993,3,20:1994,4.5,20:1995,7.5,10:1996,9,10:1997,13.2,2:1998,13.2,10:1999,7.5,10:2000,4.2,20:2002,4.2,20:2003,3,20:2004,4.2,20:2005,4.8,10:2006,3.9,20:2007,6.9,1:2008,4.5,10:2009,13.5,10:2010,13.5,10:2011,11.4,10:2012,9.3,10:2013,3.9,10:2014,3.9,10:2015,2.4,10:2016,2,10:2017,2,10:2018,3.9,12:2019,4.5,10:2020,5.7,10:2021,6.9,10:2022,4.5,10:2023,5.7,10:2024,6.9,10:2025,2.4,10:2026,3.2,10:2027,3.6,10:2028,9.3,10:2029,13.2,10:2030,11.4,10:2031,13.2,10:2032,1.2,50:2033,1.6,50:2034,3.9,20:2035,4.5,5:2036,6.9,5:2037,3.6,100:2038,3.9,10:2039,3.9,20:2040,4.2,10:2041,2.4,20:2042,18.9,2:2043,2,16:2044,1.2,20:2045,18.9,2:2046,18.9,2:2047,18.9,2:2048,18.9,2:2049,18.9,2:2050,18.9,2:2051,2,20:2052,3.6,20:2053,1.6,20:2054,1.6,20:2055,2.4,60:2056,4.8,10:2057,2.8,50:2058,4.5,20:2059,3,10:2060,3.9,10:2061,4.2,10:2062,4.8,20:2063,3.9,20:2064,3,10:2065,3.3,10:2066,4.2,10:2067,4.2,10:2068,7.5,10:2069,3,40:2070,3.9,10:2071,3.9,10:2072,3.9,60:2073,3.9,20:2074,3.9,20:2075,4.2,1:2076,13.2,10:2077,60,2:2078,21.9,5:2079,37.5,2:2080,22.5,2:2081,3.2,24:2082,6.9,5:2083,4.2,20:2084,4.2,20:2085,45,2:2086,45,5:2087,33.9,5:2088,5.4,20:2089,9.3,1:2407,2,10:1951,6,10:1516,8.8,10:1517,7.6,10:1518,6.2,10:1519,13.8,10:1520,11.2,10:1521,13.8,10:1522,15,10:1524,35,12:1525,3.8,100:1526,13.8,10:1527,20,30:1528,18.8,10:1529,27.6,20:1530,16.2,10:1531,15,10:1532,16.2,6:1533,18.8,6:1534,6.2,10:1535,7.6,10:1536,8.8,10:1537,6.2,10:1538,5.8,10:1539,6.2,10:1540,4.2,10:1541,12.6,10:1542,12.6,10:1543,21.2,5:1544,15,5:1545,11.2,10:1546,17.6,10:1547,11.2,10:1548,8.8,10:1549,7.6,10:1550,16.2,10:1551,4.2,10:1552,2.2,50:1553,2.6,10:1554,3.8,10:1555,5,10:1556,6.2,10:1557,3.8,10:1558,8.8,10:1566,2.2,10:1567,3.8,10:1568,3,10:1569,15,5:1570,22.6,5:1571,13.8,5:1572,7.6,40:1573,15,20:1574,7.6,30:1575,6.2,40:1576,12.6,20:1577,16.2,5:1578,1.2,20:1579,2.2,20:1580,45,2:1581,55,2:1582,10,5:1583,20,5:1584,7.6,10:1585,15,10:1586,5,10:1587,3.8,10:1588,16.2,5:1589,17.6,5:1590,13.8,5:1591,13.8,5:1592,3.2,20:1593,6.2,10:1594,10,10:1595,13.8,10:1596,13.8,10:1597,8.8,10:1598,8.8,10:1599,15,10:1600,15,10:1601,11.2,10:1602,11.2,10:1603,6.2,10:1604,8.8,10:1605,37.6,10:1606,62.6,10:1607,13.8,5:1608,8.8,5:1609,12.6,10:1610,5,10:1611,6.2,10:1612,7.6,10:1613,12.6,2:1614,27.6,2:1615,52.6,2:1616,25,2:1617,37.6,2:1618,30,6:1619,30,6:1620,17.6,5:1621,22.6,5:1622,25,5:1623,15,5:1624,17.6,5:1625,20,5:1626,20,5:1627,17.6,5:1628,15,5:1629,12.6,5:1630,5,10:1631,6.2,10:1632,7.6,10:1633,10,10:1634,12.6,10:1635,5,10:1636,6.2,10:1637,3.2,20:1638,5,20:1639,7,10:1640,13.8,5:1641,13.8,5:1642,13.8,5:1643,5,10:1644,7.6,10:1645,8.8,10:1646,10,5:1647,21.2,5:1648,21.2,5:1652,4.6,5:1653,6.2,5:1654,7.6,12:1655,2,24:1656,2.6,20:1657,4.6,20:1658,4.6,20:1659,87.6,2:1660,62.6,2:1661,45,2:1662,32.6,2:1663,7.6,10:1664,12.6,10:1665,12.6,10:1666,11.2,10:1667,12.6,10:1668,15,10:1669,87.6,2:1670,12.6,2:1671,20,2:1672,25,2:1673,5,10:1674,6.2,10:1675,5,10:1676,5.6,10:1677,87.6,2:1678,2.6,10:1679,3,10:1680,7,10:1681,8.8,10:1682,11.2,10:1683,10,10:1684,12.6,10:1685,10,10:1686,12.6,10:1687,15,10:1688,13.8,10:1689,30,5:1690,6.2,10:1691,11.2,10:1692,15,10:1693,35,5:1694,32.6,5:1695,6.2,10:1696,6.2,10:1559,7,10:1223,6.2,10:1225,5.6,10:1226,3,10:1227,11.2,5:1228,8.8,15:1229,8.8,15:1230,30,2:1231,21.2,2:1232,6.2,10:1233,6.2,10:1234,2.6,10:1235,21.2,5:1236,3.2,24:1237,2.6,12:1238,3.8,12:1239,2.6,20:1240,10,2:1241,20,2:1242,15,2:1243,20,2:1244,15,2:1245,3.8,10:1246,1.6,12:1247,3.8,10:1248,3.8,10:1249,3.2,10:1250,3.2,20:1251,21.2,5:1252,16.2,5:1253,10,1:1254,8,1:1255,27.6,2:1256,6,1:1257,60,2:1258,31.2,2:1259,16.2,2:1260,1.8,2:1261,6.2,5:1262,11.2,5:1263,15,5:1264,8.8,5:1265,13.8,5:1266,18.8,5:1268,23.8,5:1269,6.2,5:1270,11.2,5:1271,7.6,5:1272,11.2,5:1273,16.2,5:1274,25,3:1275,12.6,5:1276,21.2,5:1277,26.2,5:1278,41.2,2:1279,17.6,2:1280,17.6,2:1282,20,5:1284,13.8,5:1285,18.8,2:1286,15,2:1287,1.8,2:1288,21.2,2:1289,1,100:1290,2.2,20:1291,1.2,24:1292,0.8,24:1293,0.8,32:1294,1,32:1295,1.2,32:1296,72,5:1297,54,5:1298,36,5:1299,18,5:1300,15,5:1301,30,5:1302,45,3:1303,60,3:1304,82.6,2:1305,66,2:1306,49.6,3:1307,33,3:1308,24.8,5:1309,16.6,5:1310,10,5:1311,13.8,5:1312,15,5:1313,10,10:1314,13.8,5:1315,7,12:1316,4,10:1317,6.2,10:1318,25,5:1319,18.8,5:1320,1.2,72:1321,10,5:1322,1.2,60:1323,3.8,26:1324,3.8,18:1325,4.6,5:1326,9,5:1327,13.6,5:1328,21.2,2:1329,36.2,2:1330,56.2,2:1331,21.2,5:1332,21.2,5:1333,16.2,5:1334,16.2,5:1335,11.2,5:1336,11.2,5:1337,17.6,2:1338,17.6,2:1339,17.6,2:1340,18.8,2:1341,16.2,2:1342,16.2,2:1343,16.2,2:1344,8.8,2:1345,18.8,2:1346,16.2,2:1347,18.8,2:1348,8.8,2:1349,6.6,20:1350,1.8,60:1352,2.8,24:1353,3,24:1354,4.6,24:1355,0.8,60:1356,1.8,60:1357,1.2,60:1358,2.2,120:1359,2.2,120:1360,3.8,60:1361,2,20:1362,2,10:1363,1.2,30:1364,1.2,20:1365,1.2,10:1366,1.2,20:1367,1.2,10:1368,7.6,24:1369,7.6,24:1370,7.6,24:1371,7.6,24:1372,9.6,24:1373,9.6,24:1374,9.6,24:1375,9.6,24:1376,4.6,48:1377,4.6,48:1378,4.6,48:1379,4.6,48:1380,5,36:1381,5,36:1382,1.6,80:1383,1.6,80:1384,3.2,40:1385,1.6,40:1386,1.6,40:1387,2.6,40:1388,1.6,80:1389,0.8,60:1390,1.2,48:1391,1.2,48:1392,2.6,36:1393,2.6,36:1394,11.2,5:1395,11.2,5:1396,11.2,5:1397,11.2,5:1398,10,5:1399,13.8,5:1400,13.8,5:1401,11.2,5:1402,10,5:1403,10,5:1404,10,5:1405,10,5:1406,25,2:1407,25,2:1408,2.6,12:1409,3.8,12:1410,3.6,12:1411,2.6,24:1412,3.8,12:1413,8,10:1414,10.6,10:1415,3,10:1416,5,10:1417,3.8,20:1418,5,18:1419,5,18:1420,3.8,20:1421,3.8,20:1422,1.8,30:1423,1.8,30:1424,1.8,30:1425,0.8,1:1426,1.2,18:1427,1.2,15:1428,1.2,30:1429,1.2,1:1430,2.6,24:1431,6,24:1432,3.2,24:1433,3.8,24:1434,4,24:1435,2.2,24:1436,1.8,24:1437,2.4,36:1438,1.8,60:1439,1.2,60:1440,0.8,60:1441,0.8,60:1442,1.2,60:1443,3.8,10:1444,3.8,10:1445,5.6,10:1446,5,10:1447,16.2,5:1448,11.2,10:1449,5,12:1450,5,12:1451,13.8,12:1452,3.8,24:1453,13.8,12:1454,4.6,30:1455,4.6,30:1456,8.8,12:1457,8.8,12:1458,1,20:1459,4.6,30:1460,3,40:1461,3,40:1462,4.6,48:1463,18.8,5:1464,1.6,50:1465,1.2,40:1466,4,20:1467,6.2,20:1468,3,40:1469,12.6,5:1470,6.2,10:1471,9.6,10:1472,6.2,10:1473,2.8,20:1474,1.2,20:1475,13.8,10:1476,8.8,10:1477,16.2,5:1478,13.8,5:1479,11.2,5:1480,18.8,5:1481,16.2,5:1482,13.8,5:1483,10,2:1484,16.2,2:1485,15,5:1486,6.2,10:1487,6.2,10:1488,11.2,5:1489,8,5:1490,9.6,5:1491,11.2,5:1492,4,10:1493,3.2,48:1494,3.2,48:1495,4,40:1496,4,40:1497,5.8,10:1498,15,2:1499,12.6,2:1503,16.2,5:1504,16.2,5:1505,1.2,50:1506,5,1:1507,17.6,2:1509,13.8,5:1649,8.8,15:1650,8.8,15:1651,3.8,:1697,53.8,5:1698,60,5:1699,53.8,10:1700,53.8,10:1701,65,5:1702,65,5:1703,85,4:1704,80,4:1705,32.6,10:1706,62.6,5:1707,8.8,1:1708,8.8,1:1709,8.8,1:1710,8.8,1:1711,8.8,1:1712,8.8,1:1713,8.8,1:1714,20,5:1715,50,5:1716,50,5:1717,72.6,2:1718,22.6,20:1719,22.6,20:1720,22.6,20:1721,37.6,5:1722,22.6,20:1723,22.6,20:1724,58.8,2:1725,58.8,2:1726,20,5:1727,20,5:1728,10,10:1729,10,10:1730,10,10:1731,32.6,2:1732,40,2:1733,7.6,10:1734,2.6,10:1735,8.8,20:1736,8.8,20:1737,10.6,20:1738,16.2,20:1739,6.2,10:1740,3.8,1:1741,3.8,1:1742,3.8,1:1743,3.8,1:1744,3.8,1:1745,3.8,1:1746,25,5:1747,15,10:1748,25,5:1749,25,5:1750,20,5:1751,25,10:1752,25,10:1753,12.6,10:1754,25,2:1755,17.6,10:1756,10,10:1757,5,10:1758,20,10:1759,37.6,5:1760,25,10:1761,22.6,5:1762,22.6,4:1763,22.6,5:1764,22.6,10:1765,22.6,5:1766,22.6,5:1767,17.6,10:1768,17.6,10:1769,17.6,10:1770,17.6,10:1771,17.6,10:1772,12.6,16:1773,12.6,16:1774,12.6,16:1775,12.6,16:1776,7.6,5:1777,6.2,5:1778,4.6,20:1779,42.6,20:1780,42.6,20:1781,42.6,20:1782,42.6,20:1783,18.8,10:1784,30,2:1785,32.6,2:1786,32.6,5:1787,12.6,1:1788,15,1:1789,17.6,1:1790,20,1:1791,37.6,6:1792,52.6,5:1793,22.6,10:1794,22.6,10:1795,32.6,5:1796,32.6,5:1797,12.6,10:1798,22.6,10:1799,12.6,10:1800,12.6,10:1801,8.8,10:1802,5,10:1803,5,10:1804,5,10:1805,5,10:1806,22.6,12:1808,22.6,12:1809,22.6,12:1810,22.6,12:1811,3.2,60:1812,3.2,60:1813,8.8,20:1814,15,10:1815,20,5:1816,20,5:1817,20,5:1818,20,5:1819,20,5:1820,20,3:1821,20,2:1822,10,10:1823,42.6,10:1824,42.6,10:1825,42.6,10:1826,42.6,10:1827,42.6,10:1828,25,10:1829,25,10:1830,18.8,12:1831,18.8,12:1832,18.8,12:1833,17.8,12:1834,62.6,12:1835,62.6,12:1836,62.6,12:1837,62.6,12:2090,4,20:2091,3.3,40:2092,4,20:2095,4,20:2096,9.5,20:2097,9.5,20:2098,4.5,40:2099,4.8,20:2100,5,24:2101,4.8,12:2102,4.8,12:2103,4.8,12:2104,4.8,12:2105,4.8,12:2106,7.8,20:2107,4.5,12:2108,4.5,12:2109,4.5,12:2110,4.5,12:2111,4.5,12:2112,3.8,24:2113,3.8,24:2114,2.5,48:2115,4.5,18:2116,4.5,18:2117,5,36:2118,5,36:2119,5,36:2120,5,24:2121,5,24:2122,5.5,36:2123,5.5,36:2124,5.5,36:2125,34.5,12:2126,23.5,12:2127,26.5,12:2128,26.5,12:2129,5,40:2130,5.3,20:2131,5,20:2132,4.8,20:2133,4,30:2134,4,10:2135,4,10:2136,4,10:2137,4,10:2138,4,10:2139,4,10:2140,4,10:2141,4,10:2142,4,10:2143,4,10:2144,7.8,20:2145,2.5,20:2146,4.8,20:2147,4.8,20:2148,3.5,10:2149,3.8,30:2150,4.5,10:2151,3.3,20:2152,3.3,20:2153,3.3,20:2154,3.3,20:2155,3.3,20:2156,4.5,30:2157,4.5,30:2158,4.5,30:2159,4.5,30:2160,4.5,30:2161,4.5,30:2162,4.5,30:2163,2.5,20:2164,4.8,12:2165,4.8,12:2166,4.8,12:2167,4.8,12:2168,4.8,12:2169,4.5,30:2170,4.5,30:2171,4.5,30:2172,4.5,30:2173,4.5,30:2174,4.5,30:2175,4.5,30:2176,4.5,30:2177,4.5,30:2178,4.5,30:2179,4.5,30:2180,5,24:2181,5.8,24:2182,5.8,24:2183,5,120:2184,4.5,50:2185,4.5,50:2186,4.5,50:2187,4.5,50:2188,4.5,50:2189,3.5,20:2190,3.8,20:2191,4.5,20:2192,4.8,20:2193,4.8,20:2194,4.5,12:2195,3.3,12:2196,3,12:2197,2.8,12:2198,4.8,24:2199,4.8,24:2200,4.8,24:2201,4.8,24:2202,4.8,24:2203,4.8,24:2204,4.8,24:2205,4.8,24:2206,4.8,24:2207,4.5,12:2208,4.5,10:2209,4.8,24:2210,6.3,12:2211,6.3,12:2212,5.8,24:2213,4.8,24:2214,4.8,24:2215,4.5,12:2216,5,12:2217,4.8,24:2218,4.8,24:2219,4.8,20:2221,4.8,20:2222,4.8,20:2224,3.8,20:2225,5.3,4:2226,4.5,4:2227,3.3,20:2228,4.8,20:2229,3.3,20:2230,4,12:2231,4,12:2232,4,12:2233,4,12:2234,4.8,12:2235,4.8,30:2236,5,100:2237,4.8,12:2238,4.8,12:2239,4.8,12:2240,4.8,12:2241,4.8,12:2242,5,12:2243,5,12:2244,5,12:2245,4.8,12:2246,5,12:2247,5,12:2248,5,12:2249,4.5,12:2250,4.8,12:2251,4,20:2252,4,20:2253,2.5,20:2254,5,30:2255,4.8,72:2256,4.8,72:2257,4.8,72:2258,4.8,24:2259,4,12:2260,4,12:2261,4,12:2262,4,12:2263,3.8,8:2264,3.8,8:2265,4,12:2266,4,12:2267,4.5,12:2268,2.5,30:2269,5,24:2270,4.5,30:2271,4.8,36:2272,4.8,10:2273,4.8,10:2274,4.8,10:2275,4.8,10:2276,4.8,10:2277,4.8,10:2278,4.8,10:2279,7.8,10:2280,3.8,10:2281,3.8,10:2282,3.8,10:2283,3.8,10:2284,3.8,10:2285,4.5,10:2286,4.5,10:2287,4.5,10:2288,4.5,10:2289,4.5,10:2290,5.3,10:2291,5.3,10:2292,5.3,10:2293,14,10:2294,14,10:2295,14,10:2296,4.8,10:2297,4.8,10:2298,4.8,10:2299,4,30:2300,5,40:2301,5,20:2302,4.8,20:2303,5,20:2304,7.8,20:2305,4.8,40:2306,4.8,40:2307,4.8,40:2308,4.5,10:2309,4.5,10:2310,4.5,10:2311,4.5,10:2312,4.5,10:2313,4.5,10:2314,4.5,10:2315,4.8,30:2316,4.8,30:2317,4.8,30:2318,4.8,30:2319,4.8,30:2320,4.8,30:2321,4.8,30:2322,4.8,30:2323,4.8,30:2324,5,24:2325,5,24:2326,2.5,10:2327,3.8,10:2328,4.8,10:2330,4.8,10:2331,4.8,10:2332,4.8,10:2333,4.8,12:2334,4.8,12:2423,4.8,12:2335,4.8,12:2424,4.8,12:2336,4.8,12:2337,4.8,12:2338,4.8,30:2339,4,12:2340,4.5,12:2341,3.8,12:2342,3.8,12:2343,4,40:2344,3.8,20:2345,3.8,20:2346,4,40:2347,4,40:2348,4,40:2349,3.8,20:2350,3.8,20:2351,3.8,20:2352,3.8,20:2353,3.8,20:2354,3.8,20:2355,4,20:2356,4,40:2357,4,40:2358,4,20:2359,4,20:2360,3.3,40:2361,4,20:2362,4,20:2363,3.3,40:2364,3.3,20:2365,4,20:2366,3.3,40:2367,4,20:2368,4,20:2369,3.3,40:2370,4,20:2371,4,20:2372,4,20:2373,3.3,40:2374,4,20:2375,3.3,20:2376,3.3,20:2377,3.3,20:2378,3.3,20:2379,3.3,40:2380,4,20:2381,4,20:2421,4,20:2422,4,20:2382,4,20:2383,4,20:2384,4,20:2385,4,20:2386,4,20:2387,4,20:2388,4,20:2389,4,20:2390,3.3,20:2391,4,20:2392,3.3,20:2393,3.3,20:2394,4,20:2395,4,20:2396,4,20:2397,4,20:2398,3.3,20:2399,4,20:2400,3.3,40:2401,4,20:2402,3.3,20:2403,4,20:2404,4,20:2405,3.3,40:2406,3.3,20:1562,6.4,5:1563,14.6,5:1564,2.2,24:1565,2.2,24" + skuList := strings.Split(str, ":") + for k, v := range skuList { + skuEx := strings.Split(v, ",") + skuNameID, skuPrice, stock := skuEx[0], skuEx[1], skuEx[2] + skuPrice = utils.Float64ToStr(math.Floor(utils.Str2Float64(skuPrice) * 100)) + sql := fmt.Sprintf(`UPDATE store_sku_bind sb JOIN sku s ON sb.sku_id = s.id SET sb.price = %s,sb.mtwm_price = %s,ebai_price = %s,jd_price = %s,jds_price = %s,tao_price = %s,dd_price = %s ,sb.stock = %s,sb.mtwm_sync_status = 57 ,sb.ebai_sync_status = 57,sb.jd_sync_status = 57,sb.jds_sync_status = 57,sb.dd_sync_status = 57,sb.tao_sync_status = 57 WHERE s.name_id = %s AND sb.store_id = 20002;`, skuPrice, skuPrice, skuPrice, skuPrice, skuPrice, skuPrice, skuPrice, stock, skuNameID) + + fmt.Println(fmt.Sprintf("k:%d,sql:%s", k-k, sql)) + } + } diff --git a/platformapi/fnpsapi/fn_test.go b/platformapi/fnpsapi/fn_test.go index 5e6055d0..9ca0689b 100644 --- a/platformapi/fnpsapi/fn_test.go +++ b/platformapi/fnpsapi/fn_test.go @@ -29,7 +29,7 @@ func TestQueryOneStore(t *testing.T) { api = New("6705486294797503379", "c1e6c280-e618-4103-9d0a-673bc54fb22e", "51658", "") //token, err := api.GetAccessToken() api.accessToken = "45c49b75-d47e-4145-b38d-fda8b5ebf3a9" - data, err := api.GetStore("800293") + data, err := api.GetStore("668668") fmt.Println(data) fmt.Println(err) } @@ -147,7 +147,7 @@ func TestClient(t *testing.T) { // 预下单 func TestGetOrder(t *testing.T) { - api = New("6705486294797503379", "c1e6c280-e618-4103-9d0a-673bc54fb22e", "5375691", "") + api = New("6705486294797503379", "c1e6c280-e618-4103-9d0a-673bc54fb22e", "51658", "tMNyQk52Q7VA36Q9XXbTdX") token, _ := api.GetAccessToken() api.accessToken = token.BusinessDataObj.AccessToken diff --git a/platformapi/jdapi/store_page_test.go b/platformapi/jdapi/store_page_test.go index ec4890df..a9e2d0d0 100644 --- a/platformapi/jdapi/store_page_test.go +++ b/platformapi/jdapi/store_page_test.go @@ -6,9 +6,20 @@ import ( "git.rosy.net.cn/baseapi/utils" "git.rosy.net.cn/jx-callback/globals" "strings" + "sync" "testing" ) +func TestSyncMap(t *testing.T) { + var EBaiVendorStoreIDList = new(sync.Map) + + fmt.Println(EBaiVendorStoreIDList.Load("1")) + EBaiVendorStoreIDList.Store("2", 1) + value, ok := EBaiVendorStoreIDList.Load("2") + fmt.Println(value) + fmt.Println(ok) +} + // //import ( // "fmt" diff --git a/platformapi/mtwmapi/retail.go b/platformapi/mtwmapi/retail.go index e211daa0..e42bbd84 100644 --- a/platformapi/mtwmapi/retail.go +++ b/platformapi/mtwmapi/retail.go @@ -352,19 +352,19 @@ func (a *API) RetailSkuStock(trackInfo, poiCode string, foodData []*BareStoreFoo // 此接口已准备废弃 // 2019年9月17日开放平台已上线新接口【retail/sellStatus】,用于零售类商家批量更新商品售卖状态。请已接入老接口(retail/sku/sellStatus)的开发者在2019年10月31日前完成接口迁移,使用新接口的请求地址https://waimaiopen.meituan.com/api/v1/retail/sellStatus。 // 开放平台将于2019年11月1日开始全面下线老接口(retail/sku/sellStatus),如开发者逾期未完成接口迁移,调用老接口失败所造成的相关问题或损失由商家自行承担。 -func (a *API) RetailSkuSellStatus(trackInfo, poiCode string, foodData []*BareStoreFoodInfo, sellStatus int) (failedFoodList []*AppFoodResult, err error) { - _, err = a.AccessAPI2("retail/sku/sellStatus", false, map[string]interface{}{ - KeyAppPoiCode: poiCode, - "food_data": string(utils.MustMarshal(foodData)), - "sell_status": sellStatus, - }, resultKeyMsg, trackInfo) - if err != nil { - if errExt, ok := err.(*utils.ErrorWithCode); ok { - failedFoodList, _ = handleRetailBatchResultByRegexp(errExt.ErrMsg()) - } - } - return failedFoodList, err -} +//func (a *API) RetailSkuSellStatus(trackInfo, poiCode string, foodData []*BareStoreFoodInfo, sellStatus int) (failedFoodList []*AppFoodResult, err error) { +// _, err = a.AccessAPI2("retail/sku/sellStatus", false, map[string]interface{}{ +// KeyAppPoiCode: poiCode, +// "food_data": string(utils.MustMarshal(foodData)), +// "sell_status": sellStatus, +// }, resultKeyMsg, trackInfo) +// if err != nil { +// if errExt, ok := err.(*utils.ErrorWithCode); ok { +// failedFoodList, _ = handleRetailBatchResultByRegexp(errExt.ErrMsg()) +// } +// } +// return failedFoodList, err +//} // 此接口部分失败也返回成功,但错误消息格式(errorMsg, appFoodCode)与其它两个不一样 func (a *API) RetailSellStatus(trackInfo, poiCode string, foodData []*BareStoreFoodInfo, sellStatus int) (failedFoodList []*AppFoodResult, err error) { diff --git a/platformapi/mtwmapi/retail_test.go b/platformapi/mtwmapi/retail_test.go index 848cae17..1080a3e5 100644 --- a/platformapi/mtwmapi/retail_test.go +++ b/platformapi/mtwmapi/retail_test.go @@ -401,43 +401,6 @@ func TestRetailSkuStock(t *testing.T) { t.Log(utils.Format4Output(result, false)) } -func TestRetailSkuSellStatus(t *testing.T) { - result, err := api.RetailSkuSellStatus(utils.GetUUID(), testPoiCode, []*BareStoreFoodInfo{ - &BareStoreFoodInfo{ - AppFoodCode: "23841", - Skus: []*BareStoreSkuInfo{ - &BareStoreSkuInfo{ - SkuID: "23841", - //Price: "1.2", - Stock: "123", - }, - }, - }, - &BareStoreFoodInfo{ - AppFoodCode: "23840", - Skus: []*BareStoreSkuInfo{ - &BareStoreSkuInfo{ - SkuID: "23840", - Stock: "123", - }, - }, - }, - &BareStoreFoodInfo{ - AppFoodCode: "2384999", - Skus: []*BareStoreSkuInfo{ - &BareStoreSkuInfo{ - SkuID: "2384999", - Stock: "123", - }, - }, - }, - }, SellStatusOffline) - if err != nil { - t.Fatal(err) - } - t.Log(utils.Format4Output(result, false)) -} - func TestRetailSellStatus(t *testing.T) { result, err := api.RetailSellStatus(utils.GetUUID(), "17088914", []*BareStoreFoodInfo{ &BareStoreFoodInfo{