index.js
4.07 KB
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
import axios from 'axios';
const instance = axios.create({
baseURL: process.env.VUE_APP_API_URL,
});
function registerUser(userData) {
// const url = 'http://localhost:3000/api/signup'
return axios.post('/api/RegistUser', userData);
}
function loginUser(userData) {
// const url = 'http://localhost:3000/api/login'
return axios.post('/api/login', userData);
}
function folder(curData) {
return axios.get('/api/folder/show', {
params: {
id: curData.id,
folder_id: curData.folder_id,
},
});
}
function makeFolder(folderData) {
return axios.post('/api/folder/makefolder', folderData);
}
function deleteFolder(folderData) {
return axios.post('/api/folder/delfolder', folderData);
}
function moveFolder(folderData) {
return axios.post('/api/folder/move', folderData);
}
function file(curData) {
return axios.get('/api/file', {
params: {
id: curData.id,
cur: curData.cur,
},
});
}
function uploadFile(fileData) {
return axios.post('/api/file/upload', fileData, {
headers: {
'Content-Type': 'multipart/form-data',
},
});
}
function detailFile(fileData) {
return axios.get(`/api/file/${fileData.fileName}`, {
params: {
id: fileData.id,
cur: fileData.cur,
},
});
}
function deleteFile(fileData) {
return axios.get(`/api/file/delete/${fileData.fileName}`, {
params: {
//현재 접속한 사람의 id와 삭제할 파일의 이름, 현재 폴더위치를 파라미터로 넘긴다.
id: fileData.user_id,
cur: fileData.cur,
},
});
}
function downloadFile(fileData) {
return axios.get(`/api/file/download/${fileData.fileName}`, {
params: {
//현재 접속한 사람의 id와 다운로드를 위해 선택한 파일의 이름을 파라미터로 넘긴다.
id: fileData.id,
cur: fileData.cur,
},
});
}
function accessedList(curData) {
return axios.get('/api/quick', {
params: {
id: curData.id,
},
});
}
function showTrashcan(userId) {
return axios.get('/api/trashcan/show', {
params: {
id: userId,
},
});
}
function modifyFile(fileData) {
return axios.post(`/api/file/modify/${fileData.name}`, fileData);
}
function delFavorite(folderData) {
return axios.post('/api/favorites/delfolder', folderData);
}
function addFavorite(folderData) {
return axios.post('/api/favorites/addfolder', folderData);
}
function moveFile(fileData) {
return axios.post('/api/folder/move', fileData);
}
function delFavoriteFile(fileData) {
return axios.post('/api/favorites/delfile', fileData);
}
function addFavoriteFile(fileData) {
return axios.post('/api/favorites/addfile', fileData);
}
function getFavoriteList(userId) {
return axios.get('/api/favorites/show', {
params: {
id: userId,
},
});
}
function shareFile(shareData) {
return axios.post('/api/share', shareData);
}
function tdelFolder(tData) {
return axios.get('/api/trashcan/delfolder', {
params: {
id: tData.id,
folder_id: tData.folder_id,
},
});
}
function tdelFile(tData) {
return axios.get('/api/trashcan/delfile', {
params: {
id: tData.id,
file_id: tData.file_id,
},
});
}
function tdelAll(userId) {
return axios.get('/api/trashcan/all', {
params: {
id: userId,
},
});
}
function uploadContact(contactData){
return axios.post('/api/contact/contact_upload', contactData.file,{
headers: {
'Content-Type': 'multipart/form-data',
},
params:{
id: contactData.id,
}
});
}
function downloadContact(userID){
return axios.post('/api/contact/contact_download', null, {params:{id:userID}});
}
function printContact(userID){
console.log(String(userID));
return axios.post('api/contact/contact_list', {id:userID}, {params:{id:userID},});
}
function deleteContact(userID){
return axios.post('api/contact/contact_delete', {id:userID}, {params:{id:userID}});
}
export {
registerUser,
loginUser,
folder,
makeFolder,
deleteFolder,
moveFolder,
file,
uploadFile,
deleteFile,
downloadFile,
delFavorite,
addFavorite,
moveFile,
delFavoriteFile,
addFavoriteFile,
accessedList,
detailFile,
modifyFile,
getFavoriteList,
shareFile,
tdelFolder,
tdelFile,
tdelAll,
showTrashcan,
uploadContact,
downloadContact,
printContact,
deleteContact
};