Skip to content

Commit

Permalink
Merge pull request #757 from shalousun/master
Browse files Browse the repository at this point in the history
update: translate chinese comments to english
  • Loading branch information
shalousun authored Mar 10, 2024
2 parents 9bcb98a + 202926f commit a7b10a8
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 34 deletions.
13 changes: 7 additions & 6 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ labels: bug
assignees: ''
---

## Your Environment(您的使用环境)
## Your Environment(您的使用环境,您期望的结果,社区已开启国际化推广,请文心一言、讯飞星火等辅助翻译成英文,减少社区开发者的工作)

<!--- Include as many relevant details about the environment you experienced the bug in -->

Expand All @@ -15,22 +15,23 @@ assignees: ''
* build tool version(maven or gradle):
* jdk version:

## Expected Behavior(您期望的结果)
## Expected Behavior(您期望的结果,社区已开启国际化推广,请用文心一言、讯飞星火等辅助翻译成英文,减少社区开发者的工作)

<!--- If you're describing a bug, tell us what should happen -->
<!--- If you're suggesting a change/improvement, tell us how it should work -->

## Current Behavior(当前结果)

## Current Behavior(当前结果,社区已开启国际化推广,请用文心一言、讯飞星火等辅助翻译成英文,减少社区开发者的工作)

<!--- If describing a bug, tell us what happens instead of the expected behavior -->
<!--- If suggesting a change/improvement, explain the difference from current behavior -->

## Possible Solution(bug解决建议)
## Possible Solution(bug解决建议,社区已开启国际化推广,请用文心一言、讯飞星火等辅助翻译成英文,减少社区开发者的工作)

<!--- Not obligatory, but suggest a fix/reason for the bug, -->
<!--- or ideas how to implement the addition or change -->

## Steps to Reproduce (Bug产生步骤,请尽量提供用例代码)
## Steps to Reproduce (Bug产生步骤,请尽量提供用例代码。社区已开启国际化推广,请用文心一言、讯飞星火等辅助翻译成英文,减少社区开发者的工作)

<!--- Provide a link to a live example, or an unambiguous set of steps to -->
<!--- reproduce this bug. Include code to reproduce, if relevant -->
Expand All @@ -40,7 +41,7 @@ assignees: ''
3.
4.

## Context(Bug影响描述)
## Context(Bug影响描述,社区已开启国际化推广,请用文心一言、讯飞星火等辅助翻译成英文,减少社区开发者的工作)

<!--- How has this issue affected you? What are you trying to accomplish? -->
<!--- Providing context helps us come up with a solution that is most useful in the real world -->
Expand Down
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ public Map<String, Object> buildPathUrlsRequest(ApiConfig apiConfig, ApiMethodDo
}

/**
* 是否有文件
* Check if the parameter contains a file
*
* @param parameters
* @return
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/com/ly/doc/model/torna/TornaApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class TornaApi {
/**
* "debugEnvs": [
* {
* "name": "测试环境",
* "name": "Test environment",
* "url": "http://10.1.30.165:2222"
* }
* ],
Expand All @@ -40,8 +40,9 @@ public class TornaApi {
List<Apis> apis;
String author;
List<CommonErrorCode> commonErrorCodes;

/**
* 是否替换文档,1:替换,0:不替换(追加)。缺省:1
* Whether to replace the document. 1: Replace, 0: Do not replace (append). Default: 1
*/
Integer isReplace;

Expand Down
14 changes: 6 additions & 8 deletions src/test/java/com/ly/doc/ApiDocTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@

/**
* Description:
* ApiDoc测试
* ApiDoc Test
*
* @author yu 2018/06/11.
*/
public class ApiDocTest {

/**
* 包括设置请求头,缺失注释的字段批量在文档生成期使用定义好的注释
*
* test html
*/
@Deprecated
Expand All @@ -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);
Expand All @@ -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.*");
Expand Down Expand Up @@ -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);
Expand All @@ -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.*");
Expand Down
27 changes: 14 additions & 13 deletions src/test/java/com/ly/doc/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,22 @@ public class Main {

public static void main(String[] args) {
Long start = System.currentTimeMillis();
//结果集
// Result list
List<String> list = new ArrayList<>();
List<String> list2 = new ArrayList<>();
//定长10线程池
// Fixed size 10 thread pool
ExecutorService exs = Executors.newFixedThreadPool(10);
final List<Integer> 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 {
Expand All @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/com/ly/doc/qbox/QboxScanSourceTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit a7b10a8

Please sign in to comment.