feat: lecetureServiceImpl Refactoring
This commit is contained in:
parent
4f64d316d8
commit
48d08f0816
@ -224,19 +224,18 @@ public class LectureServiceImpl implements LectureService {
|
|||||||
|
|
||||||
Optional<Lecture> lecture = lectureRepository.findById(id);
|
Optional<Lecture> lecture = lectureRepository.findById(id);
|
||||||
|
|
||||||
Lecture l;
|
|
||||||
if (lecture.isPresent()) {
|
|
||||||
l = lecture.get();
|
|
||||||
|
|
||||||
System.out.println(l.isOnline());
|
|
||||||
l.setOnline(true);
|
|
||||||
System.out.println(l.isOnline());
|
|
||||||
|
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
|
if (!lecture.isPresent()) {
|
||||||
throw new RuntimeException("Lecture not found with id: " + id);
|
throw new RuntimeException("Lecture not found with id: " + id);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Lecture l;
|
||||||
|
l = lecture.get();
|
||||||
|
l.setOnline(true);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
lectureRepository.save(l);
|
lectureRepository.save(l);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -57,10 +57,9 @@ public class UserController {
|
|||||||
|
|
||||||
// 비밀번호 변경
|
// 비밀번호 변경
|
||||||
@PutMapping("/updatepassword")
|
@PutMapping("/updatepassword")
|
||||||
public ResponseEntity<String> updatePassword(
|
public ResponseEntity<String> updatePassword(@RequestBody PasswordDto passwordDto, HttpServletRequest request) {
|
||||||
|
try
|
||||||
@RequestBody PasswordDto passwordDto, HttpServletRequest request) {
|
{
|
||||||
try {
|
|
||||||
String token = request.getHeader("Authorization");
|
String token = request.getHeader("Authorization");
|
||||||
Long userId = Long.parseLong(jwtUtil.getUserId(token));
|
Long userId = Long.parseLong(jwtUtil.getUserId(token));
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user