@RestController
public class LoginController{
@RequestMapping(value="/login",method={RequestMethod.POST,RequestMethos.GET})
public String login(@RequestBody(required false) Login login,HttpServletRequest request){
String account;
String password;
if(login == null){
account = request.getParamater("account");
password = request.getParamater("password");
}else{
account = login.getAccount();
password = login.getPassword();
}
Map map = new HashMap<>();
map.put("account",account);
map.put("password",password);
return JSON.toJAONString(map);
}
}