Skip to content

Commit 3548679

Browse files
author
suyc
committed
add image path
1 parent bd5285b commit 3548679

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

dss-guide/dss-guide-server/src/main/java/com/webank/wedatasphere/dss/guide/server/dao/GuideChapterMapper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ public interface GuideChapterMapper extends BaseMapper<GuideChapter> {
2020
@Select("SELECT * FROM dss_guide_chapter WHERE is_delete =0 AND catalog_id =#{catalogId} ORDER BY id ASC")
2121
List<GuideChapter> queryGuideChapterListByCatalogId(@Param("catalogId") Long catalogId);
2222

23-
@Select("SELECT * FROM dss_guide_chapter WHERE is_delete =0 AND content LIKE CONCAT('%', #{keyword}, '%') ORDER BY id ASC")
23+
@Select("SELECT * FROM dss_guide_chapter WHERE is_delete =0 AND (content LIKE CONCAT('%', #{keyword}, '%') OR title LIKE CONCAT('%', #{keyword}, '%')) ORDER BY id ASC")
2424
List<GuideChapter> searchGuideChapterListByKeyword(@Param("keyword") String keyword);
2525
}

dss-guide/dss-guide-server/src/main/java/com/webank/wedatasphere/dss/guide/server/dao/impl/GuideGroupMapper.xml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,11 @@
5858
b.title_alias AS children_title_alias,
5959
b.seq AS children_seq,
6060
b.type AS children_type,
61-
b.content_html AS children_content_html
61+
b.content_html AS children_content_html,
62+
b.create_by AS children_create_by,
63+
b.create_time AS children_create_time,
64+
b.update_by AS children_update_by,
65+
b.update_time AS children_update_time
6266
FROM dss_guide_group a
6367
LEFT JOIN (SELECT * FROM dss_guide_content WHERE is_delete =0) b ON a.id = b.group_id
6468
WHERE a.is_delete =0 AND a.path = #{path}

dss-guide/dss-guide-server/src/main/java/com/webank/wedatasphere/dss/guide/server/restful/KnowledgeGuideAdminRestful.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,9 @@ public class KnowledgeGuideAdminRestful {
5050
@RequestMapping(path ="/guidecatalog", method = RequestMethod.POST)
5151
public Message saveGuideCatalog(HttpServletRequest request, @RequestBody GuideCatalog guideCatalog){
5252
String userName = SecurityFilter.getLoginUsername(request);
53-
if(guideCatalog.getId() ==null) {
53+
if(null == guideCatalog.getId()) {
5454
guideCatalog.setCreateBy(userName);
5555
guideCatalog.setCreateTime(new Date(System.currentTimeMillis()));
56-
guideCatalog.setUpdateTime(new Date(System.currentTimeMillis()));
5756
}
5857
else{
5958
guideCatalog.setUpdateBy(userName);
@@ -93,10 +92,9 @@ public Message queryGuideCatalogDetailById(@PathVariable Long id){
9392
@RequestMapping(path ="/guidechapter", method = RequestMethod.POST)
9493
public Message saveGuideChapter(HttpServletRequest request, @RequestBody GuideChapter guideChapter){
9594
String userName = SecurityFilter.getLoginUsername(request);
96-
if(guideChapter.getId() ==null) {
95+
if(null == guideChapter.getId()) {
9796
guideChapter.setCreateBy(userName);
9897
guideChapter.setCreateTime(new Date(System.currentTimeMillis()));
99-
guideChapter.setUpdateTime(new Date(System.currentTimeMillis()));
10098
}
10199
else{
102100
guideChapter.setUpdateBy(userName);
@@ -148,7 +146,7 @@ public Message multFileUpload(@RequestParam(required = true) List<MultipartFile>
148146
//获取文件后缀名
149147
String suffixName = fileName.substring(fileName.lastIndexOf("."));
150148
//重新生成文件名
151-
fileName = UUID.randomUUID() + suffixName;
149+
fileName = "knowledge-" + UUID.randomUUID() + suffixName;
152150
if (FileUtils.upload(file, localPath, fileName)) {
153151
String relativePath =fileName;
154152
result.put("relativePath",relativePath);

dss-guide/dss-guide-server/src/main/java/com/webank/wedatasphere/dss/guide/server/restful/PageGuideAdminRestful.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,9 @@ public class PageGuideAdminRestful {
4646
@RequestMapping(path ="/guidegroup", method = RequestMethod.POST)
4747
public Message saveGuideGroup(HttpServletRequest request, @RequestBody GuideGroup guideGroup){
4848
String userName = SecurityFilter.getLoginUsername(request);
49-
if(guideGroup.getId() ==null) {
49+
if(null == guideGroup.getId()) {
5050
guideGroup.setCreateBy(userName);
5151
guideGroup.setCreateTime(new Date(System.currentTimeMillis()));
52-
guideGroup.setUpdateTime(new Date(System.currentTimeMillis()));
5352
}
5453
else{
5554
guideGroup.setUpdateBy(userName);
@@ -79,10 +78,9 @@ public Message deleteGuideGroup(@PathVariable Long id) {
7978
@RequestMapping(path ="/guidecontent", method = RequestMethod.POST)
8079
public Message saveGuideContent(HttpServletRequest request, @RequestBody GuideContent guideConent){
8180
String userName = SecurityFilter.getLoginUsername(request);
82-
if(guideConent.getId() ==null) {
81+
if(null == guideConent.getId()) {
8382
guideConent.setCreateBy(userName);
8483
guideConent.setCreateTime(new Date(System.currentTimeMillis()));
85-
guideConent.setUpdateTime(new Date(System.currentTimeMillis()));
8684
}
8785
else{
8886
guideConent.setUpdateBy(userName);
@@ -151,7 +149,7 @@ public Message multFileUpload(@RequestParam(required = true) List<MultipartFile>
151149
//获取文件后缀名
152150
String suffixName = fileName.substring(fileName.lastIndexOf("."));
153151
//重新生成文件名
154-
fileName = UUID.randomUUID() + suffixName;
152+
fileName = "page-" + UUID.randomUUID() + suffixName;
155153
if (FileUtils.upload(file, localPath, fileName)) {
156154
String relativePath =fileName;
157155
result.put("relativePath",relativePath);

0 commit comments

Comments
 (0)