From 1422b405bd2fcf8ab1076e72880fae540ddd304c Mon Sep 17 00:00:00 2001 From: 王彬 Date: Tue, 26 Jan 2021 15:22:24 +0800 Subject: [PATCH] 1.remove unuseful code --- src/main/resources/template/bazhuayun/DtoTemplate.ftl | 47 ----------------------------------------------- src/main/resources/template/bazhuayun/RepositoryTemplate.ftl | 16 +--------------- src/main/resources/template/bazhuayun/ServiceImplTemplate.ftl | 51 --------------------------------------------------- src/main/resources/template/bazhuayun/ServiceTemplate.ftl | 38 -------------------------------------- 4 files changed, 1 insertion(+), 151 deletions(-) delete mode 100644 src/main/resources/template/bazhuayun/DtoTemplate.ftl diff --git a/src/main/resources/template/bazhuayun/DtoTemplate.ftl b/src/main/resources/template/bazhuayun/DtoTemplate.ftl deleted file mode 100644 index c80033c..0000000 --- a/src/main/resources/template/bazhuayun/DtoTemplate.ftl +++ /dev/null @@ -1,47 +0,0 @@ -package ${basePackage}.bean.dto; - -import java.io.Serializable; -import java.math.BigDecimal; -import java.sql.Timestamp; -import java.util.Date; - -/** - <#if version?exists> - * @version ${version} - - */ -public class ${dtoClassSimpleName} implements Serializable { - - private static final long serialVersionUID = 1L; - - <#--变量 ,get,set方法--> -<#if tablemodel.columnlist?exists> - private String ssid; - - public String getSsid(){ - return ssid; - } - public void setSsid(String ssid){ - this.ssid = ssid; - } - - <#list tablemodel.columnlist as clist> - <#if clist.columnRemarks?exists> - /** - * ${clist.columnRemarks} - */ - - <#if clist.columnName != "id" && clist.columnName != "ssid" > - private ${clist.columnJAVAType} ${clist.columnName}; - - public ${clist.columnJAVAType} get${clist.columnMethodName}(){ - return ${clist.columnName}; - } - public void set${clist.columnMethodName}(${clist.columnJAVAType} ${clist.columnName}){ - this.${clist.columnName} = ${clist.columnName}; - } - - - - -} \ No newline at end of file diff --git a/src/main/resources/template/bazhuayun/RepositoryTemplate.ftl b/src/main/resources/template/bazhuayun/RepositoryTemplate.ftl index 6a55155..a62a01f 100644 --- a/src/main/resources/template/bazhuayun/RepositoryTemplate.ftl +++ b/src/main/resources/template/bazhuayun/RepositoryTemplate.ftl @@ -51,19 +51,5 @@ public class ${repositoryClassSimpleName} extends CustomJdbcTemplate<${entityCla throw new Exception("对象转换失败"); } return voObj; - } - - public void updateEntityById(Integer id, List updateList) throws Exception{ - this.updateEntityById(updateList, id); - } - - public void deleteEntityById(Integer id) throws Exception{ - this.deleteEntityByID(id); - } - - public ${voClassSimpleName} addEntityByMap(Map data) throws Exception{ - ${entityClassSimpleName} entityObj = UtilHttpRequestMap.getBeanByMap(data, ${entityClassSimpleName}.class, false, "id"); - BigInteger resultId = this.addEntityForAutoincrementId(entityObj); - return this.getVoByEntity(this.findEntityByID(resultId.intValue())); - } + } } diff --git a/src/main/resources/template/bazhuayun/ServiceImplTemplate.ftl b/src/main/resources/template/bazhuayun/ServiceImplTemplate.ftl index 3bdfed5..809211a 100644 --- a/src/main/resources/template/bazhuayun/ServiceImplTemplate.ftl +++ b/src/main/resources/template/bazhuayun/ServiceImplTemplate.ftl @@ -38,55 +38,4 @@ public class ${serviceImplClassSimpleName} implements ${serviceClassSimpleName} return UtilResultInfo.getFailure(e.getMessage()); } } - - @Override - public ResultInfo getListManage(List condition, Integer page, Integer size) { - try { - return UtilResultInfo.getSuccess("查询成功", this.${repositoryClassFieldName}.getVoPage(condition, page, size)); - } catch (Exception e) { - UtilLog.errorForException(e, this.getClass()); - return UtilResultInfo.getFailure(e.getMessage()); - } - } - - @Override - public ResultInfo getOneManage(Integer id) { - try { - return UtilResultInfo.getSuccess("查询成功", this.${repositoryClassFieldName}.findEntityByID(id)); - } catch (Exception e) { - return UtilResultInfo.getFailure(e.getMessage()); - } - } - - @Override - public ResultInfo putManage(Integer id, List updateList) { - try{ - this.${repositoryClassFieldName}.updateEntityById(id, updateList); - }catch(Exception e){ - UtilLog.errorForException(e, this.getClass()); - return UtilResultInfo.getFailure(e.getMessage()); - } - return UtilResultInfo.getSuccess("更新成功"); - } - - @Override - public ResultInfo deleteManage(Integer id) { - try{ - this.${repositoryClassFieldName}.deleteEntityById(id); - }catch(Exception e){ - UtilLog.errorForException(e, this.getClass()); - return UtilResultInfo.getFailure(e.getMessage()); - } - return UtilResultInfo.getSuccess("删除成功"); - } - - @Override - public ResultInfo postManage(Map data) { - try { - return UtilResultInfo.getSuccess("创建成功", this.${repositoryClassFieldName}.addEntityByMap(data)); - } catch (Exception e) { - UtilLog.errorForException(e, this.getClass()); - return UtilResultInfo.getFailure(e.getMessage()); - } - } } diff --git a/src/main/resources/template/bazhuayun/ServiceTemplate.ftl b/src/main/resources/template/bazhuayun/ServiceTemplate.ftl index c495fa8..ca40106 100644 --- a/src/main/resources/template/bazhuayun/ServiceTemplate.ftl +++ b/src/main/resources/template/bazhuayun/ServiceTemplate.ftl @@ -21,42 +21,4 @@ public interface ${serviceClassSimpleName} { * @return */ public ResultInfo getOneV1(Integer id); - - /** - * 获取列表 - * @param condition - * @param page - * @param size - * @return - */ - public ResultInfo getListManage(List condition, Integer page, Integer size); - - /** - * 获取id对应的数据 - * @param id - * @return - */ - public ResultInfo getOneManage(Integer id); - - /** - * 修改id对应的数据 - * @param id - * @param updateList - * @return - */ - public ResultInfo putManage(Integer id, List updateList); - - /** - * 删除ssid对应的数据 - * @param id - * @return - */ - public ResultInfo deleteManage(Integer id); - - /** - * 创建数据 - * @param data - * @return - */ - public ResultInfo postManage(Map data); } -- libgit2 0.21.2