From 88f35a60d21cb6dc3ddf0c1bb97664a34e690385 Mon Sep 17 00:00:00 2001 From: jjuuuunnii Date: Fri, 12 Jan 2024 04:08:40 +0900 Subject: [PATCH] =?UTF-8?q?Feat:=20UserId=20=EC=96=B4=EB=85=B8=ED=85=8C?= =?UTF-8?q?=EC=9D=B4=EC=85=98=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../snowman/controller/RegionController.java | 22 ++++++++++++++++--- .../snowman/controller/UserController.java | 9 ++++++-- 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/snowthon/snowman/controller/RegionController.java b/src/main/java/com/snowthon/snowman/controller/RegionController.java index 87f9294..90d2239 100644 --- a/src/main/java/com/snowthon/snowman/controller/RegionController.java +++ b/src/main/java/com/snowthon/snowman/controller/RegionController.java @@ -1,5 +1,5 @@ package com.snowthon.snowman.controller; - +import io.swagger.v3.oas.annotations.Hidden; import com.snowthon.snowman.annotation.UserId; import com.snowthon.snowman.contrant.Constants; import com.snowthon.snowman.dto.common.ResponseDto; @@ -7,7 +7,9 @@ import com.snowthon.snowman.repository.UserRepository; import com.snowthon.snowman.service.RegionService; import com.snowthon.snowman.service.VoteHistoryService; +import io.swagger.v3.oas.annotations.Hidden; import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.tags.Tag; import lombok.RequiredArgsConstructor; @@ -37,18 +39,32 @@ public ResponseDto showWeatherInfo( return ResponseDto.ok(regionService.getWeather(latitude, longitude)); } + /** + * TODO USERID + * @param regionId + * @param voteRequestDto + * @return + */ //3-1 투표 여부 조회 @GetMapping("/{regionId}/poll") @Operation(summary = "투표 여부 조회", description = "투표 여부를 조회합니다") - public ResponseDto hasUserVoted(@UserId Long userId, @PathVariable Long regionId) { + public ResponseDto hasUserVoted(@PathVariable Long regionId) { + Long userId = 1L; return ResponseDto.ok(voteHistoryService.checkUserVoting(userId, regionId)); } + /** + * TODO USERID + * @param regionId + * @param voteRequestDto + * @return + */ //3-2. 투표 하기 @PostMapping("/{regionId}/poll") @Operation(summary = "투표 하기", description = "투표를 합니다.") - public ResponseDto createVote(@UserId Long userId, @PathVariable Long regionId, @RequestBody VoteRequestDto voteRequestDto) { + public ResponseDto createVote(@PathVariable Long regionId, @RequestBody VoteRequestDto voteRequestDto) { + Long userId = 1L; voteHistoryService.createVote(regionId, voteRequestDto, userId); return ResponseDto.ok(null); } diff --git a/src/main/java/com/snowthon/snowman/controller/UserController.java b/src/main/java/com/snowthon/snowman/controller/UserController.java index 68799ff..a0f1c56 100644 --- a/src/main/java/com/snowthon/snowman/controller/UserController.java +++ b/src/main/java/com/snowthon/snowman/controller/UserController.java @@ -23,10 +23,16 @@ public class UserController { private final UserService userService; + /** + * TODO USERID + * @param userId + * @return + */ //4-1. 모아 보기 @GetMapping("/vote-history") @Operation(summary = "아카이빙 모아보기", description = "유저의 투표 기록들을 가져옵니다") - public ResponseDto archiving(@UserId Long userId) { + public ResponseDto archiving() { + Long userId = 1L; return ResponseDto.ok(userService.getVoteHistoriesByUser(userId)); } @@ -34,7 +40,6 @@ public ResponseDto archiving(@UserId Long userId) { @GetMapping("/vote-history/{voteHistoryId}") @Operation(summary = "아카이빙 상세보기", description = "상세한 투표정보를 가져옵니다.") public ResponseDto archivingDetail(@PathVariable Long voteHistoryId) { - return ResponseDto.ok(userService.getVoteHistoryById(voteHistoryId)); }