Skip to content

Commit 7190853

Browse files
committed
[Feat] Presentation AlarmItemEntity extension μž‘μ„±
1 parent a3ab3e7 commit 7190853

File tree

3 files changed

+31
-3
lines changed

3 files changed

+31
-3
lines changed

β€ŽTnT/Projects/Domain/Sources/Policy/TDateFormat.swiftβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ public enum TDateFormat: String {
2020
case yyyyMMddSlash = "yyyy/MM/dd"
2121
/// "yyyy.MM.dd"
2222
case yyyyMMddDot = "yyyy.MM.dd"
23+
/// ""Mμ›” d일"
24+
case Mμ›”_d일 = "Mμ›” d일"
2325
/// "EE"
2426
case EE = "EE"
2527
}

β€ŽTnT/Projects/Domain/Sources/Utility/TDateFormatUtility.swiftβ€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@
88

99
import Foundation
1010

11-
enum TDateFormatUtility {
11+
public enum TDateFormatUtility {
1212
/// `NSCache`λ₯Ό ν™œμš©ν•œ 포맷별 `DateFormatter` 캐싱
1313
private static let cache: NSCache<NSString, DateFormatter> = {
1414
let cache: NSCache = NSCache<NSString, DateFormatter>()
1515
return cache
1616
}()
1717

1818
/// 포맷에 λ§žλŠ” `DateFormatter` λ°˜ν™˜ (μΊμ‹±λœ μΈμŠ€ν„΄μŠ€ μž¬μ‚¬μš©)
19-
static func formatter(for format: TDateFormat) -> DateFormatter {
19+
public static func formatter(for format: TDateFormat) -> DateFormatter {
2020
// μΊμ‹œλœ DateFormatterκ°€ 있으면 λ°˜ν™˜, μ—†μœΌλ©΄ 생성 ν›„ μ €μž₯
2121
if let cachedFormatter = cache.object(forKey: format.rawValue as NSString) {
2222
return cachedFormatter

β€ŽTnT/Projects/Presentation/Sources/PresentationSupport/AlarmItemEntity.swiftβ€Ž

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,30 @@
66
// Copyright Β© 2025 yapp25thTeamTnT. All rights reserved.
77
//
88

9-
import Foundation
9+
import Domain
10+
11+
extension AlarmItemEntity {
12+
/// μ—°κ²° μ™„λ£Œ, μ—°κ²° ν•΄μ œ λ“±
13+
var alarmTypeText: String {
14+
switch self.alarmType {
15+
case .traineeConnected:
16+
return "νŠΈλ ˆμ΄λ‹ˆ μ—°κ²° μ™„λ£Œ"
17+
case .traineeDisconnected:
18+
return "νŠΈλ ˆμ΄λ‹ˆ μ—°κ²° ν•΄μ œ"
19+
case .trainerDisconnected:
20+
return "νŠΈλ ˆμ΄λ„ˆ μ—°κ²° ν•΄μ œ"
21+
}
22+
}
23+
24+
/// μ•ŒλžŒ λ³Έλ¬Έ
25+
var alarmMainText: String {
26+
switch self.alarmType {
27+
case .traineeConnected(let name):
28+
return "\(name) νšŒμ›κ³Ό μ—°κ²°λ˜μ—ˆμ–΄μš”"
29+
case .traineeDisconnected(let name):
30+
return "\(name) νšŒμ›μ΄ 연결을 λŠμ—ˆμ–΄μš”"
31+
case .trainerDisconnected(let name):
32+
return "\(name) νŠΈλ ˆμ΄λ„ˆκ°€ 연결을 λŠμ—ˆμ–΄μš”"
33+
}
34+
}
35+
}

0 commit comments

Comments
Β (0)