This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object CustomAopObject { | |
val log = KotlinLogging.logger { } | |
/** | |
* 커리함수테스트 | |
*/ | |
fun <T> manageTransaction(method: () -> T): T? { | |
try { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@EnableScheduling | |
@EnableAsync | |
@Configuration | |
class AsyncConfig( | |
) : AsyncConfigurerSupport() { | |
/** | |
* 최초 coreSize개의 스레드에서 처리하다가 처리 속도가 밀릴 경우 | |
* queueCapacity 사이즈 queue에서 대기하고 그보다 많은 요청이 들어올 경우 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Repository | |
class MemoryTokenRepositoryImpl : TokenRepository { | |
/** | |
* https://hippolab.tistory.com/44 | |
* concurrent 지원 | |
* refresh token 저장용 | |
*/ | |
private val log = KotlinLogging.logger { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
fun tokenRepositoyTest(){ | |
val tokenRepository:TokenRepository = MemoryTokenRepositoryImpl() | |
val numberOfThreads = 1000 | |
val service = Executors.newFixedThreadPool(10) | |
val latch = CountDownLatch(numberOfThreads) | |
for ( index in 1..numberOfThreads){ | |
service.submit { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface QuerryRunner { | |
fun getInstance(): QueryRunnerFactory | |
} | |
class QueryRunnerFactory( | |
) : QuerryRunner { | |
companion object Factory { | |
var queryRunner = QueryRunnerFactory() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Component | |
class GlobalValue { | |
companion object { | |
@JvmField | |
lateinit var DATABASE: String | |
} | |
@Value("\${mongodb.db}") | |
fun setDatabase(db: String) { | |
DATABASE = db; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun convertPojoToUrlEncodedFormData(obj: Any?): String { | |
/** | |
* 간단한 함수 input + output 테스트를 위하므로, ObjectMapper를 의존성 주입시키지 않겠다.(스프링과는 독립적인) | |
* util function들은 최대한 의존성 없이 | |
* | |
*/ | |
val map: Map<*, *>? = ObjectMapper().convertValue(obj, Map::class.java) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@org.springframework.web.bind.annotation.RestControllerAdvice | |
class RestControllerAdvice<T>( | |
) : ResponseBodyAdvice<T>{ | |
private val log = KotlinLogging.logger { } | |
override fun supports(returnType: MethodParameter, converterType: Class<out HttpMessageConverter<*>>): Boolean { | |
//log.info { "returnType: $returnType" } | |
return true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
fun pathParsingTest() { | |
val path = "/v1/members" | |
log.info { | |
path.split(delimiters = arrayOf("/"," ")).filter { it.isNotEmpty() }.forEach { | |
println(" $it ") | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let rds = { | |
monUiCtl: [], | |
isRun: false, | |
ctlUIStart: function (idx, ch) { | |
console.log("ctlUIStart????", idx, ch); | |
this.monUiCtl[idx].value.changeLayout( | |
1, |
NewerOlder