Skip to content

Commit

Permalink
feat: 어드민 스터디 삭제 V2 API 구현 (#885)
Browse files Browse the repository at this point in the history
feat: 어드민 스터디 삭제 v2 api 구현
  • Loading branch information
Sangwook02 authored Feb 10, 2025
1 parent 39dd7c3 commit bfbc96a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
import java.util.List;
import lombok.RequiredArgsConstructor;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
Expand All @@ -36,4 +38,11 @@ public ResponseEntity<List<StudyManagerResponse>> getStudies() {
var response = adminStudyServiceV2.getAllStudies();
return ResponseEntity.ok(response);
}

@Operation(summary = "스터디 삭제", description = "스터디를 삭제합니다. 스터디의 세션도 함께 삭제됩니다.")
@DeleteMapping("/{studyId}")
public ResponseEntity<Void> deleteStudy(@PathVariable Long studyId) {
adminStudyServiceV2.deleteStudy(studyId);
return ResponseEntity.ok().build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public void createStudy(StudyCreateRequest request) {
memberRepository.save(mentor);
studyV2Repository.save(study);

log.info("[AdminStudyService] 스터디 생성 완료: studyId = {}", study.getId());
log.info("[AdminStudyServiceV2] 스터디 생성 완료: studyId = {}", study.getId());
}

@Transactional(readOnly = true)
Expand All @@ -62,4 +62,11 @@ public List<StudyManagerResponse> getAllStudies() {
.map(StudyManagerResponse::from)
.toList();
}

@Transactional
public void deleteStudy(Long studyId) {
studyV2Repository.deleteById(studyId);

log.info("[AdminStudyServiceV2] 스터디 삭제 완료: studyId = {}", studyId);
}
}

0 comments on commit bfbc96a

Please sign in to comment.