feat(notice): NoticeSended 事件与登录提醒内置监听

This commit is contained in:
augushong
2026-10-12 12:09:01 +00:00
parent 02f77f4eca
commit 7aba2d02fe
6 changed files with 233 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
<?php
namespace base\common\event\NoticeSended;
use think\facade\Log;
class LogEventBase
{
public function handle(array $payload)
{
// 事件监听处理:payload = [$notice(模型), $targets(投递行数组)](NoticeServiceBase::send trigger 形态)
[$notice, $targets] = $payload;
Log::info('notice sended', [
'notice_id' => (int) $notice->id,
'target_count' => count($targets),
'channels' => array_values(array_unique(array_column($targets, 'channel'))),
]);
}
}