完成后台管理开发

This commit is contained in:
super
2026-03-22 13:33:37 +08:00
parent 5b636c3dfd
commit 64e32523cd
8 changed files with 303 additions and 35 deletions

View File

@@ -631,6 +631,30 @@ def list_dedupe_total_data():
})
@admin_api.route('/dedupe-total-data/import/<import_id>')
@admin_required
def dedupe_total_data_import_progress(import_id):
result, error_response, status = _proxy_backend_java(
'GET',
f'/api/admin/dedupe-total-data/import/{import_id}',
)
if error_response is not None:
return error_response, status
progress = result.get('data') or {}
return jsonify({
'success': True,
'progress': {
'status': progress.get('status') or 'pending',
'total_rows': progress.get('totalRows') or 0,
'processed_rows': progress.get('processedRows') or 0,
'asin_count': progress.get('asinCount') or 0,
'inserted_count': progress.get('insertedCount') or 0,
'skipped_count': progress.get('skippedCount') or 0,
'error_message': progress.get('errorMessage') or '',
},
})
@admin_api.route('/dedupe-total-data/import', methods=['POST'])
@admin_required
def import_dedupe_total_data():
@@ -650,13 +674,8 @@ def import_dedupe_total_data():
summary = result.get('data') or {}
return jsonify({
'success': True,
'msg': result.get('message') or '导入成功',
'summary': {
'total_rows': summary.get('totalRows') or 0,
'asin_count': summary.get('asinCount') or 0,
'inserted_count': summary.get('insertedCount') or 0,
'skipped_count': summary.get('skippedCount') or 0,
},
'msg': result.get('message') or '开始导入',
'import_id': summary.get('importId') or '',
})