Browse Source

新增内容浏览

feature/syp_points
songyunpeng 5 years ago
parent
commit
bb32f2e7da
  1. 8
      esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/enums/BehaviorEnum.java
  2. 5
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiNewsController.java
  3. 10
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/NewsService.java
  4. 8
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/NewsServiceImpl.java

8
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;

5
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<java.util.List<com.elink.esua.epdc.dto.result.ModuleCategoryResultDTO>>
**/
@GetMapping("module/moduleCategory")
public Result<List<ModuleCategoryResultDTO>> getModuleCategory(ModuleCategoryFormDTO dto){
public Result<List<ModuleCategoryResultDTO>> getModuleCategory(@LoginUser TokenDto userDetail,ModuleCategoryFormDTO dto){
if(!"0".equals(dto.getPid())){
newsService.addContentPoints(userDetail,dto);
}
return newsService.getModuleCategory(dto);
}
}

10
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<java.util.List<com.elink.esua.epdc.dto.result.ModuleCategoryResultDTO>>
**/
Result<List<ModuleCategoryResultDTO>> getModuleCategory(ModuleCategoryFormDTO dto);
/**
* @Description 内容浏览加积分操作
* @Author songyunpeng
* @Date 2021/3/8
* @Param [userDetail]
* @return void
**/
void addContentPoints(TokenDto userDetail, ModuleCategoryFormDTO dto);
}

8
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<List<ModuleCategoryResultDTO>> 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) {
}
}

Loading…
Cancel
Save