diff --git a/spring-boot-helloworld/pom.xml b/spring-boot-helloworld/pom.xml
deleted file mode 100644
index bed6fdb..0000000
--- a/spring-boot-helloworld/pom.xml
+++ /dev/null
@@ -1,62 +0,0 @@
-
-
User: Zhang Kaitao - *
Date: 13-12-22 - *
Version: 1.0 - */ -@EnableAutoConfiguration -@Configuration -@ComponentScan -public class Application { - public static void main(String[] args) { - SpringApplication.run(Application.class); - } -} diff --git a/spring-boot-helloworld/src/main/java/com/sishuok/controller/UserController.java b/spring-boot-helloworld/src/main/java/com/sishuok/controller/UserController.java deleted file mode 100644 index d93299e..0000000 --- a/spring-boot-helloworld/src/main/java/com/sishuok/controller/UserController.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.sishuok.controller; - -import com.sishuok.entity.User; -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - *
User: Zhang Kaitao - *
Date: 13-12-22 - *
Version: 1.0 - */ -@EnableAutoConfiguration -@RestController -@RequestMapping("/user") -public class UserController { - - @RequestMapping("/{id}") - private User view(@PathVariable("id") Long id) { - User user = new User(); - user.setId(id); - user.setName("zhang"); - return user; - } - - public static void main(String[] args) { - SpringApplication.run(UserController.class); - } -} diff --git a/spring-boot-helloworld/src/main/java/com/sishuok/entity/User.java b/spring-boot-helloworld/src/main/java/com/sishuok/entity/User.java deleted file mode 100644 index 54c2073..0000000 --- a/spring-boot-helloworld/src/main/java/com/sishuok/entity/User.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.sishuok.entity; - -import java.io.Serializable; - -/** - *
User: Zhang Kaitao - *
Date: 13-12-22 - *
Version: 1.0
- */
-public class User implements Serializable {
- private Long id;
- private String name;
-
- public Long getId() {
- return id;
- }
-
- public void setId(Long id) {
- this.id = id;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-}
diff --git a/springmvc-rest-helloworld/README b/springmvc-rest-helloworld/README
deleted file mode 100644
index 7ea0b38..0000000
--- a/springmvc-rest-helloworld/README
+++ /dev/null
@@ -1 +0,0 @@
- 5分钟构建spring web mvc Rest风格HelloWorld
\ No newline at end of file
diff --git a/springmvc-rest-helloworld/pom.xml b/springmvc-rest-helloworld/pom.xml
deleted file mode 100644
index 8b1c2ae..0000000
--- a/springmvc-rest-helloworld/pom.xml
+++ /dev/null
@@ -1,67 +0,0 @@
-
-
User: Zhang Kaitao - *
Date: 13-12-19 - *
Version: 1.0 - */ -@Configuration -@EnableWebMvc -@ComponentScan -public class AppConfig { -} diff --git a/springmvc-rest-helloworld/src/main/java/com/sishuok/AppInitializer.java b/springmvc-rest-helloworld/src/main/java/com/sishuok/AppInitializer.java deleted file mode 100644 index cc26004..0000000 --- a/springmvc-rest-helloworld/src/main/java/com/sishuok/AppInitializer.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.sishuok; - -import org.springframework.web.WebApplicationInitializer; -import org.springframework.web.context.WebApplicationContext; -import org.springframework.web.context.support.AnnotationConfigWebApplicationContext; -import org.springframework.web.servlet.DispatcherServlet; - -import javax.servlet.ServletContext; -import javax.servlet.ServletException; -import javax.servlet.ServletRegistration; - -/** - *
User: Zhang Kaitao - *
Date: 13-12-19 - *
Version: 1.0 - */ -public class AppInitializer implements WebApplicationInitializer { - - @Override - public void onStartup(ServletContext servletContext) throws ServletException { - AnnotationConfigWebApplicationContext webApplicationContext = - new AnnotationConfigWebApplicationContext(); - webApplicationContext.register(AppConfig.class); - - - DispatcherServlet dispatcherServlet = new DispatcherServlet(webApplicationContext); - ServletRegistration.Dynamic dynamic = servletContext.addServlet("dispatcherServlet", dispatcherServlet); - dynamic.addMapping("/"); - - } -} diff --git a/springmvc-rest-helloworld/src/main/java/com/sishuok/controller/UserController.java b/springmvc-rest-helloworld/src/main/java/com/sishuok/controller/UserController.java deleted file mode 100644 index 3ae1d49..0000000 --- a/springmvc-rest-helloworld/src/main/java/com/sishuok/controller/UserController.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.sishuok.controller; - -import com.sishuok.entity.User; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RestController; - -/** - *
User: Zhang Kaitao - *
Date: 13-12-19 - *
Version: 1.0 - */ -@RestController -@RequestMapping("/user") -public class UserController { - - @RequestMapping(value = "/{id}", method = RequestMethod.GET) - public User view(@PathVariable("id") Long id) { - User user = new User(); - user.setId(id); - user.setName("zhang"); - return user; - } -} diff --git a/springmvc-rest-helloworld/src/main/java/com/sishuok/entity/User.java b/springmvc-rest-helloworld/src/main/java/com/sishuok/entity/User.java deleted file mode 100644 index d46cb19..0000000 --- a/springmvc-rest-helloworld/src/main/java/com/sishuok/entity/User.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.sishuok.entity; - -import java.io.Serializable; - -/** - *
User: Zhang Kaitao - *
Date: 13-12-19 - *
Version: 1.0 - */ -public class User implements Serializable { - private Long id; - private String name; - - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - - User user = (User) o; - - if (id != null ? !id.equals(user.id) : user.id != null) return false; - - return true; - } - - @Override - public int hashCode() { - return id != null ? id.hashCode() : 0; - } -}