mirror of
https://github.com/slhaf/Partner.git
synced 2026-05-12 08:43:02 +08:00
refactor(partnerctl): move GatewayConfig into commands.data model file
This commit is contained in:
@@ -1,9 +1,8 @@
|
||||
package work.slhaf.partner.ctl.commands
|
||||
|
||||
import kotlinx.serialization.Serializable
|
||||
import kotlinx.serialization.json.Json
|
||||
import kotlinx.serialization.json.JsonObject
|
||||
import picocli.CommandLine
|
||||
import work.slhaf.partner.ctl.commands.data.GatewayConfig
|
||||
import work.slhaf.partner.ctl.commands.init.buildFromSource
|
||||
import work.slhaf.partner.ctl.commands.init.configureExternalGateway
|
||||
import work.slhaf.partner.ctl.commands.init.configureWebSocketGateway
|
||||
@@ -164,16 +163,5 @@ class InitCommand : Runnable {
|
||||
BUILD_FROM_SOURCE
|
||||
}
|
||||
|
||||
@Serializable
|
||||
data class GatewayConfig(
|
||||
val defaultChannel: String,
|
||||
val channels: List<ChannelConfig>
|
||||
) {
|
||||
@Serializable
|
||||
data class ChannelConfig(
|
||||
val channelName: String,
|
||||
val params: JsonObject
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package work.slhaf.partner.ctl.commands.data
|
||||
|
||||
import kotlinx.serialization.Serializable
|
||||
import kotlinx.serialization.json.JsonObject
|
||||
|
||||
@Serializable
|
||||
data class GatewayConfig(
|
||||
val defaultChannel: String,
|
||||
val channels: List<ChannelConfig>
|
||||
) {
|
||||
@Serializable
|
||||
data class ChannelConfig(
|
||||
val channelName: String,
|
||||
val params: JsonObject
|
||||
)
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
package work.slhaf.partner.ctl.commands.init
|
||||
|
||||
import kotlinx.serialization.json.*
|
||||
import work.slhaf.partner.ctl.commands.InitCommand.GatewayConfig
|
||||
import work.slhaf.partner.ctl.commands.data.GatewayConfig
|
||||
import work.slhaf.partner.ctl.support.*
|
||||
import work.slhaf.partner.ctl.ui.Prompt
|
||||
import java.nio.file.Files
|
||||
|
||||
Reference in New Issue
Block a user