Skip to content

Commit

Permalink
Merge branch 'version/v0.1.2' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
itavita08 committed May 14, 2024
2 parents c4f6564 + c48a671 commit deb8ddf
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class GuideProductController {

private final GuideProductService guideProductService;

@GetMapping()
@GetMapping("/search/main")
@Operation(summary = "메인 페이지", description = """
# 메인 페이지
Expand All @@ -53,7 +53,7 @@ public class GuideProductController {
## 응답
- 상품 등록 성공 시 `200` 코드와 함께 메인 페이지 정보를 json 형태로 반환합니다.
""", tags = "Main Page")
""", tags = "Search Guide Products")
@ApiResponse(
responseCode = "200",
description = "메인페이지 조회 성공",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ public GuideProductDto getProduct(Long productId) {

// 가이드 상품 수정
@Transactional
public GuideProductDto modifyGuideProduct(User user, Long productId, ModifyGuideProductRequest edits, Optional<MultipartFile> modifyThumb, Optional<List<MultipartFile>> modifyImages) {
public GuideProductDto modifyGuideProduct(User user, Long productId, ModifyGuideProductRequest edits,
Optional<MultipartFile> modifyThumb, Optional<List<MultipartFile>> modifyImages) {
GuideProduct product = guideProductRepository.findById(productId).orElseThrow(() -> new GuideProductNotFoundException(productId));

if (product.getUser() != user) throw new MismatchUserFromCreatorException("가이드 상품을 수정할 권한이 없습니다.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,9 @@ private BooleanExpression categoryIn(MultiPolygon region, SearchCategoriesReques
} else if (request.getCategory() == GuideCategoryCode.BEST)
return Expressions.booleanTemplate("ST_CONTAINS({0}, {1})",
region, qProduct.location);
else return qCategory.categoryCode.eq(request.getCategory());
else return qProduct.id.in(jpaQueryFactory.select(qCategory.product.id)
.from(qCategory)
.where(qCategory.categoryCode.eq(request.getCategory())));
}
return null;
}
Expand Down

0 comments on commit deb8ddf

Please sign in to comment.