package com.yzdx.AiInterviewer.controller; import com.yzdx.AiInterviewer.comment.R; import com.yzdx.AiInterviewer.service.UserService; import io.swagger.annotations.ApiParam; import org.springframework.beans.factory.annotation.Autowired; 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.RestController; import java.util.Map; @RestController @RequestMapping("/admin") public class UserController { @Autowired private UserService userService; @PostMapping("/login") public R adminLogin(@RequestBody @ApiParam("传入的值,phone,encoding,password") Map loginForm){ if(loginForm.size()==0){ return R.error("传来的数据有误,请检查输入"); } String phone=(String)loginForm.get("phone"); String encoding=(String)loginForm.get("encoding"); String password=(String)loginForm.get("password"); return userService.adminLogin(phone, encoding, password); } }