@Controller
public class PersonController {

    /**
     * 查询个人信息
     * 
     * @param id
     * @return
     */
    @RequestMapping(value = "/person/profile/{id}/{name}/{status}", method = RequestMethod.GET)
    public @ResponseBody
    Person porfile(@PathVariable int id, @PathVariable String name,
            @PathVariable boolean status) {
        return new Person(id, name, status);
    }

    /**
     * 登录
     * 
     * @param person
     * @return
     */
    @RequestMapping(value = "/person/login", method = RequestMethod.POST)
    public @ResponseBody
    Person login(@RequestBody Person person) {
        return person;
    }
}
    @RequestMapping(value = "/person/profile/{id}", method = RequestMethod.GET)
    public @ResponseBody
    Person porfile(@PathVariable("id") int uid) {
        return new Person(uid, name, status);
    }

 

posted on 2016-09-12 10:58  high_grade  阅读(164)  评论(0编辑  收藏  举报