refactor(tkeg): 대시보드 프로젝트 생성 기능 제거 (tkuser로 통합)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -427,71 +427,6 @@ async def get_quick_actions(
|
||||
raise HTTPException(status_code=500, detail=f"빠른 작업 조회 실패: {str(e)}")
|
||||
|
||||
|
||||
@router.post("/projects")
|
||||
async def create_project(
|
||||
official_project_code: str = Query(..., description="프로젝트 코드"),
|
||||
project_name: str = Query(..., description="프로젝트 이름"),
|
||||
client_name: str = Query(None, description="고객사명"),
|
||||
current_user: dict = Depends(get_current_user),
|
||||
db: Session = Depends(get_db)
|
||||
):
|
||||
"""
|
||||
새 프로젝트 생성
|
||||
|
||||
Args:
|
||||
official_project_code: 프로젝트 코드 (예: J24-001)
|
||||
project_name: 프로젝트 이름
|
||||
client_name: 고객사명 (선택)
|
||||
|
||||
Returns:
|
||||
dict: 생성된 프로젝트 정보
|
||||
"""
|
||||
try:
|
||||
# 중복 확인
|
||||
check_query = text("SELECT id FROM projects WHERE official_project_code = :code")
|
||||
existing = db.execute(check_query, {"code": official_project_code}).fetchone()
|
||||
|
||||
if existing:
|
||||
raise HTTPException(status_code=400, detail="이미 존재하는 프로젝트 코드입니다")
|
||||
|
||||
# 프로젝트 생성
|
||||
insert_query = text("""
|
||||
INSERT INTO projects (official_project_code, project_name, client_name, status)
|
||||
VALUES (:code, :name, :client, 'active')
|
||||
RETURNING *
|
||||
""")
|
||||
|
||||
new_project = db.execute(insert_query, {
|
||||
"code": official_project_code,
|
||||
"name": project_name,
|
||||
"client": client_name
|
||||
}).fetchone()
|
||||
|
||||
db.commit()
|
||||
|
||||
# TODO: 활동 로그 기록 (추후 구현)
|
||||
# ActivityLogger 사용법 확인 필요
|
||||
|
||||
return {
|
||||
"success": True,
|
||||
"message": "프로젝트가 생성되었습니다",
|
||||
"project": {
|
||||
"id": new_project.id,
|
||||
"official_project_code": new_project.official_project_code,
|
||||
"project_name": new_project.project_name,
|
||||
"client_name": new_project.client_name,
|
||||
"status": new_project.status
|
||||
}
|
||||
}
|
||||
|
||||
except HTTPException:
|
||||
raise
|
||||
except Exception as e:
|
||||
db.rollback()
|
||||
logger.error(f"프로젝트 생성 실패: {str(e)}")
|
||||
raise HTTPException(status_code=500, detail=f"프로젝트 생성 실패: {str(e)}")
|
||||
|
||||
|
||||
@router.get("/projects")
|
||||
async def get_projects(
|
||||
current_user: dict = Depends(get_current_user),
|
||||
|
||||
Reference in New Issue
Block a user