Skip to content

Commit

Permalink
Add price comparison URL to perfume data
Browse files Browse the repository at this point in the history
  • Loading branch information
ChoHadam committed Feb 25, 2024
1 parent b9e8853 commit 014dfe3
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 6 deletions.
11 changes: 9 additions & 2 deletions src/controllers/definitions/response/perfume.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ type NoteDict = {
* type: array
* items:
* type: string
* priceComparisonUrl:
* type: string
* description: 가격 비교 url
* score:
* type: number
* description: 점수 평균 값
Expand Down Expand Up @@ -169,6 +172,7 @@ class PerfumeDetailResponse {
readonly noteType: number;
readonly ingredients: NoteDict;
readonly reviewIdx: number;
readonly priceComparisonUrl: string;
constructor(
perfumeIdx: number,
name: string,
Expand All @@ -186,7 +190,8 @@ class PerfumeDetailResponse {
Keywords: string[],
noteType: number,
ingredients: NoteDict,
reviewIdx: number = NO_REVIEW
reviewIdx: number = NO_REVIEW,
priceComparisonUrl?: string
) {
this.perfumeIdx = perfumeIdx;
this.name = name;
Expand All @@ -205,6 +210,7 @@ class PerfumeDetailResponse {
this.noteType = noteType;
this.ingredients = ingredients;
this.reviewIdx = reviewIdx;
this.priceComparisonUrl = priceComparisonUrl ?? '';
}

public toString(): string {
Expand Down Expand Up @@ -242,7 +248,8 @@ class PerfumeDetailResponse {
perfumeIntegralDTO.keywordList,
perfumeIntegralDTO.noteType,
perfumeIntegralDTO.noteDict,
perfumeIntegralDTO.reviewIdx
perfumeIntegralDTO.reviewIdx,
perfumeIntegralDTO.priceComparisonUrl
);
}
private static convertLongevity(longevity: any): Longevity {
Expand Down
8 changes: 6 additions & 2 deletions src/data/dto/PerfumeDTO.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ class PerfumeDTO {
readonly abundanceRate: number;
readonly volumeAndPrice: { [key: string]: number }[];
readonly imageUrl: string;
readonly priceComparisonUrl: string;
readonly Brand: BrandDTO;
constructor(
perfumeIdx: number,
Expand All @@ -16,7 +17,8 @@ class PerfumeDTO {
abundanceRate: number,
volumeAndPrice: { [key: string]: number }[],
imageUrl: string,
Brand: BrandDTO
Brand: BrandDTO,
priceComparisonUrl: string
) {
this.perfumeIdx = perfumeIdx;
this.name = name;
Expand All @@ -26,6 +28,7 @@ class PerfumeDTO {
this.volumeAndPrice = volumeAndPrice;
this.imageUrl = imageUrl;
this.Brand = Brand;
this.priceComparisonUrl = priceComparisonUrl;
}

public toString(): string {
Expand All @@ -40,7 +43,8 @@ class PerfumeDTO {
json.abundanceRate,
json.volumeAndPrice,
json.imageUrl,
BrandDTO.createByJson(json.Brand)
BrandDTO.createByJson(json.Brand),
json.priceComparisonUrl
);
}
}
Expand Down
8 changes: 6 additions & 2 deletions src/data/dto/PerfumeIntegralDTO.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ class PerfumeIntegralDTO {
readonly noteType: number;
readonly noteDict: NoteDict;
readonly reviewIdx: number;
readonly priceComparisonUrl: string;
constructor(
perfumeIdx: number,
name: string,
Expand All @@ -65,7 +66,8 @@ class PerfumeIntegralDTO {
keywordList: string[],
noteType: number,
noteDict: NoteDict,
reviewIdx: number
reviewIdx: number,
priceComparisonUrl: string
) {
this.perfumeIdx = perfumeIdx;
this.name = name;
Expand All @@ -84,6 +86,7 @@ class PerfumeIntegralDTO {
this.noteType = noteType;
this.noteDict = noteDict;
this.reviewIdx = reviewIdx;
this.priceComparisonUrl = priceComparisonUrl;
}

public toString(): string {
Expand Down Expand Up @@ -142,7 +145,8 @@ class PerfumeIntegralDTO {
json.keywordList,
json.noteType,
json.noteDict,
json.reviewIdx
json.reviewIdx,
json.priceComparisonUrl
);
}
}
Expand Down

0 comments on commit 014dfe3

Please sign in to comment.