Merge branch 'main' of ssh://nio17.ulstu.ru:22023/sam.Teaching/DockerProject

This commit is contained in:
Антон Скалкин 2024-04-25 23:45:10 +04:00
commit c8502a703d
3 changed files with 47 additions and 0 deletions

View File

@ -0,0 +1,14 @@
package ru.ulstu.is.sbapp.configuration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;
@Configuration
public class PasswordEncoderConfiguration {
@Bean
public PasswordEncoder createPasswordEncoder() {
return new BCryptPasswordEncoder();
}
}

View File

@ -0,0 +1,26 @@
package ru.ulstu.is.sbapp.speaker.configuration;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import ru.ulstu.is.sbapp.speaker.domain.Speaker;
import ru.ulstu.is.sbapp.speaker.domain.SpeakerEng;
import ru.ulstu.is.sbapp.speaker.domain.SpeakerRus;
@Configuration
public class SpeakerConfiguration {
private final Logger log = LoggerFactory.getLogger(SpeakerConfiguration.class);
@Bean(value = "ru", initMethod = "init", destroyMethod = "destroy")
public SpeakerRus createRusSpeaker() {
log.info("Call createRusSpeaker()");
return new SpeakerRus();
}
@Bean(value = "en")
public Speaker createEngSpeaker() {
log.info("Call createEngSpeaker()");
return new SpeakerEng();
}
}

View File

@ -0,0 +1,7 @@
package ru.ulstu.is.sbapp.student.service;
public class StudentNotFoundException extends RuntimeException {
public StudentNotFoundException(Long id) {
super(String.format("Student with id [%s] is not found", id));
}
}