-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
538 additions
and
11 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
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
30 changes: 30 additions & 0 deletions
30
module-api/src/main/java/com/mile/controller/writername/WriterNameController.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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package com.mile.controller.writername; | ||
|
||
import com.mile.authentication.PrincipalHandler; | ||
import com.mile.dto.SuccessResponse; | ||
import com.mile.exception.message.SuccessMessage; | ||
import com.mile.writername.service.WriterNameDeleteService; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.DeleteMapping; | ||
import org.springframework.web.bind.annotation.PathVariable; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
@RequiredArgsConstructor | ||
@RestController | ||
@RequestMapping("/api/writerName") | ||
public class WriterNameController implements WriterNameControllerSwagger{ | ||
|
||
private final WriterNameDeleteService writerNameDeleteService; | ||
private final PrincipalHandler principalHandler; | ||
|
||
@Override | ||
@DeleteMapping("/{writerNameId}") | ||
public ResponseEntity<SuccessResponse> deleteMember( | ||
@PathVariable("writerNameId") final Long writerNameId | ||
) { | ||
writerNameDeleteService.deleteWriterNameById(writerNameId, principalHandler.getUserIdFromPrincipal()); | ||
return ResponseEntity.ok(SuccessResponse.of(SuccessMessage.MOIM_MEMBER_DELETE_SUCCESS)); | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
module-api/src/main/java/com/mile/controller/writername/WriterNameControllerSwagger.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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package com.mile.controller.writername; | ||
|
||
import com.mile.dto.ErrorResponse; | ||
import com.mile.dto.SuccessResponse; | ||
import io.swagger.v3.oas.annotations.Operation; | ||
import io.swagger.v3.oas.annotations.media.Content; | ||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import io.swagger.v3.oas.annotations.responses.ApiResponse; | ||
import io.swagger.v3.oas.annotations.responses.ApiResponses; | ||
import io.swagger.v3.oas.annotations.tags.Tag; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.PathVariable; | ||
|
||
@Tag(name = "WriterName") | ||
public interface WriterNameControllerSwagger { | ||
|
||
@Operation(summary = "관리자 페이지 멤버 삭제") | ||
@ApiResponses( | ||
value = { | ||
@ApiResponse(responseCode = "200", description = "멤버 삭제가 완료되었습니다."), | ||
@ApiResponse(responseCode = "404", description = "해당 사용자는 존재하지 않습니다."), | ||
@ApiResponse(responseCode = "500", description = "서버 내부 오류입니다.", | ||
content = @Content(schema = @Schema(implementation = ErrorResponse.class))) | ||
} | ||
) | ||
ResponseEntity<SuccessResponse> deleteMember( | ||
@PathVariable("writerNameId") final Long writerNameId | ||
); | ||
} | ||
|
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
Oops, something went wrong.