-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ feat: add user item add isliked in response dto (#515)
- Loading branch information
1 parent
40306b3
commit 30df5d3
Showing
8 changed files
with
163 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,3 +10,4 @@ public record ItemGroupByDateResponseDto( | |
List<ItemGroupResponseDto> value | ||
) { | ||
} | ||
|
12 changes: 12 additions & 0 deletions
12
...i/src/main/java/com/depromeet/domains/item/dto/response/ItemGroupByDateResponseV2Dto.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.depromeet.domains.item.dto.response; | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema; | ||
|
||
import java.util.List; | ||
|
||
public record ItemGroupByDateResponseV2Dto( | ||
@Schema(description = "날짜", example = "2주전") | ||
String date, | ||
@Schema(description = "아이템 그룹", example = "아이템 그룹") | ||
List<ItemGroupResponseV2Dto> value | ||
){} |
44 changes: 44 additions & 0 deletions
44
...rop-api/src/main/java/com/depromeet/domains/item/dto/response/ItemGroupResponseV2Dto.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package com.depromeet.domains.item.dto.response; | ||
|
||
import com.depromeet.domains.music.dto.response.MusicResponseDto; | ||
import com.depromeet.domains.user.dto.response.UserResponseDto; | ||
import com.fasterxml.jackson.annotation.JsonFormat; | ||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import lombok.Builder; | ||
|
||
import java.time.LocalDateTime; | ||
|
||
|
||
@Builder | ||
public record ItemGroupResponseV2Dto( | ||
@Schema(description = "아이템 아이디", example = "1") | ||
Long itemId, | ||
|
||
@Schema(description = "사용자 정보") | ||
UserResponseDto user, | ||
|
||
@Schema(description = "사용자 위치", example = "성동구 성수1가 1동") | ||
ItemLocationResponseDto location, | ||
|
||
@Schema(description = "음악 정보") | ||
MusicResponseDto music, | ||
|
||
@Schema(description = "사용자 코멘트", example = "이 노래 좋아요") | ||
String content, | ||
|
||
@Schema(description = "생성시간", example = "yyyy-MM-dd HH:mm:ss") | ||
@JsonFormat( | ||
shape = JsonFormat.Shape.STRING, | ||
pattern = "yyyy-MM-dd HH:mm:ss", | ||
locale = "Asia/Seoul" | ||
) | ||
LocalDateTime createdAt, | ||
|
||
@Schema(description = "아이템 좋아요 개수", example = "1") | ||
long itemLikeCount, | ||
|
||
@Schema(description = "아이템 좋아요 여부", example = "true") | ||
boolean isLiked | ||
|
||
) { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
...eetdrop-api/src/main/java/com/depromeet/domains/user/controller/UserItemV2Controller.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package com.depromeet.domains.user.controller; | ||
|
||
import com.depromeet.common.dto.PaginationResponseDto; | ||
import com.depromeet.common.dto.ResponseDto; | ||
import com.depromeet.domains.user.dto.request.ItemOrderType; | ||
import com.depromeet.domains.user.service.UserItemService; | ||
import com.depromeet.security.annotation.ReqUser; | ||
import com.depromeet.user.User; | ||
import io.swagger.v3.oas.annotations.Operation; | ||
import io.swagger.v3.oas.annotations.responses.ApiResponse; | ||
import io.swagger.v3.oas.annotations.tags.Tag; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RequestParam; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
|
||
@RestController | ||
@RequiredArgsConstructor | ||
@RequestMapping("/v2/users/me/items") | ||
@Tag(name = "🏃User Item", description = "User Item API") | ||
public class UserItemV2Controller { | ||
|
||
private final UserItemService userItemService; | ||
|
||
@Operation(summary = "사용자가 드랍한 아이템 조회 V2") | ||
@ApiResponse(responseCode = "200", description = "사용자가 드랍한 아이템 조회 성공") | ||
@GetMapping("/drop") | ||
public ResponseEntity<PaginationResponseDto<?, ?>> getUserDropItemsV2( | ||
@ReqUser User user, | ||
@RequestParam(defaultValue = "RECENT", required = false) ItemOrderType orderType, | ||
@RequestParam(value = "state", required = false) String state, | ||
@RequestParam(value = "city", required = false) String city, | ||
@RequestParam(defaultValue = "9223372036854775000") long lastCursor | ||
) { | ||
var response = userItemService.getDropItemsV2(user, lastCursor, orderType, state, city); | ||
return ResponseDto.ok(response); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters