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
06d51b4f
Commit
06d51b4f
authored
Jun 21, 2023
by
shentao
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'release' into 'master'
Release See merge request
!346
parents
add5a1d5
614b7720
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
151 additions
and
10 deletions
+151
-10
pom.xml
+1
-1
src/main/java/com/zhiwei/brandkbs2/common/RedisKeyPrefix.java
+5
-0
src/main/java/com/zhiwei/brandkbs2/config/Constant.java
+1
-0
src/main/java/com/zhiwei/brandkbs2/controller/app/AppHotController.java
+0
-0
src/main/java/com/zhiwei/brandkbs2/enmus/HotPlatformEnum.java
+57
-0
src/main/java/com/zhiwei/brandkbs2/pojo/vo/SupplementWord.java
+41
-0
src/main/java/com/zhiwei/brandkbs2/service/CommonService.java
+2
-0
src/main/java/com/zhiwei/brandkbs2/service/impl/CommonServiceImpl.java
+7
-0
src/main/java/com/zhiwei/brandkbs2/util/RedisUtil.java
+27
-6
src/main/resources/application-dev.properties
+3
-1
src/main/resources/application-local.properties
+4
-1
src/main/resources/application-prod.properties
+3
-1
No files found.
pom.xml
View file @
06d51b4f
...
...
@@ -25,7 +25,7 @@
<java.version>
1.8
</java.version>
<springboot.version>
2.2.5.RELEASE
</springboot.version>
<qbjc.bean.version>
1.1.7.1-SNAPSHOT
</qbjc.bean.version>
<springfox.version>
2.
7.0
</springfox.version>
<springfox.version>
2.
9.2
</springfox.version>
<fastjson.version>
1.2.47
</fastjson.version>
<easyexcel.version>
3.0.5
</easyexcel.version>
<marker.client.version>
1.1.9-SNAPSHOT
</marker.client.version>
...
...
src/main/java/com/zhiwei/brandkbs2/common/RedisKeyPrefix.java
View file @
06d51b4f
...
...
@@ -63,6 +63,7 @@ public class RedisKeyPrefix {
public
static
final
String
HOT_RANK_LIST
=
"BRANDKBS:HOT:RANK_LIST:"
;
public
static
final
String
HOT_LIST
=
"BRANDKBS:HOT:LIST:"
;
public
static
final
String
HOT_KEYWORD
=
"BRANDKBS:HOT:KEYWORD:"
;
public
static
final
String
HOT_SUPPLEMENT_WORD
=
"BRANDKBS:HOT:SUPPLEMENT_WORD:"
;
/**
* 项目简报报相关缓存KEY
...
...
@@ -125,6 +126,10 @@ public class RedisKeyPrefix {
return
RedisKeyPrefix
.
generateRedisKey
(
RedisKeyPrefix
.
HOT_KEYWORD
,
projectId
);
}
public
static
String
supplementWordKey
(
String
projectId
)
{
return
RedisKeyPrefix
.
generateRedisKey
(
RedisKeyPrefix
.
HOT_SUPPLEMENT_WORD
,
projectId
);
}
private
static
String
generateRedisKey
(
String
...
keys
)
{
Objects
.
requireNonNull
(
keys
);
boolean
contains
=
keys
[
0
].
endsWith
(
":"
);
...
...
src/main/java/com/zhiwei/brandkbs2/config/Constant.java
View file @
06d51b4f
...
...
@@ -16,6 +16,7 @@ public class Constant {
public
static
final
Long
ONE_DAY
=
24
*
60
*
60
*
1000L
;
public
static
final
Long
ONE_WEEK
=
7
*
24
*
60
*
60
*
1000L
;
public
static
final
Long
ONE_MONTH
=
30
*
24
*
60
*
60
*
1000L
;
public
static
final
Long
ONE_YEAR
=
ONE_MONTH
*
12
;
public
static
final
String
SPEC_MINUTE_PATTERN
=
"yyyy.MM.dd HH:mm"
;
public
static
final
String
HOUR_PATTERN
=
"yyyy-MM-dd HH"
;
...
...
src/main/java/com/zhiwei/brandkbs2/controller/app/AppHotController.java
View file @
06d51b4f
This diff is collapsed.
Click to expand it.
src/main/java/com/zhiwei/brandkbs2/enmus/HotPlatformEnum.java
0 → 100644
View file @
06d51b4f
package
com
.
zhiwei
.
brandkbs2
.
enmus
;
import
lombok.Getter
;
import
java.util.HashMap
;
import
java.util.Map
;
/**
* @ClassName: HotPlatformEnum
* @Description 热搜中间件返回平台枚举
* @author: sjj
* @date: 2023-06-13 14:30
*/
@Getter
public
enum
HotPlatformEnum
{
WEIBO
(
"微博"
,
"weibo"
,
"微博热搜"
),
WEIBO_TOPIC
(
"微博"
,
"weibo-topic"
,
"微博话题"
),
WEIBO_RISE
(
"微博"
,
"weibo-rise"
,
"微博预热榜"
),
ZHIHU
(
"知乎"
,
"zhihu"
,
"知乎热搜"
),
JINRITOUTIAO
(
"今日头条"
,
"toutiao"
,
"今日头条热搜"
),
DOUYIN
(
"抖音"
,
"douyin"
,
"抖音热搜"
),
BILIBILI
(
"B站"
,
"bilibili-ranking"
,
"B站热搜"
),
KUAISHOU
(
"快手"
,
"kuaishou"
,
"快手热榜"
),
BAIDU
(
"百度"
,
"baidu"
,
"百度热搜"
);
private
final
String
platform
;
private
final
String
engName
;
private
final
String
name
;
private
static
final
Map
<
String
,
String
>
CONVERT_MAP
=
new
HashMap
<>();
static
{
for
(
HotPlatformEnum
platform
:
HotPlatformEnum
.
values
())
{
CONVERT_MAP
.
put
(
platform
.
name
,
platform
.
platform
);
}
}
HotPlatformEnum
(
String
platform
,
String
engName
,
String
name
)
{
this
.
platform
=
platform
;
this
.
engName
=
engName
;
this
.
name
=
name
;
}
public
static
String
convertPlatform
(
String
name
)
{
return
CONVERT_MAP
.
get
(
name
);
}
public
static
String
convertFromName2Eng
(
String
name
)
{
for
(
HotPlatformEnum
platform
:
HotPlatformEnum
.
values
())
{
if
(
name
.
equals
(
platform
.
name
))
{
return
platform
.
engName
;
}
}
return
name
;
}
}
src/main/java/com/zhiwei/brandkbs2/pojo/vo/SupplementWord.java
0 → 100644
View file @
06d51b4f
package
com
.
zhiwei
.
brandkbs2
.
pojo
.
vo
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
/**
* @ClassName: SupplementWord
* @Description SupplementWord
* @author: sjj
* @date: 2023-06-12 17:42
*/
@Data
@NoArgsConstructor
public
class
SupplementWord
{
/**
* 补录标题
*/
private
String
title
;
/**
* 更新时间
*/
private
Long
updateTime
;
/**
* 提交人
*/
private
String
submitter
;
public
SupplementWord
(
String
title
,
String
submitter
)
{
this
.
title
=
title
;
this
.
submitter
=
submitter
;
this
.
updateTime
=
System
.
currentTimeMillis
();
}
public
String
uniqueKey
()
{
return
title
+
updateTime
;
}
}
src/main/java/com/zhiwei/brandkbs2/service/CommonService.java
View file @
06d51b4f
...
...
@@ -59,6 +59,8 @@ public interface CommonService {
*/
void
addMtagBatch
(
List
<
MarkInfo
>
markInfos
);
Long
[]
getTimeRangeYear
();
Long
[]
getTimeRangeMonth
();
Long
[]
getTimeRangeWeek
();
...
...
src/main/java/com/zhiwei/brandkbs2/service/impl/CommonServiceImpl.java
View file @
06d51b4f
...
...
@@ -132,6 +132,13 @@ public class CommonServiceImpl implements CommonService {
}
@Override
public
Long
[]
getTimeRangeYear
()
{
long
endTime
=
Tools
.
truncDate
(
new
Date
(),
Constant
.
DAY_PATTERN
).
getTime
();
long
startTime
=
DateUtils
.
addYears
(
new
Date
(
endTime
),
-
1
).
getTime
();
return
new
Long
[]{
startTime
,
endTime
};
}
@Override
public
Long
[]
getTimeRangeMonth
()
{
long
endTime
=
Tools
.
truncDate
(
new
Date
(),
Constant
.
DAY_PATTERN
).
getTime
();
long
startTime
=
DateUtils
.
addMonths
(
new
Date
(
endTime
),
-
1
).
getTime
();
...
...
src/main/java/com/zhiwei/brandkbs2/util/RedisUtil.java
View file @
06d51b4f
...
...
@@ -2,6 +2,7 @@ package com.zhiwei.brandkbs2.util;
import
com.zhiwei.brandkbs2.common.RedisKeyPrefix
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.redis.core.HashOperations
;
import
org.springframework.data.redis.core.StringRedisTemplate
;
import
org.springframework.stereotype.Component
;
...
...
@@ -92,15 +93,35 @@ public class RedisUtil {
return
stringRedisTemplate
.
keys
(
key
);
}
public
void
setListLeft
(
String
key
,
String
value
)
{
if
(
null
==
key
)
{
return
;
public
List
<
Object
>
getMapValueAll
(
String
key
)
{
return
stringRedisTemplate
.
opsForHash
().
values
(
key
);
}
public
boolean
setMapValue
(
String
key
,
String
field
,
String
value
)
{
HashOperations
<
String
,
Object
,
Object
>
operations
=
stringRedisTemplate
.
opsForHash
();
Boolean
result
=
operations
.
putIfAbsent
(
key
,
field
,
value
);
return
Boolean
.
TRUE
.
equals
(
result
);
}
public
boolean
resetMapValue
(
String
key
,
String
field
,
String
newField
,
String
value
)
{
HashOperations
<
String
,
Object
,
Object
>
operations
=
stringRedisTemplate
.
opsForHash
();
if
(
operations
.
hasKey
(
key
,
field
))
{
operations
.
put
(
key
,
newField
,
value
);
deleteMapValue
(
key
,
field
);
return
true
;
}
return
false
;
}
public
void
deleteMapValue
(
String
key
,
String
field
)
{
HashOperations
<
String
,
Object
,
Object
>
operations
=
stringRedisTemplate
.
opsForHash
();
if
(
operations
.
hasKey
(
key
,
field
))
{
operations
.
delete
(
key
,
field
);
}
stringRedisTemplate
.
opsForList
().
leftPush
(
key
,
value
);
}
public
List
<
String
>
getListAll
(
String
key
)
{
return
stringRedisTemplate
.
opsFor
List
().
range
(
key
,
0
,
-
1
);
public
long
getMapSize
(
String
key
)
{
return
stringRedisTemplate
.
opsFor
Hash
().
size
(
key
);
}
public
void
remove
(
String
key
)
{
...
...
src/main/resources/application-dev.properties
View file @
06d51b4f
...
...
@@ -84,7 +84,9 @@ crisis.event.url =https://crisis.zhiweidata.com/event/{1}/general?share={2}
trends.longTimeInListSearchByInner.url
=
https://trends.zhiweidata.com/hotSearchTrend/inner/longTimeInListSearchByInner?sortType={1}&type={2}&day={3}
trends.findHotSearchESDataInTimeByInner.url
=
https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/findHotSearchESDataInTimeByInner?limit={1}&page={2}&type={3}&word={4}
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}
trends.getHotSearchFromEsInTimeAndTypeOrWord.url
=
https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/getHotSearchFromEsInTimeAndTypeOrWord?limit={1}&page={2}&type={3}&word={4}&sort={5
\}
&accurateWord={6}
trends.queryHotSearchTrendInner.url
=
https://trends.zhiweidata.com/hotSearchTrend/inner/queryHotSearchTrendInner?name={1}&startTime={2}&type={3}
trends.getHotSearchSnapshot.url
=
https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/getHotSearchSnapshot?type={1}&time={2}&rank={3}
#\u4E8B\u4EF6\u5E93\u5916\u90E8\u63A5\u53E3
ef.search.url
=
https://ef.zhiweidata.com/external/search.do?name={1}&page={2}
ef.searchCriteria.url
=
https://ef.zhiweidata.com/index/getSearchKey.do
...
...
src/main/resources/application-local.properties
View file @
06d51b4f
...
...
@@ -87,7 +87,10 @@ crisis.event.url =https://crisis.zhiweidata.com/event/{1}/general?share={2}
trends.longTimeInListSearchByInner.url
=
https://trends.zhiweidata.com/hotSearchTrend/inner/longTimeInListSearchByInner?sortType={1}&type={2}&day={3}
trends.findHotSearchESDataInTimeByInner.url
=
https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/findHotSearchESDataInTimeByInner?limit={1}&page={2}&type={3}&word={4}
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}
trends.getHotSearchFromEsInTimeAndTypeOrWord.url
=
http://192.168.0.192:9091/hotsearch/hotSearch/getHotSearchFromEsInTimeAndTypeOrWord?limit={1}&page={2}&type={3}&word={4}&sort={5}&accurateWord={6}
trends.queryHotSearchTrendInner.url
=
http://192.168.27.203:9094/hotSearchTrend/inner/queryHotSearchTrendInner?name={1}&startTime={2}&type={3}
trends.getHotSearchSnapshot.url
=
https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/getHotSearchSnapshot?type={1}&time={2}&rank={3}
#\u4E8B\u4EF6\u5E93\u5916\u90E8\u63A5\u53E3
ef.search.url
=
https://ef.zhiweidata.com/external/search.do?name={1}&page={2}&size={3}
ef.searchCriteria.url
=
https://ef.zhiweidata.com/index/getSearchKey.do
...
...
src/main/resources/application-prod.properties
View file @
06d51b4f
...
...
@@ -84,7 +84,9 @@ crisis.event.url =https://crisis.zhiweidata.com/event/{1}/general?share={2}
trends.longTimeInListSearchByInner.url
=
https://trends.zhiweidata.com/hotSearchTrend/inner/longTimeInListSearchByInner?sortType={1}&type={2}&day={3}
trends.findHotSearchESDataInTimeByInner.url
=
https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/findHotSearchESDataInTimeByInner?limit={1}&page={2}&type={3}&word={4}
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}
trends.getHotSearchFromEsInTimeAndTypeOrWord.url
=
https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/getHotSearchFromEsInTimeAndTypeOrWord?limit={1}&page={2}&type={3}&word={4}&sort={5}&accurateWord={6}
trends.queryHotSearchTrendInner.url
=
https://trends.zhiweidata.com/hotSearchTrend/inner/queryHotSearchTrendInner?name={1}&startTime={2}&type={3}
trends.getHotSearchSnapshot.url
=
https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/getHotSearchSnapshot?type={1}&time={2}&rank={3}
#\u4E8B\u4EF6\u5E93\u5916\u90E8\u63A5\u53E3
ef.search.url
=
https://ef.zhiweidata.com/external/search.do?name={1}&page={2}
ef.searchCriteria.url
=
https://ef.zhiweidata.com/index/getSearchKey.do
...
...
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