Skip to content

Commit 91b37b4

Browse files
committed
[feat] #173 미분류 링크 삭제 API 추가
1 parent 19ec4cd commit 91b37b4

File tree

5 files changed

+36
-2
lines changed

5 files changed

+36
-2
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
//
2+
// ContentDeleteRequest.swift
3+
// CoreKit
4+
//
5+
// Created by asobi on 12/30/24.
6+
//
7+
8+
import Foundation
9+
/// 미분류 링크 삭제
10+
public struct ContentDeleteRequest: Encodable {
11+
let contentId: [Int]
12+
13+
public init(contentId: [Int]) {
14+
self.contentId = contentId
15+
}
16+
}
17+
18+
extension ContentDeleteRequest {
19+
public static let mock: Self = Self(contentId: [551321312,4333333])
20+
}

Projects/CoreKit/Sources/Data/Network/Content/ContentClient+LiveKey.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ extension ContentClient: DependencyKey {
5858
},
5959
미분류_링크_포킷_이동: { model in
6060
try await provider.requestNoBody(.미분류_링크_포킷_이동(model: model))
61+
},
62+
미분류_링크_삭제: { model in
63+
try await provider.requestNoBody(.미분류_링크_삭제(model: model))
6164
}
6265
)
6366
}()

Projects/CoreKit/Sources/Data/Network/Content/ContentClient+TestKey.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ extension ContentClient: TestDependencyKey {
1919
미분류_카테고리_컨텐츠_조회: { _ in .mock },
2020
컨텐츠_검색: { _, _ in .mock },
2121
썸네일_수정: { _, _ in },
22-
미분류_링크_포킷_이동: { _ in }
22+
미분류_링크_포킷_이동: { _ in },
23+
미분류_링크_삭제: { _ in }
2324
)
2425
}()
2526
}

Projects/CoreKit/Sources/Data/Network/Content/ContentClient.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,5 +47,8 @@ public struct ContentClient {
4747
public var 미분류_링크_포킷_이동: @Sendable (
4848
_ model: ContentMoveRequest
4949
) async throws -> Void
50+
public var 미분류_링크_삭제: @Sendable (
51+
_ model: ContentDeleteRequest
52+
) async throws -> Void
5053
}
5154

Projects/CoreKit/Sources/Data/Network/Content/ContentEndpoint.swift

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ public enum ContentEndpoint {
2929
)
3030
case 썸네일_수정(contentId: String, model: ThumbnailRequest)
3131
case 미분류_링크_포킷_이동(model: ContentMoveRequest)
32+
case 미분류_링크_삭제(model: ContentDeleteRequest)
3233
}
3334

3435
extension ContentEndpoint: TargetType {
@@ -60,13 +61,16 @@ extension ContentEndpoint: TargetType {
6061
return "/thumbnail/\(contentId)"
6162
case .미분류_링크_포킷_이동:
6263
return ""
64+
case .미분류_링크_삭제:
65+
return "/uncategorized"
6366
}
6467
}
6568

6669
public var method: Moya.Method {
6770
switch self {
6871
case .컨텐츠_삭제,
69-
.즐겨찾기_취소:
72+
.즐겨찾기_취소,
73+
.미분류_링크_삭제:
7074
return .put
7175

7276
case .컨텐츠_상세_조회,
@@ -142,6 +146,9 @@ extension ContentEndpoint: TargetType {
142146

143147
case let .미분류_링크_포킷_이동(model):
144148
return .requestJSONEncodable(model)
149+
150+
case let .미분류_링크_삭제(model):
151+
return .requestJSONEncodable(model)
145152
}
146153
}
147154

0 commit comments

Comments
 (0)