Browse Source

:tada: 3.3.1.RELEASE 升级适配代码生成器API

smallchill 2 years ago
parent
commit
f48954ddec
31 changed files with 54 additions and 54 deletions
  1. 1 1
      blade-core-boot/pom.xml
  2. 1 1
      blade-core-boot/src/main/resources/bootstrap.yml
  3. 1 1
      blade-core-cloud/pom.xml
  4. 1 1
      blade-core-datascope/pom.xml
  5. 1 1
      blade-core-develop/pom.xml
  6. 3 3
      blade-core-develop/src/main/java/org/springblade/develop/support/BladeCodeGenerator.java
  7. 2 2
      blade-core-develop/src/main/resources/templates/controller.java.vm
  8. 1 1
      blade-core-develop/src/main/resources/templates/entity.java.vm
  9. 1 1
      blade-core-develop/src/main/resources/templates/mapper.xml.vm
  10. 5 5
      blade-core-develop/src/main/resources/templates/saber/api.js.vm
  11. 7 7
      blade-core-develop/src/main/resources/templates/saber/crud.vue.vm
  12. 2 2
      blade-core-develop/src/main/resources/templates/sword/add.js.vm
  13. 2 2
      blade-core-develop/src/main/resources/templates/sword/edit.js.vm
  14. 1 1
      blade-core-develop/src/main/resources/templates/sword/list.js.vm
  15. 1 1
      blade-core-develop/src/main/resources/templates/sword/model.js.vm
  16. 4 4
      blade-core-develop/src/main/resources/templates/sword/service.js.vm
  17. 3 3
      blade-core-develop/src/main/resources/templates/sword/view.js.vm
  18. 1 1
      blade-core-launch/pom.xml
  19. 1 1
      blade-core-launch/src/main/java/org/springblade/core/launch/constant/AppConstant.java
  20. 1 1
      blade-core-log/pom.xml
  21. 1 1
      blade-core-mybatis/pom.xml
  22. 1 1
      blade-core-oss/pom.xml
  23. 1 1
      blade-core-report/pom.xml
  24. 1 1
      blade-core-secure/pom.xml
  25. 1 1
      blade-core-social/pom.xml
  26. 1 1
      blade-core-swagger/pom.xml
  27. 1 1
      blade-core-swagger/src/main/java/org/springblade/core/swagger/SwaggerProperties.java
  28. 1 1
      blade-core-test/pom.xml
  29. 1 1
      blade-core-tool/pom.xml
  30. 1 1
      blade-core-transaction/pom.xml
  31. 4 4
      pom.xml

+ 1 - 1
blade-core-boot/pom.xml

@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.springblade</groupId>
         <artifactId>blade-tool</artifactId>
-        <version>3.3.0</version>
+        <version>3.3.1</version>
     </parent>
 
     <modelVersion>4.0.0</modelVersion>

+ 1 - 1
blade-core-boot/src/main/resources/bootstrap.yml

@@ -101,7 +101,7 @@ mybatis-plus:
 swagger:
   title: SpringBlade 接口文档系统
   description: SpringBlade 接口文档系统
-  version: 3.3.0
+  version: 3.3.1
   license: Powered By SpringBlade
   licenseUrl: https://bladex.vip
   terms-of-service-url: https://bladex.vip

+ 1 - 1
blade-core-cloud/pom.xml

@@ -5,7 +5,7 @@
     <parent>
         <artifactId>blade-tool</artifactId>
         <groupId>org.springblade</groupId>
-        <version>3.3.0</version>
+        <version>3.3.1</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
 

+ 1 - 1
blade-core-datascope/pom.xml

@@ -5,7 +5,7 @@
     <parent>
         <artifactId>blade-tool</artifactId>
         <groupId>org.springblade</groupId>
-        <version>3.3.0</version>
+        <version>3.3.1</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
 

+ 1 - 1
blade-core-develop/pom.xml

@@ -5,7 +5,7 @@
     <parent>
         <artifactId>blade-tool</artifactId>
         <groupId>org.springblade</groupId>
-        <version>3.3.0</version>
+        <version>3.3.1</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
 

+ 3 - 3
blade-core-develop/src/main/java/org/springblade/develop/support/BladeCodeGenerator.java

@@ -160,7 +160,7 @@ public class BladeCodeGenerator {
 			.packageConfig(builder -> builder.parent(packageName).controller("controller").entity("entity").service("service").serviceImpl("service.impl").mapper("mapper").xml("mapper"))
 			.strategyConfig(builder -> builder.addTablePrefix(tablePrefix).addInclude(includeTables).addExclude(excludeTables)
 				.entityBuilder().naming(NamingStrategy.underline_to_camel).columnNaming(NamingStrategy.underline_to_camel).enableLombok().superClass("org.springblade.core.mp.base.BaseEntity").addSuperEntityColumns(superEntityColumns)
-				.serviceBuilder().superServiceClass("org.springblade.core.mp.base.BaseService").superServiceImplClass("org.springblade.core.mp.base.BaseService").formatServiceFileName("I%sService").formatServiceImplFileName("%sServiceImpl")
+				.serviceBuilder().superServiceClass("org.springblade.core.mp.base.BaseService").superServiceImplClass("org.springblade.core.mp.base.BaseServiceImpl").formatServiceFileName("I%sService").formatServiceImplFileName("%sServiceImpl")
 				.mapperBuilder().enableMapperAnnotation().enableBaseResultMap().enableBaseColumnList().formatMapperFileName("%sMapper").formatXmlFileName("%sMapper")
 				.controllerBuilder().superClass("org.springblade.core.boot.ctrl.BladeController").formatFileName("%sController").enableRestStyle().enableHyphenStyle()
 			)
@@ -169,7 +169,7 @@ public class BladeCodeGenerator {
 				.service("/templates/service.java.vm")
 				.serviceImpl("/templates/serviceImpl.java.vm")
 				.mapper("/templates/mapper.java.vm")
-				.mapperXml("/templates/mapper.xml.vm")
+				.xml("/templates/mapper.xml.vm")
 				.controller("/templates/controller.java.vm"))
 			.injectionConfig(builder -> builder.beforeOutputFile(
 					(tableInfo, objectMap) -> System.out.println("tableInfo: " + tableInfo.getEntityName() + " objectMap: " + objectMap.size())
@@ -239,7 +239,7 @@ public class BladeCodeGenerator {
 						if (StringUtil.equals(key, "crud.vue")) {
 							outputPath = getOutputWebDir() + StringPool.SLASH + "views" + StringPool.SLASH + servicePackage.toLowerCase() + StringPool.SLASH + entityNameLower + ".vue";
 						}
-						outputFile(new File(String.valueOf(outputPath)), objectMap, value);
+						outputFile(new File(String.valueOf(outputPath)), objectMap, value, Boolean.TRUE);
 					});
 				}
 			})

+ 2 - 2
blade-core-develop/src/main/resources/templates/controller.java.vm

@@ -35,7 +35,7 @@ import $!{package.Entity}.$!{entity};
 #set($voPackage=$package.Entity.replace("entity","vo"))
 import $!{voPackage}.$!{entity}VO;
 #set($wrapperPackage=$package.Entity.replace("entity","wrapper"))
-#if($!{cfg.hasWrapper})
+#if($!{hasWrapper})
 import $!{wrapperPackage}.$!{entity}Wrapper;
 #end
 import $!{package.Service}.$!{table.serviceName};
@@ -63,7 +63,7 @@ public class $!{table.controllerName} {
 
 	private $!{table.serviceName} $!{table.entityPath}Service;
 
-#if($!{cfg.hasWrapper})
+#if($!{hasWrapper})
 	/**
 	 * 详情
 	 */

+ 1 - 1
blade-core-develop/src/main/resources/templates/entity.java.vm

@@ -58,7 +58,7 @@ public class $!{entity} implements Serializable {
 
 ## ----------  BEGIN 字段循环遍历  ----------
 #foreach($field in $!{table.fields})
-#if($!{field.name}!=$!{cfg.tenantColumn})
+#if($!{field.name}!=$!{tenantColumn})
 #if($!{field.keyFlag})
 #set($keyPropertyName=$!{field.propertyName})
 #end

+ 1 - 1
blade-core-develop/src/main/resources/templates/mapper.xml.vm

@@ -19,7 +19,7 @@
         <result column="$!{field.name}" property="$!{field.propertyName}"/>
 #end
 #foreach($field in $!{table.fields})
-#if(!$!{field.keyFlag} && $!{field.name} != $!{cfg.tenantColumn})##生成普通字段
+#if(!$!{field.keyFlag} && $!{field.name} != $!{tenantColumn})##生成普通字段
         <result column="$!{field.name}" property="$!{field.propertyName}"/>
 #end
 #end

+ 5 - 5
blade-core-develop/src/main/resources/templates/saber/api.js.vm

@@ -2,7 +2,7 @@ import request from '@/router/axios';
 
 export const getList = (current, size, params) => {
   return request({
-    url: '/api/$!{cfg.serviceName}/$!{cfg.entityKey}/list',
+    url: '/api/$!{serviceName}/$!{entityKey}/list',
     method: 'get',
     params: {
       ...params,
@@ -14,7 +14,7 @@ export const getList = (current, size, params) => {
 
 export const getDetail = (id) => {
   return request({
-    url: '/api/$!{cfg.serviceName}/$!{cfg.entityKey}/detail',
+    url: '/api/$!{serviceName}/$!{entityKey}/detail',
     method: 'get',
     params: {
       id
@@ -24,7 +24,7 @@ export const getDetail = (id) => {
 
 export const remove = (ids) => {
   return request({
-    url: '/api/$!{cfg.serviceName}/$!{cfg.entityKey}/remove',
+    url: '/api/$!{serviceName}/$!{entityKey}/remove',
     method: 'post',
     params: {
       ids,
@@ -34,7 +34,7 @@ export const remove = (ids) => {
 
 export const add = (row) => {
   return request({
-    url: '/api/$!{cfg.serviceName}/$!{cfg.entityKey}/submit',
+    url: '/api/$!{serviceName}/$!{entityKey}/submit',
     method: 'post',
     data: row
   })
@@ -42,7 +42,7 @@ export const add = (row) => {
 
 export const update = (row) => {
   return request({
-    url: '/api/$!{cfg.serviceName}/$!{cfg.entityKey}/submit',
+    url: '/api/$!{serviceName}/$!{entityKey}/submit',
     method: 'post',
     data: row
   })

+ 7 - 7
blade-core-develop/src/main/resources/templates/saber/crud.vue.vm

@@ -22,7 +22,7 @@
                    size="small"
                    icon="el-icon-delete"
                    plain
-                   v-if="permission.$!{cfg.entityKey}_delete"
+                   v-if="permission.$!{entityKey}_delete"
                    @click="handleDelete">删 除
         </el-button>
       </template>
@@ -31,7 +31,7 @@
 </template>
 
 <script>
-  import {getList, getDetail, add, update, remove} from "@/api/$!{cfg.servicePackage}/$!{cfg.entityKey}";
+  import {getList, getDetail, add, update, remove} from "@/api/$!{servicePackage}/$!{entityKey}";
   import {mapGetters} from "vuex";
 
   export default {
@@ -58,7 +58,7 @@
           selection: true,
           column: [
 #foreach($field in $!{table.fields})
-#if($!{field.name}!=$!{cfg.tenantColumn})
+#if($!{field.name}!=$!{tenantColumn})
             {
               label: "$!{field.comment}",
               prop: "$!{field.propertyName}",
@@ -79,10 +79,10 @@
       ...mapGetters(["permission"]),
       permissionList() {
         return {
-          addBtn: this.vaildData(this.permission.$!{cfg.entityKey}_add, false),
-          viewBtn: this.vaildData(this.permission.$!{cfg.entityKey}_view, false),
-          delBtn: this.vaildData(this.permission.$!{cfg.entityKey}_delete, false),
-          editBtn: this.vaildData(this.permission.$!{cfg.entityKey}_edit, false)
+          addBtn: this.vaildData(this.permission.$!{entityKey}_add, false),
+          viewBtn: this.vaildData(this.permission.$!{entityKey}_view, false),
+          delBtn: this.vaildData(this.permission.$!{entityKey}_delete, false),
+          editBtn: this.vaildData(this.permission.$!{entityKey}_edit, false)
         };
       },
       ids() {

+ 2 - 2
blade-core-develop/src/main/resources/templates/sword/add.js.vm

@@ -48,11 +48,11 @@ class $!{entity}Add extends PureComponent {
     );
 
     return (
-      <Panel title="新增" back="/$!{cfg.servicePackage}/$!{table.entityPath}" action={action}>
+      <Panel title="新增" back="/$!{servicePackage}/$!{table.entityPath}" action={action}>
         <Form hideRequiredMark style={{ marginTop: 8 }}>
           <Card className={styles.card} bordered={false}>
 #foreach($field in $!{table.fields})
-#if($!{field.name}!=$!{cfg.tenantColumn})
+#if($!{field.name}!=$!{tenantColumn})
             <FormItem {...formItemLayout} label="$!{field.comment}">
               {getFieldDecorator('$!{field.propertyName}', {
                 rules: [

+ 2 - 2
blade-core-develop/src/main/resources/templates/sword/edit.js.vm

@@ -71,11 +71,11 @@ class $!{entity}Edit extends PureComponent {
     );
 
     return (
-      <Panel title="修改" back="/$!{cfg.servicePackage}/$!{table.entityPath}" action={action}>
+      <Panel title="修改" back="/$!{servicePackage}/$!{table.entityPath}" action={action}>
         <Form hideRequiredMark style={{ marginTop: 8 }}>
           <Card className={styles.card} bordered={false}>
 #foreach($field in $!{table.fields})
-#if($!{field.name}!=$!{cfg.tenantColumn})
+#if($!{field.name}!=$!{tenantColumn})
             <FormItem {...formItemLayout} label="$!{field.comment}">
               {getFieldDecorator('$!{field.propertyName}', {
                 rules: [

+ 1 - 1
blade-core-develop/src/main/resources/templates/sword/list.js.vm

@@ -57,7 +57,7 @@ class $!{entity} extends PureComponent {
 
     const columns = [
 #foreach($field in $!{table.fields})
-#if($!{field.name}!=$!{cfg.tenantColumn})
+#if($!{field.name}!=$!{tenantColumn})
       {
         title: '$!{field.comment}',
         dataIndex: '$!{field.propertyName}',

+ 1 - 1
blade-core-develop/src/main/resources/templates/sword/model.js.vm

@@ -51,7 +51,7 @@ export default {
       const response = yield call(submit, payload);
       if (response.success) {
         message.success('提交成功');
-        router.push('/$!{cfg.servicePackage}/$!{table.entityPath}');
+        router.push('/$!{servicePackage}/$!{table.entityPath}');
       }
     },
     *remove({ payload }, { call }) {

+ 4 - 4
blade-core-develop/src/main/resources/templates/sword/service.js.vm

@@ -4,22 +4,22 @@ import func from '../utils/Func';
 import request from '../utils/request';
 
 export async function list(params) {
-  return request(`/api/$!{cfg.serviceName}/$!{cfg.entityKey}/list?$!{params}`);
+  return request(`/api/$!{serviceName}/$!{entityKey}/list?$!{params}`);
 }
 
 export async function submit(params) {
-  return request('/api/$!{cfg.serviceName}/$!{cfg.entityKey}/submit', {
+  return request('/api/$!{serviceName}/$!{entityKey}/submit', {
     method: 'POST',
     body: params,
   });
 }
 
 export async function detail(params) {
-  return request(`/api/$!{cfg.serviceName}/$!{cfg.entityKey}/detail?$!{params}`);
+  return request(`/api/$!{serviceName}/$!{entityKey}/detail?$!{params}`);
 }
 
 export async function remove(params) {
-  return request('/api/$!{cfg.serviceName}/$!{cfg.entityKey}/remove', {
+  return request('/api/$!{serviceName}/$!{entityKey}/remove', {
     method: 'POST',
     body: func.toFormData(params),
   });

+ 3 - 3
blade-core-develop/src/main/resources/templates/sword/view.js.vm

@@ -30,7 +30,7 @@ class $!{entity}View extends PureComponent {
         params: { id },
       },
     } = this.props;
-    router.push(`/$!{cfg.servicePackage}/$!{table.entityPath}/edit/$!{id}`);
+    router.push(`/$!{servicePackage}/$!{table.entityPath}/edit/$!{id}`);
   };
 
   render() {
@@ -57,11 +57,11 @@ class $!{entity}View extends PureComponent {
     );
 
     return (
-      <Panel title="查看" back="/$!{cfg.servicePackage}/$!{table.entityPath}" action={action}>
+      <Panel title="查看" back="/$!{servicePackage}/$!{table.entityPath}" action={action}>
         <Form hideRequiredMark style={{ marginTop: 8 }}>
           <Card className={styles.card} bordered={false}>
 #foreach($field in $!{table.fields})
-#if($!{field.name}!=$!{cfg.tenantColumn})
+#if($!{field.name}!=$!{tenantColumn})
             <FormItem {...formItemLayout} label="$!{field.comment}">
               <span>{detail.$!{field.propertyName}}</span>
             </FormItem>

+ 1 - 1
blade-core-launch/pom.xml

@@ -5,7 +5,7 @@
     <parent>
         <artifactId>blade-tool</artifactId>
         <groupId>org.springblade</groupId>
-        <version>3.3.0</version>
+        <version>3.3.1</version>
     </parent>
 
     <modelVersion>4.0.0</modelVersion>

+ 1 - 1
blade-core-launch/src/main/java/org/springblade/core/launch/constant/AppConstant.java

@@ -25,7 +25,7 @@ public interface AppConstant {
 	/**
 	 * 应用版本
 	 */
-	String APPLICATION_VERSION = "3.3.0";
+	String APPLICATION_VERSION = "3.3.1";
 
 	/**
 	 * 基础包

+ 1 - 1
blade-core-log/pom.xml

@@ -5,7 +5,7 @@
     <parent>
         <artifactId>blade-tool</artifactId>
         <groupId>org.springblade</groupId>
-        <version>3.3.0</version>
+        <version>3.3.1</version>
     </parent>
 
     <modelVersion>4.0.0</modelVersion>

+ 1 - 1
blade-core-mybatis/pom.xml

@@ -5,7 +5,7 @@
     <parent>
         <artifactId>blade-tool</artifactId>
         <groupId>org.springblade</groupId>
-        <version>3.3.0</version>
+        <version>3.3.1</version>
     </parent>
 
     <modelVersion>4.0.0</modelVersion>

+ 1 - 1
blade-core-oss/pom.xml

@@ -5,7 +5,7 @@
     <parent>
         <artifactId>blade-tool</artifactId>
         <groupId>org.springblade</groupId>
-        <version>3.3.0</version>
+        <version>3.3.1</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
 

+ 1 - 1
blade-core-report/pom.xml

@@ -5,7 +5,7 @@
     <parent>
         <artifactId>blade-tool</artifactId>
         <groupId>org.springblade</groupId>
-        <version>3.3.0</version>
+        <version>3.3.1</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
 

+ 1 - 1
blade-core-secure/pom.xml

@@ -5,7 +5,7 @@
     <parent>
         <artifactId>blade-tool</artifactId>
         <groupId>org.springblade</groupId>
-        <version>3.3.0</version>
+        <version>3.3.1</version>
     </parent>
 
     <modelVersion>4.0.0</modelVersion>

+ 1 - 1
blade-core-social/pom.xml

@@ -5,7 +5,7 @@
     <parent>
         <artifactId>blade-tool</artifactId>
         <groupId>org.springblade</groupId>
-        <version>3.3.0</version>
+        <version>3.3.1</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
 

+ 1 - 1
blade-core-swagger/pom.xml

@@ -5,7 +5,7 @@
     <parent>
         <artifactId>blade-tool</artifactId>
         <groupId>org.springblade</groupId>
-        <version>3.3.0</version>
+        <version>3.3.1</version>
     </parent>
 
     <modelVersion>4.0.0</modelVersion>

+ 1 - 1
blade-core-swagger/src/main/java/org/springblade/core/swagger/SwaggerProperties.java

@@ -55,7 +55,7 @@ public class SwaggerProperties {
 	/**
 	 * 版本
 	 **/
-	private String version = "3.3.0";
+	private String version = "3.3.1";
 	/**
 	 * 许可证
 	 **/

+ 1 - 1
blade-core-test/pom.xml

@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.springblade</groupId>
         <artifactId>blade-tool</artifactId>
-        <version>3.3.0</version>
+        <version>3.3.1</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
 

+ 1 - 1
blade-core-tool/pom.xml

@@ -6,7 +6,7 @@
     <parent>
         <groupId>org.springblade</groupId>
         <artifactId>blade-tool</artifactId>
-        <version>3.3.0</version>
+        <version>3.3.1</version>
     </parent>
 
     <modelVersion>4.0.0</modelVersion>

+ 1 - 1
blade-core-transaction/pom.xml

@@ -5,7 +5,7 @@
     <parent>
         <artifactId>blade-tool</artifactId>
         <groupId>org.springblade</groupId>
-        <version>3.3.0</version>
+        <version>3.3.1</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
 

+ 4 - 4
pom.xml

@@ -5,7 +5,7 @@
 
     <groupId>org.springblade</groupId>
     <artifactId>blade-tool</artifactId>
-    <version>3.3.0</version>
+    <version>3.3.1</version>
     <packaging>pom</packaging>
     <name>blade-tool</name>
     <description>
@@ -36,7 +36,7 @@
     </scm>
 
     <properties>
-        <blade.tool.version>3.3.0</blade.tool.version>
+        <blade.tool.version>3.3.1</blade.tool.version>
 
         <java.version>1.8</java.version>
         <maven.plugin.version>3.8.1</maven.plugin.version>
@@ -44,7 +44,7 @@
         <swagger.models.version>1.6.2</swagger.models.version>
         <knife4j.version>2.0.9</knife4j.version>
         <mybatis.plus.version>3.5.1</mybatis.plus.version>
-        <mybatis.plus.generator.version>3.5.1</mybatis.plus.generator.version>
+        <mybatis.plus.generator.version>3.5.2</mybatis.plus.generator.version>
         <protostuff.version>1.6.0</protostuff.version>
         <disruptor.version>3.4.2</disruptor.version>
         <guava.version>20.0</guava.version>
@@ -55,7 +55,7 @@
         <alibaba.seata.version>1.4.2</alibaba.seata.version>
         <spring.plugin.version>2.0.0.RELEASE</spring.plugin.version>
 
-        <spring.boot.version>2.6.3</spring.boot.version>
+        <spring.boot.version>2.6.6</spring.boot.version>
         <spring.cloud.version>2021.0.1</spring.cloud.version>
         <spring.platform.version>Cairo-SR8</spring.platform.version>