Skip to content

Instantly share code, notes, and snippets.

View ksundong's full-sized avatar
๐Ÿƒโ€โ™‚๏ธ
Run

Dion ksundong

๐Ÿƒโ€โ™‚๏ธ
Run
View GitHub Profile
@ksundong
ksundong / JacksonConfig.java
Last active April 7, 2020 02:57
Jackson Config (DateTime ํ‘œ์‹œํ˜•์‹ ์„ค์ •)
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;
@ksundong
ksundong / JasyptConfig.java
Last active April 7, 2020 08:13
Jasypt ์„ค์ •
// ์ฐธ๊ณ  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"); // ์•”ํ˜ธํ™” ํ‚ค ๊ฐ’<์„œ๋ฒ„์˜ ํ™˜๊ฒฝ๋ณ€์ˆ˜๋กœ ์„ค์ •ํ•ด์ค˜์•ผํ•จ>
@ksundong
ksundong / application.properties
Last active April 5, 2020 13:30
์ž์ฃผ ์“ฐ๋Š” ์„ค์ • ๋ฐ ์˜์กด์„ฑ(๊ฐœ๋ฐœ์šฉ)
#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
# ๋กœ๊ทธ๋ ˆ๋ฒจ ์„ค์ •
@ksundong
ksundong / application.properties
Created April 5, 2020 09:44
spring application properties ๋ถ„๋ฆฌํ•˜๊ธฐ
# profile ์„ค์ •
spring.profiles.active=<profile_name>
@ksundong
ksundong / SpringFoxConfig.java
Created March 31, 2020 10:59
Swagger2 SpringFox ์„ค์ •
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
@ksundong
ksundong / SimpleCorsFilter.java
Last active April 19, 2020 23:15
Cors ์„ค์ •
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
@ksundong
ksundong / Test.java
Created March 31, 2020 07:53
Application Context์™€ Logger๊ฐ€ ์ž˜ ๋ถˆ๋Ÿฌ์™€์ง€๋Š”์ง€ ํ…Œ์ŠคํŠธํ•˜๋Š” ์ฝ”๋“œ
@Autowired
private ApplicationContext applicationContext;
private static final Logger log = LoggerFactory.getLogger(DustApplicationTests.class);
@Test
void contextLoads() {
assertThat(applicationContext).isNotNull();
log.debug("Application Context๋ฅผ ์ •์ƒ์ ์œผ๋กœ ๋ถˆ๋Ÿฌ์™”์Šต๋‹ˆ๋‹ค.");
}
@ksundong
ksundong / README.md
Last active April 23, 2020 16:43
๋ฐฉํ•™๋™์•ˆ Slack์— ์˜ฌ๋ผ์˜จ ๋‚ด์šฉ ์ •๋ฆฌ
@ksundong
ksundong / README.md
Created February 29, 2020 13:54
ํ† ๋น„๋‹˜ ์Šคํ”„๋ง ๋ถ€ํŠธ ๊ฐ•์˜ ์ •๋ฆฌ

ํ† ๋น„๋‹˜์˜ ์Šคํ”„๋ง ๋ถ€ํŠธ ๊ฐ•์˜

์Šคํ”„๋ง ๋ถ€ํŠธ๊ฐ€ ๋ฌด์—‡์ธ์ง€ ๊ถ๊ธˆํ•˜๋ฉด ๋ ˆํผ๋Ÿฐ์Šค ๋ฌธ์„œ๋ฅผ ๋ณด์„ธ์š”!

โ‡’ ์Šคํ”„๋ง ๋ถ€ํŠธ๋Š” stand-alone, ์—…๋ฌด์— ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋Š” ์ˆ˜์ค€์˜ ์Šคํ”„๋ง ๊ธฐ๋ฐ˜ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์„ ์‰ฝ๊ฒŒ ๋งŒ๋“ค ์ˆ˜ ์žˆ๋„๋ก ๋งŒ๋“ค์–ด์ฃผ๋Š” ํ”„๋ ˆ์ž„์›Œํฌ๋ผ๊ณ  ์ƒ๊ฐํ•˜๋ฉด ๋œ๋‹ค. (์Šคํ”„๋ง์—์„œ ๋ฌด์—‡์„ ์„ ํƒํ• ์ง€ ๊ณ ๋ฏผ์„ ์ค„์—ฌ์ฃผ๋Š” ๋„๊ตฌ)

โ‡’ ์Šคํ”„๋ง์„ ์‚ฌ์šฉํ•˜๋Š” ๊ฒƒ์˜ Best-Practice๋“ค์ด ์ ์šฉ๋˜์–ด ์žˆ์Œ.

๊ฐ€๋Šฅํ•˜๋ฉด ์ธํ…”๋ฆฌ์ œ์ด ์ƒ์šฉ๋ฒ„์ „์„ ์‚ฌ์šฉํ•˜์„ธ์š”.

@ksundong
ksundong / README.md
Last active December 28, 2022 02:30
์ฝ”๋“œ์Šค์ฟผ๋“œ Q&A ๊ฒŒ์‹œํŒ ํ”„๋กœ์ ํŠธ ๋ฆฌ๋ทฐ ์ •๋ฆฌ

๋‹ค๋ฅธ ๋ถ„๋“ค PR Review ๋ณด๊ธฐ ๋ฐ Review๋“ค์˜ ์š”์•ฝ

  • ์ง๊ด€์ ์ธ ๋ณ€์ˆ˜๋ช…์˜ ์‚ฌ์šฉ. Naming์„ ์ข€ ๋” ์ƒ์„ธํ•˜๊ฒŒ ํ•ด๋ด…์‹œ๋‹ค.

  • ๋‚ ์งœ์™€ ์‹œ๊ฐ„์„ ๋‚˜ํƒ€๋‚ด๋Š” ํด๋ž˜์Šค๋Š” ZonedDateTime, LocalDateTime์ด ์žˆ๋Š”๋ฐ, ์ด๋“ค์„ ์–ธ์ œ ์„ ํƒํ•˜๋Š” ์ง€ ์ƒ๊ฐํ•ด๋ด…์‹œ๋‹ค.

  • field์˜ ํƒ€์ž…๊ณผ getter์˜ ํƒ€์ž…์ด ๋‹ค๋ฅธ ๊ฒฝ์šฐ๋ฅผ ์ง€์–‘ํ•ฉ์‹œ๋‹ค. ๋ณ„๋„์˜ ๋ฉ”์†Œ๋“œ๋กœ ๋ถ„๋ฆฌํ•ฉ์‹œ๋‹ค.

  • handlebar์—์„œ ๋ณ„๋„์˜ getter๋ฅผ ์–ด๋–ป๊ฒŒ ํ˜ธ์ถœํ•˜๋Š”์ง€ ์ƒ๊ฐํ•ด๋ด…์‹œ๋‹ค.

  • Q&A ๊ฒŒ์‹œํŒ์—์„œ ์ค‘๊ฐ„์˜ ์งˆ๋ฌธ์ด ์‚ญ์ œ๋˜๊ณ  ์ƒˆ๋กœ์šด ์งˆ๋ฌธ์ด ์ƒ์„ฑ๋˜์—ˆ์„ ๋•Œ, ์ธ๋ฑ์Šค๋Š” ์–ด๋–ป๊ฒŒ ์„ค์ •๋˜์–ด์•ผ ํ• ๊นŒ์š”?