-
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.
Browse files
Browse the repository at this point in the history
메인화면을 다 만들었습니다
- Loading branch information
Showing
23 changed files
with
674 additions
and
140 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
import UIKit | ||
import INetwork | ||
|
||
public struct AuthEntities { | ||
let token: Token | ||
let username: String | ||
let email: String | ||
|
||
init(token: Token, username: String, email: String) { | ||
self.token = token | ||
self.username = username | ||
self.email = email | ||
} | ||
} | ||
//import UIKit | ||
//import INetwork | ||
// | ||
//public struct AuthEntities { | ||
// let token: Token | ||
// let username: String | ||
// let email: String | ||
// | ||
// init(token: Token, username: String, email: String) { | ||
// self.token = token | ||
// self.username = username | ||
// self.email = email | ||
// } | ||
//} |
20 changes: 10 additions & 10 deletions
20
Projects/Domain/Sources/RepositoryInterfaces/AuthRepository.swift
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 |
---|---|---|
@@ -1,10 +1,10 @@ | ||
import UIKit | ||
import RxSwift | ||
import RxCocoa | ||
|
||
public protocol AuthRepository { | ||
func login(username: String, password: String, completion: @escaping (Result<AuthEntities, Error>) -> Void) | ||
func sendCode(email: String, completion: @escaping (Result<Void, Error>) -> Void) | ||
func checkCode(code: String, completion: @escaping (Result<Void, Error>) -> Void) | ||
func signUp(username: String, password: String, email: String, completion: @escaping (Result<AuthEntities, Error>) -> Void) | ||
} | ||
//import UIKit | ||
//import RxSwift | ||
//import RxCocoa | ||
// | ||
//public protocol AuthRepository { | ||
// func login(username: String, password: String, completion: @escaping (Result<AuthEntities, Error>) -> Void) | ||
// func sendCode(email: String, completion: @escaping (Result<Void, Error>) -> Void) | ||
// func checkCode(code: String, completion: @escaping (Result<Void, Error>) -> Void) | ||
// func signUp(username: String, password: String, email: String, completion: @escaping (Result<AuthEntities, Error>) -> Void) | ||
//} |
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 |
---|---|---|
@@ -1,115 +1,115 @@ | ||
import Foundation | ||
import RxSwift | ||
import INetwork | ||
|
||
public protocol AuthUseCase { | ||
func login(email: String, password: String) | ||
func sendCode(email: String) | ||
func checkCode(email: String, data: String, type: String) | ||
func signUp(emailCode: String, studentKey: String, name: String, email: String, password: String, githubLink: String?) | ||
func reissueToken() | ||
func checkTokenTime(token: String) | ||
|
||
var authSuccess: PublishSubject<Token> { get } | ||
var authFail: PublishSubject<Error> { get } | ||
var codeSent: PublishSubject<Void> { get } | ||
var codeCheckSuccess: PublishSubject<Void> { get } | ||
var signUpSuccess: PublishSubject<Void> { get } | ||
var tokenReissued: PublishSubject<Token> { get } | ||
var tokenTimeChecked: PublishSubject<Int> { get } | ||
} | ||
|
||
public final class DefaultAuthUseCase: AuthUseCase { | ||
private let authService: AuthService | ||
private let disposeBag = DisposeBag() | ||
|
||
public var authSuccess = PublishSubject<Token>() | ||
public var authFail = PublishSubject<Error>() | ||
public var codeSent = PublishSubject<Void>() | ||
public var codeCheckSuccess = PublishSubject<Void>() | ||
public var signUpSuccess = PublishSubject<Void>() | ||
public var tokenReissued = PublishSubject<Token>() | ||
public var tokenTimeChecked = PublishSubject<Int>() | ||
|
||
public init(authService: AuthService) { | ||
self.authService = authService | ||
} | ||
|
||
public func login(email: String, password: String) { | ||
authService.login(email: email, password: password) | ||
.subscribe( | ||
onSuccess: { [weak self] token in | ||
self?.authSuccess.onNext(token) | ||
}, | ||
onFailure: { [weak self] error in | ||
self?.authFail.onNext(error) | ||
} | ||
) | ||
.disposed(by: disposeBag) | ||
} | ||
|
||
public func sendCode(email: String) { | ||
authService.sendCode(email: email) | ||
.subscribe( | ||
onSuccess: { [weak self] in | ||
self?.codeSent.onNext(()) | ||
}, | ||
onFailure: { [weak self] error in | ||
self?.authFail.onNext(error) | ||
} | ||
) | ||
.disposed(by: disposeBag) | ||
} | ||
|
||
public func checkCode(email: String, data: String, type: String) { | ||
authService.checkCode(email: email, data: data, type: type) | ||
.subscribe( | ||
onSuccess: { [weak self] in | ||
self?.codeCheckSuccess.onNext(()) | ||
}, | ||
onFailure: { [weak self] error in | ||
self?.authFail.onNext(error) | ||
} | ||
) | ||
.disposed(by: disposeBag) | ||
} | ||
|
||
public func signUp(emailCode: String, studentKey: String, name: String, email: String, password: String, githubLink: String?) { | ||
authService.signUp(emailCode: emailCode, studentKey: studentKey, name: name, email: email, password: password, githubLink: githubLink) | ||
.subscribe( | ||
onSuccess: { [weak self] in | ||
self?.signUpSuccess.onNext(()) | ||
}, | ||
onFailure: { [weak self] error in | ||
self?.authFail.onNext(error) | ||
} | ||
) | ||
.disposed(by: disposeBag) | ||
} | ||
|
||
public func reissueToken() { | ||
authService.reissueToken() | ||
.subscribe( | ||
onSuccess: { [weak self] token in | ||
self?.tokenReissued.onNext(token) | ||
}, | ||
onFailure: { [weak self] error in | ||
self?.authFail.onNext(error) | ||
} | ||
) | ||
.disposed(by: disposeBag) | ||
} | ||
|
||
public func checkTokenTime(token: String) { | ||
authService.checkTokenTime(token: token) | ||
.subscribe( | ||
onSuccess: { [weak self] remainingTime in | ||
self?.tokenTimeChecked.onNext(remainingTime) | ||
}, | ||
onFailure: { [weak self] error in | ||
self?.authFail.onNext(error) | ||
} | ||
) | ||
.disposed(by: disposeBag) | ||
} | ||
} | ||
//import Foundation | ||
//import RxSwift | ||
//import INetwork | ||
// | ||
//public protocol AuthUseCase { | ||
// func login(email: String, password: String) | ||
// func sendCode(email: String) | ||
// func checkCode(email: String, data: String, type: String) | ||
// func signUp(emailCode: String, studentKey: String, name: String, email: String, password: String, githubLink: String?) | ||
// func reissueToken() | ||
// func checkTokenTime(token: String) | ||
// | ||
// var authSuccess: PublishSubject<Token> { get } | ||
// var authFail: PublishSubject<Error> { get } | ||
// var codeSent: PublishSubject<Void> { get } | ||
// var codeCheckSuccess: PublishSubject<Void> { get } | ||
// var signUpSuccess: PublishSubject<Void> { get } | ||
// var tokenReissued: PublishSubject<Token> { get } | ||
// var tokenTimeChecked: PublishSubject<Int> { get } | ||
//} | ||
// | ||
//public final class DefaultAuthUseCase: AuthUseCase { | ||
// private let authService: AuthService | ||
// private let disposeBag = DisposeBag() | ||
// | ||
// public var authSuccess = PublishSubject<Token>() | ||
// public var authFail = PublishSubject<Error>() | ||
// public var codeSent = PublishSubject<Void>() | ||
// public var codeCheckSuccess = PublishSubject<Void>() | ||
// public var signUpSuccess = PublishSubject<Void>() | ||
// public var tokenReissued = PublishSubject<Token>() | ||
// public var tokenTimeChecked = PublishSubject<Int>() | ||
// | ||
// public init(authService: AuthService) { | ||
// self.authService = authService | ||
// } | ||
// | ||
// public func login(email: String, password: String) { | ||
// authService.login(email: email, password: password) | ||
// .subscribe( | ||
// onSuccess: { [weak self] token in | ||
// self?.authSuccess.onNext(token) | ||
// }, | ||
// onFailure: { [weak self] error in | ||
// self?.authFail.onNext(error) | ||
// } | ||
// ) | ||
// .disposed(by: disposeBag) | ||
// } | ||
// | ||
// public func sendCode(email: String) { | ||
// authService.sendCode(email: email) | ||
// .subscribe( | ||
// onSuccess: { [weak self] in | ||
// self?.codeSent.onNext(()) | ||
// }, | ||
// onFailure: { [weak self] error in | ||
// self?.authFail.onNext(error) | ||
// } | ||
// ) | ||
// .disposed(by: disposeBag) | ||
// } | ||
// | ||
// public func checkCode(email: String, data: String, type: String) { | ||
// authService.checkCode(email: email, data: data, type: type) | ||
// .subscribe( | ||
// onSuccess: { [weak self] in | ||
// self?.codeCheckSuccess.onNext(()) | ||
// }, | ||
// onFailure: { [weak self] error in | ||
// self?.authFail.onNext(error) | ||
// } | ||
// ) | ||
// .disposed(by: disposeBag) | ||
// } | ||
// | ||
// public func signUp(emailCode: String, studentKey: String, name: String, email: String, password: String, githubLink: String?) { | ||
// authService.signUp(emailCode: emailCode, studentKey: studentKey, name: name, email: email, password: password, githubLink: githubLink) | ||
// .subscribe( | ||
// onSuccess: { [weak self] in | ||
// self?.signUpSuccess.onNext(()) | ||
// }, | ||
// onFailure: { [weak self] error in | ||
// self?.authFail.onNext(error) | ||
// } | ||
// ) | ||
// .disposed(by: disposeBag) | ||
// } | ||
// | ||
// public func reissueToken() { | ||
// authService.reissueToken() | ||
// .subscribe( | ||
// onSuccess: { [weak self] token in | ||
// self?.tokenReissued.onNext(token) | ||
// }, | ||
// onFailure: { [weak self] error in | ||
// self?.authFail.onNext(error) | ||
// } | ||
// ) | ||
// .disposed(by: disposeBag) | ||
// } | ||
// | ||
// public func checkTokenTime(token: String) { | ||
// authService.checkTokenTime(token: token) | ||
// .subscribe( | ||
// onSuccess: { [weak self] remainingTime in | ||
// self?.tokenTimeChecked.onNext(remainingTime) | ||
// }, | ||
// onFailure: { [weak self] error in | ||
// self?.authFail.onNext(error) | ||
// } | ||
// ) | ||
// .disposed(by: disposeBag) | ||
// } | ||
//} |
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
21 changes: 21 additions & 0 deletions
21
Projects/Modules/INFOKit/Resources/Assets.xcassets/MOUImage.imageset/Contents.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,21 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "MOUImage.png", | ||
"idiom" : "universal", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Binary file added
BIN
+74 KB
Projects/Modules/INFOKit/Resources/Assets.xcassets/MOUImage.imageset/MOUImage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions
21
Projects/Modules/INFOKit/Resources/Assets.xcassets/announcementImage.imageset/Contents.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,21 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "announcementImage.png", | ||
"idiom" : "universal", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Binary file added
BIN
+457 Bytes
...OKit/Resources/Assets.xcassets/announcementImage.imageset/announcementImage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions
21
Projects/Modules/INFOKit/Resources/Assets.xcassets/companyListImage.imageset/Contents.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,21 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "companyListImage.png", | ||
"idiom" : "universal", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Binary file added
BIN
+365 Bytes
...NFOKit/Resources/Assets.xcassets/companyListImage.imageset/companyListImage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions
21
Projects/Modules/INFOKit/Resources/Assets.xcassets/defaultImg.imageset/Contents.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,21 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "defaultImg.png", | ||
"idiom" : "universal", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Binary file added
BIN
+4.23 KB
...ts/Modules/INFOKit/Resources/Assets.xcassets/defaultImg.imageset/defaultImg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.