generated from tailored/app-template
perf: perf request
This commit is contained in:
parent
226f9a6896
commit
fe716b8ea3
@ -11,10 +11,15 @@ app
|
||||
.define(async (ctx) => {
|
||||
const tokenUser = ctx.state.tokenUser;
|
||||
const type = ctx.query.type || 'keep';
|
||||
const all = ctx.query.all || false;
|
||||
let search: any = {};
|
||||
if (type && !all) {
|
||||
search.type = type;
|
||||
}
|
||||
const aiChatList = await AiChatHistoryModel.findAll({
|
||||
where: {
|
||||
uid: tokenUser.id,
|
||||
type,
|
||||
...search,
|
||||
},
|
||||
order: [['updatedAt', 'DESC']],
|
||||
});
|
||||
|
@ -18,6 +18,8 @@ type AiChatHistoryData = {
|
||||
[key: string]: any;
|
||||
};
|
||||
};
|
||||
export const aiChatTypes = ['keep', 'temp', 'archive'] as const;
|
||||
export type AIChatType = (typeof aiChatTypes)[number];
|
||||
export class AiChatHistoryModel extends Model {
|
||||
declare id: string;
|
||||
declare username: string;
|
||||
|
Loading…
x
Reference in New Issue
Block a user