feat: 관리자/활동/이슈 API 전체 구현
- Entity: LoginHistory, PageView, Issue, IssueComment 추가
- Repository: 각 엔티티별 JpaRepository 추가
- Service: UserService, RoleService, ActivityService, IssueService
- Admin API: 사용자 관리 7개, 롤/권한 관리 7개, 통계 1개 엔드포인트
- Activity API: 페이지뷰 기록, 로그인 이력 조회
- Issue API: CRUD + 코멘트, 프로젝트/위치/Gitea 링크 지원
- Exception: GlobalExceptionHandler, ResourceNotFoundException, BusinessException
- AuthController: 로그인 시 LoginHistory 기록 추가
- Dockerfile 추가
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 21:13:14 +09:00
|
|
|
package com.gcsc.guide.controller;
|
|
|
|
|
|
|
|
|
|
import com.gcsc.guide.dto.*;
|
|
|
|
|
import com.gcsc.guide.service.IssueService;
|
2026-02-14 21:30:48 +09:00
|
|
|
import io.swagger.v3.oas.annotations.Operation;
|
|
|
|
|
import io.swagger.v3.oas.annotations.Parameter;
|
|
|
|
|
import io.swagger.v3.oas.annotations.media.Content;
|
|
|
|
|
import io.swagger.v3.oas.annotations.media.Schema;
|
|
|
|
|
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
|
|
|
|
import io.swagger.v3.oas.annotations.responses.ApiResponses;
|
|
|
|
|
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
|
|
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
feat: 관리자/활동/이슈 API 전체 구현
- Entity: LoginHistory, PageView, Issue, IssueComment 추가
- Repository: 각 엔티티별 JpaRepository 추가
- Service: UserService, RoleService, ActivityService, IssueService
- Admin API: 사용자 관리 7개, 롤/권한 관리 7개, 통계 1개 엔드포인트
- Activity API: 페이지뷰 기록, 로그인 이력 조회
- Issue API: CRUD + 코멘트, 프로젝트/위치/Gitea 링크 지원
- Exception: GlobalExceptionHandler, ResourceNotFoundException, BusinessException
- AuthController: 로그인 시 LoginHistory 기록 추가
- Dockerfile 추가
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 21:13:14 +09:00
|
|
|
import jakarta.validation.Valid;
|
|
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
|
|
import org.springframework.data.domain.Page;
|
|
|
|
|
import org.springframework.data.domain.Pageable;
|
|
|
|
|
import org.springframework.data.domain.Sort;
|
|
|
|
|
import org.springframework.data.web.PageableDefault;
|
|
|
|
|
import org.springframework.http.ResponseEntity;
|
|
|
|
|
import org.springframework.security.core.Authentication;
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
|
|
import java.net.URI;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
|
@RestController
|
|
|
|
|
@RequestMapping("/api/issues")
|
|
|
|
|
@RequiredArgsConstructor
|
2026-02-14 21:30:48 +09:00
|
|
|
@Tag(name = "06. 이슈 관리", description = "이슈 등록/조회/수정 및 코멘트 관리")
|
|
|
|
|
@SecurityRequirement(name = "Bearer JWT")
|
feat: 관리자/활동/이슈 API 전체 구현
- Entity: LoginHistory, PageView, Issue, IssueComment 추가
- Repository: 각 엔티티별 JpaRepository 추가
- Service: UserService, RoleService, ActivityService, IssueService
- Admin API: 사용자 관리 7개, 롤/권한 관리 7개, 통계 1개 엔드포인트
- Activity API: 페이지뷰 기록, 로그인 이력 조회
- Issue API: CRUD + 코멘트, 프로젝트/위치/Gitea 링크 지원
- Exception: GlobalExceptionHandler, ResourceNotFoundException, BusinessException
- AuthController: 로그인 시 LoginHistory 기록 추가
- Dockerfile 추가
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 21:13:14 +09:00
|
|
|
public class IssueController {
|
|
|
|
|
|
|
|
|
|
private final IssueService issueService;
|
|
|
|
|
|
2026-02-14 21:30:48 +09:00
|
|
|
@Operation(summary = "이슈 목록 조회",
|
|
|
|
|
description = "이슈 목록을 페이징으로 조회합니다. status 파라미터로 상태별 필터링이 가능합니다.")
|
|
|
|
|
@ApiResponses({
|
|
|
|
|
@ApiResponse(responseCode = "200", description = "조회 성공"),
|
|
|
|
|
@ApiResponse(responseCode = "401", description = "인증 실패", content = @Content)
|
|
|
|
|
})
|
feat: 관리자/활동/이슈 API 전체 구현
- Entity: LoginHistory, PageView, Issue, IssueComment 추가
- Repository: 각 엔티티별 JpaRepository 추가
- Service: UserService, RoleService, ActivityService, IssueService
- Admin API: 사용자 관리 7개, 롤/권한 관리 7개, 통계 1개 엔드포인트
- Activity API: 페이지뷰 기록, 로그인 이력 조회
- Issue API: CRUD + 코멘트, 프로젝트/위치/Gitea 링크 지원
- Exception: GlobalExceptionHandler, ResourceNotFoundException, BusinessException
- AuthController: 로그인 시 LoginHistory 기록 추가
- Dockerfile 추가
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 21:13:14 +09:00
|
|
|
@GetMapping
|
|
|
|
|
public ResponseEntity<Page<IssueResponse>> getIssues(
|
2026-02-14 21:30:48 +09:00
|
|
|
@Parameter(description = "이슈 상태 필터 (OPEN, IN_PROGRESS, CLOSED)", example = "OPEN")
|
feat: 관리자/활동/이슈 API 전체 구현
- Entity: LoginHistory, PageView, Issue, IssueComment 추가
- Repository: 각 엔티티별 JpaRepository 추가
- Service: UserService, RoleService, ActivityService, IssueService
- Admin API: 사용자 관리 7개, 롤/권한 관리 7개, 통계 1개 엔드포인트
- Activity API: 페이지뷰 기록, 로그인 이력 조회
- Issue API: CRUD + 코멘트, 프로젝트/위치/Gitea 링크 지원
- Exception: GlobalExceptionHandler, ResourceNotFoundException, BusinessException
- AuthController: 로그인 시 LoginHistory 기록 추가
- Dockerfile 추가
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 21:13:14 +09:00
|
|
|
@RequestParam(required = false) String status,
|
2026-02-14 21:30:48 +09:00
|
|
|
@Parameter(description = "페이징 파라미터 (page, size, sort)")
|
feat: 관리자/활동/이슈 API 전체 구현
- Entity: LoginHistory, PageView, Issue, IssueComment 추가
- Repository: 각 엔티티별 JpaRepository 추가
- Service: UserService, RoleService, ActivityService, IssueService
- Admin API: 사용자 관리 7개, 롤/권한 관리 7개, 통계 1개 엔드포인트
- Activity API: 페이지뷰 기록, 로그인 이력 조회
- Issue API: CRUD + 코멘트, 프로젝트/위치/Gitea 링크 지원
- Exception: GlobalExceptionHandler, ResourceNotFoundException, BusinessException
- AuthController: 로그인 시 LoginHistory 기록 추가
- Dockerfile 추가
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 21:13:14 +09:00
|
|
|
@PageableDefault(size = 20, sort = "createdAt", direction = Sort.Direction.DESC) Pageable pageable) {
|
|
|
|
|
return ResponseEntity.ok(issueService.getIssues(status, pageable));
|
|
|
|
|
}
|
|
|
|
|
|
2026-02-14 21:30:48 +09:00
|
|
|
@Operation(summary = "이슈 생성",
|
|
|
|
|
description = "새로운 이슈를 생성합니다. 프로젝트명, 위치, Gitea 이슈 링크 등을 선택적으로 포함할 수 있습니다.")
|
|
|
|
|
@ApiResponses({
|
|
|
|
|
@ApiResponse(responseCode = "201", description = "이슈 생성 성공",
|
|
|
|
|
content = @Content(schema = @Schema(implementation = IssueResponse.class))),
|
|
|
|
|
@ApiResponse(responseCode = "401", description = "인증 실패", content = @Content)
|
|
|
|
|
})
|
feat: 관리자/활동/이슈 API 전체 구현
- Entity: LoginHistory, PageView, Issue, IssueComment 추가
- Repository: 각 엔티티별 JpaRepository 추가
- Service: UserService, RoleService, ActivityService, IssueService
- Admin API: 사용자 관리 7개, 롤/권한 관리 7개, 통계 1개 엔드포인트
- Activity API: 페이지뷰 기록, 로그인 이력 조회
- Issue API: CRUD + 코멘트, 프로젝트/위치/Gitea 링크 지원
- Exception: GlobalExceptionHandler, ResourceNotFoundException, BusinessException
- AuthController: 로그인 시 LoginHistory 기록 추가
- Dockerfile 추가
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 21:13:14 +09:00
|
|
|
@PostMapping
|
|
|
|
|
public ResponseEntity<IssueResponse> createIssue(
|
|
|
|
|
Authentication authentication,
|
|
|
|
|
@Valid @RequestBody CreateIssueRequest request) {
|
|
|
|
|
Long authorId = (Long) authentication.getPrincipal();
|
|
|
|
|
IssueResponse issue = issueService.createIssue(authorId, request);
|
|
|
|
|
return ResponseEntity.created(URI.create("/api/issues/" + issue.id())).body(issue);
|
|
|
|
|
}
|
|
|
|
|
|
2026-02-14 21:30:48 +09:00
|
|
|
@Operation(summary = "이슈 상세 조회",
|
|
|
|
|
description = "이슈의 상세 정보와 코멘트 목록을 함께 반환합니다.")
|
|
|
|
|
@ApiResponses({
|
|
|
|
|
@ApiResponse(responseCode = "200", description = "조회 성공"),
|
|
|
|
|
@ApiResponse(responseCode = "401", description = "인증 실패", content = @Content),
|
|
|
|
|
@ApiResponse(responseCode = "404", description = "이슈를 찾을 수 없음", content = @Content)
|
|
|
|
|
})
|
feat: 관리자/활동/이슈 API 전체 구현
- Entity: LoginHistory, PageView, Issue, IssueComment 추가
- Repository: 각 엔티티별 JpaRepository 추가
- Service: UserService, RoleService, ActivityService, IssueService
- Admin API: 사용자 관리 7개, 롤/권한 관리 7개, 통계 1개 엔드포인트
- Activity API: 페이지뷰 기록, 로그인 이력 조회
- Issue API: CRUD + 코멘트, 프로젝트/위치/Gitea 링크 지원
- Exception: GlobalExceptionHandler, ResourceNotFoundException, BusinessException
- AuthController: 로그인 시 LoginHistory 기록 추가
- Dockerfile 추가
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 21:13:14 +09:00
|
|
|
@GetMapping("/{id}")
|
2026-02-14 21:30:48 +09:00
|
|
|
public ResponseEntity<Map<String, Object>> getIssue(
|
|
|
|
|
@Parameter(description = "이슈 ID", required = true) @PathVariable Long id) {
|
feat: 관리자/활동/이슈 API 전체 구현
- Entity: LoginHistory, PageView, Issue, IssueComment 추가
- Repository: 각 엔티티별 JpaRepository 추가
- Service: UserService, RoleService, ActivityService, IssueService
- Admin API: 사용자 관리 7개, 롤/권한 관리 7개, 통계 1개 엔드포인트
- Activity API: 페이지뷰 기록, 로그인 이력 조회
- Issue API: CRUD + 코멘트, 프로젝트/위치/Gitea 링크 지원
- Exception: GlobalExceptionHandler, ResourceNotFoundException, BusinessException
- AuthController: 로그인 시 LoginHistory 기록 추가
- Dockerfile 추가
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 21:13:14 +09:00
|
|
|
return ResponseEntity.ok(issueService.getIssueDetail(id));
|
|
|
|
|
}
|
|
|
|
|
|
2026-02-14 21:30:48 +09:00
|
|
|
@Operation(summary = "이슈 수정",
|
|
|
|
|
description = "이슈의 제목, 내용, 상태, 우선순위, 담당자 등을 수정합니다.")
|
|
|
|
|
@ApiResponses({
|
|
|
|
|
@ApiResponse(responseCode = "200", description = "수정 성공",
|
|
|
|
|
content = @Content(schema = @Schema(implementation = IssueResponse.class))),
|
|
|
|
|
@ApiResponse(responseCode = "401", description = "인증 실패", content = @Content),
|
|
|
|
|
@ApiResponse(responseCode = "404", description = "이슈를 찾을 수 없음", content = @Content)
|
|
|
|
|
})
|
feat: 관리자/활동/이슈 API 전체 구현
- Entity: LoginHistory, PageView, Issue, IssueComment 추가
- Repository: 각 엔티티별 JpaRepository 추가
- Service: UserService, RoleService, ActivityService, IssueService
- Admin API: 사용자 관리 7개, 롤/권한 관리 7개, 통계 1개 엔드포인트
- Activity API: 페이지뷰 기록, 로그인 이력 조회
- Issue API: CRUD + 코멘트, 프로젝트/위치/Gitea 링크 지원
- Exception: GlobalExceptionHandler, ResourceNotFoundException, BusinessException
- AuthController: 로그인 시 LoginHistory 기록 추가
- Dockerfile 추가
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 21:13:14 +09:00
|
|
|
@PutMapping("/{id}")
|
|
|
|
|
public ResponseEntity<IssueResponse> updateIssue(
|
2026-02-14 21:30:48 +09:00
|
|
|
@Parameter(description = "이슈 ID", required = true) @PathVariable Long id,
|
feat: 관리자/활동/이슈 API 전체 구현
- Entity: LoginHistory, PageView, Issue, IssueComment 추가
- Repository: 각 엔티티별 JpaRepository 추가
- Service: UserService, RoleService, ActivityService, IssueService
- Admin API: 사용자 관리 7개, 롤/권한 관리 7개, 통계 1개 엔드포인트
- Activity API: 페이지뷰 기록, 로그인 이력 조회
- Issue API: CRUD + 코멘트, 프로젝트/위치/Gitea 링크 지원
- Exception: GlobalExceptionHandler, ResourceNotFoundException, BusinessException
- AuthController: 로그인 시 LoginHistory 기록 추가
- Dockerfile 추가
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 21:13:14 +09:00
|
|
|
@RequestBody UpdateIssueRequest request) {
|
|
|
|
|
return ResponseEntity.ok(issueService.updateIssue(id, request));
|
|
|
|
|
}
|
|
|
|
|
|
2026-02-14 21:30:48 +09:00
|
|
|
@Operation(summary = "코멘트 추가",
|
|
|
|
|
description = "이슈에 새로운 코멘트를 추가합니다.")
|
|
|
|
|
@ApiResponses({
|
|
|
|
|
@ApiResponse(responseCode = "201", description = "코멘트 추가 성공",
|
|
|
|
|
content = @Content(schema = @Schema(implementation = IssueCommentResponse.class))),
|
|
|
|
|
@ApiResponse(responseCode = "401", description = "인증 실패", content = @Content),
|
|
|
|
|
@ApiResponse(responseCode = "404", description = "이슈를 찾을 수 없음", content = @Content)
|
|
|
|
|
})
|
feat: 관리자/활동/이슈 API 전체 구현
- Entity: LoginHistory, PageView, Issue, IssueComment 추가
- Repository: 각 엔티티별 JpaRepository 추가
- Service: UserService, RoleService, ActivityService, IssueService
- Admin API: 사용자 관리 7개, 롤/권한 관리 7개, 통계 1개 엔드포인트
- Activity API: 페이지뷰 기록, 로그인 이력 조회
- Issue API: CRUD + 코멘트, 프로젝트/위치/Gitea 링크 지원
- Exception: GlobalExceptionHandler, ResourceNotFoundException, BusinessException
- AuthController: 로그인 시 LoginHistory 기록 추가
- Dockerfile 추가
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 21:13:14 +09:00
|
|
|
@PostMapping("/{id}/comments")
|
|
|
|
|
public ResponseEntity<IssueCommentResponse> addComment(
|
2026-02-14 21:30:48 +09:00
|
|
|
@Parameter(description = "이슈 ID", required = true) @PathVariable Long id,
|
feat: 관리자/활동/이슈 API 전체 구현
- Entity: LoginHistory, PageView, Issue, IssueComment 추가
- Repository: 각 엔티티별 JpaRepository 추가
- Service: UserService, RoleService, ActivityService, IssueService
- Admin API: 사용자 관리 7개, 롤/권한 관리 7개, 통계 1개 엔드포인트
- Activity API: 페이지뷰 기록, 로그인 이력 조회
- Issue API: CRUD + 코멘트, 프로젝트/위치/Gitea 링크 지원
- Exception: GlobalExceptionHandler, ResourceNotFoundException, BusinessException
- AuthController: 로그인 시 LoginHistory 기록 추가
- Dockerfile 추가
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 21:13:14 +09:00
|
|
|
Authentication authentication,
|
|
|
|
|
@Valid @RequestBody CreateCommentRequest request) {
|
|
|
|
|
Long authorId = (Long) authentication.getPrincipal();
|
|
|
|
|
IssueCommentResponse comment = issueService.addComment(id, authorId, request.body());
|
|
|
|
|
return ResponseEntity.created(URI.create("/api/issues/" + id + "/comments/" + comment.id()))
|
|
|
|
|
.body(comment);
|
|
|
|
|
}
|
|
|
|
|
}
|