Compare commits
547 Commits
v1.0.1
...
full-lates
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4784a8d991 | ||
|
|
2c1297430b | ||
|
|
9de02903aa | ||
|
|
0fad018101 | ||
|
|
55ca2a2e43 | ||
|
|
d5300d4d76 | ||
|
|
802972abd2 | ||
|
|
57d560b9ec | ||
|
|
26c0f83bad | ||
|
|
e8394fac8e | ||
|
|
6769fdaa59 | ||
|
|
f5d32c6114 | ||
|
|
bdeab06d6c | ||
|
|
6f24c765ff | ||
|
|
b31104112c | ||
|
|
888a2106de | ||
|
|
feebc250d7 | ||
|
|
efa2538736 | ||
|
|
8b1fb129ce | ||
|
|
c28b7a7585 | ||
|
|
abcec4c846 | ||
|
|
2c66ad1b1a | ||
|
|
7597bdc52e | ||
|
|
84742639db | ||
|
|
5a25be99cb | ||
|
|
346c63d55f | ||
|
|
de11195aa9 | ||
|
|
252d8d23e1 | ||
|
|
75577350ba | ||
|
|
66904f0bb4 | ||
|
|
eda883a9bf | ||
|
|
35b4e2806b | ||
|
|
221e38f28a | ||
|
|
4a93ad5f48 | ||
|
|
84d94917e5 | ||
|
|
7e85a55f67 | ||
|
|
371c5a4ad4 | ||
|
|
fdb01114e3 | ||
|
|
ffbbe33a9f | ||
|
|
76e820d660 | ||
|
|
e393a71a93 | ||
|
|
90b8b117c4 | ||
|
|
8b3d86b18e | ||
|
|
718939e59b | ||
|
|
0fa8c58c7e | ||
|
|
effff9a723 | ||
|
|
a9cabd9ffe | ||
|
|
a679130a93 | ||
|
|
355b80c438 | ||
|
|
1cb19841a8 | ||
|
|
ea49f9d181 | ||
|
|
901a165fb1 | ||
|
|
98e8bccf3d | ||
|
|
65a52de3f2 | ||
|
|
55b042c6d8 | ||
|
|
931a71c54f | ||
|
|
d27c2b57d1 | ||
|
|
9fa5c8e6a5 | ||
|
|
1dd7dd0975 | ||
|
|
86af800f13 | ||
|
|
edf024fe1c | ||
|
|
f939fc5164 | ||
|
|
c85e9b1865 | ||
|
|
62e235f206 | ||
|
|
4da877e911 | ||
|
|
d574f5c8de | ||
|
|
f7773e2ec6 | ||
|
|
49d697347a | ||
|
|
80c9299532 | ||
|
|
705c2499db | ||
|
|
d03a1fa746 | ||
|
|
3211aa98f1 | ||
|
|
4f4b976b5b | ||
|
|
03848fd2d0 | ||
|
|
8facbf5fa0 | ||
|
|
9f11339b7c | ||
|
|
b7595dc766 | ||
|
|
814fde5ab5 | ||
|
|
270886a3ab | ||
|
|
87e41e91c1 | ||
|
|
a9e1766b05 | ||
|
|
9e68547cfb | ||
|
|
cd9a87b7df | ||
|
|
9e063e280c | ||
|
|
a95c1a2be1 | ||
|
|
5699d614df | ||
|
|
9dfabe54ce | ||
|
|
6e4b226a46 | ||
|
|
76c8b83284 | ||
|
|
289a42b7d4 | ||
|
|
5093b0eea6 | ||
|
|
00e3a4492d | ||
|
|
8839afb0e8 | ||
|
|
e456d4e95e | ||
|
|
960eccd165 | ||
|
|
a02aa870ae | ||
|
|
6642ba24cc | ||
|
|
f74e53c7ea | ||
|
|
98aa22f6a6 | ||
|
|
aaaa8b4e4d | ||
|
|
093b1b5b82 | ||
|
|
114d224cbf | ||
|
|
41b1426132 | ||
|
|
f70a863b62 | ||
|
|
2c80f3a894 | ||
|
|
6a458e8136 | ||
|
|
eb00388b6c | ||
|
|
91bd860440 | ||
|
|
4354e1e388 | ||
|
|
43be458728 | ||
|
|
ff2591adaa | ||
|
|
8fc9770e6d | ||
|
|
6d3df324ed | ||
|
|
be8dae345c | ||
|
|
d2ff37c7f6 | ||
|
|
f95ca14ec8 | ||
|
|
5b01d3274a | ||
|
|
d6d3d61bdd | ||
|
|
12599ff4db | ||
|
|
2f0b06a541 | ||
|
|
e257cec3b6 | ||
|
|
300c0b75fe | ||
|
|
e495588dae | ||
|
|
269b55d870 | ||
|
|
27c06ce748 | ||
|
|
79c73438da | ||
|
|
353bc4ae97 | ||
|
|
4b0ec31e6f | ||
|
|
8f48484725 | ||
|
|
6d744d6304 | ||
|
|
2ac461d3e1 | ||
|
|
fcc8b9e47b | ||
|
|
be668d9441 | ||
|
|
674de356e7 | ||
|
|
a819a8df59 | ||
|
|
76307b05b3 | ||
|
|
07d86c8ae0 | ||
|
|
accfbf81f1 | ||
|
|
ddaf23158d | ||
|
|
32259be29f | ||
|
|
fdd9683a7f | ||
|
|
d8ea5c34ec | ||
|
|
17c0531c6b | ||
|
|
f8118067e5 | ||
|
|
e5b7e68cb0 | ||
|
|
1da583ad3d | ||
|
|
65277168bb | ||
|
|
bcf675943c | ||
|
|
b2d5a86da6 | ||
|
|
852727b3ad | ||
|
|
6aec6ce8d6 | ||
|
|
41a3760b2a | ||
|
|
f8efca5ee0 | ||
|
|
1ae0e92c10 | ||
|
|
9d54140617 | ||
|
|
c04e322f7c | ||
|
|
679eca9196 | ||
|
|
06cac2b034 | ||
|
|
704d6c73b4 | ||
|
|
9b7804511e | ||
|
|
e4313007fb | ||
|
|
67341e3e92 | ||
|
|
a7eaa4dd4b | ||
|
|
84f63adcbc | ||
|
|
52167fbaa8 | ||
|
|
256fd812c9 | ||
|
|
ef31ebe52b | ||
|
|
6f68f65e9d | ||
|
|
ad9d66cee1 | ||
|
|
848ce44b34 | ||
|
|
584fa48d0d | ||
|
|
683585c527 | ||
|
|
b2740605b0 | ||
|
|
f599a293fa | ||
|
|
d8b400189b | ||
|
|
adfd8b24e6 | ||
|
|
e4920791b7 | ||
|
|
299b26579d | ||
|
|
5b39cfe2f1 | ||
|
|
8689918837 | ||
|
|
b9a1a33c4e | ||
|
|
602a9cc55c | ||
|
|
d29068bb9c | ||
|
|
b8068ef29e | ||
|
|
bc28320565 | ||
|
|
c805465684 | ||
|
|
e54d4972e1 | ||
|
|
1c4230e2d1 | ||
|
|
dec28158d2 | ||
|
|
717d3f39f0 | ||
|
|
78044ce920 | ||
|
|
e45b63077a | ||
|
|
b8dcdf93a1 | ||
|
|
fe1da585ac | ||
|
|
3829a438e2 | ||
|
|
d5636c89dd | ||
|
|
458f17f4ac | ||
|
|
9e9c0870ce | ||
|
|
1451aff28b | ||
|
|
b9eaab37a9 | ||
|
|
bddae36b2b | ||
|
|
3b993205fb | ||
|
|
95ca90a271 | ||
|
|
c4f024cfad | ||
|
|
d57289ab60 | ||
|
|
ab4f2787f9 | ||
|
|
e6ac78b91e | ||
|
|
f60b59b4ca | ||
|
|
f16950d1ee | ||
|
|
d3e3fbd529 | ||
|
|
d0e69ef184 | ||
|
|
f7cfce0bd8 | ||
|
|
c62d733869 | ||
|
|
e82937297b | ||
|
|
ad1aa476a4 | ||
|
|
b11231a940 | ||
|
|
fb8cacf74b | ||
|
|
30f4ab7c81 | ||
|
|
df8cc2429e | ||
|
|
d1dddf4ea8 | ||
|
|
0c4dcf467e | ||
|
|
6d2101837d | ||
|
|
2b5d276afa | ||
|
|
93ef472ea0 | ||
|
|
db6ead2264 | ||
|
|
9500f810af | ||
|
|
27cef1077b | ||
|
|
7cb77d7bda | ||
|
|
b54fa29587 | ||
|
|
77ac039168 | ||
|
|
4a142cee31 | ||
|
|
cb3356fb92 | ||
|
|
7aad6bf185 | ||
|
|
bffcd61b7e | ||
|
|
11456bd3b7 | ||
|
|
5bb604ebe3 | ||
|
|
c13fb2cae4 | ||
|
|
24f7eb10d0 | ||
|
|
14a3eb0c2c | ||
|
|
551a7079ec | ||
|
|
ec6e31e7c5 | ||
|
|
d2705f0313 | ||
|
|
74b1b417ad | ||
|
|
bc7ae4fc67 | ||
|
|
990c2379ff | ||
|
|
208826df62 | ||
|
|
7ce74938e8 | ||
|
|
7110ce45cc | ||
|
|
956b3b7c19 | ||
|
|
45b44a7d13 | ||
|
|
b7edfe5aa8 | ||
|
|
9a60cfe6e3 | ||
|
|
0821d59437 | ||
|
|
aaf3c811a8 | ||
|
|
8b81f78b29 | ||
|
|
e2a8c46afb | ||
|
|
c176bd7577 | ||
|
|
ab92d6958b | ||
|
|
bca4ba34e1 | ||
|
|
52a01581d4 | ||
|
|
9dfb8f9ac6 | ||
|
|
a2553097bd | ||
|
|
6eda8f48c7 | ||
|
|
1c747054bb | ||
|
|
189e96ff42 | ||
|
|
928c79b747 | ||
|
|
ffa6d669ba | ||
|
|
f86ad19afd | ||
|
|
52dce6338f | ||
|
|
22a73b445a | ||
|
|
af645464e4 | ||
|
|
66a6378056 | ||
|
|
865c14d95b | ||
|
|
f587f7c54b | ||
|
|
91aef6f9f4 | ||
|
|
4408525b45 | ||
|
|
aae8a9994a | ||
|
|
f9fb9c2f70 | ||
|
|
b32c9a8f9e | ||
|
|
80d525b735 | ||
|
|
b432e9fa17 | ||
|
|
ce84b4fee9 | ||
|
|
08df1de2e6 | ||
|
|
085b76f4b4 | ||
|
|
5bdf1ec0c6 | ||
|
|
157d06bf8d | ||
|
|
1ba75d3e29 | ||
|
|
4254f73603 | ||
|
|
cabc693119 | ||
|
|
265ad08d3e | ||
|
|
92ac2261be | ||
|
|
8c6314de27 | ||
|
|
2f1770dcbc | ||
|
|
339a29e739 | ||
|
|
4487c138b2 | ||
|
|
e99fe3bf65 | ||
|
|
42ad4916a0 | ||
|
|
e07cef459d | ||
|
|
95f0e26f82 | ||
|
|
d3ed4e8334 | ||
|
|
7b4c1ae455 | ||
|
|
9fcdfb7758 | ||
|
|
c8f570fa6a | ||
|
|
59ecaf4477 | ||
|
|
3a695ebd1a | ||
|
|
395090e958 | ||
|
|
1d999710bb | ||
|
|
2632fbe1e4 | ||
|
|
7e57dbaade | ||
|
|
5cb267fba6 | ||
|
|
9267aed477 | ||
|
|
28bcbfd379 | ||
|
|
59764b69b8 | ||
|
|
b82f6ae2e0 | ||
|
|
27c0d8e50a | ||
|
|
04b4794f92 | ||
|
|
3b2abbf19f | ||
|
|
fa725edd90 | ||
|
|
c05bc7be80 | ||
|
|
74d5de9c7f | ||
|
|
1dece8845d | ||
|
|
51f74f60c3 | ||
|
|
83ca189598 | ||
|
|
862d637075 | ||
|
|
7942262eef | ||
|
|
783de18e50 | ||
|
|
3e673c14b7 | ||
|
|
1d5c57d516 | ||
|
|
eda81c36bc | ||
|
|
3d774f43bb | ||
|
|
e509431340 | ||
|
|
77ff6722ab | ||
|
|
ddbadcd1e8 | ||
|
|
03dff7620e | ||
|
|
6da66fac7c | ||
|
|
5abe56caad | ||
|
|
a30d9318da | ||
|
|
da9146f75f | ||
|
|
01ab1d6079 | ||
|
|
1d5e0e2bf1 | ||
|
|
dcbb2b4ac8 | ||
|
|
b1fefdeba7 | ||
|
|
694f847f1d | ||
|
|
9e3f479b3e | ||
|
|
40a3db911d | ||
|
|
50a1f794c2 | ||
|
|
089fab958d | ||
|
|
c56613bc63 | ||
|
|
206f410573 | ||
|
|
9992ca9183 | ||
|
|
8fa04b9973 | ||
|
|
dcf487d55c | ||
|
|
477fef11d3 | ||
|
|
ff5434a173 | ||
|
|
da5e0e5017 | ||
|
|
09d6ccca57 | ||
|
|
2fab0d6a80 | ||
|
|
4dec5b73f4 | ||
|
|
58976dc829 | ||
|
|
744e877309 | ||
|
|
f270a9bb12 | ||
|
|
e0e59cc82e | ||
|
|
a153809649 | ||
|
|
13d6f3ca8b | ||
|
|
8a3f40c394 | ||
|
|
b252eeb33b | ||
|
|
91e7b0eb33 | ||
|
|
7c8a1e7ebc | ||
|
|
0f72acc973 | ||
|
|
e66586c765 | ||
|
|
e949570c1a | ||
|
|
6cb2d76bfb | ||
|
|
2dfb089665 | ||
|
|
911410027d | ||
|
|
861762e005 | ||
|
|
8b106c4588 | ||
|
|
8767acf080 | ||
|
|
3fbc7e5b38 | ||
|
|
b7654611c7 | ||
|
|
64572e52ef | ||
|
|
bd2d08c9ff | ||
|
|
b8a1c8554e | ||
|
|
2e37d4db44 | ||
|
|
a5fcdea2fa | ||
|
|
dfb1e62074 | ||
|
|
d1918b14e2 | ||
|
|
7285947cb3 | ||
|
|
95ec165d49 | ||
|
|
e0289aa247 | ||
|
|
ccf4196f0e | ||
|
|
3048d203ff | ||
|
|
cec0e2d5c8 | ||
|
|
38b04972b6 | ||
|
|
974793cdff | ||
|
|
b05c2158de | ||
|
|
7405d3d711 | ||
|
|
23461e7337 | ||
|
|
d0fa28eebe | ||
|
|
08bdaabcf5 | ||
|
|
f602ccf2a4 | ||
|
|
942b25e9ce | ||
|
|
a01699bd12 | ||
|
|
5cd766762a | ||
|
|
85bbfd1233 | ||
|
|
a8d74a348a | ||
|
|
da5188d840 | ||
|
|
96079c8fa1 | ||
|
|
44ebfbf554 | ||
|
|
6d2e24f455 | ||
|
|
e281b5d47d | ||
|
|
c98c3f1209 | ||
|
|
842b19a378 | ||
|
|
fbfede7663 | ||
|
|
1dd6588d63 | ||
|
|
cb7cce2b98 | ||
|
|
1abcc4f92e | ||
|
|
0451b9319c | ||
|
|
c9e57ba84a | ||
|
|
74d1c06561 | ||
|
|
61f4c316d8 | ||
|
|
39783b3467 | ||
|
|
fad50328b6 | ||
|
|
61938a840f | ||
|
|
cafe72fcc2 | ||
|
|
0965f44866 | ||
|
|
2d9a5ab6b6 | ||
|
|
13ddbc05ee | ||
|
|
ba29b57a14 | ||
|
|
88686f84f4 | ||
|
|
adadffa0cd | ||
|
|
33229dd85a | ||
|
|
c64be60263 | ||
|
|
c89f3696ea | ||
|
|
18d8105344 | ||
|
|
fb38b86b82 | ||
|
|
aeb48e0144 | ||
|
|
713582bebf | ||
|
|
0cf04e8466 | ||
|
|
e923156735 | ||
|
|
7712c52f1b | ||
|
|
5300348552 | ||
|
|
211eafaeed | ||
|
|
d87d4a7f70 | ||
|
|
c8923a7cf2 | ||
|
|
8987cca924 | ||
|
|
6b54a87470 | ||
|
|
5300ad8d12 | ||
|
|
f57de18d55 | ||
|
|
1537a67a50 | ||
|
|
53eee3a956 | ||
|
|
d7c94d0149 | ||
|
|
aebc6d2d8b | ||
|
|
9b4decf68a | ||
|
|
85bad69784 | ||
|
|
9c00186f88 | ||
|
|
f69cf40c7a | ||
|
|
7f15b7e23e | ||
|
|
93e6575a18 | ||
|
|
c4ccaa20ca | ||
|
|
abc24b424f | ||
|
|
9c29f4c8fd | ||
|
|
6f38aed1ae | ||
|
|
38e1f28305 | ||
|
|
04f36bf3ad | ||
|
|
63f6b80b79 | ||
|
|
cbaee753cb | ||
|
|
607a97b51b | ||
|
|
6c2141e8b8 | ||
|
|
f5e45b776b | ||
|
|
ec9674441f | ||
|
|
48e4a73ea9 | ||
|
|
76b18edc87 | ||
|
|
1f7cd7ad6c | ||
|
|
f0920be5a5 | ||
|
|
b62b521129 | ||
|
|
7f9e2c790b | ||
|
|
93f859bcbe | ||
|
|
4d6b09d640 | ||
|
|
2c11dbdcf0 | ||
|
|
26b700fde3 | ||
|
|
f9173925ab | ||
|
|
883540488b | ||
|
|
fadf52cec8 | ||
|
|
116e04e3bf | ||
|
|
9d7149aa04 | ||
|
|
fc02414519 | ||
|
|
417132d25c | ||
|
|
fb5438e1ec | ||
|
|
25036fb197 | ||
|
|
5084b4ce6a | ||
|
|
bf2bf47f53 | ||
|
|
cfb954854f | ||
|
|
f03c8a03ac | ||
|
|
7aa1108270 | ||
|
|
a081443c91 | ||
|
|
9a50db6b5d | ||
|
|
02a56bc6b5 | ||
|
|
1b706019cd | ||
|
|
67c6ffc877 | ||
|
|
6c1f4e123a | ||
|
|
e3ed105f49 | ||
|
|
0214934b1f | ||
|
|
dc4d1e1c65 | ||
|
|
a147d389da | ||
|
|
95ffa30c12 | ||
|
|
17c123003f | ||
|
|
817ae4d3fc | ||
|
|
0a31c4ee4b | ||
|
|
1babdb56ec | ||
|
|
4096def6b3 | ||
|
|
440123aed2 | ||
|
|
bdc8e7a959 | ||
|
|
242ca36a7a | ||
|
|
49c1929746 | ||
|
|
9d6ab9e159 | ||
|
|
eb7112b956 | ||
|
|
f144e77035 | ||
|
|
968bbb5f5a | ||
|
|
65dd754580 | ||
|
|
1f57b0d478 | ||
|
|
23d4dc5ec3 | ||
|
|
031ea4f199 | ||
|
|
29586f35d7 | ||
|
|
f83c27882f | ||
|
|
fbd6ef5f83 | ||
|
|
89b32304bd | ||
|
|
0f9f909d73 | ||
|
|
994ced47bc | ||
|
|
40f594f1ff | ||
|
|
8a94b6e426 | ||
|
|
f975e23cd8 | ||
|
|
dc93ea4395 | ||
|
|
c1adc111a1 | ||
|
|
5fffa51171 | ||
|
|
a61b100768 | ||
|
|
494149fad2 | ||
|
|
f9d53da7fe | ||
|
|
605c97347d | ||
|
|
96d081fdae | ||
|
|
49189587ce | ||
|
|
48f81dc547 | ||
|
|
7f4f3fd432 | ||
|
|
f5249f39e1 | ||
|
|
c3b3b60d93 | ||
|
|
25b4089a8f | ||
|
|
13e390535d | ||
|
|
d406b52d6a |
73
.gitignore
vendored
73
.gitignore
vendored
@@ -1,5 +1,70 @@
|
||||
# Created by .ignore support plugin (hsz.mobi)
|
||||
.idea
|
||||
*.iml
|
||||
|
||||
tmlog*.lck
|
||||
tmlog*.log
|
||||
dependency-reduced-pom.xml
|
||||
|
||||
/dist
|
||||
|
||||
######################################################################
|
||||
# Build Tools
|
||||
|
||||
.gradle
|
||||
/build/
|
||||
!gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
target/
|
||||
!.mvn/wrapper/maven-wrapper.jar
|
||||
|
||||
######################################################################
|
||||
# IDE
|
||||
|
||||
### STS ###
|
||||
.apt_generated
|
||||
.classpath
|
||||
.factorypath
|
||||
.project
|
||||
.settings
|
||||
.springBeans
|
||||
|
||||
### IntelliJ IDEA ###
|
||||
.idea
|
||||
*.iws
|
||||
*.iml
|
||||
*.ipr
|
||||
|
||||
### NetBeans ###
|
||||
nbproject/private/
|
||||
build/*
|
||||
nbbuild/
|
||||
zyplayer-doc-ui/dist/
|
||||
nbdist/
|
||||
.nb-gradle/
|
||||
|
||||
######################################################################
|
||||
# Others
|
||||
*.log
|
||||
*.xml.versionsBackup
|
||||
|
||||
!*/build/*.java
|
||||
!*/build/*.html
|
||||
!*/build/*.xml
|
||||
|
||||
### VS Code ###
|
||||
.vscode/
|
||||
|
||||
# rebel
|
||||
rebel.xml
|
||||
|
||||
### gradle构建 ###
|
||||
*.gradle
|
||||
|
||||
### office ###
|
||||
# 忽略office文件打开临时文件 #
|
||||
[~$]*.*
|
||||
tmlog.lck
|
||||
/.metadata/
|
||||
zyplayer-doc-data/bin
|
||||
zyplayer-doc-api/bin
|
||||
zyplayer-doc-core/bin
|
||||
zyplayer-doc-data/src/main/java/com/zyplayer/.metadata/
|
||||
zyplayer-doc-db/bin/
|
||||
zyplayer-doc-wiki/bin/
|
||||
184
README.md
184
README.md
@@ -1,122 +1,128 @@
|
||||
# zyplayer-doc
|
||||
<p align="center">
|
||||
<img src="https://gitee.com/dromara/zyplayer-doc/raw/master/zyplayer-doc-other/resource/logo.png">
|
||||
</p>
|
||||
|
||||
#### 项目介绍
|
||||
定位为所有文档的管理项目,swagger文档、dubbo文档、数据库文档....等,提供一整套的解决方案,为开发者服务,欢迎有想法的一起来写,给个Star鼓励下呗!(您的一个Star是快速迭代的动力源泉!)
|
||||
欢迎加群讨论,QQ群号:466363173
|
||||
<h1 align="center">zyplayer-doc</h1>
|
||||
|
||||
体验地址:[http://doc.zyplayer.com](http://doc.zyplayer.com/zyplayer-doc-manage/static/manage/home.html) 需登录 账号:zyplayer 密码:123456 (未运行dubbo服务,不能体验dubbo文档调试)
|
||||
<p align="center">专注于私有化部署的在线知识库管理平台</p>
|
||||
|
||||
开放文档地址:[http://doc.zyplayer.com/zyplayer-doc-manage/open-wiki.html?pageId=1&space=23f3f59a60824d21af9f7c3bbc9bc3cb](http://doc.zyplayer.com/zyplayer-doc-manage/open-wiki.html?pageId=1&space=23f3f59a60824d21af9f7c3bbc9bc3cb) (无需登录)
|
||||
# 项目简介
|
||||
zyplayer-doc是一款适合团队和个人私有化部署使用的WIKI文档管理工具,同时还包含数据库管理、Api接口管理等模块。
|
||||
|
||||
#### 软件架构
|
||||
##### 一、zyplayer-doc-core 一些核心、公用的类
|
||||
适合作为公司内部或个人的知识库、笔记、文档管理工具,将文档发布成对外可访问的形式,可作为公司的产品文档、帮助文档等。
|
||||
|
||||
##### 二、zyplayer-doc-db 数据库文档
|
||||
> 原[zyplayer-doc-db](https://gitee.com/zyplayer/zyplayer-doc-db),具有数据库文档的查看、管理、导出等功能
|
||||
体验地址:[http://zyplayer.com](http://zyplayer.com)
|
||||
|
||||
##### 三、zyplayer-doc-manage 可以单独部署的文档管理后台
|
||||
> 后端使用spring-boot、mybatis-plus、springfox-swagger等框架,前端使用[zui](http://zui.sexy/)、[Vue](https://cn.vuejs.org/)、[element-ui](http://element-cn.eleme.io)等框架
|
||||
在线文档:[http://doc.zyplayer.com](http://doc.zyplayer.com)
|
||||
|
||||
> 已集成三套优秀swagger文档前端:[zyplayer-doc-swagger](https://gitee.com/zyplayer/zyplayer-doc)、[swagger-bootstrap-ui](https://gitee.com/xiaoym/swagger-bootstrap-ui)、[springfox-swagger-ui](https://github.com/springfox/springfox/tree/master/springfox-swagger-ui)
|
||||
欢迎有想法的同学一起来完善,如果觉得不错就给个Star鼓励下呗!作为给项目快速更新的动力!
|
||||
|
||||
> 已集成[zyplayer-doc-db](https://gitee.com/zyplayer/zyplayer-doc)数据库文档
|
||||
欢迎加入微信群与我们一起交流
|
||||
> 微信群员超过限制只能加好友拉进群,添加微信好友,回复:`加群` 即可
|
||||
|
||||
##### 四、zyplayer-doc-swagger 原[swagger-mg-ui](https://gitee.com/zyplayer/swagger-mg-ui),swagger的UI及整套解决方案
|
||||
> 具有 后端存储、代理请求、模拟返回、所有文档管理 等一系列原创功能,不止UI
|
||||

|
||||
|
||||
##### 五、zyplayer-doc-dubbo 将dubbo的文档在线化管理
|
||||
> 支持zookeeper、nacos的注册中心文档获取,支持在线调试接口
|
||||
# 快速启动
|
||||
## 相关依赖
|
||||
启动本系统仅依赖JAVA和MySQL
|
||||
- JAVA 1.8+
|
||||
- MySQL 5.7.x、8.x
|
||||
|
||||
##### 六、zyplayer-doc-wiki wiki文档工具
|
||||
> 支持文档创建、展示,文件上传、下载,空间隔离,开放文档访问等
|
||||
数据库安装成功后,需要您**手动创建**一个库:`zyplayer_doc`
|
||||
|
||||
##### 七、zyplayer-doc-grpc grpc文档工具
|
||||
> 用比较变态的方式实现了grpc的文档和在线调试功能,通过http的方式来请求grpc的接口
|
||||
```sql
|
||||
-- 建库语句
|
||||
create database zyplayer_doc;
|
||||
```
|
||||
|
||||
> 默认未开启此功能,如需使用需要在zyplayer-doc-manage项目中开启@EnableDocGrpc注解
|
||||
> 建表SQL脚本无需手动执行,每次启动或更新之后都会检查当前版本,然后自动执行升级SQL脚本,所以每次有版本更新需求只需要下载最新版本启动即可,无需其他特殊操作
|
||||
|
||||
#### 运行方式
|
||||
## 宝塔面板一键部署
|
||||
- 安装宝塔面板,前往[宝塔面板](https://www.bt.cn/u/2OCdV3)官网,选择对应的脚本下载安装,宝塔版本:`9.2.0+`
|
||||
- 登录宝塔面板,在菜单栏中点击 Docker,根据提示安装 Docker 和 Docker Compose 服务,若已有则跳过
|
||||
- 在Docker-应用商店查询到 zyplayer-doc,点击安装
|
||||
- 设置域名等基本信息,点击确定
|
||||
- 提交后面板会自动进行应用初始化,大概需要1-5分钟,初始化完成后即可访问。
|
||||

|
||||
|
||||
1. 创建数据库:zyplayer_doc_manage,执行脚本:[zyplayer_doc_manage.1.0.1.sql](https://gitee.com/zyplayer/zyplayer-doc/blob/master/zyplayer-doc-manage/src/main/resources/sql/zyplayer_doc_manage.1.0.1.sql)
|
||||
## Main方法启动
|
||||
1. 修改`zyplayer-doc-manage/src/main/resources/application.yml`配置文件里面的数据库账号密码
|
||||
2. 执行`com.zyplayer.doc.manage.Application.main`方法启动项目
|
||||
|
||||
2. 修改zyplayer-doc-manage项目的application.yml配置文件里面的数据库账号密码
|
||||
## JAR方式启动
|
||||
1. 直接下载:直接下载编译好的jar打包文件,编译后的最新版可到 [发行版下载处](https://gitee.com/dromara/zyplayer-doc/releases) 去下载
|
||||
2. 自行编译:也可以自己动手编译,双击执行:`zyplayer-doc\build.bat`,将使用maven编译整个项目为可执行的jar文件,编译结果文件放在:`zyplayer-doc\dist\version`文件夹下
|
||||
3. 修改第一步或第二步结果文件夹下的`application.yml`文件里面数据库帐号密码
|
||||
4. 双击第一步或第二步结果文件夹下的`startup.bat`启动项目
|
||||
|
||||
3. 启动zyplayer-doc-manage项目,访问地址:
|
||||
http://127.0.0.1:8082/zyplayer-doc-manage/static/manage/home.html
|
||||
未登录会进入登录页面,登陆后自动跳回,默认账号:zyplayer 密码:123456
|
||||
> 注意!!项目页面全是静态的html,如果使用idea启动,有可能访问不了静态页面,需要在这里配置下工作目录,然后重新启动即可
|
||||

|
||||
## Tomcat容器启动
|
||||
1. 直接下载编译好的war打包文件,编译后的最新版可到 [发行版下载处](https://gitee.com/dromara/zyplayer-doc/releases) 去下载
|
||||
2. 修改配置文件:`zyplayer-doc.zip\apache-tomcat\webapps\zyplayer-doc\WEB-INF\classes\application.yml`配置文件里面的数据库账号密码
|
||||
3. 双击`tomcat\bin\startup.bat`启动即可
|
||||
|
||||
#### 功能介绍
|
||||
## 其他
|
||||
更多启动方式请参考文档:[项目下载与部署](http://doc.zyplayer.com/#/integrate/zyplayer-doc/opensource/279)
|
||||
|
||||
##### 一、zyplayer-doc-swagger
|
||||
1. 在 `zyplayer-doc-swagger`->`文档管理`->`文档地址管理` 页可以管理`任意地址`的文档,在集成的三套UI中都可以直接查看和调试这里配置的文档,不用对UI做任何调整,只要标准的UI集成进来也可以直接用
|
||||
启动后访问:[http://127.0.0.1:8083](http://127.0.0.1:8083) ,默认登录账号: **zyplayer** 密码: **123456**
|
||||
|
||||
2. 文档展示配置,`自动填充请求参数`:可配置填充级别,`强制重写域名`:文档在本地想调试线上接口的好帮手,`自动保存请求参数`:不用每次输入
|
||||
# 各模块介绍
|
||||
## zyplayer-doc-manage 文档管理后台
|
||||
1. 具有项目模块导航,人员及权限管理功能,分组管理等功能。
|
||||
2. 集成了本项目内的各个子模块功能,是各模块的协调管理模块。
|
||||
|
||||
3. 可配置`全局参数`,放在header或param里的
|
||||
## zyplayer-doc-wiki wiki文档工具
|
||||
1. 在线管理公司、项目及任意形式的文档
|
||||
2. 文档支持按空间划分,按人员分组授权,支持空间收藏和空间内的文档开放访问。
|
||||
3. 文档支持编辑、查看、评论、上传附件、历史版本查看、页面权限控制、文档搜索等功能。
|
||||
4. 文档编辑支持html富文本方式编辑和markdown的方式编辑。
|
||||
5. 本工具使用的开源工具有:vue、element-ui、mavon-editor、wangeditor等。
|
||||
6. 参考学习了Atlassian Confluence文档工具进行开发,争取作为该软件的开源免费替代产品,同时作为内部文档管理工具最好的存在。
|
||||
|
||||
4. 可对`调试数据`进行管理
|
||||
## zyplayer-doc-db 数据库工具
|
||||
一款在线管理数据库的工具,你可以将所有的数据源统一管理到这里面,团队间的各成员就不必每人在自己电脑上装一个数据库管理软件,
|
||||
然后再添加数据源,可以统一修改数据库账号密码而不用群广播通知,新员工进入后对他使用到的数据源进行授权即可使用。
|
||||
|
||||
5. `模拟返回`:前端自行调试接口的好帮手
|
||||
1. 支持MySQL、Doris(MySQL协议)、SQLServer、Oracle、达梦、PostgreSQL、Hive、Impala数据源。
|
||||
2. 支持数据库表、字段文档查看修改,表文档导出、建表语句DDL导出、表数据导出。
|
||||
3. 支持SQL执行、表数据预览、不同数据库之间的数据互导,支持多数据源管理。
|
||||
4. 支持按人员、按数据源对用户授权,可给用户 库表注释查看、注释修改、SQL执行、函数修改等粒度的授权。
|
||||
5. 支持库函数和存储过程的增删改查,修改记录查询等。
|
||||
6. 目标是取代Navicat,做一个小而精的开源免费的在线数据库管理工具。
|
||||
|
||||
6. 私人强迫症级定制化文档展示,清晰明了,参数支持批量编辑,每一条线的间距都考量了半天,支持`文件上传`的调试,需要指定dataType = `File`或`MultipartFile`,例:
|
||||
## zyplayer-doc-api API接口文档管理工具
|
||||
一款支持统一管理Swagger文档、OpenApi文档、自建接口文档的管理工具,具有文档查看、接口请求、全局参数管理等功能,设计走心,前端代码使用最新技术构建,每一行代码都是全新手动敲出来的,超级简单明了,代码简洁美观可读性好、易维护。
|
||||
|
||||
@ApiImplicitParam(name = "file", value = "文件", dataType = "File", allowMultiple = true)
|
||||
1. 支持Swagger的文档展示,接口调试,解析速度快,界面设计走心。
|
||||
2. 支持将所有的Swagger文档、OpenApi文档、自建接口文档进行统一管理,支持全局参数设置,请求参数缓存,下次自动填充等。
|
||||
3. 目标是实现一个平台解决所有项目的接口文档统一管理。
|
||||
|
||||
7. 后端代理请求,后端存储,不会存在任何跨域问题
|
||||
## 其他
|
||||
1. zyplayer-doc-ui 前面各模块的前端UI源码
|
||||
2. zyplayer-doc-core 一些核心、公用的类
|
||||
3. zyplayer-doc-data 数据库层面的交互
|
||||
5. zyplayer-doc-other 一些测试
|
||||
|
||||
##### 二、zyplayer-doc-db
|
||||
1. 支持Mysql、SQLserver的数据库表、字段文档查看修改,导出,展示关系图等功能
|
||||
# 用爱发电
|
||||
如果您正在使用这个项目并感觉良好,或者是想支持项目继续开发,您可以通过如下`任意`方式支持我们:
|
||||
1. Star并分享 [zyplayer-doc](https://gitee.com/zyplayer/zyplayer-doc)
|
||||
2. 保留`关于页面`的项目链接
|
||||
3. 你也可以选择使用 [商业版](https://doc.zyplayer.com/#/integrate/zyplayer-doc/commercial) 来支持我们
|
||||
|
||||
2. 支持多数据源,在`zyplayer-doc-manage` -> `application.yml` -> `zyplayer.doc.db.dbConfigList` 处配置多个数据库连接即可
|
||||
# 界面展示
|
||||
控制台页面
|
||||

|
||||
|
||||
##### 三、zyplayer-doc-dubbo
|
||||
1. `zyplayer-doc-manage` -> `application.yml` -> `zyplayer.dubbo.zookeeper.url` 配置zookeeper地址
|
||||
|
||||
2. `zyplayer-doc-manage` -> `application.yml` -> `zyplayer.dubbo.nacos.url` 配置nacos服务地址
|
||||
|
||||
3. 默认找zookeeper,未配置再找nacos的配置,访问地址:http://127.0.0.1:8082/zyplayer-doc-manage/doc-dubbo.html
|
||||
|
||||
4. 支持文档查找、文档编辑、在线调试接口
|
||||
|
||||
5. 自动获取参数列表需要指定的类存在,所以请在 pom.xml -> dependencies 最后加上服务所在的包,后端才能通过Class.forName("xx");来找到参数列表,减少录入成本
|
||||
|
||||
6. 数组或List参数,调试参数录入格式例:[1,2] ,后端通过JSON工具转成指定类型,有不支持的类型时欢迎反馈
|
||||
|
||||
##### 四、zyplayer-doc-manage
|
||||
1. 整合了上面两个功能到此项目,较少熟悉成本,`git clone`下来即可运行
|
||||
|
||||
2. 具有简单的`权限管理`、`人员管理`功能(还没想好具体怎么控制,没需求)
|
||||
|
||||
3. 使用最新的一些技术框架,很简单,初学者拿来学习也是很不错的
|
||||
|
||||
如果觉得此项目对您有帮助,就捐赠一个吧!无关金额,主要是对作者的认可。
|
||||
|
||||
#### 界面展示
|
||||
权限和用户管理:
|
||||

|
||||
数据库文档:
|
||||

|
||||
dubbo文档:
|
||||

|
||||
dubbo接口调试:
|
||||

|
||||
增加文档处:
|
||||

|
||||
使用springfox-swagger-ui访问增加的文档:
|
||||

|
||||
文档展示:
|
||||

|
||||
在线调试:
|
||||

|
||||
模拟返回:
|
||||

|
||||
文档配置:
|
||||

|
||||
全局参数管理:
|
||||

|
||||
数据库文档页面
|
||||

|
||||
|
||||
WIKI文档页面
|
||||

|
||||
|
||||
API文档主页面
|
||||

|
||||
|
||||
API文档查看页面
|
||||

|
||||
|
||||
API文档在线调试页面
|
||||

|
||||
|
||||
27
build.bat
Normal file
27
build.bat
Normal file
@@ -0,0 +1,27 @@
|
||||
@echo off
|
||||
|
||||
set dist_dir=dist
|
||||
|
||||
set app_name=zyplayer-doc
|
||||
|
||||
set version="1.1.5"
|
||||
|
||||
set build_folder=%app_name%-%version%
|
||||
|
||||
set target_dir=%dist_dir%\%build_folder%
|
||||
|
||||
call mvn clean package -Dmaven.test.skip=true
|
||||
|
||||
::copy files
|
||||
|
||||
rd /q /s %target_dir%
|
||||
|
||||
md %target_dir%
|
||||
|
||||
copy zyplayer-doc-manage\target\zyplayer-doc.jar %target_dir%
|
||||
copy zyplayer-doc-manage\src\main\resources\application.yml %target_dir%
|
||||
copy zyplayer-doc-manage\src\main\resources\application_pg.yml %target_dir%
|
||||
|
||||
xcopy /e /y /q zyplayer-doc-other\script %target_dir%
|
||||
|
||||
pause
|
||||
30
build.sh
Normal file
30
build.sh
Normal file
@@ -0,0 +1,30 @@
|
||||
#!/bin/sh
|
||||
|
||||
dist_dir="dist"
|
||||
|
||||
app_name="zyplayer-doc"
|
||||
|
||||
version="1.1.5"
|
||||
|
||||
build_folder="${app_name}-${version}"
|
||||
|
||||
# 输出目录
|
||||
target_dir="$dist_dir/${build_folder}"
|
||||
|
||||
echo "开始构建服务端..."
|
||||
|
||||
mvn clean package -Dmaven.test.skip=true
|
||||
|
||||
# 复制文件
|
||||
if [ ! -d "$target_dir" ]; then
|
||||
mkdir -p $target_dir
|
||||
fi
|
||||
|
||||
rm -rf $target_dir/*
|
||||
|
||||
# 复制服务端资源
|
||||
cp -r zyplayer-doc-manage/target/zyplayer-doc.jar $target_dir
|
||||
cp -r zyplayer-doc-manage/src/main/resources/application.yml $target_dir
|
||||
cp -r zyplayer-doc-other/script/* $target_dir
|
||||
|
||||
echo "服务端构建完毕,构建结果在${target_dir}文件夹下"
|
||||
187
pom.xml
187
pom.xml
@@ -4,27 +4,198 @@
|
||||
|
||||
<groupId>com.zyplayer</groupId>
|
||||
<artifactId>zyplayer-doc</artifactId>
|
||||
<version>1.0.1</version>
|
||||
<version>1.0.0</version>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<name>zyplayer-doc</name>
|
||||
<description>定位为所有文档的管理项目,swagger文档、数据库文档、、、、等</description>
|
||||
<description>定位为所有文档的管理项目,swagger文档、数据库文档、WIKI文档等</description>
|
||||
|
||||
<properties>
|
||||
<skipTests>true</skipTests>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
<java.version>1.8</java.version>
|
||||
<maven.compiler.source>1.8</maven.compiler.source>
|
||||
<maven.compiler.target>1.8</maven.compiler.target>
|
||||
<fastjson.version>1.2.53</fastjson.version>
|
||||
<zyplayer.doc.version>1.0.0</zyplayer.doc.version>
|
||||
<spring.boot.version>2.1.6.RELEASE</spring.boot.version>
|
||||
</properties>
|
||||
|
||||
<modules>
|
||||
<module>zyplayer-doc-db</module>
|
||||
<module>zyplayer-doc-manage</module>
|
||||
<module>zyplayer-doc-swagger</module>
|
||||
<module>zyplayer-doc-core</module>
|
||||
<module>zyplayer-doc-dubbo</module>
|
||||
<module>zyplayer-doc-db</module>
|
||||
<module>zyplayer-doc-api</module>
|
||||
<module>zyplayer-doc-wiki</module>
|
||||
<module>zyplayer-doc-core</module>
|
||||
<module>zyplayer-doc-data</module>
|
||||
<module>zyplayer-doc-grpc</module>
|
||||
</modules>
|
||||
<module>zyplayer-doc-other</module>
|
||||
</modules>
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot</artifactId>
|
||||
<version>${spring.boot.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter</artifactId>
|
||||
<version>${spring.boot.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
<version>${spring.boot.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<version>${spring.boot.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-jdbc</artifactId>
|
||||
<version>${spring.boot.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<version>8.0.32</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.sourceforge.jtds</groupId>
|
||||
<artifactId>jtds</artifactId>
|
||||
<version>1.3.1</version>
|
||||
</dependency>
|
||||
<!--达梦数据库驱动-->
|
||||
<dependency>
|
||||
<groupId>com.dameng</groupId>
|
||||
<artifactId>DmJdbcDriver18</artifactId>
|
||||
<version>8.1.2.192</version>
|
||||
</dependency>
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>com.oracle</groupId>-->
|
||||
<!-- <artifactId>ojdbc6</artifactId>-->
|
||||
<!-- <version>12.1.0.1-atlassian-hosted</version>-->
|
||||
<!-- </dependency>-->
|
||||
<dependency>
|
||||
<groupId>org.postgresql</groupId>
|
||||
<artifactId>postgresql</artifactId>
|
||||
<version>42.2.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
<version>2.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-fileupload</groupId>
|
||||
<artifactId>commons-fileupload</artifactId>
|
||||
<version>1.4</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.curator</groupId>
|
||||
<artifactId>curator-recipes</artifactId>
|
||||
<version>2.12.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-collections</groupId>
|
||||
<artifactId>commons-collections</artifactId>
|
||||
<version>3.2.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.12.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>easyexcel</artifactId>
|
||||
<version>2.1.4</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-boot-starter</artifactId>
|
||||
<version>3.5.3.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-core</artifactId>
|
||||
<version>3.5.3.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-generator</artifactId>
|
||||
<version>3.5.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>druid</artifactId>
|
||||
<version>1.2.16</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.freemarker</groupId>
|
||||
<artifactId>freemarker</artifactId>
|
||||
<version>2.3.28</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<version>1.18.24</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>servlet-api</artifactId>
|
||||
<version>2.5</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.springfox</groupId>
|
||||
<artifactId>springfox-swagger2</artifactId>
|
||||
<version>2.9.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>fastjson</artifactId>
|
||||
<version>1.2.83</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-all</artifactId>
|
||||
<version>5.6.6</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jsoup</groupId>
|
||||
<artifactId>jsoup</artifactId>
|
||||
<version>1.17.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.zyplayer</groupId>
|
||||
<artifactId>zyplayer-doc-core</artifactId>
|
||||
<version>${zyplayer.doc.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.zyplayer</groupId>
|
||||
<artifactId>zyplayer-doc-data</artifactId>
|
||||
<version>${zyplayer.doc.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.zyplayer</groupId>
|
||||
<artifactId>zyplayer-doc-db</artifactId>
|
||||
<version>${zyplayer.doc.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.zyplayer</groupId>
|
||||
<artifactId>zyplayer-doc-api</artifactId>
|
||||
<version>${zyplayer.doc.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.zyplayer</groupId>
|
||||
<artifactId>zyplayer-doc-wiki</artifactId>
|
||||
<version>${zyplayer.doc.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
</project>
|
||||
|
||||
@@ -1,6 +1,15 @@
|
||||
# 本文件用于已部署好的系统检测自己是否需要升级使用
|
||||
lastVersion=1.0.1
|
||||
upgradeContent=1、增加wiki文档模块;2、dubbo文档支持使用元数据生成参数和返回值;3、框架进行了大的拆分;4、增加升级通知;5、细节优化
|
||||
upgradeUrl=https://gitee.com/zyplayer/zyplayer-doc/releases
|
||||
nextStep=1、支持直接同步到git的文档;2、支持微信文章拉取
|
||||
# 本文件用于已部署好的系统检测自己是否需要升级使用,怕有人担心安全一类的问题,所以不提供服务器接口来做
|
||||
lastVersion=1.1.6
|
||||
|
||||
upgradeContent=1. 优化WIKI文档展示;\
|
||||
2. #I6S5YA 解决路由错误问题;\
|
||||
3. #I6Z8UX 解决表格样式问题;\
|
||||
4. #I6Z8UX 解决列表样式问题,修复保存后文档加载问题;\
|
||||
5. 升级fastjson版本;\
|
||||
6. 修复图片查看问题;\
|
||||
7. 移除错误的和不需要的依赖;\
|
||||
8. 修复保存后文档加载问题;
|
||||
|
||||
upgradeUrl=https://gitee.com/zyplayer/zyplayer-doc/releases
|
||||
nextStep=
|
||||
|
||||
|
||||
96
zyplayer-doc-api/pom.xml
Normal file
96
zyplayer-doc-api/pom.xml
Normal file
@@ -0,0 +1,96 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>zyplayer-doc-api</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<name>zyplayer-doc-api</name>
|
||||
<description>zyplayer-doc-api是一款接口文档管理系统</description>
|
||||
<url>https://gitee.com/zyplayer/zyplayer-doc/zyplayer-doc</url>
|
||||
<developers>
|
||||
<developer>
|
||||
<id>zyplayer</id>
|
||||
<name>暮光:城中城</name>
|
||||
<email>806783409@qq.com</email>
|
||||
<roles>
|
||||
<role>Java Development Engineer</role>
|
||||
</roles>
|
||||
<timezone>2018-05-22 16:06:06</timezone>
|
||||
</developer>
|
||||
</developers>
|
||||
|
||||
<parent>
|
||||
<groupId>com.zyplayer</groupId>
|
||||
<artifactId>zyplayer-doc</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
<java.version>1.8</java.version>
|
||||
<!-- 打包跳过单元测试 -->
|
||||
<skipTests>true</skipTests>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-fileupload</groupId>
|
||||
<artifactId>commons-fileupload</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.zyplayer</groupId>
|
||||
<artifactId>zyplayer-doc-core</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.zyplayer</groupId>
|
||||
<artifactId>zyplayer-doc-data</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<licenses>
|
||||
<license>
|
||||
<name>The Apache Software License, Version 2.0</name>
|
||||
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
|
||||
</license>
|
||||
</licenses>
|
||||
<scm>
|
||||
<connection>scm:git@git.oschina.net:zyplayer/zyplayer-doc.git</connection>
|
||||
<developerConnection>scm:git@git.oschina.net:zyplayer/zyplayer-doc.git</developerConnection>
|
||||
<url>git@git.oschina.net:zyplayer/zyplayer-doc.git</url>
|
||||
</scm>
|
||||
|
||||
<distributionManagement>
|
||||
<snapshotRepository>
|
||||
<id>snapshots</id>
|
||||
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
|
||||
</snapshotRepository>
|
||||
<repository>
|
||||
<id>snapshots</id>
|
||||
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
|
||||
</repository>
|
||||
</distributionManagement>
|
||||
|
||||
<build>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/resources/dist</directory>
|
||||
<targetPath>META-INF/resources/</targetPath>
|
||||
</resource>
|
||||
</resources>
|
||||
</build>
|
||||
</project>
|
||||
@@ -0,0 +1,156 @@
|
||||
package com.zyplayer.doc.api.controller;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.zyplayer.doc.api.controller.vo.ApiCustomParamsVo;
|
||||
import com.zyplayer.doc.core.annotation.AuthMan;
|
||||
import com.zyplayer.doc.core.json.DocResponseJson;
|
||||
import com.zyplayer.doc.core.json.ResponseJson;
|
||||
import com.zyplayer.doc.data.repository.manage.entity.*;
|
||||
import com.zyplayer.doc.data.service.common.ApiDocAuthJudgeService;
|
||||
import com.zyplayer.doc.data.service.manage.ApiCustomNodeService;
|
||||
import com.zyplayer.doc.data.service.manage.ApiCustomParamsService;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 自建接口文档分组 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2021-12-22
|
||||
*/
|
||||
@AuthMan
|
||||
@Controller
|
||||
@RequestMapping("/api-custom-node")
|
||||
public class ApiCustomNodeController {
|
||||
|
||||
@Resource
|
||||
ApiCustomNodeService apiCustomNodeService;
|
||||
@Resource
|
||||
ApiCustomParamsService apiCustomParamsService;
|
||||
@Resource
|
||||
ApiDocAuthJudgeService apiDocAuthJudgeService;
|
||||
|
||||
/**
|
||||
* 1. 新增文件夹
|
||||
* 2. 修改文件夹名称说明等
|
||||
* 3. 修改父文件夹
|
||||
*
|
||||
* @return 文档内容
|
||||
* @author 暮光:城中城
|
||||
* @since 2021年12月22日
|
||||
*/
|
||||
@ResponseBody
|
||||
@PostMapping(value = "/add")
|
||||
public ResponseJson<Object> add(ApiCustomNode apiCustomNode, ApiCustomParams apiCustomParams) {
|
||||
apiCustomNodeService.addNode(apiCustomNode, apiCustomParams);
|
||||
return DocResponseJson.ok(apiCustomNode);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改文件夹
|
||||
*
|
||||
* @return 文档内容
|
||||
* @author 暮光:城中城
|
||||
* @since 2021年12月22日
|
||||
*/
|
||||
@ResponseBody
|
||||
@PostMapping(value = "/update")
|
||||
public ResponseJson<Object> update(ApiCustomNode apiCustomNode) {
|
||||
// 参数未传不处理
|
||||
if (apiCustomNode.getId() == null) {
|
||||
return DocResponseJson.ok();
|
||||
}
|
||||
if (StringUtils.isBlank(apiCustomNode.getNodeName()) && StringUtils.isBlank(apiCustomNode.getNodeDesc())) {
|
||||
return DocResponseJson.ok();
|
||||
}
|
||||
ApiCustomNode apiCustomFolderSel = apiCustomNodeService.getById(apiCustomNode.getId());
|
||||
apiDocAuthJudgeService.judgeDevelopAndThrow(apiCustomFolderSel.getDocId());
|
||||
// 执行修改
|
||||
ApiCustomNode nodeUp = new ApiCustomNode();
|
||||
nodeUp.setId(apiCustomNode.getId());
|
||||
nodeUp.setNodeName(apiCustomNode.getNodeName());
|
||||
nodeUp.setNodeDesc(apiCustomNode.getNodeDesc());
|
||||
apiCustomNodeService.updateById(nodeUp);
|
||||
return DocResponseJson.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除文件夹
|
||||
*
|
||||
* @return 文档内容
|
||||
* @author 暮光:城中城
|
||||
* @since 2021年12月22日
|
||||
*/
|
||||
@ResponseBody
|
||||
@PostMapping(value = "/delete")
|
||||
public ResponseJson<Object> delete(Long id) {
|
||||
ApiCustomNode apiCustomFolderSel = apiCustomNodeService.getById(id);
|
||||
apiDocAuthJudgeService.judgeDevelopAndThrow(apiCustomFolderSel.getDocId());
|
||||
apiCustomNodeService.deleteNode(id);
|
||||
return DocResponseJson.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除文件夹
|
||||
*
|
||||
* @return 文档内容
|
||||
* @author 暮光:城中城
|
||||
* @since 2021年12月22日
|
||||
*/
|
||||
@ResponseBody
|
||||
@PostMapping(value = "/changeParent")
|
||||
public ResponseJson<Object> changeParent(Long id, Long parentId, Integer targetType, Integer targetSeq) {
|
||||
ApiCustomNode apiCustomFolderSel = apiCustomNodeService.getById(id);
|
||||
apiDocAuthJudgeService.judgeDevelopAndThrow(apiCustomFolderSel.getDocId());
|
||||
apiCustomNodeService.changeParent(id, parentId, targetType, targetSeq);
|
||||
return DocResponseJson.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 自定义接口详情
|
||||
*
|
||||
* @return 文档内容
|
||||
* @author 暮光:城中城
|
||||
* @since 2022年01月05日
|
||||
*/
|
||||
@ResponseBody
|
||||
@PostMapping(value = "/detail")
|
||||
public ResponseJson<Object> detail(Long id) {
|
||||
ApiCustomNode apiCustomNode = apiCustomNodeService.getById(id);
|
||||
if (apiCustomNode == null) {
|
||||
return DocResponseJson.warn("接口不存在");
|
||||
}
|
||||
apiDocAuthJudgeService.judgeDevelopAndThrow(apiCustomNode.getDocId());
|
||||
QueryWrapper<ApiCustomParams> paramsWrapper = new QueryWrapper<>();
|
||||
paramsWrapper.eq("yn", 1);
|
||||
paramsWrapper.eq("node_id", id);
|
||||
ApiCustomParams apiCustomParams = apiCustomParamsService.getOne(paramsWrapper);
|
||||
// 组装结果对象
|
||||
ApiCustomParamsVo customParamsVo = new ApiCustomParamsVo();
|
||||
customParamsVo.setId(apiCustomNode.getId());
|
||||
customParamsVo.setDocId(apiCustomNode.getDocId());
|
||||
customParamsVo.setParentId(apiCustomNode.getParentId());
|
||||
customParamsVo.setNodeType(apiCustomNode.getNodeType());
|
||||
customParamsVo.setNodeName(apiCustomNode.getNodeName());
|
||||
customParamsVo.setNodeDesc(apiCustomNode.getNodeDesc());
|
||||
customParamsVo.setSeqNo(apiCustomNode.getSeqNo());
|
||||
customParamsVo.setNodeId(apiCustomNode.getId());
|
||||
if (apiCustomParams != null) {
|
||||
customParamsVo.setMethod(apiCustomParams.getMethod());
|
||||
customParamsVo.setApiUrl(apiCustomParams.getApiUrl());
|
||||
customParamsVo.setFormData(apiCustomParams.getFormData());
|
||||
customParamsVo.setBodyData(apiCustomParams.getBodyData());
|
||||
customParamsVo.setHeaderData(apiCustomParams.getHeaderData());
|
||||
customParamsVo.setCookieData(apiCustomParams.getCookieData());
|
||||
}
|
||||
return DocResponseJson.ok(customParamsVo);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,130 @@
|
||||
package com.zyplayer.doc.api.controller;
|
||||
|
||||
import com.zyplayer.doc.api.controller.vo.DocUserAuthVo;
|
||||
import com.zyplayer.doc.core.annotation.AuthMan;
|
||||
import com.zyplayer.doc.core.json.DocResponseJson;
|
||||
import com.zyplayer.doc.core.json.ResponseJson;
|
||||
import com.zyplayer.doc.data.config.security.DocUserDetails;
|
||||
import com.zyplayer.doc.data.config.security.DocUserUtil;
|
||||
import com.zyplayer.doc.data.repository.manage.entity.*;
|
||||
import com.zyplayer.doc.data.repository.support.consts.ApiAuthType;
|
||||
import com.zyplayer.doc.data.repository.support.consts.DocSysModuleType;
|
||||
import com.zyplayer.doc.data.repository.support.consts.DocSysType;
|
||||
import com.zyplayer.doc.data.service.common.ApiDocAuthJudgeService;
|
||||
import com.zyplayer.doc.data.service.manage.ApiDocService;
|
||||
import com.zyplayer.doc.data.service.manage.AuthInfoService;
|
||||
import com.zyplayer.doc.data.service.manage.UserAuthService;
|
||||
import com.zyplayer.doc.data.service.manage.UserInfoService;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* api权限控制器
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2021年12月12日
|
||||
*/
|
||||
@AuthMan
|
||||
@RestController
|
||||
@RequestMapping("/doc-api/doc/auth")
|
||||
public class ApiDocAuthController {
|
||||
private static final Logger logger = LoggerFactory.getLogger(ApiDocAuthController.class);
|
||||
|
||||
@Resource
|
||||
UserAuthService userAuthService;
|
||||
@Resource
|
||||
AuthInfoService authInfoService;
|
||||
@Resource
|
||||
UserInfoService userInfoService;
|
||||
@Resource
|
||||
ApiDocService apiDocService;
|
||||
@Resource
|
||||
ApiDocAuthJudgeService apiDocAuthJudgeService;
|
||||
|
||||
@PostMapping("/list")
|
||||
public ResponseJson<Object> list(Long docId) {
|
||||
if (!apiDocAuthJudgeService.haveManageAuth(docId)) {
|
||||
return DocResponseJson.warn("没有此文档的操作权限");
|
||||
}
|
||||
List<UserAuth> authList = userAuthService.getModuleAuthList(DocSysType.API.getType(), DocSysModuleType.Api.DOC.getType(), docId);
|
||||
if (CollectionUtils.isEmpty(authList)) {
|
||||
return DocResponseJson.ok();
|
||||
}
|
||||
// 权限ID对应的权限名
|
||||
Collection<AuthInfo> authInfoList = authInfoService.listByIds(authList.stream().map(UserAuth::getAuthId).collect(Collectors.toSet()));
|
||||
Map<Long, String> authInfoMap = authInfoList.stream().collect(Collectors.toMap(AuthInfo::getId, AuthInfo::getAuthName));
|
||||
Collection<UserInfo> userInfoList = userInfoService.listByIds(authList.stream().map(UserAuth::getUserId).collect(Collectors.toSet()));
|
||||
Map<Long, UserInfo> userInfoMap = userInfoList.stream().collect(Collectors.toMap(UserInfo::getId, val -> val));
|
||||
// 返回结果组装
|
||||
List<DocUserAuthVo> authVoList = new LinkedList<>();
|
||||
for (UserAuth userAuth : authList) {
|
||||
UserInfo userInfo = userInfoMap.get(userAuth.getUserId());
|
||||
String authCode = authInfoMap.get(userAuth.getAuthId());
|
||||
DocUserAuthVo authVo = new DocUserAuthVo();
|
||||
authVo.setAuthType(ApiAuthType.typeOf(authCode).getType());
|
||||
authVo.setUserId(userAuth.getUserId());
|
||||
authVo.setUserNo(userInfo.getUserNo());
|
||||
authVo.setUserName(userInfo.getUserName());
|
||||
authVo.setEmail(userInfo.getEmail());
|
||||
authVo.setPhone(userInfo.getPhone());
|
||||
authVo.setSex(userInfo.getSex());
|
||||
authVoList.add(authVo);
|
||||
}
|
||||
return DocResponseJson.ok(authVoList);
|
||||
}
|
||||
|
||||
@PostMapping("/assign")
|
||||
public ResponseJson<Object> assign(Long docId, Long userId, Integer authType) {
|
||||
if (!apiDocAuthJudgeService.haveManageAuth(docId)) {
|
||||
return DocResponseJson.warn("没有此文档的操作权限");
|
||||
}
|
||||
DocUserDetails currentUser = DocUserUtil.getCurrentUser();
|
||||
String authCode = ApiAuthType.typeOf(authType).getCode();
|
||||
AuthInfo authInfo = authInfoService.getByCode(authCode);
|
||||
List<UserAuth> userModuleAuthList = userAuthService.getUserModuleAuthList(userId, DocSysType.API.getType(), DocSysModuleType.Api.DOC.getType(), docId);
|
||||
if (CollectionUtils.isNotEmpty(userModuleAuthList)) {
|
||||
UserAuth userAuth = userModuleAuthList.remove(0);
|
||||
// 错误数据兼容移除
|
||||
if (!userModuleAuthList.isEmpty()) {
|
||||
List<Long> authIdList = userModuleAuthList.stream().map(UserAuth::getId).collect(Collectors.toList());
|
||||
userAuthService.removeByIds(authIdList);
|
||||
}
|
||||
userAuth.setAuthId(authInfo.getId());
|
||||
userAuth.setUpdateTime(new Date());
|
||||
userAuth.setUpdateUid(currentUser.getUserId());
|
||||
userAuthService.updateById(userAuth);
|
||||
} else {
|
||||
UserAuth userAuth = new UserAuth();
|
||||
userAuth.setUserId(userId);
|
||||
userAuth.setSysType(DocSysType.API.getType());
|
||||
userAuth.setSysModuleType(DocSysModuleType.Api.DOC.getType());
|
||||
userAuth.setSysModuleId(docId);
|
||||
userAuth.setAuthId(authInfo.getId());
|
||||
userAuth.setCreationTime(new Date());
|
||||
userAuth.setCreateUid(currentUser.getUserId());
|
||||
userAuth.setUpdateTime(new Date());
|
||||
userAuth.setUpdateUid(currentUser.getUserId());
|
||||
userAuth.setDelFlag(0);
|
||||
userAuthService.save(userAuth);
|
||||
}
|
||||
return DocResponseJson.ok();
|
||||
}
|
||||
|
||||
@PostMapping("/delete")
|
||||
public ResponseJson<Object> delete(Long docId, Long userId) {
|
||||
if (!apiDocAuthJudgeService.haveManageAuth(docId)) {
|
||||
return DocResponseJson.warn("没有此文档的操作权限");
|
||||
}
|
||||
userAuthService.deleteUserModuleAuth(userId, DocSysType.API.getType(), DocSysModuleType.Api.DOC.getType(), docId);
|
||||
return DocResponseJson.ok();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,230 @@
|
||||
package com.zyplayer.doc.api.controller;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.zyplayer.doc.api.framework.utils.SwaggerDocUtil;
|
||||
import com.zyplayer.doc.api.service.SwaggerHttpRequestService;
|
||||
import com.zyplayer.doc.core.annotation.AuthMan;
|
||||
import com.zyplayer.doc.core.json.DocResponseJson;
|
||||
import com.zyplayer.doc.core.json.ResponseJson;
|
||||
import com.zyplayer.doc.data.config.security.DocUserDetails;
|
||||
import com.zyplayer.doc.data.config.security.DocUserUtil;
|
||||
import com.zyplayer.doc.data.repository.manage.entity.ApiDoc;
|
||||
import com.zyplayer.doc.data.repository.manage.vo.ApiCustomDocVo;
|
||||
import com.zyplayer.doc.data.repository.manage.vo.ApiDocVo;
|
||||
import com.zyplayer.doc.data.repository.support.consts.ApiAuthType;
|
||||
import com.zyplayer.doc.data.service.common.ApiDocAuthJudgeService;
|
||||
import com.zyplayer.doc.data.service.manage.ApiCustomNodeService;
|
||||
import com.zyplayer.doc.data.service.manage.ApiDocService;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import springfox.documentation.swagger.web.SwaggerResource;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 文档控制器
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2021年10月16日
|
||||
*/
|
||||
@AuthMan
|
||||
@RestController
|
||||
@RequestMapping("/doc-api/doc")
|
||||
public class ApiDocumentController {
|
||||
private static final Logger logger = LoggerFactory.getLogger(ApiDocumentController.class);
|
||||
|
||||
@Resource
|
||||
ApiDocAuthJudgeService apiDocAuthJudgeService;
|
||||
@Resource
|
||||
private ApiDocService apiDocService;
|
||||
@Resource
|
||||
private SwaggerHttpRequestService swaggerHttpRequestService;
|
||||
@Resource
|
||||
ApiCustomNodeService apiCustomNodeService;
|
||||
|
||||
/**
|
||||
* 获取所有的文档地址
|
||||
*
|
||||
* @return 文档内容
|
||||
* @author 暮光:城中城
|
||||
* @since 2021年10月16日
|
||||
*/
|
||||
@ResponseBody
|
||||
@PostMapping(value = "/list")
|
||||
public ResponseJson<List<ApiDocVo>> list(ApiDoc apiDoc, Integer pageNum, Integer pageSize) {
|
||||
IPage<ApiDocVo> docList = apiDocService.getApiDocList(apiDoc, pageNum, pageSize);
|
||||
return DocResponseJson.ok(docList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取文档内容
|
||||
*
|
||||
* @return 文档内容
|
||||
* @author 暮光:城中城
|
||||
* @since 2021年10月16日
|
||||
*/
|
||||
@ResponseBody
|
||||
@PostMapping(value = "/detail")
|
||||
public ResponseJson<List<ApiDoc>> detail(Long id) {
|
||||
ApiDoc apiDoc = apiDocService.getById(id);
|
||||
if (!apiDocAuthJudgeService.haveDevelopAuth(apiDoc)) {
|
||||
return DocResponseJson.warn("没有此文档的查看权限");
|
||||
}
|
||||
ApiDocVo apiDocVo = new ApiDocVo();
|
||||
BeanUtil.copyProperties(apiDoc, apiDocVo);
|
||||
Integer authType = apiDocAuthJudgeService.haveManageAuth(apiDoc) ? ApiAuthType.MANAGE.getType() : ApiAuthType.DEVELOPER.getType();
|
||||
apiDocVo.setAuthType(authType);
|
||||
return DocResponseJson.ok(apiDocVo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加文档
|
||||
*
|
||||
* @return 文档内容
|
||||
* @author 暮光:城中城
|
||||
* @since 2021年10月16日
|
||||
*/
|
||||
@ResponseBody
|
||||
@PostMapping(value = "/add")
|
||||
public ResponseJson<Object> add(HttpServletRequest request, ApiDoc apiDoc) {
|
||||
DocUserDetails currentUser = DocUserUtil.getCurrentUser();
|
||||
apiDoc.setYn(1);
|
||||
apiDoc.setCreateTime(new Date());
|
||||
apiDoc.setCreateUserId(currentUser.getUserId());
|
||||
apiDoc.setCreateUserName(currentUser.getUsername());
|
||||
if (apiDoc.getId() == null) {
|
||||
apiDoc.setShareUuid(IdUtil.simpleUUID());
|
||||
} else {
|
||||
ApiDoc apiDocSel = apiDocService.getById(apiDoc.getId());
|
||||
if (apiDocSel == null) {
|
||||
return DocResponseJson.warn("未找到指定的文档记录信息");
|
||||
}
|
||||
if (!apiDocAuthJudgeService.haveManageAuth(apiDocSel)) {
|
||||
return DocResponseJson.warn("没有此文档的操作权限");
|
||||
}
|
||||
if (StringUtils.isBlank(apiDocSel.getShareUuid())) {
|
||||
apiDoc.setShareUuid(IdUtil.simpleUUID());
|
||||
}
|
||||
}
|
||||
// url类型
|
||||
if (Objects.equals(apiDoc.getDocType(), 1)) {
|
||||
// UI地址替换为文档json地址
|
||||
String docUrl = SwaggerDocUtil.replaceSwaggerResources(apiDoc.getDocUrl());
|
||||
if (SwaggerDocUtil.isSwaggerResources(docUrl)) {
|
||||
String swaggerDomain = SwaggerDocUtil.getSwaggerResourceDomain(docUrl);
|
||||
List<SwaggerResource> resourceList;
|
||||
try {
|
||||
String resourcesStr = swaggerHttpRequestService.requestSwaggerUrl(request, 0L, docUrl, swaggerDomain);
|
||||
resourceList = JSON.parseArray(resourcesStr, SwaggerResource.class);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return DocResponseJson.warn("解析文档地址失败:" + e.getMessage());
|
||||
}
|
||||
if (resourceList == null || resourceList.isEmpty()) {
|
||||
return DocResponseJson.warn("该地址未找到文档");
|
||||
}
|
||||
// 删除原有文档
|
||||
if (apiDoc.getId() != null) {
|
||||
apiDocService.removeById(apiDoc.getId());
|
||||
}
|
||||
// 存明细地址
|
||||
for (SwaggerResource resource : resourceList) {
|
||||
apiDoc.setId(null);
|
||||
apiDoc.setDocUrl(swaggerDomain + resource.getUrl());
|
||||
apiDoc.setName(resource.getName());
|
||||
apiDoc.setShareUuid(IdUtil.simpleUUID());
|
||||
apiDocService.save(apiDoc);
|
||||
}
|
||||
} else {
|
||||
apiDocService.saveOrUpdate(apiDoc);
|
||||
}
|
||||
} else if (Objects.equals(apiDoc.getDocType(), 2)
|
||||
|| Objects.equals(apiDoc.getDocType(), 3)
|
||||
|| Objects.equals(apiDoc.getDocType(), 4)
|
||||
|| Objects.equals(apiDoc.getDocType(), 5)) {
|
||||
apiDocService.saveOrUpdate(apiDoc);
|
||||
} else {
|
||||
return DocResponseJson.warn("暂不支持的文档类型");
|
||||
}
|
||||
return DocResponseJson.ok(apiDoc);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改文档基本信息
|
||||
*
|
||||
* @return 无
|
||||
* @author 暮光:城中城
|
||||
* @since 2021年10月16日
|
||||
*/
|
||||
@ResponseBody
|
||||
@PostMapping(value = "/update")
|
||||
public ResponseJson<List<ApiDoc>> update(ApiDoc apiDoc) {
|
||||
if (apiDoc.getId() == null) {
|
||||
return DocResponseJson.warn("请指定修改的记录ID");
|
||||
}
|
||||
// 基本信息可以改,删除需要管理员权限
|
||||
if (Objects.equals(apiDoc.getYn(), 0)) {
|
||||
if (!apiDocAuthJudgeService.haveManageAuth(apiDoc.getId())) {
|
||||
return DocResponseJson.warn("没有此文档的删除权限");
|
||||
}
|
||||
} else {
|
||||
if (!apiDocAuthJudgeService.haveDevelopAuth(apiDoc.getId())) {
|
||||
return DocResponseJson.warn("没有此文档的编辑权限");
|
||||
}
|
||||
}
|
||||
ApiDoc swaggerDocUp = new ApiDoc();
|
||||
swaggerDocUp.setId(apiDoc.getId());
|
||||
swaggerDocUp.setDocStatus(apiDoc.getDocStatus());
|
||||
swaggerDocUp.setShareInstruction(apiDoc.getShareInstruction());
|
||||
swaggerDocUp.setYn(apiDoc.getYn());
|
||||
apiDocService.updateById(swaggerDocUp);
|
||||
return DocResponseJson.ok();
|
||||
}
|
||||
|
||||
@RequestMapping("/apis")
|
||||
public ResponseJson<List<ApiDoc>> resources() {
|
||||
List<ApiDoc> docList = apiDocService.getApiDocList();
|
||||
return DocResponseJson.ok(docList);
|
||||
}
|
||||
|
||||
@RequestMapping("/apis/detail")
|
||||
public ResponseJson<Object> detail(HttpServletRequest request, Long id) {
|
||||
ApiDoc apiDoc = apiDocService.getById(id);
|
||||
if (apiDoc == null) {
|
||||
return DocResponseJson.warn("文档不存在");
|
||||
}
|
||||
if (!apiDocAuthJudgeService.haveDevelopAuth(apiDoc)) {
|
||||
return DocResponseJson.warn("没有此文档的查看权限");
|
||||
}
|
||||
if (Objects.equals(apiDoc.getDocType(), 1) || Objects.equals(apiDoc.getDocType(), 3)) {
|
||||
try {
|
||||
String docsDomain = SwaggerDocUtil.getV2ApiDocsDomain(apiDoc.getDocUrl());
|
||||
String contentStr = swaggerHttpRequestService.requestSwaggerUrl(request, apiDoc.getId(), apiDoc.getDocUrl(), docsDomain);
|
||||
return DocResponseJson.ok(contentStr);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return DocResponseJson.warn("请求文档失败");
|
||||
}
|
||||
}
|
||||
if (Objects.equals(apiDoc.getDocType(), 2) || Objects.equals(apiDoc.getDocType(), 4)) {
|
||||
return DocResponseJson.ok(apiDoc.getJsonContent());
|
||||
}
|
||||
if (Objects.equals(apiDoc.getDocType(), 5)) {
|
||||
List<ApiCustomDocVo> customVoList = apiCustomNodeService.buildCustomApiList(apiDoc);
|
||||
return DocResponseJson.ok(customVoList);
|
||||
}
|
||||
return DocResponseJson.warn("暂不支持的文档类型");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
package com.zyplayer.doc.api.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.zyplayer.doc.core.annotation.AuthMan;
|
||||
import com.zyplayer.doc.core.json.DocResponseJson;
|
||||
import com.zyplayer.doc.core.json.ResponseJson;
|
||||
import com.zyplayer.doc.data.config.security.DocUserDetails;
|
||||
import com.zyplayer.doc.data.config.security.DocUserUtil;
|
||||
import com.zyplayer.doc.data.repository.manage.entity.ApiDoc;
|
||||
import com.zyplayer.doc.data.repository.manage.entity.ApiGlobalParam;
|
||||
import com.zyplayer.doc.data.service.common.ApiDocAuthJudgeService;
|
||||
import com.zyplayer.doc.data.service.manage.ApiGlobalParamService;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* 全局参数控制器
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2021年10月16日
|
||||
*/
|
||||
@AuthMan
|
||||
@RestController
|
||||
@RequestMapping("/doc-api/global-param")
|
||||
public class ApiGlobalParamController {
|
||||
private static final Logger logger = LoggerFactory.getLogger(ApiGlobalParamController.class);
|
||||
|
||||
@Resource
|
||||
private ApiGlobalParamService apiGlobalParamService;
|
||||
@Resource
|
||||
ApiDocAuthJudgeService apiDocAuthJudgeService;
|
||||
|
||||
/**
|
||||
* 获取所有的全局参数
|
||||
*
|
||||
* @return 全局参数列表
|
||||
* @author 暮光:城中城
|
||||
* @since 2021年10月16日
|
||||
*/
|
||||
@ResponseBody
|
||||
@PostMapping(value = "/list")
|
||||
public ResponseJson<List<ApiGlobalParam>> list(Long docId) {
|
||||
Long docIdNew = Optional.ofNullable(docId).orElse(0L);
|
||||
if (docIdNew > 0 && !apiDocAuthJudgeService.haveDevelopAuth(docIdNew)) {
|
||||
return DocResponseJson.warn("没有此文档的查看权限");
|
||||
}
|
||||
DocUserDetails currentUser = DocUserUtil.getCurrentUser();
|
||||
QueryWrapper<ApiGlobalParam> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("yn", 1);
|
||||
queryWrapper.eq("doc_id", docIdNew);
|
||||
// 全局参数才按创建人来控制,文档的全局参数大家共用
|
||||
queryWrapper.eq(docIdNew == 0, "create_user_id", currentUser.getUserId());
|
||||
queryWrapper.orderByDesc("id");
|
||||
List<ApiGlobalParam> globalParamList = apiGlobalParamService.list(queryWrapper);
|
||||
return DocResponseJson.ok(globalParamList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改全局参数
|
||||
*
|
||||
* @return 无
|
||||
* @author 暮光:城中城
|
||||
* @since 2021年10月16日
|
||||
*/
|
||||
@ResponseBody
|
||||
@PostMapping(value = "/update")
|
||||
public ResponseJson<List<ApiDoc>> update(ApiGlobalParam globalParam) {
|
||||
DocUserDetails currentUser = DocUserUtil.getCurrentUser();
|
||||
globalParam.setDocId(Optional.ofNullable(globalParam.getDocId()).orElse(0L));
|
||||
// 新的文档ID是否有权限
|
||||
if (globalParam.getDocId() > 0 && !apiDocAuthJudgeService.haveDevelopAuth(globalParam.getDocId())) {
|
||||
return DocResponseJson.warn("没有此文档的查看权限");
|
||||
}
|
||||
if (globalParam.getId() == null) {
|
||||
globalParam.setYn(1);
|
||||
globalParam.setCreateTime(new Date());
|
||||
globalParam.setCreateUserId(currentUser.getUserId());
|
||||
globalParam.setCreateUserName(currentUser.getUsername());
|
||||
} else {
|
||||
ApiGlobalParam param = apiGlobalParamService.getById(globalParam.getId());
|
||||
if (param.getDocId() > 0) {
|
||||
// 已有的文档ID是否有权限
|
||||
if (!apiDocAuthJudgeService.haveDevelopAuth(param.getDocId())) {
|
||||
return DocResponseJson.warn("没有此文档的查看权限");
|
||||
}
|
||||
} else {
|
||||
if (!Objects.equals(param.getCreateUserId(), currentUser.getUserId())) {
|
||||
return DocResponseJson.warn("目标全局参数不存在");
|
||||
}
|
||||
}
|
||||
}
|
||||
QueryWrapper<ApiGlobalParam> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("yn", 1);
|
||||
wrapper.eq("param_key", globalParam.getParamKey());
|
||||
wrapper.eq("doc_id", globalParam.getDocId());
|
||||
// 全局参数才按创建人来控制,文档的全局参数大家共用
|
||||
wrapper.eq(globalParam.getDocId() == 0, "create_user_id", currentUser.getUserId());
|
||||
List<ApiGlobalParam> paramList = apiGlobalParamService.list(wrapper);
|
||||
if (CollectionUtils.isNotEmpty(paramList)) {
|
||||
if (paramList.size() > 1 || !Objects.equals(paramList.get(0).getId(), globalParam.getId())) {
|
||||
return DocResponseJson.warn("全局参数名称不能重复");
|
||||
}
|
||||
}
|
||||
apiGlobalParamService.saveOrUpdate(globalParam);
|
||||
return DocResponseJson.ok();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
package com.zyplayer.doc.api.controller;
|
||||
|
||||
import com.zyplayer.doc.core.annotation.AuthMan;
|
||||
import com.zyplayer.doc.core.json.DocResponseJson;
|
||||
import com.zyplayer.doc.core.json.ResponseJson;
|
||||
import com.zyplayer.doc.api.controller.param.ProxyRequestParam;
|
||||
import com.zyplayer.doc.api.controller.vo.ProxyRequestResultVo;
|
||||
import com.zyplayer.doc.api.service.SwaggerHttpRequestService;
|
||||
import com.zyplayer.doc.data.repository.manage.entity.ApiCustomNode;
|
||||
import com.zyplayer.doc.data.repository.manage.entity.ApiCustomParams;
|
||||
import com.zyplayer.doc.data.service.manage.ApiCustomNodeService;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* 请求参数控制器
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2021年10月16日
|
||||
*/
|
||||
@AuthMan
|
||||
@RestController
|
||||
@RequestMapping("/doc-api/proxy")
|
||||
public class ApiPoxyRequestController {
|
||||
private static final Logger logger = LoggerFactory.getLogger(ApiPoxyRequestController.class);
|
||||
|
||||
@Resource
|
||||
ApiCustomNodeService apiCustomNodeService;
|
||||
@Resource
|
||||
private SwaggerHttpRequestService swaggerHttpRequestService;
|
||||
|
||||
/**
|
||||
* 代理接口请求
|
||||
*
|
||||
* @return 请求参数
|
||||
* @author 暮光:城中城
|
||||
* @since 2021年10月16日
|
||||
*/
|
||||
@ResponseBody
|
||||
@PostMapping(value = "/request")
|
||||
public ResponseJson<ProxyRequestResultVo> request(HttpServletRequest request, ProxyRequestParam requestParam) {
|
||||
// 自建接口请求时保存信息
|
||||
if (requestParam.getNodeId() != null) {
|
||||
ApiCustomNode apiCustomNode = new ApiCustomNode();
|
||||
apiCustomNode.setNodeType(1);
|
||||
apiCustomNode.setId(requestParam.getNodeId());
|
||||
apiCustomNode.setDocId(requestParam.getDocId());
|
||||
apiCustomNode.setNodeName(requestParam.getApiName());
|
||||
ApiCustomParams apiCustomParams = new ApiCustomParams();
|
||||
apiCustomParams.setApiUrl(requestParam.getUrl());
|
||||
apiCustomParams.setMethod(requestParam.getMethod());
|
||||
apiCustomParams.setFormData(requestParam.getFormParam());
|
||||
apiCustomParams.setBodyData(requestParam.getBodyParam());
|
||||
apiCustomParams.setHeaderData(requestParam.getHeaderParam());
|
||||
apiCustomParams.setCookieData(requestParam.getCookieParam());
|
||||
apiCustomNodeService.addNode(apiCustomNode, apiCustomParams);
|
||||
}
|
||||
ProxyRequestResultVo requestResult = swaggerHttpRequestService.proxyRequest(request, requestParam);
|
||||
return DocResponseJson.ok(requestResult);
|
||||
}
|
||||
|
||||
/**
|
||||
* 代理接口下载请求
|
||||
*
|
||||
* @return 请求参数
|
||||
* @author 暮光:城中城
|
||||
* @since 2021年10月16日
|
||||
*/
|
||||
@ResponseBody
|
||||
@PostMapping(value = "/download")
|
||||
public ResponseJson<ProxyRequestResultVo> download(HttpServletRequest request, HttpServletResponse response, ProxyRequestParam requestParam) {
|
||||
swaggerHttpRequestService.proxyDownload(request, response, requestParam);
|
||||
return DocResponseJson.ok();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
package com.zyplayer.doc.api.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.zyplayer.doc.core.annotation.AuthMan;
|
||||
import com.zyplayer.doc.core.json.DocResponseJson;
|
||||
import com.zyplayer.doc.core.json.ResponseJson;
|
||||
import com.zyplayer.doc.data.config.security.DocUserDetails;
|
||||
import com.zyplayer.doc.data.config.security.DocUserUtil;
|
||||
import com.zyplayer.doc.data.repository.manage.entity.ApiDoc;
|
||||
import com.zyplayer.doc.data.repository.manage.entity.ApiRequestParam;
|
||||
import com.zyplayer.doc.data.service.manage.ApiRequestParamService;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 请求参数控制器
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2021年10月16日
|
||||
*/
|
||||
@AuthMan
|
||||
@RestController
|
||||
@RequestMapping("/doc-api/request-param")
|
||||
public class ApiRequestParamController {
|
||||
private static final Logger logger = LoggerFactory.getLogger(ApiRequestParamController.class);
|
||||
|
||||
@Resource
|
||||
private ApiRequestParamService apiRequestParamService;
|
||||
|
||||
/**
|
||||
* 获取所有的请求参数
|
||||
*
|
||||
* @return 请求参数
|
||||
* @author 暮光:城中城
|
||||
* @since 2021年10月16日
|
||||
*/
|
||||
@ResponseBody
|
||||
@PostMapping(value = "/query")
|
||||
public ResponseJson<ApiRequestParam> query(String docUrl) {
|
||||
QueryWrapper<ApiRequestParam> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("yn", 1);
|
||||
queryWrapper.eq("doc_url", docUrl);
|
||||
ApiRequestParam requestParam = apiRequestParamService.getOne(queryWrapper);
|
||||
return DocResponseJson.ok(requestParam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改请求参数
|
||||
*
|
||||
* @return 无
|
||||
* @author 暮光:城中城
|
||||
* @since 2021年10月16日
|
||||
*/
|
||||
@ResponseBody
|
||||
@PostMapping(value = "/update")
|
||||
public ResponseJson<List<ApiDoc>> update(ApiRequestParam apiRequestParam) {
|
||||
QueryWrapper<ApiRequestParam> updateWrapper = new QueryWrapper<>();
|
||||
updateWrapper.eq("doc_url", apiRequestParam.getDocUrl());
|
||||
DocUserDetails currentUser = DocUserUtil.getCurrentUser();
|
||||
apiRequestParam.setYn(1);
|
||||
apiRequestParam.setCreateTime(new Date());
|
||||
apiRequestParam.setCreateUserId(currentUser.getUserId());
|
||||
apiRequestParam.setCreateUserName(currentUser.getUsername());
|
||||
apiRequestParamService.update(apiRequestParam, updateWrapper);
|
||||
return DocResponseJson.ok();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
package com.zyplayer.doc.api.controller;
|
||||
|
||||
import com.zyplayer.doc.api.framework.utils.SwaggerDocUtil;
|
||||
import com.zyplayer.doc.api.service.SwaggerHttpRequestService;
|
||||
import com.zyplayer.doc.core.json.DocResponseJson;
|
||||
import com.zyplayer.doc.core.json.ResponseJson;
|
||||
import com.zyplayer.doc.data.repository.manage.entity.ApiDoc;
|
||||
import com.zyplayer.doc.data.service.manage.ApiDocService;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 文档控制器
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2021年10月16日
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/doc-api/share")
|
||||
public class ApiShareDocumentController {
|
||||
private static final Logger logger = LoggerFactory.getLogger(ApiShareDocumentController.class);
|
||||
|
||||
@Resource
|
||||
private ApiDocService swaggerDocService;
|
||||
@Resource
|
||||
private SwaggerHttpRequestService swaggerHttpRequestService;
|
||||
|
||||
/**
|
||||
* 获取文档内容
|
||||
*
|
||||
* @return 文档内容
|
||||
* @author 暮光:城中城
|
||||
* @since 2021年10月16日
|
||||
*/
|
||||
@ResponseBody
|
||||
@PostMapping(value = "/detail")
|
||||
public ResponseJson<List<ApiDoc>> detail(String shareUuid) {
|
||||
ApiDoc apiDoc = swaggerDocService.getByShareUuid(shareUuid);
|
||||
if (apiDoc == null) {
|
||||
return DocResponseJson.warn("文档不存在");
|
||||
}
|
||||
apiDoc.setDocUrl(null);
|
||||
apiDoc.setJsonContent(null);
|
||||
return DocResponseJson.ok(apiDoc);
|
||||
}
|
||||
|
||||
@RequestMapping("/apis/detail")
|
||||
public ResponseJson<Object> detail(HttpServletRequest request, String shareUuid) {
|
||||
ApiDoc apiDoc = swaggerDocService.getByShareUuid(shareUuid);
|
||||
if (apiDoc == null) {
|
||||
return DocResponseJson.warn("文档不存在");
|
||||
}
|
||||
if (Objects.equals(apiDoc.getDocType(), 1)) {
|
||||
try {
|
||||
String docsDomain = SwaggerDocUtil.getV2ApiDocsDomain(apiDoc.getDocUrl());
|
||||
String contentStr = swaggerHttpRequestService.requestSwaggerUrl(request, apiDoc.getId(), apiDoc.getDocUrl(), docsDomain);
|
||||
return DocResponseJson.ok(contentStr);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return DocResponseJson.warn("请求文档失败");
|
||||
}
|
||||
}
|
||||
if (Objects.equals(apiDoc.getDocType(), 2) || Objects.equals(apiDoc.getDocType(), 4)) {
|
||||
return DocResponseJson.ok(apiDoc.getJsonContent());
|
||||
}
|
||||
return DocResponseJson.warn("暂不支持的文档类型");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
package com.zyplayer.doc.api.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.zyplayer.doc.core.annotation.AuthMan;
|
||||
import com.zyplayer.doc.core.exception.ConfirmException;
|
||||
import com.zyplayer.doc.core.json.DocResponseJson;
|
||||
import com.zyplayer.doc.data.repository.manage.entity.ApiDoc;
|
||||
import com.zyplayer.doc.data.service.manage.ApiDocService;
|
||||
import com.zyplayer.doc.api.controller.vo.SwaggerResourceVo;
|
||||
import com.zyplayer.doc.api.framework.utils.SwaggerDocUtil;
|
||||
import com.zyplayer.doc.api.service.SwaggerHttpRequestService;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.util.MimeTypeUtils;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import springfox.documentation.spring.web.json.Json;
|
||||
import springfox.documentation.swagger.web.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 承接了所有的ApiResourceController的接口
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2021年10月16日
|
||||
*/
|
||||
@AuthMan
|
||||
@RestController
|
||||
public class ApiSwaggerProxyController {
|
||||
|
||||
private static final String HAL_MEDIA_TYPE = "application/hal+json";
|
||||
|
||||
@Resource
|
||||
private ApiDocService apiDocService;
|
||||
@Resource
|
||||
private SwaggerHttpRequestService swaggerHttpRequestService;
|
||||
|
||||
@ResponseBody
|
||||
@RequestMapping("/swagger-resources")
|
||||
public List<SwaggerResourceVo> swaggerResources() {
|
||||
List<SwaggerResourceVo> resourceList = new LinkedList<>();
|
||||
QueryWrapper<ApiDoc> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("yn", 1);
|
||||
queryWrapper.eq("doc_status", 1);
|
||||
queryWrapper.eq("open_visit", 1);
|
||||
queryWrapper.in("doc_type", 1, 2);
|
||||
queryWrapper.orderByAsc("id");
|
||||
queryWrapper.select("id", "name", "rewrite_domain");
|
||||
List<ApiDoc> docList = apiDocService.list(queryWrapper);
|
||||
for (ApiDoc apiDoc : docList) {
|
||||
SwaggerResourceVo resource = new SwaggerResourceVo();
|
||||
resource.setUrl("/v2/api-docs?id=" + apiDoc.getId());
|
||||
resource.setName(apiDoc.getName());
|
||||
resource.setSwaggerVersion("2.0");
|
||||
resource.setRewriteDomain(apiDoc.getRewriteDomain());
|
||||
resourceList.add(resource);
|
||||
}
|
||||
return resourceList;
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@RequestMapping(value = "/v2/api-docs", produces = {MimeTypeUtils.APPLICATION_JSON_VALUE, HAL_MEDIA_TYPE})
|
||||
public ResponseEntity<Object> content(HttpServletRequest request, Long id) {
|
||||
ApiDoc apiDoc = apiDocService.getById(id);
|
||||
if (apiDoc == null || !Objects.equals(apiDoc.getOpenVisit(), 1)) {
|
||||
throw new ConfirmException("文档不存在");
|
||||
}
|
||||
if (Objects.equals(apiDoc.getDocType(), 1)) {
|
||||
try {
|
||||
String docsDomain = SwaggerDocUtil.getV2ApiDocsDomain(apiDoc.getDocUrl());
|
||||
String contentStr = swaggerHttpRequestService.requestSwaggerUrl(request, apiDoc.getId(), apiDoc.getDocUrl(), docsDomain);
|
||||
return new ResponseEntity<>(new Json(contentStr), HttpStatus.OK);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return new ResponseEntity<>(DocResponseJson.warn("请求文档失败"), HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
return new ResponseEntity<>(new Json(apiDoc.getJsonContent()), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@RequestMapping(value = "/swagger-resources/configuration/security")
|
||||
public ResponseEntity<SecurityConfiguration> securityConfiguration() {
|
||||
SecurityConfiguration securityConfiguration = SecurityConfigurationBuilder.builder().build();
|
||||
return new ResponseEntity<>(securityConfiguration, HttpStatus.OK);
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@RequestMapping(value = "/swagger-resources/configuration/ui")
|
||||
public ResponseEntity<UiConfiguration> uiConfiguration() {
|
||||
UiConfiguration uiConfiguration = UiConfigurationBuilder.builder().build();
|
||||
return new ResponseEntity<>(uiConfiguration, HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.zyplayer.doc.api.controller.param;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 参数信息
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2021-11-04
|
||||
*/
|
||||
@Data
|
||||
public class ParamData {
|
||||
private String code;
|
||||
private String value;
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.zyplayer.doc.api.controller.param;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 代理请求参数
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2021-11-04
|
||||
*/
|
||||
@Data
|
||||
public class ProxyRequestParam {
|
||||
private Long docId;
|
||||
private Long nodeId;
|
||||
private String url;
|
||||
private String host;
|
||||
private String method;
|
||||
private String contentType;
|
||||
private String headerParam;
|
||||
private String cookieParam;
|
||||
private String formParam;
|
||||
private String formEncodeParam;
|
||||
private String bodyParam;
|
||||
private String apiName;
|
||||
|
||||
public List<ParamData> getHeaderParamData() {
|
||||
return JSON.parseArray(headerParam, ParamData.class);
|
||||
}
|
||||
|
||||
public List<ParamData> getCookieParamData() {
|
||||
return JSON.parseArray(cookieParam, ParamData.class);
|
||||
}
|
||||
|
||||
public List<ParamData> getFormParamData() {
|
||||
return JSON.parseArray(formParam, ParamData.class);
|
||||
}
|
||||
|
||||
public List<ParamData> getFormEncodeParamData() {
|
||||
return JSON.parseArray(formEncodeParam, ParamData.class);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
package com.zyplayer.doc.api.controller.vo;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ApiCustomParamsVo {
|
||||
|
||||
/**
|
||||
* 节点ID
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 父文件夹ID
|
||||
*/
|
||||
private Long parentId;
|
||||
|
||||
/**
|
||||
* 节点类型 0=目录 1=接口
|
||||
*/
|
||||
private Integer nodeType;
|
||||
|
||||
/**
|
||||
* 节点名称
|
||||
*/
|
||||
private String nodeName;
|
||||
|
||||
/**
|
||||
* 节点说明
|
||||
*/
|
||||
private String nodeDesc;
|
||||
|
||||
/**
|
||||
* 节点顺序
|
||||
*/
|
||||
private Integer seqNo;
|
||||
|
||||
/**
|
||||
* api_doc主键ID
|
||||
*/
|
||||
private Long docId;
|
||||
|
||||
/**
|
||||
* 节点ID
|
||||
*/
|
||||
private Long nodeId;
|
||||
|
||||
/**
|
||||
* 请求方式:get、head、post、put、patch、delete、options、trace
|
||||
*/
|
||||
private String method;
|
||||
|
||||
/**
|
||||
* 接口url
|
||||
*/
|
||||
private String apiUrl;
|
||||
|
||||
/**
|
||||
* form参数
|
||||
*/
|
||||
private String formData;
|
||||
|
||||
/**
|
||||
* body参数
|
||||
*/
|
||||
private String bodyData;
|
||||
|
||||
/**
|
||||
* header参数
|
||||
*/
|
||||
private String headerData;
|
||||
|
||||
/**
|
||||
* cookie参数
|
||||
*/
|
||||
private String cookieData;
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
package com.zyplayer.doc.api.controller.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* api文档地址Vo
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2021-11-25
|
||||
*/
|
||||
@Data
|
||||
public class ApiDocVo implements Serializable {
|
||||
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 文档名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 文档类型 1=swagger url 2=swagger json 3=openapi url 4=openapi json 5=自建API分组
|
||||
*/
|
||||
private Integer docType;
|
||||
|
||||
/**
|
||||
* 文档URL地址
|
||||
*/
|
||||
private String docUrl;
|
||||
|
||||
/**
|
||||
* 文档json内容
|
||||
*/
|
||||
private String jsonContent;
|
||||
|
||||
/**
|
||||
* 重写的域名
|
||||
*/
|
||||
private String rewriteDomain;
|
||||
|
||||
/**
|
||||
* 是否开放访问 0=否 1=是
|
||||
*/
|
||||
private Integer openVisit;
|
||||
|
||||
/**
|
||||
* 状态 1=启用 2=禁用
|
||||
*/
|
||||
private Integer docStatus;
|
||||
|
||||
/**
|
||||
* 开放文档UUID
|
||||
*/
|
||||
private String shareUuid;
|
||||
|
||||
/**
|
||||
* 开放文档使用说明
|
||||
*/
|
||||
private String shareInstruction;
|
||||
|
||||
/**
|
||||
* 创建人ID
|
||||
*/
|
||||
private Long createUserId;
|
||||
|
||||
/**
|
||||
* 创建人名字
|
||||
*/
|
||||
private String createUserName;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 是否有效 0=无效 1=有效
|
||||
*/
|
||||
private Integer yn;
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.zyplayer.doc.api.controller.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 用户权限返回值对象
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2021年12月12日
|
||||
*/
|
||||
@Data
|
||||
public class DocUserAuthVo {
|
||||
|
||||
/**
|
||||
* 权限类型
|
||||
*/
|
||||
private Integer authType;
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 用户编号,用于登录等
|
||||
*/
|
||||
private String userNo;
|
||||
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 邮箱
|
||||
*/
|
||||
private String email;
|
||||
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 性别 0=女 1=男
|
||||
*/
|
||||
private Integer sex;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.zyplayer.doc.api.controller.vo;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* cookie返回值对象
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2018年8月21日
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class HttpCookieVo {
|
||||
private String name;
|
||||
private String value;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.zyplayer.doc.api.controller.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* header返回值对象
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2018年8月21日
|
||||
*/
|
||||
@Data
|
||||
public class HttpHeaderVo {
|
||||
private String name;
|
||||
private String value;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
|
||||
package com.zyplayer.doc.api.controller.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 代理请求结果
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2021-11-04
|
||||
*/
|
||||
@Data
|
||||
public class ProxyRequestResultVo {
|
||||
private List<HttpCookieVo> cookies;
|
||||
private List<HttpHeaderVo> headers;
|
||||
private Integer status;
|
||||
private Long useTime;
|
||||
private Integer contentLength;
|
||||
private String data;
|
||||
private String errorMsg;
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
|
||||
package com.zyplayer.doc.api.controller.vo;
|
||||
|
||||
import com.google.common.collect.ComparisonChain;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* swagger资源信息
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2021-11-04
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public class SwaggerResourceVo implements Comparable<SwaggerResourceVo> {
|
||||
private String name;
|
||||
private String url;
|
||||
private String swaggerVersion;
|
||||
private String rewriteDomain;
|
||||
|
||||
@Override
|
||||
public int compareTo(SwaggerResourceVo other) {
|
||||
return ComparisonChain.start().compare(this.swaggerVersion, other.swaggerVersion).compare(this.name, other.name).result();
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.zyplayer.doc.grpc.framework.config;
|
||||
package com.zyplayer.doc.api.framework.config;
|
||||
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
@@ -6,17 +6,18 @@ import org.springframework.context.annotation.Configuration;
|
||||
import java.lang.annotation.*;
|
||||
|
||||
/**
|
||||
* 开启grpc的注解
|
||||
* 开启api接口文档模块注解
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2019年3月31日
|
||||
* @since 2021-11-04
|
||||
*/
|
||||
@Target(ElementType.TYPE)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
@Configuration
|
||||
@ComponentScan(basePackages = {
|
||||
"com.zyplayer.doc.grpc",
|
||||
"com.zyplayer.doc.api",
|
||||
})
|
||||
public @interface EnableDocGrpc {
|
||||
public @interface EnableDocApi {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.zyplayer.doc.api.framework.utils;
|
||||
|
||||
/**
|
||||
* swagger文档工具类
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2021-11-04
|
||||
*/
|
||||
public class SwaggerDocUtil {
|
||||
|
||||
public static String replaceSwaggerResources(String docUrl) {
|
||||
int htmlIndex = docUrl.indexOf("/swagger-ui.html");
|
||||
if (htmlIndex > 0) {
|
||||
docUrl = docUrl.substring(0, htmlIndex) + "/swagger-resources";
|
||||
}
|
||||
return docUrl;
|
||||
}
|
||||
|
||||
public static boolean isSwaggerResources(String docUrl) {
|
||||
return docUrl.contains("/swagger-resources");
|
||||
}
|
||||
|
||||
public static String getSwaggerResourceDomain(String docUrl) {
|
||||
int index = docUrl.indexOf("/swagger-resources");
|
||||
if (index >= 0) {
|
||||
return docUrl.substring(0, index);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public static String getV2ApiDocsDomain(String docUrl) {
|
||||
int index = docUrl.indexOf("/v2/api-docs");
|
||||
if (index >= 0) {
|
||||
return docUrl.substring(0, index);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public static String getDomainHost(String domain) {
|
||||
domain = domain.replace("http://", "");
|
||||
domain = domain.replace("https://", "");
|
||||
int index = domain.indexOf("/");
|
||||
if (index >= 0) {
|
||||
return domain.substring(0, index);
|
||||
}
|
||||
return domain;
|
||||
}
|
||||
|
||||
public static boolean isSwaggerLocation(String docUrl) {
|
||||
return docUrl.contains("/v2/api-docs");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,250 @@
|
||||
package com.zyplayer.doc.api.service;
|
||||
|
||||
import cn.hutool.core.io.resource.BytesResource;
|
||||
import cn.hutool.core.io.resource.MultiResource;
|
||||
import cn.hutool.http.HttpRequest;
|
||||
import cn.hutool.http.HttpResponse;
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import cn.hutool.http.Method;
|
||||
import com.zyplayer.doc.api.controller.param.ProxyRequestParam;
|
||||
import com.zyplayer.doc.api.controller.vo.HttpCookieVo;
|
||||
import com.zyplayer.doc.api.controller.vo.HttpHeaderVo;
|
||||
import com.zyplayer.doc.api.controller.vo.ProxyRequestResultVo;
|
||||
import com.zyplayer.doc.api.framework.utils.SwaggerDocUtil;
|
||||
import com.zyplayer.doc.core.exception.ConfirmException;
|
||||
import com.zyplayer.doc.data.repository.manage.entity.ApiGlobalParam;
|
||||
import com.zyplayer.doc.data.service.manage.ApiGlobalParamService;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.collections.MapUtils;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.multipart.support.StandardMultipartHttpServletRequest;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.Cookie;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.net.HttpCookie;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
* swagger请求服务
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2021-11-04
|
||||
*/
|
||||
@Service
|
||||
public class SwaggerHttpRequestService {
|
||||
private static final Logger logger = LoggerFactory.getLogger(SwaggerHttpRequestService.class);
|
||||
|
||||
@Resource
|
||||
private ApiGlobalParamService apiGlobalParamService;
|
||||
|
||||
private static final Map<String, Method> requestMethodMap = Stream.of(Method.values()).collect(Collectors.toMap(val -> val.name().toLowerCase(), val -> val));
|
||||
|
||||
final List<String> domainHeaderKeys = Arrays.asList("referer", "origin");
|
||||
final List<String> needRequestHeaderKeys = Collections.singletonList("user-agent");
|
||||
|
||||
/**
|
||||
* 请求真实的swagger文档内容
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2021-11-04
|
||||
*/
|
||||
public String requestSwaggerUrl(HttpServletRequest request, Long docId, String docUrl, String docDomain) {
|
||||
List<ApiGlobalParam> globalParamList = apiGlobalParamService.getGlobalParamList(docId);
|
||||
Map<String, Object> globalFormParamMap = globalParamList.stream().filter(item -> Objects.equals(item.getParamType(), 1))
|
||||
.collect(Collectors.toMap(ApiGlobalParam::getParamKey, ApiGlobalParam::getParamValue, (val1, val2) -> val1));
|
||||
Map<String, String> globalHeaderParamMap = globalParamList.stream().filter(item -> Objects.equals(item.getParamType(), 2))
|
||||
.collect(Collectors.toMap(ApiGlobalParam::getParamKey, ApiGlobalParam::getParamValue, (val1, val2) -> val1));
|
||||
Map<String, String> globalCookieParamMap = globalParamList.stream().filter(item -> Objects.equals(item.getParamType(), 3))
|
||||
.collect(Collectors.toMap(ApiGlobalParam::getParamKey, ApiGlobalParam::getParamValue, (val1, val2) -> val1));
|
||||
Map<String, String> requestHeaders = this.getHttpHeader(request, globalHeaderParamMap);
|
||||
if (StringUtils.isNotBlank(docDomain)) {
|
||||
domainHeaderKeys.forEach(key -> requestHeaders.put(key, docDomain));
|
||||
requestHeaders.put("host", SwaggerDocUtil.getDomainHost(docDomain));
|
||||
}
|
||||
// 执行请求
|
||||
return HttpRequest.get(docUrl)
|
||||
.form(globalFormParamMap)
|
||||
.addHeaders(requestHeaders)
|
||||
.header("Accept", "application/json, text/javascript, */*; q=0.01")
|
||||
.cookie(this.getHttpCookie(request, globalCookieParamMap, null))
|
||||
.timeout(10000).execute().body();
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行代理请求
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2021-11-04
|
||||
*/
|
||||
public void proxyDownload(HttpServletRequest request, HttpServletResponse response, ProxyRequestParam requestParam) {
|
||||
try {
|
||||
HttpResponse httpResponse = this.getHttpResponse(request, requestParam);
|
||||
Map<String, List<String>> responseHeaders = httpResponse.headers();
|
||||
if (MapUtils.isNotEmpty(responseHeaders)) {
|
||||
for (Map.Entry<String, List<String>> httpHeader : responseHeaders.entrySet()) {
|
||||
response.addHeader(httpHeader.getKey(), String.join(";", httpHeader.getValue()));
|
||||
}
|
||||
}
|
||||
httpResponse.writeBody(response.getOutputStream(), true, null);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行代理请求
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2021-11-04
|
||||
*/
|
||||
public ProxyRequestResultVo proxyRequest(HttpServletRequest request, ProxyRequestParam requestParam) {
|
||||
ProxyRequestResultVo resultVo = new ProxyRequestResultVo();
|
||||
long startTime = System.currentTimeMillis();
|
||||
try {
|
||||
HttpResponse httpResponse = getHttpResponse(request, requestParam);
|
||||
resultVo.setData(httpResponse.body());
|
||||
resultVo.setStatus(httpResponse.getStatus());
|
||||
resultVo.setContentLength(httpResponse.bodyBytes().length);
|
||||
// 设置返回的cookies
|
||||
List<HttpCookie> responseCookies = httpResponse.getCookies();
|
||||
if (CollectionUtils.isNotEmpty(responseCookies)) {
|
||||
resultVo.setCookies(responseCookies.stream().map(val -> new HttpCookieVo(val.getName(), val.getValue())).collect(Collectors.toList()));
|
||||
}
|
||||
// 设置返回的headers
|
||||
Map<String, List<String>> responseHeaders = httpResponse.headers();
|
||||
if (MapUtils.isNotEmpty(responseHeaders)) {
|
||||
List<HttpHeaderVo> headerList = new ArrayList<>(responseHeaders.size());
|
||||
for (Map.Entry<String, List<String>> httpHeader : responseHeaders.entrySet()) {
|
||||
HttpHeaderVo vo = new HttpHeaderVo();
|
||||
vo.setName(httpHeader.getKey());
|
||||
vo.setValue(String.join(";", httpHeader.getValue()));
|
||||
headerList.add(vo);
|
||||
}
|
||||
resultVo.setHeaders(headerList);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
resultVo.setErrorMsg(e.getMessage());
|
||||
}
|
||||
resultVo.setUseTime(System.currentTimeMillis() - startTime);
|
||||
return resultVo;
|
||||
}
|
||||
|
||||
private HttpResponse getHttpResponse(HttpServletRequest request, ProxyRequestParam requestParam) {
|
||||
// 执行请求
|
||||
Method method = requestMethodMap.get(requestParam.getMethod());
|
||||
if (method == null) {
|
||||
throw new ConfirmException("不支持的请求方式:" + requestParam.getMethod());
|
||||
}
|
||||
HttpRequest httpRequest = HttpUtil.createRequest(method, requestParam.getUrl());
|
||||
// header获取
|
||||
Map<String, String> headerParam = new HashMap<>();
|
||||
requestParam.getHeaderParamData().forEach(item -> headerParam.put(item.getCode(), item.getValue()));
|
||||
Map<String, String> requestHeaders = this.getHttpHeader(request, headerParam);
|
||||
if (StringUtils.isNotBlank(requestParam.getHost())) {
|
||||
domainHeaderKeys.forEach(key -> requestHeaders.put(key, requestParam.getHost()));
|
||||
requestHeaders.put("host", SwaggerDocUtil.getDomainHost(requestParam.getHost()));
|
||||
}
|
||||
// http自带参数
|
||||
httpRequest.addHeaders(requestHeaders);
|
||||
// 用户输入的参数
|
||||
requestParam.getFormParamData().forEach(data -> httpRequest.form(data.getCode(), data.getValue()));
|
||||
requestParam.getFormEncodeParamData().forEach(data -> httpRequest.form(data.getCode(), data.getValue()));
|
||||
// 文件参数
|
||||
if (request instanceof StandardMultipartHttpServletRequest) {
|
||||
StandardMultipartHttpServletRequest multipartRequest = (StandardMultipartHttpServletRequest) request;
|
||||
Iterator<String> fileNames = multipartRequest.getFileNames();
|
||||
while (fileNames.hasNext()) {
|
||||
String fileName = fileNames.next();
|
||||
String originKey = fileName.replace("_file_", "");
|
||||
List<MultipartFile> fileList = multipartRequest.getFiles(fileName);
|
||||
try {
|
||||
if (fileList.size() > 1) {
|
||||
MultiResource multiResource = new MultiResource();
|
||||
for (MultipartFile file : fileList) {
|
||||
multiResource.add(new BytesResource(file.getBytes(), file.getOriginalFilename()));
|
||||
}
|
||||
httpRequest.form(originKey, multiResource);
|
||||
} else if (!fileList.isEmpty()) {
|
||||
MultipartFile multipartFile = fileList.get(0);
|
||||
httpRequest.form(originKey, multipartFile.getBytes(), multipartFile.getOriginalFilename());
|
||||
}
|
||||
} catch (IOException e) {
|
||||
logger.error("读取上传的文件失败", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
// cookie参数
|
||||
Map<String, String> cookieParam = new HashMap<>();
|
||||
String headerCookie = headerParam.getOrDefault("Cookie", headerParam.get("cookie"));
|
||||
requestParam.getCookieParamData().forEach(item -> cookieParam.put(item.getCode(), item.getValue()));
|
||||
httpRequest.cookie(this.getHttpCookie(request, cookieParam, headerCookie));
|
||||
if (StringUtils.isNotBlank(requestParam.getBodyParam())) {
|
||||
httpRequest.body(requestParam.getBodyParam());
|
||||
}
|
||||
// 强制设置类型,貌似不用刻意设置,如果写的application/json,参数是表单,传过去收不到值,先注释这个
|
||||
// if (StringUtils.isNotBlank(requestParam.getContentType())) {
|
||||
// httpRequest.contentType(requestParam.getContentType());
|
||||
// }
|
||||
// 执行请求
|
||||
return httpRequest.timeout(10000).execute();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取http的cookie
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2021-11-04
|
||||
*/
|
||||
private List<HttpCookie> getHttpCookie(HttpServletRequest request, Map<String, String> globalCookieParamMap, String headerCookie) {
|
||||
List<HttpCookie> httpCookies = new LinkedList<>();
|
||||
if (request.getCookies() != null) {
|
||||
for (Cookie cookie : request.getCookies()) {
|
||||
httpCookies.add(new HttpCookie(cookie.getName(), cookie.getValue()));
|
||||
}
|
||||
}
|
||||
if (StringUtils.isNotBlank(headerCookie)) {
|
||||
Arrays.stream(headerCookie.split(";")).map(String::trim).forEach(cookie -> {
|
||||
String[] cookieArr = StringUtils.split(cookie, "=", 2);
|
||||
if (ArrayUtils.getLength(cookieArr) == 2) {
|
||||
httpCookies.add(new HttpCookie(cookieArr[0], cookieArr[1]));
|
||||
}
|
||||
});
|
||||
}
|
||||
if (MapUtils.isNotEmpty(globalCookieParamMap)) {
|
||||
globalCookieParamMap.forEach((key, value) -> httpCookies.add(new HttpCookie(key, value)));
|
||||
}
|
||||
return httpCookies;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取http的header
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2021-11-04
|
||||
*/
|
||||
private Map<String, String> getHttpHeader(HttpServletRequest request, Map<String, String> globalHeaderParamMap) {
|
||||
Map<String, String> headerParamMap = new HashMap<>();
|
||||
Enumeration<String> headerNames = request.getHeaderNames();
|
||||
while (headerNames.hasMoreElements()) {
|
||||
String headerName = StringUtils.lowerCase(headerNames.nextElement());
|
||||
if (needRequestHeaderKeys.contains(headerName)) {
|
||||
headerParamMap.put(headerName, request.getHeader(headerName));
|
||||
}
|
||||
}
|
||||
if (MapUtils.isNotEmpty(globalHeaderParamMap)) {
|
||||
headerParamMap.putAll(globalHeaderParamMap);
|
||||
}
|
||||
return headerParamMap;
|
||||
}
|
||||
}
|
||||
BIN
zyplayer-doc-api/src/main/resources/dist/api-logo.png
vendored
Normal file
BIN
zyplayer-doc-api/src/main/resources/dist/api-logo.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 8.7 KiB |
4
zyplayer-doc-api/src/main/resources/dist/assets/ApiRequest.d7d8c646.js
vendored
Normal file
4
zyplayer-doc-api/src/main/resources/dist/assets/ApiRequest.d7d8c646.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
zyplayer-doc-api/src/main/resources/dist/assets/DocContent.6940f3d1.js
vendored
Normal file
1
zyplayer-doc-api/src/main/resources/dist/assets/DocContent.6940f3d1.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
zyplayer-doc-api/src/main/resources/dist/assets/DocContent.a9f68c91.js
vendored
Normal file
1
zyplayer-doc-api/src/main/resources/dist/assets/DocContent.a9f68c91.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
zyplayer-doc-api/src/main/resources/dist/assets/DocInfo.3c0ecd1f.js
vendored
Normal file
1
zyplayer-doc-api/src/main/resources/dist/assets/DocInfo.3c0ecd1f.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
import{u as S,a9 as w,r as c,o as a,c as l,w as t,a as o,k as g,t as n,b as i,F as f,s,e as m,d as M}from"./vendor.6399378c.js";import{m as B}from"./index.086d0536.js";import{_ as C}from"./main.5fd30069.js";const N={setup(){const _=S(),D=w(()=>_.state.swaggerDoc),u=w(()=>_.state.swaggerDoc.info),e=w(()=>_.state.swaggerMethodStatistic);return{swaggerDoc:D,swaggerDocInfo:u,swaggerMethodStatistic:e,getDescription:I=>B.exports.markdownIt.render(I||"")}}},V=["href"],j=["href"],L=["href"],O=["innerHTML"],T={key:1,style:{"text-align":"center"}};function E(_,D,u,e,p,I){const r=c("a-form-item"),h=c("a-divider"),v=c("a-statistic"),k=c("a-card"),b=c("a-col"),y=c("a-row"),x=c("a-form");return a(),l(k,null,{default:t(()=>[e.swaggerDocInfo?(a(),l(x,{key:0,"label-col":{span:4},"wrapper-col":{span:20}},{default:t(()=>[o(r,{label:"\u6807\u9898"},{default:t(()=>[g(n(e.swaggerDocInfo.title),1)]),_:1}),o(r,{label:"\u7248\u672C"},{default:t(()=>[g(n(e.swaggerDocInfo.version),1)]),_:1}),e.swaggerDocInfo.contact?(a(),l(r,{key:0,label:"\u4F5C\u8005"},{default:t(()=>[e.swaggerDocInfo.contact.name?(a(),i(f,{key:0},[g(n(e.swaggerDocInfo.contact.name),1)],64)):s("",!0),e.swaggerDocInfo.contact.email?(a(),i(f,{key:1},[o(h,{type:"vertical"}),g(n(e.swaggerDocInfo.contact.email),1)],64)):s("",!0),e.swaggerDocInfo.contact.url?(a(),i(f,{key:2},[o(h,{type:"vertical"}),m("a",{href:e.swaggerDocInfo.contact.url,target:"_blank"},n(e.swaggerDocInfo.contact.url),9,V)],64)):s("",!0)]),_:1})):s("",!0),o(r,{label:"host"},{default:t(()=>[g(n(e.swaggerDoc.host),1)]),_:1}),e.swaggerDocInfo.license?(a(),l(r,{key:1,label:"\u8BB8\u53EF\u8BC1"},{default:t(()=>[m("a",{href:e.swaggerDocInfo.license.url,target:"_blank"},n(e.swaggerDocInfo.license.name),9,j)]),_:1})):s("",!0),e.swaggerDocInfo.termsOfService?(a(),l(r,{key:2,label:"\u670D\u52A1\u6761\u6B3E"},{default:t(()=>[m("a",{href:e.swaggerDocInfo.termsOfService,target:"_blank"},n(e.swaggerDocInfo.termsOfService),9,L)]),_:1})):s("",!0),o(r,{label:"\u6587\u6863\u8BF4\u660E"},{default:t(()=>[m("div",{class:"markdown-body",innerHTML:e.getDescription(e.swaggerDocInfo.description)},null,8,O)]),_:1}),o(r,{label:"\u63A5\u53E3\u7EDF\u8BA1"},{default:t(()=>[o(y,{gutter:[16,16]},{default:t(()=>[(a(),i(f,null,M(["get","post","put","delete","head","patch","options","trace","total"],d=>(a(),i(f,null,[e.swaggerMethodStatistic[d]?(a(),l(b,{key:0,span:6},{default:t(()=>[o(k,{size:"small"},{default:t(()=>[o(v,{title:d==="total"?"\u603B\u8BA1":d.toUpperCase()+"\u65B9\u6CD5",value:e.swaggerMethodStatistic[d],suffix:"\u4E2A"},null,8,["title","value"])]),_:2},1024)]),_:2},1024)):s("",!0)],64))),64))]),_:1})]),_:1})]),_:1})):(a(),i("div",T,"\u6682\u65E0\u6587\u6863\u4FE1\u606F\uFF0C\u8BF7\u5148\u9009\u62E9\u6587\u6863"))]),_:1})}var U=C(N,[["render",E]]);export{U as default};
|
||||
1
zyplayer-doc-api/src/main/resources/dist/assets/DocInfo.a6a45177.js
vendored
Normal file
1
zyplayer-doc-api/src/main/resources/dist/assets/DocInfo.a6a45177.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
import{u as S,a9 as D,r as i,o as t,c as l,w as o,a as n,k as p,t as c,b as s,F as f,s as r,e as m,d as w}from"./vendor.6399378c.js";import{m as M}from"./index.086d0536.js";import{_ as B}from"./main.5fd30069.js";const C={setup(){const _=S(),A=D(()=>_.state.openApiDoc),u=D(()=>_.state.openApiDoc.info),e=D(()=>_.state.openApiMethodStatistic);return{openApiDoc:A,openApiDocInfo:u,openApiMethodStatistic:e,getDescription:I=>M.exports.markdownIt.render(I||"")}}},N=["href"],V=["href"],j=["href"],L=["innerHTML"],O={key:1,style:{"text-align":"center"}};function T(_,A,u,e,v,I){const a=i("a-form-item"),h=i("a-divider"),b=i("a-statistic"),k=i("a-card"),y=i("a-col"),g=i("a-row"),x=i("a-form");return t(),l(k,null,{default:o(()=>[e.openApiDocInfo?(t(),l(x,{key:0,"label-col":{span:4},"wrapper-col":{span:20}},{default:o(()=>[n(a,{label:"\u6807\u9898"},{default:o(()=>[p(c(e.openApiDocInfo.title),1)]),_:1}),n(a,{label:"\u7248\u672C"},{default:o(()=>[p(c(e.openApiDocInfo.version),1)]),_:1}),e.openApiDocInfo.contact?(t(),l(a,{key:0,label:"\u4F5C\u8005"},{default:o(()=>[e.openApiDocInfo.contact.name?(t(),s(f,{key:0},[p(c(e.openApiDocInfo.contact.name),1)],64)):r("",!0),e.openApiDocInfo.contact.email?(t(),s(f,{key:1},[n(h,{type:"vertical"}),p(c(e.openApiDocInfo.contact.email),1)],64)):r("",!0),e.openApiDocInfo.contact.url?(t(),s(f,{key:2},[n(h,{type:"vertical"}),m("a",{href:e.openApiDocInfo.contact.url,target:"_blank"},c(e.openApiDocInfo.contact.url),9,N)],64)):r("",!0)]),_:1})):r("",!0),n(a,{label:"host"},{default:o(()=>[p(c(e.openApiDoc.host),1)]),_:1}),e.openApiDocInfo.license?(t(),l(a,{key:1,label:"\u8BB8\u53EF\u8BC1"},{default:o(()=>[m("a",{href:e.openApiDocInfo.license.url,target:"_blank"},c(e.openApiDocInfo.license.name),9,V)]),_:1})):r("",!0),e.openApiDocInfo.termsOfService?(t(),l(a,{key:2,label:"\u670D\u52A1\u6761\u6B3E"},{default:o(()=>[m("a",{href:e.openApiDocInfo.termsOfService,target:"_blank"},c(e.openApiDocInfo.termsOfService),9,j)]),_:1})):r("",!0),n(a,{label:"\u6587\u6863\u8BF4\u660E"},{default:o(()=>[m("div",{class:"markdown-body",innerHTML:e.getDescription(e.openApiDocInfo.description)},null,8,L)]),_:1}),n(a,{label:"\u63A5\u53E3\u7EDF\u8BA1"},{default:o(()=>[n(g,{gutter:[16,16]},{default:o(()=>[(t(),s(f,null,w(["get","post","put","delete","head","patch","options","trace","total"],d=>(t(),s(f,null,[e.openApiMethodStatistic[d]?(t(),l(y,{key:0,span:6},{default:o(()=>[n(k,{size:"small"},{default:o(()=>[n(b,{title:d==="total"?"\u603B\u8BA1":d.toUpperCase()+"\u65B9\u6CD5",value:e.openApiMethodStatistic[d],suffix:"\u4E2A"},null,8,["title","value"])]),_:2},1024)]),_:2},1024)):r("",!0)],64))),64))]),_:1})]),_:1})]),_:1})):(t(),s("div",O,"\u6682\u65E0\u6587\u6863\u4FE1\u606F\uFF0C\u8BF7\u5148\u9009\u62E9\u6587\u6863"))]),_:1})}var z=B(C,[["render",T]]);export{z as default};
|
||||
15
zyplayer-doc-api/src/main/resources/dist/assets/DocManage.a533db9b.js
vendored
Normal file
15
zyplayer-doc-api/src/main/resources/dist/assets/DocManage.a533db9b.js
vendored
Normal file
File diff suppressed because one or more lines are too long
4
zyplayer-doc-api/src/main/resources/dist/assets/DocView.30c1d926.js
vendored
Normal file
4
zyplayer-doc-api/src/main/resources/dist/assets/DocView.30c1d926.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
zyplayer-doc-api/src/main/resources/dist/assets/DocView.450b6e2d.js
vendored
Normal file
1
zyplayer-doc-api/src/main/resources/dist/assets/DocView.450b6e2d.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
import{v as y,u as j,y as n,W as k,r as h,o as g,c as v,w,B as x,e as D}from"./vendor.6399378c.js";import{D as I,o as _}from"./DocContent.6940f3d1.js";import{m as M}from"./index.086d0536.js";import{_ as q}from"./main.5fd30069.js";import"./logUtil.6309fa68.js";const C={components:{DocContent:I},setup(){const a=y(),t=j();let p=n("doc"),o=n([]),r=n([]),i=n({url:"",description:"",method:"",consumes:"",produces:""}),s=n(!1),c=0,l;const m=()=>{let P=a.query.path+"."+a.query.method;if(Object.keys(t.state.openApiUrlMethodMap).length<=0){console.log("\u6587\u6863\u5C1A\u672A\u52A0\u8F7D\uFF0C\u7B49\u5F85\u52A0\u8F7D\u5B8C\u6210"),l||(l=setInterval(()=>{if(s.value||c++>50){clearInterval(l);return}Object.keys(t.state.openApiUrlMethodMap).length>0&&(console.log("\u6587\u6863\u5185\u5BB9\u6539\u53D8\uFF0C\u91CD\u65B0\u52A0\u8F7D\u6587\u6863"),m())},1e3));return}let e=t.state.openApiUrlMethodMap[P];if(!e){x.error("\u6CA1\u6709\u627E\u5230\u5BF9\u5E94\u7684\u6587\u6863");return}s.value=!0,t.commit("addTableName",{key:a.fullPath,val:e.summary});let d="",u="";e.consumes&&e.consumes.length>0&&(d=e.consumes.join(" ")),e.produces&&e.produces.length>0&&(u=e.produces.join(" "));let L=M.exports.markdownIt.render(e.description||e.summary||"");i.value={url:e.url,description:L,method:e.method||"",consumes:d,produces:u};let f=t.state.openApiComponents;o.value=_.getRequestParamList(e.parameters,f),r.value=_.getResponseParamList(e.responses,f)};return k(()=>{m()}),{docInfoShow:i,activePage:p,changePage:()=>{},isLoadSuccess:s,requestParamList:o,responseParamList:r}}},S=D("div",{style:{padding:"20px 0",height:"100px"}},null,-1);function A(a,t,p,o,r,i){const s=h("DocContent"),c=h("a-spin");return o.isLoadSuccess?(g(),v(s,{key:0,docInfoShow:o.docInfoShow,requestParamList:o.requestParamList,responseParamList:o.responseParamList},null,8,["docInfoShow","requestParamList","responseParamList"])):(g(),v(c,{key:1,tip:"\u6587\u6863\u6570\u636E\u52A0\u8F7D\u4E2D..."},{default:w(()=>[S]),_:1}))}var T=q(C,[["render",A]]);export{T as default};
|
||||
4
zyplayer-doc-api/src/main/resources/dist/assets/DocView.886e96fc.js
vendored
Normal file
4
zyplayer-doc-api/src/main/resources/dist/assets/DocView.886e96fc.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
zyplayer-doc-api/src/main/resources/dist/assets/DocView.b621f695.js
vendored
Normal file
1
zyplayer-doc-api/src/main/resources/dist/assets/DocView.b621f695.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
import{v as L,u as y,y as a,W as j,r as g,o as h,c as v,w as D,B as k,e as x}from"./vendor.6399378c.js";import{D as I,s as _}from"./DocContent.a9f68c91.js";import{m as M}from"./index.086d0536.js";import{_ as q}from"./main.5fd30069.js";import"./logUtil.6309fa68.js";const S={components:{DocContent:I},setup(){const r=L(),s=y();let m=a("doc"),t=a([]),n=a([]),c=a({url:"",description:"",method:"",consumes:"",produces:""}),o=a(!1),i=0,l;const u=()=>{let P=r.query.path+"."+r.query.method;if(Object.keys(s.state.swaggerUrlMethodMap).length<=0){console.log("\u6587\u6863\u5C1A\u672A\u52A0\u8F7D\uFF0C\u7B49\u5F85\u52A0\u8F7D\u5B8C\u6210"),l||(l=setInterval(()=>{if(o.value||i++>50){clearInterval(l);return}Object.keys(s.state.swaggerUrlMethodMap).length>0&&(console.log("\u6587\u6863\u5185\u5BB9\u6539\u53D8\uFF0C\u91CD\u65B0\u52A0\u8F7D\u6587\u6863"),u())},1e3));return}let e=s.state.swaggerUrlMethodMap[P];if(!e){k.error("\u6CA1\u6709\u627E\u5230\u5BF9\u5E94\u7684\u6587\u6863");return}o.value=!0,s.commit("addTableName",{key:r.fullPath,val:e.summary});let d="",p="";e.consumes&&e.consumes.length>0&&(d=e.consumes.join(" ")),e.produces&&e.produces.length>0&&(p=e.produces.join(" "));let w=M.exports.markdownIt.render(e.description||e.summary||"");c.value={url:e.url,description:w,method:e.method||"",consumes:d,produces:p};let f=s.state.swaggerDefinitions;t.value=_.getRequestParamList(e.parameters,f),n.value=_.getResponseParamList(e.responses,f)};return j(()=>{u()}),{docInfoShow:c,activePage:m,changePage:()=>{},isLoadSuccess:o,requestParamList:t,responseParamList:n}}},C=x("div",{style:{padding:"20px 0",height:"100px"}},null,-1);function B(r,s,m,t,n,c){const o=g("DocContent"),i=g("a-spin");return t.isLoadSuccess?(h(),v(o,{key:0,docInfoShow:t.docInfoShow,requestParamList:t.requestParamList,responseParamList:t.responseParamList},null,8,["docInfoShow","requestParamList","responseParamList"])):(h(),v(i,{key:1,tip:"\u6587\u6863\u6570\u636E\u52A0\u8F7D\u4E2D..."},{default:D(()=>[C]),_:1}))}var V=q(S,[["render",B]]);export{V as default};
|
||||
1
zyplayer-doc-api/src/main/resources/dist/assets/EditGlobalParam.ede9d5a9.js
vendored
Normal file
1
zyplayer-doc-api/src/main/resources/dist/assets/EditGlobalParam.ede9d5a9.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
var K=Object.defineProperty;var I=Object.getOwnPropertySymbols;var N=Object.prototype.hasOwnProperty,O=Object.prototype.propertyIsEnumerable;var B=(s,e,a)=>e in s?K(s,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):s[e]=a,x=(s,e)=>{for(var a in e||(e={}))N.call(e,a)&&B(s,a,e[a]);if(I)for(var a of I(e))O.call(e,a)&&B(s,a,e[a]);return s};import{z as V}from"./custom.471d0de0.js";import{P as S,a4 as U,R as j,u as A,y as L,W as F,r as m,o as l,b as u,e as z,a as d,w as n,F as f,c as k,t as G,s as g,B as R,k as c}from"./vendor.6399378c.js";import{_ as H}from"./main.5fd30069.js";const q={components:{PlusOutlined:S,SearchOutlined:U,ReloadOutlined:j},props:{dynamicParam:{type:Object,required:!0}},setup(s){const e=A();let a=L([]),t=L(!1);const h=async()=>{i.value={},t.value=!0,V.docApiGlobalParamList(s.dynamicParam).then(o=>{setTimeout(()=>t.value=!1,500),a.value=o.data||[],e.commit("setGlobalParamOnChange",a.value,s.dynamicParam.id)})};let i=L({}),D=L();const p=()=>{i.value.isEdit&&v(i.value);let o={isEdit:!0,paramType:1};a.value.unshift(o),i.value=o,setTimeout(()=>{let r=document.getElementsByClassName("ant-table-body")[0];r.scrollTop=0},0)},P=o=>{i.value.isEdit&&v(i.value),o.isEdit=!0,i.value=x({},o)},v=o=>{o.isEdit=!1,o.id?a.value.forEach(r=>r.isEdit=!1):a.value=a.value.filter(r=>r!==o),i.value={}},E=o=>{if(!i.value.paramKey||!i.value.paramValue){R.error("\u53C2\u6570\u540D\u6216\u53C2\u6570\u503C\u4E0D\u80FD\u4E3A\u7A7A");return}let r=x(x({},s.dynamicParam),i.value);V.docApiGlobalParamUpdate(r).then(w=>{o.isEdit=!1,h()})},T=async o=>{V.docApiGlobalParamUpdate({id:o.id,yn:0}).then(r=>{h()})};return F(()=>{h()}),{docList:a,docListLoading:t,docEdit:i,tableRef:D,searchDocList:h,deleteDoc:T,editDoc:P,saveEditDoc:E,cancelEditDoc:v,addDocLine:p,docListColumns:[{title:"\u53C2\u6570\u540D\u79F0",dataIndex:"paramKey",width:250},{title:"\u53C2\u6570\u503C",dataIndex:"paramValue"},{title:"\u53C2\u6570\u4F4D\u7F6E",dataIndex:"paramType",width:120},{title:"\u64CD\u4F5C",dataIndex:"operation",fixed:"right",width:170}]}}},M={style:{"margin-bottom":"10px","text-align":"right"}},W=c(" \u5237\u65B0"),J=c(" \u65B0\u5EFA"),Q={key:1},X={key:1},Y=c("Form"),Z=c("Header"),$=c("Cookie"),ee=c("Form"),ae=c("Header"),te=c("Cookie"),oe=c("\u53D6\u6D88"),ne=c("\u4FDD\u5B58"),le=c("\u7F16\u8F91"),ie=c("\u5220\u9664");function de(s,e,a,t,h,i){const D=m("reload-outlined"),p=m("a-button"),P=m("plus-outlined"),v=m("a-input"),E=m("a-select-option"),T=m("a-select"),o=m("a-tag"),r=m("a-popconfirm"),w=m("a-table");return l(),u(f,null,[z("div",M,[d(p,{onClick:t.searchDocList,type:"primary"},{icon:n(()=>[d(D)]),default:n(()=>[W]),_:1},8,["onClick"]),d(p,{onClick:t.addDocLine},{icon:n(()=>[d(P)]),default:n(()=>[J]),_:1},8,["onClick"])]),d(w,{dataSource:t.docList,columns:t.docListColumns,size:"middle",id:"paramTable",loading:t.docListLoading,pagination:!1,scroll:{x:1e3,y:"calc(100vh - 240px)"}},{bodyCell:n(({column:b,text:C,record:y})=>[b.dataIndex==="paramKey"?(l(),u(f,{key:0},[y.isEdit?(l(),k(v,{key:0,placeholder:"\u8BF7\u8F93\u5165\u53C2\u6570\u540D\u79F0",value:t.docEdit.paramKey,"onUpdate:value":e[0]||(e[0]=_=>t.docEdit.paramKey=_)},null,8,["value"])):(l(),u("span",Q,G(C),1))],64)):g("",!0),b.dataIndex==="paramValue"?(l(),u(f,{key:1},[y.isEdit?(l(),k(v,{key:0,rows:1,placeholder:"\u8BF7\u8F93\u5165\u53C2\u6570\u503C",value:t.docEdit.paramValue,"onUpdate:value":e[1]||(e[1]=_=>t.docEdit.paramValue=_)},null,8,["value"])):(l(),u("span",X,G(C),1))],64)):g("",!0),b.dataIndex==="paramType"?(l(),u(f,{key:2},[y.isEdit?(l(),k(T,{key:0,placeholder:"\u53C2\u6570\u4F4D\u7F6E",value:t.docEdit.paramType,"onUpdate:value":e[2]||(e[2]=_=>t.docEdit.paramType=_),style:{width:"110px"}},{default:n(()=>[d(E,{value:1},{default:n(()=>[Y]),_:1}),d(E,{value:2},{default:n(()=>[Z]),_:1}),d(E,{value:3},{default:n(()=>[$]),_:1})]),_:1},8,["value"])):(l(),u(f,{key:1},[C===1?(l(),k(o,{key:0,color:"green"},{default:n(()=>[ee]),_:1})):C===2?(l(),k(o,{key:1,color:"pink"},{default:n(()=>[ae]),_:1})):C===3?(l(),k(o,{key:2,color:"pink"},{default:n(()=>[te]),_:1})):g("",!0)],64))],64)):g("",!0),b.dataIndex==="operation"?(l(),u(f,{key:3},[y.isEdit?(l(),u(f,{key:0},[d(p,{type:"link",onClick:_=>t.cancelEditDoc(y)},{default:n(()=>[oe]),_:2},1032,["onClick"]),d(p,{type:"link",onClick:_=>t.saveEditDoc(y)},{default:n(()=>[ne]),_:2},1032,["onClick"])],64)):(l(),u(f,{key:1},[d(p,{type:"link",onClick:_=>t.editDoc(y)},{default:n(()=>[le]),_:2},1032,["onClick"]),d(r,{title:"\u786E\u5B9A\u8981\u5220\u9664\u5417\uFF1F",onConfirm:_=>t.deleteDoc(y)},{default:n(()=>[d(p,{type:"link",danger:""},{default:n(()=>[ie]),_:1})]),_:2},1032,["onConfirm"])],64))],64)):g("",!0)]),_:1},8,["dataSource","columns","loading","scroll"])],64)}var _e=H(q,[["render",de]]);export{_e as E};
|
||||
6
zyplayer-doc-api/src/main/resources/dist/assets/GlobalLayout.2de3b47d.js
vendored
Normal file
6
zyplayer-doc-api/src/main/resources/dist/assets/GlobalLayout.2de3b47d.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
zyplayer-doc-api/src/main/resources/dist/assets/GlobalLayout.5837e500.js
vendored
Normal file
1
zyplayer-doc-api/src/main/resources/dist/assets/GlobalLayout.5837e500.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
zyplayer-doc-api/src/main/resources/dist/assets/GlobalParam.1c8aaa70.js
vendored
Normal file
1
zyplayer-doc-api/src/main/resources/dist/assets/GlobalParam.1c8aaa70.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
import"./custom.471d0de0.js";import{E as a}from"./EditGlobalParam.ede9d5a9.js";import{_ as r}from"./main.5fd30069.js";import{r as t,o as e,c as s}from"./vendor.6399378c.js";const m={components:{EditGlobalParam:a},setup(){return{}}};function n(c,d,p,l,i,_){const o=t("EditGlobalParam");return e(),s(o,{"dynamic-param":{docId:0}})}var G=r(m,[["render",n]]);export{G as default};
|
||||
1
zyplayer-doc-api/src/main/resources/dist/assets/SettingView.20a81c98.js
vendored
Normal file
1
zyplayer-doc-api/src/main/resources/dist/assets/SettingView.20a81c98.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
import{_ as e}from"./main.5fd30069.js";import{o as t,b as o}from"./vendor.6399378c.js";const n={name:"SettingView",components:{},data(){return{}},computed:{},mounted(){},methods:{}};function r(a,s,c,m,d,i){return t(),o("div",null," \u5C55\u793A\u914D\u7F6E\u9875\u9762 ")}var f=e(n,[["render",r]]);export{f as default};
|
||||
1
zyplayer-doc-api/src/main/resources/dist/assets/ShareHome.f7a7e61e.js
vendored
Normal file
1
zyplayer-doc-api/src/main/resources/dist/assets/ShareHome.f7a7e61e.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
import{u as p,y as g,W as f,N as x,o as i,b as l,e as _,F as k,d as L,af as N,ag as C,t as I,a9 as S,r as m,a as v,w as u,c as H,s as A}from"./vendor.6399378c.js";import{m as T}from"./index.086d0536.js";import{_ as y}from"./main.5fd30069.js";const D={props:{heading:{type:Array,default:[]}},setup(r){const s=p();let a=g("100px");f(()=>{window.onresize=()=>{n()},setTimeout(()=>{n()},100)}),x(s.getters.getLeftAsideWidth,()=>{n()});let e=g();const n=()=>{a.value=window.getComputedStyle(e.value,null).width};return{navigationRef:e,navigationWidth:a,headingItemClick:t=>{t.node.scrollIntoView({behavior:"smooth",block:"start",inline:"nearest"})}}}},b={class:"navigation"},W={ref:"navigationRef",style:{display:"inline-block",width:"100%",height:"1px"}},B=["onClick"];function M(r,s,a,e,n,c){return i(),l("div",b,[_("div",W,null,512),_("div",{class:"navigation-heading",style:N({width:e.navigationWidth})},[(i(!0),l(k,null,L(a.heading,t=>(i(),l("div",{class:C("heading-item heading-"+t.level),onClick:o=>e.headingItemClick(t)},I(t.text),11,B))),256))],4)])}var R=y(D,[["render",M]]);const V={components:{Navigation:R},setup(){const r=p(),s=S(()=>r.state.apiDoc);let a=g();x(r.getters.getApiDoc,()=>{setTimeout(()=>{c(".share-instruction")},100)});const e=t=>T.exports.markdownIt.render(t||"");let n=g([]);const c=t=>{if(!document.querySelector(t))return[];let o=document.querySelector(t).querySelectorAll("h1,h2,h3,h4,h5,h6");if(o.length<=0)return[];let d=[];o.forEach(h=>{let w=h.innerHTML.replace(/^\s+/g,"").replace(/\s+$/g,"").replace(/<\/?[^>]+(>|$)/g,"");d.push({node:h,level:parseInt(h.tagName.replace(/[h]/i,""),10),text:w})}),n.value=d};return f(()=>{}),{apiDoc:s,navigationRef:a,navigationList:n,markdownToHtml:e}}},$={key:0},j=["innerHTML"],q={key:1,style:{"text-align":"center"}};function z(r,s,a,e,n,c){const t=m("Navigation"),o=m("a-col"),d=m("a-row");return e.apiDoc.shareInstruction?(i(),l("div",$,[v(d,null,{default:u(()=>[e.navigationList.length>0?(i(),H(o,{key:0,xs:0,sm:4,md:4,lg:6,xl:6},{default:u(()=>[v(t,{ref:"navigationRef",heading:e.navigationList},null,8,["heading"])]),_:1})):A("",!0),v(o,{xs:24,sm:e.navigationList.length>0?20:24,md:e.navigationList.length>0?20:24,lg:e.navigationList.length>0?18:24,xl:e.navigationList.length>0?18:24},{default:u(()=>[_("div",{class:"markdown-body share-instruction",innerHTML:e.markdownToHtml(e.apiDoc.shareInstruction),style:{margin:"0 auto","max-width":"1000px"}},null,8,j)]),_:1},8,["sm","md","lg","xl"])]),_:1})])):(i(),l("div",q,"\u6B22\u8FCE\u8BBF\u95EE\u5F00\u653EAPI\u6587\u6863"))}var G=y(V,[["render",z]]);export{G as default};
|
||||
BIN
zyplayer-doc-api/src/main/resources/dist/assets/api-logo.952f0c92.png
vendored
Normal file
BIN
zyplayer-doc-api/src/main/resources/dist/assets/api-logo.952f0c92.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 8.7 KiB |
1
zyplayer-doc-api/src/main/resources/dist/assets/api-logo.e800ca99.js
vendored
Normal file
1
zyplayer-doc-api/src/main/resources/dist/assets/api-logo.e800ca99.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
var E=Object.defineProperty,I=Object.defineProperties;var O=Object.getOwnPropertyDescriptors;var L=Object.getOwnPropertySymbols;var b=Object.prototype.hasOwnProperty,D=Object.prototype.propertyIsEnumerable;var x=(r,e,t)=>e in r?E(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,m=(r,e)=>{for(var t in e||(e={}))b.call(e,t)&&x(r,t,e[t]);if(L)for(var t of L(e))D.call(e,t)&&x(r,t,e[t]);return r},_=(r,e)=>I(r,O(e));import{_ as k}from"./main.5fd30069.js";import{W as M,y as v,o as j,b as z,e as R}from"./vendor.6399378c.js";const A=["get","head","post","put","patch","delete","options","trace"];function q(r){let e={},t={},n={},h=r.paths;return h?(Object.keys(h).forEach(o=>{let l=h[o];for(let a of A){if(!l[a]||!l[a].tags)continue;let i=a.toLowerCase();n[i]=(n[i]||0)+1,n.total=(n.total||0)+1,l[a].tags.forEach(f=>{let d=e[f];d||(d=e[f]={});let s=d[o];s||(s=d[o]={});let c=o+"."+a;s[a]=l[a],s[a].path=c,s[a].url=o,s[a].method=a,t[c]=l[a]})}}),{urlMethodMap:t,tagPathMap:e,methodStatistic:n}):{urlMethodMap:t,tagPathMap:e,methodStatistic:n}}function G(r,e,t,n){let h=[],o=1,l=r.tags||[];return l.length<=0&&Object.keys(e).forEach(a=>l.push({name:a})),l.forEach(a=>{let i=1,f=[],d=e[a.name];!d||(Object.keys(d).forEach(s=>{let c=1,p=d[s];Object.keys(p).forEach(y=>{let g=o+"_"+i+"_"+c,u=p[y];if(!$(s,u,t))return;u.treeId=g;let T=u.summary||u.path;f.push({title:T,key:g,isLeaf:!0,method:u.method,query:_(m({},n),{path:u.url,method:u.method})}),c++}),i++}),f.length>0&&h.push({title:a.name,key:o,children:f}),o++)}),[{key:"main",title:r.info.title||"Swagger\u63A5\u53E3\u6587\u6863",children:h}]}function $(r,e,t){if(!t||!r||(r=r.toLowerCase(),t=t.toLowerCase(),r.indexOf(t)>=0))return!0;let n=e.path+e.method+e.summary+e.description+e.tags;return n&&n.toLowerCase().indexOf(t)>=0}const P=["get","head","post","put","patch","delete","options","trace"];function H(r){let e={},t={},n={},h=r.paths;return h?(Object.keys(h).forEach(o=>{let l=h[o];for(let a of P){if(!l[a]||!l[a].tags)continue;let i=a.toLowerCase();n[i]=(n[i]||0)+1,n.total=(n.total||0)+1,l[a].tags.forEach(f=>{let d=e[f];d||(d=e[f]={});let s=d[o];s||(s=d[o]={});let c=o+"."+a;s[a]=l[a],s[a].path=c,s[a].url=o,s[a].method=a,t[c]=l[a]})}}),{urlMethodMap:t,tagPathMap:e,methodStatistic:n}):{urlMethodMap:t,tagPathMap:e,methodStatistic:n}}function J(r,e,t,n){let h=[],o=1,l=r.tags||[];return l.length<=0&&Object.keys(e).forEach(a=>l.push({name:a})),l.forEach(a=>{let i=1,f=[],d=e[a.name];!d||(Object.keys(d).forEach(s=>{let c=1,p=d[s];Object.keys(p).forEach(y=>{let g=o+"_"+i+"_"+c,u=p[y];if(!B(s,u,t))return;u.treeId=g;let T=u.summary||u.path;f.push({title:T,key:g,isLeaf:!0,method:u.method,query:_(m({},n),{path:u.url,method:u.method})}),c++}),i++}),f.length>0&&h.push({title:a.name,key:o,children:f}),o++)}),[{key:"main",title:r.info.title||"OpenApi\u63A5\u53E3\u6587\u6863",children:h}]}function B(r,e,t){if(!t||!r||(r=r.toLowerCase(),t=t.toLowerCase(),r.indexOf(t)>=0))return!0;let n=e.path+e.method+e.summary+e.description+e.tags;return n&&n.toLowerCase().indexOf(t)>=0}function K(r,e,t,n){let h=r[0],o=C(h,e,t,n,1);return[{key:"main",isLeaf:!1,title:h.name||"\u81EA\u5EFAAPI\u63A5\u53E3\u6587\u6863",children:o}]}function C(r,e,t,n,h){let o=[];if(!r)return o;let l=1,a=1;return r.children&&r.children.length>0&&r.children.forEach(i=>{n.originNodeMap[i.nodeId]=i;let f=h+"_"+l+"_"+a;if(i.nodeType===1)o.push({title:i.nodeName,key:f,isLeaf:!0,method:i.method,nodeId:i.nodeId,query:_(m({},t),{nodeId:i.nodeId})}),a++;else{let d=C(i,e,t,n,f),s=U(i,e);(d.length>0||s)&&(o.push({title:i.nodeName,key:f,nodeId:i.nodeId,isLeaf:!1,editing:!1,titleEditing:i.nodeName,children:d}),a++)}}),l++,o}function U(r,e){if(!e||!r)return!0;e=e.toLowerCase();let t=r.name;return t&&t.toLowerCase().indexOf(e)>=0}const w={emits:["update:value","change"],setup(r,{emit:e}){M(()=>{o()});let t=v(300),n=v(),h=v();const o=()=>{let l=n.value,a=h.value;l.onmousedown=i=>{let f=i.clientX;return l.style.background="#ccc",a.style.background="#aaa",l.left=l.offsetLeft,document.onmousemove=d=>{let s=d.clientX,c=f-s;(c<0&&t.value<600||c>0&&t.value>300)&&(f=s,t.value-=c,t.value<300&&(t.value=300),e("update:value",t.value),e("change",t.value))},document.onmouseup=()=>{l.style.background="#fafafa",a.style.background="#ccc",document.onmousemove=null,document.onmouseup=null},!1}};return{leftAsideWidth:t,leftResizeRef:n,leftResizeBarRef:h}}},F={ref:"leftResizeRef",class:"left-resize"},S={ref:"leftResizeBarRef"};function X(r,e,t,n,h,o){return j(),z("div",F,[R("i",S,"...",512)],512)}var Q=k(w,[["render",X],["__scopeId","data-v-33303c20"]]),Y="assets/api-logo.952f0c92.png";export{Q as L,Y as _,q as a,H as b,J as c,K as d,G as g};
|
||||
5
zyplayer-doc-api/src/main/resources/dist/assets/custom.471d0de0.js
vendored
Normal file
5
zyplayer-doc-api/src/main/resources/dist/assets/custom.471d0de0.js
vendored
Normal file
File diff suppressed because one or more lines are too long
BIN
zyplayer-doc-api/src/main/resources/dist/assets/fontello.0286fb90.eot
vendored
Normal file
BIN
zyplayer-doc-api/src/main/resources/dist/assets/fontello.0286fb90.eot
vendored
Normal file
Binary file not shown.
BIN
zyplayer-doc-api/src/main/resources/dist/assets/fontello.37711755.ttf
vendored
Normal file
BIN
zyplayer-doc-api/src/main/resources/dist/assets/fontello.37711755.ttf
vendored
Normal file
Binary file not shown.
72
zyplayer-doc-api/src/main/resources/dist/assets/fontello.82a2c2e3.svg
vendored
Normal file
72
zyplayer-doc-api/src/main/resources/dist/assets/fontello.82a2c2e3.svg
vendored
Normal file
@@ -0,0 +1,72 @@
|
||||
<?xml version="1.0" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg xmlns="http://www.w3.org/2000/svg">
|
||||
<metadata>Copyright (C) 2017 by original authors @ fontello.com</metadata>
|
||||
<defs>
|
||||
<font id="fontello" horiz-adv-x="1000" >
|
||||
<font-face font-family="fontello" font-weight="400" font-stretch="normal" units-per-em="1000" ascent="850" descent="-150" />
|
||||
<missing-glyph horiz-adv-x="1000" />
|
||||
<glyph glyph-name="bold" unicode="" d="M310 1q41-18 78-18 210 0 210 187 0 64-23 101-15 24-34 41t-38 26-45 14-47 6-53 1q-40 0-56-6 0-29 0-88t-1-88q0-5 0-38t0-54 2-47 7-37z m-8 417q23-4 61-4 46 0 80 7t61 25 42 50 14 79q0 39-16 68t-45 46-60 24-69 8q-28 0-73-7 0-28 3-84t2-85q0-15 0-45t-1-44q0-26 1-38z m-302-497l1 53q9 2 48 9t59 15q4 7 7 15t4 19 4 18 1 21 0 19v36q0 548-12 572-2 5-12 8t-25 6-28 4-27 3-17 2l-2 46q55 1 190 6t208 6q13 0 38-1t38 0q39 0 76-7t72-24 60-39 41-59 16-76q0-29-9-54t-22-40-36-32-41-25-47-22q86-20 144-75t57-138q0-56-20-101t-52-72-77-48-91-27-98-8q-25 0-74 2t-74 1q-59 0-171-6t-129-7z" horiz-adv-x="785.7" />
|
||||
|
||||
<glyph glyph-name="italic" unicode="" d="M0-78l10 48q12 4 34 9t40 11 33 13q16 19 23 56 1 4 35 162t63 303 29 165v14q-13 8-30 11t-39 4-32 3l10 58q19-1 67-4t84-4 67-1q27 0 55 1t68 4 54 4q-2-22-10-50-17-6-57-16t-60-19q-5-10-8-23t-5-23-4-25-4-24q-15-82-49-234t-43-198q-1-5-7-32t-11-51-9-46-4-32l1-10q9-3 103-18-2-24-9-55-6 0-18-1t-18-1q-16 0-49 6t-48 6q-77 1-115 1-28 0-79-5t-68-7z" horiz-adv-x="571.4" />
|
||||
|
||||
<glyph glyph-name="thumb-tack" unicode="" d="M650 779q12 0 24-5 19-8 29-23t11-35v-719q0-19-11-35t-29-23q-10-4-24-4-27 0-47 18l-246 236-246-236q-20-19-46-19-13 0-25 5-18 7-29 23t-11 35v719q0 19 11 35t29 23q12 5 25 5h585z" horiz-adv-x="714.3" />
|
||||
|
||||
<glyph glyph-name="link" unicode="" d="M813 171q0 23-16 38l-116 116q-16 16-38 16-24 0-40-18 1-1 10-10t12-12 9-11 7-14 2-15q0-23-16-38t-38-16q-8 0-15 2t-14 7-11 9-12 12-10 10q-19-17-19-40 0-23 16-38l115-116q15-15 38-15 22 0 38 15l82 81q16 16 16 37z m-393 394q0 22-15 38l-115 115q-16 16-38 16-22 0-38-15l-82-82q-16-15-16-37 0-22 16-38l116-116q15-15 38-15 23 0 40 17-2 2-11 11t-12 12-8 10-7 14-2 16q0 22 15 38t38 15q9 0 16-2t14-7 11-8 12-12 10-11q18 17 18 41z m500-394q0-66-48-113l-82-81q-46-47-113-47-68 0-114 48l-115 115q-46 47-46 114 0 68 49 116l-49 49q-48-49-116-49-67 0-114 47l-116 116q-47 47-47 114t47 113l82 82q47 46 114 46 67 0 114-47l115-116q46-46 46-113 0-69-49-117l49-49q48 49 116 49 67 0 114-47l116-116q47-47 47-114z" horiz-adv-x="928.6" />
|
||||
|
||||
<glyph glyph-name="picture-o" unicode="" d="M357 529q0-45-31-76t-76-32-76 32-31 76 31 76 76 31 76-31 31-76z m572-215v-250h-786v107l178 179 90-89 285 285z m53 393h-893q-7 0-12-5t-6-13v-678q0-7 6-13t12-5h893q7 0 13 5t5 13v678q0 8-5 13t-13 5z m89-18v-678q0-37-26-63t-63-27h-893q-36 0-63 27t-26 63v678q0 37 26 63t63 27h893q37 0 63-27t26-63z" horiz-adv-x="1071.4" />
|
||||
|
||||
<glyph glyph-name="repeat" unicode="" d="M857 707v-250q0-14-10-25t-26-11h-250q-23 0-32 23-10 22 7 38l77 77q-82 77-194 77-58 0-111-23t-91-61-61-91-23-111 23-111 61-91 91-61 111-23q66 0 125 29t100 82q4 6 13 7 8 0 14-5l76-77q5-4 6-11t-5-13q-60-74-147-114t-182-41q-87 0-167 34t-136 92-92 137-34 166 34 166 92 137 136 92 167 34q82 0 158-31t137-88l72 72q17 18 39 8 22-9 22-33z" horiz-adv-x="857.1" />
|
||||
|
||||
<glyph glyph-name="undo" unicode="" d="M857 350q0-87-34-166t-91-137-137-92-166-34q-96 0-183 41t-147 114q-4 6-4 13t5 11l76 77q6 5 14 5 9-1 13-7 41-53 100-82t126-29q58 0 110 23t92 61 61 91 22 111-22 111-61 91-92 61-110 23q-55 0-105-20t-90-57l77-77q17-16 8-38-10-23-33-23h-250q-15 0-25 11t-11 25v250q0 24 22 33 22 10 39-8l72-72q60 57 137 88t159 31q87 0 166-34t137-92 91-137 34-166z" horiz-adv-x="857.1" />
|
||||
|
||||
<glyph glyph-name="trash-o" unicode="" d="M286 439v-321q0-8-5-13t-13-5h-36q-8 0-13 5t-5 13v321q0 8 5 13t13 5h36q8 0 13-5t5-13z m143 0v-321q0-8-5-13t-13-5h-36q-8 0-13 5t-5 13v321q0 8 5 13t13 5h36q8 0 13-5t5-13z m142 0v-321q0-8-5-13t-12-5h-36q-8 0-13 5t-5 13v321q0 8 5 13t13 5h36q7 0 12-5t5-13z m72-404v529h-500v-529q0-12 4-22t8-15 6-5h464q2 0 6 5t8 15 4 22z m-375 601h250l-27 65q-4 5-9 6h-177q-6-1-10-6z m518-18v-36q0-8-5-13t-13-5h-54v-529q0-46-26-80t-63-34h-464q-37 0-63 33t-27 79v531h-53q-8 0-13 5t-5 13v36q0 8 5 13t13 5h172l39 93q9 21 31 35t44 15h178q23 0 44-15t30-35l39-93h173q8 0 13-5t5-13z" horiz-adv-x="785.7" />
|
||||
|
||||
<glyph glyph-name="floppy-o" unicode="" d="M214-7h429v214h-429v-214z m500 0h72v500q0 8-6 21t-11 20l-157 156q-5 6-19 12t-22 5v-232q0-22-15-38t-38-16h-322q-22 0-37 16t-16 38v232h-72v-714h72v232q0 22 16 38t37 16h465q22 0 38-16t15-38v-232z m-214 518v178q0 8-5 13t-13 5h-107q-7 0-13-5t-5-13v-178q0-7 5-13t13-5h107q7 0 13 5t5 13z m357-18v-518q0-22-15-38t-38-16h-750q-23 0-38 16t-16 38v750q0 22 16 38t38 16h517q23 0 50-12t42-26l156-157q16-15 27-42t11-49z" horiz-adv-x="857.1" />
|
||||
|
||||
<glyph glyph-name="compress" unicode="" d="M429 314v-250q0-14-11-25t-25-10-25 10l-81 81-185-186q-5-5-13-5t-12 5l-64 64q-6 6-6 13t6 13l185 185-80 80q-11 11-11 25t11 25 25 11h250q14 0 25-11t11-25z m421 375q0-7-6-12l-185-186 80-80q11-11 11-25t-11-25-25-11h-250q-14 0-25 11t-10 25v250q0 14 10 25t25 10 25-10l81-80 185 185q6 5 13 5t13-5l63-64q6-5 6-13z" horiz-adv-x="857.1" />
|
||||
|
||||
<glyph glyph-name="eye" unicode="" d="M929 314q-85 132-213 197 34-58 34-125 0-103-73-177t-177-73-177 73-73 177q0 67 34 125-128-65-213-197 75-114 187-182t242-68 243 68 186 182z m-402 215q0 11-8 19t-19 7q-70 0-120-50t-50-119q0-11 8-19t19-8 19 8 8 19q0 48 34 82t82 34q11 0 19 8t8 19z m473-215q0-19-11-38-78-129-210-206t-279-77-279 77-210 206q-11 19-11 38t11 39q78 128 210 205t279 78 279-78 210-205q11-20 11-39z" horiz-adv-x="1000" />
|
||||
|
||||
<glyph glyph-name="eye-slash" unicode="" d="M310 105l43 79q-48 35-76 88t-27 114q0 67 34 125-128-65-213-197 94-144 239-209z m217 424q0 11-8 19t-19 7q-70 0-120-50t-50-119q0-11 8-19t19-8 19 8 8 19q0 48 34 82t82 34q11 0 19 8t8 19z m202 106q0-4 0-5-59-105-176-316t-176-316l-28-50q-5-9-15-9-7 0-75 39-9 6-9 16 0 7 25 49-80 36-147 96t-117 137q-11 17-11 38t11 39q86 131 212 207t277 76q50 0 100-10l31 54q5 9 15 9 3 0 10-3t18-9 18-10 18-10 10-7q9-5 9-15z m21-249q0-78-44-142t-117-91l157 280q4-25 4-47z m250-72q0-19-11-38-22-36-61-81-84-96-194-149t-234-53l41 74q119 10 219 76t169 171q-65 100-158 164l35 63q53-36 102-85t81-103q11-19 11-39z" horiz-adv-x="1000" />
|
||||
|
||||
<glyph glyph-name="question-circle" unicode="" d="M500 82v107q0 8-5 13t-13 5h-107q-8 0-13-5t-5-13v-107q0-8 5-13t13-5h107q8 0 13 5t5 13z m143 375q0 49-31 91t-77 65-95 23q-136 0-207-119-9-13 4-24l74-55q4-4 10-4 9 0 14 7 30 38 48 51 19 14 48 14 27 0 48-15t21-33q0-21-11-34t-38-25q-35-15-65-48t-29-70v-20q0-8 5-13t13-5h107q8 0 13 5t5 13q0 10 12 27t30 28q18 10 28 16t25 19 25 27 16 34 7 45z m214-107q0-117-57-215t-156-156-215-58-216 58-155 156-58 215 58 215 155 156 216 58 215-58 156-156 57-215z" horiz-adv-x="857.1" />
|
||||
|
||||
<glyph glyph-name="times" unicode="" d="M724 112q0-22-15-38l-76-76q-16-15-38-15t-38 15l-164 165-164-165q-16-15-38-15t-38 15l-76 76q-16 16-16 38t16 38l164 164-164 164q-16 16-16 38t16 38l76 76q16 16 38 16t38-16l164-164 164 164q16 16 38 16t38-16l76-76q15-15 15-38t-15-38l-164-164 164-164q15-15 15-38z" horiz-adv-x="785.7" />
|
||||
|
||||
<glyph glyph-name="align-left" unicode="" d="M1000 100v-71q0-15-11-25t-25-11h-928q-15 0-25 11t-11 25v71q0 15 11 25t25 11h928q15 0 25-11t11-25z m-214 214v-71q0-15-11-25t-25-11h-714q-15 0-25 11t-11 25v71q0 15 11 25t25 11h714q15 0 25-11t11-25z m143 215v-72q0-14-11-25t-25-11h-857q-15 0-25 11t-11 25v72q0 14 11 25t25 10h857q14 0 25-10t11-25z m-215 214v-72q0-14-10-25t-25-10h-643q-15 0-25 10t-11 25v72q0 14 11 25t25 11h643q14 0 25-11t10-25z" horiz-adv-x="1000" />
|
||||
|
||||
<glyph glyph-name="align-center" unicode="" d="M1000 100v-71q0-15-11-25t-25-11h-928q-15 0-25 11t-11 25v71q0 15 11 25t25 11h928q15 0 25-11t11-25z m-214 214v-71q0-15-11-25t-25-11h-500q-14 0-25 11t-11 25v71q0 15 11 25t25 11h500q15 0 25-11t11-25z m143 215v-72q0-14-11-25t-25-11h-786q-14 0-25 11t-11 25v72q0 14 11 25t25 10h786q14 0 25-10t11-25z m-215 214v-72q0-14-10-25t-25-10h-358q-14 0-25 10t-10 25v72q0 14 10 25t25 11h358q14 0 25-11t10-25z" horiz-adv-x="1000" />
|
||||
|
||||
<glyph glyph-name="align-right" unicode="" d="M1000 100v-71q0-15-11-25t-25-11h-928q-15 0-25 11t-11 25v71q0 15 11 25t25 11h928q15 0 25-11t11-25z m0 214v-71q0-15-11-25t-25-11h-714q-14 0-25 11t-11 25v71q0 15 11 25t25 11h714q15 0 25-11t11-25z m0 215v-72q0-14-11-25t-25-11h-857q-14 0-25 11t-11 25v72q0 14 11 25t25 10h857q15 0 25-10t11-25z m0 214v-72q0-14-11-25t-25-10h-643q-14 0-25 10t-10 25v72q0 14 10 25t25 11h643q15 0 25-11t11-25z" horiz-adv-x="1000" />
|
||||
|
||||
<glyph glyph-name="arrows-alt" unicode="" d="M716 548l-198-198 198-198 80 80q17 18 39 8 22-9 22-33v-250q0-14-10-25t-26-11h-250q-23 0-32 23-10 21 7 38l81 81-198 198-198-198 80-81q17-17 8-38-10-23-33-23h-250q-15 0-25 11t-11 25v250q0 24 22 33 22 10 39-8l80-80 198 198-198 198-80-80q-11-11-25-11-7 0-14 3-22 9-22 33v250q0 14 11 25t25 11h250q23 0 33-23 9-21-8-38l-80-81 198-198 198 198-81 81q-17 17-7 38 9 23 32 23h250q15 0 26-11t10-25v-250q0-24-22-33-7-3-14-3-14 0-25 11z" horiz-adv-x="857.1" />
|
||||
|
||||
<glyph glyph-name="bars" unicode="" d="M857 100v-71q0-15-10-25t-26-11h-785q-15 0-25 11t-11 25v71q0 15 11 25t25 11h785q15 0 26-11t10-25z m0 286v-72q0-14-10-25t-26-10h-785q-15 0-25 10t-11 25v72q0 14 11 25t25 10h785q15 0 26-10t10-25z m0 285v-71q0-14-10-25t-26-11h-785q-15 0-25 11t-11 25v71q0 15 11 26t25 10h785q15 0 26-10t10-26z" horiz-adv-x="857.1" />
|
||||
|
||||
<glyph glyph-name="list-ul" unicode="" d="M214 64q0-44-31-76t-76-31-76 31-31 76 31 76 76 31 76-31 31-76z m0 286q0-45-31-76t-76-31-76 31-31 76 31 76 76 31 76-31 31-76z m786-232v-107q0-7-5-13t-13-5h-678q-8 0-13 5t-5 13v107q0 7 5 12t13 6h678q7 0 13-6t5-12z m-786 518q0-45-31-76t-76-31-76 31-31 76 31 76 76 31 76-31 31-76z m786-232v-108q0-7-5-12t-13-5h-678q-8 0-13 5t-5 12v108q0 7 5 12t13 5h678q7 0 13-5t5-12z m0 285v-107q0-7-5-12t-13-6h-678q-8 0-13 6t-5 12v107q0 8 5 13t13 5h678q7 0 13-5t5-13z" horiz-adv-x="1000" />
|
||||
|
||||
<glyph glyph-name="list-ol" unicode="" d="M213-54q0-45-31-70t-75-26q-60 0-96 37l31 49q28-25 60-25 16 0 28 8t12 24q0 35-59 31l-14 31q4 6 18 24t24 31 20 21v1q-9 0-27-1t-27 0v-30h-59v85h186v-49l-53-65q28-6 45-27t17-49z m1 350v-89h-202q-4 20-4 30 0 29 14 52t31 38 37 27 31 24 14 25q0 14-9 22t-22 7q-25 0-45-32l-47 33q13 28 40 44t59 16q40 0 68-23t28-63q0-28-19-51t-42-36-42-28-20-30h71v34h59z m786-178v-107q0-7-5-13t-13-5h-678q-8 0-13 5t-5 13v107q0 8 5 13t13 5h678q7 0 13-6t5-12z m-786 502v-56h-187v56h60q0 22 0 67t1 68v7h-1q-5-10-28-30l-40 42 76 71h59v-225h60z m786-216v-108q0-7-5-12t-13-5h-678q-8 0-13 5t-5 12v108q0 7 5 12t13 5h678q7 0 13-5t5-12z m0 285v-107q0-7-5-12t-13-6h-678q-8 0-13 6t-5 12v107q0 8 5 13t13 5h678q7 0 13-5t5-13z" horiz-adv-x="1000" />
|
||||
|
||||
<glyph glyph-name="strikethrough" unicode="" d="M982 350q8 0 13-5t5-13v-36q0-7-5-12t-13-5h-964q-8 0-13 5t-5 12v36q0 8 5 13t13 5h964z m-712 36q-16 19-29 44-27 55-27 105 0 101 75 173 74 71 219 71 28 0 94-11 36-7 98-27 6-21 12-66 8-68 8-102 0-10-3-25l-7-2-46 4-8 1q-28 83-58 114-49 51-117 51-64 0-101-33-38-32-38-81 0-41 37-78t156-72q38-12 96-37 33-16 53-29h-414z m283-143h229q4-22 4-51 0-62-23-119-13-31-40-58-20-19-61-45-44-27-85-37-45-12-113-12-64 0-109 13l-78 23q-32 8-40 15-5 5-5 12v8q0 60-1 87 0 17 0 38l1 20v25l57 1q8-19 17-40t12-31 7-15q20-32 45-52 24-20 59-32 33-12 73-12 36 0 78 15 43 14 68 48 26 34 26 72 0 47-45 87-19 16-76 40z" horiz-adv-x="1000" />
|
||||
|
||||
<glyph glyph-name="underline" unicode="" d="M27 726q-21 1-25 2l-2 49q7 1 22 1 34 0 63-3 74-4 93-4 47 0 93 2 65 2 82 3 31 0 48 1l-1-8 1-36v-5q-33-5-69-5-33 0-44-14-7-7-7-73 0-7 0-18t0-15l1-127 8-157q3-69 28-112 20-33 54-52 49-26 98-26 59 0 107 16 31 10 55 28 27 20 37 36 20 31 29 63 12 41 12 128 0 44-2 72t-6 68-8 89l-2 33q-3 37-13 49-19 20-43 19l-56-1-8 2 1 48h47l114-6q43-2 110 6l10-1q3-22 3-29 0-4-2-17-25-7-47-8-41-6-44-9-8-8-8-23 0-4 0-15t1-17q5-11 13-221 3-109-9-170-8-42-23-68-21-36-62-69-42-31-102-49-61-19-142-19-93 0-159 26-66 26-99 68-34 42-47 109-9 45-9 132v186q0 105-9 119-14 20-82 22z m830-787v36q0 8-5 13t-13 5h-821q-8 0-13-5t-5-13v-36q0-8 5-13t13-5h821q8 0 13 5t5 13z" horiz-adv-x="857.1" />
|
||||
|
||||
<glyph glyph-name="table" unicode="" d="M286 82v107q0 8-5 13t-13 5h-179q-7 0-12-5t-6-13v-107q0-8 6-13t12-5h179q8 0 13 5t5 13z m0 214v108q0 7-5 12t-13 5h-179q-7 0-12-5t-6-12v-108q0-7 6-12t12-5h179q8 0 13 5t5 12z m285-214v107q0 8-5 13t-12 5h-179q-8 0-13-5t-5-13v-107q0-8 5-13t13-5h179q7 0 12 5t5 13z m-285 429v107q0 8-5 13t-13 5h-179q-7 0-12-5t-6-13v-107q0-8 6-13t12-5h179q8 0 13 5t5 13z m285-215v108q0 7-5 12t-12 5h-179q-8 0-13-5t-5-12v-108q0-7 5-12t13-5h179q7 0 12 5t5 12z m286-214v107q0 8-5 13t-13 5h-178q-8 0-13-5t-5-13v-107q0-8 5-13t13-5h178q8 0 13 5t5 13z m-286 429v107q0 8-5 13t-12 5h-179q-8 0-13-5t-5-13v-107q0-8 5-13t13-5h179q7 0 12 5t5 13z m286-215v108q0 7-5 12t-13 5h-178q-8 0-13-5t-5-12v-108q0-7 5-12t13-5h178q8 0 13 5t5 12z m0 215v107q0 8-5 13t-13 5h-178q-8 0-13-5t-5-13v-107q0-8 5-13t13-5h178q8 0 13 5t5 13z m72 178v-607q0-37-27-63t-63-26h-750q-36 0-63 26t-26 63v607q0 37 26 63t63 27h750q37 0 63-27t27-63z" horiz-adv-x="928.6" />
|
||||
|
||||
<glyph glyph-name="columns" unicode="" d="M89-7h340v643h-358v-625q0-7 6-13t12-5z m768 18v625h-357v-643h339q8 0 13 5t5 13z m72 678v-678q0-37-27-63t-63-27h-750q-36 0-63 27t-26 63v678q0 37 26 63t63 27h750q37 0 63-27t27-63z" horiz-adv-x="928.6" />
|
||||
|
||||
<glyph glyph-name="quote-left" unicode="" d="M429 314v-214q0-45-32-76t-76-31h-214q-44 0-76 31t-31 76v393q0 58 23 111t61 91 91 61 111 23h35q15 0 26-11t10-25v-72q0-14-10-25t-26-10h-35q-59 0-101-42t-42-101v-18q0-22 16-38t37-16h125q45 0 76-31t32-76z m500 0v-214q0-45-32-76t-76-31h-214q-44 0-76 31t-31 76v393q0 58 23 111t61 91 91 61 111 23h35q15 0 26-11t10-25v-72q0-14-10-25t-26-10h-35q-59 0-101-42t-42-101v-18q0-22 16-38t37-16h125q45 0 76-31t32-76z" horiz-adv-x="928.6" />
|
||||
|
||||
<glyph glyph-name="code" unicode="" d="M344 69l-28-28q-5-5-12-5t-13 5l-260 261q-6 5-6 12t6 13l260 260q5 6 13 6t12-6l28-28q6-5 6-13t-6-12l-219-220 219-219q6-6 6-13t-6-13z m330 596l-208-721q-2-7-9-11t-13-1l-34 9q-8 3-11 9t-2 14l209 720q2 8 8 11t13 2l35-10q7-2 11-9t1-13z m367-363l-260-261q-6-5-13-5t-13 5l-28 28q-5 6-5 13t5 13l219 219-219 220q-5 5-5 12t5 13l28 28q6 6 13 6t13-6l260-260q5-5 5-13t-5-12z" horiz-adv-x="1071.4" />
|
||||
|
||||
<glyph glyph-name="superscript" unicode="" d="M501 86v-93h-139l-89 141-13 23q-4 5-6 12h-2q0-2-1-4t-2-4-2-4q-5-11-14-25l-86-139h-144v93h71l110 162-103 152h-76v94h154l77-127q1-2 13-24 4-5 6-11h2q1 5 6 11l14 24 78 127h143v-94h-69l-103-149 114-165h61z m355 379v-115h-287l-1 15q-3 16-3 26 0 36 15 65t36 48 47 37 47 30 36 30 15 36q0 21-17 35t-39 13q-29 0-54-21-8-6-20-22l-59 52q15 20 35 37 47 36 105 36 61 0 99-33t38-89q0-31-13-57t-35-43-45-33-46-28-37-28-17-36h130v45h70z" horiz-adv-x="857.1" />
|
||||
|
||||
<glyph glyph-name="subscript" unicode="" d="M501 86v-93h-139l-89 141-13 23q-4 5-6 12h-2q0-2-1-4t-2-4-2-4q-5-11-14-25l-86-139h-144v93h71l110 162-103 152h-76v94h154l77-127q1-2 13-24 4-5 6-11h2q1 5 6 11l14 24 78 127h143v-94h-69l-103-149 114-165h61z m356-121v-115h-287l-2 15q-2 25-2 26 0 35 15 65t36 48 47 37 47 30 36 30 15 36q0 21-17 35t-39 13q-28 0-54-21-8-6-20-22l-59 52q15 20 35 37 45 36 105 36 62 0 100-33t37-89q0-37-19-66t-47-48-55-35-49-35-23-41h130v45h70z" horiz-adv-x="857.1" />
|
||||
|
||||
<glyph glyph-name="header" unicode="" d="M939-79q-25 0-74 2t-75 2q-24 0-73-2t-74-2q-13 0-21 12t-7 25q0 18 9 26t22 9 29 4 25 9q18 11 18 78l0 218q0 12-1 17-7 3-28 3h-376q-22 0-29-3 0-5 0-17l-1-207q0-79 21-91 9-6 26-8t32-2 25-8 11-26q0-14-6-26t-21-13q-26 0-78 2t-77 2q-24 0-71-2t-71-2q-13 0-20 12t-7 25q0 17 9 25t20 10 26 4 24 9q18 13 18 80l-1 31v454q0 2 1 15t0 20-1 21-2 24-4 20-6 18-9 10q-8 5-25 7t-29 1-23 7-10 26q0 14 6 26t20 13q26 0 78-2t77-2q23 0 71 2t70 2q14 0 21-13t7-26q0-17-9-25t-22-8-27-2-24-7q-20-12-20-90l1-178q0-12 0-18 7-2 22-2h390q14 0 21 2 1 6 1 18l0 178q0 78-19 90-10 6-33 7t-37 7-14 28q0 14 7 26t21 13q24 0 74-2t73-2q24 0 72 2t72 2q14 0 21-13t7-26q0-17-10-25t-22-8-29-2-24-7q-20-13-20-90l1-526q0-66 19-78 9-6 25-8t30-2 23-9 10-25q0-14-6-26t-20-13z" horiz-adv-x="1000" />
|
||||
|
||||
<glyph glyph-name="window-maximize" unicode="" d="M143 64h714v429h-714v-429z m857 625v-678q0-37-26-63t-63-27h-822q-36 0-63 27t-26 63v678q0 37 26 63t63 27h822q37 0 63-27t26-63z" horiz-adv-x="1000" />
|
||||
</font>
|
||||
</defs>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 16 KiB |
BIN
zyplayer-doc-api/src/main/resources/dist/assets/fontello.8aa3e26e.woff
vendored
Normal file
BIN
zyplayer-doc-api/src/main/resources/dist/assets/fontello.8aa3e26e.woff
vendored
Normal file
Binary file not shown.
BIN
zyplayer-doc-api/src/main/resources/dist/assets/fontello.febc4ea8.woff2
vendored
Normal file
BIN
zyplayer-doc-api/src/main/resources/dist/assets/fontello.febc4ea8.woff2
vendored
Normal file
Binary file not shown.
1697
zyplayer-doc-api/src/main/resources/dist/assets/index.086d0536.js
vendored
Normal file
1697
zyplayer-doc-api/src/main/resources/dist/assets/index.086d0536.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1116
zyplayer-doc-api/src/main/resources/dist/assets/index.ff4a24c0.js
vendored
Normal file
1116
zyplayer-doc-api/src/main/resources/dist/assets/index.ff4a24c0.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
zyplayer-doc-api/src/main/resources/dist/assets/logUtil.6309fa68.js
vendored
Normal file
1
zyplayer-doc-api/src/main/resources/dist/assets/logUtil.6309fa68.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
import{B as r}from"./vendor.6399378c.js";var g={log(o,l,s){console.log(o+"-\u9047\u5230\u672A\u5904\u7406\u7684\u7C7B\u578B\uFF0C\u8BF7\u8054\u7CFB\u5F00\u53D1\u4EBA\u5458\u4FEE\u6539\uFF1A"+l,s)},logMessage(o,l,s){console.log(o+"-\u9047\u5230\u672A\u5904\u7406\u7684\u7C7B\u578B\uFF0C\u8BF7\u8054\u7CFB\u5F00\u53D1\u4EBA\u5458\u4FEE\u6539\uFF1A"+l,s),r.error(o+"-\u9047\u5230\u672A\u5904\u7406\u7684\u7C7B\u578B\uFF0C\u8BF7\u8054\u7CFB\u5F00\u53D1\u4EBA\u5458\u4FEE\u6539\uFF1A"+l)}};export{g as l};
|
||||
1
zyplayer-doc-api/src/main/resources/dist/assets/main.5fd30069.js
vendored
Normal file
1
zyplayer-doc-api/src/main/resources/dist/assets/main.5fd30069.js
vendored
Normal file
File diff suppressed because one or more lines are too long
8
zyplayer-doc-api/src/main/resources/dist/assets/style.9e577f5e.css
vendored
Normal file
8
zyplayer-doc-api/src/main/resources/dist/assets/style.9e577f5e.css
vendored
Normal file
File diff suppressed because one or more lines are too long
10
zyplayer-doc-api/src/main/resources/dist/assets/unitConvert.f432b2c8.js
vendored
Normal file
10
zyplayer-doc-api/src/main/resources/dist/assets/unitConvert.f432b2c8.js
vendored
Normal file
File diff suppressed because one or more lines are too long
161
zyplayer-doc-api/src/main/resources/dist/assets/vendor.6399378c.js
vendored
Normal file
161
zyplayer-doc-api/src/main/resources/dist/assets/vendor.6399378c.js
vendored
Normal file
File diff suppressed because one or more lines are too long
16
zyplayer-doc-api/src/main/resources/dist/doc-api.html
vendored
Normal file
16
zyplayer-doc-api/src/main/resources/dist/doc-api.html
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" href="api-logo.png" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>API文档管理</title>
|
||||
<script type="module" crossorigin src="assets/main.5fd30069.js"></script>
|
||||
<link rel="modulepreload" href="assets/vendor.6399378c.js">
|
||||
<link rel="stylesheet" href="assets/style.9e577f5e.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
8
zyplayer-doc-core/README.md
Normal file
8
zyplayer-doc-core/README.md
Normal file
@@ -0,0 +1,8 @@
|
||||
# zyplayer-doc-core
|
||||
|
||||
#### 项目介绍
|
||||
整个项目的公用模块
|
||||
|
||||
模块的详细使用文档地址,部署必看:
|
||||
|
||||
http://doc.zyplayer.com
|
||||
@@ -3,35 +3,43 @@
|
||||
xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>com.zyplayer</groupId>
|
||||
<artifactId>zyplayer-doc-core</artifactId>
|
||||
<version>1.0.1</version>
|
||||
<name>zyplayer-doc-core</name>
|
||||
|
||||
<url>http://maven.apache.org</url>
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
<java.version>1.8</java.version>
|
||||
<fastjson.version>1.2.53</fastjson.version>
|
||||
</properties>
|
||||
<artifactId>zyplayer-doc-core</artifactId>
|
||||
|
||||
<parent>
|
||||
<groupId>com.zyplayer</groupId>
|
||||
<artifactId>zyplayer-doc</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>servlet-api</artifactId>
|
||||
<version>2.5</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.springfox</groupId>
|
||||
<artifactId>springfox-swagger2</artifactId>
|
||||
<version>2.7.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>fastjson</artifactId>
|
||||
<version>${fastjson.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-all</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-core</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.zyplayer.doc.core.annotation;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
/**
|
||||
* 用户登录校验注解
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2019年5月29日
|
||||
*/
|
||||
@Target({ElementType.METHOD, ElementType.TYPE})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
public @interface AuthMan {
|
||||
String[] value() default {};
|
||||
|
||||
boolean all() default false;
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
package com.zyplayer.doc.core.bean.swagger;
|
||||
|
||||
public class Contact {
|
||||
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
package com.zyplayer.doc.core.bean.swagger;
|
||||
|
||||
public class Info {
|
||||
|
||||
private String description;
|
||||
private String version;
|
||||
private String title;
|
||||
private Contact contact;
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setVersion(String version) {
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public String getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setContact(Contact contact) {
|
||||
this.contact = contact;
|
||||
}
|
||||
|
||||
public Contact getContact() {
|
||||
return contact;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
package com.zyplayer.doc.core.bean.swagger;
|
||||
|
||||
public class Paths {
|
||||
|
||||
}
|
||||
@@ -1,62 +0,0 @@
|
||||
package com.zyplayer.doc.core.bean.swagger;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class SwaggerApiDocs {
|
||||
|
||||
private String swagger;
|
||||
private Info info;
|
||||
private String host;
|
||||
private String basePath;
|
||||
private List<String> tags;
|
||||
private Paths paths;
|
||||
|
||||
public void setSwagger(String swagger) {
|
||||
this.swagger = swagger;
|
||||
}
|
||||
|
||||
public String getSwagger() {
|
||||
return swagger;
|
||||
}
|
||||
|
||||
public void setInfo(Info info) {
|
||||
this.info = info;
|
||||
}
|
||||
|
||||
public Info getInfo() {
|
||||
return info;
|
||||
}
|
||||
|
||||
public void setHost(String host) {
|
||||
this.host = host;
|
||||
}
|
||||
|
||||
public String getHost() {
|
||||
return host;
|
||||
}
|
||||
|
||||
public void setBasePath(String basePath) {
|
||||
this.basePath = basePath;
|
||||
}
|
||||
|
||||
public String getBasePath() {
|
||||
return basePath;
|
||||
}
|
||||
|
||||
public void setTags(List<String> tags) {
|
||||
this.tags = tags;
|
||||
}
|
||||
|
||||
public List<String> getTags() {
|
||||
return tags;
|
||||
}
|
||||
|
||||
public void setPaths(Paths paths) {
|
||||
this.paths = paths;
|
||||
}
|
||||
|
||||
public Paths getPaths() {
|
||||
return paths;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.zyplayer.doc.core.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 文件存储路径
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2023-10-06
|
||||
*/
|
||||
public enum PageFileSource {
|
||||
UPLOAD_FILES(1, "手动上传的附件"),
|
||||
PASTE_FILES(2, "页面粘贴的图片或文件"),
|
||||
;
|
||||
@Getter
|
||||
private final Integer source;
|
||||
@Getter
|
||||
private final String desc;
|
||||
|
||||
PageFileSource(Integer source, String desc) {
|
||||
this.source = source;
|
||||
this.desc = desc;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.zyplayer.doc.core.enums;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
* 系统配置枚举
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2022-10-20
|
||||
*/
|
||||
public enum SystemConfigEnum {
|
||||
// 系统相关
|
||||
DOC_SYSTEM_VERSION("doc_system_version", "系统当前的版本号"),
|
||||
;
|
||||
|
||||
private final String key;
|
||||
private final String desc;
|
||||
|
||||
SystemConfigEnum(String key, String desc) {
|
||||
this.key = key;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
private static final Map<String, SystemConfigEnum> VALUE_MAP = Stream.of(values()).collect(Collectors.toMap(SystemConfigEnum::getKey, (treeType) -> treeType));
|
||||
|
||||
public static SystemConfigEnum get(String code) {
|
||||
return VALUE_MAP.get(code);
|
||||
}
|
||||
|
||||
public String getKey() {
|
||||
return key;
|
||||
}
|
||||
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
}
|
||||
}
|
||||
@@ -2,29 +2,32 @@ package com.zyplayer.doc.core.exception;
|
||||
|
||||
/**
|
||||
* 前端提示异常
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2018年12月8日
|
||||
*/
|
||||
public class ConfirmException extends RuntimeException {
|
||||
|
||||
|
||||
private static final long serialVersionUID = -7084066605197111614L;
|
||||
|
||||
|
||||
public ConfirmException() {
|
||||
super();
|
||||
}
|
||||
|
||||
|
||||
public ConfirmException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
|
||||
super(message, cause, enableSuppression, writableStackTrace);
|
||||
}
|
||||
|
||||
|
||||
public ConfirmException(String message, Throwable cause) {
|
||||
super(message, cause);
|
||||
}
|
||||
|
||||
|
||||
public ConfirmException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
|
||||
public ConfirmException(Throwable cause) {
|
||||
super(cause);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,153 +1,215 @@
|
||||
package com.zyplayer.doc.core.json;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Date;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.serializer.SerializeConfig;
|
||||
import com.alibaba.fastjson.serializer.SimpleDateFormatSerializer;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
/**
|
||||
* 文档返回数据格式
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2018年8月21日
|
||||
*/
|
||||
public class DocResponseJson<T> implements ResponseJson<T> {
|
||||
private static SerializeConfig mapping = new SerializeConfig();
|
||||
static {
|
||||
mapping.put(Date.class, new SimpleDateFormatSerializer("yyyy-MM-dd HH:mm:ss"));
|
||||
}
|
||||
@ApiModelProperty(value = "状态码")
|
||||
private Integer errCode;
|
||||
@ApiModelProperty(value = "返回值说明")
|
||||
private String errMsg;
|
||||
@ApiModelProperty(value = "返回数据")
|
||||
private T data;
|
||||
|
||||
public DocResponseJson() {
|
||||
this.errCode = 200;
|
||||
}
|
||||
|
||||
public DocResponseJson(T data) {
|
||||
this.setData(data);
|
||||
this.errCode = 200;
|
||||
}
|
||||
|
||||
public DocResponseJson(int errCode, String errMsg) {
|
||||
super();
|
||||
this.errCode = errCode;
|
||||
this.errMsg = errMsg;
|
||||
}
|
||||
|
||||
public DocResponseJson(int errCode, String errMsg, T data) {
|
||||
super();
|
||||
this.setData(data);
|
||||
this.errCode = errCode;
|
||||
this.errMsg = errMsg;
|
||||
}
|
||||
|
||||
public DocResponseJson(Integer errCode) {
|
||||
super();
|
||||
this.errCode = errCode;
|
||||
}
|
||||
|
||||
public Integer getErrCode() {
|
||||
return errCode;
|
||||
}
|
||||
|
||||
public void setErrCode(Integer errCode) {
|
||||
this.errCode = errCode;
|
||||
}
|
||||
|
||||
public String getErrMsg() {
|
||||
return errMsg;
|
||||
}
|
||||
|
||||
public void setErrMsg(String errMsg) {
|
||||
this.errMsg = errMsg;
|
||||
}
|
||||
|
||||
public T getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(T data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
/**
|
||||
* 提示语
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2018年8月7日
|
||||
* @return
|
||||
*/
|
||||
public static <T> DocResponseJson<T> warn(String errMsg) {
|
||||
return new DocResponseJson<T>(300, errMsg);
|
||||
}
|
||||
|
||||
/**
|
||||
* 错误
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2018年8月7日
|
||||
* @return
|
||||
*/
|
||||
public static <T> DocResponseJson<T> error(String errMsg) {
|
||||
return new DocResponseJson<T>(500, errMsg);
|
||||
}
|
||||
|
||||
/**
|
||||
* 成功的返回方法
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2018年8月7日
|
||||
* @return
|
||||
*/
|
||||
public static <T> DocResponseJson<T> ok() {
|
||||
return new DocResponseJson<T>();
|
||||
}
|
||||
|
||||
/**
|
||||
* 成功的返回方法
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2018年8月7日
|
||||
* @return
|
||||
*/
|
||||
public static <T> DocResponseJson<T> ok(T data) {
|
||||
if (data == null) {
|
||||
return DocResponseJson.ok();
|
||||
}
|
||||
DocResponseJson<T> responseJson = new DocResponseJson<T>();
|
||||
responseJson.setData(data);
|
||||
return responseJson;
|
||||
}
|
||||
|
||||
public String toJson() {
|
||||
return JSON.toJSONString(this, mapping);
|
||||
}
|
||||
|
||||
public void send(HttpServletResponse response) {
|
||||
try {
|
||||
response.setStatus(200);
|
||||
response.setContentType("application/json");
|
||||
response.setCharacterEncoding("UTF-8");
|
||||
response.setHeader("Cache-Control", "no-cache, must-revalidate");
|
||||
response.getWriter().write(toJson());
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "DefaultResponseJson [errCode=" + errCode + ", errMsg=" + errMsg + ", data=" + data + "]";
|
||||
}
|
||||
|
||||
}
|
||||
package com.zyplayer.doc.core.json;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.alibaba.fastjson.serializer.SerializeConfig;
|
||||
import com.alibaba.fastjson.serializer.SimpleDateFormatSerializer;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.Date;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 文档返回数据格式
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2018年8月21日
|
||||
*/
|
||||
public class DocResponseJson<T> implements ResponseJson<T> {
|
||||
private static final SerializeConfig mapping = new SerializeConfig();
|
||||
|
||||
static {
|
||||
mapping.put(Date.class, new SimpleDateFormatSerializer("yyyy-MM-dd HH:mm:ss"));
|
||||
}
|
||||
|
||||
private Integer errCode;
|
||||
private String errMsg;
|
||||
private Object data;
|
||||
private Long total;
|
||||
private Integer pageNum;
|
||||
private Integer pageSize;
|
||||
private Integer totalPage;
|
||||
|
||||
public DocResponseJson() {
|
||||
this.errCode = 200;
|
||||
}
|
||||
|
||||
public DocResponseJson(Object data) {
|
||||
this.setData(data);
|
||||
this.errCode = 200;
|
||||
}
|
||||
|
||||
public DocResponseJson(int errCode, String errMsg) {
|
||||
super();
|
||||
this.errCode = errCode;
|
||||
this.errMsg = errMsg;
|
||||
}
|
||||
|
||||
public DocResponseJson(int errCode, String errMsg, Object data) {
|
||||
super();
|
||||
this.setData(data);
|
||||
this.errCode = errCode;
|
||||
this.errMsg = errMsg;
|
||||
}
|
||||
|
||||
public DocResponseJson(Integer errCode) {
|
||||
super();
|
||||
this.errCode = errCode;
|
||||
}
|
||||
|
||||
public Integer getErrCode() {
|
||||
return errCode;
|
||||
}
|
||||
|
||||
public void setErrCode(Integer errCode) {
|
||||
this.errCode = errCode;
|
||||
}
|
||||
|
||||
public String getErrMsg() {
|
||||
return errMsg;
|
||||
}
|
||||
|
||||
public void setErrMsg(String errMsg) {
|
||||
this.errMsg = errMsg;
|
||||
}
|
||||
|
||||
public Long getTotal() {
|
||||
return total;
|
||||
}
|
||||
|
||||
public void setTotal(Long total) {
|
||||
this.total = total;
|
||||
}
|
||||
|
||||
public Integer getPageNum() {
|
||||
return pageNum;
|
||||
}
|
||||
|
||||
public void setPageNum(Integer pageNum) {
|
||||
this.pageNum = pageNum;
|
||||
}
|
||||
|
||||
public Integer getPageSize() {
|
||||
return pageSize;
|
||||
}
|
||||
|
||||
public void setPageSize(Integer pageSize) {
|
||||
this.pageSize = pageSize;
|
||||
}
|
||||
|
||||
public Integer getTotalPage() {
|
||||
return totalPage;
|
||||
}
|
||||
|
||||
public void setTotalPage(Integer totalPage) {
|
||||
this.totalPage = totalPage;
|
||||
}
|
||||
|
||||
public Object getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(Object data) {
|
||||
if (null != data) {
|
||||
if (data instanceof IPage) {
|
||||
IPage<?> iPage = (IPage<?>) data;
|
||||
this.data = iPage.getRecords();
|
||||
this.total = iPage.getTotal();
|
||||
this.pageNum = (int) iPage.getCurrent();
|
||||
this.pageSize = (int) iPage.getSize();
|
||||
this.totalPage = (int) iPage.getPages();
|
||||
} else {
|
||||
this.data = data;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 提示语
|
||||
*
|
||||
* @return
|
||||
* @author 暮光:城中城
|
||||
* @since 2018年8月7日
|
||||
*/
|
||||
public static <T> DocResponseJson<T> warn(String errMsg) {
|
||||
return new DocResponseJson<>(300, errMsg);
|
||||
}
|
||||
|
||||
/**
|
||||
* 错误
|
||||
*
|
||||
* @return
|
||||
* @author 暮光:城中城
|
||||
* @since 2018年8月7日
|
||||
*/
|
||||
public static <T> DocResponseJson<T> error(String errMsg) {
|
||||
return new DocResponseJson<>(500, errMsg);
|
||||
}
|
||||
|
||||
/**
|
||||
* 失败
|
||||
*
|
||||
* @return
|
||||
* @author 暮光:城中城
|
||||
* @since 2018年8月7日
|
||||
*/
|
||||
public static <T> DocResponseJson<T> failure(int errCode, String errMsg) {
|
||||
return new DocResponseJson<>(errCode, errMsg);
|
||||
}
|
||||
|
||||
/**
|
||||
* 成功的返回方法
|
||||
*
|
||||
* @return
|
||||
* @author 暮光:城中城
|
||||
* @since 2018年8月7日
|
||||
*/
|
||||
public static <T> DocResponseJson<T> ok() {
|
||||
return new DocResponseJson<>();
|
||||
}
|
||||
|
||||
/**
|
||||
* 成功的返回方法
|
||||
*
|
||||
* @return
|
||||
* @author 暮光:城中城
|
||||
* @since 2018年8月7日
|
||||
*/
|
||||
public static <T> DocResponseJson<T> ok(Object data) {
|
||||
if (data == null) {
|
||||
return DocResponseJson.ok();
|
||||
}
|
||||
DocResponseJson<T> responseJson = new DocResponseJson<>();
|
||||
responseJson.setData(data);
|
||||
return responseJson;
|
||||
}
|
||||
|
||||
public String toJson() {
|
||||
return JSON.toJSONString(this, mapping);
|
||||
}
|
||||
|
||||
public void send(HttpServletResponse response) {
|
||||
try {
|
||||
response.setStatus(200);
|
||||
response.setContentType("application/json");
|
||||
response.setCharacterEncoding("UTF-8");
|
||||
response.setHeader("Cache-Control", "no-cache, must-revalidate");
|
||||
response.getWriter().write(toJson());
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@JSONField(serialize = false)
|
||||
public boolean isOk() {
|
||||
return Objects.equals(this.errCode, 200);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "DefaultResponseJson [errCode=" + errCode + ", errMsg=" + errMsg + ", data=" + data + "]";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.zyplayer.doc.core.json;
|
||||
|
||||
/**
|
||||
* http静态资源定义
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2019年05月29日
|
||||
*/
|
||||
public class HttpConst {
|
||||
/**
|
||||
* 会话连接
|
||||
*/
|
||||
public static final String ACCESS_TOKEN = "accessToken";
|
||||
/**
|
||||
* accessToken非法或过期,需要重新登录
|
||||
**/
|
||||
public static final int TOKEN_TIMEOUT = 400;
|
||||
}
|
||||
@@ -2,7 +2,7 @@ package com.zyplayer.doc.core.json;
|
||||
|
||||
/**
|
||||
* json视图
|
||||
*
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2018年8月21日
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.zyplayer.doc.core.util;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class UpgradeInfo {
|
||||
private String version;
|
||||
private boolean haveUpgradeSql;
|
||||
|
||||
public UpgradeInfo() {
|
||||
}
|
||||
|
||||
public UpgradeInfo(String version, boolean haveUpgradeSql) {
|
||||
this.version = version;
|
||||
this.haveUpgradeSql = haveUpgradeSql;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.zyplayer.doc.core.util;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* zyplayer-doc版本号
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2021-06-06
|
||||
*/
|
||||
public class ZyplayerDocVersion {
|
||||
public static final String version = "1.1.6";
|
||||
|
||||
/**
|
||||
* 每次升级必须添加一条记录,用于执行它的升级SQL
|
||||
*/
|
||||
public static final List<UpgradeInfo> versionUpgrade = new LinkedList<UpgradeInfo>() {{
|
||||
add(new UpgradeInfo("1.1.6", true));
|
||||
add(new UpgradeInfo("1.1.5", false));
|
||||
add(new UpgradeInfo("1.1.4", true));
|
||||
add(new UpgradeInfo("1.1.3", false));
|
||||
add(new UpgradeInfo("1.1.2", true));
|
||||
}};
|
||||
}
|
||||
8
zyplayer-doc-data/README.md
Normal file
8
zyplayer-doc-data/README.md
Normal file
@@ -0,0 +1,8 @@
|
||||
# zyplayer-doc-data
|
||||
|
||||
#### 项目介绍
|
||||
整个项目的数据核心,操作数据库、登录拦截、权限拦截等
|
||||
|
||||
模块的详细使用文档地址,部署必看:
|
||||
|
||||
http://doc.zyplayer.com
|
||||
@@ -3,29 +3,15 @@
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>com.zyplayer</groupId>
|
||||
|
||||
<artifactId>zyplayer-doc-data</artifactId>
|
||||
<version>1.0.1</version>
|
||||
|
||||
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>2.0.6.RELEASE</version>
|
||||
<groupId>com.zyplayer</groupId>
|
||||
<artifactId>zyplayer-doc</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
<java.version>1.8</java.version>
|
||||
<mybatis.plus.boot.starter.version>3.0.6</mybatis.plus.boot.starter.version>
|
||||
<fastjson.version>1.2.53</fastjson.version>
|
||||
<velocity.engine.core.version>2.0</velocity.engine.core.version>
|
||||
<dozer.core.version>6.1.0</dozer.core.version>
|
||||
<alibaba.druid.version>1.1.9</alibaba.druid.version>
|
||||
<zyplayer.doc.version>1.0.1</zyplayer.doc.version>
|
||||
</properties>
|
||||
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
@@ -41,58 +27,91 @@
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-jta-atomikos</artifactId>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-boot-starter</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<groupId>commons-collections</groupId>
|
||||
<artifactId>commons-collections</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-boot-starter</artifactId>
|
||||
<version>${mybatis.plus.boot.starter.version}</version>
|
||||
<artifactId>mybatis-plus-generator</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>druid</artifactId>
|
||||
<version>${alibaba.druid.version}</version>
|
||||
</dependency>
|
||||
<!-- json -->
|
||||
<!-- 数据库驱动 -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>fastjson</artifactId>
|
||||
<version>${fastjson.version}</version>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
</dependency>
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>com.oracle</groupId>-->
|
||||
<!-- <artifactId>ojdbc6</artifactId>-->
|
||||
<!-- </dependency>-->
|
||||
<!--达梦数据库驱动-->
|
||||
<dependency>
|
||||
<groupId>com.dameng</groupId>
|
||||
<artifactId>DmJdbcDriver18</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.dozermapper</groupId>
|
||||
<artifactId>dozer-core</artifactId>
|
||||
<version>${dozer.core.version}</version>
|
||||
<groupId>net.sourceforge.jtds</groupId>
|
||||
<artifactId>jtds</artifactId>
|
||||
</dependency>
|
||||
<!-- 在线文档解析页面 -->
|
||||
<!--zyplayer-doc-core-->
|
||||
<dependency>
|
||||
<groupId>org.postgresql</groupId>
|
||||
<artifactId>postgresql</artifactId>
|
||||
</dependency>
|
||||
<!-- 按需开启对hive的支持,它依赖的包实在太多太大了-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>org.apache.hive</groupId>-->
|
||||
<!-- <artifactId>hive-jdbc</artifactId>-->
|
||||
<!-- <version>2.1.1</version>-->
|
||||
<!-- <exclusions>-->
|
||||
<!-- <exclusion>-->
|
||||
<!-- <artifactId>commons-logging</artifactId>-->
|
||||
<!-- <groupId>commons-logging</groupId>-->
|
||||
<!-- </exclusion>-->
|
||||
<!-- <exclusion>-->
|
||||
<!-- <artifactId>log4j</artifactId>-->
|
||||
<!-- <groupId>log4j</groupId>-->
|
||||
<!-- </exclusion>-->
|
||||
<!-- <exclusion>-->
|
||||
<!-- <artifactId>log4j-1.2-api</artifactId>-->
|
||||
<!-- <groupId>org.apache.logging.log4j</groupId>-->
|
||||
<!-- </exclusion>-->
|
||||
<!-- <exclusion>-->
|
||||
<!-- <artifactId>log4j-slf4j-impl</artifactId>-->
|
||||
<!-- <groupId>org.apache.logging.log4j</groupId>-->
|
||||
<!-- </exclusion>-->
|
||||
<!-- <exclusion>-->
|
||||
<!-- <artifactId>log4j-web</artifactId>-->
|
||||
<!-- <groupId>org.apache.logging.log4j</groupId>-->
|
||||
<!-- </exclusion>-->
|
||||
<!-- <exclusion>-->
|
||||
<!-- <artifactId>slf4j-log4j12</artifactId>-->
|
||||
<!-- <groupId>org.slf4j</groupId>-->
|
||||
<!-- </exclusion>-->
|
||||
<!-- </exclusions>-->
|
||||
<!-- </dependency>-->
|
||||
<dependency>
|
||||
<groupId>com.zyplayer</groupId>
|
||||
<artifactId>zyplayer-doc-core</artifactId>
|
||||
<version>${zyplayer.doc.version}</version>
|
||||
</dependency>
|
||||
<!-- velocity 模板引擎, 默认 -->
|
||||
<dependency>
|
||||
<groupId>org.apache.velocity</groupId>
|
||||
<artifactId>velocity-engine-core</artifactId>
|
||||
<version>${velocity.engine.core.version}</version>
|
||||
</dependency>
|
||||
<!-- freemarker 模板引擎 -->
|
||||
<dependency>
|
||||
<groupId>org.freemarker</groupId>
|
||||
<artifactId>freemarker</artifactId>
|
||||
</dependency>
|
||||
<!-- 整合spring security -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-security</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
||||
@@ -1,78 +1,32 @@
|
||||
package com.zyplayer.doc.data.config;
|
||||
|
||||
import com.atomikos.icatch.jta.UserTransactionImp;
|
||||
import com.atomikos.icatch.jta.UserTransactionManager;
|
||||
import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
|
||||
import com.baomidou.mybatisplus.extension.plugins.PerformanceInterceptor;
|
||||
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
|
||||
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
|
||||
import com.baomidou.mybatisplus.extension.spring.MybatisSqlSessionFactoryBean;
|
||||
import com.zyplayer.doc.data.repository.support.interceptor.SqlLogInterceptor;
|
||||
import org.apache.ibatis.plugin.Interceptor;
|
||||
import com.zyplayer.doc.data.utils.DruidDataSourceUtil;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.boot.jta.atomikos.AtomikosDataSourceBean;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
|
||||
import org.springframework.transaction.PlatformTransactionManager;
|
||||
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||
import org.springframework.transaction.jta.JtaTransactionManager;
|
||||
import org.apache.ibatis.mapping.DatabaseIdProvider;
|
||||
import org.apache.ibatis.mapping.VendorDatabaseIdProvider;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
import javax.transaction.TransactionManager;
|
||||
import javax.transaction.UserTransaction;
|
||||
import java.util.Properties;
|
||||
import javax.annotation.Resource;
|
||||
import javax.sql.DataSource;
|
||||
|
||||
/**
|
||||
* mybatis plus数据库配置
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2019-02-16
|
||||
*/
|
||||
@Configuration
|
||||
public class MybatisPlusConfig {
|
||||
|
||||
/**
|
||||
* sql日志
|
||||
**/
|
||||
private static final SqlLogInterceptor SQL_LOG_INTERCEPTOR;
|
||||
|
||||
static {
|
||||
SQL_LOG_INTERCEPTOR = new SqlLogInterceptor();
|
||||
Properties properties = new Properties();
|
||||
SQL_LOG_INTERCEPTOR.setProperties(properties);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分布式事务配置
|
||||
*/
|
||||
@Configuration
|
||||
static class JTATransactionManagerConfig {
|
||||
|
||||
@Bean(name = "userTransaction")
|
||||
public UserTransaction userTransaction() throws Throwable {
|
||||
UserTransactionImp userTransactionImp = new UserTransactionImp();
|
||||
userTransactionImp.setTransactionTimeout(300);
|
||||
return userTransactionImp;
|
||||
}
|
||||
|
||||
@Bean(name = "atomikosTransactionManager")
|
||||
public TransactionManager atomikosTransactionManager() {
|
||||
UserTransactionManager userTransactionManager = new UserTransactionManager();
|
||||
userTransactionManager.setForceShutdown(true);
|
||||
return userTransactionManager;
|
||||
}
|
||||
|
||||
@Bean(name = "transactionManager")
|
||||
public PlatformTransactionManager transactionManager() throws Throwable {
|
||||
UserTransaction userTransaction = userTransaction();
|
||||
TransactionManager atomikosTransactionManager = atomikosTransactionManager();
|
||||
|
||||
JtaTransactionManager jtaTransactionManager = new JtaTransactionManager(userTransaction, atomikosTransactionManager);
|
||||
jtaTransactionManager.setAllowCustomIsolationLevels(true);
|
||||
jtaTransactionManager.setGlobalRollbackOnParticipationFailure(true);
|
||||
jtaTransactionManager.setDefaultTimeout(30);
|
||||
|
||||
return jtaTransactionManager;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 数据库配置
|
||||
*/
|
||||
@@ -80,7 +34,7 @@ public class MybatisPlusConfig {
|
||||
@EnableTransactionManagement
|
||||
@MapperScan(value = "com.zyplayer.doc.data.repository.manage.mapper", sqlSessionFactoryRef = "manageSqlSessionFactory")
|
||||
static class ManageMybatisDbConfig {
|
||||
|
||||
|
||||
@Value("${zyplayer.doc.manage.datasource.driverClassName}")
|
||||
private String driverClassName;
|
||||
@Value("${zyplayer.doc.manage.datasource.url}")
|
||||
@@ -89,53 +43,42 @@ public class MybatisPlusConfig {
|
||||
private String username;
|
||||
@Value("${zyplayer.doc.manage.datasource.password}")
|
||||
private String password;
|
||||
|
||||
@Resource
|
||||
private MybatisPlusInterceptor paginationInterceptor;
|
||||
|
||||
@Bean(name = "manageDatasource")
|
||||
public DataSource manageDatasource() {
|
||||
Properties xaProperties = new Properties();
|
||||
xaProperties.setProperty("driverClassName", driverClassName);
|
||||
xaProperties.setProperty("url", url);
|
||||
xaProperties.setProperty("username", username);
|
||||
xaProperties.setProperty("password", password);
|
||||
xaProperties.setProperty("maxActive", "500");
|
||||
xaProperties.setProperty("testOnBorrow", "true");
|
||||
xaProperties.setProperty("testWhileIdle", "true");
|
||||
xaProperties.setProperty("validationQuery", "select 'x'");
|
||||
|
||||
AtomikosDataSourceBean xaDataSource = new AtomikosDataSourceBean();
|
||||
xaDataSource.setXaProperties(xaProperties);
|
||||
xaDataSource.setXaDataSourceClassName("com.alibaba.druid.pool.xa.DruidXADataSource");
|
||||
xaDataSource.setUniqueResourceName("manageDatasource");
|
||||
xaDataSource.setMaxPoolSize(500);
|
||||
xaDataSource.setMinPoolSize(1);
|
||||
xaDataSource.setMaxLifetime(60);
|
||||
return xaDataSource;
|
||||
public DataSource manageDatasource() throws Exception {
|
||||
return DruidDataSourceUtil.createDataSource(driverClassName, url, username, password, false);
|
||||
}
|
||||
|
||||
|
||||
@Bean(name = "manageSqlSessionFactory")
|
||||
public MybatisSqlSessionFactoryBean manageSqlSessionFactory() throws Exception {
|
||||
MybatisSqlSessionFactoryBean sqlSessionFactoryBean = new MybatisSqlSessionFactoryBean();
|
||||
DatabaseIdProvider databaseIdProvider = new VendorDatabaseIdProvider();
|
||||
Properties properties = new Properties();
|
||||
properties.setProperty("SQL Server", "sqlserver");
|
||||
properties.setProperty("DB2", "db2");
|
||||
properties.setProperty("Oracle", "oracle");
|
||||
properties.setProperty("MySQL", "mysql");
|
||||
properties.setProperty("PostgreSQL", "postgresql");
|
||||
properties.setProperty("Derby", "derby");
|
||||
properties.setProperty("HSQL", "hsqldb");
|
||||
properties.setProperty("H2", "h2");
|
||||
databaseIdProvider.setProperties(properties);
|
||||
sqlSessionFactoryBean.setDatabaseIdProvider(databaseIdProvider);
|
||||
sqlSessionFactoryBean.setDataSource(manageDatasource());
|
||||
sqlSessionFactoryBean.setPlugins(new Interceptor[]{SQL_LOG_INTERCEPTOR});
|
||||
sqlSessionFactoryBean.setPlugins(new SqlLogInterceptor(), paginationInterceptor);
|
||||
|
||||
PathMatchingResourcePatternResolver resolver = new PathMatchingResourcePatternResolver();
|
||||
sqlSessionFactoryBean.setMapperLocations(resolver.getResources("classpath:/mapper/manage/*Mapper.xml"));
|
||||
return sqlSessionFactoryBean;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Bean
|
||||
public PerformanceInterceptor performanceInterceptor() {
|
||||
PerformanceInterceptor performanceInterceptor = new PerformanceInterceptor();
|
||||
/* <!-- SQL 执行性能分析,开发环境使用,线上不推荐。 maxTime 指的是 sql 最大执行时长 --> */
|
||||
performanceInterceptor.setMaxTime(1000);
|
||||
/* <!--SQL是否格式化 默认false--> */
|
||||
performanceInterceptor.setFormat(true);
|
||||
return performanceInterceptor;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public PaginationInterceptor paginationInterceptor() {
|
||||
return new PaginationInterceptor();
|
||||
public MybatisPlusInterceptor paginationInterceptor() {
|
||||
MybatisPlusInterceptor mybatisPlusInterceptor = new MybatisPlusInterceptor();
|
||||
mybatisPlusInterceptor.addInnerInterceptor(new PaginationInnerInterceptor());
|
||||
return mybatisPlusInterceptor;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,18 +1,28 @@
|
||||
package com.zyplayer.doc.data.config.security;
|
||||
|
||||
import org.springframework.security.core.GrantedAuthority;
|
||||
import org.springframework.security.core.userdetails.UserDetails;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
public class DocUserDetails implements UserDetails {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 登录用户信息
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2018-12-02
|
||||
*/
|
||||
@Data
|
||||
public class DocUserDetails {
|
||||
private Long userId;
|
||||
private String username;
|
||||
private String password;
|
||||
private String accessToken;
|
||||
private boolean enabled;
|
||||
private Collection<? extends GrantedAuthority> authorities;
|
||||
private List<UserAuthInfo> userAuthList;
|
||||
|
||||
public DocUserDetails(Long userId, String username) {
|
||||
this.userId = userId;
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
public DocUserDetails(Long userId, String username, String password, boolean enabled) {
|
||||
super();
|
||||
@@ -22,58 +32,12 @@ public class DocUserDetails implements UserDetails {
|
||||
this.enabled = enabled;
|
||||
}
|
||||
|
||||
public DocUserDetails(Long userId, String username, String password, boolean enabled,
|
||||
Collection<? extends GrantedAuthority> authorities) {
|
||||
public DocUserDetails(Long userId, String username, String password, boolean enabled, List<UserAuthInfo> userAuthList) {
|
||||
super();
|
||||
this.userId = userId;
|
||||
this.username = username;
|
||||
this.password = password;
|
||||
this.enabled = enabled;
|
||||
this.authorities = authorities;
|
||||
}
|
||||
|
||||
public Long getUserId() {
|
||||
return this.userId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<? extends GrantedAuthority> getAuthorities() {
|
||||
return authorities;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAccountNonExpired() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAccountNonLocked() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCredentialsNonExpired() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEnabled() {
|
||||
return enabled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "MyUserDetails [userId=" + userId + ", username=" + username + ", password=" + password + ", enabled="
|
||||
+ enabled + ", authorities=" + authorities + "]";
|
||||
this.userAuthList = userAuthList;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,23 +1,103 @@
|
||||
package com.zyplayer.doc.data.config.security;
|
||||
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.security.core.context.SecurityContextHolder;
|
||||
import com.zyplayer.doc.data.utils.CachePrefix;
|
||||
import com.zyplayer.doc.data.utils.CacheUtil;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 用户工具类
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2019年05月25日
|
||||
*/
|
||||
public class DocUserUtil {
|
||||
private static final ThreadLocal<DocUserDetails> DOC_USER_DETAILS = new ThreadLocal<>();
|
||||
private static final ThreadLocal<String> ACCESS_TOKEN = new ThreadLocal<>();
|
||||
|
||||
public static void setAccessToken(String accessToken) {
|
||||
DocUserUtil.ACCESS_TOKEN.set(accessToken);
|
||||
}
|
||||
|
||||
public static boolean haveCustomAuth(String authName, Integer sysType, Integer sysModuleType, Long sysModuleId) {
|
||||
DocUserDetails currentUser = getCurrentUser();
|
||||
if (currentUser == null) {
|
||||
return false;
|
||||
}
|
||||
return currentUser.getUserAuthList().stream().anyMatch(auth ->
|
||||
Objects.equals(auth.getAuthCode(), authName)
|
||||
&& Objects.equals(auth.getSysType(), sysType)
|
||||
&& Objects.equals(auth.getSysModuleType(), sysModuleType)
|
||||
&& Objects.equals(auth.getSysModuleId(), sysModuleId)
|
||||
);
|
||||
}
|
||||
|
||||
public static boolean haveAuth(String... authNames) {
|
||||
DocUserDetails currentUser = getCurrentUser();
|
||||
if (currentUser == null) {
|
||||
return false;
|
||||
}
|
||||
Set<String> authCodeSet = currentUser.getUserAuthList().stream().map(UserAuthInfo::getAuthCode).collect(Collectors.toSet());
|
||||
for (String authName : authNames) {
|
||||
if (!authCodeSet.contains(authName)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前用户
|
||||
*
|
||||
* @return 用户信息
|
||||
*/
|
||||
public static DocUserDetails getCurrentUser() {
|
||||
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
|
||||
Object principal = null;
|
||||
if (authentication != null) {
|
||||
principal = authentication.getPrincipal();
|
||||
DocUserDetails docUser = DOC_USER_DETAILS.get();
|
||||
if (docUser == null) {
|
||||
docUser = CacheUtil.get(ACCESS_TOKEN.get());
|
||||
if (docUser != null) {
|
||||
DOC_USER_DETAILS.set(docUser);
|
||||
}
|
||||
}
|
||||
return (DocUserDetails) principal;
|
||||
return docUser;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置当前用户
|
||||
*/
|
||||
public static void setCurrentUser(String accessToken, DocUserDetails docUser) {
|
||||
docUser.setAccessToken(accessToken);
|
||||
DOC_USER_DETAILS.set(docUser);
|
||||
CacheUtil.put(accessToken, docUser);
|
||||
CacheUtil.put(CachePrefix.LOGIN_USER_ID_TOKEN + docUser.getUserId(), accessToken);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置当前用户权限
|
||||
*/
|
||||
public static void setUserAuth(Long userId, List<UserAuthInfo> userAuthList) {
|
||||
String userToken = CacheUtil.get(CachePrefix.LOGIN_USER_ID_TOKEN + userId);
|
||||
if (userToken != null) {
|
||||
DocUserDetails docUser = CacheUtil.get(userToken);
|
||||
if (docUser != null) {
|
||||
docUser.setUserAuthList(userAuthList);
|
||||
CacheUtil.put(userToken, docUser);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 退出登录
|
||||
*/
|
||||
public static void logout() {
|
||||
CacheUtil.remove(ACCESS_TOKEN.get());
|
||||
}
|
||||
|
||||
public static void clean() {
|
||||
DocUserUtil.DOC_USER_DETAILS.remove();
|
||||
DocUserUtil.ACCESS_TOKEN.remove();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
package com.zyplayer.doc.data.config.security;
|
||||
|
||||
import com.zyplayer.doc.data.repository.manage.entity.UserAuth;
|
||||
import com.zyplayer.doc.data.repository.support.consts.DocSysModuleType;
|
||||
import com.zyplayer.doc.data.repository.support.consts.DocSysType;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户权限表
|
||||
* </p>
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2019-05-31
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public class UserAuthInfo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public UserAuthInfo(UserAuth userAuth) {
|
||||
this.authId = userAuth.getAuthId();
|
||||
this.sysType = userAuth.getSysType();
|
||||
this.sysModuleType = userAuth.getSysModuleType();
|
||||
this.sysModuleId = userAuth.getSysModuleId();
|
||||
}
|
||||
|
||||
/**
|
||||
* 权限ID
|
||||
*/
|
||||
private Long authId;
|
||||
|
||||
/**
|
||||
* 权限code
|
||||
*/
|
||||
private String authCode;
|
||||
|
||||
/**
|
||||
* 系统类型,{@link DocSysType}
|
||||
*/
|
||||
private Integer sysType;
|
||||
|
||||
/**
|
||||
* 系统模块类型,{@link DocSysModuleType}
|
||||
*/
|
||||
private Integer sysModuleType;
|
||||
|
||||
/**
|
||||
* 系统模块ID
|
||||
*/
|
||||
private Long sysModuleId;
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
package com.zyplayer.doc.data.repository.manage.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 自建接口文档节点
|
||||
* </p>
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2022-01-29
|
||||
*/
|
||||
@Data
|
||||
@TableName("api_custom_node")
|
||||
public class ApiCustomNode implements Serializable {
|
||||
|
||||
/**
|
||||
* 主键自增ID
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* api_doc主键ID
|
||||
*/
|
||||
private Long docId;
|
||||
|
||||
/**
|
||||
* 父文件夹ID
|
||||
*/
|
||||
private Long parentId;
|
||||
|
||||
/**
|
||||
* 节点类型 0=目录 1=接口
|
||||
*/
|
||||
private Integer nodeType;
|
||||
|
||||
/**
|
||||
* 节点名称
|
||||
*/
|
||||
private String nodeName;
|
||||
|
||||
/**
|
||||
* 节点说明
|
||||
*/
|
||||
private String nodeDesc;
|
||||
|
||||
/**
|
||||
* 节点顺序
|
||||
*/
|
||||
private Integer seqNo;
|
||||
|
||||
/**
|
||||
* 创建人ID
|
||||
*/
|
||||
private Long createUserId;
|
||||
|
||||
/**
|
||||
* 创建人名字
|
||||
*/
|
||||
private String createUserName;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 是否有效 0=无效 1=有效
|
||||
*/
|
||||
private Integer yn;
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
package com.zyplayer.doc.data.repository.manage.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 自建接口文档
|
||||
* </p>
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2022-01-29
|
||||
*/
|
||||
@Data
|
||||
@TableName("api_custom_params")
|
||||
public class ApiCustomParams implements Serializable {
|
||||
|
||||
/**
|
||||
* 主键自增ID
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* api_doc主键ID
|
||||
*/
|
||||
private Long docId;
|
||||
|
||||
/**
|
||||
* 节点ID
|
||||
*/
|
||||
private Long nodeId;
|
||||
|
||||
/**
|
||||
* 请求方式:get、head、post、put、patch、delete、options、trace
|
||||
*/
|
||||
private String method;
|
||||
|
||||
/**
|
||||
* 接口url
|
||||
*/
|
||||
private String apiUrl;
|
||||
|
||||
/**
|
||||
* form参数
|
||||
*/
|
||||
private String formData;
|
||||
|
||||
/**
|
||||
* body参数
|
||||
*/
|
||||
private String bodyData;
|
||||
|
||||
/**
|
||||
* header参数
|
||||
*/
|
||||
private String headerData;
|
||||
|
||||
/**
|
||||
* cookie参数
|
||||
*/
|
||||
private String cookieData;
|
||||
|
||||
/**
|
||||
* 创建人ID
|
||||
*/
|
||||
private Long createUserId;
|
||||
|
||||
/**
|
||||
* 创建人名字
|
||||
*/
|
||||
private String createUserName;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 是否有效 0=无效 1=有效
|
||||
*/
|
||||
private Integer yn;
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
package com.zyplayer.doc.data.repository.manage.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* api文档地址
|
||||
* </p>
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2021-11-25
|
||||
*/
|
||||
@Data
|
||||
@TableName("api_doc")
|
||||
public class ApiDoc implements Serializable {
|
||||
|
||||
/**
|
||||
* 主键自增ID
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 文档名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 文档类型 1=swagger url 2=swagger json 3=openapi url 4=openapi json 5=自建API分组
|
||||
*/
|
||||
private Integer docType;
|
||||
|
||||
/**
|
||||
* 文档URL地址
|
||||
*/
|
||||
private String docUrl;
|
||||
|
||||
/**
|
||||
* 文档json内容
|
||||
*/
|
||||
private String jsonContent;
|
||||
|
||||
/**
|
||||
* 重写的域名
|
||||
*/
|
||||
private String rewriteDomain;
|
||||
|
||||
/**
|
||||
* 是否开放访问 0=否 1=是
|
||||
*/
|
||||
private Integer openVisit;
|
||||
|
||||
/**
|
||||
* 状态 1=启用 2=禁用
|
||||
*/
|
||||
private Integer docStatus;
|
||||
|
||||
/**
|
||||
* 开放文档UUID
|
||||
*/
|
||||
private String shareUuid;
|
||||
|
||||
/**
|
||||
* 开放文档使用说明
|
||||
*/
|
||||
private String shareInstruction;
|
||||
|
||||
/**
|
||||
* 创建人ID
|
||||
*/
|
||||
private Long createUserId;
|
||||
|
||||
/**
|
||||
* 创建人名字
|
||||
*/
|
||||
private String createUserName;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 是否有效 0=无效 1=有效
|
||||
*/
|
||||
private Integer yn;
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
package com.zyplayer.doc.data.repository.manage.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* api文档全局参数记录
|
||||
* </p>
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2021-11-25
|
||||
*/
|
||||
@Data
|
||||
@TableName("api_global_param")
|
||||
public class ApiGlobalParam implements Serializable {
|
||||
|
||||
/**
|
||||
* 主键自增ID
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* api_doc主键ID
|
||||
*/
|
||||
private Long docId;
|
||||
|
||||
/**
|
||||
* 参数类型 1=form 2=header 3=cookie
|
||||
*/
|
||||
private Integer paramType;
|
||||
|
||||
/**
|
||||
* 参数名
|
||||
*/
|
||||
private String paramKey;
|
||||
|
||||
/**
|
||||
* 参数值
|
||||
*/
|
||||
private String paramValue;
|
||||
|
||||
/**
|
||||
* 状态 1=启用 2=禁用
|
||||
*/
|
||||
private Integer paramStatus;
|
||||
|
||||
/**
|
||||
* 创建人ID
|
||||
*/
|
||||
private Long createUserId;
|
||||
|
||||
/**
|
||||
* 创建人名字
|
||||
*/
|
||||
private String createUserName;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 是否有效 0=无效 1=有效
|
||||
*/
|
||||
private Integer yn;
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
package com.zyplayer.doc.data.repository.manage.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 文档请求参数记录
|
||||
* </p>
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2021-11-25
|
||||
*/
|
||||
@Data
|
||||
@TableName("api_request_param")
|
||||
public class ApiRequestParam implements Serializable {
|
||||
|
||||
/**
|
||||
* 主键自增ID
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* api_doc主键ID
|
||||
*/
|
||||
private Long docId;
|
||||
|
||||
/**
|
||||
* 文档url
|
||||
*/
|
||||
private String docUrl;
|
||||
|
||||
/**
|
||||
* form参数
|
||||
*/
|
||||
private String formData;
|
||||
|
||||
/**
|
||||
* body参数
|
||||
*/
|
||||
private String bodyData;
|
||||
|
||||
/**
|
||||
* header参数
|
||||
*/
|
||||
private String headerData;
|
||||
|
||||
/**
|
||||
* cookie参数
|
||||
*/
|
||||
private String cookieData;
|
||||
|
||||
/**
|
||||
* 创建人ID
|
||||
*/
|
||||
private Long createUserId;
|
||||
|
||||
/**
|
||||
* 创建人名字
|
||||
*/
|
||||
private String createUserName;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 是否有效 0=无效 1=有效
|
||||
*/
|
||||
private Integer yn;
|
||||
}
|
||||
@@ -2,6 +2,8 @@ package com.zyplayer.doc.data.repository.manage.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
@@ -14,10 +16,10 @@ import java.util.Date;
|
||||
* @author 暮光:城中城
|
||||
* @since 2018-12-05
|
||||
*/
|
||||
@Data
|
||||
@TableName("auth_info")
|
||||
public class AuthInfo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键自增ID
|
||||
*/
|
||||
@@ -48,59 +50,4 @@ public class AuthInfo implements Serializable {
|
||||
* 创建时间
|
||||
*/
|
||||
private Date creationTime;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
public String getAuthName() {
|
||||
return authName;
|
||||
}
|
||||
|
||||
public void setAuthName(String authName) {
|
||||
this.authName = authName;
|
||||
}
|
||||
public String getAuthDesc() {
|
||||
return authDesc;
|
||||
}
|
||||
|
||||
public void setAuthDesc(String authDesc) {
|
||||
this.authDesc = authDesc;
|
||||
}
|
||||
public Integer getCanEdit() {
|
||||
return canEdit;
|
||||
}
|
||||
|
||||
public void setCanEdit(Integer canEdit) {
|
||||
this.canEdit = canEdit;
|
||||
}
|
||||
public Long getCreateUid() {
|
||||
return createUid;
|
||||
}
|
||||
|
||||
public void setCreateUid(Long createUid) {
|
||||
this.createUid = createUid;
|
||||
}
|
||||
public Date getCreationTime() {
|
||||
return creationTime;
|
||||
}
|
||||
|
||||
public void setCreationTime(Date creationTime) {
|
||||
this.creationTime = creationTime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "AuthInfo{" +
|
||||
"id=" + id +
|
||||
", authName=" + authName +
|
||||
", authDesc=" + authDesc +
|
||||
", canEdit=" + canEdit +
|
||||
", createUid=" + createUid +
|
||||
", creationTime=" + creationTime +
|
||||
"}";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,93 @@
|
||||
package com.zyplayer.doc.data.repository.manage.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 备份记录信息
|
||||
*
|
||||
* @author diantu
|
||||
* @since 2023年3月3日
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@TableName("backup_log")
|
||||
public class BackupLog implements Serializable {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
/**
|
||||
* 数据源id
|
||||
*/
|
||||
private Long dbId;
|
||||
/**
|
||||
* 来源(手动备份|自动备份)
|
||||
*/
|
||||
private String category;
|
||||
/**
|
||||
* 库名
|
||||
*/
|
||||
private String databaseName;
|
||||
/**
|
||||
* 表名
|
||||
*/
|
||||
private String tablesName;
|
||||
/**
|
||||
* 备份方式
|
||||
*/
|
||||
private Integer dataType;
|
||||
/**
|
||||
* 是否压缩
|
||||
*/
|
||||
private Boolean isCompress;
|
||||
/**
|
||||
* 是否上传
|
||||
*/
|
||||
private Boolean isUpload;
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
private Boolean isDelete;
|
||||
/**
|
||||
* 文件路径
|
||||
*/
|
||||
private String filePath;
|
||||
/**
|
||||
* 文件大小
|
||||
*/
|
||||
private Long fileSize;
|
||||
/**
|
||||
* 备份状态(-1-失败0-备份中1-上传中200-成功)
|
||||
*/
|
||||
private Integer status;
|
||||
/**
|
||||
* 备份信息
|
||||
*/
|
||||
private String msg;
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
private Date startTime;
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
private Date endTime;
|
||||
/**
|
||||
* 耗时(ms)
|
||||
*/
|
||||
private Long spendTime;
|
||||
/**
|
||||
* 删除状态(0--未删除1--已删除)
|
||||
*/
|
||||
private Integer delFlag;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package com.zyplayer.doc.data.repository.manage.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 备份任务信息
|
||||
*
|
||||
* @author diantu
|
||||
* @since 2023年3月3日
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@TableName(value = "backup_task", autoResultMap = true)
|
||||
public class BackupTask implements Serializable {
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
/**
|
||||
* 数据源id
|
||||
*/
|
||||
private Long dbId;
|
||||
/**
|
||||
* cron表达式
|
||||
*/
|
||||
private String cron;
|
||||
/**
|
||||
* 参数
|
||||
*/
|
||||
private String param;
|
||||
/**
|
||||
* 状态(0-停止1-启动)
|
||||
*/
|
||||
private Boolean status;
|
||||
/**
|
||||
* 库名
|
||||
*/
|
||||
private String databaseName;
|
||||
/**
|
||||
* 表名
|
||||
*/
|
||||
private String tablesName;
|
||||
/**
|
||||
* 备份方式
|
||||
*/
|
||||
private Integer dataType;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
/**
|
||||
* 删除状态(0--未删除1--已删除)
|
||||
*/
|
||||
private Integer delFlag;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
package com.zyplayer.doc.data.repository.manage.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 数据源对象
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2019-07-04
|
||||
*/
|
||||
@Data
|
||||
@TableName("db_datasource")
|
||||
public class DbDatasource implements Serializable {
|
||||
|
||||
/**
|
||||
* 主键自增ID
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 数据源驱动类
|
||||
*/
|
||||
private String driverClassName;
|
||||
|
||||
/**
|
||||
* 数据源地址
|
||||
*/
|
||||
private String sourceUrl;
|
||||
|
||||
/**
|
||||
* 数据源用户名
|
||||
*/
|
||||
private String sourceName;
|
||||
|
||||
/**
|
||||
* 数据源密码
|
||||
*/
|
||||
private String sourcePassword;
|
||||
|
||||
/**
|
||||
* 创建人ID
|
||||
*/
|
||||
private Long createUserId;
|
||||
|
||||
/**
|
||||
* 创建人名字
|
||||
*/
|
||||
private String createUserName;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 是否有效 0=无效 1=有效
|
||||
*/
|
||||
private Integer yn;
|
||||
|
||||
/**
|
||||
* 数据源名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 数据源分组
|
||||
*/
|
||||
private String groupName;
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
package com.zyplayer.doc.data.repository.manage.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2019-08-21
|
||||
*/
|
||||
@Data
|
||||
@TableName("db_favorite")
|
||||
public class DbFavorite implements Serializable {
|
||||
|
||||
/**
|
||||
* 主键自增ID
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 数据源ID
|
||||
*/
|
||||
private Long datasourceId;
|
||||
|
||||
/**
|
||||
* 收藏标题
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 收藏内容
|
||||
*/
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* 创建人ID
|
||||
*/
|
||||
private Long createUserId;
|
||||
|
||||
/**
|
||||
* 创建人名字
|
||||
*/
|
||||
private String createUserName;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 是否有效 0=无效 1=有效
|
||||
*/
|
||||
private Integer yn;
|
||||
|
||||
/**
|
||||
* 执行参数JSON
|
||||
*/
|
||||
private String paramJson;
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package com.zyplayer.doc.data.repository.manage.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2019-08-21
|
||||
*/
|
||||
@Data
|
||||
@TableName("db_history")
|
||||
public class DbHistory implements Serializable {
|
||||
|
||||
/**
|
||||
* 主键自增ID
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 数据源ID
|
||||
*/
|
||||
private Long datasourceId;
|
||||
|
||||
/**
|
||||
* sql内容
|
||||
*/
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* 创建人ID
|
||||
*/
|
||||
private Long createUserId;
|
||||
|
||||
/**
|
||||
* 创建人名字
|
||||
*/
|
||||
private String createUserName;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 是否有效 0=无效 1=有效
|
||||
*/
|
||||
private Integer yn;
|
||||
|
||||
/**
|
||||
* 执行参数JSON
|
||||
*/
|
||||
private String paramJson;
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
package com.zyplayer.doc.data.repository.manage.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 数据库函数修改日志
|
||||
* </p>
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2021-04-26
|
||||
*/
|
||||
@Data
|
||||
@TableName("db_proc_log")
|
||||
public class DbProcLog implements Serializable {
|
||||
|
||||
/**
|
||||
* 主键自增ID
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 数据源ID
|
||||
*/
|
||||
private Long datasourceId;
|
||||
|
||||
/**
|
||||
* 所属数据库
|
||||
*/
|
||||
private String procDb;
|
||||
|
||||
/**
|
||||
* 名字
|
||||
*/
|
||||
private String procName;
|
||||
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
private String procType;
|
||||
|
||||
/**
|
||||
* 函数创建SQL
|
||||
*/
|
||||
private String procBody;
|
||||
|
||||
/**
|
||||
* 保存状态 1=成功 2=失败
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 创建人ID
|
||||
*/
|
||||
private Long createUserId;
|
||||
|
||||
/**
|
||||
* 创建人名字
|
||||
*/
|
||||
private String createUserName;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
package com.zyplayer.doc.data.repository.manage.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 表关系
|
||||
* </p>
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2021-06-07
|
||||
*/
|
||||
@Data
|
||||
@TableName("db_table_relation")
|
||||
public class DbTableRelation implements Serializable {
|
||||
|
||||
/**
|
||||
* 主键自增ID
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 数据源ID
|
||||
*/
|
||||
private Long datasourceId;
|
||||
|
||||
/**
|
||||
* 源库名
|
||||
*/
|
||||
private String startDbName;
|
||||
|
||||
/**
|
||||
* 源表名
|
||||
*/
|
||||
private String startTableName;
|
||||
|
||||
/**
|
||||
* 源字段名
|
||||
*/
|
||||
private String startColumnName;
|
||||
|
||||
/**
|
||||
* 目标库名
|
||||
*/
|
||||
private String endDbName;
|
||||
|
||||
/**
|
||||
* 目标表名
|
||||
*/
|
||||
private String endTableName;
|
||||
|
||||
/**
|
||||
* 目标字段名
|
||||
*/
|
||||
private String endColumnName;
|
||||
|
||||
/**
|
||||
* 创建人ID
|
||||
*/
|
||||
private Long createUserId;
|
||||
|
||||
/**
|
||||
* 创建人名字
|
||||
*/
|
||||
private String createUserName;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
package com.zyplayer.doc.data.repository.manage.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2019-09-30
|
||||
*/
|
||||
@Data
|
||||
@TableName("db_transfer_task")
|
||||
public class DbTransferTask implements Serializable {
|
||||
|
||||
/**
|
||||
* 主键自增ID
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 任务名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 查询数据源ID
|
||||
*/
|
||||
private Long queryDatasourceId;
|
||||
|
||||
/**
|
||||
* 入库数据源ID
|
||||
*/
|
||||
private Long storageDatasourceId;
|
||||
|
||||
/**
|
||||
* 查询数据的sql
|
||||
*/
|
||||
private String querySql;
|
||||
|
||||
/**
|
||||
* 数据入库的sql
|
||||
*/
|
||||
private String storageSql;
|
||||
|
||||
/**
|
||||
* 自动查询总条数 0=否 1=是
|
||||
*/
|
||||
private Integer needCount;
|
||||
|
||||
/**
|
||||
* 最后执行状态 0=未执行 1=执行中 2=执行成功 3=执行失败 4=取消执行
|
||||
*/
|
||||
private Integer lastExecuteStatus;
|
||||
|
||||
/**
|
||||
* 最后执行时间
|
||||
*/
|
||||
private Date lastExecuteTime;
|
||||
|
||||
/**
|
||||
* 最后执行信息
|
||||
*/
|
||||
private String lastExecuteInfo;
|
||||
|
||||
/**
|
||||
* 创建人ID
|
||||
*/
|
||||
private Long createUserId;
|
||||
|
||||
/**
|
||||
* 创建人名字
|
||||
*/
|
||||
private String createUserName;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 删除标记 0=正常 1=已删除
|
||||
*/
|
||||
private Integer delFlag;
|
||||
}
|
||||
@@ -0,0 +1,153 @@
|
||||
package com.zyplayer.doc.data.repository.manage.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 系统配置表
|
||||
* </p>
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2022-12-01
|
||||
*/
|
||||
@TableName("system_config")
|
||||
public class SystemConfig implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键自增ID
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 配置Key
|
||||
*/
|
||||
private String configKey;
|
||||
|
||||
/**
|
||||
* 配置值
|
||||
*/
|
||||
private String configValue;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date created;
|
||||
|
||||
/**
|
||||
* 创建用户ID
|
||||
*/
|
||||
private Long createUserId;
|
||||
|
||||
/**
|
||||
* 创建用户名字
|
||||
*/
|
||||
private String createUser;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
private Date modified;
|
||||
|
||||
/**
|
||||
* 修改人ID
|
||||
*/
|
||||
private Long modifyUserId;
|
||||
|
||||
/**
|
||||
* 修改人姓名
|
||||
*/
|
||||
private String modifyUser;
|
||||
|
||||
/**
|
||||
* 是否有效 1=有效
|
||||
*/
|
||||
private Integer yn;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getConfigKey() {
|
||||
return configKey;
|
||||
}
|
||||
|
||||
public void setConfigKey(String configKey) {
|
||||
this.configKey = configKey;
|
||||
}
|
||||
|
||||
public String getConfigValue() {
|
||||
return configValue;
|
||||
}
|
||||
|
||||
public void setConfigValue(String configValue) {
|
||||
this.configValue = configValue;
|
||||
}
|
||||
|
||||
public Date getCreated() {
|
||||
return created;
|
||||
}
|
||||
|
||||
public void setCreated(Date created) {
|
||||
this.created = created;
|
||||
}
|
||||
|
||||
public Long getCreateUserId() {
|
||||
return createUserId;
|
||||
}
|
||||
|
||||
public void setCreateUserId(Long createUserId) {
|
||||
this.createUserId = createUserId;
|
||||
}
|
||||
|
||||
public String getCreateUser() {
|
||||
return createUser;
|
||||
}
|
||||
|
||||
public void setCreateUser(String createUser) {
|
||||
this.createUser = createUser;
|
||||
}
|
||||
|
||||
public Date getModified() {
|
||||
return modified;
|
||||
}
|
||||
|
||||
public void setModified(Date modified) {
|
||||
this.modified = modified;
|
||||
}
|
||||
|
||||
public Long getModifyUserId() {
|
||||
return modifyUserId;
|
||||
}
|
||||
|
||||
public void setModifyUserId(Long modifyUserId) {
|
||||
this.modifyUserId = modifyUserId;
|
||||
}
|
||||
|
||||
public String getModifyUser() {
|
||||
return modifyUser;
|
||||
}
|
||||
|
||||
public void setModifyUser(String modifyUser) {
|
||||
this.modifyUser = modifyUser;
|
||||
}
|
||||
|
||||
public Integer getYn() {
|
||||
return yn;
|
||||
}
|
||||
|
||||
public void setYn(Integer yn) {
|
||||
this.yn = yn;
|
||||
}
|
||||
}
|
||||
@@ -2,22 +2,24 @@ package com.zyplayer.doc.data.repository.manage.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* 用户权限表
|
||||
* </p>
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2018-12-05
|
||||
* @since 2019-05-31
|
||||
*/
|
||||
@Data
|
||||
@TableName("user_auth")
|
||||
public class UserAuth implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键自增ID
|
||||
*/
|
||||
@@ -59,74 +61,19 @@ public class UserAuth implements Serializable {
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
/**
|
||||
* 系统类型,DocSysType
|
||||
*/
|
||||
private Integer sysType;
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
public Long getUserId() {
|
||||
return userId;
|
||||
}
|
||||
/**
|
||||
* 系统模块类型,DocSysModuleType
|
||||
*/
|
||||
private Integer sysModuleType;
|
||||
|
||||
public void setUserId(Long userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
public Long getAuthId() {
|
||||
return authId;
|
||||
}
|
||||
/**
|
||||
* 系统模块ID
|
||||
*/
|
||||
private Long sysModuleId;
|
||||
|
||||
public void setAuthId(Long authId) {
|
||||
this.authId = authId;
|
||||
}
|
||||
public Long getCreateUid() {
|
||||
return createUid;
|
||||
}
|
||||
|
||||
public void setCreateUid(Long createUid) {
|
||||
this.createUid = createUid;
|
||||
}
|
||||
public Long getUpdateUid() {
|
||||
return updateUid;
|
||||
}
|
||||
|
||||
public void setUpdateUid(Long updateUid) {
|
||||
this.updateUid = updateUid;
|
||||
}
|
||||
public Integer getDelFlag() {
|
||||
return delFlag;
|
||||
}
|
||||
|
||||
public void setDelFlag(Integer delFlag) {
|
||||
this.delFlag = delFlag;
|
||||
}
|
||||
public Date getCreationTime() {
|
||||
return creationTime;
|
||||
}
|
||||
|
||||
public void setCreationTime(Date creationTime) {
|
||||
this.creationTime = creationTime;
|
||||
}
|
||||
public Date getUpdateTime() {
|
||||
return updateTime;
|
||||
}
|
||||
|
||||
public void setUpdateTime(Date updateTime) {
|
||||
this.updateTime = updateTime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "UserAuth{" +
|
||||
"id=" + id +
|
||||
", userId=" + userId +
|
||||
", authId=" + authId +
|
||||
", createUid=" + createUid +
|
||||
", updateUid=" + updateUid +
|
||||
", delFlag=" + delFlag +
|
||||
", creationTime=" + creationTime +
|
||||
", updateTime=" + updateTime +
|
||||
"}";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.zyplayer.doc.data.repository.manage.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户组
|
||||
* </p>
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2021-02-08
|
||||
*/
|
||||
@Data
|
||||
@TableName("user_group")
|
||||
public class UserGroup implements Serializable {
|
||||
|
||||
/**
|
||||
* 主键自增ID
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 分组名
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 创建人ID
|
||||
*/
|
||||
private Long createUserId;
|
||||
|
||||
/**
|
||||
* 创建人名字
|
||||
*/
|
||||
private String createUserName;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 删除标记 0=正常 1=已删除
|
||||
*/
|
||||
private Integer delFlag;
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
package com.zyplayer.doc.data.repository.manage.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户组在各项目内的授权关系
|
||||
* </p>
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2021-02-09
|
||||
*/
|
||||
@Data
|
||||
@TableName("user_group_auth")
|
||||
public class UserGroupAuth implements Serializable {
|
||||
|
||||
/**
|
||||
* 主键自增ID
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 群ID
|
||||
*/
|
||||
private Long groupId;
|
||||
|
||||
/**
|
||||
* 授权数据的ID
|
||||
*/
|
||||
private Long dataId;
|
||||
|
||||
/**
|
||||
* 授权类型,依据各项目自己定义
|
||||
*/
|
||||
private Integer authType;
|
||||
|
||||
/**
|
||||
* 项目类型 1=WIKI模块 2=数据库模块
|
||||
*/
|
||||
private Integer projectType;
|
||||
|
||||
/**
|
||||
* 创建人ID
|
||||
*/
|
||||
private Long createUserId;
|
||||
|
||||
/**
|
||||
* 创建人名字
|
||||
*/
|
||||
private String createUserName;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 删除标记 0=正常 1=已删除
|
||||
*/
|
||||
private Integer delFlag;
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.zyplayer.doc.data.repository.manage.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户和用户组关系表
|
||||
* </p>
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2021-02-08
|
||||
*/
|
||||
@Data
|
||||
@TableName("user_group_relation")
|
||||
public class UserGroupRelation implements Serializable {
|
||||
|
||||
/**
|
||||
* 主键自增ID
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 群ID
|
||||
*/
|
||||
private Long groupId;
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 创建人ID
|
||||
*/
|
||||
private Long createUserId;
|
||||
|
||||
/**
|
||||
* 创建人名字
|
||||
*/
|
||||
private String createUserName;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 删除标记 0=正常 1=已删除
|
||||
*/
|
||||
private Integer delFlag;
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user