Skip to content
This repository has been archived by the owner on May 14, 2024. It is now read-only.

Commit

Permalink
Feat :: DucamiLectureService ์ƒ์„ฑ
Browse files Browse the repository at this point in the history
createLecture() ๋น„์ฆˆ๋‹ˆ์Šค ๋กœ์ง ์ถ”๊ฐ€
  • Loading branch information
heunseoRyu committed Apr 19, 2024
1 parent 6068825 commit d1d8c6c
Showing 1 changed file with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package ducami.org.ducademi.domain.lecture.service;


import ducami.org.ducademi.domain.lecture.domain.repository.LectureRepository;
import ducami.org.ducademi.domain.lecture.presentation.dto.request.CreateLecturesRequest;
import ducami.org.ducademi.domain.member.repository.MemberRepository;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

@Service
@RequiredArgsConstructor
public class DucamiLectureService {

private final MemberRepository memberRepository;
private final LectureRepository lectureRepository;

public void createLecture(Long idx, CreateLecturesRequest request){
memberRepository.findById(idx)
.orElseThrow(() -> new IllegalArgumentException("User not found"));

lectureRepository.save(request.toEntity());
}


}

0 comments on commit d1d8c6c

Please sign in to comment.