提交 5bbb4ed0 编写于 作者: zhouweidong's avatar zhouweidong

update

上级 d5876551
<#ibiztemplate> <#ibiztemplate>
TARGET=PSDATAENTITY TARGET=PSSYSTEM
</#ibiztemplate> </#ibiztemplate>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
...@@ -8,9 +8,34 @@ TARGET=PSDATAENTITY ...@@ -8,9 +8,34 @@ TARGET=PSDATAENTITY
<name>${pub.getCodeName()?lower_case}-srv</name> <name>${pub.getCodeName()?lower_case}-srv</name>
<packaging>jar</packaging> <packaging>jar</packaging>
<parent> <parent>
<artifactId>${sys.codeName}</artifactId> <groupId>org.springframework.boot</groupId>
<groupId>${pub.getPKGCodeName()}</groupId> <artifactId>spring-boot-starter-parent</artifactId>
<version>0.0.1-SNAPSHOT</version> <version>2.0.1.RELEASE</version>
<relativePath>../pom.xml</relativePath>
</parent> </parent>
<properties>
<junit.version>4.12</junit.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${r'${junit.version}'}</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
</dependency>
</dependencies>
</project> </project>
\ No newline at end of file
...@@ -7,15 +7,30 @@ package ${pub.getPKGCodeName()}.${de.getPSSystemModule().codeName?lower_case}.re ...@@ -7,15 +7,30 @@ package ${pub.getPKGCodeName()}.${de.getPSSystemModule().codeName?lower_case}.re
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import ${pub.getPKGCodeName()}.${de.getPSSystemModule().codeName?lower_case}.domain.${de.codeName}; import ${pub.getPKGCodeName()}.${de.getPSSystemModule().codeName?lower_case}.domain.${de.codeName};
import org.springframework.beans.factory.annotation.Autowired;
import ${pub.getPKGCodeName()}.${de.getPSSystemModule().codeName?lower_case}.service.${de.codeName}Service;
@RestController @RestController
public class ${de.codeName}Controller{ public class ${de.codeName}Controller{
<#assign appReqUrl="/" +app.getPKGCodeName()?lower_case + "/"+de.getPSSystemModule().codeName?lower_case +"/"+de.codeName?lower_case ><#comment>拼接当前应用的请求路径</#comment> <#assign appReqUrl="/" +app.getPKGCodeName()?lower_case + "/"+de.getPSSystemModule().codeName?lower_case +"/"+de.codeName?lower_case ><#comment>当前实体请求路径</#comment>
@PostMapping(value="${appReqUrl}") <#comment>注入当前实体的服务对象</#comment>
public ${de.codeName} index(){ @Autowired
${de.codeName} entity =new ${de.codeName}(); private ${de.codeName}Service ${de.codeName?lower_case}Service;
<#list item.getPSControls() as ctrl><#comment>输出实体所使用到的部件(实体用到的部件可能有:表格、表单、树视图等)</#comment>
<#if ctrl.getControlType() == 'FORM'><#comment>本示例中只展示表单</#comment>
<#list ctrl.getPSAjaxControlHandler().getPSAjaxHandlerActions() as action><#comment>输出表单行为:(新建、编辑、删除等)</#comment>
<#if action.getActionName()=='Create'><#comment>本示例中只展示表单新建逻辑</#comment>
@PostMapping(value="${appReqUrl}/form/create")
public ${de.codeName} formCreate(${de.codeName} entity){
return entity; return entity;
} }
<#break>
</#if>
</#list>
<#break>
</#if>
</#list>
} }
<#ibiztemplate>
TARGET=PSDATAENTITY
</#ibiztemplate>
package ${pub.getPKGCodeName()}.${item.getPSSystemModule().codeName?lower_case}.service;
import ${pub.getPKGCodeName()}.${item.getPSSystemModule().codeName?lower_case}.domain.${item.codeName};
import com.baomidou.mybatisplus.extension.service.IService;
/**
* 实体[${item.codeName}] 服务对象接口
*/
public interface ${item.codeName}Service extends IService<${item.codeName}>{
<#if item.getAllPSDEActions()??>
<#list item.getAllPSDEActions() as deaction>
<#if (deaction.getActionMode() == "READ") ><#comment>Get与自定义行为返回DoMain不发带major</#comment>
${item.codeName} ${srfmethodname(deaction.getCodeName())}(${item.codeName} et);
<#else>
boolean ${srfmethodname(deaction.getCodeName())}(${item.codeName} et);
</#if>
</#list>
</#if>
}
\ No newline at end of file
<#ibiztemplate>
TARGET=PSDATAENTITY
</#ibiztemplate>
package ${pub.getPKGCodeName()}.${item.getPSSystemModule().codeName?lower_case}.service.impl;
import org.springframework.stereotype.Service;
import ${pub.getPKGCodeName()}.${item.getPSSystemModule().codeName?lower_case}.mapper.${item.codeName}Mapper;
import ${pub.getPKGCodeName()}.${item.getPSSystemModule().codeName?lower_case}.domain.${item.codeName};
import ${pub.getPKGCodeName()}.${item.getPSSystemModule().codeName?lower_case}.service.${item.codeName}Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* 实体[${item.codeName}] 服务对象接口实现
*/
@Service
public class ${item.codeName}ServiceImpl extends ServiceImpl<${item.codeName}Mapper, ${item.codeName}> implements ${item.codeName}Service{
}
\ No newline at end of file
...@@ -5,6 +5,7 @@ package ${pub.getPKGCodeName()}; ...@@ -5,6 +5,7 @@ package ${pub.getPKGCodeName()};
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.mybatis.spring.annotation.MapperScan;
@SpringBootApplication @SpringBootApplication
public class ${pub.getCodeName()?lower_case}Main{ public class ${pub.getCodeName()?lower_case}Main{
......
<#ibiztemplate> <#ibiztemplate>
TARGET=PSSYSTEM TARGET=PSSYSTEM
</#ibiztemplate> </#ibiztemplate>
<#assign dbinst = sysrun.getPSDBDevInst()>
server: server:
port: 8080 port: 8080
servlet: servlet:
...@@ -9,11 +8,11 @@ server: ...@@ -9,11 +8,11 @@ server:
spring: spring:
datasource: datasource:
username: ${dbinst.getUserName()} username: test
password: '${dbinst.getPassword()}' password: 'test'
url: jdbc:h2:mem:${dbinst.getUserName()}; url: jdbc:h2:mem:test;
driver-class-name: org.h2.Driver driver-class-name: org.h2.Driver
logging: logging:
level: level:
${pub.getPKGCodeName()}: debug ${pub.getPKGCodeName()}: debug
\ No newline at end of file \ No newline at end of file
<#ibiztemplate>
TARGET=PSSYSTEM
</#ibiztemplate>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>${sys.codeName}</artifactId>
<groupId>${pub.getPKGCodeName()}</groupId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<modules>
<module>${pub.getCodeName()?lower_case}-srv</module>
</modules>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.1.RELEASE</version>
</parent>
<properties>
<mybatis-plus.version>3.0.6</mybatis-plus.version>
<junit.version>4.12</junit.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${r'${junit.version}'}</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
</dependency>
</dependencies>
</project>
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册