/**
*/
package
com.jeeplus.modules.sys.web;
import
org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.web.bind.annotation.ModelAttribute;
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;
import
com.jeeplus.common.web.BaseController;
import
com.jeeplus.modules.sys.entity.User;
import
com.jeeplus.modules.sys.service.SystemService;
/**
* 用户Controller
* @author jeeplus
* @version 2013-8-29
*/
@RestController
@RequestMapping
(value =
"/user"
)
public
class
UserController2
extends
BaseController {
@Autowired
private
SystemService systemService;
@RequestMapping
(value =
"/{id}"
, method = RequestMethod.GET)
public
User viewGET(
@PathVariable
(
"id"
) String id) {
User user =
new
User();
user = systemService.getUser(id);
System.out.println(
"get method"
);
return
user;
}
@RequestMapping
(value =
"/{id}"
, method = RequestMethod.DELETE)
public
User viewDELETE(
@PathVariable
(
"id"
) String id) {
User user =
new
User();
user = systemService.getUser(id);
System.out.println(
"delete method"
);
return
user;
}
@RequestMapping
(value =
""
, method = RequestMethod.POST)
public
User viewPOST(
@ModelAttribute
(
"user"
)User users) {
User user =
new
User();
user = systemService.getUser(users.getId());
System.out.println(
"post method"
);
return
user;
}
@RequestMapping
(value =
"/{id}"
, method = RequestMethod.PUT)
public
User viewPUT(
@ModelAttribute
(
"user"
)User users) {
User user =
new
User();
user = systemService.getUser(users.getId());
System.out.println(
"put method"
);
return
user;
}
}