| | |
| | | package com.java110.code.back; |
| | | |
| | | import com.java110.code.util.FileUtilBase; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | |
| | | String variableGetSet = ""; |
| | | |
| | | for (String key : params.keySet()) { |
| | | if ("operate".equals(key) || "bId".equals(key) || "statusCd".equals(key)) { |
| | | if ("operate".equals(key) || "bId".equals(key) || "statusCd".equals(key)|| "createTime".equals(key)) { |
| | | continue; |
| | | } |
| | | variable += "private String " + key + ";\n"; |
| | |
| | | * |
| | | * @param data 数据 |
| | | */ |
| | | public void generator(Data data) { |
| | | public void generator(Data data) throws Exception { |
| | | StringBuffer sb = readFile(this.getClass().getResource("/template/dto.txt").getFile()); |
| | | String fileContext = sb.toString(); |
| | | fileContext = fileContext.replace("store", toLowerCaseFirstOne(data.getName())) |
| | | .replace("@@templateCode@@",data.getName()) |
| | | .replace("Store", toUpperCaseFirstOne(data.getName())) |
| | | .replace("商户", data.getDesc()); |
| | | |
| | |
| | | |
| | | writeFile(writePath, |
| | | fileContext); |
| | | //复制生成的文件到对应分区目录下 |
| | | if (data.isAutoMove()) { |
| | | FileUtilBase.copyfile(writePath, "java110-bean\\src\\main\\java\\com\\java110\\dto\\" + data.getName() + "/" + toUpperCaseFirstOne(data.getName()) + "Dto.java"); |
| | | } |
| | | } |
| | | } |