mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-02-25 07:30:46 +08:00
Implement profile page and related backend APIs
This commit is contained in:
@@ -136,6 +136,15 @@ public class PostService {
|
||||
return postRepository.findByAuthorAndStatusOrderByCreatedAtDesc(user, PostStatus.PUBLISHED, pageable);
|
||||
}
|
||||
|
||||
public java.time.LocalDateTime getLastPostTime(String username) {
|
||||
return postRepository.findLastPostTime(username);
|
||||
}
|
||||
|
||||
public long getTotalViews(String username) {
|
||||
Long v = postRepository.sumViews(username);
|
||||
return v != null ? v : 0;
|
||||
}
|
||||
|
||||
public List<Post> listPostsByTags(java.util.List<Long> tagIds,
|
||||
Integer page,
|
||||
Integer pageSize) {
|
||||
@@ -180,4 +189,8 @@ public class PostService {
|
||||
notificationService.createNotification(post.getAuthor(), NotificationType.POST_REVIEWED, post, null, false);
|
||||
return post;
|
||||
}
|
||||
|
||||
public java.util.List<Post> getPostsByIds(java.util.List<Long> ids) {
|
||||
return postRepository.findAllById(ids);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user