Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
8681704
[Feat] #139 - CompositionalLayout 구현을 위한 세팅
youz2me Mar 27, 2025
5655fa3
[Feat] #139 - HomeViewController 세팅
youz2me Mar 30, 2025
0f47f97
[Feat] #139 - 홈 뷰 UI 및 로직 구현
youz2me Mar 31, 2025
ca99e11
[Feat] #139 - 글 작성 뷰 UI 및 글자수 제한 로직 구현
youz2me Apr 1, 2025
235607f
[Fix] #139 - 홈 뷰 UI 제대로 표시 안되는 문제 수정 및 멀티파트 통신을 위한 TargetType 수정
youz2me Apr 2, 2025
c1da796
[Fix] #139 - 글 작성 시 postButton isEnabled 조건 수정
youz2me Apr 2, 2025
f66b7fb
[Fix] #139 - 버튼 누르고 에러 발생 시 구독 종료되던 문제 해결
youz2me Apr 2, 2025
1492b68
[Feat] #139 - 하트 버튼 탭했을 때 서버 통신 기능 추가
youz2me Apr 4, 2025
e79018d
[Feat] #139 - 좋아요 서버 통신 기능 구현
youz2me Apr 5, 2025
236a212
[Feat] #139 - 홈 최상단 아닌 곳에서 홈 탭바 아이템 클릭 시 최상단으로 이동
youz2me Apr 5, 2025
aa45800
[Feat] #139 - 사진 클릭 시 사진 디테일 뷰 띄우는 기능 구현
youz2me Apr 5, 2025
f40d068
[Feat] #139 - TextView 행간 구현을 위한 setPretendard 구현 및 적용
youz2me Apr 5, 2025
225c7fd
[Feat] #139 - 페이징 시 로딩 인디케이터 추가
youz2me Apr 5, 2025
c84eeb8
[Feat] #139 - 로딩 뷰 추가
youz2me Apr 5, 2025
9acad53
[Feat] #139 - 세부 화면 UI 구현
youz2me Apr 6, 2025
fa5294c
[Feat] #139 - 상세페이지에서 쓰이는 UseCase 정의
youz2me Apr 6, 2025
bf71352
[Feat] #139 - Cell에서 버튼 클릭 시 실행될 Handler 정의
youz2me Apr 7, 2025
4f98e76
[Feat] #139 - 게시물 소유자 구별을 위한 userInformationUseCase 구현
youz2me Apr 8, 2025
2103afb
[Feat] #139 - 프로필 수정 API 통신을 위한 베이스라인 설정
youz2me Apr 9, 2025
2e28a5d
[Fix] #139 - 오타 수정
youz2me Apr 9, 2025
facc888
[Feat] #139 - 온보딩 기능 구현
youz2me Apr 10, 2025
998f488
[Feat] #139 - 화면 누르면 키보드 내려가는 기능 추가
youz2me Apr 10, 2025
a958834
[Fix] #139 - 홈에서 프로필 이미지 랜덤으로 나오던 문제 수정
youz2me Apr 10, 2025
6905f11
[Fix] #139 - 온보딩에서 설정한 이미지 적용 안되는 문제 해결
youz2me Apr 10, 2025
6beee59
[Fix] #139 - 온보딩 후 환영 팝업 안뜨는 문제 해결
youz2me Apr 10, 2025
e016148
[Fix] #139 - 글 작성 후 가장 위쪽 피드 안보이는 문제 해결
youz2me Apr 10, 2025
0e68501
[Fix] #139 - 로그인 화면 분기 처리 복구
youz2me Apr 10, 2025
d7addac
[Fix] #139 - 로그인 분기 처리
youz2me Apr 10, 2025
4cead09
[Feat] #139 - 세부 화면 UI 및 기능 구현
youz2me Apr 11, 2025
3fec19c
[Fix] #139 - 페이징 안되는 이슈 해결
youz2me Apr 11, 2025
178927c
[Feat] #139 - 답글 좋아요 기능 구현
youz2me Apr 11, 2025
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
106 changes: 101 additions & 5 deletions Wable-iOS.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions Wable-iOS/App/SceneDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,11 @@ private extension SceneDelegate {
func configureLoginScreen() {
self.window?.rootViewController = LoginViewController(
viewModel: LoginViewModel(
useCase: FetchUserAuthUseCase(
fetchUserAuthUseCase: FetchUserAuthUseCase(
loginRepository: loginRepository,
userSessionRepository: userSessionRepository
)
),
updateUserSessionUseCase: FetchUserInformationUseCase(repository: userSessionRepository)
)
)
}
Expand Down
15 changes: 12 additions & 3 deletions Wable-iOS/Data/RepositoryImpl/ProfileRepositoryImpl.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import Combine
import Foundation
import UIKit

import CombineMoya
import Moya
Expand Down Expand Up @@ -34,20 +35,28 @@ extension ProfileRepositoryImpl: ProfileRepository {
.mapWableError()
}

func updateUserProfile(profile: UserProfile, isPushAlarmAllowed: Bool) -> AnyPublisher<Void, WableError> {
func updateUserProfile(
profile: UserProfile,
isPushAlarmAllowed: Bool,
isAlarmAllowed: Bool,
image: UIImage? = nil,
defaultProfileType: String? = nil
) -> AnyPublisher<Void, WableError> {
return provider.request(
.updateUserProfile(
request: DTO.Request.UpdateUserProfile(
info: DTO.Request.ProfileInfo(
nickname: profile.user.nickname,
isAlarmAllowed: isAlarmAllowed,
memberIntro: profile.introduction,
isPushAlarmAllowed: isPushAlarmAllowed,
// TODO: fcm 토큰 넣어주는 로직 필요
fcmToken: nil,
memberLCKYears: profile.lckYears,
memberFanTeam: profile.user.fanTeam?.rawValue,
memberDefaultProfileImage: profile.user.profileURL?.absoluteString
memberDefaultProfileImage: defaultProfileType
),
file: nil
file: image?.jpegData(compressionQuality: 0.1)
)
),
for: DTO.Response.Empty.self
Expand Down
6 changes: 3 additions & 3 deletions Wable-iOS/Data/RepositoryImpl/UserSessionRepositoryImpl.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ extension UserSessionRepositoryImpl: UserSessionRepository {
return try? userDefaults.getValue(for: Keys.activeUserID)
}

func updateUserSession(_ session: UserSession, forUserID userID: Int) {
func updateUserSession(_ session: UserSession) {
var sessions = fetchAllUserSessions()

sessions[userID] = session
sessions[session.id] = session

try? userDefaults.setValue(sessions, for: Keys.userSessions)

if fetchActiveUserID() == nil {
updateActiveUserID(userID)
updateActiveUserID(session.id)
}
}

Expand Down
2 changes: 1 addition & 1 deletion Wable-iOS/Domain/Entity/UserSession.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import Foundation
struct UserSession: Codable, Identifiable {
let id: Int
let nickname: String
let profileURL: String
let profileURL: URL?
let isPushAlarmAllowed: Bool
let isAdmin: Bool
let isAutoLoginEnabled: Bool?
Expand Down
9 changes: 8 additions & 1 deletion Wable-iOS/Domain/RepositoryInterface/ProfileRepository.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,16 @@

import Combine
import Foundation
import UIKit

protocol ProfileRepository {
func fetchUserInfo() -> AnyPublisher<AccountInfo, WableError>
func fetchUserProfile(memberID: Int) -> AnyPublisher<UserProfile, WableError>
func updateUserProfile(profile: UserProfile, isPushAlarmAllowed: Bool) -> AnyPublisher<Void, WableError>
func updateUserProfile(
profile: UserProfile,
isPushAlarmAllowed: Bool,
isAlarmAllowed: Bool,
image: UIImage?,
defaultProfileType: String?
) -> AnyPublisher<Void, WableError>
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ protocol UserSessionRepository {
func fetchUserSession(forUserID userID: Int) -> UserSession?
func fetchActiveUserSession() -> UserSession?
func fetchActiveUserID() -> Int?
func updateUserSession(_ session: UserSession, forUserID userID: Int)
func updateUserSession(_ session: UserSession)
func updateNotificationBadge(count: Int, forUserID userID: Int)
func updateActiveUserID(_ userID: Int?)
func removeUserSession(forUserID userID: Int)
Expand Down
30 changes: 30 additions & 0 deletions Wable-iOS/Domain/UseCase/Home/CreateCommentLikedUseCase.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
//
// CreateCommentLikedUseCase.swift
// Wable-iOS
//
// Created by YOUJIM on 4/6/25.
//


import Combine
import Foundation

final class CreateCommentLikedUseCase {
private let repository: CommentLikedRepository

init(repository: CommentLikedRepository) {
self.repository = repository
}
}

// MARK: - Extension

extension CreateCommentLikedUseCase {
func execute(commentID: Int, notificationText: String) -> AnyPublisher<Void, WableError> {
return repository.createCommentLiked(
commentID: commentID,
triggerType: "commentLiked",
notificationText: notificationText
)
}
}
31 changes: 31 additions & 0 deletions Wable-iOS/Domain/UseCase/Home/CreateCommentUseCase.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
//
// CreateCommentUseCase.swift
// Wable-iOS
//
// Created by YOUJIM on 4/6/25.
//


import Combine
import Foundation

final class CreateCommentUseCase {
private let repository: CommentRepository

init(repository: CommentRepository) {
self.repository = repository
}
}

// MARK: - Extension

extension CreateCommentUseCase {
func execute(contentID: Int, text: String, parentID: Int?, parentMemberID: Int?) -> AnyPublisher<Void, WableError> {
return repository.createComment(
contentID: contentID,
text: text,
parentID: parentID,
parentMemberID: parentMemberID
)
}
}
27 changes: 27 additions & 0 deletions Wable-iOS/Domain/UseCase/Home/CreateContentLikedUseCase.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
//
// CreateContentLikedUseCase.swift
// Wable-iOS
//
// Created by YOUJIM on 4/2/25.
//


import Combine
import Foundation

final class CreateContentLikedUseCase {
private let repository: ContentLikedRepository

init(repository: ContentLikedRepository) {
self.repository = repository
}
}

// MARK: - Extension

extension CreateContentLikedUseCase {
func execute(contentID: Int) -> AnyPublisher<Void, WableError> {
return repository.createContentLiked(contentID: contentID, triggerType: "contentLiked")
}
}

26 changes: 26 additions & 0 deletions Wable-iOS/Domain/UseCase/Home/CreateContentUseCase.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
//
// CreateContentUseCase.swift
// Wable-iOS
//
// Created by YOUJIM on 3/31/25.
//


import Combine
import Foundation

final class CreateContentUseCase {
private let repository: ContentRepository

init(repository: ContentRepository) {
self.repository = repository
}
}

// MARK: - Extension

extension CreateContentUseCase {
func execute(title: String, text: String, image: Data?) -> AnyPublisher<Void, WableError> {
return repository.createContent(title: title, text: text, image: image)
}
}
26 changes: 26 additions & 0 deletions Wable-iOS/Domain/UseCase/Home/DeleteCommentLikedUseCase.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
//
// DeleteCommentLikedUseCase.swift
// Wable-iOS
//
// Created by YOUJIM on 4/6/25.
//


import Combine
import Foundation

final class DeleteCommentLikedUseCase {
private let repository: CommentLikedRepository

init(repository: CommentLikedRepository) {
self.repository = repository
}
}

// MARK: - Extension

extension DeleteCommentLikedUseCase {
func execute(commentID: Int) -> AnyPublisher<Void, WableError> {
return repository.deleteCommentLiked(commentID: commentID)
}
}
26 changes: 26 additions & 0 deletions Wable-iOS/Domain/UseCase/Home/DeleteCommentUseCase.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
//
// DeleteCommentUseCase.swift
// Wable-iOS
//
// Created by YOUJIM on 4/6/25.
//


import Combine
import Foundation

final class DeleteCommentUseCase {
private let repository: CommentRepository

init(repository: CommentRepository) {
self.repository = repository
}
}

// MARK: - Extension

extension DeleteCommentUseCase {
func execute(commentID: Int) -> AnyPublisher<Void, WableError> {
return repository.deleteComment(commentID: commentID)
}
}
26 changes: 26 additions & 0 deletions Wable-iOS/Domain/UseCase/Home/DeleteContentLikedUseCase.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
//
// DeleteContentLikedUseCase.swift
// Wable-iOS
//
// Created by YOUJIM on 4/2/25.
//


import Combine
import Foundation

final class DeleteContentLikedUseCase {
private let repository: ContentLikedRepository

init(repository: ContentLikedRepository) {
self.repository = repository
}
}

// MARK: - Extension

extension DeleteContentLikedUseCase {
func execute(contentID: Int) -> AnyPublisher<Void, WableError> {
return repository.deleteContentLiked(contentID: contentID)
}
}
26 changes: 26 additions & 0 deletions Wable-iOS/Domain/UseCase/Home/DeleteContentUseCase.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
//
// DeleteContentUseCase.swift
// Wable-iOS
//
// Created by YOUJIM on 3/31/25.
//


import Combine
import Foundation

final class DeleteContentUseCase {
private let repository: ContentRepository

init(repository: ContentRepository) {
self.repository = repository
}
}

// MARK: - Extension

extension DeleteContentUseCase {
func execute(contentID: Int) -> AnyPublisher<Void, WableError> {
return repository.deleteContent(contentID: contentID)
}
}
26 changes: 26 additions & 0 deletions Wable-iOS/Domain/UseCase/Home/FetchContentCommentListUseCase.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
//
// FetchContentCommentListUseCase.swift
// Wable-iOS
//
// Created by YOUJIM on 4/6/25.
//


import Combine
import Foundation

final class FetchContentCommentListUseCase {
private let repository: CommentRepository

init(repository: CommentRepository) {
self.repository = repository
}
}

// MARK: - Extension

extension FetchContentCommentListUseCase {
func execute(contentID: Int, cursor: Int) -> AnyPublisher<[ContentComment], WableError> {
return repository.fetchContentCommentList(contentID: contentID, cursor: cursor)
}
}
25 changes: 25 additions & 0 deletions Wable-iOS/Domain/UseCase/Home/FetchContentListUseCase.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
//
// FetchContentListUseCase.swift
// Wable-iOS
//
// Created by YOUJIM on 3/31/25.
//


import Combine

final class FetchContentListUseCase {
private let repository: ContentRepository

init(repository: ContentRepository) {
self.repository = repository
}
}

// MARK: - Extension

extension FetchContentListUseCase {
func execute(cursor: Int) -> AnyPublisher<[Content], WableError> {
return repository.fetchContentList(cursor: cursor)
}
}
Loading