Skip to content

[SETTING] Swagger 초기 세팅 및 물품 상태 기준 조회 API - #5

Merged
Chhun-Lee merged 3 commits into
developfrom
setting/#4
Oct 24, 2026
Merged

Chhun-Lee merged 3 commits into
developfrom
setting/#4

Conversation

@Chhun-Lee

Copy link
Copy Markdown
Collaborator

작업 내용

  • springdoc-openapi로 Swagger UI 초기 세팅
  • 동작 확인용으로 물품 상태 기준 조회 API(GET /api/item-conditions) 1개 추가
  • Closes [SETTING] Swagger 초기 세팅 #4

Swagger

  • springdoc-openapi-starter-webmvc-ui:3.1.1 추가
    • Spring Boot 4.1 기준으로 빌드된 버전 (3.2.0은 출시 직후라 제외)
  • SwaggerConfig: API 정보(IT:SSUM API, v1), JWT Bearer 인증 스키마 → 우측 상단 Authorize 버튼
  • application.yml: /v3/api-docs, /swagger-ui.html, HTTP 메서드 순·태그 이름 순 정렬
  • SecurityConfig: Swagger 경로 인증 없이 허용 (JWT 적용 후에도 유지)

물품 상태 기준 조회 API

  • GET /api/item-conditions: ConditionGrade enum 기준 목록을 상태가 좋은 순(HIGH → MID → LOW)으로 반환
  • 응답은 공통 ApiResponse 형식, 항목은 { code, description }
{"success":true,"data":[
  {"code":"HIGH","description":"상·미개봉"},
  {"code":"MID","description":"중·사용감 적음"},
  {"code":"LOW","description":"하·다회 사용"}
]}
  • Swagger 태그 물품, 요약·설명·필드 예시 작성
  • 비로그인 화면에서도 쓰는 기준 데이터라 인증 불필요
    • @SecurityRequirements로 이 API만 전역 JWT 요구사항 해제 (자물쇠 표시 없음)
    • SecurityConfig에서 GET 요청 허용

문서

  • README API 명세에 Swagger 주소 추가

확인 사항

  • 로컬: http://localhost:8080/swagger-ui.html
  • 배포 서버: develop → main 머지로 배포되면 http://<EC2 주소>/swagger-ui.html
  • Swagger는 프론트 연동을 위해 운영 서버에서도 열어 둡니다.

테스트

  • ItemConditionControllerTest 통과 (응답 형식·순서)
  • 로컬 기동 확인 (로컬 DB 대신 임시 H2로 기동)
    • GET /api/item-conditions → 200, 위 응답 그대로
    • /swagger-ui.html → /swagger-ui/index.html 200
    • /v3/api-docs에서 이 API security: [], 응답 스키마 ApiResponseListItemConditionResponse 확인
  • SwaggerConfigTest(API 문서·Swagger UI 인증 없이 접근)는 이 PR의 CI에서 MySQL로 실행

- springdoc-openapi-starter-webmvc-ui 3.1.1 추가 (Spring Boot 4.1 기준 빌드)
- SwaggerConfig: API 정보, JWT Bearer 인증 스키마
- api-docs·swagger-ui 경로 및 정렬 설정
- Swagger 경로 인증 없이 허용, 접근 테스트 추가
- GET /api/item-conditions: ConditionGrade 기준 목록을 상태가 좋은 순으로 반환
- Swagger 요약·설명·필드 예시 작성, 기준 데이터라 JWT 요구사항 해제
- 비로그인 상태에서도 쓰도록 GET 요청 인증 없이 허용
@Chhun-Lee Chhun-Lee added ⚙️ SETTING 프로젝트 세팅 관련 라벨 ✨ FEAT 기능 구현 관련 라벨 labels Oct 24, 2026
@Chhun-Lee Chhun-Lee self-assigned this Oct 24, 2026
@Chhun-Lee
Chhun-Lee merged commit 8684702 into develop Oct 24, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨ FEAT 기능 구현 관련 라벨 ⚙️ SETTING 프로젝트 세팅 관련 라벨

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[SETTING] Swagger 초기 세팅

1 participant