feat(sync): implement sync stubs with env-var gating and status endpoint

This commit is contained in:
2026-07-06 09:53:48 +08:00
parent 2c0ca583a3
commit a568da160c
2 changed files with 36 additions and 10 deletions

View File

@@ -16,6 +16,17 @@ export class SyncController {
return { synced: logs.length, logs };
}
@Get('status')
@RequirePermission('sync:read')
async getStatus() {
const lastDingTalk = await this.syncService.getLastSync('dingtalk');
const lastWeCom = await this.syncService.getLastSync('wecom');
return {
dingTalk: lastDingTalk ? { lastSyncAt: lastDingTalk.finishedAt, status: lastDingTalk.status } : null,
weCom: lastWeCom ? { lastSyncAt: lastWeCom.finishedAt, status: lastWeCom.status } : null,
};
}
@Get('logs')
@RequirePermission('sync:read')
async getLogs(