refactor: 恢复所有审计API调用

This commit is contained in:
RockChinQ
2024-01-31 00:02:19 +08:00
parent c1c751a9ab
commit 32162afa65
11 changed files with 172 additions and 48 deletions

View File

@@ -104,3 +104,20 @@ class AnnouncementManager:
await self.write_saved(all)
return to_show
async def show_announcements(
self
):
"""显示公告"""
try:
announcements = await self.fetch_new()
for ann in announcements:
self.ap.logger.info(f'[公告] {ann.time}: {ann.content}')
if announcements:
await self.ap.ctr_mgr.main.post_announcement_showed(
ids=[item.id for item in announcements]
)
except Exception as e:
self.ap.logger.warning(f'获取公告时出错: {e}')