getNewsPage加了jwtVerify

This commit is contained in:
高子兴 2024-07-04 16:42:06 +08:00
parent ed0cde6968
commit 2c12fc075f

View File

@ -30,7 +30,8 @@ public class NewsController {
}
@GetMapping("/{id}")
public ResponseEntity<News> getNewsPage(@PathVariable Long id) {
@JwtVerify
public ResponseEntity<News> getNewsPage(@PathVariable Long id, @RequestParam String token) {
try {
return new ResponseEntity<>(newsService.getNewsById(id), HttpStatus.OK);
} catch (EntityNotFoundException e) {