-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bbc9e7f
commit bea9b0b
Showing
44 changed files
with
393 additions
and
415 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 0 additions & 10 deletions
10
qqrobot-spring-boot-starter/src/main/java/de/honoka/qqrobot/framework/FrameworkEnum.java
This file was deleted.
Oops, something went wrong.
10 changes: 10 additions & 0 deletions
10
qqrobot-spring-boot-starter/src/main/java/de/honoka/qqrobot/framework/FrameworkEnum.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package de.honoka.qqrobot.framework | ||
|
||
enum class FrameworkEnum { | ||
|
||
TESTER, | ||
|
||
MIRAI, | ||
|
||
ONEBOT | ||
} |
13 changes: 0 additions & 13 deletions
13
...bot-spring-boot-starter/src/main/java/de/honoka/qqrobot/framework/config/MiraiConfig.java
This file was deleted.
Oops, something went wrong.
33 changes: 33 additions & 0 deletions
33
qqrobot-spring-boot-starter/src/main/java/de/honoka/qqrobot/framework/config/MiraiConfig.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package de.honoka.qqrobot.framework.config | ||
|
||
import net.mamoe.mirai.utils.BotConfiguration.MiraiProtocol | ||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty | ||
import org.springframework.boot.context.properties.ConfigurationProperties | ||
import org.springframework.boot.context.properties.EnableConfigurationProperties | ||
import org.springframework.context.annotation.ComponentScan | ||
import org.springframework.context.annotation.Configuration | ||
|
||
@EnableConfigurationProperties(MiraiProperties::class) | ||
@ComponentScan("de.honoka.qqrobot.framework.impl.mirai") | ||
@ConditionalOnProperty(prefix = "honoka.qqrobot.framework", name = ["impl"], havingValue = "mirai") | ||
@Configuration | ||
class MiraiConfig | ||
|
||
@ConfigurationProperties("honoka.qqrobot.framework.mirai") | ||
data class MiraiProperties( | ||
|
||
/** | ||
* 平台输出与依赖文件的存放目录 | ||
*/ | ||
var workDirectory: String = "/qqrobot/mirai", | ||
|
||
/** | ||
* 是否转移日志到文件中 | ||
*/ | ||
var redirectLogs: Boolean = false, | ||
|
||
/** | ||
* 采用的登录协议 | ||
*/ | ||
var protocol: MiraiProtocol = MiraiProtocol.ANDROID_PAD | ||
) |
43 changes: 41 additions & 2 deletions
43
qqrobot-spring-boot-starter/src/main/java/de/honoka/qqrobot/framework/config/OnebotConfig.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,52 @@ | ||
package de.honoka.qqrobot.framework.config | ||
|
||
import de.honoka.qqrobot.framework.config.property.OnebotProperties | ||
import de.honoka.sdk.util.file.FileUtils | ||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty | ||
import org.springframework.boot.context.properties.ConfigurationProperties | ||
import org.springframework.boot.context.properties.EnableConfigurationProperties | ||
import org.springframework.context.annotation.ComponentScan | ||
import org.springframework.context.annotation.Configuration | ||
import kotlin.io.path.Path | ||
|
||
@EnableConfigurationProperties(OnebotProperties::class) | ||
@ComponentScan("de.honoka.qqrobot.framework.impl.onebot") | ||
@ConditionalOnProperty(prefix = "honoka.qqrobot.framework", name = ["impl"], havingValue = "onebot") | ||
@Configuration | ||
class OnebotConfig | ||
class OnebotConfig | ||
|
||
@ConfigurationProperties("honoka.qqrobot.framework.onebot") | ||
data class OnebotProperties( | ||
|
||
var host: String? = null, | ||
|
||
var httpPort: Int? = null, | ||
|
||
var websocketPort: Int? = null, | ||
|
||
var fileReceiverPort: Int? = null, | ||
|
||
/** | ||
* 定义缓存文件所存放的目录。 | ||
* | ||
* 发送图片或文件前,需要先将InputStream中的数据写出到文件中,才能被OneBot服务使用。 | ||
*/ | ||
var cachePath: String = Path(FileUtils.getMainClasspath(), "cache").run { | ||
normalize().toString() | ||
} | ||
) { | ||
|
||
val urlPrefix: String | ||
get() = "http://$host:$httpPort" | ||
|
||
val websocketUrlPrefix: String | ||
get() = "ws://$host:$websocketPort" | ||
|
||
val fileReceiverUrlPrefix: String | ||
get() = "http://$host:$fileReceiverPort" | ||
|
||
val imagePath: String | ||
get() = Path(cachePath, "image").toString() | ||
|
||
val fileToUploadPath: String | ||
get() = Path(cachePath, "fileToUpload").toString() | ||
} |
27 changes: 0 additions & 27 deletions
27
...ot-spring-boot-starter/src/main/java/de/honoka/qqrobot/framework/config/TesterConfig.java
This file was deleted.
Oops, something went wrong.
47 changes: 47 additions & 0 deletions
47
qqrobot-spring-boot-starter/src/main/java/de/honoka/qqrobot/framework/config/TesterConfig.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package de.honoka.qqrobot.framework.config | ||
|
||
import de.honoka.sdk.util.file.FileUtils | ||
import org.springframework.beans.factory.annotation.Value | ||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty | ||
import org.springframework.boot.context.properties.ConfigurationProperties | ||
import org.springframework.boot.context.properties.EnableConfigurationProperties | ||
import org.springframework.context.annotation.ComponentScan | ||
import org.springframework.context.annotation.Configuration | ||
import kotlin.io.path.Path | ||
|
||
@EnableConfigurationProperties(TesterProperties::class) | ||
@ComponentScan("de.honoka.qqrobot.framework.impl.tester") | ||
@ConditionalOnProperty( | ||
prefix = "honoka.qqrobot.framework", | ||
name = ["impl"], | ||
havingValue = "tester", | ||
matchIfMissing = true | ||
) | ||
@Configuration | ||
class TesterConfig { | ||
|
||
@Value("\${server.port:8080}") | ||
var serverPort = 0 | ||
|
||
@Value("\${server.servlet.context-path:}") | ||
var contextPath = "/" | ||
|
||
val testerUrl: String | ||
get() = "http://localhost:$serverPort$contextPath${TesterProperties.WEB_PREFIX}/index.html" | ||
} | ||
|
||
@ConfigurationProperties("honoka.qqrobot.framework.tester") | ||
data class TesterProperties( | ||
|
||
var groupNumber: Long = 10000L, | ||
|
||
var imagePath: String = run { | ||
Path(FileUtils.getMainClasspath(), "tester-framework", "image").toString() | ||
} | ||
) { | ||
|
||
companion object { | ||
|
||
const val WEB_PREFIX = "/tester-framework" | ||
} | ||
} |
25 changes: 0 additions & 25 deletions
25
...ot-starter/src/main/java/de/honoka/qqrobot/framework/config/property/MiraiProperties.java
This file was deleted.
Oops, something went wrong.
47 changes: 0 additions & 47 deletions
47
...t-starter/src/main/java/de/honoka/qqrobot/framework/config/property/OnebotProperties.java
This file was deleted.
Oops, something went wrong.
18 changes: 0 additions & 18 deletions
18
...t-starter/src/main/java/de/honoka/qqrobot/framework/config/property/TesterProperties.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.