Skip to content

Commit 68576db

Browse files
authored
[Feat/OPS-246] 공유 파일 관리 (#119)
* refactor/OPS-360 : OpenAPI 애너테이션 추가 * refactor/OPS-360 : NoResultException 예외 분리 * refactor/OPS-360 : param 추가 * refactor/OPS-360 : param 추가 * refactor/OPS-360 : default 폴더 CRUD 로직 수정 * refactor/OPS-360 : 폴더 리스트는 호출 로직 수정 * refactor/OPS-346 : 공유 폴더 관리 * feat/OPS-365 : soft delete + 휴지통 조회 구현 * feat/OPS-346 : 공유 폴더 관리 * feat/OPS-346 : 공유 폴더 관리 * feat/OPS-246 : 공유 파일 관리 * refactor/OPS-346 : 개인 / 공유 폳더 관리 분리 * refactor/OPS-346 : 개인 / 공유 파일 관리 분리 * refactor/OPS-346 : 검색 기능 출처 누락 수정 * feat/OPS-246 : 개인 / 공유 파일 관리 분리 * feat/OPS-246 : api 요청 수정 * feat/OPS-246 : api 요청 수정 - request 이름 통일 * refactor/OPS-246 : 머지 * refactor/OPS-246 : 머지
1 parent 7e4f1e8 commit 68576db

File tree

76 files changed

+2788
-3360
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+2788
-3360
lines changed

.github/workflows/prod-server.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ jobs:
8282
-p $NEW_PORT:8080 \
8383
--name $NEW_CONTAINER \
8484
--network common \
85-
-e SPRING_PROFILES_ACTIVE=prod \
8685
-e SPRING_DATASOURCE_URL="${{secrets.PROD_DB_URL}}" \
8786
-e SPRING_DATASOURCE_USERNAME="${{secrets.PROD_DB_USERNAME}}" \
8887
-e SPRING_DATASOURCE_PASSWORD="${{secrets.PROD_DB_PASSWORD}}" \

.github/workflows/test-server-cd.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ jobs:
5959
-p $NEW_PORT:8080 \
6060
--name $NEW_CONTAINER \
6161
--network common \
62-
-e SPRING_PROFILES_ACTIVE=server \
6362
-e SPRING_DATASOURCE_URL="${{secrets.TEST_DB_URL}}" \
6463
-e SPRING_DATASOURCE_USERNAME="${{secrets.TEST_DB_USERNAME}}" \
6564
-e SPRING_DATASOURCE_PASSWORD="${{secrets.TEST_DB_PASSWORD}}" \

.github/workflows/test-server-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ jobs:
6868
- name: Generate application-secrets.yml
6969
run: |
7070
mkdir -p src/main/resources
71-
echo "${{ secrets.APPLICATION_SECRET_YML_V2 }}" > src/main/resources/application-secrets.yml
71+
echo "${{ secrets.APPLICATION_SECRET_YML }}" > src/main/resources/application-secrets.yml
7272
echo "OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}" >> src/main/resources/application-secrets.yml
7373
7474
echo "spring.cloud.aws.region.static: ${{ secrets.AWS_REGION }}" >> src/main/resources/application-secrets.yml

build.gradle

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,6 @@ dependencies {
125125

126126
// Awaitility (비동기 테스트 지원)
127127
testImplementation 'org.awaitility:awaitility:4.2.0'
128-
129-
// retry (ai retry용)
130-
implementation 'org.springframework.retry:spring-retry'
131-
implementation 'org.springframework:spring-aspects'
132128
}
133129

134130
dependencyManagement {

gradlew

100755100644
File mode changed.

src/main/java/org/tuna/zoopzoop/backend/domain/auth/handler/OAuth2SuccessHandler.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ public class OAuth2SuccessHandler extends SimpleUrlAuthenticationSuccessHandler
4141
@Value("${front.redirect_domain}")
4242
private String redirect_domain;
4343

44-
private final String SITE_DOMAIN = "zoopzoop.kro.kr";
44+
@Value("${spring.profiles.active:dev}")
45+
private String activeProfile;
4546

4647
@Override
4748
public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response,
@@ -111,7 +112,7 @@ public void onAuthenticationSuccess(HttpServletRequest request, HttpServletRespo
111112
.maxAge(jwtProperties.getAccessTokenValidity() / 1000)
112113
// .domain() // 프론트엔드 & 백엔드 상위 도메인
113114
// .secure(true) // https 필수 설정.
114-
.domain(SITE_DOMAIN)
115+
.domain(redirect_domain)
115116
.secure(true)
116117
.sameSite("None")
117118
.build();
@@ -120,7 +121,7 @@ public void onAuthenticationSuccess(HttpServletRequest request, HttpServletRespo
120121
.httpOnly(true)
121122
.path("/")
122123
.maxAge(jwtProperties.getRefreshTokenValidity() / 1000) // RefreshToken 유효기간과 동일하게
123-
.domain(SITE_DOMAIN)
124+
.domain(redirect_domain)
124125
.secure(true)
125126
.sameSite("None")
126127
.build();

src/main/java/org/tuna/zoopzoop/backend/domain/dashboard/controller/ApiV1DashboardController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,6 @@ public ResponseEntity<RsData<BodyForReactFlow>> getGraph(
7171
"ID: " + dashboardId + " 의 React-flow 데이터를 조회했습니다.",
7272
BodyForReactFlow.from(graph)
7373
));
74-
}
7574

75+
}
7676
}

src/main/java/org/tuna/zoopzoop/backend/domain/dashboard/dto/BodyForReactFlow.java

Lines changed: 36 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -19,42 +19,27 @@ public record BodyForReactFlow(
1919
public record NodeDto(
2020
@JsonProperty("id") String nodeKey,
2121
@JsonProperty("type") String nodeType,
22-
@JsonProperty("selected") Boolean selected,
23-
@JsonProperty("dragging") Boolean dragging,
24-
@JsonProperty("position") PositionDto positionDto,
25-
@JsonProperty("measured") MeasurementsDto measurements,
26-
@JsonProperty("data") DataDto data
22+
Map<String, String> data,
23+
@JsonProperty("position") PositionDto positionDto
2724
) {
2825
public record PositionDto(
2926
@JsonProperty("x") double x,
3027
@JsonProperty("y") double y
31-
) {}
32-
33-
public record MeasurementsDto(
34-
@JsonProperty("width") double width,
35-
@JsonProperty("height") double height
36-
) {}
37-
38-
public record DataDto(
39-
@JsonProperty("content") String content,
40-
@JsonProperty("createdAt") String createAt, // YYYY-MM-DD format
41-
@JsonProperty("link") String sourceUrl,
42-
@JsonProperty("title") String title,
43-
@JsonProperty("user") WriterDto writer
44-
) {}
45-
46-
public record WriterDto(
47-
@JsonProperty("name") String name,
48-
@JsonProperty("profileUrl") String profileImageUrl
49-
) {}
50-
28+
) {}
5129
}
5230

5331
public record EdgeDto(
5432
@JsonProperty("id") String edgeKey,
5533
@JsonProperty("source") String sourceNodeKey,
56-
@JsonProperty("target") String targetNodeKey
34+
@JsonProperty("target") String targetNodeKey,
35+
@JsonProperty("type") String edgeType,
36+
@JsonProperty("animated") boolean isAnimated,
37+
@JsonProperty("style") StyleDto styleDto
5738
) {
39+
public record StyleDto(
40+
String stroke,
41+
Double strokeWidth
42+
) {}
5843
}
5944

6045
// DTO -> Entity, BodyForReactFlow를 Graph 엔티티로 변환
@@ -66,24 +51,10 @@ public Graph toEntity() {
6651
Node node = new Node();
6752
node.setNodeKey(dto.nodeKey());
6853
node.setNodeType(NodeType.valueOf(dto.nodeType().toUpperCase()));
69-
node.setSelected(dto.selected() != null ? dto.selected() : false);
70-
node.setDragging(dto.dragging() != null ? dto.dragging() : false);
71-
node.setPositionX(dto.positionDto().x());
72-
node.setPositionY(dto.positionDto().y());
73-
if (dto.measurements() != null) {
74-
node.setWidth(dto.measurements().width());
75-
node.setHeight(dto.measurements().height());
76-
}
77-
if (dto.data() != null) {
78-
node.setData(Map.of(
79-
"content", dto.data().content(),
80-
"createdAt", dto.data().createAt(),
81-
"sourceUrl", dto.data().sourceUrl(),
82-
"title", dto.data().title(),
83-
"writerName", dto.data().writer() != null ? dto.data().writer().name() : null,
84-
"writerProfileImageUrl", dto.data().writer() != null ? dto.data().writer().profileImageUrl() : null
85-
));
86-
}
54+
node.setData(dto.data());
55+
node.setPositonX(dto.positionDto().x());
56+
node.setPositonY(dto.positionDto().y());
57+
node.setGraph(graph); // 연관관계 설정
8758
return node;
8859
})
8960
.toList();
@@ -94,6 +65,12 @@ public Graph toEntity() {
9465
edge.setEdgeKey(dto.edgeKey());
9566
edge.setSourceNodeKey(dto.sourceNodeKey());
9667
edge.setTargetNodeKey(dto.targetNodeKey());
68+
edge.setEdgeType(EdgeType.valueOf(dto.edgeType().toUpperCase()));
69+
edge.setAnimated(dto.isAnimated());
70+
if (dto.styleDto() != null) {
71+
edge.setStroke(dto.styleDto().stroke());
72+
edge.setStrokeWidth(dto.styleDto().strokeWidth());
73+
}
9774
edge.setGraph(graph); // 연관관계 설정
9875
return edge;
9976
})
@@ -111,28 +88,19 @@ public static BodyForReactFlow from(Graph graph) {
11188
.map(n -> new NodeDto(
11289
n.getNodeKey(),
11390
n.getNodeType().name().toUpperCase(),
114-
n.isSelected(),
115-
n.isDragging(),
116-
new NodeDto.PositionDto(n.getPositionX(), n.getPositionY()),
117-
new NodeDto.MeasurementsDto(n.getWidth(), n.getHeight()),
118-
new NodeDto.DataDto(
119-
n.getData().get("content"),
120-
n.getData().get("createdAt"),
121-
n.getData().get("sourceUrl"),
122-
n.getData().get("title"),
123-
new NodeDto.WriterDto(
124-
n.getData().get("writerName"),
125-
n.getData().get("writerProfileImageUrl")
126-
)
127-
)
91+
n.getData(),
92+
new NodeDto.PositionDto(n.getPositonX(), n.getPositonY())
12893
))
12994
.toList();
13095

13196
List<EdgeDto> edgeDtos = graph.getEdges().stream()
13297
.map(e -> new EdgeDto(
13398
e.getEdgeKey(),
13499
e.getSourceNodeKey(),
135-
e.getTargetNodeKey()
100+
e.getTargetNodeKey(),
101+
e.getEdgeType().name().toUpperCase(),
102+
e.isAnimated(),
103+
new EdgeDto.StyleDto(e.getStroke(), e.getStrokeWidth())
136104
))
137105
.toList();
138106

@@ -145,22 +113,9 @@ public List<Node> toNodeEntities(Graph graph) {
145113
Node node = new Node();
146114
node.setNodeKey(dto.nodeKey());
147115
node.setNodeType(NodeType.valueOf(dto.nodeType().toUpperCase()));
148-
node.setPositionX(dto.positionDto().x());
149-
node.setPositionY(dto.positionDto().y());
150-
if (dto.measurements() != null) {
151-
node.setWidth(dto.measurements().width());
152-
node.setHeight(dto.measurements().height());
153-
}
154-
if (dto.data() != null) {
155-
node.setData(Map.of(
156-
"content", dto.data().content(),
157-
"createdAt", dto.data().createAt(),
158-
"sourceUrl", dto.data().sourceUrl(),
159-
"title", dto.data().title(),
160-
"writerName", dto.data().writer() != null ? dto.data().writer().name() : null,
161-
"writerProfileImageUrl", dto.data().writer() != null ? dto.data().writer().profileImageUrl() : null
162-
));
163-
}
116+
node.setData(dto.data());
117+
node.setPositonX(dto.positionDto().x());
118+
node.setPositonY(dto.positionDto().y());
164119
node.setGraph(graph); // 연관관계 설정
165120
return node;
166121
})
@@ -174,6 +129,12 @@ public List<Edge> toEdgeEntities(Graph graph) {
174129
edge.setEdgeKey(dto.edgeKey());
175130
edge.setSourceNodeKey(dto.sourceNodeKey());
176131
edge.setTargetNodeKey(dto.targetNodeKey());
132+
edge.setEdgeType(EdgeType.valueOf(dto.edgeType().toUpperCase()));
133+
edge.setAnimated(dto.isAnimated());
134+
if (dto.styleDto() != null) {
135+
edge.setStroke(dto.styleDto().stroke());
136+
edge.setStrokeWidth(dto.styleDto().strokeWidth());
137+
}
177138
edge.setGraph(graph); // 연관관계 설정
178139
return edge;
179140
})

src/main/java/org/tuna/zoopzoop/backend/domain/dashboard/dto/ReqBodyForLiveblocksAuth.java

Lines changed: 0 additions & 15 deletions
This file was deleted.

src/main/java/org/tuna/zoopzoop/backend/domain/dashboard/dto/ResBodyForAuthToken.java

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)