Skip to content

Commit 014dfe3

Browse files
committed
Add price comparison URL to perfume data
1 parent b9e8853 commit 014dfe3

File tree

3 files changed

+21
-6
lines changed

3 files changed

+21
-6
lines changed

src/controllers/definitions/response/perfume.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ type NoteDict = {
6767
* type: array
6868
* items:
6969
* type: string
70+
* priceComparisonUrl:
71+
* type: string
72+
* description: 가격 비교 url
7073
* score:
7174
* type: number
7275
* description: 점수 평균 값
@@ -169,6 +172,7 @@ class PerfumeDetailResponse {
169172
readonly noteType: number;
170173
readonly ingredients: NoteDict;
171174
readonly reviewIdx: number;
175+
readonly priceComparisonUrl: string;
172176
constructor(
173177
perfumeIdx: number,
174178
name: string,
@@ -186,7 +190,8 @@ class PerfumeDetailResponse {
186190
Keywords: string[],
187191
noteType: number,
188192
ingredients: NoteDict,
189-
reviewIdx: number = NO_REVIEW
193+
reviewIdx: number = NO_REVIEW,
194+
priceComparisonUrl?: string
190195
) {
191196
this.perfumeIdx = perfumeIdx;
192197
this.name = name;
@@ -205,6 +210,7 @@ class PerfumeDetailResponse {
205210
this.noteType = noteType;
206211
this.ingredients = ingredients;
207212
this.reviewIdx = reviewIdx;
213+
this.priceComparisonUrl = priceComparisonUrl ?? '';
208214
}
209215

210216
public toString(): string {
@@ -242,7 +248,8 @@ class PerfumeDetailResponse {
242248
perfumeIntegralDTO.keywordList,
243249
perfumeIntegralDTO.noteType,
244250
perfumeIntegralDTO.noteDict,
245-
perfumeIntegralDTO.reviewIdx
251+
perfumeIntegralDTO.reviewIdx,
252+
perfumeIntegralDTO.priceComparisonUrl
246253
);
247254
}
248255
private static convertLongevity(longevity: any): Longevity {

src/data/dto/PerfumeDTO.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ class PerfumeDTO {
88
readonly abundanceRate: number;
99
readonly volumeAndPrice: { [key: string]: number }[];
1010
readonly imageUrl: string;
11+
readonly priceComparisonUrl: string;
1112
readonly Brand: BrandDTO;
1213
constructor(
1314
perfumeIdx: number,
@@ -16,7 +17,8 @@ class PerfumeDTO {
1617
abundanceRate: number,
1718
volumeAndPrice: { [key: string]: number }[],
1819
imageUrl: string,
19-
Brand: BrandDTO
20+
Brand: BrandDTO,
21+
priceComparisonUrl: string
2022
) {
2123
this.perfumeIdx = perfumeIdx;
2224
this.name = name;
@@ -26,6 +28,7 @@ class PerfumeDTO {
2628
this.volumeAndPrice = volumeAndPrice;
2729
this.imageUrl = imageUrl;
2830
this.Brand = Brand;
31+
this.priceComparisonUrl = priceComparisonUrl;
2932
}
3033

3134
public toString(): string {
@@ -40,7 +43,8 @@ class PerfumeDTO {
4043
json.abundanceRate,
4144
json.volumeAndPrice,
4245
json.imageUrl,
43-
BrandDTO.createByJson(json.Brand)
46+
BrandDTO.createByJson(json.Brand),
47+
json.priceComparisonUrl
4448
);
4549
}
4650
}

src/data/dto/PerfumeIntegralDTO.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ class PerfumeIntegralDTO {
4848
readonly noteType: number;
4949
readonly noteDict: NoteDict;
5050
readonly reviewIdx: number;
51+
readonly priceComparisonUrl: string;
5152
constructor(
5253
perfumeIdx: number,
5354
name: string,
@@ -65,7 +66,8 @@ class PerfumeIntegralDTO {
6566
keywordList: string[],
6667
noteType: number,
6768
noteDict: NoteDict,
68-
reviewIdx: number
69+
reviewIdx: number,
70+
priceComparisonUrl: string
6971
) {
7072
this.perfumeIdx = perfumeIdx;
7173
this.name = name;
@@ -84,6 +86,7 @@ class PerfumeIntegralDTO {
8486
this.noteType = noteType;
8587
this.noteDict = noteDict;
8688
this.reviewIdx = reviewIdx;
89+
this.priceComparisonUrl = priceComparisonUrl;
8790
}
8891

8992
public toString(): string {
@@ -142,7 +145,8 @@ class PerfumeIntegralDTO {
142145
json.keywordList,
143146
json.noteType,
144147
json.noteDict,
145-
json.reviewIdx
148+
json.reviewIdx,
149+
json.priceComparisonUrl
146150
);
147151
}
148152
}

0 commit comments

Comments
 (0)