Compare commits

...

2 Commits

Author SHA1 Message Date
2c12fc075f getNewsPage加了jwtVerify 2024-07-04 16:42:06 +08:00
ed0cde6968 添加了漏加的service中保存租户的逻辑 2024-07-04 16:41:36 +08:00
2 changed files with 4 additions and 1 deletions

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) {

View File

@ -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);
}
}