diff --git a/.DS_Store b/.DS_Store index 45d21ae..970b22e 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/ars/docker-compose.dev.yaml b/ars/docker-compose.dev.yaml index cd67f2a..5d69b1b 100644 --- a/ars/docker-compose.dev.yaml +++ b/ars/docker-compose.dev.yaml @@ -2,14 +2,17 @@ version: '3.3' services: my_backend: + platform: linux/x86_64 + image: asia.gcr.io/artiful-a1/my_backend:1.9 build: context: . dockerfile: Dockerfile + env_file: + - ./.env.dev ports: - 3000:3000 volumes: - ./src:/myfolder/src - - ./.env:/myfolder/.env my_database: platform: linux/x86_64 diff --git a/ars/elk/logstash/logstash.conf b/ars/elk/logstash/logstash.conf index 7013835..12f440a 100644 --- a/ars/elk/logstash/logstash.conf +++ b/ars/elk/logstash/logstash.conf @@ -13,7 +13,7 @@ input { last_run_metadata_path => "./aaa.txt" tracking_column_type => "numeric" - statement => "select art.id, title, start_price, instant_bid, price, thumbnail, createdAt, deadline, tag1, tag2, tag3, tag4, updatedat, u.nickname, unix_timestamp(art.updatedat) as updatedat from art left join user as u ON art.userId = u.id where unix_timestamp(art.updatedat) > :sql_last_value order by updatedat asc" + statement => "select art.id, title, start_price, instant_bid, thumbnail, createdAt, deadline, tag1, tag2, tag3, tag4, updatedat, u.nickname, unix_timestamp(art.updatedat) as updatedat from art left join user as u ON art.userId = u.id where unix_timestamp(art.updatedat) > :sql_last_value order by updatedat asc" } } diff --git a/ars/src/apis/art/art.resolver.ts b/ars/src/apis/art/art.resolver.ts index 1d0ab90..5d71497 100644 --- a/ars/src/apis/art/art.resolver.ts +++ b/ars/src/apis/art/art.resolver.ts @@ -41,6 +41,8 @@ export class ArtResolver { const result = await this.elasticsearchService.search({ index: 'artipul09', + from: 0, + size: 500, query: { bool: { must: [{ match: { tag1: tags[0] } }], @@ -56,7 +58,6 @@ export class ArtResolver { title: el._source.title, start_price: el._source.start_price, instant_bid: el._source.instant_bid, - price: el._source.price, deadline: el._source.deadline, thumbnail: el._source.thumbnail, tag1: el._source.tag1, @@ -79,6 +80,8 @@ export class ArtResolver { const result = await this.elasticsearchService.search({ index: 'artipul09', + from: 0, + size: 500, query: { bool: { must: [{ match: { tag1: tags[0] } }, { match: { tag2: tags[1] } }], @@ -94,7 +97,6 @@ export class ArtResolver { title: el._source.title, start_price: el._source.start_price, instant_bid: el._source.instant_bid, - price: el._source.price, deadline: el._source.deadline, thumbnail: el._source.thumbnail, tag1: el._source.tag1, @@ -118,6 +120,8 @@ export class ArtResolver { const result = await this.elasticsearchService.search({ index: 'artipul09', + from: 0, + size: 500, query: { bool: { must: [ @@ -132,12 +136,12 @@ export class ArtResolver { if (!result.hits.hits.length) return null; const artTags = result.hits.hits.map((el: any) => { + console.log('=======', el); return { id: el._source.id, title: el._source.title, start_price: el._source.start_price, instant_bid: el._source.instant_bid, - price: el._source.price, deadline: el._source.deadline, thumbnail: el._source.thumbnail, tag1: el._source.tag1, @@ -162,6 +166,8 @@ export class ArtResolver { const result = await this.elasticsearchService.search({ index: 'artipul09', + from: 0, + size: 500, query: { bool: { must: [ @@ -182,7 +188,6 @@ export class ArtResolver { title: el._source.title, start_price: el._source.start_price, instant_bid: el._source.instant_bid, - price: el._source.price, deadline: el._source.deadline, thumbnail: el._source.thumbnail, tag1: el._source.tag1, diff --git a/ars/src/apis/art/art.service.ts b/ars/src/apis/art/art.service.ts index 994db75..7963b05 100644 --- a/ars/src/apis/art/art.service.ts +++ b/ars/src/apis/art/art.service.ts @@ -34,9 +34,7 @@ export class ArtService { tag2: tags[1], tag3: tags[2], tag4: tags[3], - createdAt: MoreThan(createdAt), }, - order: { createdAt: 'ASC' }, }); break; case 3: @@ -45,9 +43,7 @@ export class ArtService { tag1: tags[0], tag2: tags[1], tag3: tags[2], - createdAt: MoreThan(createdAt), }, - order: { createdAt: 'ASC' }, }); break; case 2: @@ -55,18 +51,14 @@ export class ArtService { where: { tag1: tags[0], tag2: tags[1], - createdAt: MoreThan(createdAt), }, - order: { createdAt: 'ASC' }, }); break; case 1: result = await this.artRepository.find({ where: { tag1: tags[0], - createdAt: MoreThan(createdAt), }, - order: { createdAt: 'ASC' }, }); } await queryRunner.commitTransaction(); diff --git a/ars/src/apis/art/dto/createArtInput.ts b/ars/src/apis/art/dto/createArtInput.ts index 55ed12b..860beed 100644 --- a/ars/src/apis/art/dto/createArtInput.ts +++ b/ars/src/apis/art/dto/createArtInput.ts @@ -17,7 +17,7 @@ export class CreateArtInput { @Field(() => Int) price: number; - @Field(() => Date) + @Field(() => Date, { nullable: true }) deadline: Date; @Field(() => [String]) @@ -28,16 +28,4 @@ export class CreateArtInput { @Field(() => [String]) tags: string[]; - - // @Field(() => String) - // tag1: string; - - // @Field(() => String, { nullable: true }) - // tag2?: string; - - // @Field(() => String, { nullable: true }) - // tag3?: string; - - // @Field(() => String, { nullable: true }) - // tag4?: string; } diff --git a/ars/src/apis/art/entities/artsSearch.entity.ts b/ars/src/apis/art/entities/artsSearch.entity.ts index bff902b..dd97da2 100644 --- a/ars/src/apis/art/entities/artsSearch.entity.ts +++ b/ars/src/apis/art/entities/artsSearch.entity.ts @@ -29,8 +29,8 @@ export class ArtsSearch { thumbnail: string; @Column() - @Field(() => Date) - deadline: Date; + @Field(() => String, { nullable: true }) + deadline: string; @Column() @Field(() => String) diff --git a/ars/src/app.module.ts b/ars/src/app.module.ts index 3affd5c..21ad61a 100644 --- a/ars/src/app.module.ts +++ b/ars/src/app.module.ts @@ -47,6 +47,7 @@ import { PaymentModule } from './apis/payment/payment.module'; entities: [__dirname + '/apis/**/*.entity.*'], synchronize: true, logging: true, + timezone: 'Asia/seoul', }), CacheModule.register({ store: redisStore, diff --git a/ars/src/common/graphql/schema.gql b/ars/src/common/graphql/schema.gql index 291b22d..8b41179 100644 --- a/ars/src/common/graphql/schema.gql +++ b/ars/src/common/graphql/schema.gql @@ -103,7 +103,7 @@ type ArtsSearch { instant_bid: Int! price: Int! thumbnail: String! - deadline: DateTime! + deadline: String tag1: String! tag2: String tag3: String @@ -203,7 +203,7 @@ input CreateArtInput { start_price: Int! instant_bid: Int! price: Int! - deadline: DateTime! + deadline: DateTime image_urls: [String!]! is_soldout: Boolean! tags: [String!]!