mirror of
https://github.com/MewoLab/AquaDX.git
synced 2026-10-10 08:08:32 +03:00
[U] Java 21 -> Java 25 (#232)
This commit is contained in:
@@ -277,4 +277,4 @@ fun List<List<Any?>>.numCsv(vararg head: Str) = head.joinToString(",") + "\n" +
|
||||
joinToString("\n") { it.joinToString(",") }
|
||||
|
||||
// DI
|
||||
inline fun <reified T> ApplicationContext.lazy() = lazy { getBean(T::class.java) }
|
||||
inline fun <reified T : Any> ApplicationContext.lazy() = kotlin.lazy { getBean(T::class.java) }
|
||||
|
||||
@@ -32,7 +32,6 @@ val JSON_DATETIME = SimpleModule().addDeserializer(java.time.LocalDateTime::clas
|
||||
} }
|
||||
})
|
||||
val JACKSON = jacksonObjectMapper().apply {
|
||||
setSerializationInclusion(JsonInclude.Include.NON_NULL)
|
||||
setDefaultPropertyInclusion(JsonInclude.Include.NON_NULL)
|
||||
findAndRegisterModules()
|
||||
registerModule(JSON_FUZZY_BOOLEAN)
|
||||
|
||||
@@ -68,7 +68,7 @@ class CardController(
|
||||
*/
|
||||
@API("/link")
|
||||
@Doc("Bind a card to the user. This action will migrate selected data from the card to the user's ghost card.", "Success message")
|
||||
suspend fun link(@RP token: Str, @RP cardId: Str, @RP migrate: Str) = jwt.auth(token) { u ->
|
||||
suspend fun link(@RP token: Str, @RP cardId: Str, @RP migrate: Str): Any = jwt.auth(token) { u ->
|
||||
// Check if the user's card limit is reached
|
||||
if (u.cards.size >= props.linkCardLimit) 400 - "Card limit reached"
|
||||
|
||||
|
||||
@@ -154,7 +154,7 @@ class Fedy(
|
||||
forEach { (k, v) -> v?.let { GAME_OPTIONS_FIELDS[k]?.set(options, it) } }
|
||||
}
|
||||
us.userRepo.save(ru)
|
||||
if (fields.containsKey("pwHash") ?: false) { us.clearAllSessions(ru) }
|
||||
if (fields.containsKey("pwHash")) { us.clearAllSessions(ru) }
|
||||
UserUpdateRes(user = ru.fedyBasicInfo())
|
||||
} caught { UserUpdateRes(error = it) }
|
||||
}
|
||||
|
||||
@@ -1,12 +1,16 @@
|
||||
package icu.samnyan.aqua.net.components
|
||||
|
||||
import jakarta.mail.Message
|
||||
import ext.Bool
|
||||
import ext.Str
|
||||
import ext.logger
|
||||
import icu.samnyan.aqua.net.db.*
|
||||
import org.simplejavamail.api.email.Recipient
|
||||
import org.simplejavamail.api.mailer.Mailer
|
||||
import org.simplejavamail.email.EmailBuilder
|
||||
import org.simplejavamail.springsupport.SimpleJavaMailSpringSupport
|
||||
import org.springframework.beans.factory.ObjectProvider
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
|
||||
import org.springframework.boot.context.event.ApplicationStartedEvent
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties
|
||||
import org.springframework.context.annotation.Configuration
|
||||
@@ -25,15 +29,19 @@ class EmailProperties {
|
||||
var webHost: Str = "aquadx.net"
|
||||
}
|
||||
|
||||
@Configuration
|
||||
@ConditionalOnProperty(prefix = "aqua-net.email", name = ["enable"], havingValue = "true")
|
||||
@Import(SimpleJavaMailSpringSupport::class)
|
||||
class EmailMailerConfiguration
|
||||
|
||||
/**
|
||||
* Email service. All email related operations should be placed here.
|
||||
*
|
||||
* Library Documentation: https://www.simplejavamail.org/
|
||||
*/
|
||||
@Service
|
||||
@Import(SimpleJavaMailSpringSupport::class)
|
||||
class EmailService(
|
||||
val mailer: Mailer,
|
||||
val mailerProvider: ObjectProvider<Mailer>,
|
||||
val props: EmailProperties,
|
||||
val confirmationRepo: EmailConfirmationRepo,
|
||||
val resetPasswordRepo: ResetPasswordRepo,
|
||||
@@ -44,13 +52,16 @@ class EmailService(
|
||||
val resetTemplate: Str = this::class.java.getResource("/email/reset.html")?.readText()
|
||||
?: throw Exception("Password Reset Template Not Found")
|
||||
|
||||
private fun mailer() = mailerProvider.getIfAvailable()
|
||||
?: throw IllegalStateException("Email is enabled, but Simple Java Mail is not configured")
|
||||
|
||||
@Async
|
||||
@EventListener(ApplicationStartedEvent::class)
|
||||
fun test() {
|
||||
if (!props.enable) return
|
||||
|
||||
try {
|
||||
mailer.testConnection()
|
||||
mailer().testConnection()
|
||||
log.info("Email Service Connected")
|
||||
} catch (e: Exception) {
|
||||
log.error("Email Service Connection Failed", e)
|
||||
@@ -71,9 +82,9 @@ class EmailService(
|
||||
|
||||
// Send email
|
||||
log.info("Sending verification email to ${user.email}")
|
||||
mailer.sendMail(EmailBuilder.startingBlank()
|
||||
mailer().sendMail(EmailBuilder.startingBlank()
|
||||
.from(props.senderName, props.senderAddr)
|
||||
.to(user.computedName, user.email)
|
||||
.withRecipients(Recipient(user.computedName, user.email, Message.RecipientType.TO, null))
|
||||
.withSubject("Verify Your Email Address for AquaNet")
|
||||
.withHTMLText(confirmTemplate
|
||||
.replace("{{name}}", user.computedName)
|
||||
@@ -94,9 +105,9 @@ class EmailService(
|
||||
|
||||
// Send email
|
||||
log.info("Sending reset password email to ${user.email}")
|
||||
mailer.sendMail(EmailBuilder.startingBlank()
|
||||
mailer().sendMail(EmailBuilder.startingBlank()
|
||||
.from(props.senderName, props.senderAddr)
|
||||
.to(user.computedName, user.email)
|
||||
.withRecipients(Recipient(user.computedName, user.email, Message.RecipientType.TO, null))
|
||||
.withSubject("Reset Your Password for AquaNet")
|
||||
.withHTMLText(resetTemplate
|
||||
.replace("{{name}}", user.computedName)
|
||||
@@ -108,9 +119,9 @@ class EmailService(
|
||||
if (!props.enable) return
|
||||
|
||||
log.info("Sending test email to $addr")
|
||||
mailer.sendMail(EmailBuilder.startingBlank()
|
||||
mailer().sendMail(EmailBuilder.startingBlank()
|
||||
.from(props.senderName, props.senderAddr)
|
||||
.to(name, addr)
|
||||
.withRecipients(Recipient(name, addr, Message.RecipientType.TO, null))
|
||||
.withSubject("Test Email")
|
||||
.withPlainText("This is a test email to check if AquaNet Email Works").buildEmail()).thenRun {
|
||||
log.info("Test email sent to $addr")
|
||||
|
||||
@@ -77,7 +77,7 @@ class GeoIP(
|
||||
{
|
||||
return try {
|
||||
val ipa = InetAddress.getByName(ip)
|
||||
geoLite.country(ipa)?.country?.isoCode ?: ""
|
||||
geoLite.country(ipa)?.country()?.isoCode() ?: ""
|
||||
}
|
||||
catch (e: AddressNotFoundException) { "" }
|
||||
catch (e: Exception) {
|
||||
@@ -85,4 +85,4 @@ class GeoIP(
|
||||
""
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -221,21 +221,23 @@ class AquaUserServices(
|
||||
400 - "User with username `$this` already exists"
|
||||
}
|
||||
|
||||
fun validateEmail(email: Str) = email.apply {
|
||||
// Check if email is valid
|
||||
if (!isValidEmail()) 400 - "Invalid email"
|
||||
|
||||
// Check if user with the same email exists
|
||||
if (userRepo.findByEmailIgnoreCase(email) != null)
|
||||
400 - "User with email `$email` already exists"
|
||||
}
|
||||
|
||||
fun checkPwHash(password: Str) = password.run {
|
||||
// Validate password
|
||||
if (length < 8) 400 - "Password must be at least 8 characters"
|
||||
|
||||
hasher.encode(this)
|
||||
}
|
||||
fun validateEmail(email: Str): Str {
|
||||
// Check if email is valid
|
||||
if (!email.isValidEmail()) 400 - "Invalid email"
|
||||
|
||||
// Check if user with the same email exists
|
||||
if (userRepo.findByEmailIgnoreCase(email) != null)
|
||||
400 - "User with email `$email` already exists"
|
||||
|
||||
return email
|
||||
}
|
||||
|
||||
fun checkPwHash(password: Str): Str {
|
||||
// Validate password
|
||||
if (password.length < 8) 400 - "Password must be at least 8 characters"
|
||||
|
||||
return hasher.encode(password) ?: (500 - "Failed to hash password")
|
||||
}
|
||||
|
||||
fun checkDisplayName(displayName: Str) = displayName.apply {
|
||||
// Check if display name is valid
|
||||
|
||||
@@ -41,7 +41,7 @@ interface IExportClass<UserModel: IUserData> {
|
||||
}
|
||||
|
||||
@NoRepositoryBean
|
||||
interface IUserRepo<UserModel, ThisModel>: JpaRepository<ThisModel, Long> {
|
||||
interface IUserRepo<UserModel : IUserData, ThisModel : Any>: JpaRepository<ThisModel, Long> {
|
||||
fun findByUser(user: UserModel): List<ThisModel>
|
||||
fun findSingleByUser(user: UserModel): ThisModel?
|
||||
}
|
||||
|
||||
@@ -96,7 +96,6 @@ class AimeDB(
|
||||
}
|
||||
}
|
||||
|
||||
@Deprecated("Deprecated in Netty 5") // TODO: Move this to ChannelInboundHandler
|
||||
override fun exceptionCaught(ctx: ChannelHandlerContext, cause: Throwable) {
|
||||
logger.error("AimeDB: Error", cause)
|
||||
ctx.close()
|
||||
|
||||
@@ -4,7 +4,8 @@ import ext.logger
|
||||
import io.netty.bootstrap.ServerBootstrap
|
||||
import io.netty.channel.ChannelInitializer
|
||||
import io.netty.channel.ChannelOption
|
||||
import io.netty.channel.nio.NioEventLoopGroup
|
||||
import io.netty.channel.MultiThreadIoEventLoopGroup
|
||||
import io.netty.channel.nio.NioIoHandler
|
||||
import io.netty.channel.socket.SocketChannel
|
||||
import io.netty.channel.socket.nio.NioServerSocketChannel
|
||||
import io.netty.handler.logging.LogLevel
|
||||
@@ -38,7 +39,10 @@ class AimeDbServer(
|
||||
if (!props.enable) return logger.info("Aime DB is disabled.")
|
||||
|
||||
val bootstrap = ServerBootstrap()
|
||||
.group(NioEventLoopGroup(), NioEventLoopGroup())
|
||||
.group(
|
||||
MultiThreadIoEventLoopGroup(NioIoHandler.newFactory()),
|
||||
MultiThreadIoEventLoopGroup(NioIoHandler.newFactory())
|
||||
)
|
||||
.handler(LoggingHandler(LogLevel.DEBUG))
|
||||
.channel(NioServerSocketChannel::class.java)
|
||||
.childHandler(initializer)
|
||||
|
||||
@@ -11,8 +11,8 @@ import org.eclipse.jetty.util.resource.URLResourceFactory
|
||||
import org.eclipse.jetty.util.ssl.SslContextFactory
|
||||
import org.springframework.beans.factory.annotation.Value
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties
|
||||
import org.springframework.boot.web.embedded.jetty.JettyServerCustomizer
|
||||
import org.springframework.boot.web.embedded.jetty.JettyServletWebServerFactory
|
||||
import org.springframework.boot.jetty.JettyServerCustomizer
|
||||
import org.springframework.boot.jetty.servlet.JettyServletWebServerFactory
|
||||
import org.springframework.boot.web.server.WebServerFactoryCustomizer
|
||||
import org.springframework.context.annotation.Bean
|
||||
import org.springframework.context.annotation.Configuration
|
||||
|
||||
@@ -18,7 +18,7 @@ import icu.samnyan.aqua.sega.util.StaticRepo
|
||||
|
||||
|
||||
@NoRepositoryBean
|
||||
interface Chu3UserLinked<T> : IUserRepo<Chu3UserData, T> {
|
||||
interface Chu3UserLinked<T : Any> : IUserRepo<Chu3UserData, T> {
|
||||
fun findByUser_Card_ExtId(extId: Long): List<T>
|
||||
fun findSingleByUser_Card_ExtId(extId: Long): T?
|
||||
fun findByUser_Card_ExtId(extId: Long, pageable: Pageable): Page<T>
|
||||
|
||||
@@ -60,9 +60,9 @@ class PsRankingHandler(val db: DivaRepos) {
|
||||
score1.add(obj.first.maxScore)
|
||||
score2.add(obj.second.maxScore)
|
||||
score3.add(obj.third.maxScore)
|
||||
name1.add(encode(obj.first.pdId?.playerName ?: "xxx"))
|
||||
name2.add(encode(obj.second.pdId?.playerName ?: "xxx"))
|
||||
name3.add(encode(obj.third.pdId?.playerName ?: "xxx"))
|
||||
name1.add(encode(obj.first.pdId.playerName))
|
||||
name2.add(encode(obj.second.pdId.playerName))
|
||||
name3.add(encode(obj.third.pdId.playerName))
|
||||
}
|
||||
|
||||
return PsRankingResponse(
|
||||
|
||||
@@ -9,7 +9,6 @@ import icu.samnyan.aqua.sega.diva.model.db.userdata.*
|
||||
import icu.samnyan.aqua.sega.diva.util.DivaCalculator
|
||||
import org.apache.commons.lang3.StringUtils
|
||||
import org.springframework.stereotype.Component
|
||||
import java.lang.String
|
||||
import java.time.LocalDateTime
|
||||
import java.util.*
|
||||
import java.util.function.Supplier
|
||||
@@ -100,7 +99,7 @@ class StageResultHandler(val db: DivaRepos, val calc: DivaCalculator) {
|
||||
|
||||
// Calculate reward
|
||||
// Contest reward
|
||||
var contestSpecifier = String.join(",", *request.cr_sp)
|
||||
var contestSpecifier = request.cr_sp.joinToString(",")
|
||||
val contestRewardType = arrayOf<kotlin.String?>("-1", "-1", "-1")
|
||||
val contestRewardValue = arrayOf<kotlin.String?>("-1", "-1", "-1")
|
||||
val contestRewardString1 = arrayOf<kotlin.String?>("***", "***", "***")
|
||||
@@ -204,10 +203,10 @@ class StageResultHandler(val db: DivaRepos, val calc: DivaCalculator) {
|
||||
request.cr_cid,
|
||||
request.cr_tv,
|
||||
contestSpecifier,
|
||||
String.join(",", *contestRewardType),
|
||||
String.join(",", *contestRewardValue),
|
||||
String.join(",", *contestRewardString1),
|
||||
String.join(",", *contestRewardString2),
|
||||
contestRewardType.joinToString(","),
|
||||
contestRewardValue.joinToString(","),
|
||||
contestRewardString1.joinToString(","),
|
||||
contestRewardString2.joinToString(","),
|
||||
contestEntryRewardType,
|
||||
contestEntryRewardValue,
|
||||
contestEntryRewardString1,
|
||||
@@ -328,7 +327,7 @@ class StageResultHandler(val db: DivaRepos, val calc: DivaCalculator) {
|
||||
while (result.size < 60) {
|
||||
result.add("-1")
|
||||
}
|
||||
return String.join(",", result)
|
||||
return result.joinToString(",")
|
||||
}
|
||||
|
||||
private fun updateReward(
|
||||
|
||||
@@ -11,7 +11,6 @@ import icu.samnyan.aqua.sega.diva.model.db.gamedata.Contest
|
||||
import icu.samnyan.aqua.sega.diva.model.db.userdata.PlayerContest
|
||||
import icu.samnyan.aqua.sega.diva.util.DivaStringUtils
|
||||
import org.springframework.stereotype.Component
|
||||
import java.lang.String
|
||||
import java.time.LocalDateTime
|
||||
import java.util.function.Supplier
|
||||
import kotlin.Any
|
||||
@@ -47,7 +46,7 @@ class EndHandler(val db: DivaRepos) {
|
||||
profile.contestNowPlayingId = request.cr_cid
|
||||
profile.contestNowPlayingResultRank = currentResultRank
|
||||
profile.contestNowPlayingValue = request.cr_tv
|
||||
profile.contestNowPlayingSpecifier = String.join(",", *request.cr_sp)
|
||||
profile.contestNowPlayingSpecifier = request.cr_sp.joinToString(",")
|
||||
} else {
|
||||
val contestRecord =
|
||||
db.contest.findByPdIdAndContestId(profile, request.cr_cid).orElseGet(
|
||||
|
||||
@@ -85,7 +85,7 @@ class Contest : Serializable {
|
||||
}
|
||||
list += listOf(-1, -2, "7fffffffffffffffffffffffffffffff")
|
||||
} else {
|
||||
val groups = pvl!!.split(',').dropLastWhile { it.isEmpty() }.toTypedArray()
|
||||
val groups = pvl.split(',').dropLastWhile { it.isEmpty() }.toTypedArray()
|
||||
if (groups.size < i) {
|
||||
list += listOf(-1, -1, -2, -2, -1, -2, "7fffffffffffffffffffffffffffffff")
|
||||
} else {
|
||||
@@ -98,7 +98,7 @@ class Contest : Serializable {
|
||||
list.add(this.maxComplexity)
|
||||
list.add(-1)
|
||||
} else {
|
||||
val diffList = pvdl!!.split(',').dropLastWhile { it.isEmpty() }.toTypedArray()
|
||||
val diffList = pvdl.split(',').dropLastWhile { it.isEmpty() }.toTypedArray()
|
||||
if (diffList.size < i) {
|
||||
list.add(this.minComplexity)
|
||||
list.add(this.maxComplexity)
|
||||
|
||||
@@ -20,7 +20,7 @@ import icu.samnyan.aqua.sega.util.StaticRepo
|
||||
import java.util.*
|
||||
|
||||
@NoRepositoryBean
|
||||
interface Mai2UserLinked<T>: JpaRepository<T, Long>, IUserRepo<Mai2UserDetail, T> {
|
||||
interface Mai2UserLinked<T : Any>: JpaRepository<T, Long>, IUserRepo<Mai2UserDetail, T> {
|
||||
fun findByUser_Card_ExtId(userId: Long): List<T>
|
||||
fun findByUser_Card_ExtId(userId: Long, page: Pageable): Page<T>
|
||||
fun findSingleByUser_Card_ExtId(userId: Long): T?
|
||||
|
||||
@@ -18,7 +18,7 @@ import java.util.*
|
||||
|
||||
|
||||
@NoRepositoryBean
|
||||
interface OngekiUserLinked<T> : IUserRepo<UserData, T> {
|
||||
interface OngekiUserLinked<T : Any> : IUserRepo<UserData, T> {
|
||||
fun findByUser_Card_ExtId(extId: Long): List<T>
|
||||
fun findSingleByUser_Card_ExtId(extId: Long): T?
|
||||
fun findByUser_Card_ExtId(extId: Long, pageable: Pageable): Page<T>
|
||||
@@ -221,4 +221,3 @@ class OngekiRepos(
|
||||
val u: OngekiUserRepos,
|
||||
val g: OngekiGameRepos,
|
||||
)
|
||||
|
||||
|
||||
@@ -14,9 +14,9 @@ interface WcUserRepo : JpaRepository<WaccaUser, Long>, GenericUserDataRepo<Wacca
|
||||
}
|
||||
|
||||
@NoRepositoryBean
|
||||
interface IWaccaUserLinked<T> : JpaRepository<T, Long> {
|
||||
interface IWaccaUserLinked<T : Any> : JpaRepository<T, Long> {
|
||||
fun findByUser(user: WaccaUser): List<T>
|
||||
fun findByUserCardExtId(userId: Long): List<T>
|
||||
fun findByUserCardExtId(extId: Long): List<T>
|
||||
@Transactional
|
||||
fun deleteByUser(user: WaccaUser)
|
||||
}
|
||||
@@ -54,4 +54,4 @@ class WaccaRepos(
|
||||
val bestScore: WcUserBestScoreRepo,
|
||||
val playLog: WcUserPlayLogRepo,
|
||||
val stageUp: WcUserStageUpRepo
|
||||
)
|
||||
)
|
||||
|
||||
@@ -33,7 +33,6 @@ class WaccaUser : BaseEntity(), IUserData {
|
||||
var titles: MutableList<Int> = mutableListOf(0, 0, 0)
|
||||
override var playerRating = 0
|
||||
override var highestRating = 0
|
||||
@Temporal(TemporalType.TIMESTAMP)
|
||||
var vipExpireTime: Date = Date(0)
|
||||
var alwaysVip = false
|
||||
var loginCount = 0
|
||||
@@ -50,11 +49,8 @@ class WaccaUser : BaseEntity(), IUserData {
|
||||
override var lastRomVersion = "1.0.0"
|
||||
@Convert(converter = IntegerListConverter::class)
|
||||
var lastSongInfo: MutableList<Int> = mutableListOf(0, 0, 0, 0, 0)
|
||||
@Temporal(TemporalType.TIMESTAMP)
|
||||
var lastConsecDate: Date = Date(0)
|
||||
@Temporal(TemporalType.TIMESTAMP)
|
||||
override var lastPlayDate: Date = Date()
|
||||
@Temporal(TemporalType.TIMESTAMP)
|
||||
override var firstPlayDate: Date = Date()
|
||||
var gateTutorialFlags: String = "[[1, 0], [2, 0], [3, 0], [4, 0], [5, 0]]"
|
||||
@Convert(converter = IntegerListConverter::class)
|
||||
@@ -71,4 +67,4 @@ class WaccaUser : BaseEntity(), IUserData {
|
||||
else vipExpireTime
|
||||
|
||||
val moddedWp get() = if (card?.aquaUser?.gameOptions?.waccaInfiniteWp == true) 999999 else wp
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,7 +56,6 @@ class WcUserGate : WaccaUserEntity() {
|
||||
var progress = 0
|
||||
var loops = 0
|
||||
|
||||
@Temporal(TemporalType.TIMESTAMP)
|
||||
var lastUsed = Date(0)
|
||||
var missionFlag = 0
|
||||
var totalPoints = 0
|
||||
@@ -74,7 +73,6 @@ class WcUserItem(
|
||||
var p2: Long = 0L,
|
||||
var p3: Long = 0L,
|
||||
|
||||
@Temporal(TemporalType.TIMESTAMP)
|
||||
var acquiredDate: Date = Date(),
|
||||
) : WaccaUserEntity() {
|
||||
fun ls() = when (type) {
|
||||
@@ -133,7 +131,6 @@ class WcUserPlayLog : WaccaUserEntity(), IGenericGamePlaylog {
|
||||
override var beforeRating = 0
|
||||
override var afterRating = 0
|
||||
|
||||
@Temporal(TemporalType.TIMESTAMP)
|
||||
override var userPlayDate = Date()
|
||||
|
||||
fun clears() = ls(1, +isClear, +isFullCombo, +isMissless, +isAllPerfect)
|
||||
|
||||
@@ -4,8 +4,8 @@ import icu.samnyan.aqua.sega.aimedb.AimeDbProps
|
||||
import icu.samnyan.aqua.sega.allnet.AllNetProps
|
||||
import org.apache.hc.client5.http.impl.classic.HttpClients
|
||||
import org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManagerBuilder
|
||||
import org.apache.hc.client5.http.ssl.ClientTlsStrategyBuilder
|
||||
import org.apache.hc.client5.http.ssl.NoopHostnameVerifier
|
||||
import org.apache.hc.client5.http.ssl.SSLConnectionSocketFactoryBuilder
|
||||
import org.apache.hc.client5.http.ssl.TrustAllStrategy
|
||||
import org.apache.hc.core5.ssl.SSLContextBuilder
|
||||
import org.springframework.beans.factory.annotation.Value
|
||||
@@ -71,11 +71,11 @@ class AutoChecker(
|
||||
val rt = HttpComponentsClientHttpRequestFactory().apply {
|
||||
httpClient = HttpClients.custom()
|
||||
.setConnectionManager(PoolingHttpClientConnectionManagerBuilder.create()
|
||||
.setSSLSocketFactory(SSLConnectionSocketFactoryBuilder.create()
|
||||
.setTlsSocketStrategy(ClientTlsStrategyBuilder.create()
|
||||
.setHostnameVerifier(NoopHostnameVerifier.INSTANCE)
|
||||
.setSslContext(SSLContextBuilder.create()
|
||||
.loadTrustMaterial(TrustAllStrategy.INSTANCE)
|
||||
.build()).build()).build()).build()
|
||||
.build()).buildClassic()).build()).build()
|
||||
}.let { RestTemplate(it) }
|
||||
|
||||
val url = "https://${aimedb.address}:$BILLING_PORT/sys/test"
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration>
|
||||
<conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter" />
|
||||
<conversionRule conversionWord="cmp" converterClass="icu.samnyan.aqua.spring.LoggerComponent" />
|
||||
<conversionRule conversionWord="cls" converterClass="icu.samnyan.aqua.spring.LoggerClassColor" />
|
||||
<conversionRule conversionWord="correlationId" converterClass="org.springframework.boot.logging.logback.CorrelationIdConverter" />
|
||||
<conversionRule conversionWord="wex" converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter" />
|
||||
<conversionRule conversionWord="wEx" converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter" />
|
||||
<conversionRule conversionWord="clr" class="org.springframework.boot.logging.logback.ColorConverter" />
|
||||
<conversionRule conversionWord="cmp" class="icu.samnyan.aqua.spring.LoggerComponent" />
|
||||
<conversionRule conversionWord="cls" class="icu.samnyan.aqua.spring.LoggerClassColor" />
|
||||
<conversionRule conversionWord="correlationId" class="org.springframework.boot.logging.logback.CorrelationIdConverter" />
|
||||
<conversionRule conversionWord="wex" class="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter" />
|
||||
<conversionRule conversionWord="wEx" class="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter" />
|
||||
|
||||
<!-- Define the log file name and path -->
|
||||
<property name="LOG_FILE" value="logs/AquaDX.log"/>
|
||||
|
||||
Reference in New Issue
Block a user