@cpzxrobot/sdk 1.3.119 → 1.3.121
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AIFORM_GATEWAY.md +573 -51
- package/aiform_gateway.ts +240 -1
- package/dist/aiform_gateway.js +204 -1
- package/package.json +1 -1
- package/types.d.ts +165 -3
package/aiform_gateway.ts
CHANGED
|
@@ -6,6 +6,11 @@ import type {
|
|
|
6
6
|
AiformFileUploadResponse,
|
|
7
7
|
AiformFileListResponse,
|
|
8
8
|
AiformFileDetailResponse,
|
|
9
|
+
AiformTemplateHistoryResponse,
|
|
10
|
+
AiformTemplatePublishResponse,
|
|
11
|
+
AiformReplyResponse,
|
|
12
|
+
AiformConfirmResponse,
|
|
13
|
+
AiformReplyListResponse,
|
|
9
14
|
} from ".";
|
|
10
15
|
|
|
11
16
|
export class AiformGateway extends Object {
|
|
@@ -67,6 +72,105 @@ export class AiformGateway extends Object {
|
|
|
67
72
|
return res.data;
|
|
68
73
|
});
|
|
69
74
|
},
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* 上传表格图片提炼模板提示词
|
|
78
|
+
* POST /api/v2/aiform/template/upload
|
|
79
|
+
* @param templateId 模板ID(可选,与factoryId二选一)
|
|
80
|
+
* @param file 图片文件
|
|
81
|
+
* @param factoryId 工厂ID(可选,与templateId二选一)
|
|
82
|
+
*/
|
|
83
|
+
uploadTemplateImage: async (templateId: number | null, file: File, factoryId?: number): Promise<any> => {
|
|
84
|
+
const axios = await this.context.ready;
|
|
85
|
+
|
|
86
|
+
if (!templateId && !factoryId) {
|
|
87
|
+
throw new Error('模板ID和工厂ID至少需要传一个');
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
const formData = new FormData();
|
|
91
|
+
formData.append('file', file);
|
|
92
|
+
if (templateId) {
|
|
93
|
+
formData.append('templateId', String(templateId));
|
|
94
|
+
}
|
|
95
|
+
if (factoryId) {
|
|
96
|
+
formData.append('factoryId', String(factoryId));
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
return axios.post('/api/v2/aiform/template/upload', formData, {
|
|
100
|
+
headers: {
|
|
101
|
+
'Content-Type': 'multipart/form-data'
|
|
102
|
+
}
|
|
103
|
+
}).then((res) => {
|
|
104
|
+
if (res.data.code !== 200) {
|
|
105
|
+
throw new Error(res.data.message || '上传图片失败');
|
|
106
|
+
}
|
|
107
|
+
return res.data;
|
|
108
|
+
});
|
|
109
|
+
},
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* 删除模板
|
|
113
|
+
* @param templateId 模板ID
|
|
114
|
+
* @returns Promise 包含删除结果
|
|
115
|
+
*/
|
|
116
|
+
delete: async (templateId: number): Promise<any> => {
|
|
117
|
+
const axios = await this.context.ready;
|
|
118
|
+
|
|
119
|
+
if (!templateId) {
|
|
120
|
+
throw new Error('模板ID不能为空');
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
return axios.post(`/api/v2/aiform/template/delete/${templateId}`).then((res) => {
|
|
124
|
+
if (res.data.code !== 200) {
|
|
125
|
+
throw new Error(res.data.message || '删除模板失败');
|
|
126
|
+
}
|
|
127
|
+
return res.data;
|
|
128
|
+
});
|
|
129
|
+
},
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* 查询模板解析历史快照
|
|
133
|
+
* @param templateId 模板ID
|
|
134
|
+
* @returns Promise 包含历史快照列表
|
|
135
|
+
*/
|
|
136
|
+
history: async (templateId: number): Promise<AiformTemplateHistoryResponse> => {
|
|
137
|
+
const axios = await this.context.ready;
|
|
138
|
+
|
|
139
|
+
if (!templateId) {
|
|
140
|
+
throw new Error('模板ID不能为空');
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
return axios.get(`/api/v2/aiform/template/${templateId}/history`).then((res) => {
|
|
144
|
+
if (res.data.code !== 200) {
|
|
145
|
+
throw new Error(res.data.message || '获取历史快照失败');
|
|
146
|
+
}
|
|
147
|
+
return res.data;
|
|
148
|
+
});
|
|
149
|
+
},
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* 按版本号将历史发布到主表
|
|
153
|
+
* @param templateId 模板ID
|
|
154
|
+
* @param snapshotVersion 解析版本号
|
|
155
|
+
* @returns Promise 包含更新后的模板
|
|
156
|
+
*/
|
|
157
|
+
publishHistory: async (templateId: number, snapshotVersion: number): Promise<AiformTemplatePublishResponse> => {
|
|
158
|
+
const axios = await this.context.ready;
|
|
159
|
+
|
|
160
|
+
if (!templateId) {
|
|
161
|
+
throw new Error('模板ID不能为空');
|
|
162
|
+
}
|
|
163
|
+
if (!snapshotVersion || snapshotVersion <= 0) {
|
|
164
|
+
throw new Error('解析版本号必须大于0');
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
return axios.post(`/api/v2/aiform/template/${templateId}/history/${snapshotVersion}/publish`).then((res) => {
|
|
168
|
+
if (res.data.code !== 200) {
|
|
169
|
+
throw new Error(res.data.message || '发布历史失败');
|
|
170
|
+
}
|
|
171
|
+
return res.data;
|
|
172
|
+
});
|
|
173
|
+
},
|
|
70
174
|
};
|
|
71
175
|
}
|
|
72
176
|
|
|
@@ -75,9 +179,10 @@ export class AiformGateway extends Object {
|
|
|
75
179
|
/**
|
|
76
180
|
* 上传表格图片
|
|
77
181
|
* @param templateId 关联的模板ID
|
|
182
|
+
* @param watermark 图片是否带水印
|
|
78
183
|
* @returns Promise 包含文件记录信息
|
|
79
184
|
*/
|
|
80
|
-
upload: async (templateId: number): Promise<AiformFileUploadResponse> => {
|
|
185
|
+
upload: async (templateId: number, watermark: boolean = false): Promise<AiformFileUploadResponse> => {
|
|
81
186
|
const axios = await this.context.ready;
|
|
82
187
|
|
|
83
188
|
if (!templateId) {
|
|
@@ -88,6 +193,7 @@ export class AiformGateway extends Object {
|
|
|
88
193
|
title: "请选择要解析的表格图片",
|
|
89
194
|
data: {
|
|
90
195
|
templateId,
|
|
196
|
+
watermark,
|
|
91
197
|
}
|
|
92
198
|
}).then((res) => {
|
|
93
199
|
if (res.data.code !== 200) {
|
|
@@ -138,6 +244,139 @@ export class AiformGateway extends Object {
|
|
|
138
244
|
return res.data;
|
|
139
245
|
});
|
|
140
246
|
},
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* 根据reply_id获取解析结果
|
|
250
|
+
* @param replyId reply记录ID
|
|
251
|
+
* @returns Promise 包含解析结果详情
|
|
252
|
+
*/
|
|
253
|
+
getReplyDetail: async (replyId: number): Promise<AiformFileDetailResponse> => {
|
|
254
|
+
const axios = await this.context.ready;
|
|
255
|
+
|
|
256
|
+
if (!replyId) {
|
|
257
|
+
throw new Error('reply记录ID不能为空');
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
return axios.get(`/api/v2/aiform/file/detail/reply/${replyId}`).then((res) => {
|
|
261
|
+
if (res.data.code !== 200) {
|
|
262
|
+
throw new Error(res.data.message || '获取解析结果失败');
|
|
263
|
+
}
|
|
264
|
+
return res.data;
|
|
265
|
+
});
|
|
266
|
+
},
|
|
267
|
+
|
|
268
|
+
/**
|
|
269
|
+
* 根据解析结果提交反馈(reply)
|
|
270
|
+
* @param code 文件业务编码
|
|
271
|
+
* @param reply 用户的修改意见/反馈内容
|
|
272
|
+
* @returns Promise 包含调整后的解析结果
|
|
273
|
+
*/
|
|
274
|
+
reply: async (code: string, reply: string): Promise<AiformReplyResponse> => {
|
|
275
|
+
const axios = await this.context.ready;
|
|
276
|
+
|
|
277
|
+
if (!code) {
|
|
278
|
+
throw new Error('文件业务编码不能为空');
|
|
279
|
+
}
|
|
280
|
+
if (!reply) {
|
|
281
|
+
throw new Error('反馈内容不能为空');
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
return axios.post(`/api/v2/aiform/file/reply`, {
|
|
285
|
+
code,
|
|
286
|
+
reply
|
|
287
|
+
}, {
|
|
288
|
+
headers: {
|
|
289
|
+
'Content-Type': 'application/x-www-form-urlencoded'
|
|
290
|
+
}
|
|
291
|
+
}).then((res) => {
|
|
292
|
+
if (res.data.code !== 200) {
|
|
293
|
+
throw new Error(res.data.message || '提交反馈失败');
|
|
294
|
+
}
|
|
295
|
+
return res.data;
|
|
296
|
+
});
|
|
297
|
+
},
|
|
298
|
+
|
|
299
|
+
/**
|
|
300
|
+
* 用户确认并保存
|
|
301
|
+
* @param id 解析结果记录ID
|
|
302
|
+
* @param content 表格文本,markdown表格格式
|
|
303
|
+
* @param headerRowCount 表头行数(可选)
|
|
304
|
+
* @param headers 表头单元格列表(可选)
|
|
305
|
+
* @returns Promise 包含保存结果
|
|
306
|
+
*/
|
|
307
|
+
confirm: async (id: number, content: string, headerRowCount?: number, headers?: any[]): Promise<AiformConfirmResponse> => {
|
|
308
|
+
const axios = await this.context.ready;
|
|
309
|
+
|
|
310
|
+
if (!id) {
|
|
311
|
+
throw new Error('解析结果记录ID不能为空');
|
|
312
|
+
}
|
|
313
|
+
if (!content) {
|
|
314
|
+
throw new Error('表格内容不能为空');
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
const data: any = {
|
|
318
|
+
content,
|
|
319
|
+
};
|
|
320
|
+
|
|
321
|
+
if (headerRowCount !== undefined) {
|
|
322
|
+
data.headerRowCount = headerRowCount;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
if (headers) {
|
|
326
|
+
data.headers = headers;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
return axios.post(`/api/v2/aiform/file/confirm?id=${id}`, data, {
|
|
330
|
+
headers: {
|
|
331
|
+
'Content-Type': 'application/json'
|
|
332
|
+
}
|
|
333
|
+
}).then((res) => {
|
|
334
|
+
if (res.data.code !== 200) {
|
|
335
|
+
throw new Error(res.data.message || '确认保存失败');
|
|
336
|
+
}
|
|
337
|
+
return res.data;
|
|
338
|
+
});
|
|
339
|
+
},
|
|
340
|
+
|
|
341
|
+
/**
|
|
342
|
+
* 查询文件的reply调整历史
|
|
343
|
+
* @param code 文件业务编码
|
|
344
|
+
* @returns Promise 包含reply记录列表
|
|
345
|
+
*/
|
|
346
|
+
getReplyList: async (code: string): Promise<AiformReplyListResponse> => {
|
|
347
|
+
const axios = await this.context.ready;
|
|
348
|
+
|
|
349
|
+
if (!code) {
|
|
350
|
+
throw new Error('文件业务编码不能为空');
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
return axios.get(`/api/v2/aiform/file/reply/list/${code}`).then((res) => {
|
|
354
|
+
if (res.data.code !== 200) {
|
|
355
|
+
throw new Error(res.data.message || '获取reply历史失败');
|
|
356
|
+
}
|
|
357
|
+
return res.data;
|
|
358
|
+
});
|
|
359
|
+
},
|
|
360
|
+
|
|
361
|
+
/**
|
|
362
|
+
* 根据文件code删除记录
|
|
363
|
+
* @param code 文件业务编码
|
|
364
|
+
* @returns Promise 包含删除结果
|
|
365
|
+
*/
|
|
366
|
+
delete: async (code: string): Promise<any> => {
|
|
367
|
+
const axios = await this.context.ready;
|
|
368
|
+
|
|
369
|
+
if (!code) {
|
|
370
|
+
throw new Error('文件业务编码不能为空');
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
return axios.post(`/api/v2/aiform/file/delete/${code}`).then((res) => {
|
|
374
|
+
if (res.data.code !== 200) {
|
|
375
|
+
throw new Error(res.data.message || '删除记录失败');
|
|
376
|
+
}
|
|
377
|
+
return res.data;
|
|
378
|
+
});
|
|
379
|
+
},
|
|
141
380
|
};
|
|
142
381
|
}
|
|
143
382
|
}
|
package/dist/aiform_gateway.js
CHANGED
|
@@ -61,6 +61,92 @@ class AiformGateway extends Object {
|
|
|
61
61
|
return res.data;
|
|
62
62
|
});
|
|
63
63
|
}),
|
|
64
|
+
/**
|
|
65
|
+
* 上传表格图片提炼模板提示词
|
|
66
|
+
* POST /api/v2/aiform/template/upload
|
|
67
|
+
* @param templateId 模板ID(可选,与factoryId二选一)
|
|
68
|
+
* @param file 图片文件
|
|
69
|
+
* @param factoryId 工厂ID(可选,与templateId二选一)
|
|
70
|
+
*/
|
|
71
|
+
uploadTemplateImage: (templateId, file, factoryId) => __awaiter(this, void 0, void 0, function* () {
|
|
72
|
+
const axios = yield this.context.ready;
|
|
73
|
+
if (!templateId && !factoryId) {
|
|
74
|
+
throw new Error('模板ID和工厂ID至少需要传一个');
|
|
75
|
+
}
|
|
76
|
+
const formData = new FormData();
|
|
77
|
+
formData.append('file', file);
|
|
78
|
+
if (templateId) {
|
|
79
|
+
formData.append('templateId', String(templateId));
|
|
80
|
+
}
|
|
81
|
+
if (factoryId) {
|
|
82
|
+
formData.append('factoryId', String(factoryId));
|
|
83
|
+
}
|
|
84
|
+
return axios.post('/api/v2/aiform/template/upload', formData, {
|
|
85
|
+
headers: {
|
|
86
|
+
'Content-Type': 'multipart/form-data'
|
|
87
|
+
}
|
|
88
|
+
}).then((res) => {
|
|
89
|
+
if (res.data.code !== 200) {
|
|
90
|
+
throw new Error(res.data.message || '上传图片失败');
|
|
91
|
+
}
|
|
92
|
+
return res.data;
|
|
93
|
+
});
|
|
94
|
+
}),
|
|
95
|
+
/**
|
|
96
|
+
* 删除模板
|
|
97
|
+
* @param templateId 模板ID
|
|
98
|
+
* @returns Promise 包含删除结果
|
|
99
|
+
*/
|
|
100
|
+
delete: (templateId) => __awaiter(this, void 0, void 0, function* () {
|
|
101
|
+
const axios = yield this.context.ready;
|
|
102
|
+
if (!templateId) {
|
|
103
|
+
throw new Error('模板ID不能为空');
|
|
104
|
+
}
|
|
105
|
+
return axios.post(`/api/v2/aiform/template/delete/${templateId}`).then((res) => {
|
|
106
|
+
if (res.data.code !== 200) {
|
|
107
|
+
throw new Error(res.data.message || '删除模板失败');
|
|
108
|
+
}
|
|
109
|
+
return res.data;
|
|
110
|
+
});
|
|
111
|
+
}),
|
|
112
|
+
/**
|
|
113
|
+
* 查询模板解析历史快照
|
|
114
|
+
* @param templateId 模板ID
|
|
115
|
+
* @returns Promise 包含历史快照列表
|
|
116
|
+
*/
|
|
117
|
+
history: (templateId) => __awaiter(this, void 0, void 0, function* () {
|
|
118
|
+
const axios = yield this.context.ready;
|
|
119
|
+
if (!templateId) {
|
|
120
|
+
throw new Error('模板ID不能为空');
|
|
121
|
+
}
|
|
122
|
+
return axios.get(`/api/v2/aiform/template/${templateId}/history`).then((res) => {
|
|
123
|
+
if (res.data.code !== 200) {
|
|
124
|
+
throw new Error(res.data.message || '获取历史快照失败');
|
|
125
|
+
}
|
|
126
|
+
return res.data;
|
|
127
|
+
});
|
|
128
|
+
}),
|
|
129
|
+
/**
|
|
130
|
+
* 按版本号将历史发布到主表
|
|
131
|
+
* @param templateId 模板ID
|
|
132
|
+
* @param snapshotVersion 解析版本号
|
|
133
|
+
* @returns Promise 包含更新后的模板
|
|
134
|
+
*/
|
|
135
|
+
publishHistory: (templateId, snapshotVersion) => __awaiter(this, void 0, void 0, function* () {
|
|
136
|
+
const axios = yield this.context.ready;
|
|
137
|
+
if (!templateId) {
|
|
138
|
+
throw new Error('模板ID不能为空');
|
|
139
|
+
}
|
|
140
|
+
if (!snapshotVersion || snapshotVersion <= 0) {
|
|
141
|
+
throw new Error('解析版本号必须大于0');
|
|
142
|
+
}
|
|
143
|
+
return axios.post(`/api/v2/aiform/template/${templateId}/history/${snapshotVersion}/publish`).then((res) => {
|
|
144
|
+
if (res.data.code !== 200) {
|
|
145
|
+
throw new Error(res.data.message || '发布历史失败');
|
|
146
|
+
}
|
|
147
|
+
return res.data;
|
|
148
|
+
});
|
|
149
|
+
}),
|
|
64
150
|
};
|
|
65
151
|
}
|
|
66
152
|
get record() {
|
|
@@ -68,9 +154,10 @@ class AiformGateway extends Object {
|
|
|
68
154
|
/**
|
|
69
155
|
* 上传表格图片
|
|
70
156
|
* @param templateId 关联的模板ID
|
|
157
|
+
* @param watermark 图片是否带水印
|
|
71
158
|
* @returns Promise 包含文件记录信息
|
|
72
159
|
*/
|
|
73
|
-
upload: (
|
|
160
|
+
upload: (templateId_1, ...args_1) => __awaiter(this, [templateId_1, ...args_1], void 0, function* (templateId, watermark = false) {
|
|
74
161
|
const axios = yield this.context.ready;
|
|
75
162
|
if (!templateId) {
|
|
76
163
|
throw new Error('模板ID不能为空');
|
|
@@ -79,6 +166,7 @@ class AiformGateway extends Object {
|
|
|
79
166
|
title: "请选择要解析的表格图片",
|
|
80
167
|
data: {
|
|
81
168
|
templateId,
|
|
169
|
+
watermark,
|
|
82
170
|
}
|
|
83
171
|
}).then((res) => {
|
|
84
172
|
if (res.data.code !== 200) {
|
|
@@ -123,6 +211,121 @@ class AiformGateway extends Object {
|
|
|
123
211
|
return res.data;
|
|
124
212
|
});
|
|
125
213
|
}),
|
|
214
|
+
/**
|
|
215
|
+
* 根据reply_id获取解析结果
|
|
216
|
+
* @param replyId reply记录ID
|
|
217
|
+
* @returns Promise 包含解析结果详情
|
|
218
|
+
*/
|
|
219
|
+
getReplyDetail: (replyId) => __awaiter(this, void 0, void 0, function* () {
|
|
220
|
+
const axios = yield this.context.ready;
|
|
221
|
+
if (!replyId) {
|
|
222
|
+
throw new Error('reply记录ID不能为空');
|
|
223
|
+
}
|
|
224
|
+
return axios.get(`/api/v2/aiform/file/detail/reply/${replyId}`).then((res) => {
|
|
225
|
+
if (res.data.code !== 200) {
|
|
226
|
+
throw new Error(res.data.message || '获取解析结果失败');
|
|
227
|
+
}
|
|
228
|
+
return res.data;
|
|
229
|
+
});
|
|
230
|
+
}),
|
|
231
|
+
/**
|
|
232
|
+
* 根据解析结果提交反馈(reply)
|
|
233
|
+
* @param code 文件业务编码
|
|
234
|
+
* @param reply 用户的修改意见/反馈内容
|
|
235
|
+
* @returns Promise 包含调整后的解析结果
|
|
236
|
+
*/
|
|
237
|
+
reply: (code, reply) => __awaiter(this, void 0, void 0, function* () {
|
|
238
|
+
const axios = yield this.context.ready;
|
|
239
|
+
if (!code) {
|
|
240
|
+
throw new Error('文件业务编码不能为空');
|
|
241
|
+
}
|
|
242
|
+
if (!reply) {
|
|
243
|
+
throw new Error('反馈内容不能为空');
|
|
244
|
+
}
|
|
245
|
+
return axios.post(`/api/v2/aiform/file/reply`, {
|
|
246
|
+
code,
|
|
247
|
+
reply
|
|
248
|
+
}, {
|
|
249
|
+
headers: {
|
|
250
|
+
'Content-Type': 'application/x-www-form-urlencoded'
|
|
251
|
+
}
|
|
252
|
+
}).then((res) => {
|
|
253
|
+
if (res.data.code !== 200) {
|
|
254
|
+
throw new Error(res.data.message || '提交反馈失败');
|
|
255
|
+
}
|
|
256
|
+
return res.data;
|
|
257
|
+
});
|
|
258
|
+
}),
|
|
259
|
+
/**
|
|
260
|
+
* 用户确认并保存
|
|
261
|
+
* @param id 解析结果记录ID
|
|
262
|
+
* @param content 表格文本,markdown表格格式
|
|
263
|
+
* @param headerRowCount 表头行数(可选)
|
|
264
|
+
* @param headers 表头单元格列表(可选)
|
|
265
|
+
* @returns Promise 包含保存结果
|
|
266
|
+
*/
|
|
267
|
+
confirm: (id, content, headerRowCount, headers) => __awaiter(this, void 0, void 0, function* () {
|
|
268
|
+
const axios = yield this.context.ready;
|
|
269
|
+
if (!id) {
|
|
270
|
+
throw new Error('解析结果记录ID不能为空');
|
|
271
|
+
}
|
|
272
|
+
if (!content) {
|
|
273
|
+
throw new Error('表格内容不能为空');
|
|
274
|
+
}
|
|
275
|
+
const data = {
|
|
276
|
+
content,
|
|
277
|
+
};
|
|
278
|
+
if (headerRowCount !== undefined) {
|
|
279
|
+
data.headerRowCount = headerRowCount;
|
|
280
|
+
}
|
|
281
|
+
if (headers) {
|
|
282
|
+
data.headers = headers;
|
|
283
|
+
}
|
|
284
|
+
return axios.post(`/api/v2/aiform/file/confirm?id=${id}`, data, {
|
|
285
|
+
headers: {
|
|
286
|
+
'Content-Type': 'application/json'
|
|
287
|
+
}
|
|
288
|
+
}).then((res) => {
|
|
289
|
+
if (res.data.code !== 200) {
|
|
290
|
+
throw new Error(res.data.message || '确认保存失败');
|
|
291
|
+
}
|
|
292
|
+
return res.data;
|
|
293
|
+
});
|
|
294
|
+
}),
|
|
295
|
+
/**
|
|
296
|
+
* 查询文件的reply调整历史
|
|
297
|
+
* @param code 文件业务编码
|
|
298
|
+
* @returns Promise 包含reply记录列表
|
|
299
|
+
*/
|
|
300
|
+
getReplyList: (code) => __awaiter(this, void 0, void 0, function* () {
|
|
301
|
+
const axios = yield this.context.ready;
|
|
302
|
+
if (!code) {
|
|
303
|
+
throw new Error('文件业务编码不能为空');
|
|
304
|
+
}
|
|
305
|
+
return axios.get(`/api/v2/aiform/file/reply/list/${code}`).then((res) => {
|
|
306
|
+
if (res.data.code !== 200) {
|
|
307
|
+
throw new Error(res.data.message || '获取reply历史失败');
|
|
308
|
+
}
|
|
309
|
+
return res.data;
|
|
310
|
+
});
|
|
311
|
+
}),
|
|
312
|
+
/**
|
|
313
|
+
* 根据文件code删除记录
|
|
314
|
+
* @param code 文件业务编码
|
|
315
|
+
* @returns Promise 包含删除结果
|
|
316
|
+
*/
|
|
317
|
+
delete: (code) => __awaiter(this, void 0, void 0, function* () {
|
|
318
|
+
const axios = yield this.context.ready;
|
|
319
|
+
if (!code) {
|
|
320
|
+
throw new Error('文件业务编码不能为空');
|
|
321
|
+
}
|
|
322
|
+
return axios.post(`/api/v2/aiform/file/delete/${code}`).then((res) => {
|
|
323
|
+
if (res.data.code !== 200) {
|
|
324
|
+
throw new Error(res.data.message || '删除记录失败');
|
|
325
|
+
}
|
|
326
|
+
return res.data;
|
|
327
|
+
});
|
|
328
|
+
}),
|
|
126
329
|
};
|
|
127
330
|
}
|
|
128
331
|
}
|