| 123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- import { initDatabase, PlatformAccount } from '../models/index.js';
- import { logger } from '../utils/logger.js';
- import { WeixinVideoDataCenterImportService } from '../services/WeixinVideoDataCenterImportService.js';
- async function main() {
- try {
- await initDatabase();
- const accountName = '凝光AI';
- const accountRepository = (await import('../models/index.js')).AppDataSource.getRepository(
- PlatformAccount
- );
- const account = await accountRepository.findOne({
- where: {
- platform: 'weixin_video' as any,
- accountName,
- },
- });
- if (!account) {
- logger.error(`[WX Import] Weixin video account not found for name=${accountName}`);
- process.exit(1);
- return;
- }
- logger.info(
- `[WX Import] Single-account run start. accountId=${account.id} name=${account.accountName}`
- );
- const svc = new WeixinVideoDataCenterImportService();
- await svc.importAccountLast30Days(account);
- logger.info(
- `[WX Import] Single-account run done. accountId=${account.id} name=${account.accountName}`
- );
- process.exit(0);
- } catch (e) {
- logger.error('[WX Import] Single-account run failed:', e);
- process.exit(1);
- }
- }
- void main();
|