KafkaUtil

新增方法
This commit is contained in:
Carol 2021-09-30 11:10:12 +08:00
parent f98a2927d3
commit bebc16d1b7
25 changed files with 645 additions and 88 deletions

16
.idea/checkstyle-idea.xml Normal file
View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CheckStyle-IDEA">
<option name="configuration">
<map>
<entry key="checkstyle-version" value="8.45" />
<entry key="copy-libs" value="true" />
<entry key="location-0" value="BUNDLED:(bundled):Sun Checks" />
<entry key="location-1" value="BUNDLED:(bundled):Google Checks" />
<entry key="scan-before-checkin" value="false" />
<entry key="scanscope" value="JavaOnly" />
<entry key="suppress-errors" value="false" />
</map>
</option>
</component>
</project>

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RunConfigurationProducerService">
<option name="ignoredProducers">
<set>
<option value="com.android.tools.idea.compose.preview.runconfiguration.ComposePreviewRunConfigurationProducer" />
</set>
</option>
</component>
</project>

View File

@ -0,0 +1,3 @@
\
java:S1118":Add a private constructor to hide the implicit public one.(<28>ʁ<EFBFBD><CA81><EFBFBD><EFBFBD><EFBFBD><EFBFBD>8<><38><EFBFBD><EFBFBD>/

View File

@ -0,0 +1,48 @@
b java:S1128"FDefine and throw a dedicated exception instead of using a generic one.(<28>ʉ<EFBFBD>8ᆋ<38>/
c java:S112<18>"FDefine and throw a dedicated exception instead of using a generic one.(<28><><EFBFBD><EFBFBD>8↋<38>/
L
java:S3740"/Provide the parametrized type for this generic.(<28><><EFBFBD><EFBFBD>8↋<38>/
L
java:S3740"/Provide the parametrized type for this generic.(<28><><EFBFBD><EFBFBD>8ㆋ<38>/
L
java:S3740>"/Provide the parametrized type for this generic.(<28><><EFBFBD><EFBFBD>8ㆋ<38>/
L
java:S3740>"/Provide the parametrized type for this generic.(<28><><EFBFBD><EFBFBD>8ㆋ<38>/
L
java:S3740Y"/Provide the parametrized type for this generic.(<28><><EFBFBD><EFBFBD>8ㆋ<38>/
L
java:S3740\"/Provide the parametrized type for this generic.(<28><><EFBFBD><EFBFBD>8ㆋ<38>/
L
java:S3740w"/Provide the parametrized type for this generic.(<28><><EFBFBD><EFBFBD>8ㆋ<38>/
R
java:S3740<18>"/Provide the parametrized type for this generic.(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>8䆋<38>/
M
java:S3740<18>"/Provide the parametrized type for this generic.(<28><><EFBFBD><EFBFBD>8䆋<38>/
M
java:S3740<18>"/Provide the parametrized type for this generic.(<28><><EFBFBD><EFBFBD>8䆋<38>/
R
java:S3740<18>"/Provide the parametrized type for this generic.(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>8䆋<38>/
\
java:S1118":Add a private constructor to hide the implicit public one.(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>8醋<38>/
o
java:S3776"RRefactor this method to reduce its Cognitive Complexity from 30 to the 15 allowed.(<28><><EFBFBD>8ꆋ<38>/
Q
java:S2864"4Iterate over the "entrySet" instead of the "keySet".(<28><><EFBFBD><EFBFBD><38><C987>/
o
java:S37768"RRefactor this method to reduce its Cognitive Complexity from 16 to the 15 allowed.(<28>ʉ<EFBFBD>8臋<38>/
<EFBFBD>
java:S11308"lRemove the declaration of thrown exception 'java.lang.Exception', as it cannot be thrown from method's body.(<28>ʉ<EFBFBD>8釋<38>/
e
java:S53619"HReplace this call to "replaceAll()" by a call to the "replace()" method.(<28>DŽ<EFBFBD>8<><38><EFBFBD><EFBFBD>/
V
java:S2864:"4Iterate over the "entrySet" instead of the "keySet".(Ĩ<><C4A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>8<><38><EFBFBD><EFBFBD>/
j
java:S5361A"HReplace this call to "replaceAll()" by a call to the "replace()" method.(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>8<><38><EFBFBD><EFBFBD>/
j
java:S5361K"HReplace this call to "replaceAll()" by a call to the "replace()" method.(<28>ҩ<EFBFBD><D2A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><38><C588>/
] java:S125a"<This block of commented-out lines of code should be removed.(ו<><D795><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><38><D388>/
p
java:S3776<18>"RRefactor this method to reduce its Cognitive Complexity from 18 to the 15 allowed.(<28><><EFBFBD><EFBFBD><38><D888>/
<EFBFBD>
java:S1130<18>"lRemove the declaration of thrown exception 'java.lang.Exception', as it cannot be thrown from method's body.(<28><><EFBFBD><EFBFBD><38><D988>/

View File

@ -0,0 +1,3 @@
h
java:S3252"FUse static access with "com.alibaba.fastjson.JSON" for "toJSONString".(<28><>֝<EFBFBD><D69D><EFBFBD><EFBFBD><EFBFBD>8<><38><EFBFBD><EFBFBD>/

View File

@ -0,0 +1,21 @@
\
java:S1118":Add a private constructor to hide the implicit public one.(<28>Ο<EFBFBD><CE9F><EFBFBD><EFBFBD><EFBFBD><EFBFBD>8<><38><EFBFBD><EFBFBD>/
o
java:S3776"RRefactor this method to reduce its Cognitive Complexity from 18 to the 15 allowed.(<28><><EFBFBD><EFBFBD>8<><38><EFBFBD><EFBFBD>/
S
java:S26925"10 is a valid index, but is ignored by this check.(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>8<><38><EFBFBD><EFBFBD>/
O
java:S1905s"3Remove this unnecessary cast to "NetworkInterface".(<28><><EFBFBD>@8<><38><EFBFBD><EFBFBD>/
P
java:S1905v".Remove this unnecessary cast to "InetAddress".(<28>̳<EFBFBD><CCB3><EFBFBD><EFBFBD><EFBFBD>8<><38><EFBFBD><EFBFBD>/
^
java:S3457{"AFormat specifiers should be used instead of string concatenation.(<28><><EFBFBD><EFBFBD>8<><38><EFBFBD><EFBFBD>/
j
java:S1192"HDefine a constant instead of duplicating this literal "unknown" 3 times.(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>8<><38><EFBFBD><EFBFBD>/
Q
java:S10665"/Merge this if statement with the enclosing one.(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>8<><38><EFBFBD><EFBFBD>/
q
java:S1104"TMake hostName a static final constant or non-public and provide accessors if needed.(<28><><EFBFBD>8<><38><EFBFBD><EFBFBD>/
K
java:S1444".Make this "public static hostName" field final(<28><><EFBFBD>8<><38><EFBFBD><EFBFBD>/

View File

@ -1,12 +1,12 @@
N
java:S2864"4Iterate over the "entrySet" instead of the "keySet".(<28><><EFBFBD>q8<71><38><EFBFBD>Ɏ/
<EFBFBD>
java:S1319"mThe return type of this method should be an interface such as "Map" rather than the implementation "HashMap".(<28>ةH8<48><38><EFBFBD>Ɏ/
e java:S112"FDefine and throw a dedicated exception instead of using a generic one.(<28><>Ş<EFBFBD><C59E><EFBFBD><EFBFBD><EFBFBD>8<EFBFBD><EFBFBD><EFBFBD>Ɏ/
<EFBFBD>
java:S1319"kThe type of the "uri" object should be an interface such as "Map" rather than the implementation "HashMap".(إ<><D8A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>8<EFBFBD><EFBFBD><EFBFBD>Ɏ/
<EFBFBD>
java:S1130"lRemove the declaration of thrown exception 'java.lang.Exception', as it cannot be thrown from method's body.(<28><>Ş<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>8<><38><EFBFBD>Ɏ/
i
java:S2095"IUse try-with-resources or close this "MongoClient" in a "finally" clause.(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>8<><38><EFBFBD>Ɏ/
g java:S112"FDefine and throw a dedicated exception instead of using a generic one.(<28><>Ş<EFBFBD><C59E><EFBFBD><EFBFBD><EFBFBD>8<><38><EFBFBD>Ɏ/
<EFBFBD>
java:S1130"lRemove the declaration of thrown exception 'java.lang.Exception', as it cannot be thrown from method's body.(<28><>Ş<EFBFBD><C59E><EFBFBD><EFBFBD><EFBFBD>8<><38><EFBFBD>Ɏ/
P
java:S2864."4Iterate over the "entrySet" instead of the "keySet".(<28><><EFBFBD>q8<EFBFBD><EFBFBD><EFBFBD>Ɏ/
<EFBFBD>
java:S1319"mThe return type of this method should be an interface such as "Map" rather than the implementation "HashMap".(<28>ةH8<EFBFBD><EFBFBD><EFBFBD>Ɏ/
<EFBFBD>
java:S1319$"kThe type of the "uri" object should be an interface such as "Map" rather than the implementation "HashMap".(إ<><D8A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>8<><38><EFBFBD>Ɏ/
k
java:S20951"IUse try-with-resources or close this "MongoClient" in a "finally" clause.(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>8<><38><EFBFBD>Ɏ/

View File

@ -0,0 +1,86 @@
R
java:S1133"5Do not forget to remove this deprecated code someday.(<28>и<EFBFBD>8<><38><EFBFBD>/
E
java:S1123"(Add the missing @deprecated Javadoc tag.(<28>и<EFBFBD>8<><38><EFBFBD>/
W
java:S1118":Add a private constructor to hide the implicit public one.(<28><><EFBFBD><EFBFBD>8<><38><EFBFBD>/
\
java:S1118"":Add a private constructor to hide the implicit public one.(ꁰ<><EA81B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD>8<><38><EFBFBD>/
\
java:S11181":Add a private constructor to hide the implicit public one.(<28>خ<EFBFBD><D8AE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>8<><38><EFBFBD>/
u java:S115;"ZRename this constant name to match the regular expression '^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$'.(<28><><EFBFBD>M8<4D><38><EFBFBD>/
v java:S115<"ZRename this constant name to match the regular expression '^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$'.(<28><><EFBFBD><EFBFBD>8<><38><EFBFBD>/
W
java:S1118:":Add a private constructor to hide the implicit public one.(<28><><EFBFBD>8<><38><EFBFBD>/
h
java:S3252_"FUse static access with "com.alibaba.fastjson.JSON" for "toJSONString".(<28><>֝<EFBFBD><D69D><EFBFBD><EFBFBD><EFBFBD>8<><38><EFBFBD>/
D
java:S1172<18>"&Remove these unused method parameters.(<28><><EFBFBD><EFBFBD>8<><38><EFBFBD>/
n java:S128<18>"LEnd this switch case with an unconditional break, return or throw statement.(ѧ<><D1A7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>8<><38><EFBFBD>/
i java:S128<18>"LEnd this switch case with an unconditional break, return or throw statement.(<28><><EFBFBD><EFBFBD>8<><38><EFBFBD>/
i java:S128<18>"LEnd this switch case with an unconditional break, return or throw statement.(<28><><EFBFBD><EFBFBD>8<><38><EFBFBD>/
X java:S107s"=Method has 13 parameters, which is greater than 7 authorized.(<28><><EFBFBD>@8<><38><EFBFBD><EFBFBD>/
Z java:S107<18>"=Method has 14 parameters, which is greater than 7 authorized.(<28><><EFBFBD><EFBFBD>8<><38><EFBFBD><EFBFBD>/
G
java:S2629<18>"$Invoke method(s) only conditionally.(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>8<><38><EFBFBD><EFBFBD>/
G
java:S2629<18>"$Invoke method(s) only conditionally.(<28><>Ǐ<EFBFBD><C78F><EFBFBD><EFBFBD><EFBFBD>8<><38><EFBFBD><EFBFBD>/
B
java:S2629<18>"$Invoke method(s) only conditionally.(Ψ<><CEA8>8<><38><EFBFBD><EFBFBD>/
G
java:S2629<18>"$Invoke method(s) only conditionally.(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>8<><38><EFBFBD><EFBFBD>/
G
java:S2629<18>"$Invoke method(s) only conditionally.(ò<><C3B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>8<><38><EFBFBD><EFBFBD>/
G
java:S2629<18>"$Invoke method(s) only conditionally.(ò<><C3B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>8<><38><EFBFBD><EFBFBD>/
G
java:S2629<18>"$Invoke method(s) only conditionally.(<28><>Ǐ<EFBFBD><C78F><EFBFBD><EFBFBD><EFBFBD>8<><38><EFBFBD><EFBFBD>/
G
java:S2629<18>"$Invoke method(s) only conditionally.(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>8<><38><EFBFBD><EFBFBD>/
B
java:S2629<18>"$Invoke method(s) only conditionally.(Ψ<><CEA8>8<><38><EFBFBD><EFBFBD>/
G
java:S2629<18>"$Invoke method(s) only conditionally.(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>8<><38><EFBFBD><EFBFBD>/
G
java:S2629<18>"$Invoke method(s) only conditionally.(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>8<><38><EFBFBD><EFBFBD>/
G
java:S2629<18>"$Invoke method(s) only conditionally.(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>8<><38><EFBFBD><EFBFBD>/
G
java:S2629<18>"$Invoke method(s) only conditionally.(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>8<><38><EFBFBD><EFBFBD>/
G
java:S2629<18>"$Invoke method(s) only conditionally.(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>8<><38><EFBFBD><EFBFBD>/
G
java:S2629<18>"$Invoke method(s) only conditionally.(<28><>Ǐ<EFBFBD><C78F><EFBFBD><EFBFBD><EFBFBD>8<><38><EFBFBD><EFBFBD>/
G
java:S2629<18>"$Invoke method(s) only conditionally.(<28><>Ǐ<EFBFBD><C78F><EFBFBD><EFBFBD><EFBFBD>8<><38><EFBFBD><EFBFBD>/
G
java:S2629<18>"$Invoke method(s) only conditionally.(<28><>Ǐ<EFBFBD><C78F><EFBFBD><EFBFBD><EFBFBD>8<><38><EFBFBD><EFBFBD>/
G
java:S2629<18>"$Invoke method(s) only conditionally.(<28><>Ǐ<EFBFBD><C78F><EFBFBD><EFBFBD><EFBFBD>8<><38><EFBFBD><EFBFBD>/
G
java:S2629<18>"$Invoke method(s) only conditionally.(<28><>Ǐ<EFBFBD><C78F><EFBFBD><EFBFBD><EFBFBD>8<><38><EFBFBD><EFBFBD>/
G
java:S2629<18>"$Invoke method(s) only conditionally.(<28><>Ǐ<EFBFBD><C78F><EFBFBD><EFBFBD><EFBFBD>8<><38><EFBFBD><EFBFBD>/
G
java:S2629<18>"$Invoke method(s) only conditionally.(<28><>Ǐ<EFBFBD><C78F><EFBFBD><EFBFBD><EFBFBD>8<><38><EFBFBD><EFBFBD>/
G
java:S2629<18>"$Invoke method(s) only conditionally.(<28><>Ǐ<EFBFBD><C78F><EFBFBD><EFBFBD><EFBFBD>8<><38><EFBFBD><EFBFBD>/
G
java:S2629<18>"$Invoke method(s) only conditionally.(<28><>Ǐ<EFBFBD><C78F><EFBFBD><EFBFBD><EFBFBD>8<><38><EFBFBD><EFBFBD>/
B
java:S2629<18>"$Invoke method(s) only conditionally.(Ψ<><CEA8>8<><38><EFBFBD><EFBFBD>/
B
java:S2629<18>"$Invoke method(s) only conditionally.(Ψ<><CEA8>8<><38><EFBFBD><EFBFBD>/
B
java:S2629<18>"$Invoke method(s) only conditionally.(Ψ<><CEA8>8<><38><EFBFBD><EFBFBD>/
B
java:S2629<18>"$Invoke method(s) only conditionally.(Ψ<><CEA8>8<><38><EFBFBD><EFBFBD>/
G
java:S2629<18>"$Invoke method(s) only conditionally.(ò<><C3B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>8<><38><EFBFBD><EFBFBD>/
G
java:S2629<18>"$Invoke method(s) only conditionally.(ò<><C3B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>8<><38><EFBFBD><EFBFBD>/
G
java:S2629<18>"$Invoke method(s) only conditionally.(ò<><C3B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>8<><38><EFBFBD><EFBFBD>/
G
java:S2629<18>"$Invoke method(s) only conditionally.(ò<><C3B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>8<><38><EFBFBD><EFBFBD>/

View File

@ -0,0 +1,29 @@
b java:S112^"FDefine and throw a dedicated exception instead of using a generic one.(<28><><EFBFBD>8<>Є<EFBFBD>/
q
java:S3008"TRename this field "S_DES_KEY" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(<28><>ؓ8<>Є<EFBFBD>/
<EFBFBD>
java:S1149{"_Replace the synchronized class "StringBuffer" by an unsynchronized one such as "StringBuilder".(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>8<>Є<EFBFBD>/
}
java:S1149<18>"_Replace the synchronized class "StringBuffer" by an unsynchronized one such as "StringBuilder".(׍<><D78D>8<>Є<EFBFBD>/
W
java:S1118":Add a private constructor to hide the implicit public one.(ټ<><D9BC>8<>Є<EFBFBD>/
g
java:S1124"EReorder the modifiers to comply with the Java Language Specification.(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>8<>Є<EFBFBD>/
g
java:S1124"EReorder the modifiers to comply with the Java Language Specification.(<28>۳<EFBFBD><DBB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>8<>Є<EFBFBD>/
g
java:S1124"EReorder the modifiers to comply with the Java Language Specification.(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>8<>Є<EFBFBD>/
[
java:S47192"9Replace charset name argument with StandardCharsets.UTF_8(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>8<>Є<EFBFBD>/
V
java:S4719A"9Replace charset name argument with StandardCharsets.UTF_8(ѥ<><D1A5>8<>Є<EFBFBD>/
@
java:S5542h"#Use secure mode and padding scheme.(<28><>ˋ8<>ф<EFBFBD>/
;
java:S5547h"Use a strong cipher algorithm.(<28><>ˋ8<>ф<EFBFBD>/
] java:S125j"<This block of commented-out lines of code should be removed.(<28><>ݔ<EFBFBD><DD94><EFBFBD><EFBFBD><EFBFBD>8<>ф<EFBFBD>/
r
java:S1104"UMake S_DES_KEY a static final constant or non-public and provide accessors if needed.(<28><>ؓ8<>҄<EFBFBD>/
L
java:S1444"/Make this "public static S_DES_KEY" field final(<28><>ؓ8<>҄<EFBFBD>/

View File

@ -0,0 +1,11 @@
W
java:S1133"5Do not forget to remove this deprecated code someday.(<28><>ݭ<EFBFBD><DDAD><EFBFBD><EFBFBD><EFBFBD>8<><38><EFBFBD><EFBFBD>/
J
java:S1123"(Add the missing @deprecated Javadoc tag.(<28><>ݭ<EFBFBD><DDAD><EFBFBD><EFBFBD><EFBFBD>8<><38><EFBFBD><EFBFBD>/
\
java:S1118":Add a private constructor to hide the implicit public one.(<28><>ݭ<EFBFBD><DDAD><EFBFBD><EFBFBD><EFBFBD>8<><38><EFBFBD><EFBFBD>/
R
java:S1133"5Do not forget to remove this deprecated code someday.(ױ<><D7B1>8<><38><EFBFBD><EFBFBD>/
W
java:S1118":Add a private constructor to hide the implicit public one.(<28><><EFBFBD>8<><38><EFBFBD><EFBFBD>/

View File

@ -0,0 +1,8 @@
g java:S1125"FDefine and throw a dedicated exception instead of using a generic one.(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>8<><38><EFBFBD><EFBFBD>/
W
java:S1118":Add a private constructor to hide the implicit public one.(<28><><EFBFBD>8<><38><EFBFBD><EFBFBD>/
z
java:S1104"XMake objectMapper a static final constant or non-public and provide accessors if needed.(ʳ՜<CAB3><D59C><EFBFBD><EFBFBD><EFBFBD>8<><38><EFBFBD><EFBFBD>/
T
java:S1444"2Make this "public static objectMapper" field final(ʳ՜<CAB3><D59C><EFBFBD><EFBFBD><EFBFBD>8<><38><EFBFBD><EFBFBD>/

View File

@ -0,0 +1,29 @@
b java:S112~"FDefine and throw a dedicated exception instead of using a generic one.(<28><><EFBFBD>8䞆<38>/
L
java:S3740"/Provide the parametrized type for this generic.(<28><><EFBFBD><EFBFBD>8垆<38>/
L
java:S3740"/Provide the parametrized type for this generic.(<28><><EFBFBD><EFBFBD>8垆<38>/
}
java:S1149<18>"_Replace the synchronized class "StringBuffer" by an unsynchronized one such as "StringBuilder".(<28>Λ<EFBFBD>8<><38><EFBFBD><EFBFBD>/
\
java:S1118":Add a private constructor to hide the implicit public one.(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>8<><38><EFBFBD><EFBFBD>/
=
java:S2129&" Remove this "String" constructor(<28><><EFBFBD><EFBFBD><38><D19F>/
t
java:S3776U"RRefactor this method to reduce its Cognitive Complexity from 21 to the 15 allowed.(<28>܉<EFBFBD><DC89><EFBFBD><EFBFBD><EFBFBD><EFBFBD><38><DC9F>/
<EFBFBD>
java:S1130~"lRemove the declaration of thrown exception 'java.lang.Exception', as it cannot be thrown from method's body.(<28><><EFBFBD>8⟆<38>/
K
java:S4425<18>"(Use String.format( "%02X", ...) instead.(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>8<38>/
p java:S100<18>"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>8<><38><EFBFBD><EFBFBD>/
<EFBFBD>
java:S1319~"mThe return type of this method should be an interface such as "Set" rather than the implementation "HashSet".(<28><><EFBFBD>8<><38><EFBFBD><EFBFBD>/
W
java:S1141]"5Extract this nested try block into a separate method.(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>8<><38><EFBFBD><EFBFBD>/
>
java:S1643*"Use a StringBuilder instead.(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>8<><38><EFBFBD><EFBFBD>/
>
java:S1643,"Use a StringBuilder instead.(͒<><CD92><EFBFBD><EFBFBD><EFBFBD><EFBFBD>8<><38><EFBFBD><EFBFBD>/
S
java:S1153*"1Directly append the argument of String.valueOf().(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>8<><38><EFBFBD><EFBFBD>/

View File

@ -1,2 +1,77 @@
<EFBFBD> squid:S1697<18>"~Either reverse the equality operator in the "propertiesPathPrefix" null test, or reverse the logical operator that follows it.(̚<><CC9A><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>8<>ۅ<EFBFBD><DB85>.
c java:S112<18>"FDefine and throw a dedicated exception instead of using a generic one.(<28><><EFBFBD><EFBFBD>8<><38><EFBFBD><EFBFBD>/
h java:S112<18>"FDefine and throw a dedicated exception instead of using a generic one.(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>8<><38><EFBFBD><EFBFBD>/
Q
java:S3740q"/Provide the parametrized type for this generic.(<28>޷<EFBFBD><DEB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>8<><38><EFBFBD><EFBFBD>/
Q
java:S3740r"/Provide the parametrized type for this generic.(<28>٬<EFBFBD><D9AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>8<><38><EFBFBD><EFBFBD>/
Q
java:S3740r"/Provide the parametrized type for this generic.(<28>٬<EFBFBD><D9AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>8<><38><EFBFBD><EFBFBD>/
M
java:S3740<18>"/Provide the parametrized type for this generic.(<28><><EFBFBD><EFBFBD>8<><38><EFBFBD><EFBFBD>/
\
java:S1118":Add a private constructor to hide the implicit public one.(<28>۟<EFBFBD><DB9F><EFBFBD><EFBFBD><EFBFBD><EFBFBD>8<><38><EFBFBD><EFBFBD>/
[
java:S4719;"9Replace charset name argument with StandardCharsets.UTF_8(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>8<><38><EFBFBD><EFBFBD>/
V
java:S4719J"9Replace charset name argument with StandardCharsets.UTF_8(<28><><EFBFBD>8<><38><EFBFBD><EFBFBD>/
B
java:S2129s" Remove this "String" constructor(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>8<38>/
h
java:S3252<18>"EUse static access with "com.alibaba.fastjson.JSON" for "parseObject".(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>8<><38>/
O
java:S1602<18>",Remove useless curly braces around statement(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>8<><38><EFBFBD><EFBFBD>/
u
java:S3776<18>"RRefactor this method to reduce its Cognitive Complexity from 16 to the 15 allowed.(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>8<><38><EFBFBD><EFBFBD>/
X
java:S1133<18>"5Do not forget to remove this deprecated code someday.(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>8<><38><EFBFBD><EFBFBD>/
K
java:S1123<18>"(Add the missing @deprecated Javadoc tag.(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>8<><38><EFBFBD><EFBFBD>/
C
java:S2129<18>" Remove this "String" constructor(<28><>Ŷ<EFBFBD><C5B6><EFBFBD><EFBFBD><EFBFBD>8<><38><EFBFBD><EFBFBD>/
C
java:S2129<18>" Remove this "String" constructor(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>8<><38><EFBFBD><EFBFBD>/
\
java:S4719<18>"9Replace charset name argument with StandardCharsets.UTF_8(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>8<><38><EFBFBD><EFBFBD>/
[ java:S106<18>"9Replace this use of System.out or System.err by a logger.(񗸽<><F197B8BD><EFBFBD><EFBFBD><EFBFBD>8<><38><EFBFBD><EFBFBD>/
I
java:S1075<18>"&Remove this hard-coded path-delimiter.(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>8<><38><EFBFBD><EFBFBD>/
u
java:S3776<18>"RRefactor this method to reduce its Cognitive Complexity from 49 to the 15 allowed.(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>8<><38><EFBFBD><EFBFBD>/
X
java:S1133<18>"5Do not forget to remove this deprecated code someday.(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>8<><38><EFBFBD><EFBFBD>/
K
java:S1123<18>"(Add the missing @deprecated Javadoc tag.(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>8<><38><EFBFBD><EFBFBD>/
\
java:S4719<18>"9Replace charset name argument with StandardCharsets.UTF_8(諅<><E8AB85><EFBFBD><EFBFBD><EFBFBD><EFBFBD>8<><38><EFBFBD><EFBFBD>/
\
java:S4719<18>"9Replace charset name argument with StandardCharsets.UTF_8(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>8<><38><EFBFBD><EFBFBD>/
W
java:S4719<18>"9Replace charset name argument with StandardCharsets.UTF_8(<28><><EFBFBD><EFBFBD>8<><38><EFBFBD><EFBFBD>/
W
java:S4719<18>"9Replace charset name argument with StandardCharsets.UTF_8(<28><EFBFBD>8<><38><EFBFBD><EFBFBD>/
d java:S899<18>"BDo something with the "boolean" value returned by "createNewFile".(А<><D090><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><38><D88F>/
o
java:S1192<18>"LDefine a constant instead of duplicating this literal ".properties" 4 times.(<28><>ٰ<EFBFBD><D9B0><EFBFBD><EFBFBD><EFBFBD>8㏁<38>/
h
java:S1192;"FDefine a constant instead of duplicating this literal "UTF-8" 7 times.(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>8䏁<38>/
u
java:S1192<18>"WDefine a constant instead of duplicating this literal "spring.profiles.active" 5 times.(<28><><EFBFBD>8䏁<38>/
u
java:S1192<18>"WDefine a constant instead of duplicating this literal "application.properties" 3 times.(<28><>ۘ8䏁<38>/
s java:S117<18>"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>8珁<38>/
s java:S117<18>"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>8珁<38>/
`
java:S1155H">Use isEmpty() to check whether the collection is empty or not.(<28>Ȅ<EFBFBD><C884><EFBFBD><EFBFBD><EFBFBD><EFBFBD>8珁<38>/
\
java:S4973<18>"9Use the "equals" method if value comparison was intended.(<28><>ٰ<EFBFBD><D9B0><EFBFBD><EFBFBD><EFBFBD>8<><38><EFBFBD><EFBFBD>/
k
java:S2095w"NUse try-with-resources or close this "LineNumberReader" in a "finally" clause.(<28><><EFBFBD>8<><38><EFBFBD><EFBFBD>/
k
java:S2095e"NUse try-with-resources or close this "LineNumberReader" in a "finally" clause.(<28><><EFBFBD>8<><38><EFBFBD><EFBFBD>/
e
java:S2095d"HUse try-with-resources or close this "FileReader" in a "finally" clause.(<28><><EFBFBD><EFBFBD>8<><38><EFBFBD><EFBFBD>/
e
java:S2095v"HUse try-with-resources or close this "FileReader" in a "finally" clause.(<28><><EFBFBD><EFBFBD>8<><38><EFBFBD><EFBFBD>/
V
java:S2589<18>"8Remove this expression which always evaluates to "false"(<28><><EFBFBD><EFBFBD>8<><38><EFBFBD><EFBFBD>/

View File

@ -0,0 +1,61 @@
R
java:S3740<18>"/Provide the parametrized type for this generic.(<28><>˴<EFBFBD><CBB4><EFBFBD><EFBFBD><EFBFBD>8<>ـ<EFBFBD>/
M
java:S3740<18>"/Provide the parametrized type for this generic.(<28><><EFBFBD>8<>ـ<EFBFBD>/
J
java:S2447{"-Null is returned but a "Boolean" is expected.(<28><><EFBFBD>8<>ڀ<EFBFBD>/
K
java:S2447<18>"-Null is returned but a "Boolean" is expected.(<28><><EFBFBD>8<>܀<EFBFBD>/
K
java:S2447<18>"-Null is returned but a "Boolean" is expected.(<28><><EFBFBD>8<>߀<EFBFBD>/
I
java:S1168<18>"+Return an empty collection instead of null.(<28><><EFBFBD>8<>߀<EFBFBD>/
I
java:S1168<18>"+Return an empty collection instead of null.(<28><><EFBFBD>8<>߀<EFBFBD>/
I
java:S1168<18>"+Return an empty collection instead of null.(<28><><EFBFBD>8<>߀<EFBFBD>/
I
java:S1168<18>"+Return an empty collection instead of null.(<28><><EFBFBD>8<><38><EFBFBD>/
I
java:S1168<18>"+Return an empty collection instead of null.(<28><><EFBFBD>8<><38><EFBFBD>/
I
java:S1168<18>"+Return an empty collection instead of null.(<28><><EFBFBD>8<><38><EFBFBD>/
I
java:S1168<18>"+Return an empty collection instead of null.(<28><><EFBFBD>8<><38><EFBFBD>/
v
java:S2293<18>"YReplace the type specification in this constructor call with the diamond operator ("<>").(<28><><EFBFBD>I8<49><38><EFBFBD>/
I
java:S1168<18>"+Return an empty collection instead of null.(<28><><EFBFBD>8<><38><EFBFBD>/
v
java:S2293<18>"YReplace the type specification in this constructor call with the diamond operator ("<>").(<28><><EFBFBD>I8<49><38><EFBFBD>/
I
java:S1168<18>"+Return an empty collection instead of null.(<28><><EFBFBD>8<><38><EFBFBD>/
8
java:S3457<18>"Not enough arguments.(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>8<><38><EFBFBD>/
8
java:S3457<18>"Not enough arguments.(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>8<><38><EFBFBD>/
<EFBFBD>
java:S1319<18>"mThe return type of this method should be an interface such as "Set" rather than the implementation "HashSet".(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>8<><38><EFBFBD>/
<EFBFBD>
java:S1319<18>"mThe return type of this method should be an interface such as "Set" rather than the implementation "HashSet".(𷕅8<><38><EFBFBD>/
H
java:S5411<18>"*Use the primitive boolean expression here.(<28><><EFBFBD><EFBFBD>8<><38><EFBFBD>/
H
java:S5411<18>"*Use the primitive boolean expression here.(<28><><EFBFBD><EFBFBD>8<><38><EFBFBD>/
H
java:S5411<18>"*Use the primitive boolean expression here.(<28><><EFBFBD><EFBFBD>8<><38><EFBFBD>/
H
java:S5411<18>"*Use the primitive boolean expression here.(<28><><EFBFBD><EFBFBD>8<><38><EFBFBD>/
M
java:S5411<18>"*Use the primitive boolean expression here.(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>8<><38><EFBFBD>/
p
java:S2259."SA "NullPointerException" could be thrown; "getConnectionFactory()" can return null.(<28><><EFBFBD>8<><38><EFBFBD>/
q
java:S2259<18>"SA "NullPointerException" could be thrown; "getConnectionFactory()" can return null.(<28><><EFBFBD><EFBFBD>8<><38><EFBFBD>/
q
java:S2259<18>"SA "NullPointerException" could be thrown; "getConnectionFactory()" can return null.(<28><><EFBFBD><EFBFBD>8<><38><EFBFBD>/
p
java:S2259"SA "NullPointerException" could be thrown; "getConnectionFactory()" can return null.(<28>ȅ<EFBFBD>8<><38><EFBFBD>/
q
java:S2259<18>"SA "NullPointerException" could be thrown; "getConnectionFactory()" can return null.(<28>֏<EFBFBD>8<><38><EFBFBD>/

View File

@ -0,0 +1,21 @@
Q
java:S3740"/Provide the parametrized type for this generic.(⋠<><E28BA0><EFBFBD><EFBFBD><EFBFBD><EFBFBD>8<><38><EFBFBD>/
Q
java:S3740"/Provide the parametrized type for this generic.(⋠<><E28BA0><EFBFBD><EFBFBD><EFBFBD><EFBFBD>8<><38><EFBFBD>/
L
java:S3740"/Provide the parametrized type for this generic.(<28><><EFBFBD><EFBFBD>8<><38><EFBFBD>/
L
java:S3740"/Provide the parametrized type for this generic.(<28><><EFBFBD><EFBFBD>8<><38><EFBFBD>/
Q
java:S3740#"/Provide the parametrized type for this generic.(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>8<><38><EFBFBD>/
p java:S116"ORename this field "NAME" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>8<><38><EFBFBD>/
o java:S116"NRename this field "PID" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(<28><>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD><EFBFBD>8<><38><EFBFBD>/
r java:S116"QRename this field "TOPICS" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(⋠<><E28BA0><EFBFBD><EFBFBD><EFBFBD><EFBFBD>8<><38><EFBFBD>/
k java:S116"ORename this field "INFO" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(<28><><EFBFBD><EFBFBD>8<><38><EFBFBD>/
h
java:S3252H"FUse static access with "com.alibaba.fastjson.JSON" for "toJSONString".(<28><>֝<EFBFBD><D69D><EFBFBD><EFBFBD><EFBFBD>8<><38><EFBFBD><EFBFBD>/
<EFBFBD>
java:S1319#"rThe type of the "customInfo" object should be an interface such as "Map" rather than the implementation "HashMap".(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>8<><38><EFBFBD><EFBFBD>/
`
java:S1155,">Use isEmpty() to check whether the collection is empty or not.(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>8<><38><EFBFBD><EFBFBD>/

View File

@ -0,0 +1,5 @@
t
java:S3077"WUse a thread-safe type; adding "volatile" is not enough to make this field thread-safe.(<28><><EFBFBD><EFBFBD>8<><38><EFBFBD><EFBFBD>/
o
java:S1215$"TDon't try to be smarter than the JVM, remove this call to run the garbage collector.(<28><>ݧ<EFBFBD><DDA7><EFBFBD><EFBFBD><EFBFBD>

View File

@ -10,8 +10,6 @@ i
.gitignore,a\5\a5cc2925ca8258af241be7e5b0381edf30266302
>
.gitattributes,2\4\24139dae656713ba861751fb2c2ac38839349a7a
9
README.md,8/e/8ec9a00bfd09b3190ac6b22251dbb1aa95a0579d
k
;src/main/java/site/cnkj/common/config/AsyncExecutePool.java,4\1\416390ba57649e9f4e6365934e9a6827cca3ffed
p
@ -26,33 +24,43 @@ i
9src/main/java/site/cnkj/common/object/redis/Receiver.java,4\a\4a24c23f6158d7abc5657040e232691adcee44ac
m
=src/main/java/site/cnkj/common/object/servlet/BaseResult.java,1\9\19affac2f7e5749f37c36532ef281eec1befbd05
m
=src/main/java/site/cnkj/common/object/servlet/CommonInfo.java,6\b\6b5bb34dca0a1a09968bad0dc5ab4ad5434df80e
m
=src/main/java/site/cnkj/common/object/servlet/DataResult.java,1\c\1c4b500508bae883bea47d0637c267e8c57d7580
s
Csrc/main/java/site/cnkj/common/object/servlet/ResponseBodyCode.java,b\c\bc46480ac8ea27c54208391c0607483f70591f52
l
<src/main/java/site/cnkj/common/object/ReasonEnumeration.java,6\5\65fb0f3f093182fd2ca42f4eb1116d36adc8a868
o
?src/main/java/site/cnkj/common/utils/http/RestTemplateUtil.java,7\7\776a6d7b367518db3108c641270f9c6311fa1150
_
/src/main/java/site/cnkj/data/ProtobufOuter.java,9\f\9f5f569cdcb2cd35235adfef521ccd334b295f84
h
8src/main/java/site/cnkj/data/ProtobufOuterOperation.java,b\2\b28def072d697c755d8047d7c4fc36e92d284e43
;
_config.yml,c\d\cd089ae45ce870c45e434019e8f1ed4f066cd425
l
<src/main/java/site/cnkj/common/config/MongoClientConfig.java,a/7/a7482e3aea73010d528b7d36a1714c752a72fa1d
q
Asrc/main/java/site/cnkj/common/utils/file/FileEncryptDecrypt.java,e\a\eaa75651d9d6785c2bd75843529d61a722450af5
9
README.md,8\e\8ec9a00bfd09b3190ac6b22251dbb1aa95a0579d
s
Csrc/main/java/site/cnkj/common/object/servlet/ResponseBodyCode.java,b\c\bc46480ac8ea27c54208391c0607483f70591f52
m
=src/main/java/site/cnkj/common/object/servlet/DataResult.java,1\c\1c4b500508bae883bea47d0637c267e8c57d7580
m
=src/main/java/site/cnkj/common/object/servlet/CommonInfo.java,6\b\6b5bb34dca0a1a09968bad0dc5ab4ad5434df80e
h
8src/main/java/site/cnkj/common/service/ActuatorInfo.java,e\7\e7ba402f75a71f1f452cbf16986ed26aa0c6f1b5
h
8src/main/java/site/cnkj/common/utils/data/KafkaUtil.java,7\4\74438aca9f4a48488fe204b00a7429cabb247abb
o
?src/main/java/site/cnkj/common/utils/data/MongoClientsInit.java,4/9/490c965ee8a02ce158895987485283bb4b666ab6
g
7src/main/java/site/cnkj/common/utils/date/DateUtil.java,1\5\157e0e9285b69e300624f35e79300c0ed6098936
?src/main/java/site/cnkj/common/utils/data/MongoClientsInit.java,4\9\490c965ee8a02ce158895987485283bb4b666ab6
h
8src/main/java/site/cnkj/common/utils/data/RedisUtil.java,e\0\e00232faab93cb27b9940f780c75123903d70b1c
g
7src/main/java/site/cnkj/common/utils/file/FileUtil.java,d\f\df021943680d67b4f49e98599f4bb0e86803c590
m
=src/main/java/site/cnkj/common/utils/http/HttpCommonUtil.java,2\1\21fd7f9a07ee140f9ce9ae11bbe161bdd456cbc8
o
?src/main/java/site/cnkj/common/utils/http/RestTemplateUtil.java,7\7\776a6d7b367518db3108c641270f9c6311fa1150
e
5src/main/java/site/cnkj/common/utils/io/CopyUtil.java,1\1\1195786afcb95315b3ec156ea91e7166c2c2cf10
`
0src/main/java/site/cnkj/common/utils/io/DES.java,6\4\644b718a1d63acca44c411c399624e16ce98e11c
g
7src/main/java/site/cnkj/common/utils/io/RSAEncrypt.java,8\2\82864735cd8af377e6ad061ae189505a1e3e9d7c
g
7src/main/java/site/cnkj/common/utils/io/StringUtil.java,a\4\a43b6e3feeba3336586237a758acfa97b791be5b
k
;src/main/java/site/cnkj/common/utils/logger/LoggerUtil.java,4\f\4ffd3a6de814df96de78c74e6c16f964b4fe9a03
@ -63,14 +71,4 @@ Esrc/main/java/site/cnkj/common/utils/serialize/SoapXmlFormatUtil.java,1\7\1759
q
Asrc/main/java/site/cnkj/common/utils/serialize/UrlDecodeUtil.java,1\4\14399913ca07717830f9b08ee87644884fc2959a
q
Asrc/main/java/site/cnkj/common/utils/system/GracefulShutdown.java,f\d\fdadf7a612307c5bb8e90739949b439a1891d886
h
8src/main/java/site/cnkj/common/utils/data/RedisUtil.java,e\0\e00232faab93cb27b9940f780c75123903d70b1c
_
/src/main/java/site/cnkj/data/ProtobufOuter.java,9\f\9f5f569cdcb2cd35235adfef521ccd334b295f84
h
8src/main/java/site/cnkj/data/ProtobufOuterOperation.java,b\2\b28def072d697c755d8047d7c4fc36e92d284e43
;
_config.yml,c\d\cd089ae45ce870c45e434019e8f1ed4f066cd425
l
<src/main/java/site/cnkj/common/config/MongoClientConfig.java,a/7/a7482e3aea73010d528b7d36a1714c752a72fa1d
Asrc/main/java/site/cnkj/common/utils/system/GracefulShutdown.java,f\d\fdadf7a612307c5bb8e90739949b439a1891d886

View File

@ -4,14 +4,31 @@
<option name="autoReloadType" value="ALL" />
</component>
<component name="ChangeListManager">
<list default="true" id="8ab3ef3f-5475-495f-a0ee-8551c01ff741" name="Changes" comment="">
<change beforePath="$PROJECT_DIR$/.idea/jarRepositories.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/jarRepositories.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/sonarlint/issuestore/4/4/442292b8a7efeabbe4cc176709b833b1792140ec" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/sonarlint/issuestore/8/2/82864735cd8af377e6ad061ae189505a1e3e9d7c" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/sonarlint/issuestore/e/a/eaa75651d9d6785c2bd75843529d61a722450af5" beforeDir="false" />
<list default="true" id="8ab3ef3f-5475-495f-a0ee-8551c01ff741" name="Changes" comment="change MongoClientInit and fix some bug.">
<change beforePath="$PROJECT_DIR$/.idea/sonarlint/issuestore/1/1/1195786afcb95315b3ec156ea91e7166c2c2cf10" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/sonarlint/issuestore/1/4/14399913ca07717830f9b08ee87644884fc2959a" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/sonarlint/issuestore/1/4/14399913ca07717830f9b08ee87644884fc2959a" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/sonarlint/issuestore/1/5/157e0e9285b69e300624f35e79300c0ed6098936" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/sonarlint/issuestore/1/7/1759e0760a24aae1fd0b2b5d7d8622112c621b0e" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/sonarlint/issuestore/1/7/1759e0760a24aae1fd0b2b5d7d8622112c621b0e" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/sonarlint/issuestore/1/c/1c4b500508bae883bea47d0637c267e8c57d7580" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/sonarlint/issuestore/1/c/1c4b500508bae883bea47d0637c267e8c57d7580" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/sonarlint/issuestore/2/1/21fd7f9a07ee140f9ce9ae11bbe161bdd456cbc8" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/sonarlint/issuestore/2/1/21fd7f9a07ee140f9ce9ae11bbe161bdd456cbc8" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/sonarlint/issuestore/4/9/490c965ee8a02ce158895987485283bb4b666ab6" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/sonarlint/issuestore/4/9/490c965ee8a02ce158895987485283bb4b666ab6" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/sonarlint/issuestore/4/f/4ffd3a6de814df96de78c74e6c16f964b4fe9a03" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/sonarlint/issuestore/4/f/4ffd3a6de814df96de78c74e6c16f964b4fe9a03" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/sonarlint/issuestore/6/4/644b718a1d63acca44c411c399624e16ce98e11c" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/sonarlint/issuestore/6/4/644b718a1d63acca44c411c399624e16ce98e11c" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/sonarlint/issuestore/6/b/6b5bb34dca0a1a09968bad0dc5ab4ad5434df80e" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/sonarlint/issuestore/6/b/6b5bb34dca0a1a09968bad0dc5ab4ad5434df80e" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/sonarlint/issuestore/7/4/74438aca9f4a48488fe204b00a7429cabb247abb" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/sonarlint/issuestore/8/9/899c5b5653c6a42950622470eb34ab3cd5851009" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/sonarlint/issuestore/8/9/899c5b5653c6a42950622470eb34ab3cd5851009" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/sonarlint/issuestore/a/4/a43b6e3feeba3336586237a758acfa97b791be5b" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/sonarlint/issuestore/a/4/a43b6e3feeba3336586237a758acfa97b791be5b" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/sonarlint/issuestore/d/f/df021943680d67b4f49e98599f4bb0e86803c590" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/sonarlint/issuestore/d/f/df021943680d67b4f49e98599f4bb0e86803c590" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/sonarlint/issuestore/e/0/e00232faab93cb27b9940f780c75123903d70b1c" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/sonarlint/issuestore/e/0/e00232faab93cb27b9940f780c75123903d70b1c" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/sonarlint/issuestore/e/7/e7ba402f75a71f1f452cbf16986ed26aa0c6f1b5" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/sonarlint/issuestore/e/7/e7ba402f75a71f1f452cbf16986ed26aa0c6f1b5" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/sonarlint/issuestore/f/d/fdadf7a612307c5bb8e90739949b439a1891d886" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/sonarlint/issuestore/f/d/fdadf7a612307c5bb8e90739949b439a1891d886" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/sonarlint/issuestore/index.pb" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/sonarlint/issuestore/index.pb" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/site/cnkj/common/utils/io/RSAEncrypt.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/site/cnkj/common/utils/io/RSAEncrypt.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/pom.xml" beforeDir="false" afterPath="$PROJECT_DIR$/pom.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/site/cnkj/common/utils/data/KafkaUtil.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/site/cnkj/common/utils/data/KafkaUtil.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/site/cnkj/common/utils/date/DateUtil.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/site/cnkj/common/utils/date/DateUtil.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/site/cnkj/common/utils/system/GracefulShutdown.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/site/cnkj/common/utils/system/GracefulShutdown.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/META-INF/spring-configuration-metadata.json" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/META-INF/spring-configuration-metadata.json" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -370,11 +387,13 @@
<property name="LombokPluginIS_LOMBOK_VERSION_CHECK_Enabled" value="false" />
<property name="LombokPluginIS_MISSING_LOMBOK_CHECK_Enabled" value="true" />
<property name="LombokPluginIS_VAL_Enabled" value="true" />
<property name="RunOnceActivity.OpenProjectViewOnStart" value="true" />
<property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
<property name="SHARE_PROJECT_CONFIGURATION_FILES" value="true" />
<property name="SONARLINT_PRECOMMIT_ANALYSIS" value="true" />
<property name="WebServerToolWindowFactoryState" value="false" />
<property name="aspect.path.notification.shown" value="true" />
<property name="last_opened_file_path" value="$PROJECT_DIR$/../../csgl/hettrmsservice" />
<property name="last_opened_file_path" value="$PROJECT_DIR$" />
<property name="node.js.detected.package.eslint" value="true" />
<property name="node.js.detected.package.standard" value="true" />
<property name="node.js.path.for.package.eslint" value="project" />
@ -403,7 +422,7 @@
<recent name="F:\CommonUtil\repository\site\cnkj\CommonUtil" />
</key>
</component>
<component name="RunManager" selected="Application.CommonApplicationTests">
<component name="RunManager" selected="Application.DateUtil">
<configuration name="CommonApplicationTests" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="site.cnkj.utils.CommonApplicationTests" />
<module name="CommonUtil" />
@ -418,6 +437,20 @@
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration name="DateUtil" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="site.cnkj.common.utils.date.DateUtil" />
<module name="CommonUtil" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<extension name="coverage">
<pattern>
<option name="PATTERN" value="site.cnkj.common.utils.date.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration name="HttpCommonUtil" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="site.cnkj.utils.HttpCommonUtil" />
<module name="CommonUtil" />
@ -487,9 +520,11 @@
<item itemvalue="Application.HttpCommonUtil" />
<item itemvalue="Application.KafkaUtil" />
<item itemvalue="Application.SSH2Util" />
<item itemvalue="Application.DateUtil" />
</list>
<recent_temporary>
<list>
<item itemvalue="Application.DateUtil" />
<item itemvalue="Application.SSH2Util" />
<item itemvalue="Application.KafkaUtil" />
<item itemvalue="Application.HttpCommonUtil" />
@ -503,7 +538,7 @@
</component>
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="52b7c556-aac6-402c-b840-5f2564f1f5d7" name="Default" comment="" />
<changelist id="8ab3ef3f-5475-495f-a0ee-8551c01ff741" name="Changes" comment="change MongoClientInit and fix some bug." />
<created>1574318981558</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
@ -528,6 +563,10 @@
<workItem from="1615862401748" duration="5071000" />
<workItem from="1616492699296" duration="2945000" />
<workItem from="1616556037817" duration="4640000" />
<workItem from="1630984333922" duration="7500000" />
<workItem from="1631697111147" duration="3971000" />
<workItem from="1632885910059" duration="1347000" />
<workItem from="1632966379808" duration="4778000" />
</task>
<task id="LOCAL-00001" summary="repair some lombok questions">
<created>1574320188766</created>
@ -809,7 +848,18 @@
</layout-to-restore>
</component>
<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="1" />
<option name="version" value="3" />
</component>
<component name="Vcs.Log.History.Properties">
<option name="COLUMN_ID_ORDER">
<list>
<option value="Default.Root" />
<option value="Default.Author" />
<option value="Default.Date" />
<option value="Default.Subject" />
<option value="Space.CommitStatus" />
</list>
</option>
</component>
<component name="Vcs.Log.Tabs.Properties">
<option name="TAB_STATES">

View File

@ -7,7 +7,7 @@
<groupId>site.cnkj</groupId>
<artifactId>CommonUtil</artifactId>
<packaging>jar</packaging>
<version>2.0.2</version>
<version>2.0.3</version>
<parent>
<groupId>org.springframework.boot</groupId>

View File

@ -1,13 +1,26 @@
package site.cnkj.common.utils.data;
import com.alibaba.fastjson.JSONObject;
import com.sun.corba.se.spi.orbutil.threadpool.NoSuchWorkQueueException;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.apache.kafka.clients.consumer.ConsumerRecords;
import org.apache.kafka.clients.consumer.KafkaConsumer;
import org.apache.kafka.clients.producer.KafkaProducer;
import org.apache.kafka.clients.producer.ProducerRecord;
import org.apache.kafka.common.KafkaException;
import org.apache.kafka.common.PartitionInfo;
import org.apache.kafka.common.TopicPartition;
import org.apache.kafka.common.errors.AuthorizationException;
import org.apache.kafka.common.errors.IllegalSaslStateException;
import org.apache.kafka.common.errors.OutOfOrderSequenceException;
import org.apache.kafka.common.errors.ProducerFencedException;
import site.cnkj.common.utils.http.HttpCommonUtil;
import site.cnkj.common.utils.logger.LoggerUtil;
import java.time.Duration;
import java.util.*;
import java.util.concurrent.BlockingQueue;
import java.util.stream.Collectors;
/*
* @version 1.0 created by LXW on 2019/11/20 10:20
@ -20,6 +33,52 @@ public class KafkaUtil {
private static final String VALUE_DESERIALIZER = "value.deserializer";
private static final String STRING_DESERIALIZER = "org.apache.kafka.common.serialization.StringDeserializer";
public static boolean producer(Map<String, Object> properties, Object source, String... topics){
KafkaProducer<Object, Object> producer = new KafkaProducer<>(properties);
try {
producer.beginTransaction();
for (String topic : topics) {
ProducerRecord record = new ProducerRecord(topic, source);
producer.send(record);
}
producer.commitTransaction();
} catch (ProducerFencedException | OutOfOrderSequenceException | AuthorizationException e) {
// We can't recover from these exceptions, so our only option is to close the producer and exit.
producer.close();
} catch (KafkaException e) {
// For all other exceptions, just abort the transaction and try again.
producer.abortTransaction();
}
producer.close();
return true;
}
public static void consumer(Map<String, Object> properties, Map<String, ? extends Queue<Object>> sources, long timeout, String... topics) {
List<String> collect = Arrays.stream(topics).collect(Collectors.toList());
for (String topic : collect) {
if (!sources.containsKey(topic)){
throw new NullPointerException("current topic is not exists.topic is: " + topic);
}
}
//构建消费者客户端
KafkaConsumer<String, Object> consumer = new KafkaConsumer<>(properties);
//填充消费监听topic
consumer.subscribe(collect);
while (true){
//消费数据
ConsumerRecords<String, Object> records = consumer.poll(Duration.ofMillis(timeout));
//数据放入队列中
for (ConsumerRecord<String, Object> record : records) {
String topic = record.topic();
Object value = record.value();
boolean offer = sources.get(topic).offer(value);
if (Boolean.FALSE.equals(offer)){
throw new IllegalSaslStateException("current queue size is max.");
}
}
}
}
/**
* 获取当前topic下的全部分区的偏移量信息

View File

@ -631,37 +631,61 @@ public final class DateUtil {
* @param inputFormat 输入日期格式
* @param outputFormat 输出日期格式
* @return 月份区间集合
* @throws Exception e
*/
public static List<String> computerMonth(String startMonth, String endMonth, String inputFormat, String outputFormat) {
List<String> months = new ArrayList<>();
try {
Long startTimestamp = translateDateToTimestamp(startMonth, inputFormat);
Calendar startDate = Calendar.getInstance();
startDate.setTimeInMillis(startTimestamp);
int year = startDate.get(Calendar.YEAR);
int month = startDate.get(Calendar.MONTH) + 1;
Long endTimestamp = translateDateToTimestamp(endMonth, inputFormat);
long currentTimestamp = 0L;
Calendar calendar = Calendar.getInstance();
calendar.clear();
while (true){
calendar.set(Calendar.YEAR, year);
calendar.set(Calendar.MONTH, month - 1);
currentTimestamp = calendar.getTimeInMillis();
if (currentTimestamp > endTimestamp){
break;
}
months.add(translateTimeToDate(currentTimestamp, outputFormat));
month = month + 1;
if (month > 12){
year = year + 1;
month = 1;
}
Long startTimestamp = translateDateToTimestamp(startMonth, inputFormat);
Long endTimestamp = translateDateToTimestamp(endMonth, inputFormat);
if (null == startTimestamp || null == endTimestamp){
throw new NullPointerException("one of startMonth or endMonth parsed resulr is null.");
}
Calendar startDate = Calendar.getInstance();
startDate.setTimeInMillis(startTimestamp);
int year = startDate.get(Calendar.YEAR);
int month = startDate.get(Calendar.MONTH) + 1;
long currentTimestamp;
Calendar calendar = Calendar.getInstance();
calendar.clear();
while (true){
calendar.set(Calendar.YEAR, year);
calendar.set(Calendar.MONTH, month - 1);
currentTimestamp = calendar.getTimeInMillis();
if (currentTimestamp > endTimestamp){
break;
}
months.add(translateTimeToDate(currentTimestamp, outputFormat));
month = month + 1;
if (month > 12){
year = year + 1;
month = 1;
}
}catch (NullPointerException e){
e.printStackTrace();
}
return months;
}
/**
* 计算两个日期之间的天数不包含结束日期当天.
* 如果结束日期小于开始日期则返回负数天数.
*
* @param startDay 开始日期
* @param endDay 结束日期
* @param format 日期格式开始日期和结束日期格式必须保持一致
* @return 天数.
*/
public static long computerDaysBetween(String startDay, String endDay, String format){
Long startTimestamp = translateDateToTimestamp(startDay, format);
Long endTimestamp = translateDateToTimestamp(endDay, format);
if (null != endTimestamp && null != startTimestamp){
long change = endTimestamp - startTimestamp;
return change / (3600 * 24 * 1000);
}
throw new NullPointerException("one of startDay or endDay is null.");
}
public static void main(String[] args) {
long l = computerDaysBetween("20210914", "20210915", FORMAT_ENUM.NOSEGMENTATION_yMd.value);
System.out.println(l);
}
}

View File

@ -33,7 +33,7 @@ public class GracefulShutdown implements TomcatConnectorCustomizer, ApplicationL
// 指定执行的方法
shutdown();
//手动清理内存
System.gc();
Runtime.getRuntime().gc();
LOGGER.warn("清理内存完毕,正在退出服务......");
if (this.connector == null){
return;
@ -42,20 +42,18 @@ public class GracefulShutdown implements TomcatConnectorCustomizer, ApplicationL
LOGGER.warn("关闭全部连接......");
Executor executor = this.connector.getProtocolHandler().getExecutor();
if (executor instanceof ThreadPoolExecutor) {
try {
ThreadPoolExecutor threadPoolExecutor = (ThreadPoolExecutor) executor;
threadPoolExecutor.shutdown();
LOGGER.warn("当前服务线程池被关闭");
if (!threadPoolExecutor.awaitTermination(30, TimeUnit.SECONDS)) {
LOGGER.warn("Tomcat thread pool did not shut down gracefully within 30 seconds. Proceeding with forceful shutdown");
}
} catch (InterruptedException ex) {
Thread.currentThread().interrupt();
ThreadPoolExecutor threadPoolExecutor = (ThreadPoolExecutor) executor;
threadPoolExecutor.shutdown();
LOGGER.warn("当前服务线程池被关闭");
if (!threadPoolExecutor.awaitTermination(30, TimeUnit.SECONDS)) {
LOGGER.warn("Tomcat thread pool did not shut down gracefully within 30 seconds. Proceeding with forceful shutdown");
}
}
this.connector.stop();
} catch (LifecycleException e) {
e.printStackTrace();
} catch (InterruptedException ex) {
Thread.currentThread().interrupt();
}
}
@ -78,5 +76,7 @@ public class GracefulShutdown implements TomcatConnectorCustomizer, ApplicationL
* 2.flush内存中全部的未处理数据
* 3.清理服务中全部待处理的数据
*/
public void shutdown(){}
public void shutdown(){
//do something
}
}