commit
This commit is contained in:
@@ -1,20 +0,0 @@
|
||||
package com.sishuok;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/**
|
||||
* <p>User: Zhang Kaitao
|
||||
* <p>Date: 13-12-22
|
||||
* <p>Version: 1.0
|
||||
*/
|
||||
@EnableAutoConfiguration
|
||||
@Configuration
|
||||
@ComponentScan
|
||||
public class Application {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(Application.class);
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
* <p>User: Zhang Kaitao
|
||||
* <p>Date: 13-12-22
|
||||
* <p>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);
|
||||
}
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
package com.sishuok.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>User: Zhang Kaitao
|
||||
* <p>Date: 13-12-22
|
||||
* <p>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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user