-
Notifications
You must be signed in to change notification settings - Fork 1
✨ Feat: Block CRUD development #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Introduced blockInfo and connectionInfo fields to store architecture data as JSON in the Project entity. Added updateArchitecture method for updating block information and improved documentation for update methods.
Introduces BlockSaveRequestDto with createdAt, updatedAt, and blocks fields to support block save operations. Includes Lombok annotations for boilerplate code reduction.
Introduces BlockSaveResponseDto with success, message, and data fields, including a nested BlockInfo class to encapsulate projectId, architectureName, and updatedAt. This DTO will be used to standardize responses for block save operations.
Introduces BlockService with methods to save and retrieve block architecture data for projects. Integrates with ProjectRepository and handles JSON serialization of block information.
Introduces BlockController with endpoints to save and retrieve block architecture data for specific projects. Includes Swagger documentation for API operations and response examples.
Added custom authenticationEntryPoint to respond with a JSON message when authentication fails, improving client-side error handling for unauthorized requests.
Introduces GlobalExceptionHandler to handle common API errors: invalid JSON (400), access denied (403), and project not found (404), returning structured error responses.
…d-backend into feature/block-api
…d-backend into feature/block-api # Conflicts: # src/main/java/com/blockcloud/domain/project/Project.java
Flattened BlockSaveResponseDto by removing the nested BlockInfo class and moving its fields to the top level. Removed unused fields 'success', 'message', and 'data' for a simpler response structure.
Refactored BlockService to add project member validation for block save and get operations, ensuring only authorized users can access or modify project architecture. Replaced generic response maps with dedicated DTOs for block retrieval, improved exception handling, and updated method signatures to include user email for authorization.
Updated BlockController endpoints to return ResponseDto wrappers instead of ResponseEntity, and to require Authentication for both saving and retrieving blocks.
Updated the SecurityConfig to return 401 Unauthorized errors using a standardized response DTO and error code (AUTHENTICATION_REQUIRED).
Introduces a new 'blockInfo' field to store additional project information as LONGTEXT and provides an 'updateArchitecture' method to update this field.
Changed the type of the 'projects' field from List<ProjectResponseDto.ProjectInfo> to List<ProjectResponseDto> for consistency.
Removed the nested ProjectInfo class and moved its fields directly into ProjectResponseDto. Also removed the 'success' field. This simplifies the DTO structure for project responses.
Replaced generic and security exceptions with custom CommonException and ErrorCode for better error handling. Extracted project member validation and project lookup into private methods. Simplified ProjectResponseDto creation with a dedicated mapping method and updated methods to use it. Updated list and update methods to use new DTO mapping and error handling.
…oller Replaces ResponseEntity and CommonResponse with a generic ResponseDto for all endpoints in ProjectController. Updates API response documentation, simplifies constructor with Lombok's @requiredargsconstructor, and standardizes response codes and messages for consistency.
Closed
3 tasks
leeeunda
approved these changes
Aug 11, 2025
Contributor
leeeunda
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
확인했습니다! 일단 기한이 촉박하니 코멘트는 참고해서 다음에 수정해주시고, PR test에서 yml 관련 에러 나는 것만 해결해서 다시 올려주시면 감사하겠습니다.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
✏️PR 타입(하나 이상의 PR 타입을 선택해 주세요)
🌴반영 브랜치
feature/block-api->develop📌변경 사항
Block(아키텍처) 정보 저장 및 조회 API 신규 구현
POST /api/block/{projectId}: 특정 프로젝트의 아키텍처 정보를 저장합니다.GET /api/block/{projectId}: 특정 프로젝트의 아키텍처 정보를 조회합니다.전사 공통 응답 포맷 적용
ResponseDto로 표준화하여 일관성을 확보했습니다.Block관련 Controller, Service, DTO 코드를 전면 리팩토링했습니다.예외 처리 및 접근 제어 강화
CommonException을 사용하여 에러 코드를 중앙에서 관리하고,GlobalExceptionHandler가 이를 처리하도록 구조화했습니다.ACCESS_DENIED권한 검증 로직을 추가했습니다.API 문서 구체화
Swagger문서에 상세한 응답 코드와 요청/응답 예시를 추가했습니다.💯테스트 결과
Swagger UI를 통해 모든 API의 성공/실패 케이스 테스트를 완료했습니다.
성공 케이스
200 OK와 함께 정상 데이터가 반환됨을 확인했습니다.실패 케이스
404 Not Found와 함께NOT_FOUND_PROJECT에러가 반환됨을 확인했습니다.403 Forbidden과 함께ACCESS_DENIED에러가 반환됨을 확인했습니다.401 Unauthorized와 함께 공통 포맷의 에러 메시지가 반환됨을 확인했습니다.