package com.seecoder.BlueWhale.controller; import com.seecoder.BlueWhale.service.UserService; import com.seecoder.BlueWhale.vo.ResultVO; import com.seecoder.BlueWhale.vo.UserVO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @RestController @RequestMapping("/api/users") public class UserController { @Autowired UserService userService; @PostMapping("/register") public ResultVO register(@RequestBody UserVO userVO){ return ResultVO.buildSuccess(userService.register(userVO)); } @PostMapping("/login") public ResultVO login(@RequestParam("phone") String phone, @RequestParam("password") String password){ return ResultVO.buildSuccess(userService.login(phone, password)); } @GetMapping public ResultVO getInformation(){ return ResultVO.buildSuccess(userService.getInformation()); } @PostMapping public ResultVO updateInformation(@RequestBody UserVO userVO){ return ResultVO.buildSuccess(userService.updateInformation(userVO)); } }