feat: pg引入
This commit is contained in:
2
src/types/index.d.ts
vendored
2
src/types/index.d.ts
vendored
@@ -1,10 +1,12 @@
|
||||
import type { Mongoose } from 'mongoose';
|
||||
import type { RedisClientType } from 'redis';
|
||||
import type { Agent } from 'http';
|
||||
import type { Pool } from 'pg';
|
||||
|
||||
declare global {
|
||||
var mongodb: Mongoose | string | null;
|
||||
var redisClient: RedisClientType | null;
|
||||
var pgClient: Pool | null;
|
||||
var generatingQA: boolean;
|
||||
var generatingAbstract: boolean;
|
||||
var generatingVector: boolean;
|
||||
|
||||
2
src/types/model.d.ts
vendored
2
src/types/model.d.ts
vendored
@@ -12,7 +12,7 @@ export interface ModelUpdateParams {
|
||||
|
||||
export interface ModelDataItemType {
|
||||
id: string;
|
||||
status: 0 | 1; // 1代表向量生成完毕
|
||||
status: 'waiting' | 'ready';
|
||||
q: string; // 提问词
|
||||
a: string; // 原文
|
||||
modelId: string;
|
||||
|
||||
7
src/types/mongoSchema.d.ts
vendored
7
src/types/mongoSchema.d.ts
vendored
@@ -66,11 +66,8 @@ export interface ModelDataSchema {
|
||||
_id: string;
|
||||
modelId: string;
|
||||
userId: string;
|
||||
text: string;
|
||||
q: {
|
||||
id: string;
|
||||
text: string;
|
||||
};
|
||||
a: string;
|
||||
q: string;
|
||||
status: ModelDataType;
|
||||
}
|
||||
|
||||
|
||||
10
src/types/pg.d.ts
vendored
Normal file
10
src/types/pg.d.ts
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import { ModelDataStatusEnum } from '@/constants/model';
|
||||
|
||||
export interface PgModelDataItemType {
|
||||
id: string;
|
||||
q: string;
|
||||
a: string;
|
||||
status: `${ModelDataStatusEnum}`;
|
||||
model_id: string;
|
||||
user_id: string;
|
||||
}
|
||||
7
src/types/redis.d.ts
vendored
7
src/types/redis.d.ts
vendored
@@ -1,7 +0,0 @@
|
||||
import { ModelDataStatusEnum } from '@/constants/redis';
|
||||
export interface RedisModelDataItemType {
|
||||
id: string;
|
||||
q: string;
|
||||
text: string;
|
||||
status: `${ModelDataStatusEnum}`;
|
||||
}
|
||||
Reference in New Issue
Block a user