Skip to content

Commit

Permalink
feat: home search api
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeongh00 committed Jul 29, 2024
1 parent b32981e commit 240f6d2
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ public class HomeFindUseCase {
private final JwtUtil jwtUtil;
private final UserQueryService userQueryService;

public List<String> findAllMarkets() {

return (List<String>) marketQueryService.findAllMarkets().stream().map(market -> market.getName());
}

public HomeInfo findMarketLists(String accessToken) {

String email = jwtUtil.getEmail(accessToken);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RequiredArgsConstructor
@RestController
@RequestMapping("/v1/home")
Expand Down Expand Up @@ -51,18 +53,22 @@ public ApplicationResponse<HomeInfo> findHomeInfo(@RequestHeader(AuthConsts.ACCE
}

// 시장 리스트 검색
// @GetMapping
// @ApiResponses(
// value = {
// @ApiResponse(
// responseCode = "200",
// description = "시장 리스트 검색 성공",
// useReturnTypeSchema = true
// )
// }
// )
// @Operation(summary = "시장 리스트 검색 API", description = "시장 리스트 검색 API 입니다.")
// public ApplicationResponse
@GetMapping("/search")
@ApiResponses(
value = {
@ApiResponse(
responseCode = "200",
description = "시장 리스트 전체 검색 성공",
useReturnTypeSchema = true
)
}
)
@Operation(summary = "시장 리스트 검색 API", description = "시장 리스트 검색 API 입니다.")
public ApplicationResponse<List<String>> findALlMarkets() {

List<String> names = homeFindUseCase.findAllMarkets();
return ApplicationResponse.ok(names);
}

// 가까운 시장 확인
@GetMapping("/nearmarket")
Expand Down

0 comments on commit 240f6d2

Please sign in to comment.