Skip to content

Commit

Permalink
Release Version 1.7.0 (#368)
Browse files Browse the repository at this point in the history
  • Loading branch information
wngus4296 authored Oct 13, 2024
2 parents 4b4f858 + 756156f commit bd62ca6
Show file tree
Hide file tree
Showing 38 changed files with 1,057 additions and 175 deletions.
52 changes: 50 additions & 2 deletions Boolti/Boolti.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
//
// ConcertCastTeamListEntity.swift
// Boolti
//
// Created by Miro on 10/6/24.
//

import Foundation

struct ConcertCastTeamListEntity {
let id: Int
let name: String
let members: [TeamMember]
let createdAt: String
let modifiedAt: String
}

struct TeamMember {
let id: Int
let code: String
let imagePath: String
let nickName: String
let roleName: String
let createdAt: String
let modifiedAt: String
}
6 changes: 6 additions & 0 deletions Boolti/Boolti/Sources/Network/APIs/ConcertAPI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ enum ConcertAPI {

case list(requesDTO: ConcertListRequestDTO)
case detail(requestDTO: ConcertDetailRequestDTO)
case castTeamList(requestDTO: ConcertCastTeamListRequestDTO)
case userProfile(requsetDTO: ConcertUserProfileRequestDTO)
}

extension ConcertAPI: ServiceAPI {
Expand All @@ -23,6 +25,10 @@ extension ConcertAPI: ServiceAPI {
return "/papi/v1/shows/search"
case .detail(let DTO):
return "/papi/v1/show/\(DTO.id)"
case .castTeamList(let DTO):
return "/papi/v1/shows/\(DTO.showID)/cast-teams"
case .userProfile(requsetDTO: let DTO):
return "/papi/v1/users/\(DTO.userCode)"
}
}

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

import Foundation

struct UserResponseDTO: Decodable {
// TODO: DTO와 Entity 분리하기!
struct UserResponseDTO: UserProfileResponseDTO {

let id: Int
let nickname: String?
Expand All @@ -16,7 +17,6 @@ struct UserResponseDTO: Decodable {
let imgPath: String?
let introduction: String?
let link: [LinkEntity]?

}

struct LinkEntity: Codable, Equatable {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// ConcertCastTeamListRequestDTO.swift
// Boolti
//
// Created by Miro on 10/6/24.
//

import Foundation

struct ConcertCastTeamListRequestDTO: Encodable {

let showID: Int
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// ConcertUserProfileRequestDTO.swift
// Boolti
//
// Created by Miro on 10/7/24.
//

import Foundation

struct ConcertUserProfileRequestDTO: Encodable {

let userCode: String
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
//
// ConcertCastTeamListResponseDTO.swift
// Boolti
//
// Created by Miro on 10/6/24.
//

import Foundation

struct ConcertCastTeamListResponseDTO: Decodable {
let id: Int
let name: String
let members: [TeamMemberDTO]
let createdAt: String
let modifiedAt: String

func convertToTeamListEntity() -> ConcertCastTeamListEntity {
let members = self.members.map { DTO in
return TeamMember(
id: DTO.id,
code: DTO.userCode,
imagePath: DTO.userImgPath,
nickName: DTO.userNickname,
roleName: DTO.roleName,
createdAt: DTO.createdAt,
modifiedAt: DTO.modifiedAt
)
}
return ConcertCastTeamListEntity(
id: self.id,
name: self.name,
members: members,
createdAt: self.createdAt,
modifiedAt: self.modifiedAt
)
}
}

struct TeamMemberDTO: Codable {
let id: Int
let userCode: String
let userImgPath: String
let userNickname: String
let roleName: String
let createdAt: String
let modifiedAt: String
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
//
// ConcertUserProfileResponseDTO.swift
// Boolti
//
// Created by Miro on 10/8/24.
//

import Foundation

protocol UserProfileResponseDTO: Decodable {
var nickname: String? { get }
var userCode: String? { get }
var imgPath: String? { get }
var introduction: String? { get }
var link: [LinkEntity]? { get }
}

struct ConcertUserProfileResponseDTO: UserProfileResponseDTO {

let nickname: String?
let userCode: String?
let imgPath: String?
let introduction: String?
let link: [LinkEntity]?
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ final class NetworkProvider: NetworkProviderType {
let baseURL = "\(api.baseURL)"
let requestString = "\(api.path)"
let endpoint = MultiTarget.target(api)

return provider.rx.request(endpoint)
.do(
onSuccess: { response in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ import KakaoSDKUser
import RxKakaoSDKUser
import SwiftJWT

protocol AuthRepositoryType {
// TODO: Auth와 유저의 정보 관리 API 나누기
protocol AuthRepositoryType: RepositoryType {

var networkService: NetworkProviderType { get }
func fetchTokens() -> (String, String)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ import Foundation

import RxSwift

protocol ConcertRepositoryType {
protocol ConcertRepositoryType: RepositoryType {
var networkService: NetworkProviderType { get }
func concertList(concertName: String?) -> Single<[ConcertEntity]>
func concertDetail(concertId: Int) -> Single<ConcertDetailEntity>
func salesTicket(concertId: Int) -> Single<[SelectedTicketEntity]>
func castTeamList(concertId: Int) -> Single<[ConcertCastTeamListEntity]>
}

final class ConcertRepository: ConcertRepositoryType {
Expand Down Expand Up @@ -51,4 +52,22 @@ final class ConcertRepository: ConcertRepositoryType {
.map { $0.convertToSalesTicketEntities() }
}

func castTeamList(concertId: Int) -> Single<[ConcertCastTeamListEntity]> {
let castTeamListRequestDTO = ConcertCastTeamListRequestDTO(showID: concertId)
let api = ConcertAPI.castTeamList(requestDTO: castTeamListRequestDTO)

return networkService.request(api)
.map([ConcertCastTeamListResponseDTO].self)
.map { return $0.map { dto in
dto.convertToTeamListEntity()
} }
}

func userProfile(userCode: String) -> Single<ConcertUserProfileResponseDTO> {
let concertUserProfileRequestDTO = ConcertUserProfileRequestDTO(userCode: userCode)
let api = ConcertAPI.userProfile(requsetDTO: concertUserProfileRequestDTO)

return networkService.request(api)
.map(ConcertUserProfileResponseDTO.self)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import Foundation

import RxSwift

protocol GiftingRepositoryType {
protocol GiftingRepositoryType: RepositoryType {
var networkService: NetworkProviderType { get }
func savePaymentInfo(concertId: Int,
selectedTicket: SelectedTicketEntity) -> Single<SavePaymentInfoResponseDTO>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import Foundation
import FirebaseMessaging
import RxSwift

protocol PushNotificationRepositoryType {
protocol PushNotificationRepositoryType: RepositoryType {

var networkService: NetworkProviderType { get }
func registerDeviceToken()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import Foundation

import RxSwift

protocol QRRepositoryType {
protocol QRRepositoryType: RepositoryType {

var networkService: NetworkProviderType { get }
func scannerList() -> Single<[QRScannerEntity]>
Expand Down
13 changes: 13 additions & 0 deletions Boolti/Boolti/Sources/Network/Repositories/RepositoryType.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// RepositoryType.swift
// Boolti
//
// Created by Miro on 10/7/24.
//

import Foundation

protocol RepositoryType {

var networkService: NetworkProviderType { get }
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import Foundation

import RxSwift

protocol ReservationRepositoryType {
protocol ReservationRepositoryType: RepositoryType {

var networkService: NetworkProviderType { get }
func ticketReservations() -> Single<[TicketReservationItemEntity]>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import Foundation

import RxSwift

protocol TicketingRepositoryType {
protocol TicketingRepositoryType: RepositoryType {
var networkService: NetworkProviderType { get }
func checkInvitationCode(concertId: Int,
ticketId: Int,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ final class ConcertDetailDIContainer {
typealias Content = String
typealias ConcertId = Int
typealias PhoneNumber = String

typealias UserCode = String

private let authRepository: AuthRepository
private let concertRepository: ConcertRepository

Expand Down Expand Up @@ -72,14 +73,22 @@ final class ConcertDetailDIContainer {
return viewController
}

let profileViewControllerFactory: (UserCode) -> ProfileViewController = { (userCode) in
let DIContainer = self.createProfileDIContainer()

let viewController = DIContainer.createProfileViewController(userCode: userCode)
return viewController
}

let viewController = ConcertDetailViewController(
viewModel: viewModel,
loginViewControllerFactory: loginViewControllerFactory,
posterExpandViewControllerFactory: posterExpandViewControllerFactory,
concertContentExpandViewControllerFactory: concertContentExpandViewControllerFactory,
reportViewControllerFactory: reportViewControllerFactory,
ticketSelectionViewControllerFactory: ticketSelectionViewControllerFactory,
contactViewControllerFactory: contactViewControllerFactory
contactViewControllerFactory: contactViewControllerFactory,
profileViewControllerFactory: profileViewControllerFactory
)

return viewController
Expand Down Expand Up @@ -118,4 +127,8 @@ final class ConcertDetailDIContainer {
concertId: concertId)
}

private func createProfileDIContainer() -> ProfileDIContainer {
return ProfileDIContainer(repository: self.concertRepository)
}

}
Loading

0 comments on commit bd62ca6

Please sign in to comment.