package com.zhentao.controller; import com.zhentao.dto.LoginDto; import com.zhentao.service.UserService; import com.zhentao.vo.Result; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @RestController @RequestMapping("/user") public class LoginController { @Autowired UserService userService; @RequestMapping("/login") public Result login(@Validated @RequestBody LoginDto dto){ return userService.userLogin(dto); } }