File tree Expand file tree Collapse file tree
Domain/Sources/DTO/Category Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ public extension CategoryItemInquiryResponse {
3232 contentCount: self . contentCount,
3333 createdAt: self . createdAt,
3434 openType: BaseOpenType ( rawValue: self . openType) ?? . 비공개,
35- keywordType: BaseInterestType ( rawValue: self . keywordType) ?? . default,
35+ keywordType: BaseInterestType ( rawValue: self . keywordType. slashConvertUnderBar ) ?? . default,
3636 userCount: self . userCount
3737 )
3838 }
Original file line number Diff line number Diff line change 55// Created by 김민호 on 1/6/25.
66//
77
8- public enum BaseInterestType : String {
8+ public enum BaseInterestType : String , CaseIterable {
99 case `default`
1010 case 스포츠_레저
1111 case 문구_오피스
@@ -23,9 +23,19 @@ public enum BaseInterestType: String {
2323 case 취업정보
2424
2525 public var title : String {
26- if self . rawValue. contains ( " _ " ) {
27- return self . rawValue. replacingOccurrences ( of: " _ " , with: " / " )
26+ switch self {
27+ case . 경제_시사: return " 경제/시사 "
28+ case . 스포츠_레저: return " 스포츠/레저 "
29+ case . 영화_드라마: return " 영화/드라마 "
30+ case . 문구_오피스: return " 문구/오피스 "
31+
32+ default : return self . rawValue
2833 }
29- return self . rawValue
34+ }
35+ }
36+
37+ public extension String {
38+ var slashConvertUnderBar : String {
39+ return self . replacingOccurrences ( of: " / " , with: " _ " )
3040 }
3141}
You can’t perform that action at this time.
0 commit comments