Skip to content

Commit

Permalink
Merge pull request #103 from LocalMingle/dev
Browse files Browse the repository at this point in the history
[작업완료]: 이벤트 모델, dto 수정
  • Loading branch information
kimjonghwa230412 authored Oct 26, 2023
2 parents e58fd9e + d30f2b4 commit b320463
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 11 deletions.
3 changes: 2 additions & 1 deletion prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down
7 changes: 5 additions & 2 deletions src/data/interface/city.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ export const city = [
{
lang: 'ko',
items: [
{ doName: '시 / 도'},
{ doName: '서울특별시' },
{ doName: '부산광역시' },
{ doName: '대구광역시' },
Expand All @@ -24,6 +25,7 @@ export const city = [
{
lang: 'jp',
items: [
{ doName: "市 / 道"},
{ doName: 'ソウル特別市' },
{ doName: '釜山広域市' },
{ doName: '大邱広域市' },
Expand All @@ -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' },
Expand All @@ -68,6 +71,6 @@ export const city = [
];

export const filter = {
category: ['☕맛집/커피', '🏃‍♂️운동/건강', '🐾애완동물', '📕공부/교육'],
verify: ['🙋‍♀️아무나', '🏡동네만'],
category: ['선택','☕맛집/커피', '🏃‍♂️운동/건강', '🐾애완동물', '📕공부/교육'],
verify: ['선택','🙋‍♀️아무나', '🏡동네만'],
};
12 changes: 10 additions & 2 deletions src/events/dto/create-event.dto.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { ApiProperty } from '@nestjs/swagger';
import { Event } from '@prisma/client';
import {
IsString,
IsInt,
Expand All @@ -9,7 +10,7 @@ import {
Min,
} from 'class-validator';

export class CreateEventDto {
export class CreateEventDto {
@IsString()
@IsNotEmpty()
@ApiProperty({
Expand Down Expand Up @@ -43,7 +44,14 @@ export class CreateEventDto {
@ApiProperty({
example: '서울특별시',
})
eventLocation: string;
location_City: string;

@IsString()
@IsNotEmpty()
@ApiProperty({
example: '종로구',
})
location_District: string;

@IsString()
@IsNotEmpty()
Expand Down
13 changes: 11 additions & 2 deletions src/events/dto/update-event.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
8 changes: 5 additions & 3 deletions src/events/entities/event.entity.ts
Original file line number Diff line number Diff line change
@@ -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;

Expand All @@ -21,7 +20,10 @@ export class EventEntity implements Event {
signupEndDate: Date;

@ApiProperty()
eventLocation: string;
location_City: string;

@ApiProperty()
location_District: string;

@ApiProperty()
content: string;
Expand Down
2 changes: 1 addition & 1 deletion src/searches/searches.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
});
}

Expand Down

0 comments on commit b320463

Please sign in to comment.