+2
-4
@@ -16,7 +16,7 @@
|
||||
* ProjectName mingli-utils
|
||||
* ModuleName mingli-utils.main
|
||||
* CurrentFile JSONAAutoConfiguration.kt
|
||||
* LastUpdate 2026-11-09 14:59:49
|
||||
* LastUpdate 2026-11-16 11:28:52
|
||||
* UpdateUser MingLiPro
|
||||
*/
|
||||
|
||||
@@ -41,9 +41,7 @@ open class JSONAAutoConfiguration(
|
||||
init {
|
||||
JSONA.setJsonApi(jsonApi)
|
||||
log.info(
|
||||
"JSONA use ${
|
||||
jsonApi.javaClass
|
||||
}"
|
||||
"JSONA use {}", jsonApi.javaClass
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
+4
-4
@@ -16,7 +16,7 @@
|
||||
* ProjectName mingli-utils
|
||||
* ModuleName mingli-utils.main
|
||||
* CurrentFile Jackson3AutoConfiguration.kt
|
||||
* LastUpdate 2026-11-09 14:18:45
|
||||
* LastUpdate 2026-11-17 10:16:38
|
||||
* UpdateUser MingLiPro
|
||||
*/
|
||||
|
||||
@@ -39,8 +39,8 @@ open class Jackson3AutoConfiguration {
|
||||
|
||||
private val log = MingLiLoggerFactory.getLogger<Jackson3AutoConfiguration>()
|
||||
|
||||
@Bean("UUIDJsonConverterJsonMapperCustomizer")
|
||||
@ConditionalOnMissingBean(name = ["UUIDJsonConverterJsonMapperCustomizer"])
|
||||
@Bean("jackson3MapperBuilderCustomizer")
|
||||
@ConditionalOnMissingBean(name = ["jackson3MapperBuilderCustomizer"])
|
||||
fun jsonMapperBuilderCustomizer(builders: ObjectProvider<JacksonBuilder>): JsonMapperBuilderCustomizer {
|
||||
val builderList = builders.orderedStream().toList()
|
||||
var jacksonJsonBuilderImpl = JacksonJsonBuilderImpl()
|
||||
@@ -52,7 +52,7 @@ open class Jackson3AutoConfiguration {
|
||||
it.addModules(
|
||||
*jacksonJsonBuilderImpl.getData().map { converter ->
|
||||
converter.getJackson3Module().also { module ->
|
||||
log.info("Jackson3 Module Install ${module.moduleName}")
|
||||
log.debug("Jackson3 Module Install {}", module.moduleName)
|
||||
}
|
||||
}.toTypedArray()
|
||||
)
|
||||
|
||||
+5
-3
@@ -16,7 +16,7 @@
|
||||
* ProjectName mingli-utils
|
||||
* ModuleName mingli-utils.main
|
||||
* CurrentFile JacksonJsonAutoConfiguration.kt
|
||||
* LastUpdate 2026-11-09 14:19:05
|
||||
* LastUpdate 2026-11-16 23:32:09
|
||||
* UpdateUser MingLiPro
|
||||
*/
|
||||
|
||||
@@ -29,6 +29,7 @@ import com.mingliqiye.utils.springboot.autoconfigure.builder.JacksonJsonBuilderI
|
||||
import org.springframework.beans.factory.ObjectProvider
|
||||
import org.springframework.boot.autoconfigure.AutoConfigureAfter
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
|
||||
import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer
|
||||
import org.springframework.context.annotation.Bean
|
||||
|
||||
@@ -67,7 +68,8 @@ open class JacksonJsonAutoConfiguration {
|
||||
private val log = MingLiLoggerFactory.getLogger<JacksonJsonAutoConfiguration>()
|
||||
}
|
||||
|
||||
@Bean("mingliUtilsJacksonObjectMapperBuilderCustomizer")
|
||||
@Bean("jacksonMapperBuilderCustomizer")
|
||||
@ConditionalOnMissingBean(name = ["jacksonMapperBuilderCustomizer"])
|
||||
fun jackson2ObjectMapperBuilderCustomizer(builders: ObjectProvider<JacksonBuilder>): Jackson2ObjectMapperBuilderCustomizer {
|
||||
val builderList = builders.orderedStream().toList()
|
||||
var jacksonJsonBuilderImpl = JacksonJsonBuilderImpl()
|
||||
@@ -78,7 +80,7 @@ open class JacksonJsonAutoConfiguration {
|
||||
builder.modulesToInstall(
|
||||
*jacksonJsonBuilderImpl.getData().map { converter ->
|
||||
converter.getJacksonModule().also { module ->
|
||||
log.info("Jackson Module Install ${module.moduleName}")
|
||||
log.debug("Jackson Module Install {}", module.moduleName)
|
||||
}
|
||||
}.toTypedArray()
|
||||
)
|
||||
|
||||
+3
-3
@@ -13,10 +13,10 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* ProjectName FastBaseMapper.kt
|
||||
* ProjectName mingli-utils
|
||||
* ModuleName mingli-utils.main
|
||||
* CurrentFile Okhttp3AutoConfiguration.kt
|
||||
* LastUpdate 2026-10-26 23:22:18
|
||||
* LastUpdate 2026-11-16 11:29:35
|
||||
* UpdateUser MingLiPro
|
||||
*/
|
||||
|
||||
@@ -98,7 +98,7 @@ open class Okhttp3AutoConfiguration {
|
||||
b.build()
|
||||
}.also {
|
||||
okhttp = it
|
||||
log.info("load $connt OkhttpBuilder initialized OkHttpClient successfully")
|
||||
log.info("load {} OkhttpBuilder initialized OkHttpClient successfully", connt)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-27
@@ -16,38 +16,12 @@
|
||||
* ProjectName mingli-utils
|
||||
* ModuleName mingli-utils.main
|
||||
* CurrentFile JacksonBuilder.kt
|
||||
* LastUpdate 2026-11-09 14:39:28
|
||||
* LastUpdate 2026-11-16 11:36:46
|
||||
* UpdateUser MingLiPro
|
||||
*/
|
||||
|
||||
package com.mingliqiye.utils.springboot.autoconfigure.builder
|
||||
|
||||
import com.mingliqiye.utils.json.converters.base.JsonConverter
|
||||
|
||||
sealed class JacksonJsonBuilder {
|
||||
abstract fun addJsonConverter(jsonConverter: JsonConverter<*, *>): JacksonJsonBuilder
|
||||
abstract fun addJsonConverters(vararg jsonConverters: JsonConverter<*, *>): JacksonJsonBuilder
|
||||
}
|
||||
|
||||
open class JacksonJsonBuilderImpl : JacksonJsonBuilder() {
|
||||
override fun addJsonConverter(jsonConverter: JsonConverter<*, *>): JacksonJsonBuilderImpl {
|
||||
data.add(jsonConverter)
|
||||
return this
|
||||
}
|
||||
|
||||
override fun addJsonConverters(vararg jsonConverters: JsonConverter<*, *>): JacksonJsonBuilder {
|
||||
data.addAll(jsonConverters)
|
||||
return this
|
||||
}
|
||||
|
||||
private val data = mutableListOf<JsonConverter<*, *>>()
|
||||
|
||||
fun getData(): List<JsonConverter<*, *>> {
|
||||
return data.toList()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@FunctionalInterface
|
||||
fun interface JacksonBuilder {
|
||||
fun customize(builder: JacksonJsonBuilder): JacksonJsonBuilder
|
||||
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* Copyright 2026 mingliqiye
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* ProjectName mingli-utils
|
||||
* ModuleName mingli-utils.main
|
||||
* CurrentFile JacksonJsonBuilder.kt
|
||||
* LastUpdate 2026-11-16 11:36:46
|
||||
* UpdateUser MingLiPro
|
||||
*/
|
||||
|
||||
package com.mingliqiye.utils.springboot.autoconfigure.builder
|
||||
|
||||
import com.mingliqiye.utils.json.converters.base.JsonConverter
|
||||
|
||||
sealed class JacksonJsonBuilder {
|
||||
abstract fun addJsonConverter(jsonConverter: JsonConverter<*, *>): JacksonJsonBuilder
|
||||
abstract fun addJsonConverters(vararg jsonConverters: JsonConverter<*, *>): JacksonJsonBuilder
|
||||
}
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* Copyright 2026 mingliqiye
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* ProjectName mingli-utils
|
||||
* ModuleName mingli-utils.main
|
||||
* CurrentFile JacksonJsonBuilderImpl.kt
|
||||
* LastUpdate 2026-11-16 11:36:46
|
||||
* UpdateUser MingLiPro
|
||||
*/
|
||||
|
||||
package com.mingliqiye.utils.springboot.autoconfigure.builder
|
||||
|
||||
import com.mingliqiye.utils.json.converters.base.JsonConverter
|
||||
|
||||
open class JacksonJsonBuilderImpl : JacksonJsonBuilder() {
|
||||
override fun addJsonConverter(jsonConverter: JsonConverter<*, *>): JacksonJsonBuilderImpl {
|
||||
data.add(jsonConverter)
|
||||
return this
|
||||
}
|
||||
|
||||
override fun addJsonConverters(vararg jsonConverters: JsonConverter<*, *>): JacksonJsonBuilder {
|
||||
data.addAll(jsonConverters)
|
||||
return this
|
||||
}
|
||||
|
||||
private val data = mutableListOf<JsonConverter<*, *>>()
|
||||
|
||||
fun getData(): List<JsonConverter<*, *>> {
|
||||
return data.toList()
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user