| import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializer; | |
| import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer; | |
| import com.fasterxml.jackson.datatype.jsr310.ser.ZonedDateTimeSerializer; | |
| import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer; | |
| import org.springframework.context.annotation.Bean; | |
| import org.springframework.context.annotation.Configuration; | |
| import java.time.format.DateTimeFormatter; | |
| import java.util.TimeZone; |
| // ์ฐธ๊ณ https://elfinlas.github.io/2017/12/21/jsaypt/ | |
| @Configuration | |
| public class JasyptConfig { | |
| @Bean("jasyptStringEncryptor") | |
| public StringEncryptor stringEncryptor() { | |
| PooledPBEStringEncryptor encryptor = new PooledPBEStringEncryptor(); | |
| SimpleStringPBEConfig config = new SimpleStringPBEConfig(); | |
| config.setPassword("sign-up"); // ์ํธํ ํค ๊ฐ<์๋ฒ์ ํ๊ฒฝ๋ณ์๋ก ์ค์ ํด์ค์ผํจ> |
| #h2 DB inmemeory database | |
| spring.datasource.url=jdbc:h2:mem:<db๋ช > | |
| spring.datasource.driverClassName=org.h2.Driver | |
| spring.datasource.username=sa | |
| spring.datasource.password= | |
| # enable h2 console | |
| spring.h2.console.enabled=true | |
| spring.h2.console.path=/h2-console | |
| # ๋ก๊ทธ๋ ๋ฒจ ์ค์ |
| # profile ์ค์ | |
| spring.profiles.active=<profile_name> |
| import org.springframework.context.annotation.Bean; | |
| import org.springframework.context.annotation.Configuration; | |
| import springfox.documentation.builders.PathSelectors; | |
| import springfox.documentation.builders.RequestHandlerSelectors; | |
| import springfox.documentation.spi.DocumentationType; | |
| import springfox.documentation.spring.web.plugins.Docket; | |
| import springfox.documentation.swagger2.annotations.EnableSwagger2; | |
| @Configuration | |
| @EnableSwagger2 |
| import org.slf4j.Logger; | |
| import org.slf4j.LoggerFactory; | |
| import org.springframework.stereotype.Component; | |
| import javax.servlet.*; | |
| import javax.servlet.http.HttpServletRequest; | |
| import javax.servlet.http.HttpServletResponse; | |
| import java.io.IOException; | |
| @Component |
| @Autowired | |
| private ApplicationContext applicationContext; | |
| private static final Logger log = LoggerFactory.getLogger(DustApplicationTests.class); | |
| @Test | |
| void contextLoads() { | |
| assertThat(applicationContext).isNotNull(); | |
| log.debug("Application Context๋ฅผ ์ ์์ ์ผ๋ก ๋ถ๋ฌ์์ต๋๋ค."); | |
| } |
์คํ๋ง ๋ถํธ๊ฐ ๋ฌด์์ธ์ง ๊ถ๊ธํ๋ฉด ๋ ํผ๋ฐ์ค ๋ฌธ์๋ฅผ ๋ณด์ธ์!
โ ์คํ๋ง ๋ถํธ๋ stand-alone, ์ ๋ฌด์ ์ฌ์ฉํ ์ ์๋ ์์ค์ ์คํ๋ง ๊ธฐ๋ฐ ์ ํ๋ฆฌ์ผ์ด์ ์ ์ฝ๊ฒ ๋ง๋ค ์ ์๋๋ก ๋ง๋ค์ด์ฃผ๋ ํ๋ ์์ํฌ๋ผ๊ณ ์๊ฐํ๋ฉด ๋๋ค. (์คํ๋ง์์ ๋ฌด์์ ์ ํํ ์ง ๊ณ ๋ฏผ์ ์ค์ฌ์ฃผ๋ ๋๊ตฌ)
โ ์คํ๋ง์ ์ฌ์ฉํ๋ ๊ฒ์ Best-Practice๋ค์ด ์ ์ฉ๋์ด ์์.
๊ฐ๋ฅํ๋ฉด ์ธํ ๋ฆฌ์ ์ด ์์ฉ๋ฒ์ ์ ์ฌ์ฉํ์ธ์.
-
์ง๊ด์ ์ธ ๋ณ์๋ช ์ ์ฌ์ฉ. Naming์ ์ข ๋ ์์ธํ๊ฒ ํด๋ด ์๋ค.
-
๋ ์ง์ ์๊ฐ์ ๋ํ๋ด๋ ํด๋์ค๋ ZonedDateTime, LocalDateTime์ด ์๋๋ฐ, ์ด๋ค์ ์ธ์ ์ ํํ๋ ์ง ์๊ฐํด๋ด ์๋ค.
-
field์ ํ์ ๊ณผ getter์ ํ์ ์ด ๋ค๋ฅธ ๊ฒฝ์ฐ๋ฅผ ์ง์ํฉ์๋ค. ๋ณ๋์ ๋ฉ์๋๋ก ๋ถ๋ฆฌํฉ์๋ค.
-
handlebar์์ ๋ณ๋์ getter๋ฅผ ์ด๋ป๊ฒ ํธ์ถํ๋์ง ์๊ฐํด๋ด ์๋ค.
-
Q&A ๊ฒ์ํ์์ ์ค๊ฐ์ ์ง๋ฌธ์ด ์ญ์ ๋๊ณ ์๋ก์ด ์ง๋ฌธ์ด ์์ฑ๋์์ ๋, ์ธ๋ฑ์ค๋ ์ด๋ป๊ฒ ์ค์ ๋์ด์ผ ํ ๊น์?