Skip to content

Commit

Permalink
Fix: img를 Image 줄임말 변경, recipeImageID로 네이밍 변경, ID를 id로 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
GeonH0 committed Jun 11, 2024
1 parent d86703c commit 628e0b7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import Foundation

struct RecipeDTO: Decodable {

let ID: Int
let id: Int
let type: String
let name: String
let description: String
Expand All @@ -19,7 +19,7 @@ struct RecipeDTO: Decodable {
let imageUrls: [RecipeImageDTO]

enum CodingKeys: String, CodingKey {
case ID = "recipeId"
case id = "recipeId"
case type = "recipeType"
case name = "recipeName"
case description = "recipeDescription"
Expand All @@ -33,12 +33,12 @@ struct RecipeDTO: Decodable {
extension RecipeDTO {
func toDomain() -> Recipe {
return Recipe(
id: ID,
id: id,
type: RecipeType(rawValue: type) ?? .coffee,
name: name,
description: description,
writer: writer.toDomain(),
imageUrls: imageUrls.map { $0.recipeImgUrl },
imageUrls: imageUrls.map { $0.recipeImageUrl },
isLiked: false,
likeCount: likesCount,
createdAt: DateFormatter.iso8601.date(from: createdAt) ?? Date()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
import Foundation

struct RecipeImageDTO: Decodable {
let recipeImgId: Int
let recipeImgUrl: String
let recipeImageID: Int
let recipeImageUrl: String
}

0 comments on commit 628e0b7

Please sign in to comment.