PersonController.java 1.0 KB
Newer Older
Q
qinyingjie 已提交
1 2 3 4 5
package com.kwan.springbootkwan.controller;

import com.kwan.springbootkwan.entity.Person;
import com.kwan.springbootkwan.entity.User;
import com.kwan.springbootkwan.service.IUserService;
Q
qinyingjie 已提交
6 7
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
Q
qinyingjie 已提交
8 9 10 11 12 13 14 15 16 17 18 19 20
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Date;
import java.util.List;

/**
 * Person相关
 *
 * @author : qinyingjie
 * @version : 2.2.0
 * @date : 2022/12/19 16:08
 */
Q
qinyingjie 已提交
21
@Api(description = "person用户信息", tags = "PersonController")
Q
qinyingjie 已提交
22 23 24 25 26 27 28 29 30 31
@RestController
@RequestMapping("/person")
public class PersonController {
    /**
     * {
     * "name": "zhang san",
     * "age": 24,
     * "birthday": "2022-12-19"
     * }
     */
Q
qinyingjie 已提交
32
    @ApiOperation(value = "json返回", notes = "json返回")
Q
qinyingjie 已提交
33 34 35 36 37 38 39 40 41
    @GetMapping("/person")
    public Person person() {
        Person person = new Person();
        person.setName("zhang san");
        person.setAge(24);
        person.setBirthday(new Date());
        return person;
    }
}