Skip to content

Let's use AI to Earn!

style: 删除测试代码

牛文政378fecd3cd6a
diff --git a/electron/main/api/tracing.ts b/electron/main/api/tracing.ts
index ad6f3d3d..7d90ccd6 100644
--- a/electron/main/api/tracing.ts
+++ b/electron/main/api/tracing.ts
@@ -24,7 +24,7 @@ export interface Tracing {
export class TracingApi {
// 创建跟踪-账号添加
- async createTracing(account: {
+ async createTracingAccountAdd(account: {
id: number;
desc?: string;
}): Promise<Tracing | null> {
diff --git a/electron/main/test/controller.ts b/electron/main/test/controller.ts
index e138d526..be2869d8 100644
--- a/electron/main/test/controller.ts
+++ b/electron/main/test/controller.ts
@@ -7,10 +7,7 @@
*/
import { Controller, Icp, Inject } from '../core/decorators';
import { TestService } from './service';
-import { douyinService } from '../../plat/douyin/index';
-import { xiaohongshuService } from '../../plat/xiaohongshu/index';
-import { shipinhaoService } from '../../plat/shipinhao/index';
-import { FileUtils } from '../../util/file';
+import { EtEvent } from '../../global/event';
@Controller()
export class TestController {
@@ -21,13 +18,14 @@ export class TestController {
* 测试-抖音登录
*/
@Icp('ICP_GET_FILE_MATE_INFO')
- async testDouyinVideoLogin(
- event: Electron.IpcMainInvokeEvent,
- path: string,
- ): Promise<any> {
- const res = await FileUtils.getFileInfo(path);
- console.log('---- res ----', res);
- return res;
+ async testDouyinVideoLogin(event: Electron.IpcMainInvokeEvent): Promise<any> {
+ console.log('---- res ----', 1);
+ EtEvent.emit('ET_TRACING_ACCOUNT_ADD', {
+ id: 111,
+ desc: '添加账户',
+ });
+
+ return 1;
}
/**
@@ -37,156 +35,4 @@ export class TestController {
async testScheduleJob(): Promise<any> {
console.log('---- Scheduled test ----');
}
-
- @Icp('ICP_DY_Login')
- async dyLogin(event: Electron.IpcMainInvokeEvent): Promise<any> {
- try {
- const result = await douyinService.loginOrView('login');
- return result;
- } catch (error) {
- console.error('Login process failed:', error);
- return {
- success: false,
- error: error instanceof Error ? error.message : 'Login failed',
- };
- }
- }
-
- @Icp('ICP_DY_PublishVideoWorkApi')
- async dyBlishVideoWorkApi(event: Electron.IpcMainInvokeEvent): Promise<any> {
- try {
- const result = await douyinService.loginOrView('login');
- return result;
- } catch (error) {
- console.error('Login process failed:', error);
- return {
- success: false,
- error: error instanceof Error ? error.message : 'Login failed',
- };
- }
- }
-
- @Icp('ICP_DY_GetDashboardFunckApi')
- async dyGetDashboardFunckApi(
- event: Electron.IpcMainInvokeEvent,
- cookies: string,
- startDate: string,
- endDate: string,
- ): Promise<any> {
- try {
- const result = await douyinService.getDashboardFunc(
- cookies,
- startDate,
- endDate,
- );
- return result;
- } catch (error) {
- console.error('getDashboardFunc process failed:', error);
- return {
- success: false,
- error: error instanceof Error ? error.message : 'Publish failed',
- };
- }
- }
-
- @Icp('ICP_XHS_Login')
- async xhsLogin(event: Electron.IpcMainInvokeEvent): Promise<any> {
- try {
- const result = await xiaohongshuService.loginOrView('login');
- return result;
- } catch (error) {
- console.error('ICP_XHS_publishVideoWorkApi process failed:', error);
- return {
- success: false,
- error: error instanceof Error ? error.message : 'Publish failed',
- };
- }
- }
-
- @Icp('ICP_XHS_GetDashboardFunckApi')
- async xhsGetDashboardFunckApi(
- event: Electron.IpcMainInvokeEvent,
- cookie: any,
- startDate: string,
- endDate: string,
- ): Promise<any> {
- try {
- const result = await xiaohongshuService.getDashboardFunc(
- cookie,
- startDate,
- endDate,
- );
- return result;
- } catch (error) {
- console.error('ICP_XHS_GetDashboardFunckApi process failed:', error);
- return {
- success: false,
- error: error instanceof Error ? error.message : 'Publish failed',
- };
- }
- }
-
- @Icp('ICP_XHS_PublishVideoWorkApi')
- async xhsPublishVideoWorkApi(
- event: Electron.IpcMainInvokeEvent,
- cookies: string,
- filePath: string,
- platformSetting: any,
- ): Promise<any> {
- try {
- const result = await xiaohongshuService.publishVideoWorkApi(
- cookies,
- filePath,
- platformSetting,
- () => {},
- );
- return {
- success: true,
- data: result,
- };
- } catch (error) {
- console.error('ICP_XHS_publishVideoWorkApi process failed:', error);
- return {
- success: false,
- error: error instanceof Error ? error.message : 'Publish failed',
- };
- }
- }
-
- @Icp('ICP_SPH_Login')
- async sphLogin(event: Electron.IpcMainInvokeEvent): Promise<any> {
- try {
- const result = await shipinhaoService.loginOrView('login');
- return result;
- } catch (error) {
- console.error('Login process failed:', error);
- return {
- success: false,
- error: error instanceof Error ? error.message : 'Login failed',
- };
- }
- }
-
- @Icp('ICP_SPH_GetDashboardFunckApi')
- async sphGetDashboardFunckApi(
- event: Electron.IpcMainInvokeEvent,
- cookie: any,
- startDate: string,
- endDate: string,
- ): Promise<any> {
- try {
- const result = await shipinhaoService.getDashboardFunc(
- cookie,
- startDate,
- endDate,
- );
- return result;
- } catch (error) {
- console.error('ICP_SPH_GetDashboardFunckApi process failed:', error);
- return {
- success: false,
- error: error instanceof Error ? error.message : 'Publish failed',
- };
- }
- }
}
diff --git a/electron/main/tracing/controller.ts b/electron/main/tracing/controller.ts
index 2881e076..e125ebbc 100644
--- a/electron/main/tracing/controller.ts
+++ b/electron/main/tracing/controller.ts
@@ -10,7 +10,7 @@ export class TracingController {
// 创建跟踪记录-账号添加
@Et('ET_TRACING_ACCOUNT_ADD')
async tracingAccountAdd(data: { id: number; desc?: string }): Promise<any> {
- tracingApi.createTracing(data);
+ tracingApi.createTracingAccountAdd(data);
}
// 创建跟踪记录-视频发布