From c1ddc53854525e93ce7fc4f92dac62ba29df7242 Mon Sep 17 00:00:00 2001 From: yujt Date: Wed, 27 May 2020 14:08:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E9=97=BB=E7=9B=B8=E5=85=B3=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epdc/controller/ApiPropertyController.java | 4 ++-- .../elink/esua/epdc/feign/NewsFeignClient.java | 15 +-------------- .../feign/fallback/NewsFeignClientFallback.java | 5 ----- .../elink/esua/epdc/service/PropertyService.java | 6 +++--- .../esua/epdc/service/impl/NewsServiceImpl.java | 1 - .../epdc/service/impl/PropertyServiceImpl.java | 13 +++---------- 6 files changed, 9 insertions(+), 35 deletions(-) diff --git a/epdc-cloud-api/src/main/java/com/elink/esua/epdc/controller/ApiPropertyController.java b/epdc-cloud-api/src/main/java/com/elink/esua/epdc/controller/ApiPropertyController.java index 4ef762f..eb8934f 100644 --- a/epdc-cloud-api/src/main/java/com/elink/esua/epdc/controller/ApiPropertyController.java +++ b/epdc-cloud-api/src/main/java/com/elink/esua/epdc/controller/ApiPropertyController.java @@ -8,7 +8,7 @@ import com.elink.esua.epdc.dto.comment.TopicCommentFormDTO; import com.elink.esua.epdc.dto.comment.TopicCommentStatementFormDTO; import com.elink.esua.epdc.dto.comment.TopicCommentsFormDTO; import com.elink.esua.epdc.dto.comment.result.EventCommentsResultDTO; -import com.elink.esua.epdc.dto.epdc.form.EpdcBannerListByCategoryFromDTO; +import com.elink.esua.epdc.dto.epdc.form.EpdcBannerListFromDTO; import com.elink.esua.epdc.dto.epdc.form.EpdcNewsListByCategoryFromDTO; import com.elink.esua.epdc.dto.epdc.form.EpdcUserGroupInviteFormDTO; import com.elink.esua.epdc.dto.epdc.result.EpdcBannerListResultDTO; @@ -352,7 +352,7 @@ public class ApiPropertyController { * @date 2020/5/25 09:17 */ @GetMapping("safety/bannerList") - public Result> listBnnerByCategory(@LoginUser TokenDto userDetail, EpdcBannerListByCategoryFromDTO formDto) { + public Result> listBnnerByCategory(@LoginUser TokenDto userDetail, EpdcBannerListFromDTO formDto) { return propertyService.listBnnerByCategory(userDetail, formDto); } } diff --git a/epdc-cloud-api/src/main/java/com/elink/esua/epdc/feign/NewsFeignClient.java b/epdc-cloud-api/src/main/java/com/elink/esua/epdc/feign/NewsFeignClient.java index 6b1e4fe..0c758b5 100644 --- a/epdc-cloud-api/src/main/java/com/elink/esua/epdc/feign/NewsFeignClient.java +++ b/epdc-cloud-api/src/main/java/com/elink/esua/epdc/feign/NewsFeignClient.java @@ -153,22 +153,9 @@ public interface NewsFeignClient { * @author qushutong * @date 2019/9/11 9:25 */ - @GetMapping(value = "news/epdc-app/news/list", consumes = MediaType.APPLICATION_JSON_VALUE) + @GetMapping(value = "news/epdc-app/news/listBanner", consumes = MediaType.APPLICATION_JSON_VALUE) Result> listBanner(@RequestBody EpdcBannerListFromDTO fromDTO); - - /** - * 根据新闻类别获取banner列表 - * - * @param formDto - * @return com.elink.esua.epdc.commons.tools.utils.Result> - * @author work@yujt.net.cn - * @date 2020/5/25 09:14 - */ - @GetMapping(value = "news/epdc-app/news/listBannerByCategory", consumes = MediaType.APPLICATION_JSON_VALUE) - Result> listBannerByCategory(@RequestBody EpdcBannerListByCategoryFromDTO formDto); - - /*** * 获取第一条通知消息 * @param userId diff --git a/epdc-cloud-api/src/main/java/com/elink/esua/epdc/feign/fallback/NewsFeignClientFallback.java b/epdc-cloud-api/src/main/java/com/elink/esua/epdc/feign/fallback/NewsFeignClientFallback.java index 68b3670..1b70624 100644 --- a/epdc-cloud-api/src/main/java/com/elink/esua/epdc/feign/fallback/NewsFeignClientFallback.java +++ b/epdc-cloud-api/src/main/java/com/elink/esua/epdc/feign/fallback/NewsFeignClientFallback.java @@ -43,11 +43,6 @@ public class NewsFeignClientFallback implements NewsFeignClient { return ModuleUtils.feignConError(ServiceConstant.EPDC_NEWS_SERVER, "listNewsByCategory", formDto); } - @Override - public Result> listBannerByCategory(EpdcBannerListByCategoryFromDTO formDto) { - return ModuleUtils.feignConError(ServiceConstant.EPDC_NEWS_SERVER, "EpdcBannerListByCategoryFromDTO", formDto); - } - @Override public Result getNewsDetail(EpdcNewsDetailFormDTO formDto) { return ModuleUtils.feignConError(ServiceConstant.EPDC_NEWS_SERVER, "getNewsDetail", formDto); diff --git a/epdc-cloud-api/src/main/java/com/elink/esua/epdc/service/PropertyService.java b/epdc-cloud-api/src/main/java/com/elink/esua/epdc/service/PropertyService.java index cbf12ce..99ef3e6 100644 --- a/epdc-cloud-api/src/main/java/com/elink/esua/epdc/service/PropertyService.java +++ b/epdc-cloud-api/src/main/java/com/elink/esua/epdc/service/PropertyService.java @@ -7,7 +7,7 @@ import com.elink.esua.epdc.dto.comment.TopicCommentFormDTO; import com.elink.esua.epdc.dto.comment.TopicCommentStatementFormDTO; import com.elink.esua.epdc.dto.comment.TopicCommentsFormDTO; import com.elink.esua.epdc.dto.comment.result.EventCommentsResultDTO; -import com.elink.esua.epdc.dto.epdc.form.EpdcBannerListByCategoryFromDTO; +import com.elink.esua.epdc.dto.epdc.form.EpdcBannerListFromDTO; import com.elink.esua.epdc.dto.epdc.form.EpdcNewsListByCategoryFromDTO; import com.elink.esua.epdc.dto.epdc.form.EpdcUserGroupInviteFormDTO; import com.elink.esua.epdc.dto.epdc.result.EpdcBannerListResultDTO; @@ -269,9 +269,9 @@ public interface PropertyService { * * @param userDetail 用户信息 * @param formDto 查询参数 - * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @return com.elink.esua.epdc.commons.tools.utils.Result> * @author work@yujt.net.cn * @date 2020/5/25 09:15 */ - Result> listBnnerByCategory(TokenDto userDetail, EpdcBannerListByCategoryFromDTO formDto); + Result> listBnnerByCategory(TokenDto userDetail, EpdcBannerListFromDTO formDto); } diff --git a/epdc-cloud-api/src/main/java/com/elink/esua/epdc/service/impl/NewsServiceImpl.java b/epdc-cloud-api/src/main/java/com/elink/esua/epdc/service/impl/NewsServiceImpl.java index 3083efd..e12f0c3 100644 --- a/epdc-cloud-api/src/main/java/com/elink/esua/epdc/service/impl/NewsServiceImpl.java +++ b/epdc-cloud-api/src/main/java/com/elink/esua/epdc/service/impl/NewsServiceImpl.java @@ -61,7 +61,6 @@ public class NewsServiceImpl implements NewsService { return newsFeignClient.updateStatement(newsStatementFromDTO); } - @Override public Result modifyNewsBrowse(EpdcNewsBrowseFromDTO newsBrowseFromDTO) { return newsFeignClient.modifyNewsBrowse(newsBrowseFromDTO); diff --git a/epdc-cloud-api/src/main/java/com/elink/esua/epdc/service/impl/PropertyServiceImpl.java b/epdc-cloud-api/src/main/java/com/elink/esua/epdc/service/impl/PropertyServiceImpl.java index 0023739..0975727 100644 --- a/epdc-cloud-api/src/main/java/com/elink/esua/epdc/service/impl/PropertyServiceImpl.java +++ b/epdc-cloud-api/src/main/java/com/elink/esua/epdc/service/impl/PropertyServiceImpl.java @@ -2,7 +2,6 @@ package com.elink.esua.epdc.service.impl; import com.elink.esua.epdc.async.WxMaSecCheckTask; import com.elink.esua.epdc.common.token.dto.TokenDto; -import com.elink.esua.epdc.commons.tools.constant.NumConstant; import com.elink.esua.epdc.commons.tools.enums.UserTagEnum; import com.elink.esua.epdc.commons.tools.enums.YesOrNoEnum; import com.elink.esua.epdc.commons.tools.utils.Result; @@ -12,7 +11,7 @@ import com.elink.esua.epdc.dto.comment.TopicCommentStatementFormDTO; import com.elink.esua.epdc.dto.comment.TopicCommentsFormDTO; import com.elink.esua.epdc.dto.comment.result.EventCommentsResultDTO; import com.elink.esua.epdc.dto.enums.TopicStateEnum; -import com.elink.esua.epdc.dto.epdc.form.EpdcBannerListByCategoryFromDTO; +import com.elink.esua.epdc.dto.epdc.form.EpdcBannerListFromDTO; import com.elink.esua.epdc.dto.epdc.form.EpdcNewsListByCategoryFromDTO; import com.elink.esua.epdc.dto.epdc.form.EpdcUserGroupInviteFormDTO; import com.elink.esua.epdc.dto.epdc.result.EpdcBannerListResultDTO; @@ -30,13 +29,11 @@ import com.elink.esua.epdc.dto.project.result.ProjectListResultDTO; import com.elink.esua.epdc.dto.topic.form.*; import com.elink.esua.epdc.dto.topic.result.TopicDetailResultDTO; import com.elink.esua.epdc.dto.topic.result.TopicListResultDTO; -import com.elink.esua.epdc.enums.IndependentFunctionCodeEnum; import com.elink.esua.epdc.feign.AdminFeignClient; import com.elink.esua.epdc.feign.NewsFeignClient; import com.elink.esua.epdc.feign.PropertyFeignClient; import com.elink.esua.epdc.service.PropertyService; import com.elink.esua.epdc.utils.UserTagUtils; -import com.google.common.collect.Lists; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -322,12 +319,8 @@ public class PropertyServiceImpl implements PropertyService { } @Override - public Result> listBnnerByCategory(TokenDto userDetail, EpdcBannerListByCategoryFromDTO formDto) { - List categoryCodes = Lists.newArrayList(); - categoryCodes.add(IndependentFunctionCodeEnum.POLICE_NOTICE.getCode()); - categoryCodes.add(IndependentFunctionCodeEnum.SAFETY_PRECAUTIONS.getCode()); + public Result> listBnnerByCategory(TokenDto userDetail, EpdcBannerListFromDTO formDto) { formDto.setDeptId(userDetail.getGridId()); - formDto.setCategoryCodeList(categoryCodes); - return newsFeignClient.listBannerByCategory(formDto); + return newsFeignClient.listBanner(formDto); } }