Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 0 additions & 19 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,25 +1,6 @@
VOLCENGINE_TOS_ACCESS_KEY=
VOLCENGINE_TOS_SECRET_KEY=

# MinIO Configuration
MINIO_USER=
MINIO_PASSWORD=
MINIO_PORT=

# Global Domain Configuration
GLOBAL_DOMAIN=
GLOBAL_IP=

# Database Configuration
PG_USER=
PG_PASSWORD=
PG_DB=
PG_PORT=

# Redis Configuration
REDIS_PASSWORD=
REDIS_PORT=

# WeChat Configuration (placeholders)
WXPA_VERIFY_TOKEN=
WXPA_APP_ID=
Expand Down
1 change: 1 addition & 0 deletions .idea/modules/compose-server.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cacheable/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Includes Redis integration for distributed caching and Caffeine for high-perform
.trimIndent()

dependencies {
implementation(libs.org.springframework.boot.spring.boot.starter.data.redis)
api(libs.org.springframework.boot.spring.boot.starter.data.redis)
implementation(libs.org.apache.commons.commons.pool2)
implementation(libs.com.github.ben.manes.caffeine.caffeine)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ class RedisJsonSerializerAutoConfiguration(@Qualifier(JacksonAutoConfiguration.N
.disableCachingNullValues()

@Bean(name = [ICacheNames.IRedis.HANDLE])
@ConditionalOnBean(name = [VIRTUAL_THREAD_REDIS_FACTORY_BEAN_NAME])
fun customRedisJsonSerializable(@Qualifier(VIRTUAL_THREAD_REDIS_FACTORY_BEAN_NAME) factory: RedisConnectionFactory): RedisTemplate<String, *> {
log.trace("register redisTemplate factory: {}", factory)
val rt = RedisTemplate<String, Any?>()
Expand All @@ -58,7 +57,6 @@ class RedisJsonSerializerAutoConfiguration(@Qualifier(JacksonAutoConfiguration.N
}

@Bean(name = [ICacheNames.IRedis.CACHE_MANAGER])
@ConditionalOnBean(name = [VIRTUAL_THREAD_REDIS_FACTORY_BEAN_NAME])
fun cacheManager2h(@Qualifier(VIRTUAL_THREAD_REDIS_FACTORY_BEAN_NAME) factory: RedisConnectionFactory): RedisCacheManager {
log.debug("register RedisCacheManager , factory: {}", factory)
return asCacheConfig(factory)
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ org-springframework-modulith = "2.0.0-M1"
org-springframework-security = "6.5.5"
org-testcontainers = "1.21.3"
org-testng = "7.11.0"
project = "0.0.37"
project = "0.0.38"

[libraries]
ch-qos-logback-logback-classic = { module = "ch.qos.logback:logback-classic", version.ref = "ch-qos-logback" }
Expand Down
13 changes: 0 additions & 13 deletions oss/oss-volcengine-tos/.env.example

This file was deleted.

30 changes: 1 addition & 29 deletions oss/oss-volcengine-tos/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,37 +1,9 @@
plugins {
id("buildlogic.kotlinspring-conventions")
id("buildlogic.spotless-conventions")
id("buildlogic.loadenv-conventions")
}

// 直接实现 dotenv 功能,避免插件依赖
fun loadDotenv() {
val envFile = rootProject.file(".env")
if (envFile.exists()) {
envFile.readLines().forEach { line ->
val trimmedLine = line.trim()
if (trimmedLine.isNotEmpty() && !trimmedLine.startsWith("#")) {
val parts = trimmedLine.split("=", limit = 2)
if (parts.size == 2) {
val key = parts[0].trim()
val value = parts[1].trim().removeSurrounding("\"").removeSurrounding("'")
if (key.isNotEmpty() && value.isNotEmpty()) {
// 设置到所有任务的环境变量中
tasks.withType<Test> { environment(key, value) }
tasks.withType<JavaExec> { environment(key, value) }
logger.debug("Loaded environment variable: $key")
}
}
}
}
logger.info("Loaded .env file from: ${envFile.absolutePath}")
} else {
logger.warn(".env file not found at: ${envFile.absolutePath}")
}
}

// 加载 dotenv 配置
loadDotenv()

description =
"""
Volcengine TOS (Tinder Object Storage) integration for enterprise-grade cloud storage.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,29 @@ inline fun String.isId(): Boolean {
return this.isNotEmpty() && this.matches(Regex("^[0-9A-Za-z]+$"))
}

@Deprecated("框架内部调用代码,不应由用户直接调用", level = DeprecationLevel.ERROR) inline fun getDefaultNullableId(): Id = Long.MIN_VALUE
@Deprecated("框架内部调用代码,不应由用户直接调用", level = DeprecationLevel.ERROR)
inline fun getDefaultNullableId(): Id = Long.MIN_VALUE

inline fun Number.toId(): Id? {
return this.toLong().takeIf { it != Long.MIN_VALUE }
}

inline fun <T> Number.toId(receiver: (Id) -> T?): T? {
return this.toId()?.let(receiver)
}

inline fun Number.toIdOrThrow(): Id {
return this.toLong().takeIf { it != Long.MIN_VALUE } ?: throw IllegalArgumentException("Invalid Id: $this")
}

inline fun String.toId(): Id? {
return this.toLongOrNull()?.takeIf { it != Long.MIN_VALUE }
}

inline fun String.toIdOrThrow(): Id {
return this.toLongOrNull()?.takeIf { it != Long.MIN_VALUE } ?: throw IllegalArgumentException("Invalid Id: $this")
}

inline fun <T> String.toId(receiver: (Id) -> T?): T? {
return this.toId()?.let(receiver)
}
Loading
Loading