Compare commits

..

5 Commits

Author SHA1 Message Date
Tim
e65273daa6 Use nullable Boolean for rssExcluded 2025-08-19 09:17:10 +08:00
tim
d3a2acb605 fix: 移动端降低gap 2025-08-18 20:21:14 +08:00
tim
bced24e47d feat: rss 动画 2025-08-18 19:59:29 +08:00
tim
425ad03e6f fix: 默认不推荐 2025-08-18 19:51:57 +08:00
Tim
4462d8f711 Merge pull request #626 from nagisa77/codex/adapt-to-rss-2.0-specification
feat: provide RSS feed with admin exclusion
2025-08-18 19:43:59 +08:00
4 changed files with 26 additions and 8 deletions

View File

@@ -63,7 +63,7 @@ public class PostMapper {
dto.setCommentCount(commentService.countComments(post.getId()));
dto.setStatus(post.getStatus());
dto.setPinnedAt(post.getPinnedAt());
dto.setRssExcluded(post.isRssExcluded());
dto.setRssExcluded(post.getRssExcluded() == null || post.getRssExcluded());
List<ReactionDto> reactions = reactionService.getReactionsForPost(post.getId())
.stream()

View File

@@ -67,7 +67,6 @@ public class Post {
@Column
private LocalDateTime pinnedAt;
@Column(nullable = false)
private boolean rssExcluded = false;
@Column(nullable = true)
private Boolean rssExcluded = true;
}

View File

@@ -385,7 +385,22 @@ onMounted(async () => {
}
.rss-icon {
text-shadow: 0 0 10px var(--primary-color);
animation: rss-glow 2s 3;
}
@keyframes rss-glow {
0% {
text-shadow: 0 0 0px var(--primary-color);
opacity: 1;
}
50% {
text-shadow: 0 0 12px var(--primary-color);
opacity: 0.8;
}
100% {
text-shadow: 0 0 0px var(--primary-color);
opacity: 1;
}
}
@media (max-width: 1200px) {
@@ -404,5 +419,9 @@ onMounted(async () => {
.logo-text {
display: none;
}
.header-content-right {
gap: 15px;
}
}
</style>

View File

@@ -358,9 +358,9 @@ const articleMenuItems = computed(() => {
items.push({ text: '置顶', onClick: () => pinPost() })
}
if (rssExcluded.value) {
items.push({ text: '取消rss推荐', onClick: () => includeRss() })
items.push({ text: 'rss推荐', onClick: () => includeRss() })
} else {
items.push({ text: 'rss推荐', onClick: () => excludeRss() })
items.push({ text: '取消rss推荐', onClick: () => excludeRss() })
}
}
if (isAdmin.value && status.value === 'PENDING') {
@@ -676,7 +676,7 @@ const includeRss = async () => {
})
if (res.ok) {
rssExcluded.value = false
toast.success('已取消rss推荐')
toast.success('已标记为rss推荐')
} else {
toast.error('操作失败')
}