package space.anyi.BI.controller; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import space.anyi.BI.entity.ResponseResult; import space.anyi.BI.entity.User; import space.anyi.BI.service.UserService; import javax.annotation.Resource; /** * @ProjectName: BI * @FileName: UserController * @Author: 杨逸 * @Data:2024/11/28 19:52 * @Description: */ @Controller() @RequestMapping("/user") public class UserController { @Resource private UserService userService; @PostMapping("/login") @ResponseBody public ResponseResult login(@RequestBody User user){ return userService.login(user); } @PostMapping("/register") @ResponseBody public ResponseResult resister(@RequestBody User user){ return userService.register(user); } }