docs(negotiation): protocol Field + 파라미터 설명 보강

- protocol: ListItem/Res_SessionList 의 빈 Field 에 description 추가.
- session.py: page/page_size 쿼리 + session_id 경로 파라미터에 설명 추가
  (Path import). req 인자는 문법상 = ... 로 두되 requestBody required 유지.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
민헌 2026-07-07 15:15:00 +09:00
parent 3c56c32c85
commit 70104404eb
2 changed files with 16 additions and 16 deletions

View File

@ -5,22 +5,22 @@ from common.models.gmodel import Res_WebPacketProtocol, WebPacketProtocol
# 협상 세션 목록 행. status/qt_type 은 정수 코드로 내려가고 라벨 매핑은 프론트가 한다.
class ListItem(WebPacketProtocol):
session_id: str = ""
session_id: str = Field("", description="협상 세션 uuid (채팅 진입용)")
session_status: int = Field(0, description="세션 상태 코드 (SessionStatus: 1=생성 2=진행중 3=완료 4=미참여 5=거부)")
qt_type: int = Field(0, description="견적 종류 코드 (1=재협상, 2=재견적, 3=신규협상, 4=신규견적)")
qt_number: str = ""
qt_number: str = Field("", description="견적 번호")
qt_end_time: str = Field("", description="견적 마감 시각 (ISO 8601)")
item_code: str = ""
item_name: str = ""
model_name: str = ""
maker_name: str = ""
item_code: str = Field("", description="상품 코드")
item_name: str = Field("", description="상품명")
model_name: str = Field("", description="모델명")
maker_name: str = Field("", description="제조사")
class Res_SessionList(Res_WebPacketProtocol):
items: list[ListItem] = []
total: int = 0
page: int = 0
page_size: int = 0
items: list[ListItem] = Field(default_factory=list, description="협상 세션 목록")
total: int = Field(0, description="필터 조건에 맞는 전체 건수(페이지네이션용)")
page: int = Field(0, description="현재 페이지 (1부터)")
page_size: int = Field(0, description="페이지당 건수")
class Res_Participate(Res_WebPacketProtocol):

View File

@ -1,6 +1,6 @@
from typing import Optional
from fastapi import APIRouter, Depends, Query
from fastapi import APIRouter, Depends, Path, Query
from fastapi.security import HTTPAuthorizationCredentials
from common.models.gmodel import UserInfo
@ -24,8 +24,8 @@ async def list_sessions(
status: Optional[int] = Query(None, description="세션 상태 코드 (SessionStatus)"),
qt_type: Optional[int] = Query(None, description="견적 유형 코드 (QtType: 1=재협상, 2=재견적, 3=신규협상, 4=신규견적)"),
order: str = Query("asc", description="마감일 정렬: asc(임박순)/desc"),
page: int = Query(1, ge=1),
page_size: int = Query(20, ge=1, le=100),
page: int = Query(1, ge=1, description="페이지 (1부터)"),
page_size: int = Query(20, ge=1, le=100, description="페이지당 건수 (1~100)"),
):
return RemoveNoneResponse(
await service.list_sessions(user_info, credentials.credentials, status, qt_type, order, page, page_size)
@ -39,7 +39,7 @@ async def list_sessions(
description="세션에 참여한다. 소유(공급사)·세션상태·견적마감·마감시간 검증 후 협상생성→협상중, 견적→견적진행중으로 전이.",
)
async def participate(
session_id: str,
session_id: str = Path(description="대상 협상 세션 uuid"),
user_info: UserInfo = Depends(IsValidAccessToken),
credentials: HTTPAuthorizationCredentials = Depends(security),
service: NegotiationService = Depends(),
@ -54,8 +54,8 @@ async def participate(
description="세션 참여를 거부한다. 소유(공급사)·세션상태(완료/미참여/거부 불가)·견적마감·마감시간 검증 후 협상거부로 전이하고 사유를 저장.",
)
async def reject(
session_id: str,
req: Req_Reject,
session_id: str = Path(description="대상 협상 세션 uuid"),
req: Req_Reject = ...,
user_info: UserInfo = Depends(IsValidAccessToken),
credentials: HTTPAuthorizationCredentials = Depends(security),
service: NegotiationService = Depends(),