Commit 1422b405bd2fcf8ab1076e72880fae540ddd304c
1 parent
5407045e
Exists in
master
1.remove unuseful code
Showing
4 changed files
with
1 additions
and
151 deletions
Show diff stats
src/main/resources/template/bazhuayun/DtoTemplate.ftl
| ... | ... | @@ -1,47 +0,0 @@ |
| 1 | -package ${basePackage}.bean.dto; | |
| 2 | - | |
| 3 | -import java.io.Serializable; | |
| 4 | -import java.math.BigDecimal; | |
| 5 | -import java.sql.Timestamp; | |
| 6 | -import java.util.Date; | |
| 7 | - | |
| 8 | -/** | |
| 9 | - <#if version?exists> | |
| 10 | - * @version ${version} | |
| 11 | - </#if> | |
| 12 | - */ | |
| 13 | -public class ${dtoClassSimpleName} implements Serializable { | |
| 14 | - | |
| 15 | - private static final long serialVersionUID = 1L; | |
| 16 | - | |
| 17 | - <#--变量 ,get,set方法--> | |
| 18 | -<#if tablemodel.columnlist?exists> | |
| 19 | - private String ssid; | |
| 20 | - | |
| 21 | - public String getSsid(){ | |
| 22 | - return ssid; | |
| 23 | - } | |
| 24 | - public void setSsid(String ssid){ | |
| 25 | - this.ssid = ssid; | |
| 26 | - } | |
| 27 | - | |
| 28 | - <#list tablemodel.columnlist as clist> | |
| 29 | - <#if clist.columnRemarks?exists> | |
| 30 | - /** | |
| 31 | - * ${clist.columnRemarks} | |
| 32 | - */ | |
| 33 | - </#if> | |
| 34 | - <#if clist.columnName != "id" && clist.columnName != "ssid" > | |
| 35 | - private ${clist.columnJAVAType} ${clist.columnName}; | |
| 36 | - | |
| 37 | - public ${clist.columnJAVAType} get${clist.columnMethodName}(){ | |
| 38 | - return ${clist.columnName}; | |
| 39 | - } | |
| 40 | - public void set${clist.columnMethodName}(${clist.columnJAVAType} ${clist.columnName}){ | |
| 41 | - this.${clist.columnName} = ${clist.columnName}; | |
| 42 | - } | |
| 43 | - </#if> | |
| 44 | - </#list> | |
| 45 | -</#if> | |
| 46 | - | |
| 47 | -} | |
| 48 | 0 | \ No newline at end of file |
src/main/resources/template/bazhuayun/RepositoryTemplate.ftl
| ... | ... | @@ -51,19 +51,5 @@ public class ${repositoryClassSimpleName} extends CustomJdbcTemplate<${entityCla |
| 51 | 51 | throw new Exception("对象转换失败"); |
| 52 | 52 | } |
| 53 | 53 | return voObj; |
| 54 | - } | |
| 55 | - | |
| 56 | - public void updateEntityById(Integer id, List<Object[]> updateList) throws Exception{ | |
| 57 | - this.updateEntityById(updateList, id); | |
| 58 | - } | |
| 59 | - | |
| 60 | - public void deleteEntityById(Integer id) throws Exception{ | |
| 61 | - this.deleteEntityByID(id); | |
| 62 | - } | |
| 63 | - | |
| 64 | - public ${voClassSimpleName} addEntityByMap(Map<String, Object> data) throws Exception{ | |
| 65 | - ${entityClassSimpleName} entityObj = UtilHttpRequestMap.getBeanByMap(data, ${entityClassSimpleName}.class, false, "id"); | |
| 66 | - BigInteger resultId = this.addEntityForAutoincrementId(entityObj); | |
| 67 | - return this.getVoByEntity(this.findEntityByID(resultId.intValue())); | |
| 68 | - } | |
| 54 | + } | |
| 69 | 55 | } | ... | ... |
src/main/resources/template/bazhuayun/ServiceImplTemplate.ftl
| ... | ... | @@ -38,55 +38,4 @@ public class ${serviceImplClassSimpleName} implements ${serviceClassSimpleName} |
| 38 | 38 | return UtilResultInfo.getFailure(e.getMessage()); |
| 39 | 39 | } |
| 40 | 40 | } |
| 41 | - | |
| 42 | - @Override | |
| 43 | - public ResultInfo getListManage(List<Object[]> condition, Integer page, Integer size) { | |
| 44 | - try { | |
| 45 | - return UtilResultInfo.getSuccess("查询成功", this.${repositoryClassFieldName}.getVoPage(condition, page, size)); | |
| 46 | - } catch (Exception e) { | |
| 47 | - UtilLog.errorForException(e, this.getClass()); | |
| 48 | - return UtilResultInfo.getFailure(e.getMessage()); | |
| 49 | - } | |
| 50 | - } | |
| 51 | - | |
| 52 | - @Override | |
| 53 | - public ResultInfo getOneManage(Integer id) { | |
| 54 | - try { | |
| 55 | - return UtilResultInfo.getSuccess("查询成功", this.${repositoryClassFieldName}.findEntityByID(id)); | |
| 56 | - } catch (Exception e) { | |
| 57 | - return UtilResultInfo.getFailure(e.getMessage()); | |
| 58 | - } | |
| 59 | - } | |
| 60 | - | |
| 61 | - @Override | |
| 62 | - public ResultInfo putManage(Integer id, List<Object[]> updateList) { | |
| 63 | - try{ | |
| 64 | - this.${repositoryClassFieldName}.updateEntityById(id, updateList); | |
| 65 | - }catch(Exception e){ | |
| 66 | - UtilLog.errorForException(e, this.getClass()); | |
| 67 | - return UtilResultInfo.getFailure(e.getMessage()); | |
| 68 | - } | |
| 69 | - return UtilResultInfo.getSuccess("更新成功"); | |
| 70 | - } | |
| 71 | - | |
| 72 | - @Override | |
| 73 | - public ResultInfo deleteManage(Integer id) { | |
| 74 | - try{ | |
| 75 | - this.${repositoryClassFieldName}.deleteEntityById(id); | |
| 76 | - }catch(Exception e){ | |
| 77 | - UtilLog.errorForException(e, this.getClass()); | |
| 78 | - return UtilResultInfo.getFailure(e.getMessage()); | |
| 79 | - } | |
| 80 | - return UtilResultInfo.getSuccess("删除成功"); | |
| 81 | - } | |
| 82 | - | |
| 83 | - @Override | |
| 84 | - public ResultInfo postManage(Map<String, Object> data) { | |
| 85 | - try { | |
| 86 | - return UtilResultInfo.getSuccess("创建成功", this.${repositoryClassFieldName}.addEntityByMap(data)); | |
| 87 | - } catch (Exception e) { | |
| 88 | - UtilLog.errorForException(e, this.getClass()); | |
| 89 | - return UtilResultInfo.getFailure(e.getMessage()); | |
| 90 | - } | |
| 91 | - } | |
| 92 | 41 | } | ... | ... |
src/main/resources/template/bazhuayun/ServiceTemplate.ftl
| ... | ... | @@ -21,42 +21,4 @@ public interface ${serviceClassSimpleName} { |
| 21 | 21 | * @return |
| 22 | 22 | */ |
| 23 | 23 | public ResultInfo getOneV1(Integer id); |
| 24 | - | |
| 25 | - /** | |
| 26 | - * 获取列表 | |
| 27 | - * @param condition | |
| 28 | - * @param page | |
| 29 | - * @param size | |
| 30 | - * @return | |
| 31 | - */ | |
| 32 | - public ResultInfo getListManage(List<Object[]> condition, Integer page, Integer size); | |
| 33 | - | |
| 34 | - /** | |
| 35 | - * 获取id对应的数据 | |
| 36 | - * @param id | |
| 37 | - * @return | |
| 38 | - */ | |
| 39 | - public ResultInfo getOneManage(Integer id); | |
| 40 | - | |
| 41 | - /** | |
| 42 | - * 修改id对应的数据 | |
| 43 | - * @param id | |
| 44 | - * @param updateList | |
| 45 | - * @return | |
| 46 | - */ | |
| 47 | - public ResultInfo putManage(Integer id, List<Object[]> updateList); | |
| 48 | - | |
| 49 | - /** | |
| 50 | - * 删除ssid对应的数据 | |
| 51 | - * @param id | |
| 52 | - * @return | |
| 53 | - */ | |
| 54 | - public ResultInfo deleteManage(Integer id); | |
| 55 | - | |
| 56 | - /** | |
| 57 | - * 创建数据 | |
| 58 | - * @param data | |
| 59 | - * @return | |
| 60 | - */ | |
| 61 | - public ResultInfo postManage(Map<String, Object> data); | |
| 62 | 24 | } | ... | ... |