UserController.java 907 字节
Newer Older
Q
qinyingjie 已提交
1 2
package com.kwan.springbootkwan.controller;

Q
qinyingjie 已提交
3
import com.kwan.springbootkwan.entity.Person;
Q
qinyingjie 已提交
4 5 6 7 8
import com.kwan.springbootkwan.entity.User;
import com.kwan.springbootkwan.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

Q
qinyingjie 已提交
9
import java.util.Date;
Q
qinyingjie 已提交
10 11
import java.util.List;

Q
qinyingjie 已提交
12 13 14 15 16 17 18
/**
 * 用户相关
 *
 * @author : qinyingjie
 * @version : 2.2.0
 * @date : 2022/12/19 16:08
 */
Q
qinyingjie 已提交
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    private IUserService userService;

    @RequestMapping(value = "/all", method = RequestMethod.GET)
    public List<User> addAdvertise() {
        return userService.getUsers();
    }

    @RequestMapping(value = "/getUserById/{id}", method = RequestMethod.GET)
    public User getUserById(@PathVariable Integer id) {
        return userService.getUserById(id);
    }
}