31 lines
864 B
TypeScript
31 lines
864 B
TypeScript
|
|
import apiService, { Config } from '@/services/api.service'
|
||
|
|
import { AiDto } from './models'
|
||
|
|
import { PagedAndSortedResultRequestDto, PagedResultDto } from '../abp'
|
||
|
|
|
||
|
|
export class AiService {
|
||
|
|
apiName = 'Default'
|
||
|
|
|
||
|
|
getList = (input: PagedAndSortedResultRequestDto, config?: Partial<Config>) =>
|
||
|
|
apiService.fetchData<PagedResultDto<AiDto>, PagedAndSortedResultRequestDto>(
|
||
|
|
{
|
||
|
|
method: 'GET',
|
||
|
|
url: '/api/app/ai-bot',
|
||
|
|
params: {
|
||
|
|
sorting: input.sorting,
|
||
|
|
skipCount: input.skipCount,
|
||
|
|
maxResultCount: input.maxResultCount,
|
||
|
|
},
|
||
|
|
},
|
||
|
|
{ apiName: this.apiName, ...config },
|
||
|
|
)
|
||
|
|
}
|
||
|
|
|
||
|
|
export const getAi = async (skipCount = 0, maxResultCount = 1000, sorting = 'botName') => {
|
||
|
|
const service = new AiService()
|
||
|
|
|
||
|
|
return await service.getList({
|
||
|
|
sorting,
|
||
|
|
skipCount,
|
||
|
|
maxResultCount,
|
||
|
|
})
|
||
|
|
}
|