-
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.
Merge pull request #62 from YAPP-Github/TNT-213-TrainerTraineeList
[TNT-213] ํธ๋ ์ด๋ ํ์๋ชฉ๋ก ํ์ด์ง ์์ฑ
- Loading branch information
Showing
12 changed files
with
409 additions
and
1 deletion.
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
59 changes: 59 additions & 0 deletions
59
TnT/Projects/Domain/Sources/DTO/Trainer/GetMembersListDTO.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 |
---|---|---|
@@ -0,0 +1,59 @@ | ||
// | ||
// GetMembersListDTO.swift | ||
// Domain | ||
// | ||
// Created by ๋ฐ์์ฐ on 2/8/25. | ||
// Copyright ยฉ 2025 yapp25thTeamTnT. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
/// ํธ๋ ์ด๋ ํ์ ์กฐํ DTO | ||
public struct GetMembersListDTO: Decodable { | ||
/// ์ด๋ฆ | ||
public let name: String | ||
/// ์ด๋ฉ์ผ | ||
public let email: String | ||
/// ํ๋กํ ์ฌ์ง | ||
public let profileImageUrl: String | ||
/// ์๋ ์์ผ | ||
public let birthday: String? | ||
/// ์ ์ ํ์ (ํธ๋ ์ด๋/ํธ๋ ์ด๋) | ||
public let memberType: String | ||
/// ์์ ๋ก๊ทธ์ธ ํ์ | ||
public let socialType: String | ||
/// ๊ด๋ฆฌ์ค์ธ ํ์์ ์ | ||
public let managementMember: Int | ||
/// ํจ๊ปํ๋ ํ์์ ์ | ||
public let fellowMember: Int | ||
/// ํธ๋ ์ด๋ ID | ||
public let trainerId: String | ||
/// ํธ๋ ์ด๋ ํค | ||
public let height: Double? | ||
/// ํธ๋ ์ด๋ ๋ฌด๊ฒ | ||
public let weight: Double? | ||
/// ์ฃผ์์ฌํญ | ||
public let cautionNote: String? | ||
/// PT ๋ชฉํ | ||
public let goalContents: [String] | ||
} | ||
|
||
public extension GetMembersListDTO { | ||
public static func toEntity(resEntity: GetMembersListDTO) -> GetMembersListEntity { | ||
return GetMembersListEntity( | ||
name: resEntity.name, | ||
email: resEntity.email, | ||
profileImageUrl: resEntity.profileImageUrl, | ||
birthday: resEntity.birthday ?? "", | ||
memberType: resEntity.memberType, | ||
socialType: resEntity.socialType, | ||
managementMember: resEntity.managementMember, | ||
fellowMember: resEntity.fellowMember, | ||
trainerId: resEntity.trainerId, | ||
height: resEntity.height ?? 0.0, | ||
weight: resEntity.weight ?? 0.0, | ||
cautionNote: resEntity.cautionNote ?? "", | ||
goalContents: resEntity.goalContents | ||
) | ||
} | ||
} |
92 changes: 92 additions & 0 deletions
92
TnT/Projects/Domain/Sources/Entity/GetMembersListEntity.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 |
---|---|---|
@@ -0,0 +1,92 @@ | ||
// | ||
// GetMembersListEntity.swift | ||
// Domain | ||
// | ||
// Created by ๋ฐ์์ฐ on 2/8/25. | ||
// Copyright ยฉ 2025 yapp25thTeamTnT. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
/// ํธ๋ ์ด๋ ํ์ ์กฐํ DTO | ||
public struct GetMembersListEntity: Encodable, Equatable { | ||
/// ID ๊ฐ ํ์ฉ์ ์ํ ์ถ๊ฐ | ||
public let id: String | ||
/// ์ด๋ฆ | ||
public let name: String | ||
/// ์ด๋ฉ์ผ | ||
public let email: String | ||
/// ํ๋กํ ์ฌ์ง | ||
public let profileImageUrl: String | ||
/// ์๋ ์์ผ | ||
public let birthday: String? | ||
/// ์ ์ ํ์ (ํธ๋ ์ด๋/ํธ๋ ์ด๋) | ||
public let memberType: String | ||
/// ์์ ๋ก๊ทธ์ธ ํ์ | ||
public let socialType: String | ||
/// ๊ด๋ฆฌ์ค์ธ ํ์์ ์ | ||
public let managementMember: Int | ||
/// ํจ๊ปํ๋ ํ์์ ์ | ||
public let fellowMember: Int | ||
/// ํธ๋ ์ด๋ ID | ||
public let trainerId: String | ||
/// ํธ๋ ์ด๋ ํค | ||
public let height: Double? | ||
/// ํธ๋ ์ด๋ ๋ฌด๊ฒ | ||
public let weight: Double? | ||
/// ์ฃผ์์ฌํญ | ||
public let cautionNote: String? | ||
/// PT ๋ชฉํ | ||
public let goalContents: [String] | ||
|
||
public init( | ||
id: String = UUID().uuidString, | ||
name: String, | ||
email: String, | ||
profileImageUrl: String, | ||
birthday: String?, | ||
memberType: String, | ||
socialType: String, | ||
managementMember: Int, | ||
fellowMember: Int, | ||
trainerId: String, | ||
height: Double?, | ||
weight: Double?, | ||
cautionNote: String?, | ||
goalContents: [String] | ||
) { | ||
self.id = id | ||
self.name = name | ||
self.email = email | ||
self.profileImageUrl = profileImageUrl | ||
self.birthday = birthday | ||
self.memberType = memberType | ||
self.socialType = socialType | ||
self.managementMember = managementMember | ||
self.fellowMember = fellowMember | ||
self.trainerId = trainerId | ||
self.height = height | ||
self.weight = weight | ||
self.cautionNote = cautionNote | ||
self.goalContents = goalContents | ||
} | ||
} | ||
|
||
extension GetMembersListEntity { | ||
static func toDTO(entity: GetMembersListEntity) -> GetMembersListDTO { | ||
return GetMembersListDTO( | ||
name: entity.name, | ||
email: entity.email, | ||
profileImageUrl: entity.profileImageUrl, | ||
birthday: entity.birthday ?? "", | ||
memberType: entity.memberType, | ||
socialType: entity.socialType, | ||
managementMember: entity.managementMember, | ||
fellowMember: entity.fellowMember, | ||
trainerId: entity.trainerId, | ||
height: entity.height ?? 0.0, | ||
weight: entity.weight ?? 0.0, | ||
cautionNote: entity.cautionNote ?? "", | ||
goalContents: entity.goalContents) | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
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,39 @@ | ||
// | ||
// TrainerUseCase.swift | ||
// Domain | ||
// | ||
// Created by ๋ฐ์์ฐ on 2/8/25. | ||
// Copyright ยฉ 2025 yapp25thTeamTnT. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
// MARK: - TrainerUseCase Default ๊ตฌํ์ฒด | ||
public struct DefaultTrainerUseCase: TrainerRepository { | ||
|
||
private let trainerRepository: TrainerRepository | ||
|
||
public init (trainerRepository: TrainerRepository) { | ||
self.trainerRepository = trainerRepository | ||
} | ||
|
||
public func getVerifyInvitationCode(code: String) async throws -> GetVerifyInvitationCodeResDTO { | ||
return try await trainerRepository.getVerifyInvitationCode(code: code) | ||
} | ||
|
||
public func getTheFirstInvitationCode() async throws -> GetTheFirstInvitationCodeDTO { | ||
return try await trainerRepository.getTheFirstInvitationCode() | ||
} | ||
|
||
public func getReissuanceInvitationCode() async throws -> GetReissuanceInvitationCodeDTO { | ||
return try await trainerRepository.getReissuanceInvitationCode() | ||
} | ||
|
||
public func getDateSessionList(date: String) async throws -> GetDateSessionListDTO { | ||
return try await trainerRepository.getDateSessionList(date: date) | ||
} | ||
|
||
public func getMembersList() async throws -> GetMembersListDTO { | ||
return try await trainerRepository.getMembersList() | ||
} | ||
} |
Oops, something went wrong.