Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BE] - 매수/매도, 차트, 기타 api 배포 #93

Merged
merged 93 commits into from
Nov 21, 2024
Merged
Changes from 1 commit
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
1289c93
fix: nginx 설정 적용
SeungGwan123 Nov 14, 2024
37d02d3
chore: 배포용 커밋
SeungGwan123 Nov 14, 2024
e01dd60
chore: nginx https설정 및 배포
SeungGwan123 Nov 14, 2024
9ef2453
chore: nginx client port 변경
SeungGwan123 Nov 14, 2024
cbc3815
chore: nginx 인증서 경로 수정
SeungGwan123 Nov 14, 2024
2692ff5
chore: nginx 인증서 경로 수정
SeungGwan123 Nov 14, 2024
9bf17a6
chore: client url 변경
SeungGwan123 Nov 14, 2024
0563f3b
chore: docker-compose수정
SeungGwan123 Nov 14, 2024
c0f66ad
chore: nginx 수정
SeungGwan123 Nov 14, 2024
348775a
chore: nginx 설정
SeungGwan123 Nov 14, 2024
c4ce8eb
chore: docker-compose 수정
SeungGwan123 Nov 14, 2024
41266b3
chore: docker-compose 수정
SeungGwan123 Nov 14, 2024
1d7b8a1
chore: docker-compose 파일 수정
SeungGwan123 Nov 14, 2024
dfb6796
chore: nginx 설정 변경
SeungGwan123 Nov 14, 2024
48d17f3
chore: nginx 설정 변경
SeungGwan123 Nov 14, 2024
9d227ae
chore: nginx 설정 변경
SeungGwan123 Nov 14, 2024
3995985
chore: nginx 설정 변경
SeungGwan123 Nov 14, 2024
a9c51b8
chore: nginx 설정 변경
SeungGwan123 Nov 14, 2024
94109d9
chore: nginx 설정 변경
SeungGwan123 Nov 14, 2024
a2eb584
chore: nginx 설정 변경
SeungGwan123 Nov 14, 2024
9f19fd6
chore: nginx 설정 변경
SeungGwan123 Nov 14, 2024
26f2a13
chore: nginx 설정 변경
SeungGwan123 Nov 14, 2024
43793e6
chore: nginx 설정 변경
SeungGwan123 Nov 14, 2024
275c1c2
chore: nginx 설정 변경
SeungGwan123 Nov 14, 2024
d36d062
chore: nginx 설정 변경
SeungGwan123 Nov 14, 2024
a082f09
chore: nginx 설정 변경
SeungGwan123 Nov 14, 2024
af1dc68
chore: nginx 설정 변경
SeungGwan123 Nov 14, 2024
786902e
chore: nginx 설정 변경
SeungGwan123 Nov 14, 2024
55e4ee7
chore: nginx 설정 변경
SeungGwan123 Nov 15, 2024
b61640f
chore: nginx 설정 변경
SeungGwan123 Nov 15, 2024
b209aac
chore: nginx 설정 변경
SeungGwan123 Nov 15, 2024
0b3d2a7
chore: nginx 설정 변경
SeungGwan123 Nov 15, 2024
1ae6543
chore: nginx 설정 변경
SeungGwan123 Nov 15, 2024
d48d957
chore: api prefix설정
SeungGwan123 Nov 15, 2024
3cf7323
feat: redis config 작성 및 ssh-tunnel 구조변경
SeongHyeon0409 Nov 16, 2024
d13e98f
chore: redis.config 구조 변경
SeongHyeon0409 Nov 16, 2024
edac18d
refactor: redis module 및 구조 리팩토링
SeongHyeon0409 Nov 16, 2024
854f9e0
fix: 터널링 비동기 문제 fix
SeongHyeon0409 Nov 16, 2024
fb234b5
chore: cicd.yml 수정
SeongHyeon0409 Nov 16, 2024
5a95ec8
chore: redis.mudule.ts. 수정
SeongHyeon0409 Nov 16, 2024
fe7e0f3
chore: redis.config.ts 수정
SeongHyeon0409 Nov 16, 2024
9e4e563
refactor: redis 분리
SeongHyeon0409 Nov 17, 2024
8313fdf
chore : redis.controller.ts 제거
SeongHyeon0409 Nov 17, 2024
c8c5187
feat: 비회원 체험 로그인 개선
SeongHyeon0409 Nov 17, 2024
30b0f65
chore: 불필요한 console.log삭제 및 auth.service 수정
SeongHyeon0409 Nov 17, 2024
197380c
feat: 매수 로직
SeungGwan123 Nov 17, 2024
6f3520e
feat: 매수 로직 수정
SeungGwan123 Nov 17, 2024
ca54572
chore: rebase-merge to dev-be
SeongHyeon0409 Nov 18, 2024
e98b455
chore: 배포용 commit
SeongHyeon0409 Nov 18, 2024
586cccc
chore: lint 적용 및 컨벤션 수정
SeongHyeon0409 Nov 18, 2024
e4b875d
fix: guest_login bug fix
SeongHyeon0409 Nov 18, 2024
4cafd47
refactor: admin 생성 로직 이동
SeongHyeon0409 Nov 18, 2024
32c0e2f
fix: guest계정 db삭제 버그 수정
SeongHyeon0409 Nov 18, 2024
771ade5
fix: api 요청 빈배열 반환 및 에러처리
SeongHyeon0409 Nov 18, 2024
0b480c0
chore: 버그 fix 배포용 commit
SeongHyeon0409 Nov 18, 2024
b6a4b3e
chore: 버그 fix 배포용 commit
SeongHyeon0409 Nov 18, 2024
ec89c2b
feat: migration 파일 생성
SeongHyeon0409 Nov 18, 2024
6c665c0
feat: 매수 로직 구현
SeongHyeon0409 Nov 18, 2024
486a00b
feat: 매도 로직 작성
SeungGwan123 Nov 19, 2024
ad46622
fix: 에러처리 수정 배포
SeungGwan123 Nov 19, 2024
d2b40b4
fix: 에러 수정중
SeungGwan123 Nov 19, 2024
9d45699
fix: 회원 가입 에러 수정
SeungGwan123 Nov 19, 2024
2d4b24c
fix: 매수, 매도 에러 수정 및 퍼센티지 api 에러처리
SeungGwan123 Nov 19, 2024
7582842
feat: 마이페이지 api 작성
SeungGwan123 Nov 19, 2024
7b8b3ce
feat: 보유 코인 체크 api 작성
SeungGwan123 Nov 19, 2024
0526467
feat: 기능 적용 배포
SeungGwan123 Nov 19, 2024
7bb7469
refactor: http 응답값 수정
SeungGwan123 Nov 19, 2024
39a1fc1
refactor: 에러 메세지 수정
SeungGwan123 Nov 19, 2024
455d1bc
refactor: 에러 응답값 수정
SeungGwan123 Nov 19, 2024
03df93d
refactor: 에러 응답 양식 수정
SeungGwan123 Nov 19, 2024
76509e8
hotfix: 매도 버그 긴급 수정
SeungGwan123 Nov 19, 2024
812ae8e
hotfix: 매수 버그 긴급 수정
SeungGwan123 Nov 19, 2024
8274338
hotfix: 매수 버그 긴급 수정
SeungGwan123 Nov 19, 2024
aca049a
refactor: 매도 로직 수정
SeungGwan123 Nov 19, 2024
32539fe
refactor: 매도 로직 수정
SeungGwan123 Nov 19, 2024
022bbed
feat: 미체결 api 작성
SeungGwan123 Nov 20, 2024
498bb6b
feat: 거래내역 api 작성
SeungGwan123 Nov 20, 2024
ef39bae
refactor: 미체결 응답값 수정
SeungGwan123 Nov 20, 2024
bacbd85
refactor: 미체결, 체결 응답 양식 수정
SeungGwan123 Nov 20, 2024
8dcb31f
feat: 차트 api 구현 완료
SeungGwan123 Nov 20, 2024
09a4057
deploy: 차트 api 테스트 배포
SeungGwan123 Nov 20, 2024
81434ee
feat: char api 트래픽 조절 적용
SeungGwan123 Nov 20, 2024
c71ebcb
feat: cicd 수정
SeungGwan123 Nov 21, 2024
8fce425
refactor: cicd 파일 삭제
SeungGwan123 Nov 21, 2024
206dd8d
refactor: base_url .env로 수정
Nov 15, 2024
b1bbe04
refactor: 타입명 명확히 수정
junhee1203 Nov 15, 2024
d792817
chore: client url 변경
SeungGwan123 Nov 14, 2024
acea100
chore: docker-compose수정
SeungGwan123 Nov 14, 2024
403a173
chore: nginx 설정 변경
SeungGwan123 Nov 14, 2024
4021617
chore: nginx 설정 변경
SeungGwan123 Nov 15, 2024
ddaa299
chore: api prefix설정
SeungGwan123 Nov 15, 2024
a61abe2
fix: yarn 설정 수정
SeungGwan123 Nov 21, 2024
05a304e
hotfix: rebase error 수정
SeungGwan123 Nov 21, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat: 보유 코인 체크 api 작성
SeungGwan123 committed Nov 21, 2024
commit 7b8b3ce53d556bf2e8d94da443787c930a3d2815
12 changes: 12 additions & 0 deletions packages/server/src/trade/trade.controller.ts
Original file line number Diff line number Diff line change
@@ -13,12 +13,14 @@ import { AuthGuard } from 'src/auth/auth.guard';
import { ApiBearerAuth, ApiSecurity, ApiBody } from '@nestjs/swagger';
import { AskService } from './trade-ask.service';
import { TradeDto } from './dtos/trade.dto';
import { TradeService } from './trade.service';

@Controller('trade')
export class TradeController {
constructor(
private bidService: BidService,
private askService: AskService,
private tradeService: TradeService
) {}

@ApiBearerAuth('access-token')
@@ -72,4 +74,14 @@ export class TradeController {
) {
return this.askService.calculatePercentBuy(req.user, moneyType, percent);
}
@ApiBearerAuth('access-token')
@ApiSecurity('access-token')
@UseGuards(AuthGuard)
@Get('check-coindata/:coin')
getMyCoinData(
@Request() req,
@Param('coin') coin: string,
) {
return this.tradeService.checkMyCoinData(req.user, coin)
}
}
2 changes: 2 additions & 0 deletions packages/server/src/trade/trade.module.ts
Original file line number Diff line number Diff line change
@@ -11,6 +11,7 @@ import { HttpModule } from '@nestjs/axios';
import { UpbitModule } from 'src/upbit/upbit.module';
import { TradeHistoryRepository } from 'src/trade-history/trade-history.repository';
import { AskService } from './trade-ask.service';
import { TradeService } from './trade.service';

@Module({
imports: [TypeOrmModule.forFeature([Trade]), HttpModule, UpbitModule],
@@ -22,6 +23,7 @@ import { AskService } from './trade-ask.service';
AssetRepository,
UserRepository,
TradeHistoryRepository,
TradeService
],
controllers: [TradeController],
})
50 changes: 50 additions & 0 deletions packages/server/src/trade/trade.service.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import {
Injectable,
OnModuleInit,
UnprocessableEntityException,
} from '@nestjs/common';
import { DataSource } from 'typeorm';
import { AccountRepository } from 'src/account/account.repository';
import { AssetRepository } from 'src/asset/asset.repository';
import { TradeRepository } from './trade.repository';
import { CoinDataUpdaterService } from 'src/upbit/coin-data-updater.service';
import { TradeHistoryRepository } from '../trade-history/trade-history.repository';
import { UPBIT_UPDATED_COIN_INFO_TIME } from 'common/upbit';

@Injectable()
export class TradeService {

constructor(
private accountRepository: AccountRepository,
private assetRepository: AssetRepository,
private readonly dataSource: DataSource,
) {}
async checkMyCoinData(user,coin){
const account = await this.accountRepository.findOne({
where: {user : {id : user.userId}}
})
if(!account) {
return {
code :400,
message: "등록되지 않은 사용자입니다."
}
}
const coinData = await this.assetRepository.findOne({
where: {
account: {id : account.id},
assetName: coin
}
})
if(coinData){
return {
code : 200,
message: "보유하고 계신 코인입니다."
}
}else{
return {
code : 422,
message : "보유하지 않은 코인입니다."
}
}
}
}