Skip to content

Commit

Permalink
refactor: optimize msg db
Browse files Browse the repository at this point in the history
  • Loading branch information
linyuchen committed Apr 29, 2024
1 parent 43b780c commit 01417be
Show file tree
Hide file tree
Showing 16 changed files with 15 additions and 338 deletions.
323 changes: 0 additions & 323 deletions src/common/utils/db.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/common/utils/file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import crypto from 'crypto';
import util from 'util';
import path from 'node:path';
import { log } from './log';
import { dbUtil } from './db';
import { dbUtil } from '@/core/utils/db';
import * as fileType from 'file-type';
import { v4 as uuidv4 } from 'uuid';
import { napCatCore } from '@/core';
Expand Down
2 changes: 1 addition & 1 deletion src/onebot11/action/extends/Debug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default class Debug extends BaseAction<Payload, any> {
// NTQQFileCacheApi,
NTQQWindowApi];
for (const ntqqApiClass of ntqqApi) {
logDebug('ntqqApiClass', ntqqApiClass);
// logDebug('ntqqApiClass', ntqqApiClass);
const method = (<any>ntqqApiClass)[payload.method];
if (method) {
const result = method(...payload.args);
Expand Down
2 changes: 1 addition & 1 deletion src/onebot11/action/file/GetFile.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import BaseAction from '../BaseAction';
import fs from 'fs/promises';
import { dbUtil } from '@/common/utils/db';
import { dbUtil } from '@/core/utils/db';
import { ob11Config } from '@/onebot11/config';
import { log, logDebug } from '@/common/utils/log';
import { sleep } from '@/common/utils/helper';
Expand Down
2 changes: 1 addition & 1 deletion src/onebot11/action/go-cqhttp/GetForwardMsg.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import BaseAction from '../BaseAction';
import { OB11ForwardMessage, OB11Message, OB11MessageData } from '../../types';
import { NTQQMsgApi } from '@/core/apis';
import { dbUtil } from '@/common/utils/db';
import { dbUtil } from '@/core/utils/db';
import { OB11Constructor } from '../../constructor';
import { ActionName } from '../types';

Expand Down
2 changes: 1 addition & 1 deletion src/onebot11/action/go-cqhttp/GetFriendMsgHistory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { OB11Message, OB11User } from '../../types';
import { getFriend, friends, uid2UinMap, getUidByUin } from '@/core/data';
import { ActionName } from '../types';
import { ChatType } from '@/core/entities';
import { dbUtil } from '@/common/utils/db';
import { dbUtil } from '@/core/utils/db';
import { NTQQMsgApi } from '@/core/apis/msg';
import { OB11Constructor } from '../../constructor';
import { logDebug } from '@/common/utils/log';
Expand Down
2 changes: 1 addition & 1 deletion src/onebot11/action/go-cqhttp/GetGroupMsgHistory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { OB11Message, OB11User } from '../../types';
import { getGroup, groups } from '@/core/data';
import { ActionName } from '../types';
import { ChatType } from '@/core/entities';
import { dbUtil } from '@/common/utils/db';
import { dbUtil } from '@/core/utils/db';
import { NTQQMsgApi } from '@/core/apis/msg';
import { OB11Constructor } from '../../constructor';
import { logDebug } from '@/common/utils/log';
Expand Down
2 changes: 1 addition & 1 deletion src/onebot11/action/msg/DeleteMsg.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { NTQQMsgApi } from '@/core/apis';
import { ActionName } from '../types';
import BaseAction from '../BaseAction';
import { dbUtil } from '@/common/utils/db';
import { dbUtil } from '@/core/utils/db';
import { napCatCore } from '@/core';

interface Payload {
Expand Down
2 changes: 1 addition & 1 deletion src/onebot11/action/msg/GetMsg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { OB11Message } from '../../types';
import { OB11Constructor } from '../../constructor';
import BaseAction from '../BaseAction';
import { ActionName } from '../types';
import { dbUtil } from '@/common/utils/db';
import { dbUtil } from '@/core/utils/db';


export interface PayloadType {
Expand Down
Loading

0 comments on commit 01417be

Please sign in to comment.