zoukankan      html  css  js  c++  java
  • @ResponseBody

    @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);
        }
  • 相关阅读:
    Python基础07
    python基础06
    python基础05
    python基础04
    python基础03
    python基础02
    python组件之wtforms
    PythonWeb框架之Flask
    Linux下yum安装Redis
    在vuex的mutations中使用vue的小技巧
  • 原文地址:https://www.cnblogs.com/java-xu/p/5863988.html
Copyright © 2011-2022 走看看