Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
searchhotcrawler
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
zhiwei
searchhotcrawler
Commits
60dd258a
Commit
60dd258a
authored
Sep 16, 2022
by
leiliangliang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加图标访问地址,去除描述转图标名方法
parent
dd207b89
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
27 deletions
+25
-27
src/main/java/com/zhiwei/searchhotcrawler/bean/IconEnum.java
+24
-12
src/main/java/com/zhiwei/searchhotcrawler/bean/IconName.java
+1
-15
No files found.
src/main/java/com/zhiwei/searchhotcrawler/bean/IconEnum.java
View file @
60dd258a
...
...
@@ -8,24 +8,25 @@ package com.zhiwei.searchhotcrawler.bean;
public
enum
IconEnum
{
/** icon图标转换 */
公益
(
"jian_gongyi"
,
"益"
,
"蓝色"
),
推荐
(
"recom_yellow"
,
"荐"
,
"黄色"
),
爆
(
"boom"
,
"爆"
,
"深红色"
),
沸
(
"fei"
,
"沸"
,
"深橙色"
),
热
(
"hot"
,
"热"
,
"橙色"
),
新
(
"new"
,
"新"
,
"红色"
),
商
(
"jian"
,
"商"
,
"蓝色"
),
首发
(
"free_issue"
,
"首发"
,
"蓝色"
),
预约
(
"appointment"
,
"预约"
,
"蓝色"
),
官宣
(
"Officer_xuan"
,
"官宣"
,
"蓝色"
),
上新
(
"newest"
,
"上新"
,
"蓝色"
),
公益
(
"jian_gongyi"
,
"益"
,
"蓝色"
,
"https://simg.s.weibo.com/20211014_jian_gongyi.png"
),
推荐
(
"recom_yellow"
,
"荐"
,
"黄色"
,
"https://simg.s.weibo.com/20200925_recom_yellow.png"
),
爆
(
"boom"
,
"爆"
,
"深红色"
,
"https://simg.s.weibo.com/20210226_boom.png"
),
沸
(
"fei"
,
"沸"
,
"深橙色"
,
"https://simg.s.weibo.com/20210226_fei.png"
),
热
(
"hot"
,
"热"
,
"橙色"
,
"https://simg.s.weibo.com/20210226_hot.png"
),
新
(
"new"
,
"新"
,
"红色"
,
"https://simg.s.weibo.com/20210226_new.png"
),
商
(
"jian"
,
"商"
,
"蓝色"
,
"https://simg.s.weibo.com/20210623_jian.png"
),
首发
(
"free_issue"
,
"首发"
,
"蓝色"
,
"https://simg.s.weibo.com/20220424_search_ads_%E9%A6%96%E5%8F%91.png"
),
预约
(
"appointment"
,
"预约"
,
"蓝色"
,
"https://simg.s.weibo.com/20220424_search_ads_%E9%A2%84%E7%BA%A6.png"
),
官宣
(
"Officer_xuan"
,
"官宣"
,
"蓝色"
,
"https://simg.s.weibo.com/20220424_search_ads_%E5%AE%98%E5%AE%A3.png"
),
上新
(
"newest"
,
"上新"
,
"蓝色"
,
"https://simg.s.weibo.com/20220424_search_ads_%E4%B8%8A%E6%96%B0.png"
),
;
IconEnum
(
String
name
,
String
describe
,
String
color
)
{
IconEnum
(
String
name
,
String
describe
,
String
color
,
String
iconUrl
)
{
this
.
name
=
name
;
this
.
describe
=
describe
;
this
.
color
=
color
;
this
.
iconUrl
=
iconUrl
;
}
/** 图标名 */
private
String
name
;
...
...
@@ -33,6 +34,8 @@ public enum IconEnum {
private
String
describe
;
/** 图标背景色 */
private
String
color
;
/** 图标地址链接 */
private
String
iconUrl
;
public
String
getName
()
{
...
...
@@ -59,11 +62,20 @@ public enum IconEnum {
this
.
color
=
color
;
}
public
String
getIconUrl
()
{
return
iconUrl
;
}
public
void
setIconUrl
(
String
iconUrl
)
{
this
.
iconUrl
=
iconUrl
;
}
@Override
public
String
toString
()
{
return
"IconEnum{"
+
"name='"
+
name
+
'\''
+
", describe='"
+
describe
+
'\''
+
", color='"
+
color
+
'\''
+
", iconUrl='"
+
iconUrl
+
'\''
+
'}'
;
}}
src/main/java/com/zhiwei/searchhotcrawler/bean/IconName.java
View file @
60dd258a
...
...
@@ -11,21 +11,7 @@ import java.util.stream.Collectors;
public
class
IconName
{
private
static
Logger
logger
=
LogManager
.
getLogger
(
IconName
.
class
.
getName
());
/**
* 描述转换成描述图标名
*
* @param describe
* @return
*/
public
String
describeChangeName
(
String
describe
)
{
for
(
IconEnum
iconEnum
:
IconEnum
.
values
())
{
if
(
iconEnum
.
getDescribe
().
equals
(
describe
)){
return
iconEnum
.
getName
();
}
}
logger
.
error
(
"未找到相应热搜名称,describe={}"
,
describe
);
return
null
;
}
/**
* 图标名转换成描述
...
...
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