UnisKB/ui/src/api/log.ts

72 lines
1.6 KiB
TypeScript
Raw Normal View History

2023-12-06 09:30:46 +00:00
import { Result } from '@/request/Result'
import { get, post, postStream, del, put } from '@/request/index'
import type { pageRequest } from '@/api/type/common'
import { type Ref } from 'vue'
const prefix = '/application'
/**
*
* @param
* application_id, history_day
* page {
"current_page": "string",
"page_size": "string",
}
* param {
"history_day": "string",
"search": "string",
}
*/
const getChatLog: (
applicaiton_id: String,
page: pageRequest,
param: any,
loading?: Ref<boolean>
) => Promise<Result<any>> = (applicaiton_id, page, param, loading) => {
return get(
`${prefix}/${applicaiton_id}/chat/${page.current_page}/${page.page_size}`,
param,
loading
)
}
2023-12-07 03:08:05 +00:00
/**
*
* @param applicaiton_id, chat_id,
*/
const delChatLog: (
applicaiton_id: string,
chat_id: string,
loading?: Ref<boolean>
) => Promise<Result<boolean>> = (applicaiton_id, chat_id, loading) => {
2023-12-07 07:22:07 +00:00
return del(`${prefix}/${applicaiton_id}/chat/${chat_id}`, undefined, {}, loading)
}
/**
*
* @param
* application_id, chart_id
* page {
"current_page": "string",
"page_size": "string",
}
*/
const getChatRecordLog: (
applicaiton_id: String,
chart_id: String,
page: pageRequest,
loading?: Ref<boolean>
) => Promise<Result<any>> = (applicaiton_id, chart_id, page, loading) => {
return get(
`${prefix}/${applicaiton_id}/chat/${chart_id}/chat_record/${page.current_page}/${page.page_size}`,
undefined,
loading
)
2023-12-07 03:08:05 +00:00
}
2023-12-06 09:30:46 +00:00
export default {
2023-12-07 03:08:05 +00:00
getChatLog,
2023-12-07 07:22:07 +00:00
delChatLog,
getChatRecordLog
2023-12-06 09:30:46 +00:00
}