|
|
|
@ -53,7 +53,7 @@ public class SDKCallable implements Callable {
|
|
|
|
|
System.out.println("生成模块:Pom");
|
|
|
|
|
HashMap<String, Object> ctx = new HashMap<String, Object>();
|
|
|
|
|
ctx.put("sdk", sdk.getName().toLowerCase());
|
|
|
|
|
File file = new File(sdk.getAbsolutePath() + File.separator + "pom.xml");
|
|
|
|
|
File file = new File(sdk, "pom.xml");
|
|
|
|
|
freeMarkerManager.outputTemp(file, "Java_api/pom.ftl", ctx);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -103,7 +103,7 @@ public class SDKCallable implements Callable {
|
|
|
|
|
|
|
|
|
|
stringBuffer.append(javaClassReader.getModuleName());
|
|
|
|
|
|
|
|
|
|
File request = new File(stringBuffer.toString() + File.separator + "request");
|
|
|
|
|
File request = new File(stringBuffer.toString(), "request");
|
|
|
|
|
request.mkdirs();
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
@ -118,7 +118,7 @@ public class SDKCallable implements Callable {
|
|
|
|
|
ctx.put("tool", tool);
|
|
|
|
|
ctx.put("hasList", javaClassReader.isHasList());
|
|
|
|
|
ctx.put("findOrSearchflag", javaClassReader.getFindOrSearchflag());
|
|
|
|
|
File file = new File(request.getAbsolutePath() + File.separator + api.getReq().getName());
|
|
|
|
|
File file = new File(request.getAbsolutePath(), api.getReq().getName());
|
|
|
|
|
|
|
|
|
|
freeMarkerManager.outputTemp(file, "Java_api/module/request/request.ftl", ctx);
|
|
|
|
|
System.out.println("生成文件" + file.getName() + "成功");
|
|
|
|
@ -148,7 +148,7 @@ public class SDKCallable implements Callable {
|
|
|
|
|
|
|
|
|
|
stringBuffer.append(javaClassReader.getModuleName());
|
|
|
|
|
|
|
|
|
|
File response = new File(stringBuffer.toString() + File.separator + "response");
|
|
|
|
|
File response = new File(stringBuffer.toString(), "response");
|
|
|
|
|
response.mkdirs();
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
@ -163,7 +163,7 @@ public class SDKCallable implements Callable {
|
|
|
|
|
ctx.put("tool", tool);
|
|
|
|
|
ctx.put("hasList", javaClassReader.isHasList());
|
|
|
|
|
ctx.put("Tclass", javaClassReader.getTclass());
|
|
|
|
|
File file = new File(response.getAbsolutePath() + File.separator + api.getRsp().getName().replaceAll("Request", "Response"));
|
|
|
|
|
File file = new File(response.getAbsolutePath(), api.getRsp().getName().replaceAll("Request", "Response"));
|
|
|
|
|
|
|
|
|
|
freeMarkerManager.outputTemp(file, "Java_api/module/response/response.ftl", ctx);
|
|
|
|
|
System.out.println("生成文件" + api.getRsp().getName() + "成功");
|
|
|
|
@ -175,7 +175,7 @@ public class SDKCallable implements Callable {
|
|
|
|
|
|
|
|
|
|
for (String s : api.getDepReq()) {
|
|
|
|
|
try {
|
|
|
|
|
File f = new File(req.getAbsolutePath() + File.separator + s + ".java");
|
|
|
|
|
File f = new File(req.getAbsolutePath(), s + ".java");
|
|
|
|
|
if (!f.exists()) {
|
|
|
|
|
System.err.println("文件" + f.getAbsolutePath() + "不存在");
|
|
|
|
|
continue;
|
|
|
|
@ -213,7 +213,7 @@ public class SDKCallable implements Callable {
|
|
|
|
|
|
|
|
|
|
stringBuffer.append(javaClassReader.getModuleName());
|
|
|
|
|
|
|
|
|
|
File request = new File(stringBuffer.toString() + File.separator + "request");
|
|
|
|
|
File request = new File(stringBuffer.toString(), "request");
|
|
|
|
|
request.mkdirs();
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
@ -228,7 +228,7 @@ public class SDKCallable implements Callable {
|
|
|
|
|
ctx.put("tool", tool);
|
|
|
|
|
ctx.put("hasList", javaClassReader.isHasList());
|
|
|
|
|
ctx.put("findOrSearchflag", javaClassReader.getFindOrSearchflag());
|
|
|
|
|
File file = new File(request.getAbsolutePath() + File.separator + f.getName());
|
|
|
|
|
File file = new File(request.getAbsolutePath(), f.getName());
|
|
|
|
|
|
|
|
|
|
freeMarkerManager.outputTemp(file, "Java_api/module/request/request.ftl", ctx);
|
|
|
|
|
System.out.println("生成文件" + file.getName() + "成功");
|
|
|
|
@ -239,8 +239,8 @@ public class SDKCallable implements Callable {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
File f = new File(rsp.getAbsolutePath() + File.separator + s.replaceAll("Request", "Response.java"));
|
|
|
|
|
if (!f.exists()){
|
|
|
|
|
File f = new File(rsp.getAbsolutePath(), s.replaceAll("Request", "Response.java"));
|
|
|
|
|
if (!f.exists()) {
|
|
|
|
|
System.err.println("文件" + f.getAbsolutePath() + "不存在");
|
|
|
|
|
}
|
|
|
|
|
JavaClassReader javaClassReader = new JavaClassReader(f);
|
|
|
|
@ -260,7 +260,7 @@ public class SDKCallable implements Callable {
|
|
|
|
|
|
|
|
|
|
stringBuffer.append(javaClassReader.getModuleName());
|
|
|
|
|
|
|
|
|
|
File response = new File(stringBuffer.toString() + File.separator + "response");
|
|
|
|
|
File response = new File(stringBuffer.toString(), "response");
|
|
|
|
|
response.mkdirs();
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
@ -275,7 +275,7 @@ public class SDKCallable implements Callable {
|
|
|
|
|
ctx.put("tool", tool);
|
|
|
|
|
ctx.put("hasList", javaClassReader.isHasList());
|
|
|
|
|
ctx.put("Tclass", javaClassReader.getTclass());
|
|
|
|
|
File file = new File(response.getAbsolutePath() + File.separator + f.getName());
|
|
|
|
|
File file = new File(response.getAbsolutePath(), f.getName());
|
|
|
|
|
|
|
|
|
|
freeMarkerManager.outputTemp(file, "Java_api/module/response/response.ftl", ctx);
|
|
|
|
|
System.out.println("生成文件" + api.getRsp().getName() + "成功");
|
|
|
|
@ -289,7 +289,7 @@ public class SDKCallable implements Callable {
|
|
|
|
|
for (String s : api.getDepEnt()) {
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
File f = new File(ent.getAbsolutePath() + File.separator + s + ".java");
|
|
|
|
|
File f = new File(ent.getAbsolutePath(), s + ".java");
|
|
|
|
|
if (!f.exists()) {
|
|
|
|
|
System.out.println("文件" + f.getAbsolutePath() + "不存在");
|
|
|
|
|
continue;
|
|
|
|
@ -311,7 +311,7 @@ public class SDKCallable implements Callable {
|
|
|
|
|
|
|
|
|
|
stringBuffer.append(javaClassReader.getModuleName());
|
|
|
|
|
|
|
|
|
|
File entity = new File(stringBuffer.toString() + File.separator + "entity");
|
|
|
|
|
File entity = new File(stringBuffer.toString(), "entity");
|
|
|
|
|
entity.mkdirs();
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
@ -324,7 +324,7 @@ public class SDKCallable implements Callable {
|
|
|
|
|
ctx.put("className", javaClassReader.getClassName().replaceAll("Entity", ""));
|
|
|
|
|
ctx.put("body", javaClassReader.getBody());
|
|
|
|
|
ctx.put("tool", tool);
|
|
|
|
|
File file = new File(entity.getAbsolutePath() + File.separator + f.getName());
|
|
|
|
|
File file = new File(entity.getAbsolutePath(), f.getName());
|
|
|
|
|
freeMarkerManager.outputTemp(file, "Java_api/module/entity/entity.ftl", ctx);
|
|
|
|
|
System.out.println("生成文件" + file.getName() + "成功");
|
|
|
|
|
}
|
|
|
|
@ -336,7 +336,7 @@ public class SDKCallable implements Callable {
|
|
|
|
|
|
|
|
|
|
for (String s : api.getDepEnum()) {
|
|
|
|
|
try {
|
|
|
|
|
File f = new File(enums.getAbsolutePath() + File.separator + s + ".java");
|
|
|
|
|
File f = new File(enums, s + ".java");
|
|
|
|
|
if (!f.exists()) {
|
|
|
|
|
System.err.println("文件" + f.getAbsolutePath() + "不存在");
|
|
|
|
|
continue;
|
|
|
|
@ -358,7 +358,7 @@ public class SDKCallable implements Callable {
|
|
|
|
|
|
|
|
|
|
stringBuffer.append(javaEnumReader.getModuleName());
|
|
|
|
|
|
|
|
|
|
File enums_ = new File(stringBuffer.toString() + File.separator + "enums");
|
|
|
|
|
File enums_ = new File(stringBuffer.toString(), "enums");
|
|
|
|
|
enums_.mkdirs();
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
@ -371,7 +371,7 @@ public class SDKCallable implements Callable {
|
|
|
|
|
ctx.put("body", javaEnumReader.getBody());
|
|
|
|
|
ctx.put("tool", tool);
|
|
|
|
|
|
|
|
|
|
File file = new File(enums_.getAbsolutePath() + File.separator + f.getName());
|
|
|
|
|
File file = new File(enums_, f.getName());
|
|
|
|
|
freeMarkerManager.outputTemp(file, "Java_api/module/enums/type.ftl", ctx);
|
|
|
|
|
System.out.println("生成文件" + file.getName() + "成功");
|
|
|
|
|
}
|
|
|
|
@ -607,90 +607,90 @@ public class SDKCallable implements Callable {
|
|
|
|
|
ctx.put("domain", domain);
|
|
|
|
|
ctx.put("module", module);
|
|
|
|
|
{
|
|
|
|
|
File file = new File(frameWork.getAbsolutePath() + File.separator + "ApiEntity.java");
|
|
|
|
|
File file = new File(frameWork, "ApiEntity.java");
|
|
|
|
|
freeMarkerManager.outputTemp(file, "/Java_api/ApiEntity.ftl", ctx);
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
File file = new File(frameWork.getAbsolutePath() + File.separator + "AESUtil.java");
|
|
|
|
|
File file = new File(frameWork, "AESUtil.java");
|
|
|
|
|
freeMarkerManager.outputTemp(file, "/Java_api/AESUtil.ftl", ctx);
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
File file = new File(frameWork.getAbsolutePath() + File.separator + "ApiClient.java");
|
|
|
|
|
File file = new File(frameWork, "ApiClient.java");
|
|
|
|
|
freeMarkerManager.outputTemp(file, "/Java_api/ApiClient.ftl", ctx);
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
File file = new File(frameWork.getAbsolutePath() + File.separator + "ApiRequest.java");
|
|
|
|
|
File file = new File(frameWork, "ApiRequest.java");
|
|
|
|
|
freeMarkerManager.outputTemp(file, "/Java_api/ApiRequest.ftl", ctx);
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
File file = new File(frameWork.getAbsolutePath() + File.separator + "ApiFindRequest.java");
|
|
|
|
|
File file = new File(frameWork, "ApiFindRequest.java");
|
|
|
|
|
freeMarkerManager.outputTemp(file, "/Java_api/ApiFindRequest.ftl", ctx);
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
File file = new File(frameWork.getAbsolutePath() + File.separator + "ApiSearchRequest.java");
|
|
|
|
|
File file = new File(frameWork, "ApiSearchRequest.java");
|
|
|
|
|
freeMarkerManager.outputTemp(file, "/Java_api/ApiSearchRequest.ftl", ctx);
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
File file = new File(frameWork.getAbsolutePath() + File.separator + "ApiResponse.java");
|
|
|
|
|
File file = new File(frameWork, "ApiResponse.java");
|
|
|
|
|
freeMarkerManager.outputTemp(file, "/Java_api/ApiResponse.ftl", ctx);
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
File file = new File(frameWork.getAbsolutePath() + File.separator + "ApiFindResponse.java");
|
|
|
|
|
File file = new File(frameWork, "ApiFindResponse.java");
|
|
|
|
|
freeMarkerManager.outputTemp(file, "/Java_api/ApiFindResponse.ftl", ctx);
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
File file = new File(frameWork.getAbsolutePath() + File.separator + "Base64Util.java");
|
|
|
|
|
File file = new File(frameWork, "Base64Util.java");
|
|
|
|
|
freeMarkerManager.outputTemp(file, "/Java_api/Base64Util.ftl", ctx);
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
File file = new File(frameWork.getAbsolutePath() + File.separator + "DownloadUtil.java");
|
|
|
|
|
File file = new File(frameWork, "DownloadUtil.java");
|
|
|
|
|
freeMarkerManager.outputTemp(file, "/Java_api/DownloadUtil.ftl", ctx);
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
File file = new File(frameWork.getAbsolutePath() + File.separator + "Error.java");
|
|
|
|
|
File file = new File(frameWork, "Error.java");
|
|
|
|
|
freeMarkerManager.outputTemp(file, "/Java_api/Error.ftl", ctx);
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
File file = new File(frameWork.getAbsolutePath() + File.separator + "ErrorType.java");
|
|
|
|
|
File file = new File(frameWork, "ErrorType.java");
|
|
|
|
|
freeMarkerManager.outputTemp(file, "/Java_api/ErrorType.ftl", ctx);
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
File file = new File(frameWork.getAbsolutePath() + File.separator + "FileUploadRequest.java");
|
|
|
|
|
File file = new File(frameWork, "FileUploadRequest.java");
|
|
|
|
|
freeMarkerManager.outputTemp(file, "/Java_api/FileUploadRequest.ftl", ctx);
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
File file = new File(frameWork.getAbsolutePath() + File.separator + "FileUploadResponse.java");
|
|
|
|
|
File file = new File(frameWork, "FileUploadResponse.java");
|
|
|
|
|
freeMarkerManager.outputTemp(file, "/Java_api/FileUploadResponse.ftl", ctx);
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
File file = new File(frameWork.getAbsolutePath() + File.separator + "MapperUtil.java");
|
|
|
|
|
File file = new File(frameWork, "MapperUtil.java");
|
|
|
|
|
freeMarkerManager.outputTemp(file, "/Java_api/MapperUtil.ftl", ctx);
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
File file = new File(frameWork.getAbsolutePath() + File.separator + "MD5Util.java");
|
|
|
|
|
File file = new File(frameWork, "MD5Util.java");
|
|
|
|
|
freeMarkerManager.outputTemp(file, "/Java_api/MD5Util.ftl", ctx);
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
File file = new File(frameWork.getAbsolutePath() + File.separator + "RSAUtil.java");
|
|
|
|
|
File file = new File(frameWork, "RSAUtil.java");
|
|
|
|
|
freeMarkerManager.outputTemp(file, "/Java_api/RSAUtil.ftl", ctx);
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
File file = new File(frameWork.getAbsolutePath() + File.separator + "ProgressRequestBody.java");
|
|
|
|
|
File file = new File(frameWork, "ProgressRequestBody.java");
|
|
|
|
|
freeMarkerManager.outputTemp(file, "/Java_api/ProgressRequestBody.ftl", ctx);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
File file = new File(frameWork.getAbsolutePath() + File.separator + "SortType.java");
|
|
|
|
|
File file = new File(frameWork, "SortType.java");
|
|
|
|
|
freeMarkerManager.outputTemp(file, "/Java_api/SortType.ftl", ctx);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
File file = new File(frameWork.getAbsolutePath() + File.separator + "StringUtils.java");
|
|
|
|
|
File file = new File(frameWork, "StringUtils.java");
|
|
|
|
|
freeMarkerManager.outputTemp(file, "/Java_api/StringUtils.ftl", ctx);
|
|
|
|
|
}
|
|
|
|
|
//4.0.1 去掉验证 减少体积
|
|
|
|
|
// {
|
|
|
|
|
// File file = new File(frameWork.getAbsolutePath() + File.separator + "ValidationUtil.java");
|
|
|
|
|
// File file = new File(frameWork , "ValidationUtil.java");
|
|
|
|
|
// freeMarkerManager.outputTemp(file, "/Java_api/ValidationUtil.ftl", ctx);
|
|
|
|
|
// }
|
|
|
|
|
System.out.println("finish");
|
|
|
|
|