File size: 1,060 Bytes
8c4ec99
 
 
 
 
 
 
 
058cd84
8c4ec99
 
 
 
6a6f6eb
8c4ec99
 
 
 
 
 
 
 
 
 
 
058cd84
 
 
 
8c4ec99
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6a6f6eb
 
 
 
8c4ec99
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import api from '@/utils/api';
import registerServer from '@/utils/registerServer';
import request from '@/utils/request';

const {
  getDialog,
  setDialog,
  listDialog,
  removeDialog,
  getConversation,
  setConversation,
  completeConversation,
  listConversation,
  removeConversation,
} = api;

const methods = {
  getDialog: {
    url: getDialog,
    method: 'get',
  },
  setDialog: {
    url: setDialog,
    method: 'post',
  },
  removeDialog: {
    url: removeDialog,
    method: 'post',
  },
  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',
  },
  removeConversation: {
    url: removeConversation,
    method: 'post',
  },
} as const;

const chatService = registerServer<keyof typeof methods>(methods, request);

export default chatService;