Skip to content

Commit 593dcae

Browse files
committed
✨ Api 명세에 맞게 응답 구조 수정
1 parent db3ee09 commit 593dcae

File tree

3 files changed

+22
-5
lines changed

3 files changed

+22
-5
lines changed

src/main/java/com/going/server/domain/upload/dto/UploadRequestDto.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,7 @@
1010
public class UploadRequestDto {
1111
@NotNull(message = "파일이 필요합니다.")
1212
private MultipartFile file;
13+
14+
@NotNull(message = "파일명이 필요합니다.")
15+
private String title;
1316
}

src/main/java/com/going/server/domain/upload/dto/UploadResponseDto.java

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,16 @@
66

77
@Getter
88
@Setter
9+
@Builder
910
public class UploadResponseDto {
10-
private String text;
11+
private Long graphId;
12+
private String title;
13+
private Boolean easy; //쉬움 모드
14+
private Boolean hard; //어려움 모드
15+
private Long nodes; //그래프 노드 개수
16+
private Long edges; //그래프 관계 개수
1117

12-
@Builder
13-
public UploadResponseDto(String text) {
14-
this.text = text;
18+
public static UploadResponseDto from(Long graphId, String title, Boolean easy, Boolean haed, Long nodes, Long edges) {
19+
return UploadResponseDto.builder().graphId(graphId).title(title).easy(easy).hard(haed).nodes(nodes).edges(edges).build();
1520
}
1621
}

src/main/java/com/going/server/domain/upload/service/UploadServiceImpl.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,16 @@ public UploadResponseDto uploadFile(UploadRequestDto dto) {
3333

3434
String text = paresData.get("6학년 읽기자료 내용");
3535

36-
return UploadResponseDto.builder().text(text).build();
36+
//TODO : 그래프 생성을 위한 FastApi 호출 코드 작성
37+
38+
return UploadResponseDto.from(
39+
null,
40+
null,
41+
null,
42+
null,
43+
null,
44+
null
45+
);
3746
} catch (IllegalArgumentException e){
3847
throw new ResponseStatusException(HttpStatus.BAD_REQUEST, e.getMessage());
3948
} catch (IOException e){

0 commit comments

Comments
 (0)