Skip to content

Commit

Permalink
refactor: ProductSecret -> ProductPassword 네이밍 변경 #14
Browse files Browse the repository at this point in the history
  • Loading branch information
ChaminLee committed Jan 27, 2022
1 parent aa37775 commit c0b0c0a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions OpenMarket/OpenMarket.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
C995B25B279703EE00293651 /* Notification+name.swift in Sources */ = {isa = PBXBuildFile; fileRef = C995B25A279703ED00293651 /* Notification+name.swift */; };
C996A575279EB5B8002AAA97 /* ProductDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C996A574279EB5B8002AAA97 /* ProductDetailViewController.swift */; };
C997D3242782DD0900FF3398 /* .swiftlint.yml in Resources */ = {isa = PBXBuildFile; fileRef = C997D3232782DD0800FF3398 /* .swiftlint.yml */; };
C99CF02E27A002A900E5CDB4 /* ProductSecret.swift in Sources */ = {isa = PBXBuildFile; fileRef = C99CF02D27A002A900E5CDB4 /* ProductSecret.swift */; };
C99CF02E27A002A900E5CDB4 /* ProductPassword.swift in Sources */ = {isa = PBXBuildFile; fileRef = C99CF02D27A002A900E5CDB4 /* ProductPassword.swift */; };
C99CF05227A113D900E5CDB4 /* ProductManageViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C99CF05127A113D900E5CDB4 /* ProductManageViewController.swift */; };
C9AC3E5B2786C5BE00177751 /* ImageData.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9AC3E5A2786C5BD00177751 /* ImageData.swift */; };
C9AC3E5E2786DAAD00177751 /* APIError.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9AC3E5D2786DAAD00177751 /* APIError.swift */; };
Expand Down Expand Up @@ -128,7 +128,7 @@
C995B25A279703ED00293651 /* Notification+name.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Notification+name.swift"; sourceTree = "<group>"; };
C996A574279EB5B8002AAA97 /* ProductDetailViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProductDetailViewController.swift; sourceTree = "<group>"; };
C997D3232782DD0800FF3398 /* .swiftlint.yml */ = {isa = PBXFileReference; lastKnownFileType = text.yaml; path = .swiftlint.yml; sourceTree = "<group>"; };
C99CF02D27A002A900E5CDB4 /* ProductSecret.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProductSecret.swift; sourceTree = "<group>"; };
C99CF02D27A002A900E5CDB4 /* ProductPassword.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProductPassword.swift; sourceTree = "<group>"; };
C99CF05127A113D900E5CDB4 /* ProductManageViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProductManageViewController.swift; sourceTree = "<group>"; };
C9AC3E5A2786C5BD00177751 /* ImageData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ImageData.swift; sourceTree = "<group>"; };
C9AC3E5D2786DAAD00177751 /* APIError.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = APIError.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -370,7 +370,7 @@
children = (
A6A824562785DDD8006CE6DA /* ProductRegisterInformation.swift */,
C9AC3E5A2786C5BD00177751 /* ImageData.swift */,
C99CF02D27A002A900E5CDB4 /* ProductSecret.swift */,
C99CF02D27A002A900E5CDB4 /* ProductPassword.swift */,
);
path = Request;
sourceTree = "<group>";
Expand Down Expand Up @@ -642,7 +642,7 @@
C99CF05227A113D900E5CDB4 /* ProductManageViewController.swift in Sources */,
A6A8248327871680006CE6DA /* URLRequest+httpmethod.swift in Sources */,
C996A575279EB5B8002AAA97 /* ProductDetailViewController.swift in Sources */,
C99CF02E27A002A900E5CDB4 /* ProductSecret.swift in Sources */,
C99CF02E27A002A900E5CDB4 /* ProductPassword.swift in Sources */,
C9AC3E5B2786C5BE00177751 /* ImageData.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation

struct ProductSecret: Codable {
struct ProductPassword: Codable {
let secret: String

enum CodingKeys: CodingKey {
Expand Down
4 changes: 2 additions & 2 deletions OpenMarket/OpenMarket/Network/APIService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,12 @@ extension APIService {
task.resume()
}

func retrieveProductSecret(productId: Int, secret: ProductSecret, completion: @escaping (Result<String, APIError>) -> Void) {
func retrieveProductSecret(productId: Int, password: ProductPassword, completion: @escaping (Result<String, APIError>) -> Void) {
guard let url = URLCreator.productSecret(id: productId).url else {
return
}

guard let body = try? JSONEncoder().encode(secret) else {
guard let body = try? JSONEncoder().encode(password) else {
return
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,8 @@ extension ProductDetailViewController {
guard let secret = secret else {
return
}
let productSecret = ProductSecret(secret: VendorInformation.secret)
api.retrieveProductSecret(productId: productDetail.id, secret: productSecret) { result in
let productPassword = ProductPassword(secret: VendorInformation.secret)
api.retrieveProductSecret(productId: productDetail.id, password: productPassword) { result in
switch result {
case .success(let password):
DispatchQueue.main.async {
Expand Down

0 comments on commit c0b0c0a

Please sign in to comment.