From 49eba85de37c8125905afc23d9fe2c5e90c6737f Mon Sep 17 00:00:00 2001 From: DU Date: Mon, 1 Mar 2021 17:36:05 +0800 Subject: [PATCH 01/14] =?UTF-8?q?=E4=B8=8B=E6=9E=B6=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E4=B8=8D=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/club/joylink/rtss/services/MapSystemService.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/club/joylink/rtss/services/MapSystemService.java b/src/main/java/club/joylink/rtss/services/MapSystemService.java index 1dd77b69f..89808cd44 100644 --- a/src/main/java/club/joylink/rtss/services/MapSystemService.java +++ b/src/main/java/club/joylink/rtss/services/MapSystemService.java @@ -232,12 +232,12 @@ public class MapSystemService implements IMapSystemService { } - //默认课程展示 // BusinessConsts.Lesson.PrdInfo prdInfo = BusinessConsts.Lesson.PrdInfo.getBy(mapSystem.getPrdType()); // if (Objects.nonNull(prdInfo)) { // String defaultLessonName = String.join("-", mapVO.getName(), prdInfo.getName()); - LessonVO existedDefaultLesson = iLessonService.findSysFaultByMapAndPrdType(mapSystem.getMapId(), mapSystem.getPrdType()); - if (Objects.nonNull(existedDefaultLesson)) { + //默认课程展示 + LessonVO existedDefaultLesson = iLessonService.findSysFaultByMapAndPrdType(mapSystem.getMapId(), mapSystem.getPrdType()); + if (Objects.nonNull(existedDefaultLesson) && Objects.equals(MapStatus.Online.getCode(),existedDefaultLesson.getStatus())) { if (lessonVOList.stream().noneMatch(lessonVO -> lessonVO.getId().equals(existedDefaultLesson.getId()))) { // existedDefaultLesson.setSystemFault(true); lessonVOList.add(existedDefaultLesson); From cf9481b89e85cb9b9d46749975c8e4146d3293f4 Mon Sep 17 00:00:00 2001 From: joylink_zhangsai <1021828630@qq.com> Date: Wed, 3 Mar 2021 21:30:38 +0800 Subject: [PATCH 02/14] =?UTF-8?q?=E9=92=88=E5=AF=B9=E6=88=90=E5=B7=A5?= =?UTF-8?q?=E9=99=A2=E4=BF=AE=E6=94=B9=E7=95=99=E8=A8=80=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sql/20210303-zhangsai.sql | 9 + .../joylink/rtss/configuration/WebConfig.java | 5 + .../rtss/controller/LearnController.java | 26 +++ .../joylink/rtss/dao/LearnMessageDAO.java | 36 +--- .../joylink/rtss/entity/LearnComment.java | 20 +- .../rtss/entity/LearnCommentExample.java | 70 +++++++ .../joylink/rtss/entity/LearnMessage.java | 52 ++++- .../rtss/entity/LearnMessageExample.java | 190 ++++++++++++++++++ .../rtss/entity/LearnMessageWithBLOBs.java | 89 -------- .../joylink/rtss/services/ILearnService.java | 20 ++ .../joylink/rtss/services/LearnService.java | 63 +++++- .../vo/client/learn/LearnCommentUpdateVO.java | 25 +++ .../rtss/vo/client/learn/LearnCommentVO.java | 5 +- .../rtss/vo/client/learn/LearnCreateVO.java | 2 + .../vo/client/learn/LearnMessageUpdateVO.java | 23 +++ .../vo/client/post/LearnMessageCreateVO.java | 8 +- .../rtss/vo/client/post/LearnMessageVO.java | 7 +- .../mybatis/mapper/LearnCommentDAO.xml | 28 ++- .../mybatis/mapper/LearnMessageDAO.xml | 144 +++++-------- 19 files changed, 588 insertions(+), 234 deletions(-) create mode 100644 sql/20210303-zhangsai.sql delete mode 100644 src/main/java/club/joylink/rtss/entity/LearnMessageWithBLOBs.java create mode 100644 src/main/java/club/joylink/rtss/vo/client/learn/LearnCommentUpdateVO.java create mode 100644 src/main/java/club/joylink/rtss/vo/client/learn/LearnMessageUpdateVO.java diff --git a/sql/20210303-zhangsai.sql b/sql/20210303-zhangsai.sql new file mode 100644 index 000000000..af7422c41 --- /dev/null +++ b/sql/20210303-zhangsai.sql @@ -0,0 +1,9 @@ +alter table learn_comment + add user_name varchar(32) null comment '给成都工业临时加的'; + +alter table learn_message + add user_name varchar(32) null comment '给成都工业临时加的'; + +alter table learn_message modify creator_id bigint null comment '留言者'; + +alter table learn_comment modify creator_id bigint null comment '创建者'; diff --git a/src/main/java/club/joylink/rtss/configuration/WebConfig.java b/src/main/java/club/joylink/rtss/configuration/WebConfig.java index dc1352c35..3ced4ff1b 100644 --- a/src/main/java/club/joylink/rtss/configuration/WebConfig.java +++ b/src/main/java/club/joylink/rtss/configuration/WebConfig.java @@ -50,6 +50,11 @@ public class WebConfig implements WebMvcConfigurer { whiteList.add("/api/license/local"); // 微信回调接口 whiteList.add("/api/wechatPay/receive"); + // 成都工业留言板 + whiteList.add("/api/learn/cgy/message/create"); + whiteList.add("/api/learn/cgy/{messageId}/comment"); + whiteList.add("/api/learn/{postId}/message/pagedQuery/postId"); + whiteList.add("/api/learn/{messageId}/comment"); registry.addInterceptor(authenticateInterceptor).excludePathPatterns(whiteList); } diff --git a/src/main/java/club/joylink/rtss/controller/LearnController.java b/src/main/java/club/joylink/rtss/controller/LearnController.java index 994da8c9b..982a470f2 100644 --- a/src/main/java/club/joylink/rtss/controller/LearnController.java +++ b/src/main/java/club/joylink/rtss/controller/LearnController.java @@ -91,6 +91,12 @@ public class LearnController { return iLearnService.createMessage(messageCreateVO, user); } + @ApiOperation("成工院留言") + @PostMapping("/cgy/message/create") + public long cgyCreateMessage(@RequestBody @Validated LearnMessageCreateVO messageCreateVO) { + return iLearnService.cgyCreateMessage(messageCreateVO); + } + @ApiOperation("分页查询留言") @GetMapping("/{postId}/message/pagedQuery/postId") public PageVO pagedQueryMessageByPostId(@PathVariable Long postId, LearnMessagePagedQueryVO queryVO) { @@ -149,6 +155,13 @@ public class LearnController { iLearnService.addComment(messageId, commentCreateVO, user); } + @ApiOperation(value = "成工院评论") + @PostMapping(path = "/cgy/{messageId}/comment") + public void cygComment(@PathVariable Long messageId, + @RequestBody @Validated(value = LearnCommentCreateCheck.class) LearnCreateVO commentCreateVO) { + iLearnService.cgyAddComment(messageId, commentCreateVO); + } + @ApiOperation(value = "回复") @PostMapping(path = "/{messageId}/{commentId}/comment") public void comment(@PathVariable Long messageId, @PathVariable Long commentId, @@ -187,4 +200,17 @@ public class LearnController { iLearnService.userDeleteComment(commentId, user); } + //----------------------------------------- 改数据 ----------------------------------------- + @ApiOperation(value = "管理员修改留言数据") + @DeleteMapping(path = "/admin/update/message") + public void adminUpdateMessage(LearnMessageUpdateVO messageUpdateVO) { + iLearnService.adminUpdateMessage(messageUpdateVO); + } + + @ApiOperation(value = "管理员修改评论数据") + @DeleteMapping(path = "/admin/update/comment") + public void adminUpdateComment(LearnCommentUpdateVO commentUpdateVO) { + iLearnService.adminUpdateComment(commentUpdateVO); + } + } diff --git a/src/main/java/club/joylink/rtss/dao/LearnMessageDAO.java b/src/main/java/club/joylink/rtss/dao/LearnMessageDAO.java index 4621698f0..9b20db6f1 100644 --- a/src/main/java/club/joylink/rtss/dao/LearnMessageDAO.java +++ b/src/main/java/club/joylink/rtss/dao/LearnMessageDAO.java @@ -2,45 +2,18 @@ package club.joylink.rtss.dao; import club.joylink.rtss.entity.LearnMessage; import club.joylink.rtss.entity.LearnMessageExample; -import club.joylink.rtss.entity.LearnMessageWithBLOBs; import club.joylink.rtss.vo.client.post.LearnMessagePagedQueryVO; import club.joylink.rtss.vo.client.post.LearnMessageVO; -import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; import org.springframework.stereotype.Repository; import java.util.List; +/** + * LearnMessageDAO继承基类 + */ @Repository -public interface LearnMessageDAO { - long countByExample(LearnMessageExample example); - - int deleteByExample(LearnMessageExample example); - - int deleteByPrimaryKey(Long id); - - int insert(LearnMessageWithBLOBs record); - - int insertSelective(LearnMessageWithBLOBs record); - - List selectByExampleWithBLOBs(LearnMessageExample example); - - List selectByExample(LearnMessageExample example); - - LearnMessageWithBLOBs selectByPrimaryKey(Long id); - - int updateByExampleSelective(@Param("record") LearnMessageWithBLOBs record, @Param("example") LearnMessageExample example); - - int updateByExampleWithBLOBs(@Param("record") LearnMessageWithBLOBs record, @Param("example") LearnMessageExample example); - - int updateByExample(@Param("record") LearnMessage record, @Param("example") LearnMessageExample example); - - int updateByPrimaryKeySelective(LearnMessageWithBLOBs record); - - int updateByPrimaryKeyWithBLOBs(LearnMessageWithBLOBs record); - - int updateByPrimaryKey(LearnMessage record); - +public interface LearnMessageDAO extends MyBatisBaseDao { @Select("