Skip to content

Commit 1e0ffe7

Browse files
feat: 컬렉션 등록 시 accessLevel 설정 가능하게 변경 (#55)
1 parent 670ffd4 commit 1e0ffe7

4 files changed

Lines changed: 11 additions & 2 deletions

File tree

src/main/java/org/devkor/apu/saerok_server/domain/collection/api/CollectionController.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,9 @@ public class CollectionController {
4646
description = """
4747
새 컬렉션(관찰 기록)을 생성합니다. 이 단계에서는 **이미지를 제외한 메타데이터만 전송**합니다.
4848
49-
⚠️ 유효성 제약:
49+
⚠️ 유효성 제약 (위반 시 400 Bad Request):
5050
- note는 50자 이하
51+
- accessLevel은 "PUBLIC", "PRIVATE" 중 하나 (대소문자 구별), accessLevel 생략 시 기본값: PUBLIC
5152
5253
📌 이 API를 먼저 호출하여 컬렉션을 생성한 후,
5354
응답으로 받은 `collectionId`를 기준으로 이미지를 업로드해야 합니다.

src/main/java/org/devkor/apu/saerok_server/domain/collection/api/dto/request/CreateCollectionRequest.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import io.swagger.v3.oas.annotations.media.Schema;
44
import lombok.Data;
55
import lombok.NoArgsConstructor;
6+
import org.devkor.apu.saerok_server.domain.collection.core.entity.AccessLevelType;
67

78
import java.time.LocalDate;
89

@@ -31,4 +32,7 @@ public class CreateCollectionRequest {
3132

3233
@Schema(description = "관찰 기록에 대한 간단한 메모", example = "까치가 엄청 날아다녔다", nullable = true)
3334
private String note;
35+
36+
@Schema(description = "공개/비공개 여부", example = "PUBLIC", nullable = true)
37+
private AccessLevelType accessLevel;
3438
}

src/main/java/org/devkor/apu/saerok_server/domain/collection/application/CollectionCommandService.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ public Long createCollection(CreateCollectionCommand command) {
7373
.locationAlias(command.locationAlias())
7474
.address(command.address())
7575
.note(command.note())
76+
.accessLevel(command.accessLevel())
7677
.build();
7778

7879
return collectionRepository.save(collection);

src/main/java/org/devkor/apu/saerok_server/domain/collection/application/dto/CreateCollectionCommand.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package org.devkor.apu.saerok_server.domain.collection.application.dto;
22

3+
import org.devkor.apu.saerok_server.domain.collection.core.entity.AccessLevelType;
4+
35
import java.time.LocalDate;
46

57
public record CreateCollectionCommand (
@@ -10,6 +12,7 @@ public record CreateCollectionCommand (
1012
Double longitude,
1113
String locationAlias,
1214
String address,
13-
String note
15+
String note,
16+
AccessLevelType accessLevel
1417
){
1518
}

0 commit comments

Comments
 (0)