Skip to content

Commit

Permalink
feat: 허브 링크 삭제 api 구현
Browse files Browse the repository at this point in the history
  • Loading branch information
hseong3243 committed Apr 21, 2024
1 parent 09462b3 commit dc23821
Show file tree
Hide file tree
Showing 4 changed files with 218 additions and 62 deletions.
10 changes: 10 additions & 0 deletions src/docs/asciidoc/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,16 @@ operation::link-controller-test/delete-link[snippets='http-request,request-heade

operation::link-controller-test/delete-link[snippets='http-response,response-fields']

=== 허브 링크 삭제

==== request

operation::link-controller-test/delete-hub-link[snippets='http-request,request-headers,path-parameters']

==== response

operation::link-controller-test/delete-hub-link[snippets='http-response,response-fields']

== 허브

=== 허브 생성
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import com.seong.shoutlink.domain.link.service.LinkUseCase;
import com.seong.shoutlink.domain.link.service.request.CreateHubLinkCommand;
import com.seong.shoutlink.domain.link.service.request.CreateLinkCommand;
import com.seong.shoutlink.domain.link.service.request.DeleteHubLinkCommand;
import com.seong.shoutlink.domain.link.service.request.DeleteLinkCommand;
import com.seong.shoutlink.domain.link.service.request.FindHubLinksCommand;
import com.seong.shoutlink.domain.link.service.request.FindLinksCommand;
Expand Down Expand Up @@ -94,4 +95,14 @@ public ResponseEntity<DeleteLinkResponse> deleteLink(
new DeleteLinkCommand(memberId, linkId));
return ResponseEntity.ok(deleteLinkResponse);
}

@DeleteMapping("/hubs/{hubId}/links/{linkId}")
public ResponseEntity<DeleteLinkResponse> deleteHubLink(
@LoginUser Long memberId,
@PathVariable("hubId") Long hubId,
@PathVariable("linkId") Long linkId) {
DeleteLinkResponse response = linkUseCase.deleteHubLink(
new DeleteHubLinkCommand(linkId, memberId, hubId));
return ResponseEntity.ok(response);
}
}
Loading

0 comments on commit dc23821

Please sign in to comment.