基础版本完成

This commit is contained in:
2023-08-15 14:13:42 +08:00
parent 5fd2177429
commit 64bf2b74db
14 changed files with 35 additions and 22 deletions

View File

@@ -2,6 +2,8 @@ package com.test;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
/**
* ClassName: UserApplication
@@ -11,6 +13,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
* @Create 2023/8/14 16:26
*/
@SpringBootApplication
@EnableEurekaClient
public class UserApplication {
public static void main(String[] args) {
SpringApplication.run(UserApplication.class, args);

View File

@@ -4,6 +4,7 @@ import com.test.entity.User;
import com.test.service.UserService;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;

View File

@@ -10,7 +10,8 @@ spring:
password: mactest
eureka:
client:
# 跟上面一样需要指向Eureka服务端地址这样才能进行注册
service-url:
serviceUrl:
defaultZone: http://localhost:8888/eureka
instance:
prefer-ip-address: true
instance-id: ${spring.cloud.client.ip-address}:${server.port}