♻️Refactor: 微服务重构
This commit is contained in:
@@ -11,6 +11,14 @@
|
|||||||
|
|
||||||
<artifactId>common</artifactId>
|
<artifactId>common</artifactId>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.projectlombok</groupId>
|
||||||
|
<artifactId>lombok</artifactId>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<maven.compiler.source>21</maven.compiler.source>
|
<maven.compiler.source>21</maven.compiler.source>
|
||||||
<maven.compiler.target>21</maven.compiler.target>
|
<maven.compiler.target>21</maven.compiler.target>
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package cn.hezhaohui.common;
|
package cn.hezhaohui.weather.common;
|
||||||
|
|
||||||
public class AIConstant {
|
public class AIConstant {
|
||||||
|
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package cn.hezhaohui.common;
|
package cn.hezhaohui.weather.common;
|
||||||
|
|
||||||
public class AppConstant {
|
public class AppConstant {
|
||||||
|
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package cn.hezhaohui.common;
|
package cn.hezhaohui.weather.common;
|
||||||
|
|
||||||
public enum CardEnum {
|
public enum CardEnum {
|
||||||
CARD_WEATHER("AAqxas5etOJDx", "1.0.5");
|
CARD_WEATHER("AAqxas5etOJDx", "1.0.5");
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package cn.hezhaohui.common;
|
package cn.hezhaohui.weather.common;
|
||||||
|
|
||||||
public class WeatherConstant {
|
public class WeatherConstant {
|
||||||
|
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package cn.hezhaohui.entity;
|
package cn.hezhaohui.weather.entity;
|
||||||
|
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
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">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>cn.hezhaohui</groupId>
|
||||||
|
<artifactId>lark-panel</artifactId>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>eureka</artifactId>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<maven.compiler.source>21</maven.compiler.source>
|
||||||
|
<maven.compiler.target>21</maven.compiler.target>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
</project>
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package cn.hezhaohui.eureka;
|
||||||
|
|
||||||
|
import org.springframework.boot.SpringApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;
|
||||||
|
|
||||||
|
@SpringBootApplication
|
||||||
|
@EnableEurekaServer
|
||||||
|
public class EurekaServerApplication {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
SpringApplication.run(EurekaServerApplication.class, args);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
server:
|
||||||
|
port: 8761
|
||||||
|
|
||||||
|
spring:
|
||||||
|
application:
|
||||||
|
name: eureka-server
|
||||||
|
|
||||||
|
eureka:
|
||||||
|
instance:
|
||||||
|
hostname: localhost
|
||||||
|
client:
|
||||||
|
register-with-eureka: false
|
||||||
|
fetch-registry: false
|
||||||
|
service-url:
|
||||||
|
defaultZone:
|
||||||
|
http://${eureka.instance.hostname}:${server.port}/eureka/
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
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">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>cn.hezhaohui</groupId>
|
||||||
|
<artifactId>lark-panel</artifactId>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>gateway</artifactId>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-loadbalancer</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-gateway</artifactId>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<maven.compiler.source>21</maven.compiler.source>
|
||||||
|
<maven.compiler.target>21</maven.compiler.target>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
</project>
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package cn.hezhaohui.gateway;
|
||||||
|
|
||||||
|
import org.springframework.boot.SpringApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
||||||
|
|
||||||
|
@SpringBootApplication
|
||||||
|
@EnableDiscoveryClient
|
||||||
|
public class GatewayApplication {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
SpringApplication.run(GatewayApplication.class, args);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
spring:
|
||||||
|
application:
|
||||||
|
name: api-gateway
|
||||||
|
cloud:
|
||||||
|
gateway:
|
||||||
|
routes:
|
||||||
|
# 路由到service-weather服务
|
||||||
|
- id: service-weather
|
||||||
|
uri: lb://service-weather
|
||||||
|
predicates:
|
||||||
|
- Path=/api/weather/**
|
||||||
|
filters:
|
||||||
|
- StripPrefix=2
|
||||||
|
# 路由到service-consumer服务
|
||||||
|
- id: service-consumer
|
||||||
|
uri: lb://service-consumer
|
||||||
|
predicates:
|
||||||
|
- Path=/api/consumer/**
|
||||||
|
filters:
|
||||||
|
- StripPrefix=2
|
||||||
|
# 全局过滤器配置
|
||||||
|
globalcors:
|
||||||
|
cors-configurations:
|
||||||
|
"[/**]":
|
||||||
|
allowedOriginPatterns: "*"
|
||||||
|
allowedMethods: "*"
|
||||||
|
allowedHeaders: "*"
|
||||||
|
|
||||||
|
server:
|
||||||
|
port: 8081
|
||||||
|
|
||||||
|
|
||||||
|
eureka:
|
||||||
|
client:
|
||||||
|
service-url:
|
||||||
|
defaultZone: http://localhost:8761/eureka/
|
||||||
+2
-3
@@ -18,9 +18,8 @@
|
|||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>cn.hezhaohui</groupId>
|
<groupId>org.springframework.cloud</groupId>
|
||||||
<artifactId>weather</artifactId>
|
<artifactId>spring-cloud-starter-openfeign</artifactId>
|
||||||
<version>1.0.0</version>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|||||||
+7
-5
@@ -1,16 +1,18 @@
|
|||||||
package cn.hezhaohui.lark;
|
package cn.hezhaohui.lark;
|
||||||
|
|
||||||
|
import cn.hezhaohui.lark.client.WeatherClient;
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
import org.springframework.context.annotation.ComponentScan;
|
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||||
|
|
||||||
import static cn.hezhaohui.lark.handler.EventListener.larkClientStart;
|
import static cn.hezhaohui.lark.handler.EventListener.larkClientStart;
|
||||||
|
|
||||||
@SpringBootApplication
|
@SpringBootApplication
|
||||||
@ComponentScan(basePackages = "cn.hezhaohui")
|
@EnableFeignClients
|
||||||
public class Application {
|
public class LarkApplication {
|
||||||
public static void main(String[] args) throws Exception {
|
|
||||||
SpringApplication.run(Application.class, args);
|
public static void main(String[] args) {
|
||||||
|
SpringApplication.run(LarkApplication.class, args);
|
||||||
larkClientStart();
|
larkClientStart();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package cn.hezhaohui.lark.client;
|
||||||
|
|
||||||
|
import cn.hezhaohui.weather.entity.Weather;
|
||||||
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
|
||||||
|
@FeignClient(name = "service-weather")
|
||||||
|
public interface WeatherClient {
|
||||||
|
|
||||||
|
@GetMapping("get")
|
||||||
|
Weather getWeather();
|
||||||
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
package cn.hezhaohui.lark.handler;
|
package cn.hezhaohui.lark.handler;
|
||||||
|
|
||||||
import cn.hezhaohui.common.AppConstant;
|
import cn.hezhaohui.weather.common.AppConstant;
|
||||||
import com.lark.oapi.core.request.EventReq;
|
import com.lark.oapi.core.request.EventReq;
|
||||||
import com.lark.oapi.core.utils.Jsons;
|
import com.lark.oapi.core.utils.Jsons;
|
||||||
import com.lark.oapi.event.CustomEventHandler;
|
import com.lark.oapi.event.CustomEventHandler;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package cn.hezhaohui.lark.util;
|
package cn.hezhaohui.lark.util;
|
||||||
|
|
||||||
import cn.hezhaohui.common.AppConstant;
|
import cn.hezhaohui.weather.common.AppConstant;
|
||||||
import cn.hezhaohui.common.CardEnum;
|
import cn.hezhaohui.weather.common.CardEnum;
|
||||||
import cn.hutool.core.util.IdUtil;
|
import cn.hutool.core.util.IdUtil;
|
||||||
import cn.hutool.json.JSONUtil;
|
import cn.hutool.json.JSONUtil;
|
||||||
import com.google.gson.JsonParser;
|
import com.google.gson.JsonParser;
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
spring:
|
||||||
|
application:
|
||||||
|
name: lark
|
||||||
|
server:
|
||||||
|
port: 8082
|
||||||
|
|
||||||
|
service-weather:
|
||||||
|
url: http://localhost:8081/api/weather
|
||||||
@@ -1,17 +1,17 @@
|
|||||||
package cn.hezhaohui.lark.util;
|
package cn.hezhaohui.lark.util;
|
||||||
|
|
||||||
|
import cn.hezhaohui.lark.client.WeatherClient;
|
||||||
import cn.hezhaohui.common.CardEnum;
|
import cn.hezhaohui.weather.common.CardEnum;
|
||||||
import cn.hezhaohui.util.SpringContextUtil;
|
import cn.hezhaohui.weather.entity.Weather;
|
||||||
import cn.hezhaohui.util.WeatherUtil;
|
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.springframework.boot.test.context.SpringBootTest;
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
|
|
||||||
@SpringBootTest
|
@SpringBootTest
|
||||||
class LarkUtilTest {
|
class LarkUtilTest {
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private SpringContextUtil springContextUtil;
|
private WeatherClient weatherClient;
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void sendText() throws Exception {
|
void sendText() throws Exception {
|
||||||
@@ -20,6 +20,7 @@ class LarkUtilTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
void sendCard() throws Exception {
|
void sendCard() throws Exception {
|
||||||
LarkUtil.sendCard(CardEnum.CARD_WEATHER, WeatherUtil.getWeather());
|
Weather weather = weatherClient.getWeather();
|
||||||
|
LarkUtil.sendCard(CardEnum.CARD_WEATHER, weather);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -16,6 +16,8 @@
|
|||||||
<module>lark</module>
|
<module>lark</module>
|
||||||
<module>weather</module>
|
<module>weather</module>
|
||||||
<module>common</module>
|
<module>common</module>
|
||||||
|
<module>eureka</module>
|
||||||
|
<module>gateway</module>
|
||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
<!-- 依赖管理 -->
|
<!-- 依赖管理 -->
|
||||||
@@ -24,7 +26,14 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-dependencies</artifactId>
|
<artifactId>spring-boot-dependencies</artifactId>
|
||||||
<version>3.2.2</version>
|
<version>3.3.13</version>
|
||||||
|
<type>pom</type>
|
||||||
|
<scope>import</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-dependencies</artifactId>
|
||||||
|
<version>2023.0.6</version>
|
||||||
<type>pom</type>
|
<type>pom</type>
|
||||||
<scope>import</scope>
|
<scope>import</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|||||||
@@ -12,15 +12,32 @@
|
|||||||
<artifactId>weather</artifactId>
|
<artifactId>weather</artifactId>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-web</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.ai</groupId>
|
<groupId>org.springframework.ai</groupId>
|
||||||
<artifactId>spring-ai-starter-model-openai</artifactId>
|
<artifactId>spring-ai-starter-model-openai</artifactId>
|
||||||
<version>1.0.3</version>
|
<version>1.0.3</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.projectlombok</groupId>
|
<groupId>org.projectlombok</groupId>
|
||||||
<artifactId>lombok</artifactId>
|
<artifactId>lombok</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-netflix-eureka-client</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-loadbalancer</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>cn.hutool</groupId>
|
<groupId>cn.hutool</groupId>
|
||||||
<artifactId>hutool-all</artifactId>
|
<artifactId>hutool-all</artifactId>
|
||||||
|
|||||||
+3
-3
@@ -1,11 +1,11 @@
|
|||||||
package cn.hezhaohui;
|
package cn.hezhaohui.weather;
|
||||||
|
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
|
||||||
@SpringBootApplication
|
@SpringBootApplication
|
||||||
public class Application {
|
public class WeatherApplication {
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
SpringApplication.run(Application.class, args);
|
SpringApplication.run(WeatherApplication.class, args);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package cn.hezhaohui.weather.controller;
|
||||||
|
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping
|
||||||
|
public class HealthController {
|
||||||
|
|
||||||
|
@GetMapping("health")
|
||||||
|
public String health() {
|
||||||
|
return "Hello wonder!";
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package cn.hezhaohui.weather.controller;
|
||||||
|
|
||||||
|
import cn.hezhaohui.weather.entity.Weather;
|
||||||
|
import cn.hezhaohui.weather.util.WeatherUtil;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping
|
||||||
|
public class WeatherController {
|
||||||
|
|
||||||
|
@GetMapping("get")
|
||||||
|
public Weather getWeather() {
|
||||||
|
return WeatherUtil.getWeather();
|
||||||
|
}
|
||||||
|
}
|
||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
package cn.hezhaohui.service;
|
package cn.hezhaohui.weather.service;
|
||||||
|
|
||||||
import cn.hezhaohui.common.AIConstant;
|
import cn.hezhaohui.weather.common.AIConstant;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.ai.chat.client.ChatClient;
|
import org.springframework.ai.chat.client.ChatClient;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package cn.hezhaohui.util;
|
package cn.hezhaohui.weather.util;
|
||||||
|
|
||||||
import org.springframework.beans.BeansException;
|
import org.springframework.beans.BeansException;
|
||||||
import org.springframework.context.ApplicationContext;
|
import org.springframework.context.ApplicationContext;
|
||||||
+5
-5
@@ -1,14 +1,14 @@
|
|||||||
package cn.hezhaohui.util;
|
package cn.hezhaohui.weather.util;
|
||||||
|
|
||||||
import cn.hezhaohui.common.AIConstant;
|
import cn.hezhaohui.weather.common.AIConstant;
|
||||||
import cn.hezhaohui.entity.Weather;
|
import cn.hezhaohui.weather.entity.Weather;
|
||||||
import cn.hezhaohui.service.ChatService;
|
import cn.hezhaohui.weather.service.ChatService;
|
||||||
import cn.hutool.http.HttpUtil;
|
import cn.hutool.http.HttpUtil;
|
||||||
import cn.hutool.json.JSONObject;
|
import cn.hutool.json.JSONObject;
|
||||||
import cn.hutool.json.JSONUtil;
|
import cn.hutool.json.JSONUtil;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
import static cn.hezhaohui.common.WeatherConstant.*;
|
import static cn.hezhaohui.weather.common.WeatherConstant.*;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class WeatherUtil {
|
public class WeatherUtil {
|
||||||
@@ -1,4 +1,7 @@
|
|||||||
spring:
|
spring:
|
||||||
|
application:
|
||||||
|
name: service-weather
|
||||||
|
|
||||||
ai:
|
ai:
|
||||||
openai:
|
openai:
|
||||||
api-key: sk-ihsqnxhnzmgsaojdkxomcmgdypdfpzojymfndfklgzfchlgz
|
api-key: sk-ihsqnxhnzmgsaojdkxomcmgdypdfpzojymfndfklgzfchlgz
|
||||||
@@ -7,3 +10,10 @@ spring:
|
|||||||
options:
|
options:
|
||||||
model: Pro/Qwen/Qwen2.5-7B-Instruct
|
model: Pro/Qwen/Qwen2.5-7B-Instruct
|
||||||
temperature: 0.7
|
temperature: 0.7
|
||||||
|
eureka:
|
||||||
|
client:
|
||||||
|
service-url:
|
||||||
|
defaultZone: http://localhost:8761/eureka/
|
||||||
|
server:
|
||||||
|
port: 8083
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -1,11 +1,11 @@
|
|||||||
package cn.hezhaohui.service;
|
package cn.hezhaohui.weather.service;
|
||||||
|
|
||||||
import cn.hezhaohui.common.AIConstant;
|
import cn.hezhaohui.weather.common.AIConstant;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.springframework.boot.test.context.SpringBootTest;
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
|
|
||||||
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.NONE)
|
@SpringBootTest
|
||||||
class ChatServiceTest {
|
class ChatServiceTest {
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
+3
-3
@@ -1,10 +1,10 @@
|
|||||||
package cn.hezhaohui.util;
|
package cn.hezhaohui.weather.util;
|
||||||
|
|
||||||
import cn.hezhaohui.entity.Weather;
|
import cn.hezhaohui.weather.entity.Weather;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.springframework.boot.test.context.SpringBootTest;
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
|
|
||||||
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.NONE)
|
@SpringBootTest
|
||||||
class WeatherUtilTest {
|
class WeatherUtilTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
Reference in New Issue
Block a user