Commit 704aa573 by yubaogu

tett

parent 7afec11c
......@@ -19,7 +19,7 @@ import ${entityUrl}.${entityName};
*
*/
@Mapper
public interface ${entityName}Dao extends BaseMapper<${entityName}> {
public interface ${entityName}Mapper extends BaseMapper<${entityName}> {
}
\ No newline at end of file
......@@ -32,7 +32,7 @@ import ${ps};
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class ${entityName} extends Model<${entityName}> {
public class ${entityName} implements Serializable{
private static final long serialVersionUID = ${agile}L;
......
......@@ -22,6 +22,6 @@ import com.github.pagehelper.PageHelper;
*
*/
@Service
public class ${entityName}ServiceImpl extends ServiceImpl<${entityName}Dao, ${entityName}> implements ${entityName}Service {
public class ${entityName}ServiceImpl extends BaseService<${entityName}> implements ${entityName}Service {
}
\ No newline at end of file
......@@ -7,6 +7,7 @@
package com.flying.cattle.mdg;
import java.io.IOException;
import java.io.Serializable;
import java.sql.SQLException;
import java.text.SimpleDateFormat;
import java.util.Date;
......@@ -25,28 +26,28 @@ import javax.swing.text.DateFormatter;
* <p>说明: 自动生成工具</P>
* <p>源码地址:https://gitee.com/flying-cattle/mybatis-dsc-generator</P>
*/
public class MyGenerator {
public class MyGenerator implements Serializable {
// 基础信息:项目名、作者、版本
public static final String PROJECT = "wallet-sign";
public static final String AUTHOR = "BianPeng";
public static final String VERSION = "V1.0";
// 数据库连接信息:连接URL、用户名、秘密、数据库名
public static final String URL = "jdbc:mysql://localhost:3306/seata?useSSL=false&serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8";
public static final String NAME = "root";
public static final String PASS = "12345678";
public static final String DATABASE = "seata";
public static final String URL = "jdbc:mysql://120.26.213.52:3306/ydl?useSSL=false&serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8";
public static final String NAME = "ydl";
public static final String PASS = "tt12345";
public static final String DATABASE = "ydl";
// 类信息:类名、对象名(一般是【类名】的首字母小些)、类说明、时间
public static final String TABLE = "undo_log";
public static final String CLASSCOMMENT = "日志";
public static final String TABLE = "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.buybit.power.entity";
public static final String DAO_URL = "com.buybit.power.mapper";
public static final String XML_URL = "com.buybit.power.mapper.xml";
public static final String SERVICE_URL = "com.buybit.power.service";
public static final String SERVICE_IMPL_URL = "com.buybit.power.service.impl";
public static final String CONTROLLER_URL = "com.buybit.power.api";
public static final String ENTITY_URL = "com.ydl.demo.entity";
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 CONTROLLER_URL = "com.ydl.demo.api";
//是否是Swagger配置
public static final String IS_SWAGGER = "true";
......@@ -60,21 +61,25 @@ public class MyGenerator {
bi.setEntityComment(CLASSCOMMENT);
try {
bi = EntityInfoUtil.getInfo(bi);
String fileUrl = "D:\\ydlwork\\generator\\demo\\src\\main\\java\\";// 生成文件存放位置
String fileUrl = "D:\\ydlwork\\ydl-demo\\ydl-demo-api\\src\\main\\java\\";// 生成文件存放位置
//开始生成文件
String aa1 = Generator.createEntity(fileUrl, bi).toString();
String aa2 = Generator.createDao(fileUrl, bi).toString();
String aa3 = Generator.createDaoImpl(fileUrl, bi).toString();
String aa4 = Generator.createService(fileUrl, bi).toString();
String aa5 = Generator.createServiceImpl(fileUrl, bi).toString();
// String aa1 = Generator.createEntity(fileUrl, bi).toString();
// String aa2 = Generator.createDao(fileUrl, bi).toString();
// String aa3 = Generator.createDaoImpl(fileUrl, bi).toString();
String aa4 = Generator.createService(fileUrl, bi).toString();
String aa5 = Generator.createServiceImpl(fileUrl, bi).toString();
String aa6 = Generator.createController(fileUrl, bi).toString();
// 是否创建swagger配置文件
String aa7 = Generator.createSwaggerConfig(fileUrl, bi).toString();
System.out.println(aa1);
System.out.println(aa2); System.out.println(aa3); System.out.println(aa4);
System.out.println(aa5); System.out.println(aa6); System.out.println(aa7);
// String aa7 = Generator.createSwaggerConfig(fileUrl, bi).toString();
// System.out.println(aa1);
// System.out.println(aa2);
// System.out.println(aa3);
System.out.println(aa4);
System.out.println(aa5);
System.out.println(aa6);
// System.out.println(aa7);
//System.out.println(aa7);
} catch (SQLException e) {
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