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.
feat : restaurant Info dto 및 entity 구현 #35
- Loading branch information
Showing
4 changed files
with
59 additions
and
1 deletion.
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { ApiProperty } from "@nestjs/swagger"; | ||
import { | ||
IsNotEmpty, | ||
IsInt, | ||
} from "class-validator"; | ||
|
||
export class RestaurantInfoDto { | ||
@ApiProperty({ | ||
example: "음식점 id", | ||
description: "The id of the restaurant", | ||
}) | ||
@IsInt() | ||
@IsNotEmpty() | ||
id: number; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn } from 'typeorm'; | ||
|
||
@Entity('restaurant') | ||
export class RestaurantInfoEntity { | ||
@PrimaryGeneratedColumn('increment') | ||
id: number; | ||
|
||
@Column({ type: 'varchar', length: 100 }) | ||
name: string; | ||
|
||
@Column({ | ||
type: 'geometry', | ||
spatialFeatureType: 'Point', | ||
srid: 4326, | ||
nullable: true | ||
}) | ||
location: string | null; | ||
|
||
@Column({ type: 'text', nullable: true }) | ||
address: string | null; | ||
|
||
@Column({ type: 'varchar', length: 20, nullable: true }) | ||
category: string | null; | ||
|
||
@Column({ type: 'int', default: 0 }) | ||
reviewCnt: number; | ||
|
||
@Column({ type: 'varchar', length: 20, nullable: true }) | ||
phoneNumber: string | null; | ||
|
||
@CreateDateColumn({ name: 'created_at' }) | ||
createdAt: Date; | ||
|
||
@Column({ name: 'deleted_at', type: 'timestamp', nullable: true }) | ||
deletedAt: Date | null; | ||
|
||
@UpdateDateColumn({ name: 'updated_at' }) | ||
updatedAt: Date; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import { Module } from '@nestjs/common'; | ||
|
||
@Module({}) | ||
export class RestaurantModule {} |
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