-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
59 changed files
with
2,163 additions
and
373 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// Copyright © 2024 RT4. All rights reserved | ||
|
||
import Foundation | ||
import Moya | ||
|
||
enum OCRService { | ||
case postImage(data : OCRRequest) | ||
} | ||
|
||
extension OCRService : TargetType { | ||
var baseURL: URL { | ||
guard let url = URL(string: Constants.NetworkManager.OCRAPIURL) else { | ||
fatalError("fatal error - none url") | ||
} | ||
return url | ||
} | ||
|
||
var path: String { | ||
return "/general" | ||
} | ||
|
||
var method: Moya.Method { | ||
return .post | ||
} | ||
|
||
var task: Moya.Task { | ||
switch self { | ||
case .postImage(let data) : | ||
return .requestJSONEncodable(data) | ||
} | ||
} | ||
|
||
var headers: [String : String]? { | ||
return [ | ||
"Content-Type": "application/json", | ||
"X-OCR-SECRET": "\(Constants.NetworkManager.OCRSecretKey)" | ||
] | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
// Copyright © 2024 RT4. All rights reserved | ||
|
||
import Foundation | ||
import Moya | ||
import KeychainSwift | ||
|
||
enum PointAPI { | ||
case getPoint | ||
case postPoint(param: AddPointRequest) | ||
case getPointHistory | ||
case getMonthlyStats | ||
} | ||
|
||
extension PointAPI: TargetType { | ||
var baseURL: URL { | ||
guard let url = URL(string: Constants.NetworkManager.baseURL) else { | ||
fatalError("fatal error - invalid url") | ||
} | ||
return url | ||
} | ||
|
||
var path: String { | ||
switch self { | ||
case .getPoint: | ||
return "points" | ||
case .postPoint: | ||
return "points" | ||
case .getPointHistory: | ||
return "points/history" | ||
case .getMonthlyStats: | ||
return "points/monthly" | ||
} | ||
} | ||
|
||
var method: Moya.Method { | ||
switch self { | ||
case .getPoint, .getPointHistory, .getMonthlyStats: | ||
return .get | ||
case .postPoint: | ||
return .post | ||
} | ||
} | ||
|
||
var task: Task { | ||
switch self { | ||
case .getPoint: | ||
return .requestPlain | ||
case .postPoint(let param): | ||
return .requestJSONEncodable(param) | ||
case .getPointHistory: | ||
return .requestPlain | ||
case .getMonthlyStats: | ||
return .requestPlain | ||
} | ||
} | ||
|
||
var headers: [String: String]? { | ||
return ["Content-Type": "application/json"] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
// Copyright © 2024 RT4. All rights reserved | ||
|
||
import Foundation | ||
import Moya | ||
import KeychainSwift | ||
|
||
enum DrugAPI { | ||
case getDrug | ||
case postDrug(param: drugSaveRequest) | ||
case deleteDrug(param: drugDeleteRequest) | ||
} | ||
|
||
extension DrugAPI: TargetType { | ||
var baseURL: URL { | ||
guard let url = URL(string: Constants.NetworkManager.baseURL) else { | ||
fatalError("fatal error - invalid url") | ||
} | ||
return url | ||
} | ||
|
||
var path: String { | ||
switch self { | ||
case .getDrug, .postDrug, .deleteDrug: | ||
return "drugs" | ||
} | ||
} | ||
|
||
var method: Moya.Method { | ||
switch self { | ||
case .getDrug: | ||
return .get | ||
case .postDrug: | ||
return .post | ||
case .deleteDrug: | ||
return .delete | ||
} | ||
} | ||
|
||
var task: Task { | ||
switch self { | ||
case .getDrug: | ||
return .requestPlain | ||
case .postDrug(let param): | ||
return .requestJSONEncodable(param) | ||
case .deleteDrug(let param): | ||
return .requestJSONEncodable(param) | ||
} | ||
} | ||
|
||
var headers: [String: String]? { | ||
return ["Content-Type": "application/json"] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
// Copyright © 2024 RT4. All rights reserved | ||
|
||
import UIKit | ||
import SnapKit | ||
|
||
class NotificationCell: UITableViewCell { | ||
// UI Components | ||
private lazy var iconImageView: UIImageView = { | ||
let imageView = UIImageView() | ||
imageView.image = UIImage(systemName: "circle.fill") // SF Symbol 설정 | ||
imageView.contentMode = .scaleAspectFit // 적절한 크기 유지 | ||
imageView.tintColor = Constants.Colors.pink | ||
return imageView | ||
}() | ||
|
||
private lazy var titleLabel: UILabel = { | ||
let label = UILabel() | ||
label.text = "Title Label" // 기본 텍스트 | ||
label.textColor = Constants.Colors.gray700 | ||
label.font = UIFont.ptdRegularFont(ofSize: 16) | ||
label.numberOfLines = 1 // 한 줄로 제한 | ||
return label | ||
}() | ||
|
||
// MARK: - Initializers | ||
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { | ||
super.init(style: style, reuseIdentifier: reuseIdentifier) | ||
setupViews() | ||
setupConstraints() | ||
} | ||
|
||
required init?(coder: NSCoder) { | ||
fatalError("init(coder:) has not been implemented") | ||
} | ||
|
||
// MARK: - Setup Methods | ||
private func setupViews() { | ||
contentView.addSubview(iconImageView) | ||
contentView.addSubview(titleLabel) | ||
} | ||
|
||
private func setupConstraints() { | ||
iconImageView.snp.makeConstraints { make in | ||
make.top.equalTo(contentView.safeAreaLayoutGuide).offset(16) // safeArea Top + 16 | ||
make.leading.equalTo(contentView.safeAreaLayoutGuide).offset(20) // safeArea Leading + 20 | ||
make.width.height.equalTo(10) // 정사각형 크기 설정 | ||
} | ||
|
||
titleLabel.snp.makeConstraints { make in | ||
make.top.equalTo(iconImageView) // 이미지뷰와 동일한 Top | ||
make.leading.equalTo(iconImageView.snp.trailing).offset(8) // 이미지뷰의 trailing + 8 | ||
make.trailing.equalTo(contentView.safeAreaLayoutGuide).offset(-20) // safeArea Trailing - 20 | ||
make.bottom.equalTo(contentView.safeAreaLayoutGuide).offset(-16) | ||
} | ||
} | ||
|
||
// MARK: - Configure Method | ||
|
||
func configure(with title: String) { | ||
titleLabel.text = title | ||
} | ||
|
||
} |
Oops, something went wrong.