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
RestTemplate restTemplate = RestTemplateFactory.createTemplate(readTimeout, connectionTimeout); | |
String url = String.format("https://androidpublisher.googleapis.com/androidpublisher/v3/applications/%s/reviews?access_token=%s&startIndex=1&maxResults=20", packageName, accessToken); | |
restTemplate.getForObject(url, ReviewsListResponse.class); |
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
HttpTransport httpTransport = GoogleNetHttpTransport.newTrustedTransport(); | |
JsonFactory jsonFactory = JacksonFactory.getDefaultInstance(); | |
// Google Cloud Platform에서 발급 받은 인증서 파일입니다. | |
InputStream inputStream = getClass().getResourceAsStream(p12FilePath); | |
// Google Cloud Platform에서 인증서를 발급 받은 서비스 계정명입니다. | |
GoogleCredential credential = new GoogleCredential.Builder() | |
.setTransport(httpTransport) | |
.setJsonFactory(jsonFactory) |
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
spring: | |
datasource: | |
master: | |
minimumIdle: 0 | |
maximumPoolSize: 20 | |
connectionTestQuery: 'select 1' | |
jdbcUrl: jdbc:mysql://localhost:3306/sa | |
username: sa | |
password: 'sa' | |
driverClassName: com.mysql.cj.jdbc.Driver |
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
class RoutingDataSource : AbstractRoutingDataSource() { | |
override fun determineCurrentLookupKey(): Any { | |
return if (TransactionSynchronizationManager.isCurrentTransactionReadOnly()) "slave" else "master" | |
} | |
} |
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
@Configuration | |
@EntityScan(basePackages = ["com.beauty.domain"]) | |
@EnableJpaRepositories(basePackages = ["com.beauty.repository"]) | |
@EnableTransactionManagement | |
@EnableAutoConfiguration(exclude = [DataSourceAutoConfiguration::class]) | |
class DataSourceConfig { | |
companion object { | |
const val MASTER = "master" | |
const val SLAVE = "slave" |
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
class Solution { | |
fun solution(s: String, n: Int): String { | |
return s.toCharArray().map { map(it, n) }.joinToString("") | |
} | |
private fun map(s: Char, n: Int): Char { | |
val ch = s.toInt() | |
if (ch in 65..90){ |
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
class Solution { | |
fun solution(s: String): Int { | |
//return s.toInt() | |
if (s[0] == '-') { | |
return Integer.parseInt(s.substring(1)) * -1 | |
} | |
return Integer.parseInt(s) | |
} |
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
class Solution { | |
fun solution(numbers: IntArray): String { | |
val sorted = numbers.sortedWith(Comparator { o1, o2 -> compare1(o1, o2) }) | |
if (sorted.stream().allMatch { it == 0 }){ | |
return "0" | |
} | |
return sorted.joinToString("") |
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
class Solution { | |
fun solution(seoul: Array<String>): String { | |
for ((idx, word) in seoul.withIndex()){ | |
if (word == "Kim"){ | |
return "김서방은 ${idx}에 있다" | |
} | |
} |
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
class Solution { | |
fun solution(s: String): Boolean { | |
if (s.length != 4 && s.length != 6){ | |
return false | |
} | |
for (c in s.toCharArray()){ | |
if (!c.isDigit()){ | |
return false |
NewerOlder