没有GET /me的映射



我有这个春季启动应用程序,我是春季启动的新手。我已经创建了这个控制器,但它抛出404并说在控制台中没有GET/me的映射。我找不到问题,我需要尽快得到这个。

日志如下:https://pastebin.com/Qf5W6MZU

此控制器中的任何其他端点也不起作用。

import org.sefglobal.scholarx.exception.BadRequestException;
import org.sefglobal.scholarx.exception.NoContentException;
import org.sefglobal.scholarx.exception.ResourceNotFoundException;
import org.sefglobal.scholarx.exception.UnauthorizedException;
import org.sefglobal.scholarx.model.Mentee;
import org.sefglobal.scholarx.model.Profile;
import org.sefglobal.scholarx.model.Program;
import org.sefglobal.scholarx.service.IntrospectionService;
import org.sefglobal.scholarx.util.EnrolmentState;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.CookieValue;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@RestController
@RequestMapping("/me")
public class AuthUserController {
private final IntrospectionService introspectionService;
public AuthUserController(IntrospectionService introspectionService) {
this.introspectionService = introspectionService;
}
@GetMapping
@ResponseStatus(HttpStatus.OK)
public Profile getLoggedInUser(@CookieValue(value = "profileId", defaultValue = "-1") long profileId)
throws ResourceNotFoundException, UnauthorizedException {
return introspectionService.getLoggedInUser(profileId);
}
@GetMapping("/programs/mentee")
@ResponseStatus(HttpStatus.OK)
public List<Program> getMenteeingPrograms(@CookieValue(value = "profileId") long profileId)
throws ResourceNotFoundException, NoContentException {
return introspectionService.getMenteeingPrograms(profileId);
}
@PutMapping("/mentor/{id}/confirmation")
@ResponseStatus(HttpStatus.OK)
public Mentee confirmMentor(@PathVariable long id,
@CookieValue(value = "profileId") long profileId)
throws ResourceNotFoundException, BadRequestException {
return introspectionService.confirmMentor(id, profileId);
}
}

我发现了问题,我没有包含包。

最新更新