Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ extension CollectionDetailDTO.AuthorDTO {
id: unwrap(id),
nickname: nickname ?? "",
profileImageUrl: URL(string: profileImageUrl ?? ""),
role: unwrap(UserRole(rawValue: userRole ?? ""))
role: UserRole(rawValue: userRole ?? "") ?? .unknown
)
}
}
Expand Down
4 changes: 2 additions & 2 deletions FLINT/Data/Sources/DTO/Content/OTTPlatformsDTO.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ extension OTTPlatformsDTO.OTTPlatformDTO {
return try OTTPlatformEntity(
ottId: unwrap(ottId),
name: name ?? "",
logoUrl: logoUrl ?? "",
contentUrl: contentUrl ?? ""
logoUrl: URL(string: logoUrl ?? ""),
contentUrl: URL(string: contentUrl ?? "")
)
}
}
Expand Down
8 changes: 4 additions & 4 deletions FLINT/Data/Sources/DTO/User/CollectionBookmarkUsersDTO.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ extension CollectionBookmarkUsersDTO {
}

extension CollectionBookmarkUsersDTO.UserDTO {
public var entity: CollectionBookmarkUserEntity {
public var entity: UserProfileEntity {
get throws {
return try CollectionBookmarkUserEntity(
userId: unwrap(userId),
return try UserProfileEntity(
id: unwrap(userId),
nickname: nickName ?? "",
profileImageUrl: URL(string: profileImageUrl ?? ""),
userRole: userRole ?? ""
role: UserRole(rawValue: userRole ?? "") ?? .unknown
)
}
}
Expand Down
4 changes: 2 additions & 2 deletions FLINT/Data/Sources/DTO/User/KeywordDTO.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ extension KeywordsDTO.KeywordDTO {
public var entity: KeywordEntity {
get throws {
return try KeywordEntity(
color: color ?? "",
color: unwrap(KeywordColor(rawValue: color ?? "")),
rank: unwrap(rank),
name: name ?? "",
percentage: percentage ?? 0,
imageUrl: imageUrl ?? ""
imageUrl: URL(string: imageUrl ?? "")
)
}
}
Expand Down
4 changes: 2 additions & 2 deletions FLINT/Data/Sources/DTO/User/UserProfileDTO.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ extension UserProfileDTO {
return try UserProfileEntity(
id: unwrap(id),
nickname: nickname ?? "",
profileImageUrl: profileImageUrl ?? "",
isFliner: isFliner ?? false
profileImageUrl: URL(string: profileImageUrl ?? ""),
role: (isFliner ?? false) ? .fliner : .unknown
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public final class DefaultCollectionService: CollectionService {

public func createCollection(collectionInfo: CreateCollectionEntity) -> AnyPublisher<CreateCollectionDTO, Error> {
return collectionAPIProvider.requestPublisher(.createCollection(collectionInfo: collectionInfo))
.mapBaseResponseData(CreateCollectionResponseDTO.self)
.mapBaseResponseData(CreateCollectionDTO.self)
.eraseToAnyPublisher()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import Foundation

public struct CollectionBookmarkUsersEntity {
public struct CollectionBookmarkUsersEntity: Equatable {
public let bookmarkCount: Int
public let users: [UserProfileEntity]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import Foundation

public struct CollectionDetailEntity {
public struct CollectionDetailEntity: Equatable {
public let id: String
public let title: String
public let description: String
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import Foundation

public struct ExploreInfoEntity {
public struct ExploreInfoEntity: Equatable, Hashable, Sendable {
public let id: String
public let imageUrl: URL?
public let title: String
Expand Down
2 changes: 1 addition & 1 deletion FLINT/Domain/Sources/Entity/Content/ContentEntity.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import Foundation

public struct ContentEntity {
public struct ContentEntity: Equatable {
public let id: String
public let title: String
public let author: String
Expand Down
16 changes: 16 additions & 0 deletions FLINT/Domain/Sources/Entity/User/KeywordColor.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//
// KeywordColor.swift
// Domain
//
// Created by 김호성 on 2026.02.09.
//

import Foundation

public enum KeywordColor: String, Decodable {
case pink = "PINK"
case green = "GREEN"
case orange = "ORANGE"
case yellow = "YELLOW"
case blue = "BLUE"
}
4 changes: 2 additions & 2 deletions FLINT/Domain/Sources/Entity/User/KeywordEntity.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
import Foundation

public struct KeywordEntity {
public let color: String
public let color: KeywordColor
public let rank: Int
public let name: String
public let percentage: Int
public let imageUrl: URL?

public init(color: String, rank: Int, name: String, percentage: Int, imageUrl: URL?) {
public init(color: KeywordColor, rank: Int, name: String, percentage: Int, imageUrl: URL?) {
self.color = color
self.rank = rank
self.name = name
Expand Down
2 changes: 1 addition & 1 deletion FLINT/Domain/Sources/Entity/User/UserProfileEntity.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import Foundation

public struct UserProfileEntity {
public struct UserProfileEntity: Equatable {
public let id: String
public let nickname: String
public let profileImageUrl: URL?
Expand Down
4 changes: 3 additions & 1 deletion FLINT/Domain/Sources/Entity/User/UserRole.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import Foundation

public enum UserRole: String {
public enum UserRole: String, Equatable {
/// 관리자 - 시스템 전체 관리 권한
case admin = "ADMIN"

Expand All @@ -16,4 +16,6 @@ public enum UserRole: String {

/// 게스트 사용자 - 조회만 가능
case fling = "FLING"

case unknown
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import Entity
import Repository

public protocol CreateCollectionUseCase {
func createCollection(collectionInfo: CreateCollectionEntity) -> AnyPublisher<Void, Error>
func createCollection(collectionInfo: CreateCollectionEntity) -> AnyPublisher<Int64, Error>
}

public class DefaultCreateCollectionUseCase: CreateCollectionUseCase {
Expand All @@ -23,7 +23,7 @@ public class DefaultCreateCollectionUseCase: CreateCollectionUseCase {
self.collectionRepository = collectionRepository
}

public func createCollection(collectionInfo: CreateCollectionEntity) -> AnyPublisher<Void, Error> {
public func createCollection(collectionInfo: CreateCollectionEntity) -> AnyPublisher<Int64, Error> {
return collectionRepository.createCollection(collectionInfo: collectionInfo)
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// FetchCollectionsUseCase.swift
// FetchExploreCollectionsUseCase.swift
// Domain
//
// Created by 김호성 on 2026.01.22.
Expand All @@ -11,19 +11,19 @@ import Foundation
import Entity
import Repository

public protocol FetchCollectionsUseCase {
func fetchExplore(cursor: Int64?) -> AnyPublisher<CollectionPagingEntity, Error>
public protocol FetchExploreCollectionsUseCase {
func fetchExploreCollections(cursor: Int64?) -> AnyPublisher<CollectionPagingEntity, Error>
}

public final class DefaultFetchCollectionsUseCase: FetchCollectionsUseCase {
public final class DefaultFetchExploreCollectionsUseCase: FetchExploreCollectionsUseCase {

private let collectionRepository: CollectionRepository

public init(collectionRepository: CollectionRepository) {
self.collectionRepository = collectionRepository
}

public func fetchExplore(cursor: Int64?) -> AnyPublisher<CollectionPagingEntity, Error> {
public func fetchExploreCollections(cursor: Int64?) -> AnyPublisher<CollectionPagingEntity, Error> {
collectionRepository.fetchCollections(cursor: cursor, size: 3)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public protocol FetchPopularContentsUseCase {
func fetchPopularContents() -> AnyPublisher<[ContentEntity], Error>
}

public class DefaultContentsUseCase: FetchPopularContentsUseCase {
public class DefaultFetchPopularContentsUseCase: FetchPopularContentsUseCase {

private let searchRepository: SearchRepository

Expand Down
6 changes: 6 additions & 0 deletions FLINT/FLINT/Dependency/DIContainer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ final class DIContainer: DependencyFactory {
private lazy var authInterceptor: AuthInterceptor = AuthInterceptor(tokenStorage: tokenStorage)
private lazy var networkLoggerPlugin: NetworkLoggerPlugin = NetworkLoggerPlugin()

lazy var contentAPIProvider = MoyaProvider<ContentAPI>(
session: Session(interceptor: authInterceptor),
plugins: [
networkLoggerPlugin
]
)
lazy var userAPIProvider = MoyaProvider<UserAPI>(
session: Session(interceptor: authInterceptor),
plugins: [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// AuthAPIFactory.swift
// AuthAPIProviderFactory.swift
// FLINT
//
// Created by 김호성 on 2026.01.23.
Expand All @@ -11,13 +11,13 @@ import Moya

import Data

protocol AuthAPIFactory {
protocol AuthAPIProviderFactory {
var authAPIProvider: MoyaProvider<AuthAPI> { get set }

func makeAuthAPIProvider() -> MoyaProvider<AuthAPI>
}

extension AuthAPIFactory {
extension AuthAPIProviderFactory {
func makeAuthAPIProvider() -> MoyaProvider<AuthAPI> {
return authAPIProvider
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ import Moya

import Data

protocol CollectionAPIFactory {
protocol CollectionAPIProviderFactory {
var collectionAPIProvider: MoyaProvider<CollectionAPI> { get set }

func makeCollectionAPIProvider() -> MoyaProvider<CollectionAPI>
}

extension CollectionAPIFactory {
extension CollectionAPIProviderFactory {
func makeCollectionAPIProvider() -> MoyaProvider<CollectionAPI> {
return collectionAPIProvider
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
//
// ContentAPIProviderFactory.swift
// FLINT
//
// Created by 김호성 on 2026.02.09.
//

import Foundation

import Moya

import Data

protocol ContentAPIProviderFactory {
var contentAPIProvider: MoyaProvider<ContentAPI> { get set }

func makeContentAPIProvider() -> MoyaProvider<ContentAPI>
}

extension ContentAPIProviderFactory {
func makeContentAPIProvider() -> MoyaProvider<ContentAPI> {
return contentAPIProvider
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// HomeAPIFactory.swift
// HomeAPIProviderFactory.swift
// FLINT
//
// Created by 김호성 on 2026.01.31.
Expand All @@ -11,13 +11,13 @@ import Moya

import Data

protocol HomeAPIFactory {
protocol HomeAPIProviderFactory {
var homeAPIProvider: MoyaProvider<HomeAPI> { get set }

func makeHomeAPIProvider() -> MoyaProvider<HomeAPI>
}

extension HomeAPIFactory {
extension HomeAPIProviderFactory {
func makeHomeAPIProvider() -> MoyaProvider<HomeAPI> {
return homeAPIProvider
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// SearchAPIFactory.swift
// SearchAPIProviderFactory.swift
// FLINT
//
// Created by 김호성 on 2026.01.22.
Expand All @@ -11,13 +11,13 @@ import Moya

import Data

protocol SearchAPIFactory {
protocol SearchAPIProviderFactory {
var searchAPIProvider: MoyaProvider<SearchAPI> { get set }

func makeSearchAPIProvider() -> MoyaProvider<SearchAPI>
}

extension SearchAPIFactory {
extension SearchAPIProviderFactory {
func makeSearchAPIProvider() -> MoyaProvider<SearchAPI> {
return searchAPIProvider
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// File.swift
// UserAPIProviderFactory.swift
// FLINT
//
// Created by 김호성 on 2026.01.22.
Expand All @@ -11,13 +11,13 @@ import Moya

import Data

protocol UserAPIFactory {
protocol UserAPIProviderFactory {
var userAPIProvider: MoyaProvider<UserAPI> { get set }

func makeUserAPIProvider() -> MoyaProvider<UserAPI>
}

extension UserAPIFactory {
extension UserAPIProviderFactory {
func makeUserAPIProvider() -> MoyaProvider<UserAPI> {
return userAPIProvider
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// File.swift
// CollectionRepositoryFactory.swift
// FLINT
//
// Created by 김호성 on 2026.01.22.
Expand Down
Loading