-
Notifications
You must be signed in to change notification settings - Fork 0
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
[TNT-210] 트레이너 마이페이지, 홈 캘린더 화면 작성 #54
Changes from all commits
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,12 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "icn_plus_empty.svg", | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// | ||
// GetReissuanceInvitationCodeDTO.swift | ||
// Domain | ||
// | ||
// Created by 박서연 on 2/4/25. | ||
// Copyright © 2025 yapp25thTeamTnT. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
public struct GetReissuanceInvitationCodeDTO: Decodable { | ||
public let trainerId: String | ||
public let invitationCode: String | ||
|
||
public init( | ||
trainerId: String, | ||
invitationCode: String | ||
) { | ||
self.trainerId = trainerId | ||
self.invitationCode = invitationCode | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// | ||
// GetTheFirstInvitationCodeDTO.swift | ||
// Domain | ||
// | ||
// Created by 박서연 on 2/4/25. | ||
// Copyright © 2025 yapp25thTeamTnT. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
/// 트레이너의 최초 연결 코드 | ||
public struct GetTheFirstInvitationCodeDTO: Decodable { | ||
public let invitationCode: String | ||
|
||
public init(invitationCode: String) { | ||
self.invitationCode = invitationCode | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
// | ||
// TrainerHomeResponseDTO.swift | ||
// Domain | ||
// | ||
// Created by 박서연 on 2/4/25. | ||
// Copyright © 2025 yapp25thTeamTnT. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
/// 특정 날짜의 PT 리스트 불러오기 | ||
public struct GetDateSessionListDTO: Decodable { | ||
public let count: Int | ||
public let date: String | ||
public let lessons: [SessonDTO] | ||
|
||
public init( | ||
count: Int, | ||
date: String, | ||
lessons: [SessonDTO] | ||
) { | ||
self.count = count | ||
self.date = date | ||
self.lessons = lessons | ||
} | ||
} | ||
|
||
public struct SessonDTO: Decodable { | ||
public let ptLessonId: String | ||
public let traineeId: String | ||
public let traineeName: String | ||
public let session: Int | ||
public let startTime: String | ||
public let endTime: String | ||
public let isCompleted: Bool | ||
|
||
public init( | ||
ptLessonId: String, | ||
traineeId: String, | ||
traineeName: String, | ||
session: Int, | ||
startTime: String, | ||
endTime: String, | ||
isCompleted: Bool | ||
) { | ||
self.ptLessonId = ptLessonId | ||
self.traineeId = traineeId | ||
self.traineeName = traineeName | ||
self.session = session | ||
self.startTime = startTime | ||
self.endTime = endTime | ||
self.isCompleted = isCompleted | ||
} | ||
} | ||
|
||
public struct GetDateSessionListEntity: Equatable, Encodable { | ||
public let id = UUID().uuidString | ||
public let count: Int | ||
public let date: String | ||
public let lessons: [SessonEntity] | ||
|
||
public init( | ||
count: Int, | ||
date: String, | ||
lessons: [SessonEntity] | ||
) { | ||
self.count = count | ||
self.date = date | ||
self.lessons = lessons | ||
} | ||
} | ||
|
||
public struct SessonEntity: Equatable, Encodable { | ||
public let id = UUID().uuidString | ||
public let ptLessonId: String | ||
Comment on lines
+73
to
+75
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. 여기에서 id는 어떤 역할을 위한걸까요? 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. Foreach에서 id값을 활용하기 위해서입니다! @ViewBuilder
private func RecordList() -> some View {
VStack {
if let record = store.tappedsessionInfo {
ForEach(record.lessons, id: \.id) { record in
SessionCellView(session: record) {
send(.tapSessionCompleted(id: record.ptLessonId))
}
}
} else {
RecordEmptyView()
}
}
.padding(.horizontal, 20)
} 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. 아하 그런거라면 API에서 ResponseDTO -> SessionEntity로 Mapping할 때 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. 😮 그렇네요. 수정해서 반영하고 머지하겠습니다! |
||
public let traineeId: String | ||
public let traineeName: String | ||
public let session: Int | ||
public let startTime: String | ||
public let endTime: String | ||
public var isCompleted: Bool | ||
|
||
public init( | ||
ptLessonId: String, | ||
traineeId: String, | ||
traineeName: String, | ||
session: Int, | ||
startTime: String, | ||
endTime: String, | ||
isCompleted: Bool | ||
) { | ||
self.ptLessonId = ptLessonId | ||
self.traineeId = traineeId | ||
self.traineeName = traineeName | ||
self.session = session | ||
self.startTime = startTime | ||
self.endTime = endTime | ||
self.isCompleted = isCompleted | ||
} | ||
} |
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.
참고용으로 올려드립니다! 아래와 같이 작성하면 조금? 더 편합니다 갠취인것 같아요.