# liteflow-script **Repository Path**: tangkc123/liteflow-script ## Basic Information - **Project Name**: liteflow-script - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-10-27 - **Last Updated**: 2024-10-27 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # liteflow-script #### 使用方法 ```java package com.liteflow.bot.liteflowscript; import cn.hutool.core.lang.Assert; import cn.hutool.core.util.StrUtil; import com.liteflow.bot.liteflowscript.script.ScriptExecutor; import com.liteflow.bot.liteflowscript.script.jsr223.impl.AviatorScriptExecutor; import com.liteflow.bot.liteflowscript.script.jsr223.impl.GroovyScriptExecutor; import com.liteflow.bot.liteflowscript.script.jsr223.impl.LuaScriptExecutor; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; import java.util.Map; @SpringBootTest class LiteflowScriptApplicationTests { @Test void aviatorScriptExecutorTest() throws Exception { ScriptExecutor executor = new AviatorScriptExecutor(); executor.load("test", "a+b"); Object execute = executor.execute("test", Map.of("a", 1, "b", 2)); Assert.isTrue(StrUtil.toString(execute).equals("3")); } @Test void groovyScriptExecutorTest() throws Exception { ScriptExecutor executor = new GroovyScriptExecutor(); executor.load("test", "return a+b"); Object execute = executor.execute("test", Map.of("a", 1, "b", 2)); Assert.isTrue(StrUtil.toString(execute).equals("3")); } @Test void luaScriptExecutorTest() throws Exception { ScriptExecutor executor = new LuaScriptExecutor(); executor.load("test", "return a+b"); Object execute = executor.execute("test", Map.of("a", 1, "b", 2)); Assert.isTrue(StrUtil.toString(execute).equals("3")); } } ```