From eb8ae2f65db85fe6b3f6ae31347e05e42df70f58 Mon Sep 17 00:00:00 2001 From: changjunqiang <344656718@qq.com> Date: Wed, 17 Jun 2026 23:14:31 +0800 Subject: [PATCH] duli --- pom.xml | 93 ++++++++++++++++--- .../com/rszhihui/web/service/NewsService.java | 4 +- 2 files changed, 83 insertions(+), 14 deletions(-) diff --git a/pom.xml b/pom.xml index 03936c1..eec450f 100644 --- a/pom.xml +++ b/pom.xml @@ -3,15 +3,9 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - - com.rszhihui - zhihui - 1.0 - - com.rszhihui rongshuo - + 1.0 8 8 @@ -23,11 +17,13 @@ org.springframework.boot spring-boot-starter-test + 2.4.2 org.springframework.boot spring-boot-starter-web + 2.4.2 @@ -38,18 +34,64 @@ org.springframework.boot - spring-boot-starter-thymeleaf + spring-boot-starter-log4j2 + 2.4.2 + + org.projectlombok + lombok + 1.18.26 + provided + + + + + com.baomidou + mybatis-plus-boot-starter + 3.4.2 + + + com.alibaba + druid-spring-boot-starter + 1.2.16 + + + mysql + mysql-connector-java + 8.0.33 + + + org.springframework.boot + spring-boot-starter-thymeleaf + 2.4.2 + + + + + cn.hutool + hutool-all + 5.8.15 + + + com.google.zxing + core + 3.4.1 + + com.alibaba fastjson 2.0.25 - commons-io - commons-io - 2.17.0 - compile + com.squareup.okhttp3 + okhttp + 4.9.3 + + + io.swagger + swagger-annotations + 1.6.2 @@ -58,6 +100,7 @@ org.springframework.boot spring-boot-maven-plugin + 2.4.2 com.rszhihui.web.RongShuoApplication ZIP @@ -72,4 +115,30 @@ + + + + aliyun + https://maven.aliyun.com/repository/public + + true + + + false + + + + + + + aliyun-plugin + https://maven.aliyun.com/repository/public + + true + + + false + + + \ No newline at end of file diff --git a/src/main/java/com/rszhihui/web/service/NewsService.java b/src/main/java/com/rszhihui/web/service/NewsService.java index 564d4d3..5cb2521 100644 --- a/src/main/java/com/rszhihui/web/service/NewsService.java +++ b/src/main/java/com/rszhihui/web/service/NewsService.java @@ -3,12 +3,12 @@ package com.rszhihui.web.service; import com.alibaba.fastjson2.JSON; import com.alibaba.fastjson2.JSONObject; import com.rszhihui.web.model.NewsItem; -import org.apache.commons.io.IOUtils; import org.springframework.stereotype.Service; import javax.annotation.PostConstruct; import java.io.InputStream; import java.nio.charset.StandardCharsets; +import cn.hutool.core.io.IoUtil; import java.util.List; import java.util.Optional; import java.util.stream.Collectors; @@ -25,7 +25,7 @@ public class NewsService { try { // 使用Fastjson加载JSON数据 InputStream is = getClass().getResourceAsStream("/data/news-data.json"); - String jsonStr = IOUtils.toString(is, StandardCharsets.UTF_8); + String jsonStr = IoUtil.read(is, StandardCharsets.UTF_8); JSONObject jsonObject = JSON.parseObject(jsonStr);