Merge branch 'main' into feature/240101-tag

main
itao 11 months ago
commit f4f909eda8

@ -33,6 +33,13 @@
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-config</artifactId>
</dependency>
<dependency>
<groupId>net.renfei</groupId>
<artifactId>ip2location</artifactId>
<version>1.2.1</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-bus</artifactId>

@ -0,0 +1,2 @@
# 解析IP三方库
https://github.com/jarod/qqwry-java

@ -0,0 +1,15 @@
package com.luoo.comment.config;
import org.springframework.context.ResourceLoaderAware;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.io.ResourceLoader;
@Configuration
public class MyConfiguration implements ResourceLoaderAware {
private ResourceLoader resourceLoader;
@Override
public void setResourceLoader(ResourceLoader resourceLoader) {
this.resourceLoader = resourceLoader;
}
}

@ -0,0 +1,59 @@
package com.luoo.comment.enums;
public enum Province {
BEIJING("Beijing", "北京"),
TIANJIN("Tianjin", "天津"),
SHANGHAI("Shanghai", "上海"),
CHONGQING("Chongqing", "重庆"),
HEBEI("Hebei", "河北"),
SHANXI("Shanxi", "山西"),
LIAONING("Liaoning", "辽宁"),
JILIN("Jilin", "吉林"),
HEILONGJIANG("Heilongjiang", "黑龙江"),
JIANGSU("Jiangsu", "江苏"),
ZHEJIANG("Zhejiang", "浙江"),
ANHUI("Anhui", "安徽"),
FUJIAN("Fujian", "福建"),
JIANGXI("Jiangxi", "江西"),
SHANDONG("Shandong", "山东"),
HENAN("Henan", "河南"),
HUBEI("Hubei", "湖北"),
HUNAN("Hunan", "湖南"),
GUANGDONG("Guangdong", "广东"),
GUANGXI("Guangxi", "广西"),
HAINAN("Hainan", "海南"),
SICHUAN("Sichuan", "四川"),
GUIZHOU("Guizhou", "贵州"),
YUNNAN("Yunnan", "云南"),
TIBET("Tibet", "西藏"),
SHAANXI("Shaanxi", "陕西"),
GANSU("Gansu", "甘肃"),
QINGHAI("Qinghai", "青海"),
NINGXIA("Ningxia", "宁夏"),
XINJIANG("Xinjiang", "新疆");
private final String englishName;
private final String chineseName;
Province(String englishName, String chineseName) {
this.englishName = englishName;
this.chineseName = chineseName;
}
public String getEnglishName() {
return englishName;
}
public String getChineseName() {
return chineseName;
}
public static String getCityName(String englishName) {
for (Province province : Province.values()) {
if (englishName.equalsIgnoreCase(province.englishName)) {
return province.chineseName;
}
}
return "未知IP";
}
}

@ -9,15 +9,26 @@ public class Comment implements Serializable {
@Id
private String _id;
// 评论内容
private String content;
// 发布时间
private Date publishtime;
private String userid;
// 昵称
private String nickname;
// 访问数
private Integer visits;
// 点赞数
private Integer thumbup;
// 转发数
private Integer share;
// 评论数量
private Integer comment;
// 状态
private String state;
private String parentid;
private String articleid;

Loading…
Cancel
Save