From fd1db9c7d07059615a6d08c1f0690c43262c16f8 Mon Sep 17 00:00:00 2001 From: cokie Date: Mon, 22 Jan 2024 17:56:48 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20fix:=20=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../server/robot/domain/model/entity/FeatureFunctionDO.kt | 7 +++---- .../robot/domain/service/impl/RobotManagerServiceImpl.kt | 2 +- .../server/robot/infra/event/dto/FeatureFunctionDTO.kt | 7 +++---- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/tokisaki-server/src/main/kotlin/io/micro/server/robot/domain/model/entity/FeatureFunctionDO.kt b/tokisaki-server/src/main/kotlin/io/micro/server/robot/domain/model/entity/FeatureFunctionDO.kt index 377ca6e..05c6ade 100644 --- a/tokisaki-server/src/main/kotlin/io/micro/server/robot/domain/model/entity/FeatureFunctionDO.kt +++ b/tokisaki-server/src/main/kotlin/io/micro/server/robot/domain/model/entity/FeatureFunctionDO.kt @@ -6,7 +6,6 @@ import io.micro.core.exception.requireNonNull import io.micro.core.function.sdk.Cmd import io.micro.core.rest.CommonCode import io.micro.server.robot.domain.model.valobj.Switch -import kotlin.properties.Delegates class FeatureFunctionDO { @@ -28,15 +27,15 @@ class FeatureFunctionDO { var requireQuota: Boolean? = null - var cmd: Cmd by Delegates.notNull() + var cmd: Cmd? = null var args: MutableList = mutableListOf() var switch: Switch = Switch() - var groupId: Long by Delegates.notNull() + var groupId: Long? = null - var memberId: Long by Delegates.notNull() + var memberId: Long? = null companion object { const val BRACES = "{}" diff --git a/tokisaki-server/src/main/kotlin/io/micro/server/robot/domain/service/impl/RobotManagerServiceImpl.kt b/tokisaki-server/src/main/kotlin/io/micro/server/robot/domain/service/impl/RobotManagerServiceImpl.kt index 3cbb061..1f29fc7 100644 --- a/tokisaki-server/src/main/kotlin/io/micro/server/robot/domain/service/impl/RobotManagerServiceImpl.kt +++ b/tokisaki-server/src/main/kotlin/io/micro/server/robot/domain/service/impl/RobotManagerServiceImpl.kt @@ -275,7 +275,7 @@ class RobotManagerServiceImpl( if (switched) { runCatching { functionContext.call( - featureFunction.cmd, + featureFunction.cmd!!, featureFunction.args, featureFunction.getConfigMap(objectMapper) ).awaitSuspending() diff --git a/tokisaki-server/src/main/kotlin/io/micro/server/robot/infra/event/dto/FeatureFunctionDTO.kt b/tokisaki-server/src/main/kotlin/io/micro/server/robot/infra/event/dto/FeatureFunctionDTO.kt index 97d5d15..fea39e0 100644 --- a/tokisaki-server/src/main/kotlin/io/micro/server/robot/infra/event/dto/FeatureFunctionDTO.kt +++ b/tokisaki-server/src/main/kotlin/io/micro/server/robot/infra/event/dto/FeatureFunctionDTO.kt @@ -2,7 +2,6 @@ package io.micro.server.robot.infra.event.dto import io.micro.core.function.sdk.Cmd import io.micro.server.robot.domain.model.valobj.Switch -import kotlin.properties.Delegates class FeatureFunctionDTO { @@ -24,14 +23,14 @@ class FeatureFunctionDTO { var requireQuota: Boolean? = null - var cmd: Cmd by Delegates.notNull() + var cmd: Cmd? = null var args: MutableList = mutableListOf() var switch: Switch = Switch() - var groupId: Long by Delegates.notNull() + var groupId: Long? = null - var memberId: Long by Delegates.notNull() + var memberId: Long? = null }