Commit 60dd258a by leiliangliang

增加图标访问地址,去除描述转图标名方法

parent dd207b89
...@@ -8,24 +8,25 @@ package com.zhiwei.searchhotcrawler.bean; ...@@ -8,24 +8,25 @@ package com.zhiwei.searchhotcrawler.bean;
public enum IconEnum { public enum IconEnum {
/** icon图标转换 */ /** icon图标转换 */
公益("jian_gongyi","益","蓝色"), 公益("jian_gongyi","益","蓝色","https://simg.s.weibo.com/20211014_jian_gongyi.png"),
推荐("recom_yellow","荐","黄色"), 推荐("recom_yellow","荐","黄色","https://simg.s.weibo.com/20200925_recom_yellow.png"),
("boom","爆","深红色"), ("boom","爆","深红色","https://simg.s.weibo.com/20210226_boom.png"),
("fei","沸","深橙色"), ("fei","沸","深橙色","https://simg.s.weibo.com/20210226_fei.png"),
("hot","热","橙色"), ("hot","热","橙色","https://simg.s.weibo.com/20210226_hot.png"),
("new","新","红色"), ("new","新","红色","https://simg.s.weibo.com/20210226_new.png"),
("jian","商","蓝色"), ("jian","商","蓝色","https://simg.s.weibo.com/20210623_jian.png"),
首发("free_issue","首发","蓝色"), 首发("free_issue","首发","蓝色","https://simg.s.weibo.com/20220424_search_ads_%E9%A6%96%E5%8F%91.png"),
预约("appointment","预约","蓝色"), 预约("appointment","预约","蓝色","https://simg.s.weibo.com/20220424_search_ads_%E9%A2%84%E7%BA%A6.png"),
官宣("Officer_xuan","官宣","蓝色"), 官宣("Officer_xuan","官宣","蓝色","https://simg.s.weibo.com/20220424_search_ads_%E5%AE%98%E5%AE%A3.png"),
上新("newest","上新","蓝色"), 上新("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.name = name;
this.describe = describe; this.describe = describe;
this.color = color; this.color = color;
this.iconUrl = iconUrl;
} }
/** 图标名 */ /** 图标名 */
private String name; private String name;
...@@ -33,6 +34,8 @@ public enum IconEnum { ...@@ -33,6 +34,8 @@ public enum IconEnum {
private String describe; private String describe;
/** 图标背景色 */ /** 图标背景色 */
private String color; private String color;
/** 图标地址链接 */
private String iconUrl;
public String getName() { public String getName() {
...@@ -59,11 +62,20 @@ public enum IconEnum { ...@@ -59,11 +62,20 @@ public enum IconEnum {
this.color = color; this.color = color;
} }
public String getIconUrl() {
return iconUrl;
}
public void setIconUrl(String iconUrl) {
this.iconUrl = iconUrl;
}
@Override @Override
public String toString() { public String toString() {
return "IconEnum{" + return "IconEnum{" +
"name='" + name + '\'' + "name='" + name + '\'' +
", describe='" + describe + '\'' + ", describe='" + describe + '\'' +
", color='" + color + '\'' + ", color='" + color + '\'' +
", iconUrl='" + iconUrl + '\'' +
'}'; '}';
}} }}
...@@ -11,21 +11,7 @@ import java.util.stream.Collectors; ...@@ -11,21 +11,7 @@ import java.util.stream.Collectors;
public class IconName { public class IconName {
private static Logger logger = LogManager.getLogger(IconName.class.getName()); 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;
}
/** /**
* 图标名转换成描述 * 图标名转换成描述
......
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