From 4732ce484466a32790d562284bf9cb757702ea6d Mon Sep 17 00:00:00 2001 From: SeungGwa123 Date: Tue, 19 Nov 2024 20:51:32 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20http=20=EC=9D=91=EB=8B=B5=EA=B0=92?= =?UTF-8?q?=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/server/src/trade/trade-ask.service.ts | 8 ++++---- packages/server/src/trade/trade-bid.service.ts | 10 +++++----- packages/server/src/trade/trade.service.ts | 6 +++--- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/server/src/trade/trade-ask.service.ts b/packages/server/src/trade/trade-ask.service.ts index 7e4222dd..614f092a 100644 --- a/packages/server/src/trade/trade-ask.service.ts +++ b/packages/server/src/trade/trade-ask.service.ts @@ -58,7 +58,7 @@ export class AskService implements OnModuleInit { if (!userAccount) { throw new UnprocessableEntityException({ message: '유저가 존재하지 않습니다.', - code: 422, + statusCode: 422, }); } @@ -66,7 +66,7 @@ export class AskService implements OnModuleInit { await queryRunner.commitTransaction(); return { - code: 200, + statusCode: 200, message: '거래가 정상적으로 등록되었습니다.', }; } catch (error) { @@ -74,7 +74,7 @@ export class AskService implements OnModuleInit { await queryRunner.rollbackTransaction(); if (error instanceof UnprocessableEntityException) throw error; return new UnprocessableEntityException({ - code: 422, + statusCode: 422, message: '거래 등록에 실패했습니다.', }); } finally { @@ -141,7 +141,7 @@ export class AskService implements OnModuleInit { } return { - code: 200, + statusCode: 200, message: '거래가 정상적으로 등록되었습니다.', }; } catch (error) { diff --git a/packages/server/src/trade/trade-bid.service.ts b/packages/server/src/trade/trade-bid.service.ts index 37f531a9..efcfc905 100644 --- a/packages/server/src/trade/trade-bid.service.ts +++ b/packages/server/src/trade/trade-bid.service.ts @@ -50,7 +50,7 @@ export class BidService implements OnModuleInit { if (!userAccount) { throw new UnprocessableEntityException({ message: '유저가 존재하지 않습니다.', - code: 422, + statusCode: 422, }); } const accountBalance = await this.checkCurrency(user, bidDto); @@ -63,7 +63,7 @@ export class BidService implements OnModuleInit { await this.tradeRepository.createTrade(bidDto, user.userId, 'buy', queryRunner); await queryRunner.commitTransaction(); return { - code: 200, + statusCode: 200, message: '거래가 정상적으로 등록되었습니다.', }; } catch (error) { @@ -71,7 +71,7 @@ export class BidService implements OnModuleInit { await queryRunner.rollbackTransaction(); if (error instanceof UnprocessableEntityException) throw error; return new UnprocessableEntityException({ - code: 422, + statusCode: 422, message: '거래 등록에 실패했습니다.', }); } finally { @@ -93,7 +93,7 @@ export class BidService implements OnModuleInit { if (accountResult < 0){ throw new UnprocessableEntityException({ message: '자산이 부족합니다.', - code: 422, + statusCode: 422, }); } return accountResult; @@ -128,7 +128,7 @@ export class BidService implements OnModuleInit { } return { - code: 200, + statusCode: 200, message: '거래가 정상적으로 등록되었습니다.', }; } catch (error) { diff --git a/packages/server/src/trade/trade.service.ts b/packages/server/src/trade/trade.service.ts index 751c8834..36a7d24b 100644 --- a/packages/server/src/trade/trade.service.ts +++ b/packages/server/src/trade/trade.service.ts @@ -25,7 +25,7 @@ export class TradeService { }) if(!account) { return { - code :400, + statusCode :400, message: "등록되지 않은 사용자입니다." } } @@ -37,12 +37,12 @@ export class TradeService { }) if(coinData){ return { - code : 200, + statusCode : 200, message: "보유하고 계신 코인입니다." } }else{ return { - code : 422, + statusCode : 422, message : "보유하지 않은 코인입니다." } }