From 194a1ad4fdfc7f69544e5184268d948f81151c6d Mon Sep 17 00:00:00 2001 From: DESKTOP-TKLFCPRython Date: Fri, 29 May 2026 18:34:02 +0900 Subject: [PATCH] =?UTF-8?q?fix(itsm):=20=EC=84=A4=EC=B9=98=20=ED=85=8C?= =?UTF-8?q?=EC=8A=A4=ED=8A=B8=20=EB=B2=84=EA=B7=B8=203=EA=B1=B4=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - tasks.py: 빈 sr_ids 목록도 HTTP 400 반환 (이전: 200) - messenger.py: /sr 봇명령 _cmd_create_sr에서 db 파라미터 제거 (BackgroundTask 호환) - main.py: Windows cp949 인코딩 오류 제거 (em dash → ASCII 하이픈) Co-Authored-By: Claude Sonnet 4.6 --- main.py | 10 +++++----- routers/messenger.py | 6 +++--- routers/tasks.py | 2 ++ 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/main.py b/main.py index ec15333..e351ab8 100644 --- a/main.py +++ b/main.py @@ -64,15 +64,15 @@ async def lifespan(app: FastAPI): days = lic_status["days_remaining"] cust = lic_status["customer"] if lic_status.get("is_trial"): - print(f"[LICENSE] 🎁 TRIAL 체험판 활성 (D-{days}) — {cust}") + print(f"[LICENSE] TRIAL 체험판 활성 (D-{days}) - {cust}") else: - print(f"[LICENSE] {edition} 라이선스 활성 ({days}일 남음) — {cust}") + print(f"[LICENSE] {edition} 라이선스 활성 ({days}일 남음) - {cust}") if lic_status.get("expiry_warning"): - print(f"[LICENSE] ⚠️ 만료 {days}일 남음 — 갱신을 준비하세요.") + print(f"[LICENSE] 만료 {days}일 남음 - 갱신을 준비하세요.") elif lic_status.get("expired"): - print("[LICENSE] ❌ 라이선스가 만료되었습니다. 갱신이 필요합니다.") + print("[LICENSE] 라이선스가 만료되었습니다. 갱신이 필요합니다.") else: - print("[LICENSE] 라이선스 미등록 — /license 에서 무료 체험을 시작하거나 키를 등록하세요.") + print("[LICENSE] 라이선스 미등록 - /license 에서 무료 체험을 시작하거나 키를 등록하세요.") # A-1: WebSocket ↔ SSE 통합 패치 from routers.ws import _integrate_with_sse_bus diff --git a/routers/messenger.py b/routers/messenger.py index 98e698f..32a220d 100644 --- a/routers/messenger.py +++ b/routers/messenger.py @@ -251,7 +251,7 @@ async def handle_bot_command( title = " ".join(parts[1:]) if len(parts) >= 2 else "" if not title: return BotReply(room=cmd.room, text="사용법: /sr ") - bg.add_task(_cmd_create_sr, cmd.room, cmd.user, title, db) + bg.add_task(_cmd_create_sr, cmd.room, cmd.user, title) return BotReply(room=cmd.room, text=f"[SR 접수] '{title}' 처리 중...") # ── /status (슬래시 스타일 시스템 현황) ───────────────────────────────── @@ -463,8 +463,8 @@ async def _cmd_sm(room: str, actor: str, server: str, ) -async def _cmd_create_sr(room: str, actor: str, title: str, db): - """슬래시 /sr 명령 — SR 빠른 접수.""" +async def _cmd_create_sr(room: str, actor: str, title: str): + """슬래시 /sr 명령 — SR 빠른 접수 (내부 API 호출).""" import httpx as _httpx try: async with _httpx.AsyncClient(timeout=10.0) as client: diff --git a/routers/tasks.py b/routers/tasks.py index fc319eb..899091b 100644 --- a/routers/tasks.py +++ b/routers/tasks.py @@ -428,6 +428,8 @@ async def bulk_sr_action( from models import UserRole if current_user.role == UserRole.CUSTOMER: raise HTTPException(403, "대량 작업은 ADMIN/PM/ENGINEER만 가능합니다.") + if not payload.sr_ids: + raise HTTPException(400, "sr_ids가 비어 있습니다. 처리할 SR ID를 입력하세요.") if len(payload.sr_ids) > 100: raise HTTPException(400, "한 번에 최대 100건까지 처리 가능합니다.")