Method | Endpoint | 설명 |
---|---|---|
GET | /api/clothes | 의상 목록 조회 |
POST | /api/clothes | 의상 등록 |
PATCH | /api/clothes/{clothesId} | 의상 수정 |
DELETE | /api/clothes/{clothesId} | 의상 삭제 |
GET | /api/clothes/extractions | 구매 링크로 의상 정보 추출 |
POST | /api/clothes/attribute-defs | 의상 속성 정의 등록 |
PATCH | /api/clothes/attribute-defs/{definitionId} | 의상 속성 정의 수정 |
DELETE | /api/clothes/attribute-defs/{definitionId} | 의상 속성 정의 삭제 |
ClothesCreateRequest
DTO 설계(record
기반)
@NotNull
@NotBlank
@Enum(ClothesType)
, @NotNull
List<ClothesAttributeDto>
(definitionId + value)MultipartFile
imageFile (선택적 @RequestPart(”image”)
)ClothesDto
응답 DTO 설계(record
기반)
id
, ownerId
, name
, imageUrl
, type
, attributes
,createdAt
ClothesSelectedValue
엔티티와 연결POST /api/clothes
)
ClothesImageService
+ S3ImageStorage
ClothesCreatedEvent
ClothesMapper
)로 DTO 변환201 Created
+ ClothesDto
응답400 Bad Request
:
MethodArgumentNotValidException
ATTRIBUTE_DEFINITION_DUPLICATE
401 Unauthorized
: 로그인하지 않은 사용자
403 Forbidden
:
`@PreAuthorize("#request.ownerId() == principal.user.id")` 불일치
404 Not Found
USER_NOT_FOUND
ATTRIBUTE_DEFINITION_NOT_FOUND
ATTRIBUTE_VALUE_NOT_FOUND
415 Unsupported Media Type
: 이미지 포맷 오류
500 Internal Server Error
: 서버 오류 → 전역 처리
ClothesUpdateRequest
DTO 설계(record
기반)
@Enum(ClothesType)
List<ClothesAttributeDto>
(선택)MultipartFile
imageFile (선택적)PATCH /api/clothes/{clothesId}
)
ClothesUpdatedEvent
200 OK
+ ClothesDto
응답400 Bad Request
: DTO 유효성 실패, 속성 정의 중복401 Unauthorized
: 로그인하지 않은 사용자403 Forbidden
: 소유자 불일치404 Not Found
: 의상 없음, 속성 정의/값 없음415 Unsupported Media Type
: 이미지 포맷 오류500 Internal Server Error
: 서버 오류DELETE /api/clothes/{clothesId}
)
clothesImageService.delete()
호출ClothesDeletedEvent
204 No Content
응답401 Unauthorized
: 로그인하지 않은 사용자403 Forbidden
: 소유자 불일치404 Not Found
: 의상 없음500 Internal Server Error
: 서버 오류ClothesSearchCondition
DTO 설계
@Min(1)
)ClothesType
GET /api/clothes
)ClothesDtoCursorResponse
응답200 OK
+ Cursor 응답