-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/moit list #72
Changes from all commits
3e9ce98
c44fd3e
210c9aa
1f06a30
0834bce
9d4534f
5f6afeb
92ce6c0
106cda4
d9cfc98
404726a
6e5b27c
0a39410
b841157
701af15
f4717d2
d7f5a71
a7af07b
c8394dd
cde95e7
9693156
309f29c
11dabdd
9cb5246
aba45ab
f955488
5cbb61a
1cb1c78
c3f71b4
2135af4
683e54f
e6a8d2c
094e885
62cb634
e1c2b6a
8326914
508c6da
aa43302
c2c4991
06205ab
2948713
3abddca
d3e3729
cf57aac
2d84117
e43e1e3
f969bed
e6b5c66
e2fd3a1
4c90a0a
44fe382
c9053cd
2bdbc60
4a4e3e1
3bb2c0f
104c95f
59e86de
4e898d9
b79d5e7
b9e38f3
fefab8a
f3bb3ba
14e6116
d1a585f
48a7376
849e1a2
5a53f8f
40defae
faf06de
6c83479
3d24a7a
fa40e5a
fe59977
5bc2a70
a4c0a05
82f701d
f143318
a06c232
968abff
3fec2c3
35d83c6
baa06b3
4abd0a0
f38f149
a2c512f
9f005ad
a617abf
69a2148
d952102
233f9de
e6bc970
0035181
c3e9911
f302c4f
1ba31dd
7e25144
977dfb0
eaaae74
da72db2
b01fda7
ea33a9b
b4624a5
316a292
ee3baa9
3c67aa1
f16d3c9
8ebac2c
669ceeb
ed8ffb9
2c5ba4c
92df9ab
5b8fa0b
c932113
59f64e1
49ed87c
0c807c6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
// | ||
// BaseCollectionViewCell.swift | ||
// Utils | ||
// | ||
// Created by kimchansoo on 2023/07/23. | ||
// | ||
|
||
import UIKit | ||
|
||
import RxSwift | ||
import RxCocoa | ||
|
||
open class BaseCollectionViewCell: UICollectionViewCell { | ||
|
||
// MARK: - UI | ||
public let flexRootView = UIView() | ||
|
||
// MARK: - Properties | ||
public var disposebag = DisposeBag() | ||
|
||
// MARK: - Methods | ||
public override init(frame: CGRect) { | ||
super.init(frame: frame) | ||
|
||
self.backgroundColor = .white | ||
configureAttributes() | ||
configureHierarchy() | ||
configureConstraints() | ||
bind() | ||
} | ||
|
||
open func configureHierarchy() { | ||
// self.addSubview(flexRootView) | ||
self.contentView.addSubview(flexRootView) | ||
} | ||
open func configureConstraints() {} | ||
open func configureAttributes() {} | ||
open func bind() {} | ||
|
||
open override func layoutSubviews() { | ||
// self.contentView.backgroundColor = .green | ||
// self.backgroundColor = .black | ||
// flexRootView.backgroundColor = .blue | ||
self.contentView.backgroundColor = .clear | ||
self.backgroundColor = .clear | ||
flexRootView.backgroundColor = .clear | ||
|
||
flexRootView.frame = contentView.bounds | ||
flexRootView.pin.all() | ||
flexRootView.flex.layout(mode: .fitContainer) | ||
} | ||
|
||
@available(*, unavailable) | ||
required public init?(coder: NSCoder) { | ||
fatalError("init(coder:) is called.") | ||
} | ||
} | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. μ건 κ·Έλ₯ κΆκΈν건λ°...μ΄λ° νΉμ μΌμ΄μ€μ λ·°λ MOITList RIB λ΄λΆμ λ€μ΄κ°λ κ²λ³΄λ€ Design Systemμ λ³΄ν΅ λ§λλ νΈμΈκ°μ?! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. μ λ,,, μ λͺ¨λ₯΄κ² κΈ΄ νλ° μΌλ¨ μ»΄ν¬λνΈλΌ λΆλ¦¬ν΄λκΈ΄ νμ΅λλ€. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
// | ||
// EmptyMOITView.swift | ||
// DesignSystem | ||
// | ||
// Created by kimchansoo on 2023/07/23. | ||
// Copyright Β© 2023 chansoo.MOIT. All rights reserved. | ||
// | ||
|
||
import UIKit | ||
|
||
import ResourceKit | ||
|
||
import FlexLayout | ||
import Kingfisher | ||
import RxSwift | ||
import RxGesture | ||
|
||
public final class EmptyMOITView: UIView { | ||
|
||
// MARK: - UI | ||
private let flexRootView = UIView() | ||
|
||
private let noStudyLabel: UILabel = { | ||
let label = UILabel() | ||
label.text = "μ°Έμ¬ν μ€ν°λκ° μμ΄μ!" | ||
label.font = ResourceKitFontFamily.p3 | ||
label.textColor = ResourceKitAsset.Color.gray600.color | ||
return label | ||
}() | ||
|
||
private let studySuggestionLabel: UILabel = { | ||
let label = UILabel() | ||
label.text = "μ€ν°λλ₯Ό μμ±νκ±°λ μ°Έμ¬ν΄λ³΄μΈμ" | ||
label.font = ResourceKitFontFamily.p3 | ||
label.textColor = ResourceKitAsset.Color.gray600.color | ||
return label | ||
}() | ||
|
||
// MARK: - Properties | ||
private let disposebag = DisposeBag() | ||
|
||
// MARK: - Initializers | ||
public init() { | ||
super.init(frame: .zero) | ||
configure() | ||
} | ||
|
||
|
||
@available (*, unavailable) | ||
required init?(coder: NSCoder) { | ||
fatalError("required init called") | ||
} | ||
|
||
// MARK: - Lifecycle | ||
public override func layoutSubviews() { | ||
super.layoutSubviews() | ||
|
||
self.addSubview(flexRootView) | ||
self.flexRootView.pin.all() | ||
self.flexRootView.flex.layout() | ||
self.flexRootView.layer.cornerRadius = 30 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. clipsToBoundsλ masksToBounds μΆκ°νμλκ±° μ΄λ μ κ°μ© ~ |
||
self.flexRootView.clipsToBounds = true | ||
} | ||
|
||
// MARK: - Methods | ||
private func configure() { | ||
|
||
self.flexRootView.flex | ||
.justifyContent(.center) | ||
.alignItems(.center) | ||
.backgroundColor(.white) | ||
.define { flex in | ||
flex.addItem(noStudyLabel) | ||
.marginBottom(5) | ||
flex.addItem(studySuggestionLabel) | ||
} | ||
|
||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// | ||
// FineRepositoryImpl.swift | ||
// MOITListDataImpl | ||
// | ||
// Created by kimchansoo on 2023/07/23. | ||
// Copyright Β© 2023 chansoo.MOIT. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
import RxSwift | ||
|
||
import MOITListData | ||
import MOITListDomain | ||
import MOITNetwork | ||
|
||
final class FineRepositoryImpl: FineRepository { | ||
|
||
// MARK: - Properties | ||
private let network: Network | ||
|
||
// MARK: - Initializers | ||
public init(network: Network) { | ||
self.network = network | ||
} | ||
|
||
// MARK: - Lifecycle | ||
|
||
// MARK: - Methods | ||
func fetchFine(moitId: Int) -> Single<Fine> { | ||
fatalError() | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// | ||
// MOITRepository.swift | ||
// MOITListData | ||
// | ||
// Created by kimchansoo on 2023/07/16. | ||
// Copyright Β© 2023 chansoo.MOIT. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
import RxSwift | ||
|
||
import MOITListData | ||
import MOITListDomain | ||
import MOITNetwork | ||
|
||
public final class MOITRepositoryImpl: MOITRepository { | ||
|
||
|
||
// MARK: - UI | ||
|
||
// MARK: - Properties | ||
private let network: Network | ||
|
||
// MARK: - Initializers | ||
public init(network: Network) { | ||
self.network = network | ||
} | ||
|
||
// MARK: - Lifecycle | ||
|
||
// MARK: - Methods | ||
public func fetchMOITList() -> Single<[MOIT]> { | ||
network.request( | ||
with: FetchMOITListRequestable() | ||
) | ||
.map { $0.moits.map { $0.toMOIT() } } | ||
} | ||
|
||
public func deleteMoit(id: Int) -> Single<Void> { | ||
fatalError() | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// | ||
// MOITRequestable.swift | ||
// MOITListData | ||
// | ||
// Created by kimchansoo on 2023/07/23. | ||
// Copyright Β© 2023 chansoo.MOIT. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
import MOITNetwork | ||
import MOITListData | ||
|
||
struct FetchMOITListRequestable: Requestable { | ||
|
||
public typealias Response = MOITListDTO | ||
|
||
// MARK: - Properties | ||
|
||
public var baseURL: URL? { | ||
return URL(string: "http://moit-backend-eb-env.eba-qtcnkjjy.ap-northeast-2.elasticbeanstalk.com") ?? URL(fileReferenceLiteralResourceName: "") | ||
} | ||
|
||
public var path: String { | ||
return "/api/v1/moit" | ||
} | ||
|
||
public var method: HTTPMethod { | ||
return .get | ||
} | ||
|
||
public var headers: HTTPHeaders { | ||
return [:] | ||
} | ||
|
||
public var parameters: HTTPRequestParameter? { | ||
return nil | ||
} | ||
|
||
// mark: - Initializers | ||
init() { | ||
|
||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
layout() λ©μλμ mode defaultκ°μ΄ .fitContainerλΌμ κ΅³μ΄ μ΄λ κ² μμ±ν΄μ€ νμλ μμ κ² κ°μμ~!