[web-33] 관리자 메인 로고 수정 API 구현#34
Closed
Chunwol wants to merge 62 commits into
Closed
Conversation
Feat: JWT 기반 인증 시스템 구현
Feat: 어드민 메인페이지 구현
Revert "Feat: 어드민 메인페이지 구현"
fix: deploy 수정
[web-1] 백엔드 보일러플레이팅 수정
[web-32] 인증 DTO 코딩 컨벤션 리팩토링
- AuthController: /auth -> /api/v1/auth prefix 변경 - AuthController: @SecurityRequirements 추가 (Swagger 로그인 자물쇠 제거) - AuthController: @ApiErrorExceptions 적용, 기존 verbose @ApiResponses 제거 - SecurityConfig: PUBLIC_URLS /auth/** -> /api/v1/auth/** 변경 - OpenApiConfig: authApi /api/v1/auth/**, adminApi /api/v1/** 경로 통일 - ApiErrorExceptions: ErrorCode 기반 에러 응답 자동 등록 어노테이션 추가 - ApiErrorExceptionCustomizer: OperationCustomizer 구현체 추가
- MinIO SDK 의존성 추가 (io.minio:minio:8.5.11) - MinioConfig: @ConfigurationProperties 기반 MinIO 클라이언트 설정 - MinioService: Presigned PUT/GET URL 생성 서비스 - application.yml / application-prod.yml: MinIO 환경변수 설정 추가 - V3__add_recruitment.sql: recruitment 단일 레코드 테이블 마이그레이션 - recruitment_start/end를 main_page에서 recruitment 테이블로 이동 - main_page.recruitment_start/end 컬럼 제거
[web-32] 인증 API prefix /api/v1/auth 적용 및 Swagger 문서 개선
[web-35] 관리자 캘린더 일정 생성 API 구현
[web-35-3] 관리자 캘린더 일정 삭제 API 구현
관리자 캘린더 일정 조회/수정/삭제 API 구현 (web-35-1 ~ web-35-3)
- FileController: GET /api/v1/files/upload-url 엔드포인트 추가 (Presigned PUT URL 발급) - PresignedUploadResponseDto: uploadUrl, objectKey 필드 - MinioService: getObjectUrl(objectKey) 메서드 추가 - AdminMainController: MultipartFile 제거 → @RequestBody MainLogoUpdateRequestDto - AdminMainService: 서버 업로드 제거 → objectKey 받아 URL 저장 - MainLogoUpdateRequestDto: logoUrl → objectKey 필드로 변경
- MainLogoUpdateRequestDto.objectKey에 @notblank 추가 - AdminMainService.update()에 logo/ 경로 prefix 검증 추가
…ce 로깅 개선 - ErrorCode에 INVALID_DATE_RANGE / PHOTO_LIMIT_EXCEEDED / INVALID_OBJECT_KEY 추가 - BusinessException(ErrorCode, customMessage) 생성자 추가 - GlobalExceptionHandler: exception.getMessage() 기반 응답으로 변경 - MinioService: uploadFile / deleteFile / getPresignedUrl catch에 error 로그 추가 - AdminMainService.validateObjectKey(): INVALID_OBJECT_KEY + 구체적 메시지 적용
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
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.
작업 내용
관리자 페이지에서 메인 페이지 로고 이미지를 수정할 수 있는 API를 구현합니다.
파일 업로드는 클라이언트가 Presigned PUT URL로 MinIO에 직접 업로드하는 방식을 사용합니다.
서버는 파일을 받지 않고, 업로드 완료 후 전달받은
objectKey로 URL을 저장합니다.변경 사항
FileController추가:GET /api/v1/files/upload-url— Presigned PUT URL 발급PresignedUploadResponseDto추가:uploadUrl,objectKey필드MinioConfig추가:application.yml의minio.*프로퍼티 바인딩,MinioClientBean 등록MinioService추가:generateUploadUrl(),generateDownloadUrl(),getObjectUrl(),deleteFile(),extractObjectKey()PATCH /api/v1/admin/main/logo엔드포인트 구현 (JSON body)MainPageConfig엔티티 정리 (description, recruitmentStart/End 제거)MainLogoResponseDto,MainLogoUpdateRequestDto(objectKey)추가MainPageConfigRepository추가 (getConfig()— Singleton 엔티티 ID 고정 1)AdminMainController,AdminMainService추가파일 업로드 흐름
API
1. Presigned 업로드 URL 발급
GET /api/v1/files/upload-url?type=logoResponse:
200 OK{ "success": true, "data": { "uploadUrl": "http://minio:9000/one-bucket/logo/uuid?X-Amz-Signature=...", "objectKey": "logo/550e8400-e29b-41d4-a716-446655440000" } }2. 메인 로고 수정
PATCH /api/v1/admin/main/logoRequest Body:
{ "objectKey": "logo/550e8400-e29b-41d4-a716-446655440000" }Response:
200 OK{ "success": true, "data": { "logoUrl": "http://minio:9000/one-bucket/logo/550e8400-e29b-41d4-a716-446655440000" } }프론트엔드 요청 예시 (JavaScript):
테스트