基础版本完成
This commit is contained in:
		@@ -3,6 +3,8 @@ package com.test;
 | 
			
		||||
import com.apple.eawt.Application;
 | 
			
		||||
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: BookApplication
 | 
			
		||||
@@ -12,6 +14,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
 | 
			
		||||
 * @Create 2023/8/14 16:23
 | 
			
		||||
 */
 | 
			
		||||
@SpringBootApplication
 | 
			
		||||
@EnableEurekaClient
 | 
			
		||||
public class BookApplication {
 | 
			
		||||
    public static void main(String[] args) {
 | 
			
		||||
        SpringApplication.run(BookApplication.class,args);
 | 
			
		||||
 
 | 
			
		||||
@@ -1,12 +1,13 @@
 | 
			
		||||
package com.test.controller;
 | 
			
		||||
 | 
			
		||||
import com.test.service.BookService;
 | 
			
		||||
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
 | 
			
		||||
import org.springframework.web.bind.annotation.PathVariable;
 | 
			
		||||
import org.springframework.web.bind.annotation.RequestMapping;
 | 
			
		||||
import org.springframework.web.bind.annotation.RestController;
 | 
			
		||||
 | 
			
		||||
import javax.annotation.Resource;
 | 
			
		||||
import java.awt.print.Book;
 | 
			
		||||
import com.test.entity.Book;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * ClassName: BookController
 | 
			
		||||
@@ -16,6 +17,7 @@ import java.awt.print.Book;
 | 
			
		||||
 * @Create 2023/8/14 17:11
 | 
			
		||||
 */
 | 
			
		||||
@RestController
 | 
			
		||||
@EnableEurekaClient
 | 
			
		||||
public class BookController {
 | 
			
		||||
 | 
			
		||||
    @Resource
 | 
			
		||||
 
 | 
			
		||||
@@ -1,9 +1,9 @@
 | 
			
		||||
package com.test.mapper;
 | 
			
		||||
 | 
			
		||||
import com.test.entity.Book;
 | 
			
		||||
import org.apache.ibatis.annotations.Mapper;
 | 
			
		||||
import org.apache.ibatis.annotations.Select;
 | 
			
		||||
 | 
			
		||||
import java.awt.print.Book;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * ClassName: BookMapper
 | 
			
		||||
 
 | 
			
		||||
@@ -1,6 +1,5 @@
 | 
			
		||||
package com.test.service;
 | 
			
		||||
 | 
			
		||||
import java.awt.print.Book;
 | 
			
		||||
import com.test.entity.Book;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * ClassName: BookService
 | 
			
		||||
 
 | 
			
		||||
@@ -5,7 +5,7 @@ import com.test.service.BookService;
 | 
			
		||||
import org.springframework.stereotype.Service;
 | 
			
		||||
 | 
			
		||||
import javax.annotation.Resource;
 | 
			
		||||
import java.awt.print.Book;
 | 
			
		||||
import com.test.entity.Book;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * ClassName: BookServiceImpl
 | 
			
		||||
 
 | 
			
		||||
@@ -10,6 +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}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user