刘嘉昕 | f28ea23 | 2025-04-15 16:55:43 +0800 | [diff] [blame^] | 1 | package com.pt5.pthouduan.controller; |
| 2 | |
| 3 | import com.pt5.pthouduan.entity.User; |
| 4 | import com.pt5.pthouduan.service.UserService; |
| 5 | import org.springframework.beans.factory.annotation.Autowired; |
| 6 | import org.springframework.web.bind.annotation.*; |
| 7 | import org.springframework.stereotype.Controller; |
| 8 | |
| 9 | /** |
| 10 | * <p> |
| 11 | * 前端控制器 |
| 12 | * </p> |
| 13 | * |
| 14 | * @author ljx |
| 15 | * @since 2025-04-14 |
| 16 | */ |
| 17 | @Controller |
| 18 | @RequestMapping("/user") |
| 19 | public class UserController { |
| 20 | @Autowired |
| 21 | private UserService userService; |
| 22 | |
| 23 | // 创建用户 |
| 24 | @PostMapping("/create") |
| 25 | @ResponseBody |
| 26 | public User createUser(@RequestBody User user) { |
| 27 | return userService.createUser(user); |
| 28 | } |
| 29 | |
| 30 | |
| 31 | |
| 32 | } |