Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
C
chinafrica
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
zhengfg
chinafrica
Commits
02b9ad5a
提交
02b9ad5a
authored
3月 18, 2020
作者:
梁业锦
💬
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
- 商品导入相关逻辑
上级
b535bbfe
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
142 行增加
和
88 行删除
+142
-88
TbProductMissEntity.java
...rc/main/java/com/platform/entity/TbProductMissEntity.java
+11
-0
TbProductMissDao.xml
.../src/main/resources/com/platform/dao/TbProductMissDao.xml
+3
-1
ConcurrencyApi.java
platform-admin/src/main/test/java/test/ConcurrencyApi.java
+38
-0
ImpartCode.java
platform-admin/src/main/test/java/test/ImpartCode.java
+56
-71
RunningTest.java
platform-admin/src/main/test/java/test/RunningTest.java
+25
-0
TestApi.java
platform-admin/src/main/test/java/test/TestApi.java
+1
-8
Test.sql
platform-admin/src/main/test/sql/Test.sql
+8
-8
没有找到文件。
platform-admin/src/main/java/com/platform/entity/TbProductMissEntity.java
浏览文件 @
02b9ad5a
...
...
@@ -25,6 +25,9 @@ public class TbProductMissEntity implements Serializable {
* 失败类型【1:已存在】【2:出现了异常】
*/
private
Integer
missType
;
private
String
missReason
;
/**
* 页数(每250个)
*/
...
...
@@ -99,4 +102,12 @@ public class TbProductMissEntity implements Serializable {
public
Date
getCreateTime
()
{
return
createTime
;
}
public
String
getMissReason
()
{
return
missReason
;
}
public
void
setMissReason
(
String
missReason
)
{
this
.
missReason
=
missReason
;
}
}
platform-admin/src/main/resources/com/platform/dao/TbProductMissDao.xml
浏览文件 @
02b9ad5a
...
...
@@ -60,12 +60,14 @@
`id`,
`product_id`,
`miss_type`,
`miss_reason`,
`page_size`,
`create_time`)
values(
#{id},
#{productId},
#{missType},
#{missReason},
#{pageSize},
#{createTime})
</insert>
...
...
@@ -92,4 +94,4 @@
</foreach>
</delete>
</mapper>
\ No newline at end of file
</mapper>
platform-admin/src/main/test/java/test/ConcurrencyApi.java
0 → 100644
浏览文件 @
02b9ad5a
package
test
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.springframework.test.context.ContextConfiguration
;
import
org.springframework.test.context.junit4.SpringJUnit4ClassRunner
;
import
java.util.concurrent.*
;
/**
* 并发测试
*
* @author 爱酱油不爱醋
* @version 1.0
*/
@RunWith
(
SpringJUnit4ClassRunner
.
class
)
@ContextConfiguration
(
locations
=
{
"classpath*:/applicationContext-test.xml"
})
public
class
ConcurrencyApi
{
private
final
int
corePoolSize
=
15
;
private
final
int
maximumPoolSize
=
35
;
@Test
public
void
test
()
{
ExecutorService
executor
=
Executors
.
newCachedThreadPool
();
int
i
=
0
;
while
(
true
)
{
RunningTest
test
=
new
RunningTest
(
i
);
executor
.
submit
(
test
);
System
.
out
.
println
(
"正在执行的线程编号:"
+
i
);
i
++;
}
}
}
platform-admin/src/main/test/java/test/ImpartCode.java
浏览文件 @
02b9ad5a
差异被折叠。
点击展开。
platform-admin/src/main/test/java/test/RunningTest.java
0 → 100644
浏览文件 @
02b9ad5a
package
test
;
/**
* @author 爱酱油不爱醋
* @version 1.0
*/
public
class
RunningTest
implements
Runnable
{
private
int
taskNum
;
public
RunningTest
(
int
num
)
{
this
.
taskNum
=
num
;
}
@Override
public
void
run
()
{
System
.
out
.
println
(
"正在执行任务:"
+
taskNum
);
try
{
Thread
.
sleep
(
1000
);
}
catch
(
InterruptedException
e
)
{
e
.
printStackTrace
();
}
System
.
out
.
println
(
"执行完毕:"
+
taskNum
);
}
}
platform-admin/src/main/test/java/test/TestApi.java
浏览文件 @
02b9ad5a
...
...
@@ -67,7 +67,6 @@ public class TestApi {
*/
private
final
String
API_URL
=
"https://mollykitty.myshopify.com/admin/api/"
+
VERSION
+
"/products.json"
;
@Test
public
void
host
()
{
String
link
=
API_URL
+
"?limit=250&page_info=eyJwcm9kdWN0X3R5cGUiOiJXb21lbiIsImxhc3RfaWQiOjQ0OTc2Nzg5NTg2ODksImxhc3RfdmFsdWUiOiJDYXN1YWwgU2xpbSBTd2VhdGVycyIsImRpcmVjdGlvbiI6Im5leHQifQ"
;
...
...
@@ -720,12 +719,6 @@ public class TestApi {
return
output
.
toByteArray
();
}
public
static
void
main
(
String
[]
args
)
throws
Exception
{
String
link
=
"https://cdn.shopify.com/s/files/1/0079/8330/0705/products/0_-9_aee971dc-5661-46bb-9d7e-11f0a3ee5b35.jpg?v=1580133539"
;
InputStream
inputStream
=
getImageStream
(
link
);
byte
[]
bytes
=
toByteArray
(
inputStream
);
String
url
=
OssUtil
.
upload
(
bytes
,
IdUtil
.
simpleUUID
()
+
".jpg"
,
"zion"
);
System
.
out
.
println
(
url
);
}
}
platform-admin/src/main/test/sql/Test.sql
浏览文件 @
02b9ad5a
truncate
from
tb_category_template
;
DELETE
from
tb_cf_category
;
DELETE
from
tb_cf_goodstwotype
;
DELETE
from
tb_cf_goodstype
;
DELETE
from
tb_cf_item_desc
;
DELETE
from
tb_cf_item_skus
;
DELETE
from
tb_cf_option
;
DELETE
from
tb_cf_station_item
;
\ No newline at end of file
SELECT
count
(
*
)
FROM
tb_cf_station_item
WHERE
item_category
=
'2fe6be991b4941608c7ebcea7091288f'
;
SELECT
count
(
*
)
FROM
tb_cf_station_item
WHERE
item_category
=
'7c0d04650ad649fd9bf6b9476947c118'
;
SELECT
count
(
*
)
FROM
tb_cf_station_item
WHERE
item_category
=
'03f2d9ab2ea44893a27d54c280233c9f'
;
SELECT
count
(
*
)
FROM
tb_cf_station_item
WHERE
item_category
=
'59a9e2c64d2a4a1696a06045f39c0166'
;
SELECT
count
(
*
)
FROM
tb_cf_station_item
WHERE
item_category
=
'f0100ca392074027bb99da3a93625d63'
;
SELECT
count
(
*
)
FROM
tb_cf_station_item
WHERE
item_category
=
'a777a18b4fc4423082fa843231cfc7bc'
;
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论