Skip to content

Commit

Permalink
[Fix/#7] DTO 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
kim-seonwoo committed Jun 7, 2024
1 parent b267f34 commit abfbc4f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
4 changes: 2 additions & 2 deletions Tving-Clone/Tving-Clone/Network/DTO/DetailResponseDTO.swift
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ struct ShowType: Codable {
}

extension DetailResponseDTO {
func toAppData() -> DetailDataModel {
func toDomain() -> ContentDetail {
let movieInfo = self.movieInfoResult.movieInfo

let title = movieInfo.movieNm
Expand All @@ -70,7 +70,7 @@ extension DetailResponseDTO {
let audits = movieInfo.audits.first?.auditNo ?? ""
let companys = movieInfo.companys.first?.companyNm ?? ""

return DetailDataModel(
return ContentDetail(
title: title,
openDt: openDt,
directors: directors,
Expand Down
11 changes: 5 additions & 6 deletions Tving-Clone/Tving-Clone/Network/DTO/MovieResponseDTO.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,12 @@ enum RankOldAndNew: String, Codable {
}

extension MovieResponseDTO {
func toAppData() -> [MainDataModel] {
var mainDataModels: [MainDataModel] = []
func toAppData() -> [Content] {
var mainDataModels: [Content] = []

var tempData: [MainData] = []
var tempData: [ContentData] = []
for (index, boxOfficeData) in boxOfficeResult.dailyBoxOfficeList.enumerated() {
let mainData = MainData(
image: .poster4,
let mainData = ContentData(image: "poster4",
title: boxOfficeData.movieNm,
maker: boxOfficeData.movieCd,
subTitle: boxOfficeData.movieCd,
Expand All @@ -52,7 +51,7 @@ extension MovieResponseDTO {
tempData.append(mainData)

if (index + 1) % 8 == 0 || index == boxOfficeResult.dailyBoxOfficeList.count - 1 {
let mainDataModel = MainDataModel(data: tempData)
let mainDataModel = Content(data: tempData)
mainDataModels.append(mainDataModel)
tempData.removeAll()
}
Expand Down

0 comments on commit abfbc4f

Please sign in to comment.