Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
brandkbs2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
shenjunjie
brandkbs2
Commits
84b448c8
Commit
84b448c8
authored
Feb 06, 2023
by
shenjunjie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
事件分享页移除权限限制
parent
b8ca7a5c
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
20 additions
and
7 deletions
+20
-7
pom.xml
+1
-1
src/main/java/com/zhiwei/brandkbs2/controller/app/AppEventController.java
+4
-2
src/main/java/com/zhiwei/brandkbs2/controller/app/AppSearchController.java
+6
-1
src/main/java/com/zhiwei/brandkbs2/enmus/RoleEnum.java
+6
-1
src/main/java/com/zhiwei/brandkbs2/interceptor/MainAuthInterceptor.java
+2
-1
src/main/java/com/zhiwei/brandkbs2/service/impl/CommonServiceImpl.java
+1
-1
No files found.
pom.xml
View file @
84b448c8
...
...
@@ -35,7 +35,7 @@
<dubbo.version>
2.7.4.1
</dubbo.version>
<curator.version>
2.12.0
</curator.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>
<dependencies>
...
...
src/main/java/com/zhiwei/brandkbs2/controller/app/AppEventController.java
View file @
84b448c8
...
...
@@ -21,8 +21,6 @@ import org.springframework.http.ResponseEntity;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.client.RestTemplate
;
import
java.util.List
;
/**
* @Description: 前台事件库
* @Author: shentao
...
...
@@ -74,18 +72,21 @@ public class AppEventController extends BaseController {
@ApiOperation
(
"前台事件库-事件详情-基础信息"
)
@GetMapping
(
"/info/base/{id}"
)
@Auth
(
role
=
RoleEnum
.
NO_AUTHORISE
)
public
ResponseResult
getEventBaseInfo
(
@PathVariable
String
id
)
{
return
ResponseResult
.
success
(
eventService
.
getEventBaseInfo
(
id
));
}
@ApiOperation
(
"前台事件库-事件详情-传播趋势图"
)
@GetMapping
(
"/info/dissemination-trends/{id}"
)
@Auth
(
role
=
RoleEnum
.
NO_AUTHORISE
)
public
ResponseResult
getEventDisseminationTrends
(
@PathVariable
String
id
,
@RequestParam
(
value
=
"type"
,
defaultValue
=
"小时"
)
String
type
)
{
return
ResponseResult
.
success
(
eventService
.
getEventDisseminationTrends
(
id
,
type
));
}
@ApiOperation
(
"前台事件库-事件详情-渠道发声"
)
@GetMapping
(
"/info/channel-voices/{id}"
)
@Auth
(
role
=
RoleEnum
.
NO_AUTHORISE
)
public
ResponseResult
getEventChannelVoices
(
@PathVariable
String
id
,
@RequestParam
(
value
=
"type"
,
defaultValue
=
"重要渠道"
)
String
type
,
@RequestParam
(
value
=
"page"
,
defaultValue
=
"1"
)
int
page
,
...
...
@@ -96,6 +97,7 @@ public class AppEventController extends BaseController {
@ApiOperation
(
"前台事件库-事件详情-热门文章分析"
)
@GetMapping
(
"/info/top-articles-analysis/{id}"
)
@Auth
(
role
=
RoleEnum
.
NO_AUTHORISE
)
public
ResponseResult
getEventTopArticlesAnalysis
(
@PathVariable
String
id
,
@RequestParam
(
value
=
"type"
,
defaultValue
=
"按时间"
)
String
type
,
@RequestParam
(
value
=
"emotion"
,
defaultValue
=
"全部"
)
String
emotion
,
...
...
src/main/java/com/zhiwei/brandkbs2/controller/app/AppSearchController.java
View file @
84b448c8
...
...
@@ -10,6 +10,7 @@ import com.zhiwei.brandkbs2.easyexcel.EasyExcelUtil;
import
com.zhiwei.brandkbs2.enmus.RoleEnum
;
import
com.zhiwei.brandkbs2.model.ResponseResult
;
import
com.zhiwei.brandkbs2.pojo.dto.*
;
import
com.zhiwei.brandkbs2.pojo.vo.ChannelListVO
;
import
com.zhiwei.brandkbs2.service.*
;
import
com.zhiwei.brandkbs2.util.Tools
;
import
com.zhiwei.middleware.event.pojo.dto.BrandkbsEventSearchDTO
;
...
...
@@ -169,7 +170,11 @@ public class AppSearchController extends BaseController {
@GetMapping
(
"channel/list/active"
)
public
ResponseResult
getActiveChannelList
(
@RequestParam
(
value
=
"size"
,
defaultValue
=
"2"
)
int
size
)
{
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
(
"搜索-渠道搜索条件"
)
...
...
src/main/java/com/zhiwei/brandkbs2/enmus/RoleEnum.java
View file @
84b448c8
...
...
@@ -22,7 +22,12 @@ public enum RoleEnum {
/**
* 客户
*/
CUSTOMER
(
4
,
"客户"
);
CUSTOMER
(
4
,
"客户"
),
/**
* 客户
*/
NO_AUTHORISE
(-
1
,
"无需权限"
);
private
final
int
state
;
private
final
String
name
;
...
...
src/main/java/com/zhiwei/brandkbs2/interceptor/MainAuthInterceptor.java
View file @
84b448c8
...
...
@@ -2,6 +2,7 @@ package com.zhiwei.brandkbs2.interceptor;
import
com.zhiwei.brandkbs2.auth.Auth
;
import
com.zhiwei.brandkbs2.common.GenericAttribute
;
import
com.zhiwei.brandkbs2.enmus.RoleEnum
;
import
com.zhiwei.brandkbs2.model.CommonCodeEnum
;
import
com.zhiwei.brandkbs2.model.ResponseResult
;
import
com.zhiwei.brandkbs2.pojo.UserInfo
;
...
...
@@ -46,7 +47,7 @@ public class MainAuthInterceptor implements HandlerInterceptor {
}
}
// 不需要验证权限
if
(
null
==
auth
)
{
if
(
null
==
auth
||
RoleEnum
.
NO_AUTHORISE
==
auth
.
role
()
)
{
return
true
;
}
String
token
=
request
.
getHeader
(
"Token"
);
...
...
src/main/java/com/zhiwei/brandkbs2/service/impl/CommonServiceImpl.java
View file @
84b448c8
...
...
@@ -127,7 +127,7 @@ public class CommonServiceImpl implements CommonService {
@Override
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
();
return
new
Long
[]{
startTime
,
endTime
};
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment