fix(itsm): 설치 테스트 버그 3건 수정
- 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 <noreply@anthropic.com>
This commit is contained in:
parent
64c27c3509
commit
194a1ad4fd
10
main.py
10
main.py
@ -64,15 +64,15 @@ async def lifespan(app: FastAPI):
|
|||||||
days = lic_status["days_remaining"]
|
days = lic_status["days_remaining"]
|
||||||
cust = lic_status["customer"]
|
cust = lic_status["customer"]
|
||||||
if lic_status.get("is_trial"):
|
if lic_status.get("is_trial"):
|
||||||
print(f"[LICENSE] 🎁 TRIAL 체험판 활성 (D-{days}) — {cust}")
|
print(f"[LICENSE] TRIAL 체험판 활성 (D-{days}) - {cust}")
|
||||||
else:
|
else:
|
||||||
print(f"[LICENSE] {edition} 라이선스 활성 ({days}일 남음) — {cust}")
|
print(f"[LICENSE] {edition} 라이선스 활성 ({days}일 남음) - {cust}")
|
||||||
if lic_status.get("expiry_warning"):
|
if lic_status.get("expiry_warning"):
|
||||||
print(f"[LICENSE] ⚠️ 만료 {days}일 남음 — 갱신을 준비하세요.")
|
print(f"[LICENSE] 만료 {days}일 남음 - 갱신을 준비하세요.")
|
||||||
elif lic_status.get("expired"):
|
elif lic_status.get("expired"):
|
||||||
print("[LICENSE] ❌ 라이선스가 만료되었습니다. 갱신이 필요합니다.")
|
print("[LICENSE] 라이선스가 만료되었습니다. 갱신이 필요합니다.")
|
||||||
else:
|
else:
|
||||||
print("[LICENSE] 라이선스 미등록 — /license 에서 무료 체험을 시작하거나 키를 등록하세요.")
|
print("[LICENSE] 라이선스 미등록 - /license 에서 무료 체험을 시작하거나 키를 등록하세요.")
|
||||||
|
|
||||||
# A-1: WebSocket ↔ SSE 통합 패치
|
# A-1: WebSocket ↔ SSE 통합 패치
|
||||||
from routers.ws import _integrate_with_sse_bus
|
from routers.ws import _integrate_with_sse_bus
|
||||||
|
|||||||
@ -251,7 +251,7 @@ async def handle_bot_command(
|
|||||||
title = " ".join(parts[1:]) if len(parts) >= 2 else ""
|
title = " ".join(parts[1:]) if len(parts) >= 2 else ""
|
||||||
if not title:
|
if not title:
|
||||||
return BotReply(room=cmd.room, text="사용법: /sr <SR 제목>")
|
return BotReply(room=cmd.room, text="사용법: /sr <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}' 처리 중...")
|
return BotReply(room=cmd.room, text=f"[SR 접수] '{title}' 처리 중...")
|
||||||
|
|
||||||
# ── /status (슬래시 스타일 시스템 현황) ─────────────────────────────────
|
# ── /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):
|
async def _cmd_create_sr(room: str, actor: str, title: str):
|
||||||
"""슬래시 /sr 명령 — SR 빠른 접수."""
|
"""슬래시 /sr 명령 — SR 빠른 접수 (내부 API 호출)."""
|
||||||
import httpx as _httpx
|
import httpx as _httpx
|
||||||
try:
|
try:
|
||||||
async with _httpx.AsyncClient(timeout=10.0) as client:
|
async with _httpx.AsyncClient(timeout=10.0) as client:
|
||||||
|
|||||||
@ -428,6 +428,8 @@ async def bulk_sr_action(
|
|||||||
from models import UserRole
|
from models import UserRole
|
||||||
if current_user.role == UserRole.CUSTOMER:
|
if current_user.role == UserRole.CUSTOMER:
|
||||||
raise HTTPException(403, "대량 작업은 ADMIN/PM/ENGINEER만 가능합니다.")
|
raise HTTPException(403, "대량 작업은 ADMIN/PM/ENGINEER만 가능합니다.")
|
||||||
|
if not payload.sr_ids:
|
||||||
|
raise HTTPException(400, "sr_ids가 비어 있습니다. 처리할 SR ID를 입력하세요.")
|
||||||
if len(payload.sr_ids) > 100:
|
if len(payload.sr_ids) > 100:
|
||||||
raise HTTPException(400, "한 번에 최대 100건까지 처리 가능합니다.")
|
raise HTTPException(400, "한 번에 최대 100건까지 처리 가능합니다.")
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user