Merge remote-tracking branch 'origin/sub_laptop_2' into sub_laptop_4

This commit is contained in:
2026-09-21 19:52:45 +09:00
5 changed files with 869 additions and 0 deletions
+14
View File
@@ -63,6 +63,14 @@ class DeleteLogic(BaseModel):
version: str
class DraftLogic(BaseModel):
text: str # 줄로 적은 식 — 줄마다 「이름 = 식」
decided: dict[str, Any] = {} # 변수마다 정한 것 {이름: {무엇, 단위, 비목, 요소·찾기·값}}
head: dict[str, Any] | None = None # 로직 머리(이름 · 결과단위 …) — 주면 로직 줄까지
save: bool = False
owner: str = make.OWNERS[0]
def _num(v):
"""Decimal → JSON 수(그냥 두면 글자로 나감)."""
if isinstance(v, Decimal):
@@ -214,3 +222,9 @@ def post_logic_edit(body: EditLogic) -> dict:
@router.post("/logic/delete")
def post_logic_delete(body: DeleteLogic) -> dict:
return _call(make.logic_delete, body.key, body.version)
@router.post("/logic/draft")
def post_logic_draft(body: DraftLogic) -> dict:
"""식으로 새 로직 만들기 — 변수 뽑기 · 검사 · 로직 줄로 옮기기(`save` 면 저장까지)."""
return _call(make.logic_draft, body.text, body.decided, body.head, body.save, body.owner)