zero-ai 0.3.34 → 0.3.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/package.json +1 -1
  2. package/src/_template/APP/.placeholder +0 -0
  3. package/src/_template/MODULE/.placeholder +0 -0
  4. package/src/_template/MODULE/database/MYSQL.properties +4 -0
  5. package/src/_template/MODULE/database/MYSQL.yml +2 -0
  6. package/src/_template/MODULE/source-domain/ExtensionGeneration.ejs +7 -0
  7. package/src/_template/MODULE/source-domain/configuration.yml.ejs +3 -0
  8. package/src/_template/MODULE/source-provider/ExtensionSource.ejs +14 -0
  9. package/src/_template/SPRING/.placeholder +0 -0
  10. package/src/_template/SPRING/database/database-account.sql.ejs +3 -0
  11. package/src/_template/SPRING/database/database-reinit.sql.ejs +5 -0
  12. package/src/_template/SPRING/database/init-db.sh +4 -0
  13. package/src/_template/SPRING/mvn-build.sh +3 -0
  14. package/src/_template/SPRING/mvn-env.sh.ejs +7 -0
  15. package/src/_template/SPRING/pom.xml.ejs +46 -0
  16. package/src/_template/SPRING/source-api/AppDev.java.ejs +13 -0
  17. package/src/_template/SPRING/source-api/Application.java.ejs +12 -0
  18. package/src/_template/SPRING/source-api/application.yml.ejs +64 -0
  19. package/src/_template/SPRING/source-api/env.properties.ejs +7 -0
  20. package/src/_template/SPRING/source-api/pom.xml.ejs +65 -0
  21. package/src/_template/SPRING/source-domain/ActOperationCommon.ejs +17 -0
  22. package/src/_template/SPRING/source-domain/GenConfigApp.ejs +22 -0
  23. package/src/_template/SPRING/source-domain/pom.xml.ejs +21 -0
  24. package/src/_template/SPRING/source-provider/GenAppModule.ejs +12 -0
  25. package/src/_template/SPRING/source-provider/pom.xml.ejs +21 -0
  26. package/src/_template/SPRING/source-test/pom.xml.ejs +28 -0
  27. package/src/commander/app.json +8 -2
  28. package/src/commander/spring.json +24 -0
  29. package/src/commander-ai/fn.source.app.js +8 -3
  30. package/src/commander-ai/fn.source.mod.js +1 -1
  31. package/src/commander-ai/fn.source.spring.js +20 -0
  32. package/src/commander-ai/index.js +2 -0
  33. package/src/commander-shared/ai.fn.initialize.__.io.util.js +161 -0
  34. package/src/commander-shared/ai.fn.initialize.__.spring.directory.js +73 -0
  35. package/src/commander-shared/ai.fn.initialize.__.spring.file.js +112 -0
  36. package/src/commander-shared/ai.fn.initialize.__.zero.directory.js +63 -0
  37. package/src/commander-shared/ai.fn.initialize.__.zero.file.js +81 -0
  38. package/src/commander-shared/ai.fn.initialize.app.js +26 -0
  39. package/src/commander-shared/ai.fn.initialize.module.js +35 -28
  40. package/src/commander-shared/ai.fn.initialize.spring.js +68 -0
  41. package/src/commander-shared/index.js +21 -1
  42. package/src/commander-shared/ai.fn.initialize.io.js +0 -86
  43. /package/src/_template/{SERVICE → MODULE}/database/database-reinit.sh +0 -0
  44. /package/src/_template/{SERVICE → MODULE}/database/database-reinit.sql +0 -0
  45. /package/src/_template/{SERVICE → MODULE}/database/init-db.sh +0 -0
  46. /package/src/_template/{SERVICE → MODULE}/pom.xml.ejs +0 -0
  47. /package/src/_template/{SERVICE → MODULE}/source-api/pom.xml.ejs +0 -0
  48. /package/src/_template/{SERVICE → MODULE}/source-domain/pom.xml.ejs +0 -0
  49. /package/src/_template/{SERVICE → MODULE}/source-provider/pom.xml.ejs +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zero-ai",
3
- "version": "0.3.34",
3
+ "version": "0.3.35",
4
4
  "description": "Zero Ecotope AI",
5
5
  "main": "src/ai.js",
6
6
  "bin": {
File without changes
File without changes
@@ -0,0 +1,4 @@
1
+ url=jdbc:mysql://ox.engine.cn:3306/ZDB?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&failOverReadOnly=false&useSSL=false&allowPublicKeyRetrieval=true
2
+ driver=com.mysql.cj.jdbc.Driver
3
+ username=${R2MO_DB_MYSQL5_USERNAME}
4
+ password=${R2MO_DB_MYSQL5_PASSWORD}
@@ -0,0 +1,2 @@
1
+ databaseChangeLog:
2
+ # 组织架构基本信息
@@ -0,0 +1,7 @@
1
+ package <%= packageName %>;
2
+
3
+ import io.r2mo.vertx.jooq.generate.configuration.MetaGenerate;
4
+
5
+ public class Extension<%= name %>Generation extends MetaGenerate {
6
+
7
+ }
@@ -0,0 +1,3 @@
1
+ shape:
2
+ id: <%= id %>
3
+ name: "Zero Extension / <%= name %>"
@@ -0,0 +1,14 @@
1
+ package <%= packageName %>;
2
+
3
+ import io.zerows.extension.skeleton.boot.ExtensionLauncher;
4
+ import io.zerows.platform.ENV;
5
+
6
+ public class Extension<%= name %>Source {
7
+
8
+ public static void main(final String[] args) {
9
+ final ExtensionLauncher launcher = ExtensionLauncher.create(Extension<%= name %>Source.class, args);
10
+ final Extension<%= name %>Generation configuration = new Extension<%= name %>Generation();
11
+ configuration.resolver(ENV::parseVariable);
12
+ launcher.startGenerate(configuration);
13
+ }
14
+ }
File without changes
@@ -0,0 +1,3 @@
1
+ CREATE USER IF NOT EXISTS '<%= dbUser %>'@'%' IDENTIFIED BY '<%= dbPassword %>';
2
+ GRANT ALL PRIVILEGES ON *.* TO '<%= dbUser %>'@'%' WITH GRANT OPTION;
3
+ FLUSH PRIVILEGES;
@@ -0,0 +1,5 @@
1
+ SET NAMES utf8mb4;
2
+ SET FOREIGN_KEY_CHECKS = 0;
3
+ -- 删除原来的数据库
4
+ DROP DATABASE IF EXISTS <%= dbName %>;
5
+ CREATE DATABASE IF NOT EXISTS <%= dbName %> DEFAULT CHARSET utf8mb4 COLLATE utf8mb4_bin;
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env bash
2
+ source $PWD/mvn-env.sh
3
+ mysql -ur2mo -h"$R2MO_MYSQL_HOST" < "$PWD/database/${R2MO_CLOUD_DB_TYPE}/database-account.sql"
4
+ mysql -ur2mo -h"$R2MO_MYSQL_HOST" < "$PWD/database/${R2MO_CLOUD_DB_TYPE}/database-reinit.sql"
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env bash
2
+ rm -rf generated/*
3
+ mvn clean package install -Dquickly -DskipTests=true -Dmaven.javadoc.skip=true -Dmaven.compile.fork=true -T 16C
@@ -0,0 +1,7 @@
1
+ export R2MO_CLOUD_DB_TYPE=<%= dbType %>
2
+ # MySQL Env
3
+ export R2MO_MYSQL_DATABASE=<%= dbName %>
4
+ export R2MO_MYSQL_HOST=<%= dbHost %>
5
+ export R2MO_MYSQL_PORT=<%= dbPort %>
6
+ export R2MO_MYSQL_USER=<%= dbUser %>
7
+ export R2MO_MYSQL_PASS=<%= dbPassword %>
@@ -0,0 +1,46 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3
+ xmlns="http://maven.apache.org/POM/4.0.0"
4
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5
+ <modelVersion>4.0.0</modelVersion>
6
+ <parent>
7
+ <groupId>io.zerows</groupId>
8
+ <artifactId>r2mo-rapid</artifactId>
9
+ <version>1.0-M26</version>
10
+ </parent>
11
+ <groupId><%= group %></groupId>
12
+ <artifactId><%= id %></artifactId>
13
+ <version>1.0</version>
14
+ <name>App::<%= name %> / MOMO ${momo.version} | R2MO ${r2mo.version}</name>
15
+ <modules>
16
+ <module><%= id %>-domain</module>
17
+ <module><%= id %>-provider</module>
18
+ <module><%= id %>-api</module>
19
+ </modules>
20
+ <properties>
21
+ <momo.version>1.0.11</momo.version>
22
+ <r2mo.version>1.0-M26</r2mo.version>
23
+ <!-- 项目基本信息 -->
24
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
25
+ <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
26
+ <maven.compiler.source>17</maven.compiler.source>
27
+ <maven.compiler.target>17</maven.compiler.target>
28
+ <java.version>17</java.version>
29
+ </properties>
30
+
31
+ <dependencyManagement>
32
+ <dependencies>
33
+ <!--
34
+ 版本管理专用 Stack
35
+ -->
36
+ <dependency>
37
+ <groupId>io.zerows</groupId>
38
+ <artifactId>rachel-momo-stack</artifactId>
39
+ <version>${momo.version}</version>
40
+ <scope>import</scope>
41
+ <type>pom</type>
42
+ </dependency>
43
+ </dependencies>
44
+ </dependencyManagement>
45
+ <packaging>pom</packaging>
46
+ </project>
@@ -0,0 +1,13 @@
1
+ package <%= packageName %>;
2
+
3
+ import org.springframework.boot.SpringApplication;
4
+ import org.springframework.boot.autoconfigure.SpringBootApplication;
5
+ import org.springframework.context.annotation.PropertySource;
6
+
7
+ @SpringBootApplication
8
+ @PropertySource("classpath:env.properties")
9
+ public class <%= name %>AppDev {
10
+ public static void main(final String[] args) {
11
+ SpringApplication.run(<%= name %>AppDev.class, args);
12
+ }
13
+ }
@@ -0,0 +1,12 @@
1
+ package <%= packageName %>;
2
+
3
+ import org.springframework.boot.SpringApplication;
4
+ import org.springframework.boot.autoconfigure.SpringBootApplication;
5
+
6
+ @SpringBootApplication
7
+ public class <%= name %>Application {
8
+
9
+ public static void main(final String[] args) {
10
+ SpringApplication.run(<%= name %>Application.class, args);
11
+ }
12
+ }
@@ -0,0 +1,64 @@
1
+ server:
2
+ port: 9002
3
+ servlet:
4
+ context-path: /
5
+
6
+ spring:
7
+ application:
8
+ name: <%= id %>
9
+ # 数据源配置
10
+ datasource:
11
+ dynamic:
12
+ primary: master
13
+ strict: false
14
+ datasource:
15
+ master:
16
+ url: ${spring.datasource.url}
17
+ username: ${spring.datasource.username}
18
+ password: ${spring.datasource.password}
19
+ driver-class-name: ${spring.datasource.driver-class-name}
20
+ url: jdbc:mysql://${R2MO_MYSQL_HOST}:${R2MO_MYSQL_PORT:3306}/${R2MO_MYSQL_DATABASE}?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
21
+ username: ${R2MO_MYSQL_USER}
22
+ password: ${R2MO_MYSQL_PASS}
23
+ driver-class-name: com.mysql.cj.jdbc.Driver
24
+ hikari:
25
+ minimum-idle: 5
26
+ maximum-pool-size: 20
27
+ auto-commit: true
28
+ idle-timeout: 30000
29
+ max-lifetime: 1800000
30
+ connection-timeout: 30000
31
+ connection-test-query: SELECT 1
32
+ # Flyway
33
+ flyway:
34
+ enabled: true
35
+ locations:
36
+ - classpath:${spring.application.name}/database/schema/
37
+ encoding: UTF-8
38
+ sql-migration-prefix: V
39
+ sql-migration-separator: __
40
+ sql-migration-suffixes: .sql
41
+ validate-on-migrate: false
42
+ baseline-on-migrate: true
43
+ baseline-version: 1
44
+ clean-disabled: true # 生产环境禁用
45
+
46
+ mybatis-plus:
47
+ configuration:
48
+ map-underscore-to-camel-case: true
49
+ cache-enabled: false
50
+ log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
51
+ global-config:
52
+ db-config:
53
+ id-type: auto
54
+ logic-delete-value: 1
55
+ logic-not-delete-value: 0
56
+ mapper-locations:
57
+ - classpath:${spring.application.name}/mapper/**/*.xml
58
+ mapperPackage: <%= packageName %>.mapper
59
+ type-handlers-package: io.r2mo.dbe.mybatisplus.core.typehandler
60
+
61
+ logging:
62
+ level:
63
+ org.springframework.web: DEBUG
64
+ org.springframework.web.servlet.mvc.method.annotation: TRACE
@@ -0,0 +1,7 @@
1
+ R2MO_CLOUD_DB_TYPE=<%= dbType %>
2
+ # MySQL Env
3
+ R2MO_MYSQL_DATABASE=<%= dbName %>
4
+ R2MO_MYSQL_HOST=<%= dbHost %>
5
+ R2MO_MYSQL_PORT=<%= dbPort %>
6
+ R2MO_MYSQL_USER=<%= dbUser %>
7
+ R2MO_MYSQL_PASS=<%= dbPassword %>
@@ -0,0 +1,65 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3
+ xmlns="http://maven.apache.org/POM/4.0.0"
4
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5
+ <modelVersion>4.0.0</modelVersion>
6
+ <parent>
7
+ <groupId><%= group %></groupId>
8
+ <artifactId><%= id %></artifactId>
9
+ <version>1.0</version>
10
+ </parent>
11
+
12
+ <artifactId><%= id %>-api</artifactId>
13
+ <name>App::<%= name %>::Api</name>
14
+ <dependencies>
15
+ <dependency>
16
+ <groupId><%= group %></groupId>
17
+ <artifactId><%= id %>-provider</artifactId>
18
+ <version>${project.version}</version>
19
+ </dependency>
20
+ <!-- MySQL -->
21
+ <dependency>
22
+ <groupId>com.mysql</groupId>
23
+ <artifactId>mysql-connector-j</artifactId>
24
+ </dependency>
25
+ <dependency>
26
+ <groupId>org.springframework.boot</groupId>
27
+ <artifactId>spring-boot-starter-undertow</artifactId>
28
+ </dependency>
29
+ <dependency>
30
+ <groupId>org.springframework.boot</groupId>
31
+ <artifactId>spring-boot-starter-actuator</artifactId>
32
+ </dependency>
33
+ <dependency>
34
+ <groupId>org.springframework.boot</groupId>
35
+ <artifactId>spring-boot-starter-quartz</artifactId>
36
+ <version>3.5.5</version>
37
+ </dependency>
38
+ <!-- https://mvnrepository.com/artifact/org.hibernate.validator/hibernate-validator -->
39
+ <dependency>
40
+ <groupId>org.hibernate.validator</groupId>
41
+ <artifactId>hibernate-validator</artifactId>
42
+ <version>9.0.1.Final</version>
43
+ </dependency>
44
+ </dependencies>
45
+ <build>
46
+ <plugins>
47
+ <plugin>
48
+ <groupId>org.springframework.boot</groupId>
49
+ <artifactId>spring-boot-maven-plugin</artifactId>
50
+ <configuration>
51
+ <mainClass><%= packageName %>.<%= name %>Application</mainClass>
52
+ <layout>JAR</layout>
53
+ </configuration>
54
+ <executions>
55
+ <execution>
56
+ <id>repackage</id>
57
+ <goals>
58
+ <goal>repackage</goal>
59
+ </goals>
60
+ </execution>
61
+ </executions>
62
+ </plugin>
63
+ </plugins>
64
+ </build>
65
+ </project>
@@ -0,0 +1,17 @@
1
+ package <%= packageName %>.base;
2
+
3
+ import io.r2mo.io.common.HFS;
4
+ import io.r2mo.spring.mybatisplus.program.ActOperationMybatisPlus;
5
+
6
+ public abstract class ActOperationCommon<T> extends ActOperationMybatisPlus<T> {
7
+ private final HFS hfs;
8
+
9
+ public ActOperationCommon() {
10
+ super();
11
+ this.hfs = HFS.of();
12
+ }
13
+
14
+ protected HFS fs() {
15
+ return this.hfs;
16
+ }
17
+ }
@@ -0,0 +1,22 @@
1
+ package <%= packageName %>;
2
+
3
+ import <%= packageName %>.base.ActOperationCommon;
4
+ import io.r2mo.base.generator.GenMeta;
5
+ import io.r2mo.base.generator.SourceStructure;
6
+ import io.r2mo.dbe.mybatisplus.generator.config.GenConfigMybatisPlus;
7
+ import io.r2mo.typed.enums.DatabaseType;
8
+
9
+ public class GenConfigApp<%= name %> extends GenConfigMybatisPlus {
10
+
11
+ @Override
12
+ public GenMeta getMetadata() {
13
+ return GenMeta.builder()
14
+ .schema("V1__init_schema.sql")
15
+ .spi("GenMybatisPlus")
16
+ .database(DatabaseType.MYSQL_8)
17
+ .structure(SourceStructure.DPA)
18
+ .version("v1")
19
+ .baseAct(ActOperationCommon.class)
20
+ .build();
21
+ }
22
+ }
@@ -0,0 +1,21 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3
+ xmlns="http://maven.apache.org/POM/4.0.0"
4
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5
+ <modelVersion>4.0.0</modelVersion>
6
+ <parent>
7
+ <groupId><%= group %></groupId>
8
+ <artifactId><%= id %></artifactId>
9
+ <version>1.0</version>
10
+ </parent>
11
+
12
+ <artifactId><%= id %>-domain</artifactId>
13
+ <name>App::<%= name %>::Domain</name>
14
+ <dependencies>
15
+ <dependency>
16
+ <groupId>io.zerows</groupId>
17
+ <artifactId>r2mo-boot-spring-default</artifactId>
18
+ <version>${r2mo.version}</version>
19
+ </dependency>
20
+ </dependencies>
21
+ </project>
@@ -0,0 +1,12 @@
1
+ package <%= packageName %>;
2
+
3
+
4
+ import io.r2mo.boot.spring.generator.SourceGenerator;
5
+
6
+ public class GenApp<%= name %>Module {
7
+
8
+ public static void main(final String[] args) {
9
+ final SourceGenerator generator = new SourceGenerator(GenConfigApp<%= name %>.class);
10
+ generator.generate();
11
+ }
12
+ }
@@ -0,0 +1,21 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3
+ xmlns="http://maven.apache.org/POM/4.0.0"
4
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5
+ <modelVersion>4.0.0</modelVersion>
6
+ <parent>
7
+ <groupId><%= group %></groupId>
8
+ <artifactId><%= id %></artifactId>
9
+ <version>1.0</version>
10
+ </parent>
11
+
12
+ <artifactId><%= id %>-provider</artifactId>
13
+ <name>App::<%= name %>::Provider</name>
14
+ <dependencies>
15
+ <dependency>
16
+ <groupId><%= group %></groupId>
17
+ <artifactId><%= id %>-domain</artifactId>
18
+ <version>${project.version}</version>
19
+ </dependency>
20
+ </dependencies>
21
+ </project>
@@ -0,0 +1,28 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project xmlns="http://maven.apache.org/POM/4.0.0"
3
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5
+ <modelVersion>4.0.0</modelVersion>
6
+ <parent>
7
+ <groupId><%= group %></groupId>
8
+ <artifactId><%= id %></artifactId>
9
+ <version>1.0</version>
10
+ </parent>
11
+
12
+ <artifactId><%= id %>-test</artifactId>
13
+ <name>APP::<%= name %>::Test</name>
14
+ <dependencies>
15
+ <dependency>
16
+ <groupId>io.zerows</groupId>
17
+ <artifactId>r2mo-spring-junit5</artifactId>
18
+ <version>${r2mo.version}</version>
19
+ <scope>test</scope>
20
+ </dependency>
21
+ <dependency>
22
+ <groupId><%= group %></groupId>
23
+ <artifactId><%= id %>-api</artifactId>
24
+ <version>${project.version}</version>
25
+ </dependency>
26
+ </dependencies>
27
+
28
+ </project>
@@ -9,8 +9,14 @@
9
9
  "description": "创建应用的名称!"
10
10
  },
11
11
  {
12
- "name": "path",
13
- "alias": "p",
12
+ "name": "config",
13
+ "alias": "c",
14
+ "description": "配置文件路径,默认读取 app.json 文件!",
15
+ "default": "app.json"
16
+ },
17
+ {
18
+ "name": "output",
19
+ "alias": "o",
14
20
  "description": "默认应用的输出路径,若不制定为当前路径!",
15
21
  "default": "."
16
22
  }
@@ -0,0 +1,24 @@
1
+ {
2
+ "executor": "executeSpring",
3
+ "description": "(后端)创建一个新的 Spring 脚手架!",
4
+ "command": "spring",
5
+ "options": [
6
+ {
7
+ "name": "name",
8
+ "alias": "n",
9
+ "description": "创建应用的名称!"
10
+ },
11
+ {
12
+ "name": "config",
13
+ "alias": "c",
14
+ "description": "配置文件路径,默认读取 app.json 文件!",
15
+ "default": "app.json"
16
+ },
17
+ {
18
+ "name": "output",
19
+ "alias": "o",
20
+ "description": "默认应用的输出路径,若不制定为当前路径!",
21
+ "default": "."
22
+ }
23
+ ]
24
+ }
@@ -9,7 +9,12 @@ module.exports = (options) => {
9
9
  /*
10
10
  * 基本信息验证
11
11
  */
12
- const name = parsed.name;
13
- console.log(parsed);
14
- Ec.info(`生成应用信息,应用名称:${name}`);
12
+ if (!Ut.nameValid(parsed.name)) {
13
+ Ec.error("应用名称只能包含字母、数字、点(.)和短横线(-),且不能以数字、点(.)或短横线(-)开头!");
14
+ process.exit(1);
15
+ }
16
+ const configuration = Ut.initAppConfiguration(parsed);
17
+ Ec.info(`准备生成 Zero App 应用:${configuration.artifactId}`);
18
+ configuration.srcType = Symbol("APP");
19
+ Ut.initApp(configuration).then(() => Ec.info(`应用生成完成!`));
15
20
  }
@@ -9,7 +9,7 @@ module.exports = (options) => {
9
9
  /*
10
10
  * 基本信息验证
11
11
  */
12
- const configuration = Ut.initConfiguration(parsed);
12
+ const configuration = Ut.initModuleConfiguration(parsed);
13
13
  Ec.info(`准备生成 Zero Extension 扩展模块:${configuration.artifactId}`);
14
14
  Ut.initMod(configuration).then(() => Ec.info(`模块生成完成!`));
15
15
  }
@@ -0,0 +1,20 @@
1
+ const Ec = require("../epic");
2
+ const Ut = require("../commander-shared");
3
+
4
+ module.exports = (options) => {
5
+ /*
6
+ * 参数解析
7
+ */
8
+ const parsed = Ut.parseArgument(options);
9
+ /*
10
+ * 基本信息验证
11
+ */
12
+ if (!Ut.nameValid(parsed.name)) {
13
+ Ec.error("应用名称只能包含字母、数字、点(.)和短横线(-),且不能以数字、点(.)或短横线(-)开头!");
14
+ process.exit(1);
15
+ }
16
+ const configuration = Ut.initSpringConfiguration(parsed);
17
+ Ec.info(`准备生成 Rapid Spring App 应用:${configuration.artifactId}`);
18
+ configuration.srcType = Symbol("SPRING");
19
+ Ut.initSpring(configuration).then(() => Ec.info(`应用生成完成!`));
20
+ }
@@ -6,6 +6,7 @@ const executeApp = require('./fn.source.app');
6
6
  const executeMod = require('./fn.source.mod');
7
7
  const executeHelp = require('./fn.help.metadata');
8
8
  const executeWeb = require('./fn.source.front');
9
+ const executeSpring = require('./fn.source.spring');
9
10
  const exported = {
10
11
  executeUuid, // ai uuid
11
12
  executeString, // ai str
@@ -15,6 +16,7 @@ const exported = {
15
16
  executeMod, // ai mod
16
17
  executeHelp, // ai help
17
18
  executeWeb, // ai web
19
+ executeSpring, // ai spring
18
20
  };
19
21
  module.exports = exported;
20
22
  /**