본문 어투: 기본 다정한 톤 + 다정한/담백한/서정적인 선택과 다시 쓰기(미리보기·적용)
This commit is contained in:
1 parent
a749b9daf8
commit
02e654d75e
5 files changed
+139
-5
No files matched your search
+12
-1
@@ -740,7 +740,9 @@ class Handler(BaseHTTPRequestHandler):
|
||||
self.send_body(200, target.read_bytes(), ctype)
|
||||
return
|
||||
if path == "/api/presets":
|
||||
self.send_json({"ok": True, "presets": reg.PRESETS, "vision": reg.vision_status()})
|
||||
self.send_json({"ok": True, "presets": reg.PRESETS, "vision": reg.vision_status(),
|
||||
"tones": [{"key": k, "label": v["label"]} for k, v in reg.TONES.items()],
|
||||
"default_tone": reg.DEFAULT_TONE})
|
||||
return
|
||||
if path == "/api/state":
|
||||
rows = summaries()
|
||||
@@ -818,6 +820,15 @@ class Handler(BaseHTTPRequestHandler):
|
||||
except RuntimeError as error:
|
||||
self.send_json({"ok": False, "error": str(error)}, 502)
|
||||
return
|
||||
if path == "/api/tone":
|
||||
payload = self.read_json()
|
||||
try:
|
||||
self.send_json(upd.rewrite_body(str(payload.get("slug") or ""), str(payload.get("tone") or "")))
|
||||
except FileNotFoundError as error:
|
||||
self.send_json({"ok": False, "error": str(error)}, 404)
|
||||
except (ValueError, RuntimeError) as error:
|
||||
self.send_json({"ok": False, "error": str(error)}, 502)
|
||||
return
|
||||
if path == "/api/update":
|
||||
helpers = {"build": build, "git_commit": git_commit, "deploy": deploy, "push": push}
|
||||
try:
|
||||
|
||||
Reference in new issue
Block a user