|
|
@ -147,74 +147,52 @@ public class OptionDocController {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// File ajaxPath = Tool.createPath(actionPath.get(0), "ajax");
|
|
|
|
File ajaxPath = Tool.createPath(actionPath.get(0), "ajax");
|
|
|
|
// for (File file : ajaxPath.listFiles()) {
|
|
|
|
for (File file : ajaxPath.listFiles()) {
|
|
|
|
// String module = file.getName();
|
|
|
|
String module = file.getName();
|
|
|
|
// for (File tar : file.listFiles()) {
|
|
|
|
for (File tar : file.listFiles()) {
|
|
|
|
// try {
|
|
|
|
try {
|
|
|
|
// String target = tar.getName().replaceAll("Ajax$", "").replaceAll(".java", "");
|
|
|
|
String target = tar.getName().replaceAll("Ajax$", "").replaceAll(".java", "");
|
|
|
|
// DocClassReader docClassReader = new DocClassReader(tar);
|
|
|
|
DocClassReader docClassReader = new DocClassReader(tar);
|
|
|
|
//
|
|
|
|
|
|
|
|
// for (ApiMethod apiMethod : docClassReader.getMethodList()) {
|
|
|
|
for (ApiMethod apiMethod : docClassReader.getMethodList()) {
|
|
|
|
// Doc doc = new Doc();
|
|
|
|
Doc doc = new Doc();
|
|
|
|
// doc.setType("ajax");
|
|
|
|
doc.setType("ajax");
|
|
|
|
// doc.setModule(module);
|
|
|
|
doc.setModule(module);
|
|
|
|
// doc.setTarget(target);
|
|
|
|
doc.setTarget(target);
|
|
|
|
// doc.setRequest(apiMethod.getRequest());
|
|
|
|
doc.setRequest(apiMethod.getRequest());
|
|
|
|
// doc.setResponse(apiMethod.getResponse());
|
|
|
|
doc.setResponse(apiMethod.getResponse());
|
|
|
|
// doc.setMethod(apiMethod.getMethod());
|
|
|
|
doc.setMethod(apiMethod.getMethod());
|
|
|
|
//
|
|
|
|
|
|
|
|
// List<File> reqFiles = Tool.findRequest(moduleFile, apiMethod.getRequest() + ".java");
|
|
|
|
List<File> reqFiles = Tool.findRequest(moduleFile, apiMethod.getRequest() + ".java");
|
|
|
|
// if (reqFiles.size() == 0) {
|
|
|
|
if (reqFiles.size() == 0) {
|
|
|
|
// doc.setError(doc.getError() + "未找到请求");
|
|
|
|
doc.setError(doc.getError() + "未找到请求");
|
|
|
|
// } else if (reqFiles.size() > 1) {
|
|
|
|
} else if (reqFiles.size() > 1) {
|
|
|
|
// doc.setError(doc.getError() + "找到多个请求");
|
|
|
|
doc.setError(doc.getError() + "找到多个请求");
|
|
|
|
// } else {
|
|
|
|
} else {
|
|
|
|
// DocRequestReader docRequestReader = new DocRequestReader("ajax", reqFiles.get(0));
|
|
|
|
DocRequestReader docRequestReader = new DocRequestReader(reqFiles.get(0));
|
|
|
|
//
|
|
|
|
doc.setTitle(docRequestReader.getClassNote());
|
|
|
|
// //查找依赖ent
|
|
|
|
doc.setReqParams(docRequestReader.getFieldDocList());
|
|
|
|
// List<String> entities = findEntities(reqFiles.get(0));
|
|
|
|
}
|
|
|
|
// for (String entity : entities) {
|
|
|
|
|
|
|
|
// System.out.println();
|
|
|
|
List<File> rspfiles = Tool.findResponse(moduleFile, apiMethod.getResponse() + ".java");
|
|
|
|
//// doc.getDepEnt().add(entity);
|
|
|
|
if (rspfiles.size() == 0) {
|
|
|
|
// }
|
|
|
|
doc.setError(doc.getError() + "未找到响应");
|
|
|
|
//
|
|
|
|
} else if (rspfiles.size() > 1) {
|
|
|
|
// //查找依赖req
|
|
|
|
doc.setError(doc.getError() + "找到多个响应");
|
|
|
|
// List<String> reqss = findEntities(reqFiles.get(0));
|
|
|
|
} else {
|
|
|
|
// for (String string : reqss) {
|
|
|
|
DocResponseReader docResponseReader = new DocResponseReader(rspfiles.get(0));
|
|
|
|
//// doc.getDepReq().add(string);
|
|
|
|
doc.setRspParams(docResponseReader.getFieldDocList());
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
|
|
|
|
//
|
|
|
|
doc.setCheck(true);
|
|
|
|
// List<File> rspfiles = Tool.findResponse(moduleFile, apiMethod.getResponse() + ".java");
|
|
|
|
data.add(doc);
|
|
|
|
// if (rspfiles.size() == 0) {
|
|
|
|
}
|
|
|
|
// doc.setError(doc.getError() + "未找到响应");
|
|
|
|
} catch (IOException e) {
|
|
|
|
// } else if (rspfiles.size() > 1) {
|
|
|
|
e.printStackTrace();
|
|
|
|
// doc.setError(doc.getError() + "找到多个响应");
|
|
|
|
}
|
|
|
|
// } else {
|
|
|
|
}
|
|
|
|
// DocRequestReader docRequestReader = new DocRequestReader("ajax", reqFiles.get(0));
|
|
|
|
}
|
|
|
|
//
|
|
|
|
|
|
|
|
// //查找依赖ent
|
|
|
|
|
|
|
|
// List<String> entities = findEntities(rspfiles.get(0));
|
|
|
|
|
|
|
|
// for (String entity : entities) {
|
|
|
|
|
|
|
|
// System.out.println();
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// //查找依赖req
|
|
|
|
|
|
|
|
// List<String> reqss = findEntities(rspfiles.get(0));
|
|
|
|
|
|
|
|
// for (String string : reqss) {
|
|
|
|
|
|
|
|
// System.out.println("");
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// doc.setCheck(true);
|
|
|
|
|
|
|
|
// data.add(doc);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// } catch (IOException e) {
|
|
|
|
|
|
|
|
// e.printStackTrace();
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
File apiPath = Tool.createPath(actionPath.get(0), "api");
|
|
|
|
File apiPath = Tool.createPath(actionPath.get(0), "api");
|
|
|
|
for (File file : apiPath.listFiles()) {
|
|
|
|
for (File file : apiPath.listFiles()) {
|
|
|
|