Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibizlab-generator
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibizlab-generator
提交
13eacd10
提交
13eacd10
编写于
7月 30, 2022
作者:
ibiz4j
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
提交
上级
9b80a1ca
变更
14
隐藏空白字符变更
内嵌
并排
正在显示
14 个修改的文件
包含
118 行增加
和
256 行删除
+118
-256
ApiEntityModel.java
...rc/main/java/cn/ibizlab/codegen/model/ApiEntityModel.java
+6
-1
pom.xml.hbs
...rces/templ/ibiz-boot/{{projectName}}-provider/pom.xml.hbs
+1
-1
pom.xml.hbs
.../resources/templ/ibizlab/{{projectName}}-boot/pom.xml.hbs
+55
-39
BootApplication.java.hbs
...ot/src/main/java/{{packageName}}/BootApplication.java.hbs
+2
-4
BootAutoConfiguration.java.hbs
...ava/{{packageName}}/config/BootAutoConfiguration.java.hbs
+1
-1
BootHeaderFilter.java.hbs
...ain/java/{{packageName}}/config/BootHeaderFilter.java.hbs
+1
-1
BootSecurityConfig.java.hbs
...n/java/{{packageName}}/config/BootSecurityConfig.java.hbs
+1
-1
application-boot.yml.hbs
...ctName}}-boot/src/main/resources/application-boot.yml.hbs
+0
-0
application.yml.hbs
...projectName}}-boot/src/main/resources/application.yml.hbs
+2
-2
{{apiEntities}}Resource.java.hbs
...kageName}}/{{apis}}/rest/{{apiEntities}}Resource.java.hbs
+49
-0
{{system.codeName}}{{api.codeName}}Application.java.hbs
...}/{{system.codeName}}{{api.codeName}}Application.java.hbs
+0
-62
{{system.codeName}}{{api.codeName}}Initializer.java.hbs
...}/{{system.codeName}}{{api.codeName}}Initializer.java.hbs
+0
-17
application-sys.yml.hbs
...ectName}}-core/src/main/resources/application-sys.yml.hbs
+0
-22
%SYS%.json.hbs
...ectName}}-core/src/main/resources/sysmodel/%SYS%.json.hbs
+0
-105
未找到文件。
modules/ibizlab-generator-core/src/main/java/cn/ibizlab/codegen/model/ApiEntityModel.java
浏览文件 @
13eacd10
...
@@ -21,6 +21,8 @@ public class ApiEntityModel extends BaseModel {
...
@@ -21,6 +21,8 @@ public class ApiEntityModel extends BaseModel {
private
List
<
ApiDtoModel
>
dtos
=
new
ArrayList
<>();
private
List
<
ApiDtoModel
>
dtos
=
new
ArrayList
<>();
private
ApiDtoModel
defaultDto
;
private
String
apiName
;
private
String
apiName
;
public
String
getApiName
()
public
String
getApiName
()
...
@@ -38,7 +40,10 @@ public class ApiEntityModel extends BaseModel {
...
@@ -38,7 +40,10 @@ public class ApiEntityModel extends BaseModel {
this
.
setId
(
String
.
format
(
"%1$s-%2$s"
,
api
.
getCodeName
(),
apiDataEntity
.
getCodeName
()));
this
.
setId
(
String
.
format
(
"%1$s-%2$s"
,
api
.
getCodeName
(),
apiDataEntity
.
getCodeName
()));
if
(
apiDataEntity
.
getPSDataEntity
()
!=
null
&&
apiDataEntity
.
getPSDataEntity
().
getAllPSDEMethodDTOs
()
!=
null
)
{
if
(
apiDataEntity
.
getPSDataEntity
()
!=
null
&&
apiDataEntity
.
getPSDataEntity
().
getAllPSDEMethodDTOs
()
!=
null
)
{
for
(
IPSDEMethodDTO
iPSDEMethodDTO
:
apiDataEntity
.
getPSDataEntity
().
getAllPSDEMethodDTOs
())
{
for
(
IPSDEMethodDTO
iPSDEMethodDTO
:
apiDataEntity
.
getPSDataEntity
().
getAllPSDEMethodDTOs
())
{
dtos
.
add
(
new
ApiDtoModel
(
this
,
iPSDEMethodDTO
));
ApiDtoModel
dto
=
new
ApiDtoModel
(
this
,
iPSDEMethodDTO
);
dtos
.
add
(
dto
);
if
(
dto
.
codeName
.
equalsIgnoreCase
(
this
.
codeName
+
"dto"
))
defaultDto
=
dto
;
}
}
}
}
...
...
modules/ibizlab-generator-core/src/main/resources/templ/ibiz-boot/{{projectName}}-provider/pom.xml.hbs
浏览文件 @
13eacd10
...
@@ -187,7 +187,7 @@
...
@@ -187,7 +187,7 @@
../
../
</output>
</output>
<inputSpec>
<inputSpec>
${basedir}/src/main/resources/model/
com/sa/jcsc
${basedir}/src/main/resources/model/
{{
replace
packageName
"."
"/"
}}
</inputSpec>
</inputSpec>
<templateDirs>
<templateDirs>
${basedir}/src/main/resources/templ/ibiz-boot
${basedir}/src/main/resources/templ/ibiz-boot
...
...
modules/ibizlab-generator-core/src/main/resources/templ/ibizlab/{{projectName}}-boot/pom.xml.hbs
浏览文件 @
13eacd10
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
</parent>
</parent>
<artifactId>
{{
projectName
}}
-boot
</artifactId>
<artifactId>
{{
projectName
}}
-boot
</artifactId>
<name>
{{
projectDesc
}}
Dev Monolithic
Boot
</name>
<name>
{{
projectDesc
}}
Boot
</name>
<description>
{{
projectDesc
}}
Boot
</description>
<description>
{{
projectDesc
}}
Boot
</description>
<dependencies>
<dependencies>
...
@@ -20,43 +20,59 @@
...
@@ -20,43 +20,59 @@
<version>
${project.version}
</version>
<version>
${project.version}
</version>
</dependency>
</dependency>
</dependencies>
</dependencies>
<build>
<resources>
<resource>
<directory>
${basedir}/src/main/resources
</directory>
<includes>
<include>
**/**
</include>
</includes>
</resource>
</resources>
<plugins>
<plugin>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-maven-plugin
</artifactId>
<configuration>
<finalName>
{{
projectName
}}
</finalName>
<jvmArguments>
-Dfile.encoding=UTF-8
</jvmArguments>
<mainClass>
{{
packageName
}}
.BootApplication
</mainClass>
<outputDirectory>
../
</outputDirectory>
</configuration>
<executions>
<execution>
<goals>
<goal>
repackage
</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>
cn.ibizlab
</groupId>
<artifactId>
ibizlab-generator-plugin
</artifactId>
<version>
1.0-SNAPSHOT
</version>
<configuration>
<output>
../
</output>
<inputSpec>
${basedir}/src/main/resources/model/
{{
replace
packageName
"."
"/"
}}
</inputSpec>
<templateDirs>
${basedir}/src/main/resources/templ/ibizlab
</templateDirs>
<embedTemplate>
ibizlab
</embedTemplate>
<packageName>
${project.groupId}
</packageName>
<name>
${parent.artifactId}
</name>
</configuration>
<!--由于boot是通过dependency来关联所有子项目,页面和配置等信息都存在与子项目中,
</plugin>
所以您在对boot进行打包前,需要先将子项目install到maven仓库,以确保boot可以正常引用所有完整的子项目-->
</plugins>
<profiles>
</build>
<profile>
<id>
boot
</id>
<build>
<resources>
<resource>
<directory>
${basedir}/src/main/resources
</directory>
<includes>
<include>
**/**
</include>
</includes>
</resource>
</resources>
<plugins>
<plugin>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-maven-plugin
</artifactId>
<configuration>
<finalName>
{{
projectName
}}
</finalName>
<jvmArguments>
-Dfile.encoding=UTF-8
</jvmArguments>
<mainClass>
{{
packageName
}}
.DevBootApplication
</mainClass>
<outputDirectory>
../
</outputDirectory>
</configuration>
<executions>
<execution>
<goals>
<goal>
repackage
</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
</project>
modules/ibizlab-generator-core/src/main/resources/templ/ibizlab/{{projectName}}-boot/src/main/java/{{packageName}}/
Dev
BootApplication.java.hbs
→
modules/ibizlab-generator-core/src/main/resources/templ/ibizlab/{{projectName}}-boot/src/main/java/{{packageName}}/BootApplication.java.hbs
浏览文件 @
13eacd10
...
@@ -26,9 +26,7 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -26,9 +26,7 @@ import org.springframework.beans.factory.annotation.Autowired;
{{#
unless
system
.
enableMongo
}}
{{#
unless
system
.
enableMongo
}}
org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration.class,
org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration.class,
{{/
unless
}}
{{/
unless
}}
{{#
unless
system
.
enableDS
}}
com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure.class
com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure.class
{{/
unless
}}
})
})
@ComponentScan(basePackages = {"
{{
packageName
}}
","cn.ibizlab.util"}
@ComponentScan(basePackages = {"
{{
packageName
}}
","cn.ibizlab.util"}
// ,excludeFilters = {
// ,excludeFilters = {
...
@@ -40,13 +38,13 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -40,13 +38,13 @@ import org.springframework.beans.factory.annotation.Autowired;
})
})
@EnableAsync
@EnableAsync
@EnableScheduling
@EnableScheduling
public class
Dev
BootApplication extends WebMvcConfigurerAdapter {
public class BootApplication extends WebMvcConfigurerAdapter {
@Autowired
@Autowired
SearchContextHandlerMethodArgumentResolver resolver;
SearchContextHandlerMethodArgumentResolver resolver;
public static void main(String[] args) {
public static void main(String[] args) {
SpringApplication.run(
Dev
BootApplication.class, args);
SpringApplication.run(BootApplication.class, args);
}
}
@Override
@Override
...
...
modules/ibizlab-generator-core/src/main/resources/templ/ibizlab/{{projectName}}-boot/src/main/java/{{packageName}}/config/
Dev
BootAutoConfiguration.java.hbs
→
modules/ibizlab-generator-core/src/main/resources/templ/ibizlab/{{projectName}}-boot/src/main/java/{{packageName}}/config/BootAutoConfiguration.java.hbs
浏览文件 @
13eacd10
...
@@ -12,7 +12,7 @@ import java.util.concurrent.ThreadPoolExecutor;
...
@@ -12,7 +12,7 @@ import java.util.concurrent.ThreadPoolExecutor;
{{#if
system
.
enableGlobalTransaction
}}
{{#if
system
.
enableGlobalTransaction
}}
@Import({com.alibaba.cloud.seata.feign.SeataFeignClientAutoConfiguration.class})
@Import({com.alibaba.cloud.seata.feign.SeataFeignClientAutoConfiguration.class})
{{/if}}
{{/if}}
public class
Dev
BootAutoConfiguration {
public class BootAutoConfiguration {
@Bean("asyncExecutor")
@Bean("asyncExecutor")
public Executor asyncExecutor() {
public Executor asyncExecutor() {
...
...
modules/ibizlab-generator-core/src/main/resources/templ/ibizlab/{{projectName}}-boot/src/main/java/{{packageName}}/config/
Dev
BootHeaderFilter.java.hbs
→
modules/ibizlab-generator-core/src/main/resources/templ/ibizlab/{{projectName}}-boot/src/main/java/{{packageName}}/config/BootHeaderFilter.java.hbs
浏览文件 @
13eacd10
...
@@ -9,7 +9,7 @@ import org.springframework.stereotype.Component;
...
@@ -9,7 +9,7 @@ import org.springframework.stereotype.Component;
@Component
@Component
@Slf4j
@Slf4j
public class
Dev
BootHeaderFilter extends ZuulFilter {
public class BootHeaderFilter extends ZuulFilter {
@Override
@Override
public String filterType() {
public String filterType() {
...
...
modules/ibizlab-generator-core/src/main/resources/templ/ibizlab/{{projectName}}-boot/src/main/java/{{packageName}}/config/
Dev
BootSecurityConfig.java.hbs
→
modules/ibizlab-generator-core/src/main/resources/templ/ibizlab/{{projectName}}-boot/src/main/java/{{packageName}}/config/BootSecurityConfig.java.hbs
浏览文件 @
13eacd10
...
@@ -24,7 +24,7 @@ import org.springframework.beans.factory.annotation.Qualifier;
...
@@ -24,7 +24,7 @@ import org.springframework.beans.factory.annotation.Qualifier;
@Configuration
@Configuration
@EnableWebSecurity
@EnableWebSecurity
@EnableGlobalMethodSecurity(prePostEnabled = true)
@EnableGlobalMethodSecurity(prePostEnabled = true)
public class
Dev
BootSecurityConfig extends WebSecurityConfigurerAdapter {
public class BootSecurityConfig extends WebSecurityConfigurerAdapter {
@Autowired
@Autowired
private AuthenticationEntryPoint unauthorizedHandler;
private AuthenticationEntryPoint unauthorizedHandler;
...
...
modules/ibizlab-generator-core/src/main/resources/templ/ibizlab/{{projectName}}-boot/src/main/resources/application-
dev
.yml.hbs
→
modules/ibizlab-generator-core/src/main/resources/templ/ibizlab/{{projectName}}-boot/src/main/resources/application-
boot
.yml.hbs
浏览文件 @
13eacd10
文件已移动
modules/ibizlab-generator-core/src/main/resources/templ/ibizlab/{{projectName}}-boot/src/main/resources/application.yml.hbs
浏览文件 @
13eacd10
spring:
spring:
profiles:
profiles:
include: sys
, nacos ,
{{#
each
system
.
apps
}}
{{
lowerCase
codeName
}}
-dev ,
{{/
each
}}{{#
each
system
.
apis
}}
{{
lowerCase
codeName
}}
-dev ,
{{/
each
}}
dev
include: sys
, nacos, boot,
dev
application:
application:
name:
{{
lowerCase
system
.
codeN
ame
}}
name:
{{
lowerCase
system
.
n
ame
}}
main:
main:
allow-bean-definition-overriding: true
allow-bean-definition-overriding: true
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/ibizlab/{{projectName}}-core/src/main/java/{{packageName}}/{{apis}}/rest/{{apiEntities}}Resource.java.hbs
浏览文件 @
13eacd10
...
@@ -20,6 +20,7 @@ import org.springframework.data.domain.Page;
...
@@ -20,6 +20,7 @@ import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Pageable;
import org.springframework.util.StringUtils;
import org.springframework.util.StringUtils;
import org.springframework.util.ObjectUtils;
import org.springframework.context.annotation.Lazy;
import org.springframework.context.annotation.Lazy;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.access.prepost.PostAuthorize;
import org.springframework.security.access.prepost.PostAuthorize;
...
@@ -56,6 +57,17 @@ public class {{apiEntity.codeName}}Resource {
...
@@ -56,6 +57,17 @@ public class {{apiEntity.codeName}}Resource {
{{#
each
apiEntity
.
methods
}}
{{#
each
apiEntity
.
methods
}}
{{#
neq
name
"Select"
}}
{{#
neq
name
"Select"
}}
@ApiOperation(value = "
{{
apiName
}}
", tags = {"
{{
tags
}}
" }, notes = "
{{
notes
}}
")
@ApiOperation(value = "
{{
apiName
}}
", tags = {"
{{
tags
}}
" }, notes = "
{{
notes
}}
")
{{#
eq
methodType
"DEACTION"
}}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','
{{
projectName
}}
-
{{
apiEntity
.
entity
.
codeName
}}
-
{{
name
}}
-all')")
{{#
eq
name
"Update"
}}
{{#if
apiEntity
.
entity
.
lastModifyField
}}
@VersionCheck(entity = "
{{
lowerCase
apiEntity
.
entity
.
codeName
}}
" , versionfield = "
{{
camelCase
apiEntity
.
entity
.
lastModifyField
.
codeName
}}
")
{{/if}}
{{/
eq
}}
{{/
eq
}}
{{#
eq
methodType
"FETCH"
}}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','
{{
projectName
}}
-
{{
apiEntity
.
entity
.
codeName
}}
-
{{
replace
name
"Fetch"
"search"
}}
-all')")
{{/
eq
}}
@RequestMapping(method = RequestMethod.
{{
requestMethod
}}
, value = "
{{
requestPath
}}
")
@RequestMapping(method = RequestMethod.
{{
requestMethod
}}
, value = "
{{
requestPath
}}
")
public ResponseEntity
<
{{
outParam
}}
>
{{
camelCase
name
}}{{#
each
pathVariables
}}{{#if
@first
}}
By
{{else}}
And
{{/if}}{{
pascalCase
name
}}{{/
each
}}
public ResponseEntity
<
{{
outParam
}}
>
{{
camelCase
name
}}{{#
each
pathVariables
}}{{#if
@first
}}
By
{{else}}
And
{{/if}}{{
pascalCase
name
}}{{/
each
}}
(
{{#
each
pathVariables
}}{{#
unless
@first
}}
,
{{/
unless
}}
@PathVariable("
{{
camelCase
name
}}
")
{{
type
.
java
}}
{{
camelCase
name
}}{{/
each
}}{{#if
body
}}{{#if
pathVariables
}}
,
{{/if}}{{#
neq
requestMethod
'GET'
}}
@Validated @RequestBody
{{/
neq
}}{{
body
}}{{/if}}
) {
(
{{#
each
pathVariables
}}{{#
unless
@first
}}
,
{{/
unless
}}
@PathVariable("
{{
camelCase
name
}}
")
{{
type
.
java
}}
{{
camelCase
name
}}{{/
each
}}{{#if
body
}}{{#if
pathVariables
}}
,
{{/if}}{{#
neq
requestMethod
'GET'
}}
@Validated @RequestBody
{{/
neq
}}{{
body
}}{{/if}}
) {
...
@@ -78,6 +90,12 @@ public class {{apiEntity.codeName}}Resource {
...
@@ -78,6 +90,12 @@ public class {{apiEntity.codeName}}Resource {
{{/if}}
{{/if}}
{{/if}}
{{/if}}
{{#if
booleanReturn
}}
{{#if
booleanReturn
}}
{{#
eq
name
"Remove"
}}
if(ObjectUtils.isEmpty(list)) {
list=new ArrayList
<>
();
list.add(
{{#
each
pathVariables
}}{{#if
@last
}}{{
camelCase
name
}}{{/if}}{{/
each
}}
);
}
{{/
eq
}}
{{
camelCase
apiEntity
.
entity
.
codeName
}}
Service.
{{
camelCase
name
}}
(
{{
inParamName2
}}
);
{{
camelCase
apiEntity
.
entity
.
codeName
}}
Service.
{{
camelCase
name
}}
(
{{
inParamName2
}}
);
{{
outParam2
}}
rt =
{{
inParamName2
}}
;
{{
outParam2
}}
rt =
{{
inParamName2
}}
;
{{else}}
{{else}}
...
@@ -109,5 +127,36 @@ public class {{apiEntity.codeName}}Resource {
...
@@ -109,5 +127,36 @@ public class {{apiEntity.codeName}}Resource {
{{/
neq
}}
{{/
neq
}}
{{/
each
}}
{{/
each
}}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','
{{
projectName
}}
-
{{
apiEntity
.
entity
.
codeName
}}
-Create-all')")
@ApiOperation(value = "批量新建
{{
apiEntity
.
entity
.
logicName
}}
", tags = {"
{{
apiEntity
.
entity
.
logicName
}}
" }, notes = "批量新建
{{
apiEntity
.
entity
.
logicName
}}
")
@RequestMapping(method = RequestMethod.POST, value = "/
{{
pluralize
apiEntity
.
codeName
}}
/batch")
public ResponseEntity
<Boolean>
createBatch(@RequestBody List
<
{{
apiEntity
.
codeName
}}
DTO>
dtos) {
{{
camelCase
apiEntity
.
entity
.
codeName
}}
Service.createBatch(
{{
camelCase
apiEntity
.
defaultDto
.
codeName
}}
Mapping.toDomain(dtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','
{{
projectName
}}
-
{{
apiEntity
.
entity
.
codeName
}}
-Update-all')")
@ApiOperation(value = "批量更新
{{
apiEntity
.
entity
.
logicName
}}
", tags = {"
{{
apiEntity
.
entity
.
logicName
}}
" }, notes = "批量更新
{{
apiEntity
.
entity
.
logicName
}}
")
@RequestMapping(method = RequestMethod.PUT, value = "/
{{
pluralize
apiEntity
.
codeName
}}
/batch")
public ResponseEntity
<Boolean>
updateBatch(@RequestBody List
<
{{
apiEntity
.
codeName
}}
DTO>
dtos) {
{{
camelCase
apiEntity
.
entity
.
codeName
}}
Service.updateBatch(
{{
camelCase
apiEntity
.
defaultDto
.
codeName
}}
Mapping.toDomain(dtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','
{{
projectName
}}
-
{{
apiEntity
.
entity
.
codeName
}}
-Save-all')")
@ApiOperation(value = "批量保存
{{
apiEntity
.
entity
.
logicName
}}
", tags = {"
{{
apiEntity
.
entity
.
logicName
}}
" }, notes = "批量保存
{{
apiEntity
.
entity
.
logicName
}}
")
@RequestMapping(method = RequestMethod.POST, value = "/
{{
pluralize
apiEntity
.
codeName
}}
/savebatch")
public ResponseEntity
<Boolean>
saveBatch(@RequestBody List
<
{{
apiEntity
.
codeName
}}
DTO>
dtos) {
{{
camelCase
apiEntity
.
entity
.
codeName
}}
Service.saveBatch(
{{
camelCase
apiEntity
.
defaultDto
.
codeName
}}
Mapping.toDomain(dtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','
{{
projectName
}}
-
{{
apiEntity
.
entity
.
codeName
}}
-Remove-all')")
@ApiOperation(value = "批量删除
{{
apiEntity
.
entity
.
logicName
}}
", tags = {"
{{
apiEntity
.
entity
.
logicName
}}
" }, notes = "批量删除
{{
apiEntity
.
entity
.
logicName
}}
")
@RequestMapping(method = RequestMethod.DELETE, value = {"/
{{
pluralize
apiEntity
.
codeName
}}
","/
{{
pluralize
apiEntity
.
codeName
}}
/batch"})
public ResponseEntity
<Boolean>
removeBatch(@RequestBody List
<
{{
apiEntity
.
entity
.
keyField
.
type
.
java
}}
>
ids) {
{{
camelCase
apiEntity
.
entity
.
codeName
}}
Service.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
}
}
{{/
neq
}}
{{/
neq
}}
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/ibizlab/{{projectName}}-core/src/main/java/{{packageName}}/{{apis}}/{{system.codeName}}{{api.codeName}}Application.java.hbs
已删除
100644 → 0
浏览文件 @
9b80a1ca
package
{{
packageName
}}
.
{{
lowerCase
api
.
codeName
}}
;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.data.mongodb.repository.config.EnableMongoRepositories;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import cn.ibizlab.util.web.SearchContextHandlerMethodArgumentResolver;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
@Slf4j
@EnableDiscoveryClient
@Configuration
@EnableTransactionManagement
@ComponentScan(basePackages = {"
{{
packageName
}}
","cn.ibizlab.util"}
// ,excludeFilters={
// @ComponentScan.Filter(type= org.springframework.context.annotation.FilterType.REGEX,pattern="
{{
packageName
}}
.
{{
lowerCase
api
.
codeName
}}
.rest.xxx"),
// }
)
@EnableMongoRepositories(basePackages = {"
{{
packageName
}}
"})
@MapperScan({"
{{
packageName
}}
.*.mapper","cn.ibizlab.util.mapper" })
@SpringBootApplication(exclude = {
org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration.class,
{{#
unless
system
.
enableMongo
}}
org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration.class,
{{/
unless
}}
{{#
unless
system
.
enableDS
}}
com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure.class
{{/
unless
}}
})
@Import({
org.springframework.cloud.openfeign.FeignClientsConfiguration.class
})
@EnableFeignClients(basePackages = {"
{{
packageName
}}
","cn.ibizlab.util" })
@EnableAsync
@EnableScheduling
public class
{{
system
.
codeName
}}{{
api
.
codeName
}}
Application extends WebMvcConfigurerAdapter{
@Autowired
SearchContextHandlerMethodArgumentResolver resolver;
public static void main(String[] args) {
SpringApplication.run(
{{
system
.
codeName
}}{{
api
.
codeName
}}
Application.class, args);
}
@Override
public void addArgumentResolvers(List
<HandlerMethodArgumentResolver>
argumentResolvers) {
super.addArgumentResolvers(argumentResolvers);
argumentResolvers.add(resolver);
}
}
modules/ibizlab-generator-core/src/main/resources/templ/ibizlab/{{projectName}}-core/src/main/java/{{packageName}}/{{apis}}/{{system.codeName}}{{api.codeName}}Initializer.java.hbs
已删除
100644 → 0
浏览文件 @
9b80a1ca
package
{{
packageName
}}
.
{{
lowerCase
api
.
codeName
}}
;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
/**
* 提供外部容器启动服务能力
*/
@Slf4j
public class
{{
system
.
codeName
}}{{
api
.
codeName
}}
Initializer extends SpringBootServletInitializer {
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
log.info("--正在使用外部容器启动服务--");
return builder.sources(
{{
system
.
codeName
}}{{
api
.
codeName
}}
Application.class);
}
}
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/ibizlab/{{projectName}}-core/src/main/resources/application-sys.yml.hbs
浏览文件 @
13eacd10
...
@@ -42,7 +42,6 @@ spring:
...
@@ -42,7 +42,6 @@ spring:
driver-class-name: com.mysql.jdbc.Driver
driver-class-name: com.mysql.jdbc.Driver
isSyncDBSchema: false
isSyncDBSchema: false
defaultSchema: a_LAB01_da1af574b
defaultSchema: a_LAB01_da1af574b
{{#if
system
.
enableDS
}}
dynamic:
dynamic:
druid: #以下是全局默认值,可以全局更改
druid: #以下是全局默认值,可以全局更改
filters: stat,log4j2
filters: stat,log4j2
...
@@ -80,27 +79,6 @@ spring:
...
@@ -80,27 +79,6 @@ spring:
conf: classpath:liquibase/master.xml
conf: classpath:liquibase/master.xml
isSyncDBSchema: ${spring.datasource.isSyncDBSchema}
isSyncDBSchema: ${spring.datasource.isSyncDBSchema}
defaultSchema: ${spring.datasource.defaultSchema}
defaultSchema: ${spring.datasource.defaultSchema}
{{else}}
conf: classpath:liquibase/master.xml
filters: stat,wall,log4j2
#配置初始化大小/最小/最大
initial-size: 1
min-idle: 1
max-active: 20
#获取连接等待超时时间
max-wait: 60000
#间隔多久进行一次检测,检测需要关闭的空闲连接
time-between-eviction-runs-millis: 60000
#一个连接在池中最小生存的时间
min-evictable-idle-time-millis: 300000
validation-query: SELECT 1 FROM DUAL
test-while-idle: true
test-on-borrow: false
test-on-return: false
#打开PSCache,并指定每个连接上PSCache的大小。oracle设为true,mysql设为false。分库分表较多推荐设置为false
pool-prepared-statements: false
max-pool-prepared-statement-per-connection-size: 20
{{/if}}
#Mybatis-plus配置
#Mybatis-plus配置
mybatis-plus:
mybatis-plus:
...
...
modules/ibizlab-generator-core/src/main/resources/templ/ibizlab/{{projectName}}-core/src/main/resources/sysmodel/%SYS%.json.hbs
已删除
100644 → 0
浏览文件 @
9b80a1ca
{{#
eq
system
.
codeName
"1"
}}
<
#
ibiztemplate
>
TARGET=PSSYSTEM
</
#
ibiztemplate>
{
"systemid":"${sys.codeName}",
"systemname":"${sys.getLogicName()}",
"entities":[
<
#
if
sys
.
getAllPSDataEntities
()??
>
<
#
list
sys
.
getAllPSDataEntities
()
as
de
>
{
"entity_name":"${de.name}",
"logic_name":"${de.logicName}",
"code_name":"${de.codeName}",
"table_name":"${de.getTableName()}",
"system_id":"${sys.codeName}",
"system_name":"${sys.logicName}",
"module_id":"${de.getPSSystemModule().codeName}",
"module_name":"${de.getPSSystemModule().name}",
<
#
--
"
ds_id
"
:null
,
--
>
<
#
--
"
ds_name
"
:
"",
--
>
"fields":[
<
#
if
de
.
getPSDEFields
()??
>
<
#
list
de
.
getPSDEFields
()
as
defield
>
{
"fieldname":"${defield.name}" ,
"codename":"${defield.codeName}",
"field_logic_name":"${defield.logicName}",
"entity_name":"${de.name}",
<
#
if
defield
.
getRelatedPSDEField
??
&&
defield
.
getRelatedPSDEField
()??
>
"ref_de":"${defield.getRelatedPSDEField().getPSDataEntity().name}",
"ref_field_name":"${defield.getRelatedPSDEField().name}",
</
#
if>
<
#
if
(((
defield
.
dataType
())!'')=='
PICKUP
'
||
((
defield
.
dataType
())!'')=='
PICKUPDATA
'
||
((
defield
.
dataType
())!'')=='
PICKUPTEXT
'
)
&&
defield
.
getPSDER1N
()??
>
"relation_name":"${defield.getPSDER1N().getName()}",
"relation_codename":"${defield.getPSDER1N().getCodeName()}",
</
#
if>
"field_type":"${defield.getDataType()}",
<
#
if
defield
.
getPSCodeList
()??
>
"dict":"${defield.getPSCodeList().codeName}",
</
#
if>
"nullable":
<
#
if
defield
.
isAllowEmpty
()
>
1
<
#
else
>
0
</
#
if>
,
"physical_field":
<
#
if
defield
.
isPhisicalDEField
()
>
1
<
#
else
>
0
</
#
if>
,
"data_type":"${srfdatatype(defield.getStdDataType())}",
<
#
if
defield
.
getLength
()?
c
!='
-1
'
>
"data_length":${defield.getLength()?c},
</
#
if>
<
#
if
defield
.
getPrecision
()?
c
!='
0
'
>
"data_preci":${defield.getPrecision()?c},
</
#
if>
<
#
if
defield
.
getDefaultPSDEFDTColumn
??
&&
defield
.
getDefaultPSDEFDTColumn
()??
&&
defield
.
getDefaultPSDEFDTColumn
().
isFormula
()==
true
>
"expression":"${defield.getDefaultPSDEFDTColumn().getFormulaFormat()}",
</
#
if>
<
#
if
defield
.
getPredefinedType
()??
&&
defield
.
getPredefinedType
()!=''
>
"predefined":"${defield.getPredefinedType()}",
</
#
if>
"key_field":
<
#
if
defield
.
isKeyDEField
()==
true
>
1
<
#
else
>
0
</
#
if>
,
<
#
if
defield
.
getUnionKeyValue
()??
&&
defield
.
getUnionKeyValue
()!=''
>
"union_key":"${defield.getUnionKeyValue()}",
</
#
if>
<
#
if
defield
.
getOrderValue
??
&&
defield
.
getOrderValue
()??
>
"show_order":${defield.getOrderValue()?c},
</
#
if>
"major_field":
<
#
if
defield
.
isMajorDEField
()==
true
>
1
<
#
else
>
0
</
#
if>
}
<
#
if
defield_has_next
>
,
</
#
if>
</
#
list>
</
#
if>
],
"subEntitys":[
<
#
if
de
.
getMinorPSDERs
()??
>
<
#
list
de
.
getMajorPSDERs
()
as
majorPSDER
>
{"name":"${majorPSDER.name}",
"relation_type":"${majorPSDER.getDERType()}",
"code_name":"${majorPSDER.getCodeName()}",
"entity_name":"${majorPSDER.getMinorPSDataEntity().name}",
"ref_entity_name":"${majorPSDER.getMajorPSDataEntity().name}"
<
#
--
"
nested_name
"
:
"",
--
>
<
#
--
"
lookup
"
:
""
--
>
}
<
#
if
majorPSDER_has_next
>
,
</
#
if>
</
#
list>
</
#
if>
],
"parentEntitys":[
<
#
if
de
.
getMinorPSDERs
()??
>
<
#
list
de
.
getMinorPSDERs
()
as
minorPSDER
>
{"name":"${minorPSDER.name}",
"relation_type":"${minorPSDER.getDERType()}",
"code_name":"${minorPSDER.getCodeName()}",
"entity_name":"${minorPSDER.getMinorPSDataEntity().name}",
"ref_entity_name":"${minorPSDER.getMajorPSDataEntity().name}"
<
#
--
"
nested_name
"
:
"",
--
>
<
#
--
"
lookup
"
:
""
--
>
}
<
#
if
minorPSDER_has_next
>
,
</
#
if>
</
#
list>
</
#
if>
]
}
<
#
if
de_has_next
>
,
</
#
if>
</
#
list>
</
#
if>
]
}
{{/
eq
}}
\ No newline at end of file
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录