Spaces:
Sleeping
Sleeping
quachtiensinh27 commited on
Commit ·
6808376
1
Parent(s): 477a7c3
cập nhật backend dashboard TA
Browse files- src/services/ta.service.js +74 -0
src/services/ta.service.js
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import api from './api';
|
| 2 |
+
|
| 3 |
+
const taService = {
|
| 4 |
+
/**
|
| 5 |
+
* Quét học viên có nguy cơ
|
| 6 |
+
*/
|
| 7 |
+
scanAtRisk: async (spaceId) => {
|
| 8 |
+
const response = await api.post(`/ta/scan-at-risk?spaceId=${spaceId}`);
|
| 9 |
+
return response.data;
|
| 10 |
+
},
|
| 11 |
+
|
| 12 |
+
/**
|
| 13 |
+
* Lấy danh sách học viên có nguy cơ
|
| 14 |
+
*/
|
| 15 |
+
getAtRiskList: async (spaceId) => {
|
| 16 |
+
const response = await api.get(`/ta/at-risk?spaceId=${spaceId}`);
|
| 17 |
+
return response.data;
|
| 18 |
+
},
|
| 19 |
+
|
| 20 |
+
/**
|
| 21 |
+
* Giải quyết cảnh báo
|
| 22 |
+
*/
|
| 23 |
+
resolveAlert: async (snapshotId, spaceId) => {
|
| 24 |
+
const response = await api.post(`/ta/at-risk/${snapshotId}/resolve?spaceId=${spaceId}`);
|
| 25 |
+
return response.data;
|
| 26 |
+
},
|
| 27 |
+
|
| 28 |
+
/**
|
| 29 |
+
* Lấy hàng chờ duyệt tóm tắt
|
| 30 |
+
*/
|
| 31 |
+
getSummaryQueue: async (spaceId) => {
|
| 32 |
+
const response = await api.get(`/ta/summary-queue?spaceId=${spaceId}`);
|
| 33 |
+
return response.data;
|
| 34 |
+
},
|
| 35 |
+
|
| 36 |
+
/**
|
| 37 |
+
* Duyệt bản tóm tắt
|
| 38 |
+
*/
|
| 39 |
+
approveSummary: async (draftId, spaceId) => {
|
| 40 |
+
const response = await api.post(`/ta/summary-queue/${draftId}/approve?spaceId=${spaceId}`);
|
| 41 |
+
return response.data;
|
| 42 |
+
},
|
| 43 |
+
|
| 44 |
+
/**
|
| 45 |
+
* Lấy nhật ký hành động
|
| 46 |
+
*/
|
| 47 |
+
getActionLogs: async (spaceId) => {
|
| 48 |
+
const response = await api.get(`/ta/action-logs?spaceId=${spaceId}`);
|
| 49 |
+
return response.data;
|
| 50 |
+
},
|
| 51 |
+
|
| 52 |
+
/**
|
| 53 |
+
* Lấy bộ Context cho Agent
|
| 54 |
+
*/
|
| 55 |
+
getAtRiskContext: async (snapshotId, spaceId) => {
|
| 56 |
+
const response = await api.get(`/ta/at-risk-context/${snapshotId}?spaceId=${spaceId}`);
|
| 57 |
+
return response.data;
|
| 58 |
+
},
|
| 59 |
+
/**
|
| 60 |
+
* Tải lên slide bài giảng
|
| 61 |
+
*/
|
| 62 |
+
uploadSlide: async (spaceId, file) => {
|
| 63 |
+
const formData = new FormData();
|
| 64 |
+
formData.append('file', file);
|
| 65 |
+
const response = await api.post(`/ta/upload-slide?spaceId=${spaceId}`, formData, {
|
| 66 |
+
headers: {
|
| 67 |
+
'Content-Type': 'multipart/form-data',
|
| 68 |
+
},
|
| 69 |
+
});
|
| 70 |
+
return response.data;
|
| 71 |
+
},
|
| 72 |
+
};
|
| 73 |
+
|
| 74 |
+
export default taService;
|