Skip to content

Commit

Permalink
Revert "feat: #323 경매 목록 조회 시 인가 기능 추가 (#324)"
Browse files Browse the repository at this point in the history
This reverts commit 6196339.
  • Loading branch information
swonny authored Oct 6, 2023
1 parent 4276202 commit 1fb061a
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 68 deletions.
2 changes: 0 additions & 2 deletions backend/ddang/src/docs/asciidoc/docs.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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[]

==== 응답

Expand All @@ -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[]

==== 응답

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class AuctionController {

@PostMapping
public ResponseEntity<CreateAuctionResponse> create(
@AuthenticateUser final AuthenticationUserInfo userInfo,
@AuthenticateUser AuthenticationUserInfo userInfo,
@RequestPart final List<MultipartFile> images,
@RequestPart @Valid final CreateAuctionRequest request
) {
Expand Down Expand Up @@ -71,7 +71,6 @@ public ResponseEntity<ReadAuctionDetailResponse> read(

@GetMapping
public ResponseEntity<ReadAuctionsResponse> readAllByLastAuctionId(
@AuthenticateUser final AuthenticationUserInfo ignored,
@RequestParam(required = false) final Long lastAuctionId,
@RequestParam(required = false, defaultValue = "10") final int size
) {
Expand All @@ -83,7 +82,7 @@ public ResponseEntity<ReadAuctionsResponse> readAllByLastAuctionId(

@DeleteMapping("/{auctionId}")
public ResponseEntity<Void> delete(
@AuthenticateUser final AuthenticationUserInfo userInfo,
@AuthenticateUser AuthenticationUserInfo userInfo,
@PathVariable final Long auctionId
) {
auctionService.deleteByAuctionId(auctionId, userInfo.userId());
Expand Down
69 changes: 16 additions & 53 deletions backend/ddang/src/main/resources/static/docs/docs.html
Original file line number Diff line number Diff line change
Expand Up @@ -1217,7 +1217,7 @@ <h4 id="_요청_10"><a class="link" href="#_요청_10">요청</a></h4>
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--</code></pre>
</div>
</div>
Expand Down Expand Up @@ -1335,8 +1335,7 @@ <h4 id="_요청_11"><a class="link" href="#_요청_11">요청</a></h4>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight nowrap"><code class="language-http hljs" data-lang="http">GET /auctions?size=10 HTTP/1.1
Content-Type: application/json
Authorization: Bearer accessToken</code></pre>
Content-Type: application/json</code></pre>
</div>
</div>
<table class="tableblock frame-all grid-all stretch">
Expand All @@ -1361,24 +1360,6 @@ <h4 id="_요청_11"><a class="link" href="#_요청_11">요청</a></h4>
</tr>
</tbody>
</table>
<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 50%;">
<col style="width: 50%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">Name</th>
<th class="tableblock halign-left valign-top">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>Authorization</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">회원 Bearer 인증 정보</p></td>
</tr>
</tbody>
</table>
</div>
<div class="sect3">
<h4 id="_응답_11"><a class="link" href="#_응답_11">응답</a></h4>
Expand Down Expand Up @@ -1500,24 +1481,6 @@ <h4 id="_요청_12"><a class="link" href="#_요청_12">요청</a></h4>
</tr>
</tbody>
</table>
<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 50%;">
<col style="width: 50%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">Name</th>
<th class="tableblock halign-left valign-top">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>Authorization</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">회원 Bearer 인증 정보</p></td>
</tr>
</tbody>
</table>
</div>
<div class="sect3">
<h4 id="_응답_12"><a class="link" href="#_응답_12">응답</a></h4>
Expand All @@ -1540,8 +1503,8 @@ <h4 id="_응답_12"><a class="link" href="#_응답_12">응답</a></h4>
"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" : "강서구",
Expand Down Expand Up @@ -1873,12 +1836,12 @@ <h4 id="_응답_15"><a class="link" href="#_응답_15">응답</a></h4>
"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"
} ]
}</code></pre>
</div>
Expand Down Expand Up @@ -2073,7 +2036,7 @@ <h4 id="_응답_17"><a class="link" href="#_응답_17">응답</a></h4>
"price" : 10000
},
"lastMessage" : {
"createdAt" : "2023-08-17T09:59:55",
"createdAt" : "2023-08-16T16:30:55",
"contents" : "메시지1"
},
"isChatAvailable" : true
Expand All @@ -2091,7 +2054,7 @@ <h4 id="_응답_17"><a class="link" href="#_응답_17">응답</a></h4>
"price" : 20000
},
"lastMessage" : {
"createdAt" : "2023-08-17T09:59:55",
"createdAt" : "2023-08-16T16:30:55",
"contents" : "메시지2"
},
"isChatAvailable" : true
Expand Down Expand Up @@ -2529,7 +2492,7 @@ <h4 id="_응답_20"><a class="link" href="#_응답_20">응답</a></h4>

[ {
"id" : 1,
"createdAt" : "2023-08-17T09:59:55",
"createdAt" : "2023-08-16T16:30:55",
"isMyMessage" : true,
"contents" : "메시지내용"
} ]</code></pre>
Expand Down Expand Up @@ -2679,7 +2642,7 @@ <h4 id="_응답_22"><a class="link" href="#_응답_22">응답</a></h4>
"id" : 1,
"name" : "회원1"
},
"createdTime" : "2023-08-17T09:59:57",
"createdTime" : "2023-08-16T16:30:57",
"auction" : {
"id" : 1,
"title" : "제목"
Expand All @@ -2691,7 +2654,7 @@ <h4 id="_응답_22"><a class="link" href="#_응답_22">응답</a></h4>
"id" : 2,
"name" : "회원2"
},
"createdTime" : "2023-08-17T09:59:57",
"createdTime" : "2023-08-16T16:30:57",
"auction" : {
"id" : 1,
"title" : "제목"
Expand All @@ -2703,7 +2666,7 @@ <h4 id="_응답_22"><a class="link" href="#_응답_22">응답</a></h4>
"id" : 3,
"name" : "회원3"
},
"createdTime" : "2023-08-17T09:59:57",
"createdTime" : "2023-08-16T16:30:57",
"auction" : {
"id" : 1,
"title" : "제목"
Expand Down Expand Up @@ -2867,7 +2830,7 @@ <h4 id="_응답_24"><a class="link" href="#_응답_24">응답</a></h4>
"id" : 1,
"name" : "회원1"
},
"createdTime" : "2023-08-17T09:59:57",
"createdTime" : "2023-08-16T16:30:57",
"chatRoom" : {
"id" : 1
},
Expand All @@ -2878,7 +2841,7 @@ <h4 id="_응답_24"><a class="link" href="#_응답_24">응답</a></h4>
"id" : 1,
"name" : "회원1"
},
"createdTime" : "2023-08-17T09:59:57",
"createdTime" : "2023-08-16T16:30:57",
"chatRoom" : {
"id" : 1
},
Expand All @@ -2889,7 +2852,7 @@ <h4 id="_응답_24"><a class="link" href="#_응답_24">응답</a></h4>
"id" : 1,
"name" : "회원1"
},
"createdTime" : "2023-08-17T09:59:57",
"createdTime" : "2023-08-16T16:30:57",
"chatRoom" : {
"id" : 1
},
Expand Down Expand Up @@ -2957,7 +2920,7 @@ <h4 id="_응답_24"><a class="link" href="#_응답_24">응답</a></h4>
<div id="footer">
<div id="footer-text">
Version 0.0.1-SNAPSHOT<br>
Last updated 2023-08-17 09:59:27 +0900
Last updated 2023-08-16 16:29:20 +0900
</div>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.18.3/highlight.min.js"></script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand All @@ -525,9 +526,6 @@ void setUp(@Autowired RestDocumentationContextProvider provider) {
)
.andDo(
restDocs.document(
requestHeaders(
headerWithName("Authorization").description("회원 Bearer 인증 정보")
),
pathParameters(
parameterWithName("auctionId").description("조회하고자 하는 경매 ID")
),
Expand Down Expand Up @@ -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(),
Expand All @@ -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()
Expand Down

0 comments on commit 1fb061a

Please sign in to comment.