Skip to content

Commit

Permalink
Merge pull request #11 from a645162/dev
Browse files Browse the repository at this point in the history
v1.1.2
  • Loading branch information
a645162 authored Dec 7, 2024
2 parents d582118 + 876c120 commit 8ef24da
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .idea/kotlinc.xml

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

39 changes: 27 additions & 12 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask


plugins {
val kotlinVersion = "2.0.21"
val springBootVersion = "3.3.5"
val kotlinVersion = "2.1.0"
val springBootVersion = "3.4.0"

id("org.springframework.boot") version springBootVersion
id("io.spring.dependency-management") version "1.1.6"
Expand All @@ -18,16 +18,16 @@ plugins {
id("com.github.ben-manes.versions") version "0.51.0"
}

val kotlinVersion = "2.0.21"
val kotlinVersion = "2.1.0"
val kotlinVersionPrevious = "2.0.20"

val springBootVersion = "3.3.5"
val myBatisVersion = "3.0.3"
val springBootVersion = "3.4.0"
val myBatisVersion = "3.0.4"

val fastjsonVersion = "2.0.53"

group = "com.khm.group"
version = "1.1.1-SNAPSHOT"
version = "1.1.2-SNAPSHOT"

java {
sourceCompatibility = JavaVersion.VERSION_21
Expand Down Expand Up @@ -66,16 +66,29 @@ allprojects {
maven { url = uri("https://maven.aliyun.com/repository/central") }
maven { url = uri("https://maven.aliyun.com/repository/public") }
maven { url = uri("https://maven.aliyun.com/repository/spring") }
maven{ url = uri("https://maven.aliyun.com/repository/jcenter") }
maven{ url = uri("https://maven.aliyun.com/repository/google") }

maven { url = uri("https://maven.aliyun.com/repository/gradle-plugin") }

// MyBatis-Plus Snapshot
maven { url = uri("https://oss.sonatype.org/content/repositories/snapshots/") }

mavenLocal()
mavenCentral()

gradlePluginPortal()

google()
}
}

repositories {
maven { url = uri("https://maven.aliyun.com/repository/central") }
maven { url = uri("https://maven.aliyun.com/repository/public") }
maven { url = uri("https://maven.aliyun.com/repository/spring") }
maven{ url = uri("https://maven.aliyun.com/repository/jcenter") }
maven{ url = uri("https://maven.aliyun.com/repository/google") }

maven { url = uri("https://maven.aliyun.com/repository/gradle-plugin") }

Expand All @@ -86,6 +99,8 @@ repositories {
mavenCentral()

gradlePluginPortal()

google()
}

dependencies {
Expand All @@ -100,7 +115,7 @@ dependencies {
// https://central.sonatype.com/artifact/org.jetbrains.kotlinx/kotlinx-coroutines-core
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.9.0")

implementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.18.1")
implementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.18.2")

////////////////////////////////////////////////////////////////////////////////////////////
// Spring Boot
Expand All @@ -110,7 +125,7 @@ dependencies {
////////////////////////////////////////////////////////////////////////////////////////////
// Database
// https://mvnrepository.com/artifact/com.alibaba/druid-spring-boot-starter
implementation("com.alibaba:druid-spring-boot-starter:1.2.23")
implementation("com.alibaba:druid-spring-boot-starter:1.2.24")

implementation("org.mybatis.spring.boot:mybatis-spring-boot-starter:${myBatisVersion}")
implementation("com.baomidou:mybatis-plus-spring-boot3-starter:3.5.9")
Expand All @@ -128,7 +143,7 @@ dependencies {
////////////////////////////////////////////////////////////////////////////////////////////
// Task
// https://mvnrepository.com/artifact/org.jobrunr/jobrunr
implementation("org.jobrunr:jobrunr:7.3.1")
implementation("org.jobrunr:jobrunr:7.3.2")
// https://mvnrepository.com/artifact/org.jobrunr/jobrunr-kotlin-1.7-support
implementation("org.jobrunr:jobrunr-kotlin-1.7-support:7.2.0")
// https://mvnrepository.com/artifact/org.jobrunr/jobrunr-spring-boot-starter
Expand All @@ -153,7 +168,7 @@ dependencies {
implementation("com.squareup.okhttp3:okhttp:4.12.0")

// https://mvnrepository.com/artifact/com.larksuite.oapi/oapi-sdk
implementation("com.larksuite.oapi:oapi-sdk:2.3.7")
implementation("com.larksuite.oapi:oapi-sdk:2.4.4")

// Data
// https://mvnrepository.com/artifact/com.alibaba.fastjson2/fastjson2
Expand All @@ -164,7 +179,7 @@ dependencies {
implementation("com.akuleshov7:ktoml-core:0.5.2")
implementation("com.akuleshov7:ktoml-file:0.5.2")

implementation("com.charleskorn.kaml:kaml:0.61.0")
implementation("com.charleskorn.kaml:kaml:0.62.2")

// File Encoding
implementation("com.github.albfernandez:juniversalchardet:2.5.0")
Expand All @@ -173,7 +188,7 @@ dependencies {
// Dev Tools
// Lombok for Java
// https://mvnrepository.com/artifact/org.projectlombok/lombok
compileOnly("org.projectlombok:lombok:1.18.34")
compileOnly("org.projectlombok:lombok:1.18.36")

// Docker
// runtimeOnly("org.springframework.boot:spring-boot-docker-compose")
Expand Down
3 changes: 1 addition & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://mirrors.cloud.tencent.com/gradle/gradle-8.11-rc-2-all.zip
#distributionUrl=https\://mirrors.cloud.tencent.com/gradle/gradle-8.10.2-all.zip
distributionUrl=https\://mirrors.cloud.tencent.com/gradle/gradle-8.11.1-all.zip
#distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
networkTimeout=10000
validateDistributionUrl=true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ class ConfigEnvironment {
var MACHINE_AUTH_REMEMBER_IP: Boolean = true
var RUN_IN_DOCKER: Boolean = false

var GROUP_BOT_AT_ENABLE: Boolean = false

var LARK_BOT_APP_ID: String = ""
var LARK_BOT_APP_SECRET: String = ""

Expand Down Expand Up @@ -60,7 +62,9 @@ class ConfigEnvironment {
if (envString.isEmpty()) return defaultValue

return try {
envString.trim().uppercase() == "TRUE"
val upper_string = envString.trim().uppercase()

(upper_string == "TRUE" || upper_string == "1")
} catch (e: Exception) {
defaultValue
}
Expand Down Expand Up @@ -171,6 +175,11 @@ class ConfigEnvironment {
} else {
println("Machine Auth Remember IP is Disabled")
}

GROUP_BOT_AT_ENABLE = getEnvBool(
"GROUP_BOT_AT_ENABLE",
GROUP_BOT_AT_ENABLE
)
}
}

Expand Down
19 changes: 12 additions & 7 deletions src/main/kotlin/com/khm/group/center/message/MessageSender.kt
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@ class MessageSender(private val messageItem: MessageItem) {
if (userConfig != null) {
// User Personal Bot
val userId = userConfig.webhook.lark.userId
if (userId.isEmpty()) {
atText = userConfig.name
} else {
atText = LarkGroupBot.getAtUserHtml(userId)

if (!userId.isEmpty()) {
if (ConfigEnvironment.GROUP_BOT_AT_ENABLE)
atText = LarkGroupBot.getAtUserHtml(userId)

if (LarkBot.isAppIdSecretValid()) {
val larkBotObj = LarkBot(userConfig.webhook.lark.userId)
Expand All @@ -92,20 +92,25 @@ class MessageSender(private val messageItem: MessageItem) {
+ machineUrl
)

// Send Personal Bot
launch {
larkBotObj.sendTextWithSilentMode(
text, userConfig.webhook.silentMode
)
}
}
}

atText = atText.trim()
if (atText.isEmpty()) {
atText = userConfig.name
}
}

val finalText = atText + messageItem.content

// Lark Group Bot
val groupBotText = (
finalText
)
val groupBotText = finalText

launch {
larkGroupBotObj.sendTextWithSilentMode(
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/settings/version.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version=1.1.1-SNAPSHOT
version=1.1.2-SNAPSHOT

0 comments on commit 8ef24da

Please sign in to comment.