Merge remote-tracking branch 'origin/sub_laptop_4' into main_laptop_1
This commit is contained in:
@@ -17,6 +17,8 @@ from M01_MasterData import M01_MasterData_Store_Combo as combo_store
|
||||
from M01_MasterData import M01_MasterData_Store_Flow as flow
|
||||
from M01_MasterData import M01_MasterData_Store_Make as make
|
||||
|
||||
import master_basis as mbs # noqa: E402 (`store` 가 scripts 를 길에 둠)
|
||||
|
||||
router = APIRouter(prefix="/api/m01", tags=["M01 MasterData"])
|
||||
|
||||
if "pytest" not in sys.modules: # 시험은 사본 폴더를 써서 정본을 미리 읽을 까닭이 없음
|
||||
@@ -122,7 +124,9 @@ def get_groups() -> dict:
|
||||
|
||||
@router.get("/groups/{group}/files")
|
||||
def get_files(group: str) -> dict:
|
||||
return {"files": _call(store.files_of, group)}
|
||||
"""`판정규` = 머리 판의 해(「2026-01-01」 · 「2026」 → 「2026」) · 읽을 때 파생(파일 안 씀)."""
|
||||
files = _call(store.files_of, group)
|
||||
return {"files": [{**f, "판정규": mbs.edition(f["edition"])} for f in files]}
|
||||
|
||||
|
||||
@router.get("/subs")
|
||||
@@ -156,12 +160,17 @@ def get_tables(
|
||||
usage: str = "",
|
||||
section: str = "",
|
||||
) -> dict:
|
||||
return _call(store.tables, file, group, sub, detail, q, page, size, usage, section)
|
||||
out = _call(store.tables, file, group, sub, detail, q, page, size, usage, section)
|
||||
for t in out["tables"]: # 기준배 · 기준단위 — 읽을 때 파생(정본 표에 안 씀 · 712-3)
|
||||
t["기준파생"] = _num(mbs.basis(t))
|
||||
return out
|
||||
|
||||
|
||||
@router.get("/table")
|
||||
def get_table(file: str, key: str) -> dict:
|
||||
return _call(store.table, file, key)
|
||||
"""`기준파생` 은 표 밖 칸 — 표 줄째 되돌려 저장해도 정본에 안 섞임."""
|
||||
out = _call(store.table, file, key)
|
||||
return {**out, "기준파생": _num(mbs.basis(out["table"]))}
|
||||
|
||||
|
||||
@router.get("/table/options")
|
||||
|
||||
Reference in New Issue
Block a user