Skip to content

Commit 28ee063

Browse files
authored
Merge pull request #18 from linwumingshi/feature/websocket-markdown
feat: ✨ add websocket-markdown support;update license validi…
2 parents 14be0bb + ae03e36 commit 28ee063

31 files changed

+103
-43
lines changed

src/main/java/com/ly/doc/gradle/chain/CommonArtifactFilterChain.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* smart-doc
33
*
4-
* Copyright (C) 2018-2023 smart-doc
4+
* Copyright (C) 2018-2024 smart-doc
55
*
66
* Licensed to the Apache Software Foundation (ASF) under one
77
* or more contributor license agreements. See the NOTICE file

src/main/java/com/ly/doc/gradle/chain/ContainsFilterChain.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* smart-doc
33
*
4-
* Copyright (C) 2018-2023 smart-doc
4+
* Copyright (C) 2018-2024 smart-doc
55
*
66
* Licensed to the Apache Software Foundation (ASF) under one
77
* or more contributor license agreements. See the NOTICE file

src/main/java/com/ly/doc/gradle/chain/FilterChain.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* smart-doc
33
*
4-
* Copyright (C) 2018-2023 smart-doc
4+
* Copyright (C) 2018-2024 smart-doc
55
*
66
* Licensed to the Apache Software Foundation (ASF) under one
77
* or more contributor license agreements. See the NOTICE file

src/main/java/com/ly/doc/gradle/chain/GroupIdFilterChain.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* smart-doc
33
*
4-
* Copyright (C) 2018-2023 smart-doc
4+
* Copyright (C) 2018-2024 smart-doc
55
*
66
* Licensed to the Apache Software Foundation (ASF) under one
77
* or more contributor license agreements. See the NOTICE file

src/main/java/com/ly/doc/gradle/chain/SpringBootArtifactFilterChain.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* smart-doc
33
*
4-
* Copyright (C) 2018-2023 smart-doc
4+
* Copyright (C) 2018-2024 smart-doc
55
*
66
* Licensed to the Apache Software Foundation (ASF) under one
77
* or more contributor license agreements. See the NOTICE file

src/main/java/com/ly/doc/gradle/chain/StartsWithFilterChain.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* smart-doc
33
*
4-
* Copyright (C) 2018-2023 smart-doc
4+
* Copyright (C) 2018-2024 smart-doc
55
*
66
* Licensed to the Apache Software Foundation (ASF) under one
77
* or more contributor license agreements. See the NOTICE file

src/main/java/com/ly/doc/gradle/constant/GlobalConstants.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* smart-doc
33
*
4-
* Copyright (C) 2018-2023 smart-doc
4+
* Copyright (C) 2018-2024 smart-doc
55
*
66
* Licensed to the Apache Software Foundation (ASF) under one
77
* or more contributor license agreements. See the NOTICE file
@@ -104,8 +104,12 @@ public interface GlobalConstants {
104104
/**
105105
* Generate Swagger document
106106
*/
107-
String Swagger_TASK = "swagger";
107+
String SWAGGER_TASK = "swagger";
108108

109+
/**
110+
* Generate WebSocket markdown document
111+
*/
112+
String WEBSOCKET_MARKDOWN = "webSocketMarkdown";
109113

110114
/**
111115
* Plugin extension name

src/main/java/com/ly/doc/gradle/constant/TaskConstants.java

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* smart-doc
33
*
4-
* Copyright (C) 2018-2023 smart-doc
4+
* Copyright (C) 2018-2024 smart-doc
55
*
66
* Licensed to the Apache Software Foundation (ASF) under one
77
* or more contributor license agreements. See the NOTICE file
@@ -35,10 +35,10 @@ public class TaskConstants {
3535
/**
3636
* Map of Gradle Task
3737
*/
38-
public static Map<String, Class> taskMap = new HashMap<>();
38+
public static Map<String, Class<?>> taskMap = new HashMap<>();
3939

4040
static {
41-
//create html
41+
// create html
4242
taskMap.put(GlobalConstants.REST_HTML_TASK, RestHtmlTask.class);
4343
// create adoc
4444
taskMap.put(GlobalConstants.REST_ADOC_TASK, RestAdocTask.class);
@@ -50,19 +50,21 @@ public class TaskConstants {
5050
taskMap.put(GlobalConstants.POSTMAN_TASK, PostmanTask.class);
5151
// create open api
5252
taskMap.put(GlobalConstants.OPEN_API_TASK, OpenApiTask.class);
53-
//create rpc html
53+
// create rpc html
5454
taskMap.put(GlobalConstants.RPC_HTML_TASK, RpcHtmlTask.class);
5555
// create rpc adoc
5656
taskMap.put(GlobalConstants.RPC_ADOC_TASK, RpcAdocTask.class);
57-
// create rpc markdown
57+
// create rpc Markdown
5858
taskMap.put(GlobalConstants.RPC_MARKDOWN_TASK, RpcMarkdownTask.class);
5959
// create torna rest
60-
taskMap.put(GlobalConstants.TORNA_REST_TASK,TornaRestTask.class);
60+
taskMap.put(GlobalConstants.TORNA_REST_TASK, TornaRestTask.class);
6161
// create torna rpc
62-
taskMap.put(GlobalConstants.TORNA_RPC_TASK,TornaRpcTask.class);
62+
taskMap.put(GlobalConstants.TORNA_RPC_TASK, TornaRpcTask.class);
6363
// create word rest
6464
taskMap.put(GlobalConstants.WORD_TASK, WordTask.class);
6565
// create Swagger
66-
taskMap.put(GlobalConstants.Swagger_TASK, SwaggerTask.class);
66+
taskMap.put(GlobalConstants.SWAGGER_TASK, SwaggerTask.class);
67+
// create websocket markdown
68+
taskMap.put(GlobalConstants.WEBSOCKET_MARKDOWN, WebSocketMarkdownTask.class);
6769
}
6870
}

src/main/java/com/ly/doc/gradle/extension/SmartDocPluginExtension.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* smart-doc
33
*
4-
* Copyright (C) 2018-2023 smart-doc
4+
* Copyright (C) 2018-2024 smart-doc
55
*
66
* Licensed to the Apache Software Foundation (ASF) under one
77
* or more contributor license agreements. See the NOTICE file

src/main/java/com/ly/doc/gradle/model/CustomArtifact.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* smart-doc
33
*
4-
* Copyright (C) 2018-2023 smart-doc
4+
* Copyright (C) 2018-2024 smart-doc
55
*
66
* Licensed to the Apache Software Foundation (ASF) under one
77
* or more contributor license agreements. See the NOTICE file

src/main/java/com/ly/doc/gradle/plugin/SmartDocPlugin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* smart-doc
33
*
4-
* Copyright (C) 2018-2023 smart-doc
4+
* Copyright (C) 2018-2024 smart-doc
55
*
66
* Licensed to the Apache Software Foundation (ASF) under one
77
* or more contributor license agreements. See the NOTICE file

src/main/java/com/ly/doc/gradle/task/DocBaseTask.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* smart-doc
33
*
4-
* Copyright (C) 2018-2023 smart-doc
4+
* Copyright (C) 2018-2024 smart-doc
55
*
66
* Licensed to the Apache Software Foundation (ASF) under one
77
* or more contributor license agreements. See the NOTICE file

src/main/java/com/ly/doc/gradle/task/JMeterTask.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* smart-doc
33
*
4-
* Copyright (C) 2018-2023 smart-doc
4+
* Copyright (C) 2018-2024 smart-doc
55
*
66
* Licensed to the Apache Software Foundation (ASF) under one
77
* or more contributor license agreements. See the NOTICE file

src/main/java/com/ly/doc/gradle/task/OpenApiTask.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* smart-doc
33
*
4-
* Copyright (C) 2018-2023 smart-doc
4+
* Copyright (C) 2018-2024 smart-doc
55
*
66
* Licensed to the Apache Software Foundation (ASF) under one
77
* or more contributor license agreements. See the NOTICE file

src/main/java/com/ly/doc/gradle/task/PostmanTask.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* smart-doc
33
*
4-
* Copyright (C) 2018-2023 smart-doc
4+
* Copyright (C) 2018-2024 smart-doc
55
*
66
* Licensed to the Apache Software Foundation (ASF) under one
77
* or more contributor license agreements. See the NOTICE file

src/main/java/com/ly/doc/gradle/task/RestAdocTask.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* smart-doc
33
*
4-
* Copyright (C) 2018-2023 smart-doc
4+
* Copyright (C) 2018-2024 smart-doc
55
*
66
* Licensed to the Apache Software Foundation (ASF) under one
77
* or more contributor license agreements. See the NOTICE file

src/main/java/com/ly/doc/gradle/task/RestHtmlTask.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* smart-doc
33
*
4-
* Copyright (C) 2018-2023 smart-doc
4+
* Copyright (C) 2018-2024 smart-doc
55
*
66
* Licensed to the Apache Software Foundation (ASF) under one
77
* or more contributor license agreements. See the NOTICE file

src/main/java/com/ly/doc/gradle/task/RestMarkdownTask.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* smart-doc
33
*
4-
* Copyright (C) 2018-2023 smart-doc
4+
* Copyright (C) 2018-2024 smart-doc
55
*
66
* Licensed to the Apache Software Foundation (ASF) under one
77
* or more contributor license agreements. See the NOTICE file

src/main/java/com/ly/doc/gradle/task/RpcAdocTask.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* smart-doc
33
*
4-
* Copyright (C) 2018-2023 smart-doc
4+
* Copyright (C) 2018-2024 smart-doc
55
*
66
* Licensed to the Apache Software Foundation (ASF) under one
77
* or more contributor license agreements. See the NOTICE file

src/main/java/com/ly/doc/gradle/task/RpcHtmlTask.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* smart-doc
33
*
4-
* Copyright (C) 2018-2023 smart-doc
4+
* Copyright (C) 2018-2024 smart-doc
55
*
66
* Licensed to the Apache Software Foundation (ASF) under one
77
* or more contributor license agreements. See the NOTICE file

src/main/java/com/ly/doc/gradle/task/RpcMarkdownTask.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* smart-doc
33
*
4-
* Copyright (C) 2018-2023 smart-doc
4+
* Copyright (C) 2018-2024 smart-doc
55
*
66
* Licensed to the Apache Software Foundation (ASF) under one
77
* or more contributor license agreements. See the NOTICE file

src/main/java/com/ly/doc/gradle/task/SwaggerTask.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* smart-doc
33
*
4-
* Copyright (C) 2018-2023 smart-doc
4+
* Copyright (C) 2018-2024 smart-doc
55
*
66
* Licensed to the Apache Software Foundation (ASF) under one
77
* or more contributor license agreements. See the NOTICE file

src/main/java/com/ly/doc/gradle/task/TornaRestTask.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* smart-doc
33
*
4-
* Copyright (C) 2018-2023 smart-doc
4+
* Copyright (C) 2018-2024 smart-doc
55
*
66
* Licensed to the Apache Software Foundation (ASF) under one
77
* or more contributor license agreements. See the NOTICE file

src/main/java/com/ly/doc/gradle/task/TornaRpcTask.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* smart-doc
33
*
4-
* Copyright (C) 2018-2023 smart-doc
4+
* Copyright (C) 2018-2024 smart-doc
55
*
66
* Licensed to the Apache Software Foundation (ASF) under one
77
* or more contributor license agreements. See the NOTICE file
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/*
2+
* smart-doc
3+
*
4+
* Copyright (C) 2018-2024 smart-doc
5+
*
6+
* Licensed to the Apache Software Foundation (ASF) under one
7+
* or more contributor license agreements. See the NOTICE file
8+
* distributed with this work for additional information
9+
* regarding copyright ownership. The ASF licenses this file
10+
* to you under the Apache License, Version 2.0 (the
11+
* "License"); you may not use this file except in compliance
12+
* with the License. You may obtain a copy of the License at
13+
*
14+
* http://www.apache.org/licenses/LICENSE-2.0
15+
*
16+
* Unless required by applicable law or agreed to in writing,
17+
* software distributed under the License is distributed on an
18+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
19+
* KIND, either express or implied. See the License for the
20+
* specific language governing permissions and limitations
21+
* under the License.
22+
*/
23+
package com.ly.doc.gradle.task;
24+
25+
import com.ly.doc.builder.websocket.WebSocketMarkdownBuilder;
26+
import com.ly.doc.model.ApiConfig;
27+
import com.thoughtworks.qdox.JavaProjectBuilder;
28+
import org.gradle.api.logging.Logger;
29+
30+
/**
31+
* Support for WebSocket markdown
32+
*
33+
* @author linwumingshi
34+
*/
35+
public class WebSocketMarkdownTask extends DocBaseTask {
36+
@Override
37+
public void executeAction(ApiConfig apiConfig, JavaProjectBuilder javaProjectBuilder, Logger logger) {
38+
try {
39+
WebSocketMarkdownBuilder.buildApiDoc(apiConfig, javaProjectBuilder);
40+
} catch (Exception e) {
41+
e.printStackTrace();
42+
}
43+
}
44+
}

src/main/java/com/ly/doc/gradle/task/WordTask.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* smart-doc
33
*
4-
* Copyright (C) 2018-2023 smart-doc
4+
* Copyright (C) 2018-2024 smart-doc
55
*
66
* Licensed to the Apache Software Foundation (ASF) under one
77
* or more contributor license agreements. See the NOTICE file

src/main/java/com/ly/doc/gradle/util/ArtifactFilterUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* smart-doc
33
*
4-
* Copyright (C) 2018-2023 smart-doc
4+
* Copyright (C) 2018-2024 smart-doc
55
*
66
* Licensed to the Apache Software Foundation (ASF) under one
77
* or more contributor license agreements. See the NOTICE file

src/main/java/com/ly/doc/gradle/util/ClassLoaderUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* smart-doc
33
*
4-
* Copyright (C) 2018-2023 smart-doc
4+
* Copyright (C) 2018-2024 smart-doc
55
*
66
* Licensed to the Apache Software Foundation (ASF) under one
77
* or more contributor license agreements. See the NOTICE file

src/main/java/com/ly/doc/gradle/util/GradleUtil.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* smart-doc
33
*
4-
* Copyright (C) 2018-2023 smart-doc
4+
* Copyright (C) 2018-2024 smart-doc
55
*
66
* Licensed to the Apache Software Foundation (ASF) under one
77
* or more contributor license agreements. See the NOTICE file
@@ -26,16 +26,17 @@
2626
import com.google.gson.FieldAttributes;
2727
import com.google.gson.Gson;
2828
import com.google.gson.GsonBuilder;
29+
import com.ly.doc.model.*;
2930
import com.power.common.util.FileUtil;
3031
import com.power.common.util.StringUtil;
31-
import com.ly.doc.model.*;
3232
import org.gradle.api.Project;
3333
import org.gradle.api.logging.Logger;
3434

3535
import java.io.File;
3636
import java.io.FileInputStream;
3737
import java.io.FileNotFoundException;
38-
import java.util.*;
38+
import java.util.List;
39+
import java.util.Objects;
3940

4041
/**
4142
* @author yu 2020/2/16.
@@ -61,6 +62,7 @@ public boolean shouldSkipClass(Class<?> aClass) {
6162
*
6263
* @param configFile config file
6364
* @param project Project object
65+
* @param increment increment
6466
* @param log gradle plugin log
6567
* @return com.power.doc.model.ApiConfig
6668
*/

src/main/java/com/ly/doc/gradle/util/I18nMsgUtil.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* smart-doc
33
*
4-
* Copyright (C) 2018-2023 smart-doc
4+
* Copyright (C) 2018-2024 smart-doc
55
*
66
* Licensed to the Apache Software Foundation (ASF) under one
77
* or more contributor license agreements. See the NOTICE file
@@ -35,6 +35,9 @@ public interface I18nMsgUtil {
3535

3636
/**
3737
* Abbreviations, instead of full writing: 👇
38+
*
39+
* @param key key
40+
* @return value
3841
*/
3942
@SuppressWarnings("JavadocDeclaration")
4043
static String get(String key) {

0 commit comments

Comments
 (0)