parent
1568403b1c
commit
7975a225d7
@ -0,0 +1,33 @@
|
||||
package com.hzu.bookingsystem.controller;
|
||||
|
||||
import com.hzu.bookingsystem.VO.ResultVO;
|
||||
import com.hzu.bookingsystem.bean.User;
|
||||
import com.hzu.bookingsystem.service.UserService;
|
||||
import com.hzu.bookingsystem.utils.ResultVOUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/user")
|
||||
public class UserController {
|
||||
@Autowired
|
||||
private UserService userService;
|
||||
|
||||
//创建订单
|
||||
@PostMapping(value = "/create", consumes = "application/json")
|
||||
public ResultVO create(@RequestBody User user) {
|
||||
userService.create(user);
|
||||
return ResultVOUtil.success();
|
||||
}
|
||||
|
||||
@GetMapping(value = "/findById")
|
||||
public ResultVO<Map<String, User>> findById(@RequestParam("uId") Integer uId) {
|
||||
User user = userService.findById(uId);
|
||||
return ResultVOUtil.success(user);
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in new issue