2024-02-20 18:10:20 +08:00
|
|
|
import api from '@/utils/api';
|
|
|
|
|
import registerServer from '@/utils/registerServer';
|
|
|
|
|
import request from '@/utils/request';
|
|
|
|
|
|
|
|
|
|
const {
|
|
|
|
|
getDialog,
|
|
|
|
|
setDialog,
|
|
|
|
|
listDialog,
|
2024-02-22 17:14:25 +08:00
|
|
|
removeDialog,
|
2024-02-20 18:10:20 +08:00
|
|
|
getConversation,
|
|
|
|
|
setConversation,
|
|
|
|
|
completeConversation,
|
|
|
|
|
listConversation,
|
2024-02-28 16:28:33 +08:00
|
|
|
removeConversation,
|
2024-04-16 19:06:47 +08:00
|
|
|
createToken,
|
|
|
|
|
listToken,
|
|
|
|
|
removeToken,
|
|
|
|
|
getStats,
|
|
|
|
|
createExternalConversation,
|
|
|
|
|
getExternalConversation,
|
|
|
|
|
completeExternalConversation,
|
2024-02-20 18:10:20 +08:00
|
|
|
} = api;
|
|
|
|
|
|
|
|
|
|
const methods = {
|
|
|
|
|
getDialog: {
|
|
|
|
|
url: getDialog,
|
|
|
|
|
method: 'get',
|
|
|
|
|
},
|
|
|
|
|
setDialog: {
|
|
|
|
|
url: setDialog,
|
|
|
|
|
method: 'post',
|
|
|
|
|
},
|
2024-02-22 17:14:25 +08:00
|
|
|
removeDialog: {
|
|
|
|
|
url: removeDialog,
|
|
|
|
|
method: 'post',
|
|
|
|
|
},
|
2024-02-20 18:10:20 +08:00
|
|
|
listDialog: {
|
|
|
|
|
url: listDialog,
|
|
|
|
|
method: 'get',
|
|
|
|
|
},
|
|
|
|
|
listConversation: {
|
|
|
|
|
url: listConversation,
|
|
|
|
|
method: 'get',
|
|
|
|
|
},
|
|
|
|
|
getConversation: {
|
|
|
|
|
url: getConversation,
|
|
|
|
|
method: 'get',
|
|
|
|
|
},
|
|
|
|
|
setConversation: {
|
|
|
|
|
url: setConversation,
|
|
|
|
|
method: 'post',
|
|
|
|
|
},
|
|
|
|
|
completeConversation: {
|
|
|
|
|
url: completeConversation,
|
|
|
|
|
method: 'post',
|
|
|
|
|
},
|
2024-02-28 16:28:33 +08:00
|
|
|
removeConversation: {
|
|
|
|
|
url: removeConversation,
|
|
|
|
|
method: 'post',
|
|
|
|
|
},
|
2024-04-16 19:06:47 +08:00
|
|
|
createToken: {
|
|
|
|
|
url: createToken,
|
|
|
|
|
method: 'post',
|
|
|
|
|
},
|
|
|
|
|
listToken: {
|
|
|
|
|
url: listToken,
|
|
|
|
|
method: 'get',
|
|
|
|
|
},
|
|
|
|
|
removeToken: {
|
|
|
|
|
url: removeToken,
|
|
|
|
|
method: 'post',
|
|
|
|
|
},
|
|
|
|
|
getStats: {
|
|
|
|
|
url: getStats,
|
|
|
|
|
method: 'get',
|
|
|
|
|
},
|
|
|
|
|
createExternalConversation: {
|
|
|
|
|
url: createExternalConversation,
|
2024-04-18 19:27:53 +08:00
|
|
|
method: 'get',
|
2024-04-16 19:06:47 +08:00
|
|
|
},
|
|
|
|
|
getExternalConversation: {
|
|
|
|
|
url: getExternalConversation,
|
|
|
|
|
method: 'get',
|
|
|
|
|
},
|
|
|
|
|
completeExternalConversation: {
|
|
|
|
|
url: completeExternalConversation,
|
|
|
|
|
method: 'post',
|
|
|
|
|
},
|
2024-02-20 18:10:20 +08:00
|
|
|
} as const;
|
|
|
|
|
|
|
|
|
|
const chatService = registerServer<keyof typeof methods>(methods, request);
|
|
|
|
|
|
|
|
|
|
export default chatService;
|