-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #106 from kakao-tech-campus-2nd-step3/weekly
Weekly 정기 병합
- Loading branch information
Showing
3 changed files
with
18 additions
and
9 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
18 changes: 11 additions & 7 deletions
18
src/main/java/com/helpmeCookies/product/controller/docs/ProductApiDocs.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 |
---|---|---|
@@ -1,21 +1,25 @@ | ||
package com.helpmeCookies.product.controller.docs; | ||
|
||
import com.helpmeCookies.global.ApiResponse.ApiResponse; | ||
import com.helpmeCookies.product.dto.ProductPage; | ||
import com.helpmeCookies.product.dto.ProductPage.Paging; | ||
import com.helpmeCookies.product.util.ProductSort; | ||
import io.swagger.v3.oas.annotations.Operation; | ||
import io.swagger.v3.oas.annotations.Parameter; | ||
import io.swagger.v3.oas.annotations.tags.Tag; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RequestParam; | ||
|
||
@Tag(name = "상품 관련 기능", description = "상품 관련 API") | ||
public interface ProductApiDocs { | ||
|
||
@Operation(summary = "상품 검색") | ||
ResponseEntity<Paging> getProductsByPage( | ||
String query, | ||
@Parameter(description = "default value 20") int size, | ||
int page, | ||
ProductSort productSort | ||
); | ||
|
||
@GetMapping | ||
public ResponseEntity<ApiResponse<Paging>> getProductsByPage( | ||
@RequestParam("query") String query, | ||
@RequestParam(name = "size", required = false, defaultValue = "20") int size, | ||
@RequestParam("page") int page, | ||
@RequestParam("sort") ProductSort productSort | ||
) | ||
} |