perf: redis del (#6115)

* fix: log

* fix: redirect api
This commit is contained in:
Archer
2025-12-18 13:49:45 +08:00
committed by GitHub
parent 527237d019
commit 0d88761378
15 changed files with 49 additions and 18 deletions
@@ -0,0 +1,4 @@
import { NextAPI } from '@/service/middleware/entry';
import { handler } from './history/clearHistories';
export default NextAPI(handler);
@@ -0,0 +1,4 @@
import { NextAPI } from '@/service/middleware/entry';
import { handler } from './history/delHistory';
export default NextAPI(handler);
@@ -0,0 +1,4 @@
import { NextAPI } from '@/service/middleware/entry';
import { handler } from './history/getHistories';
export default NextAPI(handler);
@@ -9,7 +9,6 @@ import { getS3ChatSource } from '@fastgpt/service/common/s3/sources/chat';
import { authApp } from '@fastgpt/service/support/permission/app/auth';
import { AppReadChatLogPerVal } from '@fastgpt/global/support/permission/app/constant';
import { ChatBatchDeleteBodySchema } from '@fastgpt/global/openapi/core/chat/history/api';
import { UserError } from '@fastgpt/global/common/error/utils';
async function handler(req: ApiRequestProps, res: NextApiResponse) {
const { appId, chatIds } = ChatBatchDeleteBodySchema.parse(req.body);
@@ -7,7 +7,7 @@ import { type ApiRequestProps } from '@fastgpt/service/type/next';
import { authChatCrud } from '@/service/support/permission/auth/chat';
/* clear all chat histories of an app */
async function handler(req: ApiRequestProps, res: NextApiResponse) {
export async function handler(req: ApiRequestProps, res: NextApiResponse) {
const { appId, shareId, outLinkUid, teamId, teamToken } = ClearChatHistoriesSchema.parse(
req.query
);
@@ -6,7 +6,7 @@ import { NextAPI } from '@/service/middleware/entry';
import { type ApiRequestProps } from '@fastgpt/service/type/next';
/* delete single chat history (soft delete) */
async function handler(req: ApiRequestProps, res: NextApiResponse) {
export async function handler(req: ApiRequestProps, res: NextApiResponse) {
const { appId, chatId } = DelChatHistorySchema.parse(req.query);
await authChatCrud({
@@ -14,7 +14,7 @@ import { parsePaginationRequest } from '@fastgpt/service/common/api/pagination';
import { addMonths } from 'date-fns';
/* get chat histories list */
async function handler(
export async function handler(
req: ApiRequestProps,
_res: ApiResponseType
): Promise<GetHistoriesResponseType> {
@@ -7,7 +7,7 @@ import { type ApiRequestProps } from '@fastgpt/service/type/next';
import { WritePermissionVal } from '@fastgpt/global/support/permission/constant';
/* update chat history: title, customTitle, top */
async function handler(req: ApiRequestProps, res: NextApiResponse) {
export async function handler(req: ApiRequestProps, res: NextApiResponse) {
const { appId, chatId, title, customTitle, top } = UpdateHistoryBodySchema.parse(req.body);
await authChatCrud({
req,
@@ -0,0 +1,4 @@
import { NextAPI } from '@/service/middleware/entry';
import { handler } from './history/updateHistory';
export default NextAPI(handler);