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
c60988a4
Commit
c60988a4
authored
Mar 22, 2024
by
shenjunjie
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature' into 'dev'
Feature See merge request
!469
parents
9d8f0bea
426541cc
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
44 additions
and
15 deletions
+44
-15
src/main/java/com/zhiwei/brandkbs2/aop/AopLogRecord.java
+8
-5
src/main/java/com/zhiwei/brandkbs2/controller/app/AppSearchController.java
+7
-4
src/main/java/com/zhiwei/brandkbs2/enmus/HotPlatformEnum.java
+3
-1
src/main/java/com/zhiwei/brandkbs2/pojo/Project.java
+1
-0
src/main/java/com/zhiwei/brandkbs2/pojo/vo/ProjectVO.java
+17
-1
src/main/resources/application-dev.properties
+1
-1
src/main/resources/application-local.properties
+6
-2
src/main/resources/application-prod.properties
+1
-1
No files found.
src/main/java/com/zhiwei/brandkbs2/aop/AopLogRecord.java
View file @
c60988a4
...
@@ -61,8 +61,7 @@ public class AopLogRecord {
...
@@ -61,8 +61,7 @@ public class AopLogRecord {
private
static
final
List
<
String
>
URL_PATTERNS
=
Arrays
.
asList
(
"/getNewAll"
,
"/getNew"
,
"/schedule"
);
private
static
final
List
<
String
>
URL_PATTERNS
=
Arrays
.
asList
(
"/getNewAll"
,
"/getNew"
,
"/schedule"
);
@AfterReturning
(
value
=
"execution(public * com..controller..admin..*Controller.*(..)) || execution(* com..controller..app..*Controller.*(..)) || execution(* com..controller..LoginController.checkBind())"
,
returning
=
"ResponseResult"
)
@AfterReturning
(
value
=
"execution(public * com..controller..admin..*Controller.*(..)) || execution(* com..controller..app..*Controller.*(..)) || execution(* com..controller..LoginController.checkBind())"
,
returning
=
"ResponseResult"
)
private
void
beforeLog
(
JoinPoint
joinPoint
,
ResponseResult
ResponseResult
){
private
void
beforeLog
(
JoinPoint
joinPoint
,
ResponseResult
ResponseResult
)
{
String
pid
=
null
;
try
{
try
{
long
now
=
System
.
currentTimeMillis
();
long
now
=
System
.
currentTimeMillis
();
// RequestContextHolder 顾名思义 持有 request 上下文的容器
// RequestContextHolder 顾名思义 持有 request 上下文的容器
...
@@ -87,7 +86,7 @@ public class AopLogRecord {
...
@@ -87,7 +86,7 @@ public class AopLogRecord {
// 前后台,false:前台,true:后台
// 前后台,false:前台,true:后台
boolean
backstage
=
uri
.
contains
(
"admin"
);
boolean
backstage
=
uri
.
contains
(
"admin"
);
String
token
=
request
.
getHeader
(
jwtKey
);
String
token
=
request
.
getHeader
(
jwtKey
);
pid
=
request
.
getHeader
(
"pid"
);
String
pid
=
request
.
getHeader
(
"pid"
);
// 任意有一个不为空
// 任意有一个不为空
if
(!(
Tools
.
isNullOrUndefined
(
token
)
||
Tools
.
isNullOrUndefined
(
pid
)))
{
if
(!(
Tools
.
isNullOrUndefined
(
token
)
||
Tools
.
isNullOrUndefined
(
pid
)))
{
Map
<
String
,
Object
>
map
=
JwtUtil
.
unsign
(
request
.
getHeader
(
jwtKey
),
Map
.
class
);
Map
<
String
,
Object
>
map
=
JwtUtil
.
unsign
(
request
.
getHeader
(
jwtKey
),
Map
.
class
);
...
@@ -102,7 +101,11 @@ public class AopLogRecord {
...
@@ -102,7 +101,11 @@ public class AopLogRecord {
}
}
String
userId
=
userIdObj
.
toString
();
String
userId
=
userIdObj
.
toString
();
String
projectId
=
request
.
getHeader
(
"pid"
);
String
projectId
=
request
.
getHeader
(
"pid"
);
UserInfo
userInfo
=
userService
.
queryUserInfo
(
userId
,
projectId
);
UserInfo
userInfo
;
if
(
null
==
(
userInfo
=
userService
.
queryUserInfo
(
userId
,
projectId
)))
{
log
.
error
(
"用户信息解析异常,pid:{},userId:{}"
,
pid
,
userId
);
return
;
}
String
nickName
=
userInfo
.
getNickname
();
String
nickName
=
userInfo
.
getNickname
();
// 请求地址和服务器地址
// 请求地址和服务器地址
String
severAddress
=
InetAddress
.
getLocalHost
().
getHostAddress
();
String
severAddress
=
InetAddress
.
getLocalHost
().
getHostAddress
();
...
@@ -121,7 +124,7 @@ public class AopLogRecord {
...
@@ -121,7 +124,7 @@ public class AopLogRecord {
}
}
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"beforeLog
,pid:{}"
,
pid
,
e
);
log
.
error
(
"beforeLog
-"
,
e
);
}
}
}
}
...
...
src/main/java/com/zhiwei/brandkbs2/controller/app/AppSearchController.java
View file @
c60988a4
...
@@ -50,7 +50,7 @@ public class AppSearchController extends BaseController {
...
@@ -50,7 +50,7 @@ public class AppSearchController extends BaseController {
@Autowired
@Autowired
private
RestTemplate
restTemplate
;
private
RestTemplate
restTemplate
;
@Value
(
"${trends.find
HotSearchESDataInTimeByInner
.url}"
)
@Value
(
"${trends.find
AllPlatformHotSearchESDataInTime
.url}"
)
private
String
trendsSearchUrl
;
private
String
trendsSearchUrl
;
@Value
(
"${crisis.search.url}"
)
@Value
(
"${crisis.search.url}"
)
...
@@ -88,9 +88,12 @@ public class AppSearchController extends BaseController {
...
@@ -88,9 +88,12 @@ public class AppSearchController extends BaseController {
@GetMapping
(
"/hot/list"
)
@GetMapping
(
"/hot/list"
)
public
ResponseResult
searchHotList
(
@RequestParam
(
value
=
"pageSize"
,
defaultValue
=
"10"
)
Integer
limit
,
public
ResponseResult
searchHotList
(
@RequestParam
(
value
=
"pageSize"
,
defaultValue
=
"10"
)
Integer
limit
,
@RequestParam
(
value
=
"page"
,
defaultValue
=
"1"
)
Integer
page
,
@RequestParam
(
value
=
"page"
,
defaultValue
=
"1"
)
Integer
page
,
@RequestParam
(
value
=
"type"
,
defaultValue
=
"weibo"
)
String
type
,
@RequestParam
(
value
=
"type"
,
defaultValue
=
"all"
)
String
type
,
@RequestParam
(
value
=
"keyword"
)
String
keyword
)
{
@RequestParam
(
value
=
"keyword"
)
String
keyword
,
ResponseEntity
<
JSONObject
>
jsonObjectResponseEntity
=
restTemplate
.
getForEntity
(
trendsSearchUrl
,
JSONObject
.
class
,
limit
,
page
,
type
,
keyword
);
@RequestParam
(
value
=
"sort"
)
String
sort
,
@RequestParam
(
value
=
"startTime"
,
required
=
false
)
Long
startTime
,
@RequestParam
(
value
=
"endTime"
,
required
=
false
)
Long
endTime
)
{
ResponseEntity
<
JSONObject
>
jsonObjectResponseEntity
=
restTemplate
.
getForEntity
(
trendsSearchUrl
,
JSONObject
.
class
,
limit
,
page
,
type
,
keyword
,
sort
,
startTime
,
endTime
);
JSONObject
result
=
jsonObjectResponseEntity
.
getBody
();
JSONObject
result
=
jsonObjectResponseEntity
.
getBody
();
if
(
Objects
.
nonNull
(
result
))
{
if
(
Objects
.
nonNull
(
result
))
{
return
ResponseResult
.
success
(
result
);
return
ResponseResult
.
success
(
result
);
...
...
src/main/java/com/zhiwei/brandkbs2/enmus/HotPlatformEnum.java
View file @
c60988a4
...
@@ -20,10 +20,12 @@ public enum HotPlatformEnum {
...
@@ -20,10 +20,12 @@ public enum HotPlatformEnum {
ZHIHU
(
"知乎"
,
"zhihu"
,
"知乎热搜"
),
ZHIHU
(
"知乎"
,
"zhihu"
,
"知乎热搜"
),
JINRITOUTIAO
(
"今日头条"
,
"toutiao"
,
"今日头条热搜"
),
JINRITOUTIAO
(
"今日头条"
,
"toutiao"
,
"今日头条热搜"
),
DOUYIN
(
"抖音"
,
"douyin"
,
"抖音热搜"
),
DOUYIN
(
"抖音"
,
"douyin"
,
"抖音热搜"
),
DOUYIN_RISE
(
"抖音"
,
"douyin-rise"
,
"抖音预热榜"
),
BILIBILI
(
"B站"
,
"bilibili"
,
"B站热搜"
),
BILIBILI
(
"B站"
,
"bilibili"
,
"B站热搜"
),
BILIBILI_RANKING
(
"B站"
,
"bilibili-ranking"
,
"B站排行榜"
),
BILIBILI_RANKING
(
"B站"
,
"bilibili-ranking"
,
"B站排行榜"
),
KUAISHOU
(
"快手"
,
"kuaishou"
,
"快手热榜"
),
KUAISHOU
(
"快手"
,
"kuaishou"
,
"快手热榜"
),
BAIDU
(
"百度"
,
"baidu"
,
"百度热搜"
);
BAIDU
(
"百度"
,
"baidu"
,
"百度热搜"
),
XIAOHONGSHU
(
"小红书"
,
"little-red-book"
,
"小红书热榜"
);
private
final
String
platform
;
private
final
String
platform
;
private
final
String
engName
;
private
final
String
engName
;
...
...
src/main/java/com/zhiwei/brandkbs2/pojo/Project.java
View file @
c60988a4
...
@@ -36,6 +36,7 @@ public class Project extends AbstractProject {
...
@@ -36,6 +36,7 @@ public class Project extends AbstractProject {
/**
/**
* 模块展示列表(1:标注库 2:大库)
* 模块展示列表(1:标注库 2:大库)
*/
*/
@Deprecated
private
List
<
Integer
>
moduleShowList
;
private
List
<
Integer
>
moduleShowList
;
/**
/**
...
...
src/main/java/com/zhiwei/brandkbs2/pojo/vo/ProjectVO.java
View file @
c60988a4
...
@@ -9,7 +9,6 @@ import io.swagger.annotations.ApiModel;
...
@@ -9,7 +9,6 @@ import io.swagger.annotations.ApiModel;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.ToString
;
import
lombok.ToString
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.bson.types.ObjectId
;
import
org.bson.types.ObjectId
;
import
java.util.*
;
import
java.util.*
;
...
@@ -159,6 +158,23 @@ public class ProjectVO {
...
@@ -159,6 +158,23 @@ public class ProjectVO {
project
.
setModuleShowList
(
this
.
getModuleShowList
());
project
.
setModuleShowList
(
this
.
getModuleShowList
());
project
.
setToolsetShowList
(
this
.
getToolsetShowList
());
project
.
setToolsetShowList
(
this
.
getToolsetShowList
());
project
.
setChannelFileUrl
(
this
.
getChannelFileUrl
());
project
.
setChannelFileUrl
(
this
.
getChannelFileUrl
());
// 负面渠道判断默认值
if
(
null
==
negativeChannelParams
)
{
this
.
negativeChannelParams
=
new
HashMap
<>();
negativeChannelParams
.
put
(
"negativeArticles"
,
0.6
);
negativeChannelParams
.
put
(
"negativeEvent"
,
0.3
);
negativeChannelParams
.
put
(
"specialArticles"
,
0.1
);
negativeChannelParams
.
put
(
"experience"
,
0.0
);
}
// 友好渠道判断默认值
if
(
null
==
positiveChannelParams
)
{
this
.
positiveChannelParams
=
new
HashMap
<>();
positiveChannelParams
.
put
(
"specialArticles"
,
0.1
);
positiveChannelParams
.
put
(
"positiveEvent"
,
0.3
);
positiveChannelParams
.
put
(
"negative"
,
0.25
);
positiveChannelParams
.
put
(
"neutral"
,
0.35
);
positiveChannelParams
.
put
(
"experience"
,
0.0
);
}
project
.
setNegativeChannelParams
((
this
.
getNegativeChannelParams
()));
project
.
setNegativeChannelParams
((
this
.
getNegativeChannelParams
()));
project
.
setPositiveChannelParams
((
this
.
getPositiveChannelParams
()));
project
.
setPositiveChannelParams
((
this
.
getPositiveChannelParams
()));
project
.
setBlackChannelGroup
(
this
.
getBlackChannelGroup
());
project
.
setBlackChannelGroup
(
this
.
getBlackChannelGroup
());
...
...
src/main/resources/application-dev.properties
View file @
c60988a4
...
@@ -88,7 +88,7 @@ crisis.share.url=https://crisis.zhiweidata.com/app/brandkbs/share/{1}
...
@@ -88,7 +88,7 @@ crisis.share.url=https://crisis.zhiweidata.com/app/brandkbs/share/{1}
crisis.event.url
=
https://crisis.zhiweidata.com/share/crisisDetails?id={1}&share={2}
crisis.event.url
=
https://crisis.zhiweidata.com/share/crisisDetails?id={1}&share={2}
#\u70ED\u70B9\u5E93\u5916\u90E8\u63A5\u53E3
#\u70ED\u70B9\u5E93\u5916\u90E8\u63A5\u53E3
trends.longTimeInListSearchByInner.url
=
https://trends.zhiweidata.com/hotSearchTrend/inner/longTimeInListSearchByInner?sortType={1}&type={2}&day={3}
trends.longTimeInListSearchByInner.url
=
https://trends.zhiweidata.com/hotSearchTrend/inner/longTimeInListSearchByInner?sortType={1}&type={2}&day={3}
trends.find
HotSearchESDataInTimeByInner.url
=
https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/findHotSearchESDataInTimeByInner?limit={1}&page={2}&type={3}&word={4
}
trends.find
AllPlatformHotSearchESDataInTime.url
=
https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/findAllPlatformHotSearchESDataInTime?limit={1}&page={2}&type={3}&word={4}&sort={5}&startTime={6}&endTime={7
}
trends.longTimeInListSearch.url
=
https://trends.zhiweidata.com/hotSearchTrend/search/longTimeInListSearch?type={1}&sortType=realTime
trends.longTimeInListSearch.url
=
https://trends.zhiweidata.com/hotSearchTrend/search/longTimeInListSearch?type={1}&sortType=realTime
trends.getHotSearchFromEsInTimeAndTypeOrWord.url
=
https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/getHotSearchFromEsInTimeAndTypeOrWord?limit={1}&page={2}&type={3}&word={4}&sort={5}&accurateWord={6}&maskWord={7}
trends.getHotSearchFromEsInTimeAndTypeOrWord.url
=
https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/getHotSearchFromEsInTimeAndTypeOrWord?limit={1}&page={2}&type={3}&word={4}&sort={5}&accurateWord={6}&maskWord={7}
trends.queryHotSearchTrendInner.url
=
https://trends.zhiweidata.com/hotSearchTrend/inner/queryHotSearchTrendInner
trends.queryHotSearchTrendInner.url
=
https://trends.zhiweidata.com/hotSearchTrend/inner/queryHotSearchTrendInner
...
...
src/main/resources/application-local.properties
View file @
c60988a4
...
@@ -17,10 +17,14 @@ brandkbs.image.url=https://brandkbs.zhiweidata.com/brandkbs/images/
...
@@ -17,10 +17,14 @@ brandkbs.image.url=https://brandkbs.zhiweidata.com/brandkbs/images/
#\u56FE\u7247\u8D44\u6E90\u8DEF\u5F84
#\u56FE\u7247\u8D44\u6E90\u8DEF\u5F84
cbs.imagesPath
=
file:${brandkbs.img.url},file:${brandkbs.head.url}
cbs.imagesPath
=
file:${brandkbs.img.url},file:${brandkbs.head.url}
#redis
#redis
\u6D4B\u8BD5
spring.redis.host
=
192.168.0.24
spring.redis.host
=
192.168.0.24
spring.redis.database
=
2
spring.redis.database
=
2
spring.redis.port
=
6379
spring.redis.port
=
6379
#redis \u7EBF\u4E0A
#spring.redis.host=115.236.59.91
#spring.redis.database=0
#spring.redis.port=7376
#mongo\u914D\u7F6E
#mongo\u914D\u7F6E
...
@@ -93,7 +97,7 @@ crisis.share.url=https://crisis.zhiweidata.com/app/brandkbs/share/{1}
...
@@ -93,7 +97,7 @@ crisis.share.url=https://crisis.zhiweidata.com/app/brandkbs/share/{1}
crisis.event.url
=
https://crisis.zhiweidata.com/share/crisisDetails?id={1}&share={2}
crisis.event.url
=
https://crisis.zhiweidata.com/share/crisisDetails?id={1}&share={2}
#\u70ED\u70B9\u5E93\u5916\u90E8\u63A5\u53E3
#\u70ED\u70B9\u5E93\u5916\u90E8\u63A5\u53E3
trends.longTimeInListSearchByInner.url
=
https://trends.zhiweidata.com/hotSearchTrend/inner/longTimeInListSearchByInner?sortType={1}&type={2}&day={3}
trends.longTimeInListSearchByInner.url
=
https://trends.zhiweidata.com/hotSearchTrend/inner/longTimeInListSearchByInner?sortType={1}&type={2}&day={3}
trends.find
HotSearchESDataInTimeByInner.url
=
https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/findHotSearchESDataInTimeByInner?limit={1}&page={2}&type={3}&word={4
}
trends.find
AllPlatformHotSearchESDataInTime.url
=
https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/findAllPlatformHotSearchESDataInTime?limit={1}&page={2}&type={3}&word={4}&sort={5}&startTime={6}&endTime={7
}
trends.longTimeInListSearch.url
=
https://trends.zhiweidata.com/hotSearchTrend/search/longTimeInListSearch?type={1}&sortType=realTime
trends.longTimeInListSearch.url
=
https://trends.zhiweidata.com/hotSearchTrend/search/longTimeInListSearch?type={1}&sortType=realTime
trends.getHotSearchFromEsInTimeAndTypeOrWord.url
=
https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/getHotSearchFromEsInTimeAndTypeOrWord?limit={1}&page={2}&type={3}&word={4}&sort={5}&accurateWord={6}&maskWord={7}
trends.getHotSearchFromEsInTimeAndTypeOrWord.url
=
https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/getHotSearchFromEsInTimeAndTypeOrWord?limit={1}&page={2}&type={3}&word={4}&sort={5}&accurateWord={6}&maskWord={7}
trends.queryHotSearchTrendInner.url
=
https://trends.zhiweidata.com/hotSearchTrend/inner/queryHotSearchTrendInner
trends.queryHotSearchTrendInner.url
=
https://trends.zhiweidata.com/hotSearchTrend/inner/queryHotSearchTrendInner
...
...
src/main/resources/application-prod.properties
View file @
c60988a4
...
@@ -88,7 +88,7 @@ crisis.share.url=https://crisis.zhiweidata.com/app/brandkbs/share/{1}
...
@@ -88,7 +88,7 @@ crisis.share.url=https://crisis.zhiweidata.com/app/brandkbs/share/{1}
crisis.event.url
=
https://crisis.zhiweidata.com/share/crisisDetails?id={1}&share={2}
crisis.event.url
=
https://crisis.zhiweidata.com/share/crisisDetails?id={1}&share={2}
#\u70ED\u70B9\u5E93\u5916\u90E8\u63A5\u53E3
#\u70ED\u70B9\u5E93\u5916\u90E8\u63A5\u53E3
trends.longTimeInListSearchByInner.url
=
https://trends.zhiweidata.com/hotSearchTrend/inner/longTimeInListSearchByInner?sortType={1}&type={2}&day={3}
trends.longTimeInListSearchByInner.url
=
https://trends.zhiweidata.com/hotSearchTrend/inner/longTimeInListSearchByInner?sortType={1}&type={2}&day={3}
trends.find
HotSearchESDataInTimeByInner.url
=
https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/findHotSearchESDataInTimeByInner?limit={1}&page={2}&type={3}&word={4
}
trends.find
AllPlatformHotSearchESDataInTime.url
=
https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/findAllPlatformHotSearchESDataInTime?limit={1}&page={2}&type={3}&word={4}&sort={5}&startTime={6}&endTime={7
}
trends.longTimeInListSearch.url
=
https://trends.zhiweidata.com/hotSearchTrend/search/longTimeInListSearch?type={1}&sortType=realTime
trends.longTimeInListSearch.url
=
https://trends.zhiweidata.com/hotSearchTrend/search/longTimeInListSearch?type={1}&sortType=realTime
trends.getHotSearchFromEsInTimeAndTypeOrWord.url
=
https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/getHotSearchFromEsInTimeAndTypeOrWord?limit={1}&page={2}&type={3}&word={4}&sort={5}&accurateWord={6}&maskWord={7}
trends.getHotSearchFromEsInTimeAndTypeOrWord.url
=
https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/getHotSearchFromEsInTimeAndTypeOrWord?limit={1}&page={2}&type={3}&word={4}&sort={5}&accurateWord={6}&maskWord={7}
trends.queryHotSearchTrendInner.url
=
https://trends.zhiweidata.com/hotSearchTrend/inner/queryHotSearchTrendInner
trends.queryHotSearchTrendInner.url
=
https://trends.zhiweidata.com/hotSearchTrend/inner/queryHotSearchTrendInner
...
...
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