Skip to content

Commit

Permalink
♻️ [#220] Domain / S 붙이기
Browse files Browse the repository at this point in the history
  • Loading branch information
kimsh153 committed Aug 22, 2023
1 parent 1bf5c37 commit 05fc3d7
Show file tree
Hide file tree
Showing 10 changed files with 60 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ struct AuthRepositoryImpl: AuthRepository {

func logout() async throws {
#warning("통신 오류 남")
// try await remoteAuthDataSource.logout()
try await remoteAuthDataSource.logout()
try await localAuthDataSource.logout()
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,70 +1,70 @@
import Foundation

public struct InputStudentInformationRequestDTO: Encodable {
public let certificate: [String]
public let certificates: [String]
public let contactEmail: String
public let formOfEmployment: FormOfEmployment
public let gsmAuthenticationScore: Int
public let introduce: String
public let languageCertificate: [LanguageCertificate]
public let languageCertificates: [LanguageCertificate]
public let major: String
public let militaryService: MilitaryServiceType
public let portfolioURL: String
public let profileImgURL: String
public let region: [String]
public let regions: [String]
public let salary: Int
public let techStack: [String]
public let techStacks: [String]
public let projects: [Project]
public let prizes: [Prize]

public init(
certificate: [String],
certificates: [String],
contactEmail: String,
formOfEmployment: FormOfEmployment,
gsmAuthenticationScore: Int,
introduce: String,
languageCertificate: [LanguageCertificate],
languageCertificates: [LanguageCertificate],
major: String,
militaryService: MilitaryServiceType,
portfolioURL: String,
profileImgURL: String,
region: [String],
regions: [String],
salary: Int,
techStack: [String],
techStacks: [String],
projects: [Project] = [],
prizes: [Prize] = []
) {
self.certificate = certificate
self.certificates = certificates
self.contactEmail = contactEmail
self.formOfEmployment = formOfEmployment
self.gsmAuthenticationScore = gsmAuthenticationScore
self.introduce = introduce
self.languageCertificate = languageCertificate
self.languageCertificates = languageCertificates
self.major = major
self.militaryService = militaryService
self.portfolioURL = portfolioURL
self.profileImgURL = profileImgURL
self.region = region
self.regions = regions
self.salary = salary
self.techStack = techStack
self.techStacks = techStacks
self.projects = projects
self.prizes = prizes
}

enum CodingKeys: String, CodingKey {
case certificate
case certificates
case contactEmail
case formOfEmployment
case gsmAuthenticationScore
case introduce
case languageCertificate
case languageCertificates
case major
case militaryService
case portfolioURL = "portfolioUrl"
case profileImgURL = "profileImgUrl"
case region
case regions
case salary
case techStack
case techStacks
case projects
case prizes
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ public struct SingleStudentEntity: Equatable {
public let profileImageURL: String
public let name: String
public let major: String
public let techStack: [String]
public let techStacks: [String]

public init(id: String, profileImageURL: String, name: String, major: String, techStack: [String]) {
public init(id: String, profileImageURL: String, name: String, major: String, techStacks: [String]) {
self.id = id
self.profileImageURL = profileImageURL
self.name = name
self.major = major
self.techStack = techStack
self.techStacks = techStacks
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ public struct FetchStudentDetailByGuestResponseDTO: Decodable {
public let introduce: String
public let major: String
public let profileImg: String
public let techStack: [String]
public let techStacks: [String]
public let projects: [ProjectResponseDTO]
public let prizes: [PrizeResponseDTO]

Expand All @@ -15,15 +15,15 @@ public struct FetchStudentDetailByGuestResponseDTO: Decodable {
introduce: String,
major: String,
profileImg: String,
techStack: [String],
techStacks: [String],
projects: [ProjectResponseDTO],
prizes: [PrizeResponseDTO]
) {
self.name = name
self.introduce = introduce
self.major = major
self.profileImg = profileImg
self.techStack = techStack
self.techStacks = techStacks
self.projects = projects
self.prizes = prizes
}
Expand All @@ -36,7 +36,7 @@ public extension FetchStudentDetailByGuestResponseDTO {
introduce: introduce,
major: major,
profileImageURL: profileImg,
techStacks: techStack,
techStacks: techStacks,
projects: projects.map { $0.toDomain() },
prizes: prizes.map { $0.toDomain() }
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public struct FetchStudentDetailByStudentResponseDTO: Decodable {
public let department: DepartmentType
public let major: String
public let profileImg: String
public let techStack: [String]
public let techStacks: [String]
public let projects: [ProjectResponseDTO]
public let prizes: [PrizeResponseDTO]
}
Expand All @@ -22,7 +22,7 @@ public extension FetchStudentDetailByStudentResponseDTO {
introduce: introduce,
major: major,
profileImageURL: profileImg,
techStacks: techStack,
techStacks: techStacks,
projects: projects.map { $0.toDomain() },
prizes: prizes.map { $0.toDomain() },
detailInfoByStudent: .init(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public struct FetchStudentListResponseDTO: Decodable {
public let profileImg: String
public let name: String
public let major: String
public let techStack: [String]
public let techStacks: [String]
}

enum CodingKeys: String, CodingKey {
Expand All @@ -27,7 +27,7 @@ public extension FetchStudentListResponseDTO.SingleStudentResponseDTO {
profileImageURL: profileImg,
name: name,
major: major,
techStack: techStack
techStacks: techStacks
)
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
//
// InputInformationUseCaseSpy.swift
// StudentDomainTesting
//
// Created by sunghun on 8/17/23.
// Copyright © 2023 com.msg. All rights reserved.
//
import StudentDomainInterface

import Foundation
final class InputInformationUseCaseSpy: InputInformationUseCase {
var executeCallCount = 0
func execute(req: InputStudentInformationRequestDTO) async throws {
executeCallCount += 1
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import Foundation

public struct FetchTechStackListResponseDTO: Decodable {
public let techStack: [String]
public let techStacks: [String]

public init(techStack: [String]) {
self.techStack = techStack
public init(techStacks: [String]) {
self.techStacks = techStacks
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ final class RemoteTechStackDataSourceImpl:
RemoteTechStackDataSource {
func fetchTechStackList(keyword: String) async throws -> [String] {
try await request(.fetchTechStackList(keyword: keyword), dto: FetchTechStackListResponseDTO.self)
.techStack
.techStacks
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,27 @@ struct FetchMyProfileResponseDTO: Decodable {
let languageCertificates: [LanguageCertificateResponseDTO]
let certificates: [String]
let techStacks: [String]

enum CodingKeys: String, CodingKey {
case name
case introduce
case portfolioURL = "portfolioUrl"
case grade
case classNum
case number
case department
case major
case profileImageURL = "profileImg"
case contactEmail
case gsmAuthenticationScore
case formOfEmployment
case regions
case militaryService
case salary
case languageCertificates
case certificates
case techStacks
}
}

extension FetchMyProfileResponseDTO {
Expand Down

0 comments on commit 05fc3d7

Please sign in to comment.