package com.example.demo.user.controller; import com.example.demo.user.dto.LoginDto; import com.example.demo.user.dto.UserDto; import com.example.demo.user.service.UserService; import com.example.demo.user.service.impl.UserServiceImpl; import com.example.demo.user.vo.ResultVo; import io.swagger.annotations.Api; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @Api(tags = "用户管理") @RestController @RequestMapping("/user") public class UserController { @Autowired private UserServiceImpl userService; @RequestMapping("/register") public ResultVo register(@RequestBody UserDto dto){ return userService.register(dto); } @RequestMapping("/login") public ResultVo login(@RequestBody LoginDto dto){ return userService.login(dto); } }