Commit 1bc03dab by yubaogu

tett

parent 704aa573
......@@ -69,6 +69,10 @@ public class BasisInfo implements Serializable{
private String serviceImplUrl;
private String facadeUrl;
private String facadeImplUrl;
private String abstractControllerUrl;
private String controllerUrl;
......@@ -87,7 +91,7 @@ public class BasisInfo implements Serializable{
public BasisInfo(String project, String author, String version, String dbUrl, String dbName, String dbPassword,
String database, String createTime, String agile, String entityUrl, String daoUrl, String mapperUrl,
String serviceUrl, String serviceImplUrl, String controllerUrl,String isSwagger) {
String serviceUrl, String serviceImplUrl,String facadeUrl, String facadeImplUrl, String controllerUrl,String isSwagger) {
super();
this.project = project;
this.author = author;
......@@ -103,6 +107,8 @@ public class BasisInfo implements Serializable{
this.mapperUrl = mapperUrl;
this.serviceUrl = serviceUrl;
this.serviceImplUrl = serviceImplUrl;
this.facadeUrl = facadeUrl;
this.facadeImplUrl = facadeImplUrl;
this.controllerUrl = controllerUrl;
this.abstractControllerUrl = controllerUrl.substring(0, controllerUrl.lastIndexOf("."))+".aid";
this.swaggerConfigUrl=controllerUrl.substring(0, controllerUrl.lastIndexOf("."))+".config";
......
/**
* @filename:${entityName}Service ${createTime}
* @project ${project} ${version}
* Copyright(c) 2020 ${author} Co. Ltd.
* All right reserved.
*/
package ${facadeUrl};
import ${entityUrl}.${entityName};
import java.util.LinkedHashMap;
import java.util.List;
import com.ydl.common.dto.BaseDtoResponse;
/**
* @Description:TODO(${entityComment}服务层)
* @version: ${version}
* @author: ${author}
*
*/
public interface ${entityName}Facade {
}
\ No newline at end of file
/**
* @filename:${entityName}ServiceImpl ${createTime}
* @project ${project} ${version}
* Copyright(c) 2018 ${author} Co. Ltd.
* All right reserved.
*/
package ${serviceImplUrl};
import ${entityUrl}.${entityName};
import ${facadeUrl}.${entityName}Facade;
import org.springframework.stereotype.Service;
import com.alibaba.dubbo.config.annotation.Service;
import com.github.pagehelper.PageHelper;
/**
* @Description:TODO(${entityComment}服务实现)
*
* @version: ${version}
* @author: ${author}
*
*/
@Service(version = "1.0.0", interfaceClass = ${entityName}Facade.class)
public class ${entityName}FacadeImpl implements ${entityName}Facade {
}
\ No newline at end of file
......@@ -10,6 +10,7 @@ import java.io.IOException;
import java.io.Serializable;
import java.sql.SQLException;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Date;
import com.alibaba.druid.support.json.JSONUtils;
......@@ -38,15 +39,18 @@ public class MyGenerator implements Serializable {
public static final String DATABASE = "ydl";
// 类信息:类名、对象名(一般是【类名】的首字母小些)、类说明、时间
public static final String TABLE = "doctor";
public static final String[] TABLES = {"doctor"};
public static final String CLASSCOMMENT = "专家";
public static final String TIME = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
public static final String AGILE = new Date().getTime() + "";
// 路径信息,分开路径方便聚合工程项目,微服务项目
public static final String ENTITY_URL = "com.ydl.demo.entity";
public static final String ENTITY_URL = "com.ydl.demo.po";
public static final String DAO_URL = "com.ydl.demo.mapper";
public static final String XML_URL = "com.ydl.demo.mapper.xml";
public static final String SERVICE_URL = "com.ydl.demo.service";
public static final String SERVICE_IMPL_URL = "com.ydl.demo.service.impl";
public static final String FACADE_URL = "com.ydl.demo.facade";
public static final String FACADE_URL_IMPL = "com.ydl.demo.facade";
public static final String CONTROLLER_URL = "com.ydl.demo.api";
//是否是Swagger配置
public static final String IS_SWAGGER = "true";
......@@ -54,10 +58,11 @@ public class MyGenerator implements Serializable {
public static void main(String[] args) throws IOException {
System.out.println(MyGenerator.class.getResource("").getPath());
BasisInfo bi = new BasisInfo(PROJECT, AUTHOR, VERSION, URL, NAME, PASS, DATABASE, TIME, AGILE, ENTITY_URL,
DAO_URL, XML_URL, SERVICE_URL, SERVICE_IMPL_URL, CONTROLLER_URL,IS_SWAGGER);
bi.setTable(TABLE);
bi.setEntityName(MySqlToJavaUtil.getClassName(TABLE));
bi.setObjectName(MySqlToJavaUtil.changeToJavaFiled(TABLE));
DAO_URL, XML_URL, SERVICE_URL, SERVICE_IMPL_URL,FACADE_URL, FACADE_URL_IMPL, CONTROLLER_URL,IS_SWAGGER);
for(String table : TABLES) {
bi.setTable(table);
bi.setEntityName(MySqlToJavaUtil.getClassName(table));
bi.setObjectName(MySqlToJavaUtil.changeToJavaFiled(table));
bi.setEntityComment(CLASSCOMMENT);
try {
bi = EntityInfoUtil.getInfo(bi);
......@@ -85,4 +90,5 @@ public class MyGenerator implements Serializable {
e.printStackTrace();
}
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment