Skip to content

Commit

Permalink
feat:#35 발자국 추가 및 조회
Browse files Browse the repository at this point in the history
  • Loading branch information
lywg committed Dec 1, 2022
1 parent e54f104 commit 1269487
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/footprint/footprint.controller.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Controller, Get, Post, Query } from '@nestjs/common';
import { Controller, Get, Post, Body, Req } from '@nestjs/common';
import { FootprintService } from './footprint.service';
import { ApiCreatedResponse } from '@nestjs/swagger';

@Controller('footprint')
export class FootprintController {
Expand All @@ -9,16 +10,21 @@ export class FootprintController {

// 발자국 수 추가
@Post()
async updateFootPrint(@Query() query) {
@ApiCreatedResponse({
status: 200,
type: CreateFootprintDto,
description: '발자국 수를 늘립니다.',
})
async updateFootPrint(@Req() req) {
return await this.footprintService.addFootprint(
query.user_id,
query.post_id,
req.user.user_id,
req.post.post_id,
);
}

// 발자국 수 조회
@Get()
async getFootprints(@Query() query) {
return await this.footprintService.getFootprints(query.post_id);
async getFootprints(@Req() req) {
return await this.footprintService.getFootprints(req.post.post_id);
}
}

0 comments on commit 1269487

Please sign in to comment.