diff --git a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/enums/BehaviorEnum.java b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/enums/BehaviorEnum.java index 754fa2fa..0c4158b8 100644 --- a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/enums/BehaviorEnum.java +++ b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/enums/BehaviorEnum.java @@ -285,8 +285,12 @@ public enum BehaviorEnum { /** * 志愿者完善信息 */ - VOLUNTEER_PERFECT_INFO("volunteer_perfect_info") - ; + VOLUNTEER_PERFECT_INFO("volunteer_perfect_info"), + + /** + * 内容浏览 + */ + CONTENT_BROWSE("content_browse"); private String value; diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiNewsController.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiNewsController.java index 29604f9e..256b54cf 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiNewsController.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiNewsController.java @@ -232,7 +232,10 @@ public class ApiNewsController { * @return com.elink.esua.epdc.commons.tools.utils.Result> **/ @GetMapping("module/moduleCategory") - public Result> getModuleCategory(ModuleCategoryFormDTO dto){ + public Result> getModuleCategory(@LoginUser TokenDto userDetail,ModuleCategoryFormDTO dto){ + if(!"0".equals(dto.getPid())){ + newsService.addContentPoints(userDetail,dto); + } return newsService.getModuleCategory(dto); } } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/NewsService.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/NewsService.java index 466b994f..509f3bb5 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/NewsService.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/NewsService.java @@ -1,11 +1,13 @@ package com.elink.esua.epdc.service; import com.elink.esua.epdc.common.token.dto.TokenDto; +import com.elink.esua.epdc.commons.tools.enums.BehaviorEnum; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dto.epdc.form.*; import com.elink.esua.epdc.dto.epdc.form.v2.EpdcNoticeListV2FormDTO; import com.elink.esua.epdc.dto.epdc.result.*; import com.elink.esua.epdc.dto.result.EpdcAppHomeDataResultDTO; +import com.elink.esua.epdc.pointcommons.tools.annotation.RecordUserBehavior; import java.util.List; @@ -172,4 +174,12 @@ public interface NewsService { * @return com.elink.esua.epdc.commons.tools.utils.Result> **/ Result> getModuleCategory(ModuleCategoryFormDTO dto); + /** + * @Description 内容浏览加积分操作 + * @Author songyunpeng + * @Date 2021/3/8 + * @Param [userDetail] + * @return void + **/ + void addContentPoints(TokenDto userDetail, ModuleCategoryFormDTO dto); } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/NewsServiceImpl.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/NewsServiceImpl.java index 8c3a85c4..e6535e5a 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/NewsServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/NewsServiceImpl.java @@ -2,6 +2,7 @@ package com.elink.esua.epdc.service.impl; 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.BehaviorEnum; import com.elink.esua.epdc.commons.tools.enums.YesOrNoEnum; import com.elink.esua.epdc.commons.tools.redis.RedisUtils; import com.elink.esua.epdc.commons.tools.utils.Result; @@ -12,6 +13,7 @@ import com.elink.esua.epdc.dto.epdc.result.*; import com.elink.esua.epdc.dto.result.EpdcAppHomeDataResultDTO; import com.elink.esua.epdc.feign.ActInfoFeignClient; import com.elink.esua.epdc.feign.NewsFeignClient; +import com.elink.esua.epdc.pointcommons.tools.annotation.RecordUserBehavior; import com.elink.esua.epdc.service.NewsService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -157,4 +159,10 @@ public class NewsServiceImpl implements NewsService { public Result> getModuleCategory(ModuleCategoryFormDTO dto) { return newsFeignClient.getModuleCategory(dto); } + + @Override + @RecordUserBehavior(behavior = BehaviorEnum.CONTENT_BROWSE,referenceId = "#{dto.getPid}",userId = "#{userDetail.getUserId}",gridId = "#{userDetail.getGridId}") + public void addContentPoints(TokenDto userDetail, ModuleCategoryFormDTO dto) { + + } }