Skip to content

Commit

Permalink
feat: #4 - exampleModel 이름 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
hryeong66 committed Jun 14, 2024
1 parent f340e5a commit a6a73b0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions Projects/Core/PPACModels/Sources/ExampleModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@

import Foundation

struct ExampleDTO: Decodable {
struct ExampleResponseModel: Decodable {
let exampleString: String?
let exampleString2: String?
}

struct ExampleVO: Decodable {
struct ExampleEntity: Decodable {
let exampleString: String?
}
16 changes: 8 additions & 8 deletions Projects/Features/Home/Sources/Service/ExampleRepository.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import PPACModels
import PPACNetwork

protocol ExampleRepository {
func fetchExample() async -> ExampleVO?
func postExample(id: Int) async -> ExampleVO?
func fetchExample() async -> ExampleEntity?
func postExample(id: Int) async -> ExampleEntity?
}

class ExampleRepositoryImpl: ExampleRepository {
Expand All @@ -21,17 +21,17 @@ class ExampleRepositoryImpl: ExampleRepository {
self.apiService = apiService
}

func fetchExample() async -> ExampleVO? {
func fetchExample() async -> ExampleEntity? {
let request = ExampleServiceEndpoints.getExample
let (data: ExampleDTO, error) = await self.apiService.request(request)
let (data: ExampleResponseModel, error) = await self.apiService.request(request)
guard let data, error == nil else { return nil }
return ExampleVO(exampleString: response.exampleString ?? "")
return ExampleEntity(exampleString: data.exampleString ?? "")
}

func postExample(id: Int) async -> ExampleVO? {
func postExample(id: Int) async -> ExampleEntity? {
let request = ExampleServiceEndpoints.postExmple(id: id)
let (data: ExampleDTO, error) = await self.apiService.request(request)
let (data: ExampleResponseModel, error) = await self.apiService.request(request)
guard let data, error == nil else { return nil }
return ExampleVO(exampleString: response.exampleString ?? "")
return ExampleEntity(exampleString: data.exampleString ?? "")
}
}

0 comments on commit a6a73b0

Please sign in to comment.