From ec8858e6f62d04bbe462d688eb27650520c74c85 Mon Sep 17 00:00:00 2001 From: niamu01 Date: Tue, 9 Jul 2024 22:22:02 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20:recycle:=20where42All=20api?= =?UTF-8?q?=EC=9D=98=20=EB=B0=98=ED=99=98=EA=B0=92=20=ED=83=80=EC=9E=85=20?= =?UTF-8?q?=EC=83=88=EB=A1=9C=EC=9A=B4=20=EC=9A=94=EC=B2=AD=EB=8C=80?= =?UTF-8?q?=EB=A1=9C=20=EB=B3=80=ED=99=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/enums/cluster.enum.ts | 2 +- src/external/where42/dto/where42.response.dto.ts | 6 ------ src/external/where42/where42.service.ts | 11 +++-------- 3 files changed, 4 insertions(+), 15 deletions(-) diff --git a/src/enums/cluster.enum.ts b/src/enums/cluster.enum.ts index 37fb24f..398f655 100644 --- a/src/enums/cluster.enum.ts +++ b/src/enums/cluster.enum.ts @@ -3,6 +3,6 @@ */ enum Cluster { GAEPO = 'GAEPO', - SEOCHO = 'SEOCHO', + //SEOCHO = 'SEOCHO', } export default Cluster; diff --git a/src/external/where42/dto/where42.response.dto.ts b/src/external/where42/dto/where42.response.dto.ts index 2a40b1d..c6ae656 100644 --- a/src/external/where42/dto/where42.response.dto.ts +++ b/src/external/where42/dto/where42.response.dto.ts @@ -22,10 +22,4 @@ export class Where42ResponseDto { example: Cluster.GAEPO, }) cluster: Cluster; - - @ApiProperty({ - description: '마지막으로 태깅한 시간', - type: Date, - }) - tag_at: Date; } diff --git a/src/external/where42/where42.service.ts b/src/external/where42/where42.service.ts index 7192200..20dec18 100644 --- a/src/external/where42/where42.service.ts +++ b/src/external/where42/where42.service.ts @@ -7,12 +7,12 @@ import { Logger, Post, } from '@nestjs/common'; +import Cluster from 'src/enums/cluster.enum'; import { ITagLogRepository } from 'src/tag-log/repository/interface/tag-log-repository.interface'; import { IdLoginDto } from 'src/user/dto/id-login.dto'; import { UserService } from 'src/user/user.service'; import { Where42ResponseDto } from './dto/where42.response.dto'; import { IDeviceInfoRepository } from './repository/interface/device-info.repository.interface'; -import Cluster from 'src/enums/cluster.enum'; @Injectable() export class Where42Service { @@ -56,13 +56,11 @@ export class Where42Service { login, inoutState: device.inoutState, cluster: device.cluster, - tag_at: last.tag_at, }; } @Post('where42All') async where42All(@Body() logins: string[]): Promise { - // todo: Where42ResponseDto의 inoutState, tag_at은 사라질 예정입니다. const res: Where42ResponseDto[] = []; const users = await this.userService.findUsersByLogins(logins); @@ -103,8 +101,7 @@ export class Where42Service { res.push({ login, inoutState: null, - cluster: Cluster.GAEPO, - tag_at: last.tag_at, + cluster: device.cluster, }); return; } @@ -112,8 +109,7 @@ export class Where42Service { res.push({ login, inoutState: device.inoutState, - cluster: Cluster.GAEPO, - tag_at: last.tag_at, + cluster: device.cluster, }); } catch (e) { this.logger.error(`정상적인 조회가 아님: ${login}`); @@ -121,7 +117,6 @@ export class Where42Service { login, inoutState: null, cluster: Cluster.GAEPO, - tag_at: new Date(), }); } }),