diff --git a/backend/src/main/java/com/edufocus/edufocus/video/service/VideoSertvice.java b/backend/src/main/java/com/edufocus/edufocus/video/service/VideoSertvice.java index 53428f9..71b34d9 100644 --- a/backend/src/main/java/com/edufocus/edufocus/video/service/VideoSertvice.java +++ b/backend/src/main/java/com/edufocus/edufocus/video/service/VideoSertvice.java @@ -4,8 +4,10 @@ import java.sql.SQLException; public interface VideoSertvice { - void startOnline(Long userId,Long lectureId) throws SQLException; + void startOnline(Long userId, Long lectureId) throws SQLException; - boolean isRoomAccessible(Long lectureId,Long userId); + void stopOnline(Long userId, Long lectureId) throws SQLException; + + boolean isRoomAccessible(Long lectureId, Long userId); } diff --git a/backend/src/main/java/com/edufocus/edufocus/video/service/VideoServiceImpl.java b/backend/src/main/java/com/edufocus/edufocus/video/service/VideoServiceImpl.java index c6328e2..cf9714e 100644 --- a/backend/src/main/java/com/edufocus/edufocus/video/service/VideoServiceImpl.java +++ b/backend/src/main/java/com/edufocus/edufocus/video/service/VideoServiceImpl.java @@ -10,36 +10,39 @@ import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; import java.sql.SQLException; + @Service @Transactional @RequiredArgsConstructor -public class VideoServiceImpl implements VideoSertvice{ +public class VideoServiceImpl implements VideoSertvice { + + private final LectureService lectureService; + private final RegistrationService registrationService; - private final LectureService lectureService; - private final RegistrationService registrationService; @Override - public void startOnline(Long userId,Long lectureId) throws SQLException { + public void startOnline(Long userId, Long lectureId) throws SQLException { lectureService.changeState(lectureId); } + @Override + public void stopOnline(Long userId, Long lectureId) throws SQLException { + lectureService.changeState(lectureId); + } + @Override public boolean isRoomAccessible(Long lectureId, Long userId) { - - LectureDetailResponse lecture= lectureService.findLectureById(userId,userId); + LectureDetailResponse lecture = lectureService.findLectureById(userId, userId); - RegistrationStatus registrationStatus = registrationService.getStatus(userId,lectureId); + RegistrationStatus registrationStatus = registrationService.getStatus(userId, lectureId); - if(registrationStatus==RegistrationStatus.ACCEPTED && lecture.isOnline()) - { + if (registrationStatus == RegistrationStatus.ACCEPTED && lecture.isOnline()) { return true; - } - else - { + } else { return false; } } diff --git a/backend/src/main/resources/application.properties b/backend/src/main/resources/application.properties index b774bfc..aa22dc0 100644 --- a/backend/src/main/resources/application.properties +++ b/backend/src/main/resources/application.properties @@ -1,25 +1,17 @@ spring.application.name=edufocus server.port=8080 - server.ssl.enabled=false server.servlet.context-path=${CONTEXT_PATH} - # openvidu #server.port=${SERVER_PORT:6080} - - # LiveKit configuration livekit.api.key=${LIVEKIT_API_KEY:devkey} livekit.api.secret=${LIVEKIT_API_SECRET:secret} # JWT Salt (??? ?? ???? ???) - jwt.salt=${SALT} - # Access Token ?? ?? (??? ??) #jwt.access-token.expiretime=3600000 - jwt.access-token.expiretime=3000000 - # Refresh Token ?? ?? (??? ??) jwt.refresh-token.expiretime=504000000 #jwt.refresh-token.expiretime=4000 @@ -28,21 +20,13 @@ spring.datasource.url=${DATA_SOURCE_URL} spring.datasource.username=${USER_NAME} spring.datasource.password=${USER_PASSWORD} spring.mvc.pathmatch.matching-strategy=ant_path_matcher - spring.jpa.database=mysql -spring.jpa.hibernate.ddl-auto=create +spring.jpa.hibernate.ddl-auto=update spring.jpa.show-sql=true - - management.endpoints.web.exposure.include=health,info management.endpoint.health.show-details=always - - - spring.rabbitmq.host=${RABBITMQ_HOST} spring.rabbitmq.port=${RABBITMQ_PORT} spring.rabbitmq.username=${RABBITMQ_USERNAME} spring.rabbitmq.password=${RABBITMQ_PASSWORD} - - image.path=${IMAGE_PATH} \ No newline at end of file