Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pms-ci-test
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
test-ci
pms-ci-test
Commits
c40fbf42
提交
c40fbf42
authored
6月 15, 2023
作者:
panda
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
删除多余System.out.println
上级
5cf48e37
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
15 行增加
和
11 行删除
+15
-11
UploadController.java
src/main/java/com/mmc/pms/controller/UploadController.java
+12
-10
CategoriesServiceImpl.java
.../java/com/mmc/pms/service/Impl/CategoriesServiceImpl.java
+3
-1
没有找到文件。
src/main/java/com/mmc/pms/controller/UploadController.java
浏览文件 @
c40fbf42
...
...
@@ -18,6 +18,7 @@ import io.swagger.annotations.Api;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
import
springfox.documentation.annotations.ApiIgnore
;
...
...
@@ -36,6 +37,7 @@ import java.util.*;
@Api
(
tags
=
{
"上传文件"
})
@RestController
@RequestMapping
(
"/upload"
)
@Slf4j
public
class
UploadController
{
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy/MM/dd/"
);
...
...
@@ -174,7 +176,7 @@ public class UploadController {
.
build
(
OssConstant
.
ENDPOINT
,
OssConstant
.
ACCESSKEYID
,
OssConstant
.
ACCESSKEYSECRET
);
List
list
=
new
LinkedList
();
if
(
uploadFile
!=
null
&&
uploadFile
.
length
>
0
)
{
System
.
out
.
println
(
"osses文件数量"
+
uploadFile
.
length
);
log
.
info
(
"osses文件数量"
+
uploadFile
.
length
);
for
(
int
i
=
0
;
i
<
uploadFile
.
length
;
i
++)
{
MultipartFile
file
=
uploadFile
[
i
];
InputStream
inputStream
=
null
;
...
...
@@ -236,7 +238,7 @@ public class UploadController {
clientBuilderConfiguration
);
List
list
=
new
LinkedList
();
if
(
uploadFile
!=
null
&&
uploadFile
.
length
>
0
)
{
System
.
out
.
println
(
"osses文件数量"
+
uploadFile
.
length
);
log
.
info
(
"osses文件数量"
+
uploadFile
.
length
);
for
(
int
i
=
0
;
i
<
uploadFile
.
length
;
i
++)
{
MultipartFile
file
=
uploadFile
[
i
];
InputStream
inputStream
=
null
;
...
...
@@ -257,7 +259,7 @@ public class UploadController {
+
UUID
.
randomUUID
().
toString
()
+
oldName
.
substring
(
oldName
.
lastIndexOf
(
"."
),
oldName
.
length
());
ossClient
.
putObject
(
OssConstant
.
BUCKET
,
newName
,
bis
);
System
.
out
.
println
(
"视频名称:"
+
newName
);
log
.
info
(
"视频名称:"
+
newName
);
list
.
add
(
"https://"
+
OssConstant
.
BUCKET
+
'.'
+
OssConstant
.
ENDPOINT
+
"/"
+
newName
);
}
}
...
...
@@ -300,7 +302,7 @@ public class UploadController {
clientBuilderConfiguration
);
Map
map
=
new
HashMap
();
if
(
uploadFile
!=
null
&&
uploadFile
.
length
>
0
)
{
System
.
out
.
println
(
"osses文件数量"
+
uploadFile
.
length
);
log
.
info
(
"osses文件数量"
+
uploadFile
.
length
);
for
(
int
i
=
0
;
i
<
uploadFile
.
length
;
i
++)
{
MultipartFile
file
=
uploadFile
[
i
];
InputStream
inputStream
=
null
;
...
...
@@ -321,7 +323,7 @@ public class UploadController {
+
UUID
.
randomUUID
().
toString
()
+
oldName
.
substring
(
oldName
.
lastIndexOf
(
"."
),
oldName
.
length
());
ossClient
.
putObject
(
OssConstant
.
BUCKET
,
newName
,
bis
);
System
.
out
.
println
(
"视频名称:"
+
newName
);
log
.
info
(
"视频名称:"
+
newName
);
map
.
put
(
"filePath"
,
"https://"
+
OssConstant
.
BUCKET
+
'.'
+
OssConstant
.
ENDPOINT
+
"/"
+
newName
);
...
...
@@ -360,7 +362,7 @@ public class UploadController {
.
build
(
OssConstant
.
ENDPOINT
,
OssConstant
.
ACCESSKEYID
,
OssConstant
.
ACCESSKEYSECRET
);
List
list
=
new
LinkedList
();
if
(
uploadFile
!=
null
&&
uploadFile
.
length
>
0
)
{
System
.
out
.
println
(
"osses文件数量"
+
uploadFile
.
length
);
log
.
info
(
"osses文件数量"
+
uploadFile
.
length
);
for
(
int
i
=
0
;
i
<
uploadFile
.
length
;
i
++)
{
MultipartFile
file
=
uploadFile
[
i
];
InputStream
inputStream
=
null
;
...
...
@@ -382,7 +384,7 @@ public class UploadController {
+
UUID
.
randomUUID
().
toString
()
+
oldName
.
substring
(
oldName
.
lastIndexOf
(
"."
),
oldName
.
length
());
ossClient
.
putObject
(
OssConstant
.
BUCKET
,
newName
,
bis
);
System
.
out
.
println
(
"图片名称:"
+
newName
);
log
.
info
(
"图片名称:"
+
newName
);
list
.
add
(
"https://"
+
OssConstant
.
BUCKET
+
'.'
+
OssConstant
.
ENDPOINT
+
"/"
+
newName
);
}
}
...
...
@@ -438,7 +440,7 @@ public class UploadController {
+
UUID
.
randomUUID
().
toString
()
+
oldName
.
substring
(
oldName
.
lastIndexOf
(
"."
),
oldName
.
length
());
ossClient
.
putObject
(
OssConstant
.
BUCKET
,
newName
,
bis
);
System
.
out
.
println
(
"图片名称:"
+
newName
);
log
.
info
(
"图片名称:"
+
newName
);
list
.
add
(
"https://"
+
OssConstant
.
BUCKET
+
'.'
+
OssConstant
.
ENDPOINT
+
"/"
+
newName
);
}
}
...
...
@@ -471,7 +473,7 @@ public class UploadController {
.
build
(
OssConstant
.
ENDPOINT
,
OssConstant
.
ACCESSKEYID
,
OssConstant
.
ACCESSKEYSECRET
);
Map
map
=
new
HashMap
();
if
(
uploadFile
!=
null
&&
uploadFile
.
length
>
0
)
{
System
.
out
.
println
(
"osses文件数量"
+
uploadFile
.
length
);
log
.
info
(
"osses文件数量"
+
uploadFile
.
length
);
for
(
int
i
=
0
;
i
<
uploadFile
.
length
;
i
++)
{
MultipartFile
file
=
uploadFile
[
i
];
InputStream
inputStream
=
null
;
...
...
@@ -493,7 +495,7 @@ public class UploadController {
+
UUID
.
randomUUID
().
toString
()
+
oldName
.
substring
(
oldName
.
lastIndexOf
(
"."
),
oldName
.
length
());
ossClient
.
putObject
(
OssConstant
.
BUCKET
,
newName
,
bis
);
System
.
out
.
println
(
"图片名称:"
+
newName
);
log
.
info
(
"图片名称:"
+
newName
);
map
.
put
(
"filePath"
,
"https://"
+
OssConstant
.
BUCKET
+
'.'
+
OssConstant
.
ENDPOINT
+
"/"
+
newName
);
...
...
src/main/java/com/mmc/pms/service/Impl/CategoriesServiceImpl.java
浏览文件 @
c40fbf42
...
...
@@ -22,6 +22,7 @@ import com.mmc.pms.model.sale.vo.QueryClassifyVO;
import
com.mmc.pms.page.PageResult
;
import
com.mmc.pms.service.BackstageTaskService
;
import
com.mmc.pms.service.CategoriesService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -38,6 +39,7 @@ import java.util.stream.Collectors;
* @createDate 2023-05-24 10:29:28
*/
@Service
@Slf4j
public
class
CategoriesServiceImpl
implements
CategoriesService
{
@Autowired
private
CategoriesDao
categoriesDao
;
@Resource
private
GoodsInfoDao
goodsInfoDao
;
...
...
@@ -252,7 +254,7 @@ public class CategoriesServiceImpl implements CategoriesService {
.
collect
(
Collectors
.
toList
());
Map
<
Integer
,
List
<
CategoriesInfoListDTO
>>
categoryMap
=
getCategoryMap
(
allCategoryDTOList
);
addSubCategories
(
allCategoryDTOList
,
categoryMap
);
System
.
out
.
println
(
"Res: "
+
JSONObject
.
toJSON
(
allCategoryDTOList
));
log
.
info
(
"Res: "
+
JSONObject
.
toJSON
(
allCategoryDTOList
));
return
allCategoryDTOList
;
}
return
null
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论