首页>代码>Spring Cloud搭建Eureka Server服务注册发现Eureka Client简单实例>/eureka-service-discovery/bookstore-service/src/main/java/com/memorynotfound/cloud/BookController.java
package com.memorynotfound.cloud; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; import java.math.BigDecimal; import java.util.Arrays; import java.util.List; @RestController public class BookController { @GetMapping("books") public List<Book> getBooks() { return Arrays.asList( new Book(1, "Spring Cloud Eureka Service Registry Server", new BigDecimal(0)), new Book(2, "Spring Cloud Eureka Service Discovery", new BigDecimal(0)), new Book(3, "Spring Cloud Eureka Client", new BigDecimal(0)), new Book(4, "zuidaima.com", new BigDecimal(6.66)), new Book(5, "最代码", new BigDecimal(8.88)) ); } }