Skip to content

Commit

Permalink
#4 CoreModule 네이밍 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
doyeonk429 committed Dec 19, 2024
1 parent e7763eb commit 5073627
Show file tree
Hide file tree
Showing 7 changed files with 115 additions and 114 deletions.
24 changes: 12 additions & 12 deletions DE/DE/Sources/Core/Utilities/Constants.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,27 @@

import Foundation

struct Constants {
static let appname = "Drink-EG"
public struct Constants {
public static let appname = "Drink-EG"

struct Auth {
static var Tokens : [String : String] = [:]
public struct Auth {
public static var Tokens : [String : String] = [:]
// iOS test id : iOSadmin
// iOS test pw : 0000
}

struct API {
static let baseURL = "https://drinkeg.com"
static let commentURL = "https://drinkeg.com/comments"
static let recommentURL = "https://drinkeg.com/recomments"
public struct API {
public static let baseURL = "https://drinkeg.com"
public static let commentURL = "https://drinkeg.com/comments"
public static let recommentURL = "https://drinkeg.com/recomments"
}

struct Design {
public struct Design {

}

struct Policy {
static let service =
public struct Policy {
public static let service =
"""
서비스 이용약관
Expand Down Expand Up @@ -201,7 +201,7 @@ struct Constants {
2. 미디어, 통신사 등을 통한 홍보목적으로 이용자의 콘텐츠를 제공, 전시하도록 하는 등의 사용.
"""

static let privacy =
public static let privacy =
"""
개인정보처리방침
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Copyright © 2024 DRINKIG. All rights reserved

import CoreModule
import Foundation
import Moya

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Copyright © 2024 DRINKIG. All rights reserved

import CoreModule
import Foundation
import Moya

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Copyright © 2024 DRINKIG. All rights reserved

import CoreModule
import Foundation
import Moya

Expand Down
104 changes: 51 additions & 53 deletions DE/DE/Sources/Network/Course/WineClassAPI.swift
Original file line number Diff line number Diff line change
@@ -1,56 +1,54 @@
////
//// WineClassAPI.swift
//// Drink-EG
//
// WineClassAPI.swift
// Drink-EG
//import Core
//import Foundation
//import Moya
//
// Created by 김도연 on 8/12/24.
//enum WineClassAPI {
// case getAllWineClass
// case getWineClass(id: Int)
//}
//

import Foundation
import Moya

enum WineClassAPI {
case getAllWineClass
case getWineClass(id: Int)
}

extension WineClassAPI: TargetType {
var baseURL: URL {
return URL(string: Constants.API.baseURL)!
}

var path: String {
switch self {
case .getAllWineClass:
return "/wine-class"
case .getWineClass(let id):
return "/wine-class/\(id)"
}
}

var method: Moya.Method {
switch self {
case .getAllWineClass, .getWineClass:
return .get
}
}

var task: Moya.Task {
switch self {
case .getAllWineClass:
return .requestPlain
case .getWineClass(let id):
return .requestParameters(parameters: ["wineClassId" : id], encoding: JSONEncoding.default)
}
}

var headers: [String : String]? {
return [
"Content-type": "application/json"
]
}

var validationType: ValidationType {
return .successCodes
}

}
//extension WineClassAPI: TargetType {
// var baseURL: URL {
// return URL(string: Constants.API.baseURL)!
// }
//
// var path: String {
// switch self {
// case .getAllWineClass:
// return "/wine-class"
// case .getWineClass(let id):
// return "/wine-class/\(id)"
// }
// }
//
// var method: Moya.Method {
// switch self {
// case .getAllWineClass, .getWineClass:
// return .get
// }
// }
//
// var task: Moya.Task {
// switch self {
// case .getAllWineClass:
// return .requestPlain
// case .getWineClass(let id):
// return .requestParameters(parameters: ["wineClassId" : id], encoding: JSONEncoding.default)
// }
// }
//
// var headers: [String : String]? {
// return [
// "Content-type": "application/json"
// ]
// }
//
// var validationType: ValidationType {
// return .successCodes
// }
//
//}
78 changes: 39 additions & 39 deletions DE/DE/Sources/Network/Home/MemberInfoAPI.swift
Original file line number Diff line number Diff line change
@@ -1,43 +1,43 @@
// Copyright © 2024 DRINKIG. All rights reserved

import Core
import Foundation
import Moya

enum MemberInfoAPI {
case patchMember(data: MemberInfoRequest)
}

extension MemberInfoAPI: TargetType {
var baseURL: URL {
return URL(string: Constants.API.baseURL)!
}

var path: String {
switch self {
case .patchMember:
return "/member"
}
}

var method: Moya.Method {
return .patch
}

var task: Moya.Task {
switch self {
case .patchMember(let data):
return .requestJSONEncodable(data)
}
}

var headers: [String : String]? {
return [
"Content-type": "application/json"
]
}

var validationType: ValidationType {
return .successCodes
}
}

//enum MemberInfoAPI {
// case patchMember(data: MemberInfoRequest)
//}
//
//extension MemberInfoAPI: TargetType {
// var baseURL: URL {
// return URL(string: Constants.API.baseURL)!
// }
//
// var path: String {
// switch self {
// case .patchMember:
// return "/member"
// }
// }
//
// var method: Moya.Method {
// return .patch
// }
//
// var task: Moya.Task {
// switch self {
// case .patchMember(let data):
// return .requestJSONEncodable(data)
// }
// }
//
// var headers: [String : String]? {
// return [
// "Content-type": "application/json"
// ]
// }
//
// var validationType: ValidationType {
// return .successCodes
// }
//}
//
20 changes: 10 additions & 10 deletions DE/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ let project = Project(
[
"CFBundleTypeRole" : "Editor",
"CFBundleURLName" : "kakaologin",
"CFBundleURLSchemes" : ["kakao74177ce7b14b89614c47ac7d51464b95"]
"CFBundleURLSchemes" : ["kakao180ebe6367eb8ee6eafe439aa551744a"]
],
],
// 다른 설정은 여기에다가 추가
Expand All @@ -79,11 +79,11 @@ let project = Project(
entitlements: "DE/DE.entitlements",
scripts: [ swiftLintScript ],
dependencies: [
.target(name: "Core"),
.target(name: "CoreModule"),
.target(name: "Network"),
.target(name: "Authentication"),

.external(name: "KeychainSwift"),
.external(name: "KeychainSwift"),
.external(name: "KakaoSDK")
// .target(name: "Core"),
// .target(name: "Network"),
Expand Down Expand Up @@ -167,20 +167,20 @@ let project = Project(
entitlements: "DE/DE.entitlements",
scripts: [ swiftLintScript ],
dependencies: [
.target(name: "Core"),
.target(name: "CoreModule"),
.target(name: "Network"),
.target(name: "Authentication"),

.external(name: "KeychainSwift"),
.external(name: "KeychainSwift"),
.external(name: "KakaoSDK")
]
),
// module
.target(
name: "Core",
name: "CoreModule",
destinations: .iOS,
product: .staticFramework,
bundleId: "\(bundleId).\(bundleMid).Core",
bundleId: "\(bundleId).\(bundleMid).CoreModule",
sources: ["DE/Sources/Core/**"],
resources: ["DE/Resources/**"],
dependencies: [
Expand All @@ -191,7 +191,6 @@ let project = Project(
.external(name: "SwiftyToaster"),
.external(name: "Then"),
.external(name: "Cosmos"),

]
),
.target(
Expand All @@ -202,7 +201,8 @@ let project = Project(
sources: ["DE/Sources/Network/**"],
resources: ["DE/Resources/**"],
dependencies: [
.external(name: "Moya"),
.target(name: "CoreModule"),
.external(name: "Moya")
]
),
.target(
Expand All @@ -213,7 +213,7 @@ let project = Project(
sources: ["DE/Sources/Features/Authentication/**"],
resources: ["DE/Resources/**"],
dependencies: [
.target(name: "Core"),
.target(name: "CoreModule"),
.target(name: "Network")
]
),
Expand Down

0 comments on commit 5073627

Please sign in to comment.