feat(796-2e-1): 더한 기초 블록 [연결 끊기] · [다시 잇기] 서버 — 끊음 = 이 SK 안 자기 사본 줄 · 수식 고침 · 재생성 때 줄 안 바꿈
- M02_Sangeun_Block 신설: 끊기(닫힌 묶음 굳힘 · 금액 그대로) · 다시 잇기(고침 버림 + 원본 갈음) · 끊은 기초 수식 읽기 · 미리 셈 · 저장 검사 - Calc.sub_run 이 끊은 기초 자기 줄 + 수식 고침을 얹어 셈 · Copy.settle 이 다시 잇기 표지 처리 · [단가 갱신] · [재생성] 응답 끊은기초 한 줄 - Router: block/unlink · relink · equation 몸 블록 · 새 시험 test_796_2e_unlink_basis 6 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -9,6 +9,8 @@
|
||||
(화면 캐시 문서에 할일 얹음 · 저장 없음 · 층 읽기).
|
||||
수식 탭(796-2b · `M02_Sangeun_Equation`) `…/sangeun/equation`(층 읽기) · `/preview`(고침 미리 셈 ·
|
||||
층 쓰기) — 저장 없음 · 고침 = 화면 캐시 `수식고침` → [저장].
|
||||
더한 기초 [연결 끊기](796-2e · `M02_Sangeun_Block`) `…/sangeun/block/unlink` · `/relink`(화면 캐시 문서 고침 ·
|
||||
저장 없음 · 층 읽기) · 끊은 기초 수식 = 같은 equation 길 몸 `블록`(더한줄 차례).
|
||||
|
||||
저장 안 함 · 로그인 사용자 · 층 읽기 권한(`Router_Items._root`) · 화면은 최신 응답만.
|
||||
몸 = `문서`(저장 전 화면 문서) 또는 `키`(그 층 저장본) + `입력값`(열린입력 · 시험 값) ·
|
||||
@@ -26,6 +28,7 @@ from pydantic import BaseModel
|
||||
|
||||
from common_util.common_util_auth import verify_session
|
||||
from M02_MasterTemplete import M02_MasterTemplete_Store as store
|
||||
from M02_MasterTemplete import M02_Sangeun_Block as blk
|
||||
from M02_MasterTemplete import M02_Sangeun_Calc as calc
|
||||
from M02_MasterTemplete import M02_Sangeun_Copy as skc
|
||||
from M02_MasterTemplete import M02_Sangeun_Doc as sd
|
||||
@@ -232,6 +235,7 @@ class EquationBody(BaseModel):
|
||||
문서: dict[str, Any]
|
||||
inputs: dict[str, Any] | None = None
|
||||
고침: list[Any] | None = None
|
||||
블록: int | None = None # 끊은 더한 기초 차례(796-2e) — 없으면 바탕 줄
|
||||
|
||||
|
||||
@router.post("/layers/{layer}/sangeun/equation")
|
||||
@@ -242,6 +246,8 @@ def sangeun_equation(
|
||||
session: Session = Depends(verify_session),
|
||||
) -> dict:
|
||||
"""수식 탭 읽기(796-2b) — 사본(가져온 식) 줄 + 문서 `수식고침` → {ok, 수식 | reason}."""
|
||||
if body.블록 is not None:
|
||||
return _call(_root(session, layer, owner), _sd(blk.read), body.문서, body.블록, body.inputs)
|
||||
return _call(_root(session, layer, owner), _sd(eqm.read), body.문서, body.inputs)
|
||||
|
||||
|
||||
@@ -255,4 +261,27 @@ def sangeun_equation_preview(
|
||||
"""수식 고침 미리 셈(796-2b · 층 쓰기 · 저장 없음) — 고침 = `수식고침` 통째 →
|
||||
{되나, 까닭, 줄, 수식, 전, 후}."""
|
||||
folder = _root(session, layer, owner, write=True)
|
||||
if body.블록 is not None:
|
||||
args = (body.문서, body.블록, body.고침 or [], body.inputs)
|
||||
return _call(folder, _sd(blk.preview), *args)
|
||||
return _call(folder, _sd(eqm.preview), body.문서, body.고침 or [], body.inputs)
|
||||
|
||||
|
||||
class BlockBody(BaseModel):
|
||||
문서: dict[str, Any]
|
||||
차례: int
|
||||
|
||||
|
||||
@router.post("/layers/{layer}/sangeun/block/{how}")
|
||||
def sangeun_block(
|
||||
layer: Layer,
|
||||
how: str,
|
||||
body: BlockBody,
|
||||
owner: str | None = None,
|
||||
session: Session = Depends(verify_session),
|
||||
) -> dict:
|
||||
"""더한 기초 연결(796-2e) — unlink [연결 끊기] · relink [다시 잇기] · 답 = 고친 문서(화면 캐시 ·
|
||||
[저장] 때 서버가 다시 셈) + 전 · 후 SK 금액."""
|
||||
if how not in ("unlink", "relink"):
|
||||
raise HTTPException(status_code=404, detail="unlink · relink")
|
||||
return _call(_root(session, layer, owner), _sd(blk.change), body.문서, body.차례, how)
|
||||
|
||||
Reference in New Issue
Block a user