diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index d3567357..a1a7e7c5 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -6,7 +6,7 @@ labels: bug assignees: '' --- -## Your Environment(您的使用环境) +## Your Environment(您的使用环境,您期望的结果,社区已开启国际化推广,请文心一言、讯飞星火等辅助翻译成英文,减少社区开发者的工作) @@ -15,22 +15,23 @@ assignees: '' * build tool version(maven or gradle): * jdk version: -## Expected Behavior(您期望的结果) +## Expected Behavior(您期望的结果,社区已开启国际化推广,请用文心一言、讯飞星火等辅助翻译成英文,减少社区开发者的工作) -## Current Behavior(当前结果) + +## Current Behavior(当前结果,社区已开启国际化推广,请用文心一言、讯飞星火等辅助翻译成英文,减少社区开发者的工作) -## Possible Solution(bug解决建议) +## Possible Solution(bug解决建议,社区已开启国际化推广,请用文心一言、讯飞星火等辅助翻译成英文,减少社区开发者的工作) -## Steps to Reproduce (Bug产生步骤,请尽量提供用例代码) +## Steps to Reproduce (Bug产生步骤,请尽量提供用例代码。社区已开启国际化推广,请用文心一言、讯飞星火等辅助翻译成英文,减少社区开发者的工作) @@ -40,7 +41,7 @@ assignees: '' 3. 4. -## Context(Bug影响描述) +## Context(Bug影响描述,社区已开启国际化推广,请用文心一言、讯飞星火等辅助翻译成英文,减少社区开发者的工作) diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index 0ffb4ee2..212f5d7d 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -4,14 +4,14 @@ about: Suggest a new idea for the project. labels: enhancement --- -## Summary(关于这个pr的描述) +## Summary(关于这个pr的描述,社区已开启国际化推广,请文心一言、讯飞星火等辅助翻译成英文,减少社区开发者的工作) Brief explanation of the feature. -### Basic example(pr的用例) +### Basic example(pr的用例,社区已开启国际化推广,请文心一言、讯飞星火等辅助翻译成英文,减少社区开发者的工作) If the proposal involves a new or changed API, include a basic code example. Omit this section if it's not applicable. -### Motivation(提出这个pr目的) +### Motivation(提出这个pr目的,社区已开启国际化推广,请文心一言、讯飞星火等辅助翻译成英文,减少社区开发者的工作) Why are we doing this? What use cases does it support? What is the expected outcome? \ No newline at end of file diff --git a/src/main/java/com/ly/doc/builder/openapi/SwaggerBuilder.java b/src/main/java/com/ly/doc/builder/openapi/SwaggerBuilder.java index 530c3e48..affb8a17 100644 --- a/src/main/java/com/ly/doc/builder/openapi/SwaggerBuilder.java +++ b/src/main/java/com/ly/doc/builder/openapi/SwaggerBuilder.java @@ -163,7 +163,7 @@ public Map buildPathUrlsRequest(ApiConfig apiConfig, ApiMethodDo } /** - * 是否有文件 + * Check if the parameter contains a file * * @param parameters * @return diff --git a/src/main/java/com/ly/doc/model/torna/TornaApi.java b/src/main/java/com/ly/doc/model/torna/TornaApi.java index a6f4e9bf..769ef23d 100644 --- a/src/main/java/com/ly/doc/model/torna/TornaApi.java +++ b/src/main/java/com/ly/doc/model/torna/TornaApi.java @@ -30,7 +30,7 @@ public class TornaApi { /** * "debugEnvs": [ * { - * "name": "测试环境", + * "name": "Test environment", * "url": "http://10.1.30.165:2222" * } * ], @@ -40,8 +40,9 @@ public class TornaApi { List apis; String author; List commonErrorCodes; + /** - * 是否替换文档,1:替换,0:不替换(追加)。缺省:1 + * Whether to replace the document. 1: Replace, 0: Do not replace (append). Default: 1 */ Integer isReplace; diff --git a/src/test/java/com/ly/doc/ApiDocTest.java b/src/test/java/com/ly/doc/ApiDocTest.java index b439b314..1fa5fb52 100644 --- a/src/test/java/com/ly/doc/ApiDocTest.java +++ b/src/test/java/com/ly/doc/ApiDocTest.java @@ -12,14 +12,14 @@ /** * Description: - * ApiDoc测试 + * ApiDoc Test * * @author yu 2018/06/11. */ public class ApiDocTest { /** - * 包括设置请求头,缺失注释的字段批量在文档生成期使用定义好的注释 + * * test html */ @Deprecated @@ -34,7 +34,7 @@ public void testBuilderControllersApi() { config.setAppToken("be4211613a734b45888c075741680e49"); // config.setAppToken("7b0935531d1144e58a86d7b4f2ad23c6"); - config.setDebugEnvName("测试环境"); + config.setDebugEnvName("Test environment"); config.setInlineEnum(true); config.setStyle("randomLight"); config.setCreateDebugPage(false); @@ -46,9 +46,8 @@ public void testBuilderControllersApi() { config.setOutPath("D:\\smart-doc\\docs\\html"); // config.setMd5EncryptedHtmlName(true); config.setFramework(FrameworkEnum.SPRING.getFramework()); - // 不指定SourcePaths默认加载代码为项目src/main/java下的 config.setSourceCodePaths( - SourceCodePath.builder().setDesc("本项目代码") + SourceCodePath.builder().setDesc("current project code") .setPath("D:\\smart-doc\\test-project") ); config.setPackageFilters("com.power.doc.controller.*"); @@ -83,7 +82,7 @@ public void testJmxBuilderControllersApi() { config.setOpenUrl("http://localhost:7700/api"); config.setAppToken("be4211613a734b45888c075741680e49"); - config.setDebugEnvName("测试环境"); + config.setDebugEnvName("Test environment"); config.setLanguage(DocLanguage.CHINESE); // config.setLanguage(DocLanguage.ENGLISH); config.setInlineEnum(true); @@ -93,9 +92,8 @@ public void testJmxBuilderControllersApi() { config.setCoverOld(false); config.setOutPath("D:\\smart-doc\\docs\\jmx1"); config.setFramework(FrameworkEnum.SPRING.getFramework()); - // 不指定SourcePaths默认加载代码为项目src/main/java下的 config.setSourceCodePaths( - SourceCodePath.builder().setDesc("本项目代码") + SourceCodePath.builder().setDesc("current project code") .setPath("D:\\smart-doc\\test-project") ); config.setPackageFilters("com.power.doc.controller.*"); diff --git a/src/test/java/com/ly/doc/Main.java b/src/test/java/com/ly/doc/Main.java index fcbc5292..ae58bce2 100644 --- a/src/test/java/com/ly/doc/Main.java +++ b/src/test/java/com/ly/doc/Main.java @@ -31,22 +31,22 @@ public class Main { public static void main(String[] args) { Long start = System.currentTimeMillis(); - //结果集 + // Result list List list = new ArrayList<>(); List list2 = new ArrayList<>(); - //定长10线程池 + // Fixed size 10 thread pool ExecutorService exs = Executors.newFixedThreadPool(10); final List taskList = Arrays.asList(2, 1, 3, 4, 5, 6, 7, 8, 9, 10); try { CompletableFuture[] cfs = taskList.stream().map(object -> CompletableFuture.supplyAsync(() -> calc(object), exs) - .thenApply(h -> Integer.toString(h)) - //如需获取任务完成先后顺序,此处代码即可 - .whenComplete((v, e) -> { - System.out.println("任务" + v + "完成!result=" + v + ",异常 e=" + e + "," + new Date()); - list2.add(v); - })).toArray(CompletableFuture[]::new); + .thenApply(h -> Integer.toString(h)) + // If you need to get the order of task completion, this code is available + .whenComplete((v, e) -> { + System.out.println("Task " + v + " completed! result=" + v + ",exception e=" + e + "," + new Date()); + list2.add(v); + })).toArray(CompletableFuture[]::new); CompletableFuture.allOf(cfs).join(); - System.out.println("任务完成先后顺序,结果list2=" + list2 + ";任务提交顺序,结果list=" + list + ",耗时=" + (System.currentTimeMillis() - start)); + System.out.println("The order of task completion, result list2=" + list2 + ";The order of task submission, result list=" + list + ", time taken=" + (System.currentTimeMillis() - start)); } catch (Exception e) { e.printStackTrace(); } finally { @@ -57,22 +57,23 @@ public static void main(String[] args) { public static Integer calc(Integer i) { try { if (i == 1) { - //任务1耗时3秒 + // Task 1 takes 3 seconds Thread.sleep(3000); } else if (i == 5) { - //任务5耗时5秒 + // Task 5 takes 5 seconds Thread.sleep(5000); } else { - //其它任务耗时1秒 + // Other tasks take 1 second Thread.sleep(1000); } - System.out.println("task线程:" + Thread.currentThread().getName() + "任务i=" + i + ",完成!+" + new Date()); + System.out.println("task thread:" + Thread.currentThread().getName() + " task i=" + i + ", completed!+" + new Date()); } catch (InterruptedException e) { e.printStackTrace(); } return i; } + public static boolean ignoreArtifactById(String artifactId) { if (PREFIX_LIST.stream().anyMatch(artifactId::startsWith)) { return true; diff --git a/src/test/java/com/ly/doc/qbox/QboxScanSourceTest.java b/src/test/java/com/ly/doc/qbox/QboxScanSourceTest.java index 0efac568..47c13316 100644 --- a/src/test/java/com/ly/doc/qbox/QboxScanSourceTest.java +++ b/src/test/java/com/ly/doc/qbox/QboxScanSourceTest.java @@ -28,7 +28,7 @@ public void scanError() { ApiConfig config = new ApiConfig(); config.setServerUrl("HSF://127.0.0.1:8088"); config.setOpenUrl("http://demo.torna.cn/api"); - config.setDebugEnvName("测试环境"); + config.setDebugEnvName("Test environment"); config.setStyle("randomLight"); config.setCreateDebugPage(true); config.setAuthor("test");