Skip to content
Merged

Dev #201

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion example/example-app/example-app-cmd-domain/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.codingapi.springboot</groupId>
<artifactId>example-app</artifactId>
<version>3.4.49</version>
<version>3.4.50</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion example/example-app/example-app-cmd-meta/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.codingapi.springboot</groupId>
<artifactId>example-app</artifactId>
<version>3.4.49</version>
<version>3.4.50</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion example/example-app/example-app-query/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.codingapi.springboot</groupId>
<artifactId>example-app</artifactId>
<version>3.4.49</version>
<version>3.4.50</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion example/example-app/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.codingapi.springboot</groupId>
<artifactId>springboot-example</artifactId>
<version>3.4.49</version>
<version>3.4.50</version>
<relativePath>../pom.xml</relativePath>
</parent>
<packaging>pom</packaging>
Expand Down
2 changes: 1 addition & 1 deletion example/example-domain/example-domain-leave/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.codingapi.springboot</groupId>
<artifactId>example-domain</artifactId>
<version>3.4.49</version>
<version>3.4.50</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion example/example-domain/example-domain-user/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.codingapi.springboot</groupId>
<artifactId>example-domain</artifactId>
<version>3.4.49</version>
<version>3.4.50</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion example/example-domain/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.codingapi.springboot</groupId>
<artifactId>springboot-example</artifactId>
<version>3.4.49</version>
<version>3.4.50</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion example/example-infra/example-infra-flow/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.codingapi.springboot</groupId>
<artifactId>example-infra</artifactId>
<version>3.4.49</version>
<version>3.4.50</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion example/example-infra/example-infra-jpa/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.codingapi.springboot</groupId>
<artifactId>example-infra</artifactId>
<version>3.4.49</version>
<version>3.4.50</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion example/example-infra/example-infra-security/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.codingapi.springboot</groupId>
<artifactId>example-infra</artifactId>
<version>3.4.49</version>
<version>3.4.50</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion example/example-infra/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.codingapi.springboot</groupId>
<artifactId>springboot-example</artifactId>
<version>3.4.49</version>
<version>3.4.50</version>
<relativePath>../pom.xml</relativePath>
</parent>
<packaging>pom</packaging>
Expand Down
2 changes: 1 addition & 1 deletion example/example-interface/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.codingapi.springboot</groupId>
<artifactId>springboot-example</artifactId>
<version>3.4.49</version>
<version>3.4.50</version>
</parent>

<artifactId>example-interface</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion example/example-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>springboot-example</artifactId>
<groupId>com.codingapi.springboot</groupId>
<version>3.4.49</version>
<version>3.4.50</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion example/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
</parent>

<artifactId>springboot-example</artifactId>
<version>3.4.49</version>
<version>3.4.50</version>

<name>springboot-example</name>
<description>springboot-example project for Spring Boot</description>
Expand Down
11 changes: 10 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<groupId>com.codingapi.springboot</groupId>
<artifactId>springboot-parent</artifactId>
<version>3.4.49</version>
<version>3.4.50</version>

<url>https://github.com/codingapi/springboot-framewrok</url>
<name>springboot-parent</name>
Expand Down Expand Up @@ -165,6 +165,12 @@
<version>${codingapi.framework.version}</version>
</dependency>

<dependency>
<groupId>com.codingapi.springboot</groupId>
<artifactId>springboot-starter-script</artifactId>
<version>${codingapi.framework.version}</version>
</dependency>

<dependency>
<groupId>com.codingapi.springboot</groupId>
<artifactId>springboot-starter-security</artifactId>
Expand Down Expand Up @@ -288,6 +294,7 @@
</activation>
<modules>
<module>springboot-starter</module>
<module>springboot-starter-script</module>
<module>springboot-starter-security</module>
<module>springboot-starter-data-authorization</module>
<module>springboot-starter-data-fast</module>
Expand All @@ -302,6 +309,7 @@

<modules>
<module>springboot-starter</module>
<module>springboot-starter-script</module>
<module>springboot-starter-security</module>
<module>springboot-starter-data-authorization</module>
<module>springboot-starter-data-fast</module>
Expand Down Expand Up @@ -354,6 +362,7 @@

<modules>
<module>springboot-starter</module>
<module>springboot-starter-script</module>
<module>springboot-starter-security</module>
<module>springboot-starter-data-authorization</module>
<module>springboot-starter-data-fast</module>
Expand Down
2 changes: 1 addition & 1 deletion springboot-starter-data-authorization/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.codingapi.springboot</groupId>
<artifactId>springboot-parent</artifactId>
<version>3.4.49</version>
<version>3.4.50</version>
</parent>

<name>springboot-starter-data-authorization</name>
Expand Down
7 changes: 6 additions & 1 deletion springboot-starter-data-fast/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>springboot-parent</artifactId>
<groupId>com.codingapi.springboot</groupId>
<version>3.4.49</version>
<version>3.4.50</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down Expand Up @@ -35,6 +35,11 @@
<artifactId>springboot-starter</artifactId>
</dependency>

<dependency>
<groupId>com.codingapi.springboot</groupId>
<artifactId>springboot-starter-script</artifactId>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,25 @@
import com.codingapi.springboot.fast.jdbc.JdbcQueryContext;
import com.codingapi.springboot.fast.jpa.JpaQuery;
import com.codingapi.springboot.fast.jpa.JpaQueryContext;
import com.codingapi.springboot.framework.script.GroovyScriptRunner;
import com.codingapi.springboot.framework.script.request.GroovyBindObjectBuilder;
import com.codingapi.springboot.script.GroovyScriptRuntime;
import lombok.Getter;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;

import java.util.HashMap;
import java.util.Map;


public class ScriptRuntime {


@Getter
private final static ScriptRuntime instance = new ScriptRuntime();

private final GroovyScriptRunner scriptRunner;
private final GroovyScriptRuntime scriptRunner;

private ScriptRuntime(){
this.scriptRunner = new GroovyScriptRunner(1000);
this.scriptRunner = new GroovyScriptRuntime(1000);
}

Object running(String script) {
Expand All @@ -29,11 +31,12 @@ Object running(String script) {
JdbcQuery jdbcQuery = JdbcQueryContext.getInstance().getJdbcQuery();
JpaQuery jpaQuery = JpaQueryContext.getInstance().getJpaQuery();

GroovyBindObjectBuilder bindBuilder = GroovyBindObjectBuilder.builder();
bindBuilder.add("$request", request);
bindBuilder.add("$jpa", jpaQuery);
bindBuilder.add("$jdbc", jdbcQuery);
Map<String,Object> bindBuilder = new HashMap<>();
bindBuilder.put("$request", request);
bindBuilder.put("$jpa", jpaQuery);
bindBuilder.put("$jdbc", jdbcQuery);

return this.scriptRunner.run(script,Object.class,bindBuilder);

return this.scriptRunner.run(script,Object.class,bindBuilder.build());
}
}
33 changes: 6 additions & 27 deletions springboot-starter-flow/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<artifactId>springboot-parent</artifactId>
<groupId>com.codingapi.springboot</groupId>
<version>3.4.49</version>
<version>3.4.50</version>
</parent>

<name>springboot-starter-flow</name>
Expand All @@ -23,6 +23,11 @@
<artifactId>springboot-starter</artifactId>
</dependency>

<dependency>
<groupId>com.codingapi.springboot</groupId>
<artifactId>springboot-starter-script</artifactId>
</dependency>

<dependency>
<groupId>com.esotericsoftware</groupId>
<artifactId>kryo</artifactId>
Expand All @@ -46,30 +51,4 @@
</dependencies>


<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.12</version>
<executions>
<execution>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>


</plugins>
</build>

</project>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.codingapi.springboot.flow.script;

import com.codingapi.springboot.framework.script.GroovyScriptRunner;
import com.codingapi.springboot.script.GroovyScriptRuntime;
import lombok.Getter;

public class GroovyShellContext {
Expand All @@ -11,11 +11,11 @@ public class GroovyShellContext {
@Getter
private final static GroovyShellContext instance = new GroovyShellContext();

private final GroovyScriptRunner scriptRunner;
private final GroovyScriptRuntime scriptRunner;


private GroovyShellContext() {
scriptRunner = new GroovyScriptRunner(MAX_CACHE_SIZE);
scriptRunner = new GroovyScriptRuntime(MAX_CACHE_SIZE);
}


Expand Down
Loading