diff --git a/wwwroot/api/instance_create.dspy b/wwwroot/api/instance_create.dspy index 703e6c1..cffee1e 100644 --- a/wwwroot/api/instance_create.dspy +++ b/wwwroot/api/instance_create.dspy @@ -1,7 +1,6 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- """Create approval instance""" -import json, time, uuid result = {'widgettype': 'Message', 'options': {'title': 'Error', 'message': 'Invalid request', 'type': 'error'}} @@ -25,7 +24,7 @@ try: workflows = await sor.sqlExe("SELECT id FROM approval_workflow WHERE id=${id}$ AND status='Y'", {'id': workflow_id}) if not workflows: result['options'] = {'title': 'Error', 'message': '工作流不存在或未激活', 'type': 'error'} - return json.dumps(result, ensure_ascii=False) + return result first_step = await sor.sqlExe("SELECT id, step_number FROM approval_step WHERE workflow_id=${workflow_id}$ ORDER BY step_number ASC LIMIT 1", {'workflow_id': workflow_id}) @@ -57,4 +56,4 @@ try: except Exception as e: result['options'] = {'title': 'Error', 'message': f'创建失败: {str(e)}', 'type': 'error'} -return json.dumps(result, ensure_ascii=False) +return result diff --git a/wwwroot/api/step_create.dspy b/wwwroot/api/step_create.dspy index c7ca334..f5ea7b0 100644 --- a/wwwroot/api/step_create.dspy +++ b/wwwroot/api/step_create.dspy @@ -1,7 +1,6 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- """Create approval step""" -import json, uuid result = {'widgettype': 'Message', 'options': {'title': 'Error', 'message': 'Invalid request', 'type': 'error'}} @@ -37,4 +36,4 @@ try: except Exception as e: result['options'] = {'title': 'Error', 'message': f'创建失败: {str(e)}', 'type': 'error'} -return json.dumps(result, ensure_ascii=False) +return result diff --git a/wwwroot/api/step_delete.dspy b/wwwroot/api/step_delete.dspy index 038257e..d7a0f0c 100644 --- a/wwwroot/api/step_delete.dspy +++ b/wwwroot/api/step_delete.dspy @@ -1,7 +1,6 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- """Delete approval step""" -import json result = {'widgettype': 'Message', 'options': {'title': 'Error', 'message': 'Invalid request', 'type': 'error'}} @@ -21,4 +20,4 @@ try: except Exception as e: result['options'] = {'title': 'Error', 'message': f'删除失败: {str(e)}', 'type': 'error'} -return json.dumps(result, ensure_ascii=False) +return result diff --git a/wwwroot/api/step_update.dspy b/wwwroot/api/step_update.dspy index fef549b..1800714 100644 --- a/wwwroot/api/step_update.dspy +++ b/wwwroot/api/step_update.dspy @@ -1,7 +1,6 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- """Update approval step""" -import json result = {'widgettype': 'Message', 'options': {'title': 'Error', 'message': 'Invalid request', 'type': 'error'}} @@ -41,4 +40,4 @@ try: except Exception as e: result['options'] = {'title': 'Error', 'message': f'更新失败: {str(e)}', 'type': 'error'} -return json.dumps(result, ensure_ascii=False) +return result diff --git a/wwwroot/api/workflow_create.dspy b/wwwroot/api/workflow_create.dspy index a2133b1..8bcb1c8 100644 --- a/wwwroot/api/workflow_create.dspy +++ b/wwwroot/api/workflow_create.dspy @@ -1,7 +1,6 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- """Create approval workflow""" -import json, time, uuid result = {'widgettype': 'Message', 'options': {'title': 'Error', 'message': 'Invalid request', 'type': 'error'}} @@ -34,4 +33,4 @@ try: except Exception as e: result['options'] = {'title': 'Error', 'message': f'创建失败: {str(e)}', 'type': 'error'} -return json.dumps(result, ensure_ascii=False) +return result diff --git a/wwwroot/api/workflow_delete.dspy b/wwwroot/api/workflow_delete.dspy index 8f5b662..7c0f967 100644 --- a/wwwroot/api/workflow_delete.dspy +++ b/wwwroot/api/workflow_delete.dspy @@ -1,7 +1,6 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- """Delete approval workflow""" -import json result = {'widgettype': 'Message', 'options': {'title': 'Error', 'message': 'Invalid request', 'type': 'error'}} @@ -22,4 +21,4 @@ try: except Exception as e: result['options'] = {'title': 'Error', 'message': f'删除失败: {str(e)}', 'type': 'error'} -return json.dumps(result, ensure_ascii=False) +return result diff --git a/wwwroot/api/workflow_update.dspy b/wwwroot/api/workflow_update.dspy index 97b2f89..e6a0bd7 100644 --- a/wwwroot/api/workflow_update.dspy +++ b/wwwroot/api/workflow_update.dspy @@ -1,7 +1,6 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- """Update approval workflow""" -import json, time result = {'widgettype': 'Message', 'options': {'title': 'Error', 'message': 'Invalid request', 'type': 'error'}} @@ -37,4 +36,4 @@ try: except Exception as e: result['options'] = {'title': 'Error', 'message': f'更新失败: {str(e)}', 'type': 'error'} -return json.dumps(result, ensure_ascii=False) +return result