feat(sync): implement sync stubs with env-var gating and status endpoint
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user