refactor(tkqc): UI 스타일 통일 + 일일공수 제거 + 메뉴 정리
- UI: tkuser 스타일로 통일 (dark slate 헤더, flat 배경, gradient/glass 제거) - tkqc-common.css 공통 스타일시트 신규 생성 - 의견 제시 API 별도 엔드포인트 추가 (모든 사용자 접근 가능) - 일일 공수 기능 완전 제거 (라우터, 모델, 스키마, DB 테이블 DROP) - 프로젝트 관리/사용자 관리 메뉴 숨김 (통합관리 페이지로 이관) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -246,6 +246,42 @@ async def delete_issue(
|
||||
db.commit()
|
||||
return {"detail": "Issue deleted successfully", "logged": True}
|
||||
|
||||
@router.post("/{issue_id}/opinion")
|
||||
async def add_opinion(
|
||||
issue_id: int,
|
||||
opinion_request: schemas.OpinionRequest,
|
||||
current_user: User = Depends(get_current_user),
|
||||
db: Session = Depends(get_db)
|
||||
):
|
||||
"""
|
||||
의견 제시 — 로그인한 모든 사용자가 사용 가능 (권한 체크 없음)
|
||||
solution 필드에 의견을 추가합니다.
|
||||
"""
|
||||
issue = db.query(Issue).filter(Issue.id == issue_id).first()
|
||||
if not issue:
|
||||
raise HTTPException(status_code=404, detail="부적합을 찾을 수 없습니다.")
|
||||
|
||||
# 새 의견 형식: [작성자] (날짜시간)\n내용
|
||||
now = datetime.now()
|
||||
date_str = now.strftime("%Y. %m. %d. %H:%M")
|
||||
author = current_user.full_name or current_user.username
|
||||
new_opinion = f"[{author}] ({date_str})\n{opinion_request.opinion}"
|
||||
|
||||
# 기존 solution에 추가 (최신이 위로)
|
||||
separator = "─" * 50
|
||||
if issue.solution:
|
||||
issue.solution = f"{new_opinion}\n{separator}\n{issue.solution}"
|
||||
else:
|
||||
issue.solution = new_opinion
|
||||
|
||||
db.commit()
|
||||
db.refresh(issue)
|
||||
|
||||
return {
|
||||
"message": "의견이 추가되었습니다.",
|
||||
"issue_id": issue.id
|
||||
}
|
||||
|
||||
@router.get("/stats/summary")
|
||||
async def get_issue_stats(
|
||||
current_user: User = Depends(get_current_user),
|
||||
|
||||
Reference in New Issue
Block a user