diff --git a/backend/ddang/src/docs/asciidoc/docs.adoc b/backend/ddang/src/docs/asciidoc/docs.adoc index 1e57fb307..e0c99fb1e 100644 --- a/backend/ddang/src/docs/asciidoc/docs.adoc +++ b/backend/ddang/src/docs/asciidoc/docs.adoc @@ -157,7 +157,6 @@ include::{snippets}/auction-controller-test/경매를_등록한다/response-fiel include::{snippets}/auction-controller-test/첫번째_페이지의_경매_목록을_조회한다/http-request.adoc[] include::{snippets}/auction-controller-test/첫번째_페이지의_경매_목록을_조회한다/query-parameters.adoc[] -include::{snippets}/auction-controller-test/첫번째_페이지의_경매_목록을_조회한다/request-headers.adoc[] ==== 응답 @@ -170,7 +169,6 @@ include::{snippets}/auction-controller-test/첫번째_페이지의_경매_목록 include::{snippets}/auction-controller-test/지정한_아이디에_해당하는_경매를_조회한다/http-request.adoc[] include::{snippets}/auction-controller-test/지정한_아이디에_해당하는_경매를_조회한다/path-parameters.adoc[] -include::{snippets}/auction-controller-test/지정한_아이디에_해당하는_경매를_조회한다/request-headers.adoc[] ==== 응답 diff --git a/backend/ddang/src/main/java/com/ddang/ddang/auction/presentation/AuctionController.java b/backend/ddang/src/main/java/com/ddang/ddang/auction/presentation/AuctionController.java index a2866723d..d7e869bc0 100644 --- a/backend/ddang/src/main/java/com/ddang/ddang/auction/presentation/AuctionController.java +++ b/backend/ddang/src/main/java/com/ddang/ddang/auction/presentation/AuctionController.java @@ -39,7 +39,7 @@ public class AuctionController { @PostMapping public ResponseEntity create( - @AuthenticateUser final AuthenticationUserInfo userInfo, + @AuthenticateUser AuthenticationUserInfo userInfo, @RequestPart final List images, @RequestPart @Valid final CreateAuctionRequest request ) { @@ -71,7 +71,6 @@ public ResponseEntity read( @GetMapping public ResponseEntity readAllByLastAuctionId( - @AuthenticateUser final AuthenticationUserInfo ignored, @RequestParam(required = false) final Long lastAuctionId, @RequestParam(required = false, defaultValue = "10") final int size ) { @@ -83,7 +82,7 @@ public ResponseEntity readAllByLastAuctionId( @DeleteMapping("/{auctionId}") public ResponseEntity delete( - @AuthenticateUser final AuthenticationUserInfo userInfo, + @AuthenticateUser AuthenticationUserInfo userInfo, @PathVariable final Long auctionId ) { auctionService.deleteByAuctionId(auctionId, userInfo.userId()); diff --git a/backend/ddang/src/main/resources/static/docs/docs.html b/backend/ddang/src/main/resources/static/docs/docs.html index 54da7829d..7b813699a 100644 --- a/backend/ddang/src/main/resources/static/docs/docs.html +++ b/backend/ddang/src/main/resources/static/docs/docs.html @@ -1217,7 +1217,7 @@

요청

Content-Disposition: form-data; name=request; filename=request Content-Type: application/json -{"title":"경매 상품 1","description":"이것은 경매 상품 1 입니다.","bidUnit":1000,"startPrice":1000,"closingTime":"2023-08-20T09:59:53.172963","subCategoryId":2,"thirdRegionIds":[3]} +{"title":"경매 상품 1","description":"이것은 경매 상품 1 입니다.","bidUnit":1000,"startPrice":1000,"closingTime":"2023-08-19T16:30:53.364176","subCategoryId":2,"thirdRegionIds":[3]} --6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm-- @@ -1335,8 +1335,7 @@

요청

GET /auctions?size=10 HTTP/1.1
-Content-Type: application/json
-Authorization: Bearer accessToken
+Content-Type: application/json
@@ -1361,24 +1360,6 @@

요청

- ---- - - - - - - - - - - - - -
NameDescription

Authorization

회원 Bearer 인증 정보

응답

@@ -1500,24 +1481,6 @@

요청

- ---- - - - - - - - - - - - - -
NameDescription

Authorization

회원 Bearer 인증 정보

응답

@@ -1540,8 +1503,8 @@

응답

"lastBidPrice" : null, "status" : "FAILURE", "bidUnit" : 1000, - "registerTime" : "2023-08-17T09:59:53", - "closingTime" : "2023-08-17T09:59:53", + "registerTime" : "2023-08-16T16:30:53", + "closingTime" : "2023-08-16T16:30:53", "directRegions" : [ { "first" : "서울특별시", "second" : "강서구", @@ -1873,12 +1836,12 @@

응답

"name" : "사용자1", "profileImage" : "이미지1", "price" : 10000, - "bidTime" : "2023-08-17T09:59:54" + "bidTime" : "2023-08-16T16:30:54" }, { "name" : "사용자2", "profileImage" : "이미지2", "price" : 12000, - "bidTime" : "2023-08-17T09:59:54" + "bidTime" : "2023-08-16T16:30:54" } ] }
@@ -2073,7 +2036,7 @@

응답

"price" : 10000 }, "lastMessage" : { - "createdAt" : "2023-08-17T09:59:55", + "createdAt" : "2023-08-16T16:30:55", "contents" : "메시지1" }, "isChatAvailable" : true @@ -2091,7 +2054,7 @@

응답

"price" : 20000 }, "lastMessage" : { - "createdAt" : "2023-08-17T09:59:55", + "createdAt" : "2023-08-16T16:30:55", "contents" : "메시지2" }, "isChatAvailable" : true @@ -2529,7 +2492,7 @@

응답

[ { "id" : 1, - "createdAt" : "2023-08-17T09:59:55", + "createdAt" : "2023-08-16T16:30:55", "isMyMessage" : true, "contents" : "메시지내용" } ] @@ -2679,7 +2642,7 @@

응답

"id" : 1, "name" : "회원1" }, - "createdTime" : "2023-08-17T09:59:57", + "createdTime" : "2023-08-16T16:30:57", "auction" : { "id" : 1, "title" : "제목" @@ -2691,7 +2654,7 @@

응답

"id" : 2, "name" : "회원2" }, - "createdTime" : "2023-08-17T09:59:57", + "createdTime" : "2023-08-16T16:30:57", "auction" : { "id" : 1, "title" : "제목" @@ -2703,7 +2666,7 @@

응답

"id" : 3, "name" : "회원3" }, - "createdTime" : "2023-08-17T09:59:57", + "createdTime" : "2023-08-16T16:30:57", "auction" : { "id" : 1, "title" : "제목" @@ -2867,7 +2830,7 @@

응답

"id" : 1, "name" : "회원1" }, - "createdTime" : "2023-08-17T09:59:57", + "createdTime" : "2023-08-16T16:30:57", "chatRoom" : { "id" : 1 }, @@ -2878,7 +2841,7 @@

응답

"id" : 1, "name" : "회원1" }, - "createdTime" : "2023-08-17T09:59:57", + "createdTime" : "2023-08-16T16:30:57", "chatRoom" : { "id" : 1 }, @@ -2889,7 +2852,7 @@

응답

"id" : 1, "name" : "회원1" }, - "createdTime" : "2023-08-17T09:59:57", + "createdTime" : "2023-08-16T16:30:57", "chatRoom" : { "id" : 1 }, @@ -2957,7 +2920,7 @@

응답

diff --git a/backend/ddang/src/test/java/com/ddang/ddang/auction/presentation/AuctionControllerTest.java b/backend/ddang/src/test/java/com/ddang/ddang/auction/presentation/AuctionControllerTest.java index f93ccbb17..ddff1d478 100644 --- a/backend/ddang/src/test/java/com/ddang/ddang/auction/presentation/AuctionControllerTest.java +++ b/backend/ddang/src/test/java/com/ddang/ddang/auction/presentation/AuctionControllerTest.java @@ -501,6 +501,7 @@ void setUp(@Autowired RestDocumentationContextProvider provider) { final ReadAuctionWithChatRoomIdDto auctionWithChatRoomIdDto = new ReadAuctionWithChatRoomIdDto(auction, chatRoomDto); + final PrivateClaims privateClaims = new PrivateClaims(1L); given(mockTokenDecoder.decode(eq(TokenType.ACCESS), anyString())).willReturn(Optional.of(privateClaims)); @@ -525,9 +526,6 @@ void setUp(@Autowired RestDocumentationContextProvider provider) { ) .andDo( restDocs.document( - requestHeaders( - headerWithName("Authorization").description("회원 Bearer 인증 정보") - ), pathParameters( parameterWithName("auctionId").description("조회하고자 하는 경매 ID") ), @@ -632,17 +630,14 @@ void setUp(@Autowired RestDocumentationContextProvider provider) { "판매자", 3.5d ); - final PrivateClaims privateClaims = new PrivateClaims(1L); - final ReadAuctionsDto readAuctionsDto = new ReadAuctionsDto(List.of(auction2, auction1), true); - given(mockTokenDecoder.decode(eq(TokenType.ACCESS), anyString())).willReturn(Optional.of(privateClaims)); + final ReadAuctionsDto readAuctionsDto = new ReadAuctionsDto(List.of(auction2, auction1), true); given(auctionService.readAllByLastAuctionId(any(), anyInt())).willReturn(readAuctionsDto); // when & then mockMvc.perform(get("/auctions") .contentType(MediaType.APPLICATION_JSON) .queryParam("size", "10") - .header(HttpHeaders.AUTHORIZATION, "Bearer accessToken") ) .andExpectAll( status().isOk(), @@ -661,9 +656,6 @@ void setUp(@Autowired RestDocumentationContextProvider provider) { ) .andDo( restDocs.document( - requestHeaders( - headerWithName("Authorization").description("회원 Bearer 인증 정보") - ), queryParameters( parameterWithName("lastAuctionId").description("마지막으로 조회한 경매 ID").optional(), parameterWithName("size").description("페이지 크기").optional()