Browse Source

志愿者banner详情浏览数+1

feature/syp_points
liuchuang 5 years ago
parent
commit
285e08b42e
  1. 2
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/EpdcActBannerController.java
  2. 10
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActBannerService.java
  3. 26
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActBannerServiceImpl.java

2
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<ActBannerDTO> getBannerDetail(@PathVariable("id") String id){
ActBannerDTO data = actBannerService.get(id);
ActBannerDTO data = actBannerService.getBannerDetail(id);
return new Result<ActBannerDTO>().ok(data);
}
}

10
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<ActBannerEntity> {
* @since 2020/11/5 10:22
*/
List<ActBannerDTO> listBanners(EpdcAppBannerFormDTO formDto);
/**
* 志愿者banner详情
*
* @param id
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.activity.ActBannerDTO>
* @author Liuchuang
* @since 2020/11/5 10:33
*/
ActBannerDTO getBannerDetail(String id);
}

26
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<ActBannerDao, ActBanne
@Override
public ActBannerDTO get(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.setActId(id);
bannerEntity.setBrowseNum(browseNum);
updateById(bannerEntity);
}
return dto;
return ConvertUtils.sourceToTarget(entity, ActBannerDTO.class);
}
@Override
public Result grounding(String id) {
@ -194,4 +185,19 @@ public class ActBannerServiceImpl extends BaseServiceImpl<ActBannerDao, ActBanne
public List<ActBannerDTO> 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;
}
}

Loading…
Cancel
Save