refactor: establish standalone application boundary

This commit is contained in:
leefer
2026-08-03 21:42:25 +08:00
parent cc5fb8d73e
commit e1e76cd51e
324 changed files with 63090 additions and 44743 deletions
+18
View File
@@ -0,0 +1,18 @@
from __future__ import annotations
import json
from http import HTTPStatus
class PoolRoutesMixin:
def save_reason(self) -> None:
try:
body = self.read_json_body()
self.application_service.save_reason(
str(body.get("trade_date") or ""),
str(body.get("code") or ""),
str(body.get("reason") or ""),
)
self.send_json({"ok": True})
except (ValueError, json.JSONDecodeError) as exc:
self.send_json({"error": str(exc)}, HTTPStatus.BAD_REQUEST)