auto: 2026-11-18 07:18 (ESD_LAPTOP)

This commit is contained in:
2026-11-18 07:18:00 +09:00
parent 5eb42dfbd0
commit cce57c2984
9 changed files with 410 additions and 320 deletions
+9 -40
View File
@@ -48,26 +48,14 @@ class SaveBody(BaseModel):
class CopyLogic(BaseModel):
"""[복사/생성](본떠 만들기) — 원본 문서를 새 자체 기초로 · 빈 글 = 원본 그대로."""
key: str
이름: str = ""
owner: str = make.OWNERS[0]
class FormulaLogic(BaseModel):
"""복사해서 만들기 — 별칭 꼴 식이 든 로직 줄과 그 별칭표(되돌릴 원문)."""
로직: dict[str, Any]
별칭: list[dict[str, Any]] = []
owner: str = make.OWNERS[0]
이름: str = ""
본뜬키: str = ""
class FormulaPreview(BaseModel):
"""저장 전 미리보기 — 별칭을 원문으로 되돌린 로직 줄만 받고 싶을 때(시험 계산 전)."""
로직: dict[str, Any]
별칭: list[dict[str, Any]] = []
원문번호: str = ""
결과단위: str = ""
출처: str = ""
def _num(v):
@@ -248,27 +236,8 @@ def post_save(body: SaveBody) -> dict:
@router.post("/logic/copy")
def post_logic_copy(body: CopyLogic) -> dict:
return _call(make.logic_copy, body.key, body.이름, body.owner)
@router.get("/logic/formula")
def get_logic_formula(key: str) -> dict:
"""복사해서 만들기 — 로직 한 줄을 별칭 꼴 식 묶음으로."""
return _call(make.logic_formula, key)
@router.post("/logic/formula/save")
def post_logic_formula_save(body: FormulaLogic) -> dict:
"""고친 식 묶음을 자체 로직(`GX`)으로 — 별칭은 원문으로 되돌려 저장."""
return _call(make.logic_from_formula, body.로직, body.별칭, body.owner, body.이름, body.본뜬키)
@router.post("/logic/formula/preview")
def post_logic_formula_preview(body: FormulaPreview) -> dict:
"""저장 전 시험 계산용 — 별칭을 원문으로 되돌린 로직 줄 + 저장하면 지을 수식 문서
{logic, 문서}(저장 안 함 · 화면은 `문서` 를 `/logic/doc/preview` 로 셈 · 855 2-B4)."""
got = _call(make.logic_formula_preview, body.로직, body.별칭)
return {**got, "문서": doc_screen.of_row(got["logic"])}
more = {"원문번호": body.원문번호, "결과단위": body.결과단위, "출처": body.출처}
return _call(make.logic_copy, body.key, body.이름, body.owner, more)
# ── 수식 문서(802-3) — 단가산출 기초 정본 · 화면은 같은 계산기로 즉시 셈 ──
@@ -280,7 +249,7 @@ class DocBody(BaseModel):
@router.get("/logic/doc")
def get_logic_doc(key: str) -> dict:
"""수식 문서 {문서, 셈, 연결, 파일, 새} — 없으면 빈 문서(쓰기 없음)."""
"""수식 문서 {문서, 셈, 연결, 파일, 새} — 없는 키 = 404(쓰기 없음)."""
return _call(doc_screen.read, key)
@@ -311,7 +280,7 @@ def get_logic_users(key: str) -> dict:
@router.post("/logic/remove")
def post_logic_remove(body: RemoveBody) -> dict:
"""로직 지우기(804-7) — 로직 줄 + 수식 문서 · 부르는 곳 있으면 409 {쓰는곳}."""
"""로직 지우기(804-7) — 수식 문서(+ 옛 로직 줄 같이 쓰기) · 부르는 곳 있으면 409 {쓰는곳}."""
return _call(doc_screen.remove, body.key, body.file, body.version, body.개정확인)