Commit 84b448c8 by shenjunjie

事件分享页移除权限限制

parent b8ca7a5c
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
<dubbo.version>2.7.4.1</dubbo.version> <dubbo.version>2.7.4.1</dubbo.version>
<curator.version>2.12.0</curator.version> <curator.version>2.12.0</curator.version>
<push.log.version>2.17.0-SNAPSHOT</push.log.version> <push.log.version>2.17.0-SNAPSHOT</push.log.version>
<event-client.version>1.0.2-SNAPSHOT</event-client.version> <event-client.version>1.0.4-SNAPSHOT</event-client.version>
</properties> </properties>
<dependencies> <dependencies>
......
...@@ -21,8 +21,6 @@ import org.springframework.http.ResponseEntity; ...@@ -21,8 +21,6 @@ import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.client.RestTemplate; import org.springframework.web.client.RestTemplate;
import java.util.List;
/** /**
* @Description: 前台事件库 * @Description: 前台事件库
* @Author: shentao * @Author: shentao
...@@ -74,18 +72,21 @@ public class AppEventController extends BaseController { ...@@ -74,18 +72,21 @@ public class AppEventController extends BaseController {
@ApiOperation("前台事件库-事件详情-基础信息") @ApiOperation("前台事件库-事件详情-基础信息")
@GetMapping("/info/base/{id}") @GetMapping("/info/base/{id}")
@Auth(role = RoleEnum.NO_AUTHORISE)
public ResponseResult getEventBaseInfo(@PathVariable String id) { public ResponseResult getEventBaseInfo(@PathVariable String id) {
return ResponseResult.success(eventService.getEventBaseInfo(id)); return ResponseResult.success(eventService.getEventBaseInfo(id));
} }
@ApiOperation("前台事件库-事件详情-传播趋势图") @ApiOperation("前台事件库-事件详情-传播趋势图")
@GetMapping("/info/dissemination-trends/{id}") @GetMapping("/info/dissemination-trends/{id}")
@Auth(role = RoleEnum.NO_AUTHORISE)
public ResponseResult getEventDisseminationTrends(@PathVariable String id, @RequestParam(value = "type", defaultValue = "小时") String type) { public ResponseResult getEventDisseminationTrends(@PathVariable String id, @RequestParam(value = "type", defaultValue = "小时") String type) {
return ResponseResult.success(eventService.getEventDisseminationTrends(id, type)); return ResponseResult.success(eventService.getEventDisseminationTrends(id, type));
} }
@ApiOperation("前台事件库-事件详情-渠道发声") @ApiOperation("前台事件库-事件详情-渠道发声")
@GetMapping("/info/channel-voices/{id}") @GetMapping("/info/channel-voices/{id}")
@Auth(role = RoleEnum.NO_AUTHORISE)
public ResponseResult getEventChannelVoices(@PathVariable String id, public ResponseResult getEventChannelVoices(@PathVariable String id,
@RequestParam(value = "type", defaultValue = "重要渠道") String type, @RequestParam(value = "type", defaultValue = "重要渠道") String type,
@RequestParam(value = "page", defaultValue = "1") int page, @RequestParam(value = "page", defaultValue = "1") int page,
...@@ -96,6 +97,7 @@ public class AppEventController extends BaseController { ...@@ -96,6 +97,7 @@ public class AppEventController extends BaseController {
@ApiOperation("前台事件库-事件详情-热门文章分析") @ApiOperation("前台事件库-事件详情-热门文章分析")
@GetMapping("/info/top-articles-analysis/{id}") @GetMapping("/info/top-articles-analysis/{id}")
@Auth(role = RoleEnum.NO_AUTHORISE)
public ResponseResult getEventTopArticlesAnalysis(@PathVariable String id, public ResponseResult getEventTopArticlesAnalysis(@PathVariable String id,
@RequestParam(value = "type", defaultValue = "按时间") String type, @RequestParam(value = "type", defaultValue = "按时间") String type,
@RequestParam(value = "emotion", defaultValue = "全部") String emotion, @RequestParam(value = "emotion", defaultValue = "全部") String emotion,
......
...@@ -10,6 +10,7 @@ import com.zhiwei.brandkbs2.easyexcel.EasyExcelUtil; ...@@ -10,6 +10,7 @@ import com.zhiwei.brandkbs2.easyexcel.EasyExcelUtil;
import com.zhiwei.brandkbs2.enmus.RoleEnum; import com.zhiwei.brandkbs2.enmus.RoleEnum;
import com.zhiwei.brandkbs2.model.ResponseResult; import com.zhiwei.brandkbs2.model.ResponseResult;
import com.zhiwei.brandkbs2.pojo.dto.*; import com.zhiwei.brandkbs2.pojo.dto.*;
import com.zhiwei.brandkbs2.pojo.vo.ChannelListVO;
import com.zhiwei.brandkbs2.service.*; import com.zhiwei.brandkbs2.service.*;
import com.zhiwei.brandkbs2.util.Tools; import com.zhiwei.brandkbs2.util.Tools;
import com.zhiwei.middleware.event.pojo.dto.BrandkbsEventSearchDTO; import com.zhiwei.middleware.event.pojo.dto.BrandkbsEventSearchDTO;
...@@ -169,7 +170,11 @@ public class AppSearchController extends BaseController { ...@@ -169,7 +170,11 @@ public class AppSearchController extends BaseController {
@GetMapping("channel/list/active") @GetMapping("channel/list/active")
public ResponseResult getActiveChannelList(@RequestParam(value = "size", defaultValue = "2") int size) { public ResponseResult getActiveChannelList(@RequestParam(value = "size", defaultValue = "2") int size) {
Long[] timeRangeDay = commonService.getTimeRangeDay(); Long[] timeRangeDay = commonService.getTimeRangeDay();
return ResponseResult.success(channelService.getActiveChannelList("0", null, null, timeRangeDay[0], timeRangeDay[1], size, true)); List<ChannelListVO> activeChannelList = channelService.getActiveChannelList("0", null, null, timeRangeDay[0], timeRangeDay[1], size, true);
if (activeChannelList.size() > 2) {
activeChannelList = activeChannelList.subList(0, 2);
}
return ResponseResult.success(activeChannelList);
} }
@ApiOperation("搜索-渠道搜索条件") @ApiOperation("搜索-渠道搜索条件")
......
...@@ -22,7 +22,12 @@ public enum RoleEnum { ...@@ -22,7 +22,12 @@ public enum RoleEnum {
/** /**
* 客户 * 客户
*/ */
CUSTOMER(4, "客户"); CUSTOMER(4, "客户"),
/**
* 客户
*/
NO_AUTHORISE(-1, "无需权限");
private final int state; private final int state;
private final String name; private final String name;
......
...@@ -2,6 +2,7 @@ package com.zhiwei.brandkbs2.interceptor; ...@@ -2,6 +2,7 @@ package com.zhiwei.brandkbs2.interceptor;
import com.zhiwei.brandkbs2.auth.Auth; import com.zhiwei.brandkbs2.auth.Auth;
import com.zhiwei.brandkbs2.common.GenericAttribute; import com.zhiwei.brandkbs2.common.GenericAttribute;
import com.zhiwei.brandkbs2.enmus.RoleEnum;
import com.zhiwei.brandkbs2.model.CommonCodeEnum; import com.zhiwei.brandkbs2.model.CommonCodeEnum;
import com.zhiwei.brandkbs2.model.ResponseResult; import com.zhiwei.brandkbs2.model.ResponseResult;
import com.zhiwei.brandkbs2.pojo.UserInfo; import com.zhiwei.brandkbs2.pojo.UserInfo;
...@@ -46,7 +47,7 @@ public class MainAuthInterceptor implements HandlerInterceptor { ...@@ -46,7 +47,7 @@ public class MainAuthInterceptor implements HandlerInterceptor {
} }
} }
// 不需要验证权限 // 不需要验证权限
if (null == auth) { if (null == auth || RoleEnum.NO_AUTHORISE == auth.role()) {
return true; return true;
} }
String token = request.getHeader("Token"); String token = request.getHeader("Token");
......
...@@ -127,7 +127,7 @@ public class CommonServiceImpl implements CommonService { ...@@ -127,7 +127,7 @@ public class CommonServiceImpl implements CommonService {
@Override @Override
public Long[] getTimeRangeDay() { public Long[] getTimeRangeDay() {
long endTime = DateUtils.addDays(Tools.truncDate(new Date(), Constant.DAY_PATTERN), 1).getTime(); long endTime = Tools.truncDate(new Date(), Constant.DAY_PATTERN).getTime();
long startTime = DateUtils.addDays(new Date(endTime), -1).getTime(); long startTime = DateUtils.addDays(new Date(endTime), -1).getTime();
return new Long[]{startTime, endTime}; return new Long[]{startTime, endTime};
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment