feat: db update

This commit is contained in:
박정민 2024-08-05 13:21:59 +09:00
commit e0dcdee366
3 changed files with 20 additions and 31 deletions

View File

@ -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);
}

View File

@ -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;
}
}

View File

@ -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}