数通互联化工云平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

131 lines
2.6 KiB

import request from '@/utils/request';
import { AxiosPromise } from 'axios';
4 months ago
import { matterPage,createDir,matterTreeList,matterInfo} from './type';
/**
*
*/
export function getSpaceMatterList( uid:string,data?: matterPage): AxiosPromise<matterTreeList> {
return request({
url: '/hxpan/api/space/page',
method: 'post',
headers: {
'Identifier':uid,
'Content-Type': 'application/x-www-form-urlencoded'
},
data: data
});
}
/**
*
*/
export function doCreateSpaceDir(uid:string,data?: createDir){
return request({
url: '/hxpan/api/space/directory',
method: 'post',
headers: {
'Identifier':uid,
'Content-Type': 'application/x-www-form-urlencoded'
},
data: data
});
}
4 months ago
export function doCreateAiagent(uid:string,data?: {space:string,matter:string}){
return request({
url: '/hxpan/api/space/aiagent',
method: 'post',
headers: {
'Identifier':uid,
'Content-Type': 'application/x-www-form-urlencoded'
},
data: data
});
}
/**
*
*/
export function doAccessManage(uid:string,data?: any){
return request({
url: '/hxpan/api/space/access',
method: 'post',
headers: {
'Identifier':uid,
'Content-Type': 'application/x-www-form-urlencoded'
},
data: data
});
}
/**
*
*/
export function doDelSpace(uid:string,data?: any){
return request({
url: '/hxpan/api/space/delete',
method: 'post',
headers: {
'Identifier':uid,
'Content-Type': 'application/x-www-form-urlencoded'
},
data: data
});
}
/**
*
*/
export function doDelSpaceMatter(uid:string,data?: any){
return request({
url: '/hxpan/api/space/materdelete',
method: 'post',
headers: {
'Identifier':uid,
'Content-Type': 'application/x-www-form-urlencoded'
},
data: data
});
4 months ago
}
//-------------------AI backend APIs---------------
/**
*
*/
export function doAiTraining(_url:string,data?: any){
return request({
url: '/aibot'+_url,
method: 'post',
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
},
data: data
});
}
export interface aiChatData{
inputs:object;
query:string;
response_mode:string;
conversation_id?:string;
user:string,
file?:[]
}
/**
* api
*/
export function doAiChat(_url:string,data: aiChatData,sig?:AbortSignal){
return fetch(
_url,{
method: 'post',
headers: {
'Content-Type': 'application/json'
},
signal:sig,
body: JSON.stringify(data)
}
)
}