From e173eef44047b8f2ca4c5f18f348ca78fe9049be Mon Sep 17 00:00:00 2001 From: kim jong hwa Date: Thu, 26 Oct 2023 18:40:57 +0900 Subject: [PATCH 1/2] =?UTF-8?q?[=EC=9E=91=EC=97=85=EC=99=84=EB=A3=8C]:=20?= =?UTF-8?q?=EC=9D=B4=EB=B2=A4=ED=8A=B8=20=EB=AA=A8=EB=8D=B8=20=EC=88=98?= =?UTF-8?q?=EC=A0=95,=20=EC=9D=B4=EB=B2=A4=ED=8A=B8=20dto=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- prisma/schema.prisma | 3 ++- src/data/interface/city.ts | 9 ++++++--- src/events/dto/create-event.dto.ts | 12 ++++++++++-- src/events/entities/event.entity.ts | 8 +++++--- src/searches/searches.service.ts | 2 +- 5 files changed, 24 insertions(+), 10 deletions(-) diff --git a/prisma/schema.prisma b/prisma/schema.prisma index bd2958b..4284cac 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -56,7 +56,8 @@ model Event { signupStartDate DateTime signupEndDate DateTime eventImg String? - eventLocation String + location_City String + location_District String content String category String isVerified String? diff --git a/src/data/interface/city.ts b/src/data/interface/city.ts index cc4cdd2..899c521 100644 --- a/src/data/interface/city.ts +++ b/src/data/interface/city.ts @@ -2,6 +2,7 @@ export const city = [ { lang: 'ko', items: [ + { doName: '시 / 도'}, { doName: '서울특별시' }, { doName: '부산광역시' }, { doName: '대구광역시' }, @@ -18,12 +19,13 @@ export const city = [ { doName: '전라남도' }, { doName: '경상북도' }, { doName: '경상남도' }, - { doName: '제주특별자치시' }, + { doName: '제주특별자치도' }, ], }, { lang: 'jp', items: [ + { doName: "市 / 道"}, { doName: 'ソウル特別市' }, { doName: '釜山広域市' }, { doName: '大邱広域市' }, @@ -46,6 +48,7 @@ export const city = [ { lang: 'en', items: [ + { doName: 'City / Province'}, { doName: 'Seoul Special City' }, { doName: 'Busan Metropolitan City' }, { doName: 'Daegu Metropolitan City' }, @@ -68,6 +71,6 @@ export const city = [ ]; export const filter = { - category: ['☕맛집/커피', '🏃‍♂️운동/건강', '🐾애완동물', '📕공부/교육'], - verify: ['🙋‍♀️아무나', '🏡동네만'], + category: ['선택','☕맛집/커피', '🏃‍♂️운동/건강', '🐾애완동물', '📕공부/교육'], + verify: ['선택','🙋‍♀️아무나', '🏡동네만'], }; diff --git a/src/events/dto/create-event.dto.ts b/src/events/dto/create-event.dto.ts index f9e867f..2ec1a0f 100644 --- a/src/events/dto/create-event.dto.ts +++ b/src/events/dto/create-event.dto.ts @@ -1,4 +1,5 @@ import { ApiProperty } from '@nestjs/swagger'; +import { Event } from '@prisma/client'; import { IsString, IsInt, @@ -9,7 +10,7 @@ import { Min, } from 'class-validator'; -export class CreateEventDto { +export class CreateEventDto { @IsString() @IsNotEmpty() @ApiProperty({ @@ -43,7 +44,14 @@ export class CreateEventDto { @ApiProperty({ example: '서울특별시', }) - eventLocation: string; + location_City: string; + + @IsString() + @IsNotEmpty() + @ApiProperty({ + example: '종로구', + }) + location_District: string; @IsString() @IsNotEmpty() diff --git a/src/events/entities/event.entity.ts b/src/events/entities/event.entity.ts index a4c75eb..49caad9 100644 --- a/src/events/entities/event.entity.ts +++ b/src/events/entities/event.entity.ts @@ -1,7 +1,6 @@ import { ApiProperty } from '@nestjs/swagger'; -import { Event } from '@prisma/client'; -export class EventEntity implements Event { +export class EventEntity { @ApiProperty() eventId: number; @@ -21,7 +20,10 @@ export class EventEntity implements Event { signupEndDate: Date; @ApiProperty() - eventLocation: string; + location_City: string; + + @ApiProperty() + location_District: string; @ApiProperty() content: string; diff --git a/src/searches/searches.service.ts b/src/searches/searches.service.ts index d87684c..6c76000 100644 --- a/src/searches/searches.service.ts +++ b/src/searches/searches.service.ts @@ -26,7 +26,7 @@ export class SearchesService { searchByLocation(query: any) { return this.prisma.event.findMany({ - where: { eventLocation: query.doName, isDeleted: false }, + where: { location_City: query.doName, isDeleted: false }, }); } From bbbf88da66e6446eaa29eda00d650d63d4fe7af1 Mon Sep 17 00:00:00 2001 From: kim jong hwa Date: Thu, 26 Oct 2023 18:42:50 +0900 Subject: [PATCH 2/2] =?UTF-8?q?[=EC=9E=91=EC=97=85=EC=99=84=EB=A3=8C]:=20?= =?UTF-8?q?=EC=9D=B4=EB=B2=A4=ED=8A=B8=20dto=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/events/dto/update-event.dto.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/events/dto/update-event.dto.ts b/src/events/dto/update-event.dto.ts index 5ba8734..9c0f7e2 100644 --- a/src/events/dto/update-event.dto.ts +++ b/src/events/dto/update-event.dto.ts @@ -34,8 +34,17 @@ export class UpdateEventDto { @IsString() @IsNotEmpty() - @ApiProperty({ example: '경기도' }) - eventLocation: string; + @ApiProperty({ + example: '서울특별시', + }) + location_City: string; + + @IsString() + @IsNotEmpty() + @ApiProperty({ + example: '마포구', + }) + location_District: string; @IsString() @IsNotEmpty()