Skip to content

Commit 9511ee2

Browse files
authored
Merge pull request #68 from TrueNine/dev
v0.0.38
2 parents 44307cd + df57fb1 commit 9511ee2

File tree

10 files changed

+236
-120
lines changed

10 files changed

+236
-120
lines changed

.env.example

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,6 @@
11
VOLCENGINE_TOS_ACCESS_KEY=
22
VOLCENGINE_TOS_SECRET_KEY=
33

4-
# MinIO Configuration
5-
MINIO_USER=
6-
MINIO_PASSWORD=
7-
MINIO_PORT=
8-
9-
# Global Domain Configuration
10-
GLOBAL_DOMAIN=
11-
GLOBAL_IP=
12-
13-
# Database Configuration
14-
PG_USER=
15-
PG_PASSWORD=
16-
PG_DB=
17-
PG_PORT=
18-
19-
# Redis Configuration
20-
REDIS_PASSWORD=
21-
REDIS_PORT=
22-
234
# WeChat Configuration (placeholders)
245
WXPA_VERIFY_TOKEN=
256
WXPA_APP_ID=

.idea/modules/compose-server.iml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cacheable/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Includes Redis integration for distributed caching and Caffeine for high-perform
1111
.trimIndent()
1212

1313
dependencies {
14-
implementation(libs.org.springframework.boot.spring.boot.starter.data.redis)
14+
api(libs.org.springframework.boot.spring.boot.starter.data.redis)
1515
implementation(libs.org.apache.commons.commons.pool2)
1616
implementation(libs.com.github.ben.manes.caffeine.caffeine)
1717

cacheable/src/main/kotlin/io/github/truenine/composeserver/cacheable/autoconfig/RedisJsonSerializerAutoConfiguration.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ class RedisJsonSerializerAutoConfiguration(@Qualifier(JacksonAutoConfiguration.N
4343
.disableCachingNullValues()
4444

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

6059
@Bean(name = [ICacheNames.IRedis.CACHE_MANAGER])
61-
@ConditionalOnBean(name = [VIRTUAL_THREAD_REDIS_FACTORY_BEAN_NAME])
6260
fun cacheManager2h(@Qualifier(VIRTUAL_THREAD_REDIS_FACTORY_BEAN_NAME) factory: RedisConnectionFactory): RedisCacheManager {
6361
log.debug("register RedisCacheManager , factory: {}", factory)
6462
return asCacheConfig(factory)

gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ org-springframework-modulith = "2.0.0-M1"
5454
org-springframework-security = "6.5.5"
5555
org-testcontainers = "1.21.3"
5656
org-testng = "7.11.0"
57-
project = "0.0.37"
57+
project = "0.0.38"
5858

5959
[libraries]
6060
ch-qos-logback-logback-classic = { module = "ch.qos.logback:logback-classic", version.ref = "ch-qos-logback" }

oss/oss-volcengine-tos/.env.example

Lines changed: 0 additions & 13 deletions
This file was deleted.

oss/oss-volcengine-tos/build.gradle.kts

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,9 @@
11
plugins {
22
id("buildlogic.kotlinspring-conventions")
33
id("buildlogic.spotless-conventions")
4+
id("buildlogic.loadenv-conventions")
45
}
56

6-
// 直接实现 dotenv 功能,避免插件依赖
7-
fun loadDotenv() {
8-
val envFile = rootProject.file(".env")
9-
if (envFile.exists()) {
10-
envFile.readLines().forEach { line ->
11-
val trimmedLine = line.trim()
12-
if (trimmedLine.isNotEmpty() && !trimmedLine.startsWith("#")) {
13-
val parts = trimmedLine.split("=", limit = 2)
14-
if (parts.size == 2) {
15-
val key = parts[0].trim()
16-
val value = parts[1].trim().removeSurrounding("\"").removeSurrounding("'")
17-
if (key.isNotEmpty() && value.isNotEmpty()) {
18-
// 设置到所有任务的环境变量中
19-
tasks.withType<Test> { environment(key, value) }
20-
tasks.withType<JavaExec> { environment(key, value) }
21-
logger.debug("Loaded environment variable: $key")
22-
}
23-
}
24-
}
25-
}
26-
logger.info("Loaded .env file from: ${envFile.absolutePath}")
27-
} else {
28-
logger.warn(".env file not found at: ${envFile.absolutePath}")
29-
}
30-
}
31-
32-
// 加载 dotenv 配置
33-
loadDotenv()
34-
357
description =
368
"""
379
Volcengine TOS (Tinder Object Storage) integration for enterprise-grade cloud storage.

shared/src/main/kotlin/io/github/truenine/composeserver/AliasExtensions.kt

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,29 @@ inline fun String.isId(): Boolean {
2121
return this.isNotEmpty() && this.matches(Regex("^[0-9A-Za-z]+$"))
2222
}
2323

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

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

31+
inline fun <T> Number.toId(receiver: (Id) -> T?): T? {
32+
return this.toId()?.let(receiver)
33+
}
34+
35+
inline fun Number.toIdOrThrow(): Id {
36+
return this.toLong().takeIf { it != Long.MIN_VALUE } ?: throw IllegalArgumentException("Invalid Id: $this")
37+
}
38+
3039
inline fun String.toId(): Id? {
3140
return this.toLongOrNull()?.takeIf { it != Long.MIN_VALUE }
3241
}
42+
43+
inline fun String.toIdOrThrow(): Id {
44+
return this.toLongOrNull()?.takeIf { it != Long.MIN_VALUE } ?: throw IllegalArgumentException("Invalid Id: $this")
45+
}
46+
47+
inline fun <T> String.toId(receiver: (Id) -> T?): T? {
48+
return this.toId()?.let(receiver)
49+
}

0 commit comments

Comments
 (0)