From 73eb30fd1f274d3a562ced2ab9f6a8eff0337820 Mon Sep 17 00:00:00 2001 From: yinzuomei Date: Mon, 10 Feb 2020 13:07:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=80=E7=83=AD=E8=AF=9D=E9=A2=98=E3=80=81?= =?UTF-8?q?=E6=9C=80=E6=96=B0=E8=AF=9D=E9=A2=98=E5=90=8E=E5=8F=B0=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E5=88=97=E8=A1=A8=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../esua/epdc/dto/result/TopicResultDTO.java | 86 ++++++++++++++++++ .../topic/controller/TopicController.java | 71 +++++++++++++++ .../esua/epdc/modules/topic/dao/TopicDao.java | 53 +++++++++++ .../modules/topic/service/TopicService.java | 49 ++++++++++ .../topic/service/impl/TopicServiceImpl.java | 59 ++++++++++++ .../main/resources/mapper/topic/TopicDao.xml | 90 +++++++++++++++++++ 6 files changed, 408 insertions(+) create mode 100644 esua-epdc/epdc-module/epdc-analysis/epdc-analysis-client/src/main/java/com/elink/esua/epdc/dto/result/TopicResultDTO.java create mode 100644 esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/topic/controller/TopicController.java create mode 100644 esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/topic/dao/TopicDao.java create mode 100644 esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/topic/service/TopicService.java create mode 100644 esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/topic/service/impl/TopicServiceImpl.java create mode 100644 esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/mapper/topic/TopicDao.xml diff --git a/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-client/src/main/java/com/elink/esua/epdc/dto/result/TopicResultDTO.java b/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-client/src/main/java/com/elink/esua/epdc/dto/result/TopicResultDTO.java new file mode 100644 index 000000000..403e69207 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-client/src/main/java/com/elink/esua/epdc/dto/result/TopicResultDTO.java @@ -0,0 +1,86 @@ +package com.elink.esua.epdc.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * @Description 最热话题列表DTO + * @Author yinzuomei + * @Date 2020/2/10 11:31 + */ +@Data +public class TopicResultDTO implements Serializable { + private static final long serialVersionUID = -1938141144074477454L; + + /** + * 主键 + */ + private String id; + + /** + * 话题摘要 + */ + private String topicContent; + + /** + * 父所有部门ID + */ + private String parentDeptIds; + + /** + * 父所有部门 + */ + private String parentDeptNames; + + /** + * 所有部门ID + */ + private String allDeptIds; + + /** + * 所有部门 + */ + private String allDeptNames; + + /** + * 网格 + */ + private String grid; + + /** + * 网格ID + */ + private Long gridId; + + /** + * 网格来源群名称 + */ + private String groupName; + + /** + * 话题发布人姓名 + */ + private String nickname; + + /** + * 发布时间 + */ + private Date releaseTime; + + /** + * 评论数(评论+回复) + */ + private Integer commentNum; + + /** + * 浏览数 + */ + private Integer browseNum; + + /** + * 表达态度(评论+回复+浏览) + */ + private Integer expressAttitudeNum; +} diff --git a/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/topic/controller/TopicController.java b/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/topic/controller/TopicController.java new file mode 100644 index 000000000..bd460ce39 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/topic/controller/TopicController.java @@ -0,0 +1,71 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.topic.controller; + +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.result.TopicResultDTO; +import com.elink.esua.epdc.modules.topic.service.TopicService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import java.util.Map; + + +/** + * 话题相关接口 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-10-10 + */ +@RestController +@RequestMapping("topic") +public class TopicController { + + @Autowired + private TopicService topicService; + + /** + * @param params + * @return com.elink.esua.epdc.dto.result.TopicResultDTO + * @Author yinzuomei + * @Description 最热话题列表查询 + * @Date 2020/2/10 11:34 + **/ + @GetMapping("pageHottestTopic") + public Result> pageHottestTopic(@RequestParam Map params) { + PageData page = topicService.listHottestTopic(params); + return new Result>().ok(page); + } + + /** + * @param params + * @return com.elink.esua.epdc.dto.result.TopicResultDTO + * @Author yinzuomei + * @Description 最新话题列表查询 + * @Date 2020/2/10 12:50 + **/ + @GetMapping("pageLatestTopic") + public Result> pageLatestTopic(@RequestParam Map params) { + PageData page = topicService.listLatestTopic(params); + return new Result>().ok(page); + } +} diff --git a/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/topic/dao/TopicDao.java b/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/topic/dao/TopicDao.java new file mode 100644 index 000000000..82e91535b --- /dev/null +++ b/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/topic/dao/TopicDao.java @@ -0,0 +1,53 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.topic.dao; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.elink.esua.epdc.dto.result.TopicResultDTO; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; +import java.util.Map; + +/** + * 话题表 话题表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-10-10 + */ +@Mapper +public interface TopicDao extends BaseMapper { + + /** + * @param params + * @return java.util.List + * @Author yinzuomei + * @Description 最热话题列表查询 + * @Date 2020/2/10 11:52 + **/ + List selectListHottestTopicDTO(Map params); + + /** + * @param params + * @return java.util.List + * @Author yinzuomei + * @Description 最新话题列表查询 + * @Date 2020/2/10 12:51 + **/ + List selectListLatesttTopicDTO(Map params); +} diff --git a/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/topic/service/TopicService.java b/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/topic/service/TopicService.java new file mode 100644 index 000000000..1743f20e3 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/topic/service/TopicService.java @@ -0,0 +1,49 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.topic.service; + +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.dto.result.TopicResultDTO; + +import java.util.Map; + +/** + * 话题相关Service + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-10-10 + */ +public interface TopicService { + /** + * @param params + * @return com.elink.esua.epdc.dto.result.TopicResultDTO + * @Author yinzuomei + * @Description 最热话题列表查询 + * @Date 2020/2/10 11:34 + **/ + PageData listHottestTopic(Map params); + + /** + * @param params + * @return com.elink.esua.epdc.commons.tools.page.PageData + * @Author yinzuomei + * @Description 最新话题列表查询 + * @Date 2020/2/10 12:50 + **/ + PageData listLatestTopic(Map params); +} diff --git a/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/topic/service/impl/TopicServiceImpl.java b/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/topic/service/impl/TopicServiceImpl.java new file mode 100644 index 000000000..552826f03 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/topic/service/impl/TopicServiceImpl.java @@ -0,0 +1,59 @@ +package com.elink.esua.epdc.modules.topic.service.impl; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.datasources.DataSourceNames; +import com.elink.esua.epdc.datasources.annotation.DataSource; +import com.elink.esua.epdc.dto.result.TopicResultDTO; +import com.elink.esua.epdc.modules.topic.dao.TopicDao; +import com.elink.esua.epdc.modules.topic.service.TopicService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.Map; + +/** + * @Description 话题相关Service + * @Author yinzuomei + * @Date 2020/2/10 10:56 + */ +@Service +public class TopicServiceImpl extends BaseServiceImpl implements TopicService { + @Autowired + private TopicDao topicDao; + + /** + * @param params + * @return com.elink.esua.epdc.dto.result.HottestTopicResultDTO + * @Author yinzuomei + * @Description 最热话题列表查询 + * @Date 2020/2/10 12:53 + **/ + @DataSource(name = DataSourceNames.FIFTH) + @Override + public PageData listHottestTopic(Map params) { + + IPage page = getPage(params); + List list = topicDao.selectListHottestTopicDTO(params); + return new PageData<>(list, page.getTotal()); + } + + /** + * @param params + * @return com.elink.esua.epdc.dto.result.LatestTopicResultDTO + * @Author yinzuomei + * @Description 最新话题列表查询 + * @Date 2020/2/10 12:53 + **/ + @DataSource(name = DataSourceNames.FIFTH) + @Override + public PageData listLatestTopic(Map params) { + IPage page = getPage(params); + List list = topicDao.selectListLatesttTopicDTO(params); + return new PageData<>(list, page.getTotal()); + } + + +} diff --git a/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/mapper/topic/TopicDao.xml b/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/mapper/topic/TopicDao.xml new file mode 100644 index 000000000..4bcecb528 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/mapper/topic/TopicDao.xml @@ -0,0 +1,90 @@ + + + + + + + + + +