package com.yzdx.AiInterviewer.controller; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import java.util.HashMap; import java.util.Map; @RestController @RequestMapping("/hello") public class HelloController { @GetMapping("/hello") public String hello(){ return "hello"; } @ApiOperation("用户登录") @PostMapping("/test") public Map testLogin(@ApiParam("用户名") String username ,@ApiParam("密码")String password){ Map result=new HashMap<>(); result.put("code",0); result.put("message","登陆成功"); result.put("data","username:"+username+","+"password:"+password); return result; } }