From 285e08b42ec171a8c972b65df6ed4af63dc72c7c Mon Sep 17 00:00:00 2001 From: liuchuang <123456> Date: Thu, 5 Nov 2020 16:30:45 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BF=97=E6=84=BF=E8=80=85banner=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E6=B5=8F=E8=A7=88=E6=95=B0+1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/EpdcActBannerController.java | 2 +- .../activity/service/ActBannerService.java | 10 +++++++ .../service/impl/ActBannerServiceImpl.java | 26 ++++++++++++------- 3 files changed, 27 insertions(+), 11 deletions(-) diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/EpdcActBannerController.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/EpdcActBannerController.java index 00a2d8d2..e03c85ba 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/EpdcActBannerController.java +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/EpdcActBannerController.java @@ -79,7 +79,7 @@ public class EpdcActBannerController { */ @GetMapping("detail/{id}") public Result getBannerDetail(@PathVariable("id") String id){ - ActBannerDTO data = actBannerService.get(id); + ActBannerDTO data = actBannerService.getBannerDetail(id); return new Result().ok(data); } } diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActBannerService.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActBannerService.java index 3c370891..63e17ed2 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActBannerService.java +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActBannerService.java @@ -164,4 +164,14 @@ public interface ActBannerService extends BaseService { * @since 2020/11/5 10:22 */ List listBanners(EpdcAppBannerFormDTO formDto); + + /** + * 志愿者banner详情 + * + * @param id + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author Liuchuang + * @since 2020/11/5 10:33 + */ + ActBannerDTO getBannerDetail(String id); } diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActBannerServiceImpl.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActBannerServiceImpl.java index 8c83c111..ac80ba8a 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActBannerServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActBannerServiceImpl.java @@ -96,16 +96,7 @@ public class ActBannerServiceImpl extends BaseServiceImpl listBanners(EpdcAppBannerFormDTO formDto) { return baseDao.selectListBanners(formDto); } + + @Override + public ActBannerDTO getBannerDetail(String id) { + ActBannerEntity entity = baseDao.selectById(id); + ActBannerDTO dto = ConvertUtils.sourceToTarget(entity, ActBannerDTO.class); + // 浏览数+1 + if (null != entity) { + int browseNum = null == entity.getBrowseNum() ? 1:entity.getBrowseNum()+1; + ActBannerEntity bannerEntity = new ActBannerEntity(); + bannerEntity.setId(id); + bannerEntity.setBrowseNum(browseNum); + updateById(bannerEntity); + } + return dto; + } }