+
+
+
+ springboot-webflux-1-quickstart
+
+
+ springboot-webflux-2-restful
+
springboot-helloworld
@@ -54,6 +62,19 @@
spring-data-elasticsearch-crud
spring-data-elasticsearch-query
+
+ chapter-1-spring-boot-quickstart
+
+ chapter-2-spring-boot-config
+
+ chapter-3-spring-boot-web
+
+ chapter-4-spring-boot-web-thymeleaf
+
+ chapter-5-spring-boot-data-jpa
+
+ chapter-6-spring-boot-cache-redis
+
chapter-4-spring-boot-validating-form-input
diff --git a/springboot-webflux/pom.xml b/springboot-webflux/pom.xml
deleted file mode 100755
index ed47c0e..0000000
--- a/springboot-webflux/pom.xml
+++ /dev/null
@@ -1,59 +0,0 @@
-
-
- 4.0.0
-
- springboot
- springboot-webflux
- 0.0.1-SNAPSHOT
- springboot-webflux :: Spring Boot 实现 WebFlux HTTP Restful 服务
-
-
-
- org.springframework.boot
- spring-boot-starter-parent
- 2.0.0.M3
-
-
-
- 1.2.0
- 5.1.39
-
-
-
-
-
-
- org.springframework.boot
- spring-boot-starter-webflux
-
-
-
-
- org.springframework.boot
- spring-boot-starter-test
- test
-
-
-
-
- junit
- junit
- 4.12
-
-
-
-
-
-
-
- spring-milestones
- Spring Milestones
- https://repo.spring.io/libs-milestone
-
- false
-
-
-
-
-
diff --git a/springboot-webflux/src/main/java/org/spring/springboot/Application.java b/springboot-webflux/src/main/java/org/spring/springboot/Application.java
deleted file mode 100644
index d648b6b..0000000
--- a/springboot-webflux/src/main/java/org/spring/springboot/Application.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package org.spring.springboot;
-
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-
-/**
- * Spring Boot 应用启动类
- *
- * Created by bysocket on 09/29/2017.
- */
-// Spring Boot 应用的标识
-@SpringBootApplication
-public class Application {
-
- public static void main(String[] args) {
- // 程序启动入口
- // 启动嵌入式的 Tomcat 并初始化 Spring 环境及其各 Spring 组件
- SpringApplication.run(Application.class,args);
- }
-}
diff --git a/springboot-webflux/src/main/java/org/spring/springboot/controller/CityRestController.java b/springboot-webflux/src/main/java/org/spring/springboot/controller/CityRestController.java
deleted file mode 100644
index ff495b6..0000000
--- a/springboot-webflux/src/main/java/org/spring/springboot/controller/CityRestController.java
+++ /dev/null
@@ -1,51 +0,0 @@
-package org.spring.springboot.controller;
-
-import org.spring.springboot.domain.City;
-import org.spring.springboot.service.CityService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-import reactor.core.publisher.Flux;
-import reactor.core.publisher.Mono;
-
-/**
- * 城市 Controller 实现 Restful HTTP 服务
- *
- * Created by bysocket on 09/29/2017.
- */
-@RestController
-@RequestMapping(value = "/city")
-public class CityRestController {
-
- @Autowired
- private CityService cityService;
-
- @RequestMapping(value = "/{id}", method = RequestMethod.GET)
- public Mono findOneCity(@PathVariable("id") Long id) {
- return Mono.create(cityMonoSink -> cityMonoSink.success(cityService.findCityById(id)));
- }
-
- @RequestMapping(method = RequestMethod.GET)
- public Flux findAllCity() {
- return Flux.create(cityFluxSink -> {
- cityService.findAllCity().forEach(city -> {
- cityFluxSink.next(city);
- });
- cityFluxSink.complete();
- });
- }
-
- @RequestMapping(method = RequestMethod.POST)
- public Mono createCity(@RequestBody City city) {
- return Mono.create(cityMonoSink -> cityMonoSink.success(cityService.saveCity(city)));
- }
-
- @RequestMapping(method = RequestMethod.PUT)
- public Mono modifyCity(@RequestBody City city) {
- return Mono.create(cityMonoSink -> cityMonoSink.success(cityService.updateCity(city)));
- }
-
- @RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
- public Mono modifyCity(@PathVariable("id") Long id) {
- return Mono.create(cityMonoSink -> cityMonoSink.success(cityService.deleteCity(id)));
- }
-}
diff --git a/springboot-webflux/src/main/java/org/spring/springboot/domain/City.java b/springboot-webflux/src/main/java/org/spring/springboot/domain/City.java
deleted file mode 100644
index 598af6d..0000000
--- a/springboot-webflux/src/main/java/org/spring/springboot/domain/City.java
+++ /dev/null
@@ -1,61 +0,0 @@
-package org.spring.springboot.domain;
-
-/**
- * 城市实体类
- *
- * Created by bysocket on 09/29/2017.
- */
-public class City {
-
- /**
- * 城市编号
- */
- private Long id;
-
- /**
- * 省份编号
- */
- private Long provinceId;
-
- /**
- * 城市名称
- */
- private String cityName;
-
- /**
- * 描述
- */
- private String description;
-
- public Long getId() {
- return id;
- }
-
- public void setId(Long id) {
- this.id = id;
- }
-
- public Long getProvinceId() {
- return provinceId;
- }
-
- public void setProvinceId(Long provinceId) {
- this.provinceId = provinceId;
- }
-
- public String getCityName() {
- return cityName;
- }
-
- public void setCityName(String cityName) {
- this.cityName = cityName;
- }
-
- public String getDescription() {
- return description;
- }
-
- public void setDescription(String description) {
- this.description = description;
- }
-}
diff --git a/springboot-webflux/src/main/java/org/spring/springboot/service/CityService.java b/springboot-webflux/src/main/java/org/spring/springboot/service/CityService.java
deleted file mode 100644
index 441ffbb..0000000
--- a/springboot-webflux/src/main/java/org/spring/springboot/service/CityService.java
+++ /dev/null
@@ -1,52 +0,0 @@
-package org.spring.springboot.service;
-
-import org.spring.springboot.domain.City;
-
-import java.util.List;
-
-/**
- * 城市业务逻辑接口类
- *
- * Created by bysocket on 09/29/2017.
- */
-public interface CityService {
-
- /**
- * 获取城市信息列表
- *
- * @return
- */
- List findAllCity();
-
- /**
- * 根据城市 ID,查询城市信息
- *
- * @param id
- * @return
- */
- City findCityById(Long id);
-
- /**
- * 新增城市信息
- *
- * @param city
- * @return
- */
- Long saveCity(City city);
-
- /**
- * 更新城市信息
- *
- * @param city
- * @return
- */
- Long updateCity(City city);
-
- /**
- * 根据城市 ID,删除城市信息
- *
- * @param id
- * @return
- */
- Long deleteCity(Long id);
-}
diff --git a/springboot-webflux/src/main/java/org/spring/springboot/service/impl/CityServiceImpl.java b/springboot-webflux/src/main/java/org/spring/springboot/service/impl/CityServiceImpl.java
deleted file mode 100644
index 1a628a6..0000000
--- a/springboot-webflux/src/main/java/org/spring/springboot/service/impl/CityServiceImpl.java
+++ /dev/null
@@ -1,50 +0,0 @@
-package org.spring.springboot.service.impl;
-
-import org.spring.springboot.domain.City;
-import org.spring.springboot.service.CityService;
-import org.springframework.stereotype.Service;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * 城市业务逻辑实现类
- *
- * Created by bysocket on 09/29/2017.
- */
-@Service
-public class CityServiceImpl implements CityService {
-
- // 模拟数据库,存储 City 信息
- private static Map CITY_DB = new HashMap<>();
-
- public List findAllCity() {
- return new ArrayList<>(CITY_DB.values());
- }
-
- public City findCityById(Long id) {
- return CITY_DB.get(id);
- }
-
- @Override
- public Long saveCity(City city) {
- city.setId(CITY_DB.size() + 1L);
- CITY_DB.put(city.getId(), city);
- return city.getId();
- }
-
- @Override
- public Long updateCity(City city) {
- CITY_DB.put(city.getId(), city);
- return city.getId();
- }
-
- @Override
- public Long deleteCity(Long id) {
- CITY_DB.remove(id);
- return id;
- }
-
-}