Compare commits
2 Commits
e66695cbff
...
2c12fc075f
| Author | SHA1 | Date | |
|---|---|---|---|
| 2c12fc075f | |||
| ed0cde6968 |
@ -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) {
|
||||
|
||||
@ -58,6 +58,7 @@ public class NewsService {
|
||||
news.setContent(request.getContent());
|
||||
news.setAuthor(request.getAuthor());
|
||||
news.setImagePath(request.getImagePath());
|
||||
news.setTenant(request.getTenant());
|
||||
newsRepository.save(news);
|
||||
}
|
||||
|
||||
@ -69,6 +70,7 @@ public class NewsService {
|
||||
news.setContent(request.getContent());
|
||||
news.setAuthor(request.getAuthor());
|
||||
news.setImagePath(request.getImagePath());
|
||||
news.setTenant(request.getTenant());
|
||||
newsRepository.save(news);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user