forked from yy0ung/nibobnebob
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: GeunH <[email protected]>
- Loading branch information
Showing
20 changed files
with
627 additions
and
359 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,18 @@ | ||
import { LocationDto } from "./location.dto"; | ||
|
||
export class FilterInfoDto { | ||
filter: string; | ||
filter: string; | ||
|
||
latitude: number; | ||
latitude: number; | ||
|
||
longitude: number; | ||
longitude: number; | ||
|
||
radius: number; | ||
radius: number; | ||
|
||
constructor( | ||
filter: string, | ||
location: LocationDto | ||
) { | ||
this.filter = filter; | ||
this.latitude = location.latitude ? parseFloat(location.latitude) : null; | ||
this.longitude = location.longitude ? parseFloat(location.longitude) : null; | ||
this.radius = location.radius ? parseInt(location.radius) : 500000; | ||
} | ||
} | ||
constructor(filter: string, location: LocationDto) { | ||
this.filter = filter; | ||
this.latitude = location.latitude ? parseFloat(location.latitude) : null; | ||
this.longitude = location.longitude ? parseFloat(location.longitude) : null; | ||
this.radius = location.radius ? parseInt(location.radius) : 500000; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
import { IsString, IsNumberString, IsOptional } from 'class-validator'; | ||
import { IsString, IsNumberString, IsOptional } from "class-validator"; | ||
|
||
export class LocationDto { | ||
@IsNumberString({}, { message: 'Latitude must be a valid number.' }) | ||
@IsOptional() | ||
latitude: string; | ||
@IsNumberString({}, { message: "Latitude must be a valid number." }) | ||
@IsOptional() | ||
latitude: string; | ||
|
||
@IsNumberString({}, { message: 'Longitude must be a valid number.' }) | ||
@IsOptional() | ||
longitude: string; | ||
@IsNumberString({}, { message: "Longitude must be a valid number." }) | ||
@IsOptional() | ||
longitude: string; | ||
|
||
@IsNumberString({}, { message: 'Radius must be a valid number.' }) | ||
@IsOptional() | ||
radius: string; | ||
} | ||
@IsNumberString({}, { message: "Radius must be a valid number." }) | ||
@IsOptional() | ||
radius: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,18 @@ | ||
import { LocationDto } from "./location.dto"; | ||
|
||
export class SearchInfoDto { | ||
partialName: string; | ||
partialName: string; | ||
|
||
latitude: number; | ||
latitude: number; | ||
|
||
longitude: number; | ||
longitude: number; | ||
|
||
radius: number; | ||
radius: number; | ||
|
||
constructor( | ||
partialName: string, | ||
location: LocationDto | ||
) { | ||
this.partialName = partialName; | ||
this.latitude = location.latitude ? parseFloat(location.latitude) : null; | ||
this.longitude = location.longitude ? parseFloat(location.longitude) : null; | ||
this.radius = location.radius ? parseInt(location.radius) : 500000; | ||
} | ||
} | ||
constructor(partialName: string, location: LocationDto) { | ||
this.partialName = partialName; | ||
this.latitude = location.latitude ? parseFloat(location.latitude) : null; | ||
this.longitude = location.longitude ? parseFloat(location.longitude) : null; | ||
this.radius = location.radius ? parseInt(location.radius) : 500000; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.