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
6 changes: 4 additions & 2 deletions ByeBoo-iOS/ByeBoo-iOS/Data/Enum/JourneyType+Data.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@
extension JourneyType {
var key: String {
switch self {
case .face:
case .recording:
"FACE_EMOTION"
case .process:
case .active:
"PROCESS_EMOTION"
case .reunion:
"PREPARE_REUNION"
}
}

Expand Down
4 changes: 2 additions & 2 deletions ByeBoo-iOS/ByeBoo-iOS/Data/Enum/SelectJourneyType+Data.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ extension SelectQuestType {
switch self {
case .recording:
"RECORDING"
case .active:
"ACTIVE"
case .reunion:
"REUNION"
}
}

Expand Down
1 change: 0 additions & 1 deletion ByeBoo-iOS/ByeBoo-iOS/Data/Model/UserRequestDTO.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,5 @@

struct UserRequestDTO: Encodable {
let name: String
let feeling: String
let questStyle: String
}
14 changes: 7 additions & 7 deletions ByeBoo-iOS/ByeBoo-iOS/Data/Network/EndPoint/UsersAPI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ enum UsersAPI {

extension UsersAPI: EndPoint {
var basePath: String {
return "/api/v1/users"

// switch self {
// case .journey, .character, .count, .start, .modifyName, .updateNotificationPermission:
// case .sendUser:
// return "/api/v2/users"
// }
switch self {
case .journey, .character, .count, .start,
.modifyName, .updateNotificationPermission, .fetchCommonQuestAnswers:
return "/api/v1/users"
case .sendUser:
return "/api/v2/users"
}
}

var path: String {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ struct DefaultQuestRepository: QuestsInterface {

func postNewJourney(journey: JourneyType) async throws {
ByeBooLogger.debug(journey)
// TODO: 로그인 붙인 후 주석 해제
let _ = try await network.request(
QuestAPI.postJourney(journey: journey)
)
Expand Down
6 changes: 3 additions & 3 deletions ByeBoo-iOS/ByeBoo-iOS/Data/Repository/UsersRepository.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ struct DefaultUsersRepository: UsersInterface {
let accessToken = loadAccessToken()
let userRequestDTO: UserRequestDTO = .init(
name: name,
feeling: "EXHAUSTED",
questStyle: questStyle
)
let result = try await network.request(
Expand All @@ -57,6 +56,7 @@ struct DefaultUsersRepository: UsersInterface {
let _ = userDefaultsService.save(false, key: .hasEnterMyPage)
let _ = userDefaultsService.save(false, key: .alarmEnabled)

ByeBooLogger.debug("유저 여정 \(questStyle)")
ByeBooLogger.debug("유저 정보 저장 완료")
return result.toEntity()
}
Expand Down Expand Up @@ -124,7 +124,7 @@ struct DefaultUsersRepository: UsersInterface {

func getLastJourneyType() -> JourneyType {
let journey: String? = userDefaultsService.load(key: .journey)
return JourneyType.keyToEnum(journey ?? "") ?? .face
return JourneyType.keyToEnum(journey ?? "") ?? .recording
}

func updateNotificationPermission() async throws -> Bool {
Expand Down Expand Up @@ -243,7 +243,7 @@ final class MockUserRepository: UsersInterface {
}

func getLastJourneyType() -> JourneyType {
.process
.reunion
}

func updateNotificationPermission() -> Bool {
Expand Down
15 changes: 9 additions & 6 deletions ByeBoo-iOS/ByeBoo-iOS/Domain/Entity/Enum/JourneyType.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,23 @@

import Foundation

// 여정의 타입: 감정 직면형, 감정 정리형
// 여정의 타입: 이별 극복, 재회 준비

enum JourneyType: CaseIterable {
case face
case process
case recording
case active
case reunion
}

extension JourneyType {
var mixpanelKey: String {
switch self {
case .face:
"감정 직면"
case .process:
case .recording:
"이별 극복"
case .active:
"감정 정리"
case .reunion:
"재회 준비"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@
// 온보딩 시에 퀘스트 방식 선택

enum SelectQuestType: CaseIterable {
case reunion
case recording
case active
}

extension SelectQuestType {
var mixpanelKey: String {
switch self {
case .recording:
"질문형"
case .active:
"행동형"
"이별극복"
case .reunion:
"재회준비"
}
}
}
2 changes: 1 addition & 1 deletion ByeBoo-iOS/ByeBoo-iOS/Domain/Entity/JourneyEntity.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ struct JourneyEntity {

extension JourneyEntity: Equatable {
static func stub() -> Self {
return .init(title: "감정 직면", description: "설명", style: .face, questType: .question)
return .init(title: "이별 극복", description: "설명", style: .recording, questType: .question)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,41 +10,38 @@ import UIKit
extension JourneyType {
var title: String {
switch self {
case .face:
"재회 준비"
case .process:
case .recording:
"이별 극복"
}
}

var image: UIImage {
switch self {
case .face:
.faceEmotion
case .process:
.processEmotion
case .active:
"감정 정리"
case .reunion:
"재회 준비"
}
}

var description: String {
return "\(title) 여정"
}

var frontImage: UIImage {
var frontImage: UIImage? {
switch self {
case .face:
.reunionFront
case .process:
.overcomingFront
case .recording:
.overcomingFront
case .reunion:
.reunionFront
case .active:
nil
}
}

var backImage: UIImage {
var backImage: UIImage? {
switch self {
case .face:
.reunionBack
case .process:
.overcomingBack
case .recording:
.overcomingBack
case .reunion:
.reunionBack
case .active:
nil
}
}

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ import Mixpanel

final class CardJourneyViewController: BaseViewController {

private let viewModel: JourneyResultViewModel
private let viewModel: CardJourneyViewModel
private var cancellables = Set<AnyCancellable>()

private let rootView = CardJourneyView()
private var journeyType: JourneyType = .face
private var journeyType: JourneyType = .recording

init(viewModel: JourneyResultViewModel) {
init(viewModel: CardJourneyViewModel) {
self.viewModel = viewModel
super.init(nibName: nil, bundle: nil)
}
Expand Down Expand Up @@ -79,10 +79,10 @@ extension CardJourneyViewController: ToastPresentable, ToastErrorHandler {
switch result {
case .success(let journey):
self?.rootView.updateJourney(
journeyType: JourneyType.titleToEnum(journey.title) ?? .face,
journeyType: JourneyType.titleToEnum(journey.title) ?? .recording,
journeyDescription: journey.description ?? ""
)
self?.journeyType = JourneyType.titleToEnum(journey.title) ?? .face
self?.journeyType = JourneyType.titleToEnum(journey.title) ?? .recording
case .failure(let error):
self?.handleError(error)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ final class HomeViewController: BaseViewController {

private var state: HomeState = .beforeJourneyStart
private var isFirstVisit: Bool = true
private var journeyType: JourneyType = .face
private var journeyType: JourneyType = .recording
private var isAnimating: Bool = false

init(viewModel: HomeViewModel) {
Expand Down Expand Up @@ -156,11 +156,11 @@ extension HomeViewController: ToastPresentable, ToastErrorHandler {
progress: state.questCount,
journey: journey.title
)
self?.journeyType = JourneyType.titleToEnum(journey.title) ?? .face
self?.journeyType = JourneyType.titleToEnum(journey.title) ?? .recording
case let (_, .success(journey), .failure(.notFound)):
self?.rootView.updateState(.beforeJourneyStart, journey.title)
self?.state = .beforeJourneyStart
self?.journeyType = JourneyType.titleToEnum(journey.title) ?? .face
self?.journeyType = JourneyType.titleToEnum(journey.title) ?? .recording
case let (_, .failure(.notFound), .success(state)):
self?.rootView.updateState(state.currentStatus)
self?.state = state.currentStatus
Expand Down
Loading
Loading