mirror of
http://git.pig4cloud.com/pig/pigx.git
synced 2026-11-15 06:29:01 +08:00
Compare commits
2274
Commits
3.1.0
...
a6d0705e40
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a6d0705e40 | ||
|
|
c0034f3799 | ||
|
|
db23fd2d0c | ||
|
|
fd5cd572a4 | ||
|
|
ab91447941 | ||
|
|
e3440353ae | ||
|
|
ff98dcc3fb | ||
|
|
467a1fea1b | ||
|
|
8d37e48d1f | ||
|
|
589d17f0d3 | ||
|
|
5f4d9d6621 | ||
|
|
d6adbfa36e | ||
|
|
b003a1b444 | ||
|
|
0974a56294 | ||
|
|
2f089f029f | ||
|
|
93c52e41dc | ||
|
|
2053cc5766 | ||
|
|
ddfc2b41d9 | ||
|
|
14cb5dfe0a | ||
|
|
f8742f5e69 | ||
|
|
e0d43f41a1 | ||
|
|
b04588ffae | ||
|
|
fbb5bd121c | ||
|
|
72ac720fb6 | ||
|
|
cf917b5988 | ||
|
|
d0aa3a7284 | ||
|
|
4f6e796c55 | ||
|
|
085235710b | ||
|
|
749931b53e | ||
|
|
a177f3073a | ||
|
|
d927a5b984 | ||
|
|
daad35902e | ||
|
|
e4bda833bc | ||
|
|
cbdd0e202c | ||
|
|
ccdbde5229 | ||
|
|
3b15ea4235 | ||
|
|
3fd14644cd | ||
|
|
4471c363cb | ||
|
|
c0a2b97679 | ||
|
|
45250841a5 | ||
|
|
57877b951f | ||
|
|
618a29be52 | ||
|
|
67608f76ba | ||
|
|
22f55b8ba3 | ||
|
|
9d5ff9c022 | ||
|
|
ec93f78417 | ||
|
|
65f184ace6 | ||
|
|
ca84985d63 | ||
|
|
b8fda524f8 | ||
|
|
dc663491b6 | ||
|
|
cca41756c8 | ||
|
|
cb08f11a5d | ||
|
|
e63dc8678e | ||
|
|
abf10a2a19 | ||
|
|
1db9bdc636 | ||
|
|
60babcbc3d | ||
|
|
2bc231f1bf | ||
|
|
464c6df5b8 | ||
|
|
7720ea8547 | ||
|
|
ee27036339 | ||
|
|
db60b48f6c | ||
|
|
7712a1bb3c | ||
|
|
816a63f0c2 | ||
|
|
545b0a4642 | ||
|
|
1dc58c60cf | ||
|
|
75ec99389c | ||
|
|
b6681ed578 | ||
|
|
53e7a6c2eb | ||
|
|
a810bf8f0b | ||
|
|
840732c52d | ||
|
|
6a4b8b1f1d | ||
|
|
3f4d1dbf6e | ||
|
|
39ea9a6eae | ||
|
|
c80d5bc44a | ||
|
|
50b68563a6 | ||
|
|
2a6ce673f5 | ||
|
|
08c081304a | ||
|
|
bca999535c | ||
|
|
d46af13a2e | ||
|
|
4023b142d1 | ||
|
|
269d7fe5e4 | ||
|
|
2edc478f73 | ||
|
|
cbb68a0e5b | ||
|
|
9c63820b53 | ||
|
|
4ed36c5559 | ||
|
|
c3b336aad4 | ||
|
|
d46e42d51d | ||
|
|
fe9ee4d1e6 | ||
|
|
0aaaee14fb | ||
|
|
a043c4f19e | ||
|
|
d1876914d2 | ||
|
|
6248d60e62 | ||
|
|
7461394f99 | ||
|
|
55df29df99 | ||
|
|
0601ed01ed | ||
|
|
2b6a4d2e85 | ||
|
|
5931a5d6d7 | ||
|
|
83ee6144b3 | ||
|
|
08a82ee09c | ||
|
|
1dad386954 | ||
|
|
02cfe26922 | ||
|
|
87911c87d0 | ||
|
|
75f426deb3 | ||
|
|
41f20b2db3 | ||
|
|
d9130d4fbf | ||
|
|
ea6940378c | ||
|
|
ce07c9dcb9 | ||
|
|
fb5e1bdf6e | ||
|
|
2ab4d66f28 | ||
|
|
d3afca673e | ||
|
|
0a15577761 | ||
|
|
2bc5fb5f24 | ||
|
|
76ea7f45ac | ||
|
|
8062730ec3 | ||
|
|
15fb0df080 | ||
|
|
1e74a8e4b2 | ||
|
|
194e3e0f99 | ||
|
|
4f79671c94 | ||
|
|
91b5d27347 | ||
|
|
d6ef8e4e98 | ||
|
|
87489ed353 | ||
|
|
e883e64a65 | ||
|
|
00a4b30ecb | ||
|
|
82743a0375 | ||
|
|
a8437aacad | ||
|
|
74fb06e3ea | ||
|
|
bdeba4ce3d | ||
|
|
a6af889ccf | ||
|
|
9236384ce6 | ||
|
|
53bf0dbcb1 | ||
|
|
dda210e91a | ||
|
|
783c688b6c | ||
|
|
2c2a9a3bd7 | ||
|
|
d7c4ab10b3 | ||
|
|
a5d3dff3fc | ||
|
|
d3966d64f5 | ||
|
|
fef648a8cf | ||
|
|
28c16ac730 | ||
|
|
b82721c293 | ||
|
|
ace1e560f7 | ||
|
|
e3287e3d8a | ||
|
|
778e795d9d | ||
|
|
45c7ceec17 | ||
|
|
5d561bee33 | ||
|
|
f172154800 | ||
|
|
f3c0b2034c | ||
|
|
dd49790ceb | ||
|
|
3b6c63dd64 | ||
|
|
b19c1c2f0f | ||
|
|
21127c11b5 | ||
|
|
5eff0d71df | ||
|
|
124a2547dd | ||
|
|
3132cc3784 | ||
|
|
1b87ae9787 | ||
|
|
0fca2924d4 | ||
|
|
5ad4dfb711 | ||
|
|
c796af6c5f | ||
|
|
87a1ea1ae0 | ||
|
|
1d9bfd866f | ||
|
|
836fc04a26 | ||
|
|
5f3bff90e1 | ||
|
|
26efa7acbf | ||
|
|
a1edbfcc6e | ||
|
|
c48d5f753c | ||
|
|
32c6e81b3a | ||
|
|
7613f72673 | ||
|
|
e80b4f0b28 | ||
|
|
e88b2818fd | ||
|
|
f68327b857 | ||
|
|
66e55f3258 | ||
|
|
9d198266d7 | ||
|
|
fe64bf38c2 | ||
|
|
f759865202 | ||
|
|
b553787cfd | ||
|
|
2c70387ace | ||
|
|
9d6515d8fa | ||
|
|
c3f757e38c | ||
|
|
61adedf902 | ||
|
|
0198431ffa | ||
|
|
ed60e69d07 | ||
|
|
e646321d15 | ||
|
|
40977fbc56 | ||
|
|
13b8984769 | ||
|
|
cb8e426855 | ||
|
|
7e005eabd0 | ||
|
|
7070b9f3d2 | ||
|
|
57d1d03a6c | ||
|
|
98656e4af3 | ||
|
|
96361c21ec | ||
|
|
cd2ec46f82 | ||
|
|
3acab393c4 | ||
|
|
410a869db2 | ||
|
|
3c05364e12 | ||
|
|
325f58996d | ||
|
|
b28d86cb59 | ||
|
|
ecdbfaca68 | ||
|
|
1b27c695d8 | ||
|
|
650d791222 | ||
|
|
ef13df4f79 | ||
|
|
191efaad40 | ||
|
|
88d057f081 | ||
|
|
d70d741e50 | ||
|
|
2efe58556a | ||
|
|
583fca8611 | ||
|
|
d11856d3f0 | ||
|
|
11b6faf6f8 | ||
|
|
84041ed7ce | ||
|
|
618f3ff1d5 | ||
|
|
2754607924 | ||
|
|
d1858d5844 | ||
|
|
b7631ddeaf | ||
|
|
e60a28a17e | ||
|
|
7015e4704c | ||
|
|
4868f0d213 | ||
|
|
a44319f898 | ||
|
|
0187d93912 | ||
|
|
c19c0f1ed4 | ||
|
|
7e78541763 | ||
|
|
4d9093c851 | ||
|
|
f312f1b229 | ||
|
|
70334d3c11 | ||
|
|
23287b77ea | ||
|
|
d2f49723d6 | ||
|
|
31ad1fbeb8 | ||
|
|
27898142ac | ||
|
|
bf2ed2f9f7 | ||
|
|
fefbc25f45 | ||
|
|
6fc0a3de36 | ||
|
|
2acdceac2a | ||
|
|
b59765f927 | ||
|
|
79dd2471ad | ||
|
|
f56a63beba | ||
|
|
173bc6853d | ||
|
|
b9268e4393 | ||
|
|
c36ef5fdf5 | ||
|
|
25e16f5dd6 | ||
|
|
7bdf9e1d8c | ||
|
|
36620c05ad | ||
|
|
85a1d609e3 | ||
|
|
13d17923e4 | ||
|
|
e959811fa2 | ||
|
|
5a324b75c9 | ||
|
|
6743d8d7ab | ||
|
|
bfd64bbd47 | ||
|
|
77ebb4fe37 | ||
|
|
aaab895655 | ||
|
|
f30b32a28a | ||
|
|
7911761653 | ||
|
|
825b9a147b | ||
|
|
16a7f9309f | ||
|
|
0ad5864476 | ||
|
|
d6c1a0aad1 | ||
|
|
ab97082cd8 | ||
|
|
65297a5574 | ||
|
|
2716c65170 | ||
|
|
87d1162c45 | ||
|
|
4adc7b00de | ||
|
|
f181712cf2 | ||
|
|
e1ac291a1e | ||
|
|
1268e9d604 | ||
|
|
437970b926 | ||
|
|
5ce0abdcd6 | ||
|
|
71a6f5c2d7 | ||
|
|
efd195ae37 | ||
|
|
0b939f3d57 | ||
|
|
5123e3f116 | ||
|
|
470f5e7fdb | ||
|
|
c88762a433 | ||
|
|
6d837c6f1c | ||
|
|
1a8d0c0898 | ||
|
|
c0112af189 | ||
|
|
6de57dfab1 | ||
|
|
a25963323b | ||
|
|
15f28dcd35 | ||
|
|
45146adec1 | ||
|
|
646859625b | ||
|
|
b7c4132765 | ||
|
|
74110199e2 | ||
|
|
6117c47d7c | ||
|
|
99daf9db95 | ||
|
|
16dcbef197 | ||
|
|
dc3ad69a38 | ||
|
|
92d9b403c0 | ||
|
|
f4508ac412 | ||
|
|
1bb0af7b52 | ||
|
|
99d295bfa8 | ||
|
|
6f9d41b624 | ||
|
|
14cdf670f2 | ||
|
|
d67bee5476 | ||
|
|
0674403268 | ||
|
|
103f5e72b0 | ||
|
|
dacdb83989 | ||
|
|
d16d8bc18a | ||
|
|
7710baa92a | ||
|
|
883293cc2a | ||
|
|
ed6138b566 | ||
|
|
4b8775153b | ||
|
|
f53e542100 | ||
|
|
38916dda25 | ||
|
|
d8ddacd143 | ||
|
|
e3f4200a39 | ||
|
|
9ee99d4063 | ||
|
|
b329b5c501 | ||
|
|
8c924da2dc | ||
|
|
02e60b3968 | ||
|
|
c6c76b3cbd | ||
|
|
9c237c9921 | ||
|
|
cd1854e498 | ||
|
|
0d5326ff77 | ||
|
|
0eaa4b6d11 | ||
|
|
79b27b6d7d | ||
|
|
2551ef2606 | ||
|
|
a60127323e | ||
|
|
70855f8b5b | ||
|
|
f01440dd9e | ||
|
|
f6798c1d21 | ||
|
|
1ef50a6d5b | ||
|
|
79841ced60 | ||
|
|
f9e960ea1f | ||
|
|
6a4b25b3d2 | ||
|
|
e1f5bf6325 | ||
|
|
7be922ef0f | ||
|
|
2b64a4cfe1 | ||
|
|
8d81533751 | ||
|
|
72e575bbbe | ||
|
|
fea0028126 | ||
|
|
9649b980e5 | ||
|
|
651ff2c74e | ||
|
|
6bdbb17dd3 | ||
|
|
c855344c3c | ||
|
|
0c11c4ffa9 | ||
|
|
31cae49a17 | ||
|
|
f7c1dc402a | ||
|
|
887c9c32e3 | ||
|
|
fdc704d564 | ||
|
|
fdc3ba87da | ||
|
|
2fc40ac21a | ||
|
|
c9124d11c6 | ||
|
|
769d49a0d5 | ||
|
|
23a464bb7f | ||
|
|
cb7e7222c4 | ||
|
|
f0b83406be | ||
|
|
a3951a0368 | ||
|
|
88da029a7e | ||
|
|
d32b1af5e4 | ||
|
|
dc0e814522 | ||
|
|
bcfeec31bc | ||
|
|
c0e9ed69be | ||
|
|
2d7d089fcd | ||
|
|
00efa97eef | ||
|
|
bf1e58fb71 | ||
|
|
32c7aec93d | ||
|
|
809b17da68 | ||
|
|
c8edf16536 | ||
|
|
d392f2f03a | ||
|
|
0be39ba180 | ||
|
|
6dfa937f34 | ||
|
|
21130253a4 | ||
|
|
b1646437bc | ||
|
|
886471f96a | ||
|
|
2db74fc7d6 | ||
|
|
c8a8da7497 | ||
|
|
db332055ae | ||
|
|
d3770993ce | ||
|
|
3a53fb5677 | ||
|
|
5058c07bff | ||
|
|
7205251977 | ||
|
|
8227768849 | ||
|
|
a970fe166a | ||
|
|
e2e73dffda | ||
|
|
f7edba9801 | ||
|
|
24a685bc54 | ||
|
|
b49e8bf736 | ||
|
|
946ca2ef38 | ||
|
|
de7e1fb4df | ||
|
|
607f7a13eb | ||
|
|
7d422b91ab | ||
|
|
5978f87268 | ||
|
|
1e9c1bd054 | ||
|
|
f796c87342 | ||
|
|
679aebdbb7 | ||
|
|
52e5be9442 | ||
|
|
78874c1646 | ||
|
|
fe9151c2f2 | ||
|
|
9601609eb2 | ||
|
|
718a587c19 | ||
|
|
6c8e257a1e | ||
|
|
880652f62c | ||
|
|
155a303bec | ||
|
|
8d0eb9c8fb | ||
|
|
00fb8ce48b | ||
|
|
64cdd035e1 | ||
|
|
404d7bf6c2 | ||
|
|
2ad48fb751 | ||
|
|
560129fc06 | ||
|
|
bcd0f82bcc | ||
|
|
1b560e486b | ||
|
|
0a661a3dc3 | ||
|
|
f3738c4e11 | ||
|
|
c3f6e68770 | ||
|
|
be30534c40 | ||
|
|
6912730e94 | ||
|
|
d8e56129bc | ||
|
|
4779be6cfd | ||
|
|
298d09586d | ||
|
|
2b1742470c | ||
|
|
d87172db05 | ||
|
|
19a223695f | ||
|
|
37035cbf27 | ||
|
|
bf8b8805c8 | ||
|
|
d0f89b7917 | ||
|
|
6b48ccf74a | ||
|
|
b3834e3215 | ||
|
|
dc37974c72 | ||
|
|
f1231ec841 | ||
|
|
7f9e6105f8 | ||
|
|
1700648c2e | ||
|
|
a5abaa4d2c | ||
|
|
e78eb14898 | ||
|
|
8edb1458a0 | ||
|
|
7db8f47e39 | ||
|
|
7f79e077d1 | ||
|
|
c303196fe7 | ||
|
|
0422a35562 | ||
|
|
96011a3663 | ||
|
|
9b4590ccbb | ||
|
|
47a4421cb3 | ||
|
|
29de9b5732 | ||
|
|
d0a5e0f66b | ||
|
|
01724e788a | ||
|
|
6764a33d1d | ||
|
|
daafcd9eea | ||
|
|
cee6524ffb | ||
|
|
bf410db2eb | ||
|
|
2abb4faacf | ||
|
|
cba22d4066 | ||
|
|
b55f7fbe91 | ||
|
|
86a3340802 | ||
|
|
69d0589222 | ||
|
|
c536348d52 | ||
|
|
b08b69c29b | ||
|
|
4978ab23f6 | ||
|
|
a825de905a | ||
|
|
5b5aac37d0 | ||
|
|
e7bea5e221 | ||
|
|
186505deac | ||
|
|
9f7f4c4564 | ||
|
|
aef21008d9 | ||
|
|
675d068018 | ||
|
|
3a8116b5ea | ||
|
|
fd44cc6042 | ||
|
|
a328d1c90e | ||
|
|
4ea3b805fe | ||
|
|
d0e54a7013 | ||
|
|
8c0d8c0284 | ||
|
|
312720fada | ||
|
|
af90a5c906 | ||
|
|
8bc5f95291 | ||
|
|
32b5ecf6ed | ||
|
|
d474799fa7 | ||
|
|
ecc0c8ac93 | ||
|
|
6b5dbb86cb | ||
|
|
dbd552a42c | ||
|
|
deddae63d5 | ||
|
|
3e016ecc4f | ||
|
|
7a97f94557 | ||
|
|
518720d325 | ||
|
|
818b4370d2 | ||
|
|
4ed963af5d | ||
|
|
ee2453934d | ||
|
|
597123ae6d | ||
|
|
a233aa5b5a | ||
|
|
db2f4ffa71 | ||
|
|
ecad480ec7 | ||
|
|
a285a86571 | ||
|
|
990824343d | ||
|
|
c485de19f2 | ||
|
|
8afdafbea4 | ||
|
|
3a5d7a9eb9 | ||
|
|
7f8626e04f | ||
|
|
cfae5e1c05 | ||
|
|
a00f4f81a4 | ||
|
|
03c3b96275 | ||
|
|
803cf33d1e | ||
|
|
cb131319be | ||
|
|
3e7df4cc61 | ||
|
|
84a5f75776 | ||
|
|
67150af00a | ||
|
|
d8c9f64079 | ||
|
|
552d6feaf9 | ||
|
|
7dab2a5121 | ||
|
|
0777db3cd2 | ||
|
|
a63d66f291 | ||
|
|
11d2262b8c | ||
|
|
bba2e67f23 | ||
|
|
5332ee8ce3 | ||
|
|
08f9b493e0 | ||
|
|
ab86bce01c | ||
|
|
59c8d2a672 | ||
|
|
7b1e95f5ff | ||
|
|
17a081edb8 | ||
|
|
63318ae288 | ||
|
|
f6a8ba8c0e | ||
|
|
cc0f1cda67 | ||
|
|
31f41db931 | ||
|
|
d249355f05 | ||
|
|
75549547b5 | ||
|
|
9415d82c28 | ||
|
|
a55f6d0bfb | ||
|
|
754d6428c4 | ||
|
|
a013b5196a | ||
|
|
0a8586ef1e | ||
|
|
2999ed8e3a | ||
|
|
4f8a78661b | ||
|
|
8baef653f1 | ||
|
|
e77e2c5a4a | ||
|
|
bc305ca84a | ||
|
|
062034a3a3 | ||
|
|
536be6fb15 | ||
|
|
0d798c328f | ||
|
|
9cf022c717 | ||
|
|
2608b831ff | ||
|
|
f3a03c1afa | ||
|
|
3b7a66652a | ||
|
|
64e17420ef | ||
|
|
eec245d4ad | ||
|
|
10e5234e34 | ||
|
|
d9ed794fc3 | ||
|
|
4ff88571c7 | ||
|
|
8d0faea641 | ||
|
|
c617a8b7e2 | ||
|
|
4c8ae51957 | ||
|
|
2d999e325b | ||
|
|
5d3eba85c4 | ||
|
|
b62b13fdaf | ||
|
|
bb1a78e859 | ||
|
|
fb10c25c6f | ||
|
|
f2384b2b73 | ||
|
|
f763512a6c | ||
|
|
61d08708b9 | ||
|
|
52827cdbf9 | ||
|
|
61121eb507 | ||
|
|
0d9461d036 | ||
|
|
6ca76a3016 | ||
|
|
0243e59041 | ||
|
|
9dd236e068 | ||
|
|
075cda636a | ||
|
|
02dea27959 | ||
|
|
fddf156651 | ||
|
|
59ebbb65de | ||
|
|
3f82770353 | ||
|
|
a99abf52a6 | ||
|
|
1e79c85b17 | ||
|
|
e7e31200f2 | ||
|
|
a48e51eda9 | ||
|
|
4fbc5e6c14 | ||
|
|
0d8cde1e13 | ||
|
|
fd6875763b | ||
|
|
2071195f7d | ||
|
|
9dc190df59 | ||
|
|
17a7351e31 | ||
|
|
eac1c8beaf | ||
|
|
5e5e36d1d4 | ||
|
|
350414563c | ||
|
|
43fed57a86 | ||
|
|
b87a0839e0 | ||
|
|
89dd047167 | ||
|
|
f4e0455376 | ||
|
|
62d0271af5 | ||
|
|
d72fade7b0 | ||
|
|
0e8858a338 | ||
|
|
b5a33cbdd0 | ||
|
|
b560859f20 | ||
|
|
bc0debdbf2 | ||
|
|
2e6a5831b3 | ||
|
|
f548079d23 | ||
|
|
b14c52403c | ||
|
|
ee0e34eab3 | ||
|
|
6671a4abf9 | ||
|
|
26f1f69a56 | ||
|
|
e167095932 | ||
|
|
2a5e07f2d7 | ||
|
|
80a335e93c | ||
|
|
f6e5aebfac | ||
|
|
a2a9bf529f | ||
|
|
686c0c770f | ||
|
|
1a1e2be00f | ||
|
|
604a124ff6 | ||
|
|
f1aa2ff390 | ||
|
|
ed6af29f8a | ||
|
|
75bfcbdaca | ||
|
|
c01498f8d2 | ||
|
|
bb5e9cb555 | ||
|
|
98205b3ead | ||
|
|
5c724900e3 | ||
|
|
3c659c86bd | ||
|
|
d6fd5ad960 | ||
|
|
d723fac0e2 | ||
|
|
5827c163c2 | ||
|
|
d5daf6b27d | ||
|
|
f2921c2102 | ||
|
|
4118d91756 | ||
|
|
f3ab8396bc | ||
|
|
6f7c83feb8 | ||
|
|
0e6be2eccc | ||
|
|
95644e9b9a | ||
|
|
4747aa1098 | ||
|
|
1359415965 | ||
|
|
ad0c7b87b1 | ||
|
|
1bf9ba0db6 | ||
|
|
ec0703d45d | ||
|
|
7750314ac6 | ||
|
|
c9d8c6a421 | ||
|
|
2ece806760 | ||
|
|
51a20ad898 | ||
|
|
a616bcc2de | ||
|
|
4b2d55f339 | ||
|
|
f8630da5af | ||
|
|
97348c9e83 | ||
|
|
6d56f5e213 | ||
|
|
e9b77a8e09 | ||
|
|
c2d4c438c4 | ||
|
|
1b822862bf | ||
|
|
20ef46292f | ||
|
|
9a3c2ddf3f | ||
|
|
e94b2f1d63 | ||
|
|
08376e2cfe | ||
|
|
aedd2fe4c7 | ||
|
|
03b3ecac55 | ||
|
|
ba15cf45cc | ||
|
|
cdac9cab16 | ||
|
|
f650c2c743 | ||
|
|
8c202a1938 | ||
|
|
e96eaa2179 | ||
|
|
aba51bbdb8 | ||
|
|
835d582b3b | ||
|
|
69aa10d54e | ||
|
|
148a2f54da | ||
|
|
a9b9475fa3 | ||
|
|
c80178148a | ||
|
|
04af734d83 | ||
|
|
2a1a7880f0 | ||
|
|
5d75b8294f | ||
|
|
9e5cbd4fb5 | ||
|
|
860a3f72f5 | ||
|
|
c647864b9b | ||
|
|
310b16ba7b | ||
|
|
abb033f560 | ||
|
|
2c77c3db7f | ||
|
|
2da674478e | ||
|
|
69d54efdd4 | ||
|
|
7052b21a63 | ||
|
|
2e06c03e57 | ||
|
|
b4db53891d | ||
|
|
63032e672f | ||
|
|
1a10197b48 | ||
|
|
9fa8b13b6e | ||
|
|
68e97384e6 | ||
|
|
50bf7c6ba0 | ||
|
|
282c998b41 | ||
|
|
aa01420e46 | ||
|
|
e61d526512 | ||
|
|
d9e0c8cf34 | ||
|
|
04e65b00f7 | ||
|
|
3e448f1093 | ||
|
|
8e32d61f58 | ||
|
|
fdd7b72f2a | ||
|
|
9843bd949d | ||
|
|
22666e1ffa | ||
|
|
2d1f8cd6db | ||
|
|
45fc19a5b2 | ||
|
|
3061a6ec6d | ||
|
|
852be70ab9 | ||
|
|
c7a3534fd7 | ||
|
|
38beb5783c | ||
|
|
61c78a90fd | ||
|
|
05d5e067d6 | ||
|
|
4f736bbac1 | ||
|
|
77004a2ffa | ||
|
|
f95a92d9e5 | ||
|
|
cd5bae6c1a | ||
|
|
a2e86bc562 | ||
|
|
9b0aeaa326 | ||
|
|
f79fe5e03e | ||
|
|
65f939bbb8 | ||
|
|
5c83763c29 | ||
|
|
d97a001ec6 | ||
|
|
c14ee912ce | ||
|
|
4b201215dd | ||
|
|
e50fb137e7 | ||
|
|
cc1a87944b | ||
|
|
bbf5614cfc | ||
|
|
cc96bf8434 | ||
|
|
4f19ddbeca | ||
|
|
a78682d49f | ||
|
|
946dcdaf99 | ||
|
|
179f818e4b | ||
|
|
079d70e204 | ||
|
|
690568aa82 | ||
|
|
6fc3a9af40 | ||
|
|
503b4aff74 | ||
|
|
1a145b1287 | ||
|
|
4d76bd855b | ||
|
|
6fcfb260b4 | ||
|
|
97e3ffc6ac | ||
|
|
41ce4c9fb2 | ||
|
|
f1b1d58fa1 | ||
|
|
86a32f7c8e | ||
|
|
67b276af44 | ||
|
|
5138c1e2b8 | ||
|
|
3d85bb87f8 | ||
|
|
2f7a72c091 | ||
|
|
26bc891783 | ||
|
|
44dd71abca | ||
|
|
4c667d04e1 | ||
|
|
7fbecca54e | ||
|
|
e83dc9a198 | ||
|
|
3d1bbef3a7 | ||
|
|
27de7564c5 | ||
|
|
b77d318f07 | ||
|
|
f3a93fd3d0 | ||
|
|
159ec6d9d4 | ||
|
|
d5d48d369f | ||
|
|
9c521a7d34 | ||
|
|
5db9daee21 | ||
|
|
c5e4d9a0d9 | ||
|
|
6ba8ce326d | ||
|
|
60257eec93 | ||
|
|
80a2e85618 | ||
|
|
d7416be841 | ||
|
|
ebddfc2e9f | ||
|
|
55943af46d | ||
|
|
ff79ae2e27 | ||
|
|
a3a32320c2 | ||
|
|
9f6be8850b | ||
|
|
ac2fbfef0d | ||
|
|
5f3aa969f3 | ||
|
|
10f979fcf8 | ||
|
|
88ad413fa5 | ||
|
|
8dd3c178d4 | ||
|
|
c3cdc145d5 | ||
|
|
59a202e4d9 | ||
|
|
2e582d8710 | ||
|
|
71e5a0e2ab | ||
|
|
9b0fe3f4e2 | ||
|
|
3352865429 | ||
|
|
2d0b08bf3f | ||
|
|
37bebcd066 | ||
|
|
f3b4a32dd9 | ||
|
|
c65f8ddd7a | ||
|
|
02e2d34cc1 | ||
|
|
26d4bad0ff | ||
|
|
d2585f2890 | ||
|
|
12cc50109c | ||
|
|
e159602711 | ||
|
|
473f193fb6 | ||
|
|
bd762afa2d | ||
|
|
48fcea9978 | ||
|
|
96278499dc | ||
|
|
ac91659105 | ||
|
|
d7f9cb21fb | ||
|
|
e030653d40 | ||
|
|
bf0cf11349 | ||
|
|
fa08b161f6 | ||
|
|
64d4dd6484 | ||
|
|
7f46d9791b | ||
|
|
4025c42fcf | ||
|
|
c5b2f82a7a | ||
|
|
4f63af4ebf | ||
|
|
1c4de7ef2a | ||
|
|
4f1c99d38b | ||
|
|
f5026e2206 | ||
|
|
3169e0c1c7 | ||
|
|
d6f5266350 | ||
|
|
db60afa592 | ||
|
|
291b54f2fe | ||
|
|
54b93d1c66 | ||
|
|
2b7b6a744c | ||
|
|
c0e15a4ded | ||
|
|
c424c5aa8f | ||
|
|
ad37fb25bb | ||
|
|
d421b5f22c | ||
|
|
5a8e4b72b1 | ||
|
|
d15832c784 | ||
|
|
6ef72febbf | ||
|
|
cfde3c0e1a | ||
|
|
66b3684ee2 | ||
|
|
46c1c9e326 | ||
|
|
57c101e28e | ||
|
|
55bcd9fe45 | ||
|
|
16b86b0f66 | ||
|
|
8370878ace | ||
|
|
9b3280ff5d | ||
|
|
e78189b266 | ||
|
|
80bb259b68 | ||
|
|
83118f5066 | ||
|
|
6bb62a839e | ||
|
|
96e1df004f | ||
|
|
e0fd01d74b | ||
|
|
93f02b9d8b | ||
|
|
018768a15e | ||
|
|
7460562571 | ||
|
|
7c24c2d049 | ||
|
|
8e6e6166b5 | ||
|
|
d1529c5fba | ||
|
|
47530dea5e | ||
|
|
34bf7572bf | ||
|
|
e0bc54f558 | ||
|
|
2716461566 | ||
|
|
673896ecf7 | ||
|
|
f6f05b132a | ||
|
|
3e1d96f9b1 | ||
|
|
936acbb716 | ||
|
|
a8f77654c0 | ||
|
|
3ffb89177a | ||
|
|
5c11673841 | ||
|
|
247c5dbcc9 | ||
|
|
5db1ca8e62 | ||
|
|
a6577abe17 | ||
|
|
fc49d5c488 | ||
|
|
7867476745 | ||
|
|
dde66002b2 | ||
|
|
07d9f0c98c | ||
|
|
61bfcc00de | ||
|
|
bcbf539670 | ||
|
|
8aeac8c4e9 | ||
|
|
6a0199d9cd | ||
|
|
b0df74b134 | ||
|
|
7d14ed4345 | ||
|
|
7aa5a4ebe2 | ||
|
|
f1a1291203 | ||
|
|
31efcb669a | ||
|
|
f98fb3ba1a | ||
|
|
22bc9ef90e | ||
|
|
5bd6d4643c | ||
|
|
32bcd5465b | ||
|
|
4d60ca8600 | ||
|
|
90f31d178f | ||
|
|
cb4f51facc | ||
|
|
a7b752cc0b | ||
|
|
736a81473f | ||
|
|
a1fb6339af | ||
|
|
64f7a90e7d | ||
|
|
2fa4131b1f | ||
|
|
2336a23ea4 | ||
|
|
9458a3f3b3 | ||
|
|
8f355d8c30 | ||
|
|
893c4c79a4 | ||
|
|
bcb4c1a805 | ||
|
|
326b8443b5 | ||
|
|
49b4152653 | ||
|
|
8a0187c652 | ||
|
|
0c9b7dd02b | ||
|
|
90a4fb0fa0 | ||
|
|
130da074a0 | ||
|
|
dd89faff1e | ||
|
|
0c60cf1b52 | ||
|
|
cea1924c62 | ||
|
|
a91508ac7b | ||
|
|
1ef16a076a | ||
|
|
23001a092f | ||
|
|
dea0351d99 | ||
|
|
feb39115c9 | ||
|
|
f091558947 | ||
|
|
e84a13d03d | ||
|
|
b9dc6ab477 | ||
|
|
2c6a700154 | ||
|
|
95371f54a8 | ||
|
|
9fc0218cb7 | ||
|
|
8e35b50e1d | ||
|
|
b7b2f102c7 | ||
|
|
20098fe6c0 | ||
|
|
dc66e4a296 | ||
|
|
64d3289316 | ||
|
|
1947ec3c75 | ||
|
|
115650b159 | ||
|
|
4cb7cfb387 | ||
|
|
3308a68753 | ||
|
|
06a72534a9 | ||
|
|
918c288bbe | ||
|
|
6a92252c8e | ||
|
|
6d9b45ca56 | ||
|
|
08d904a8ae | ||
|
|
6e193859f7 | ||
|
|
698bb9fd3b | ||
|
|
ac33bb5cdb | ||
|
|
1891666cfe | ||
|
|
409555c5c5 | ||
|
|
83c1f41327 | ||
|
|
8f76c03896 | ||
|
|
da9a765c36 | ||
|
|
e0f3956c2f | ||
|
|
79b1ea04cf | ||
|
|
69d969b4cf | ||
|
|
5e10ccdf6c | ||
|
|
659617b407 | ||
|
|
51c4cf2816 | ||
|
|
40c50cad58 | ||
|
|
1653e11fc3 | ||
|
|
2efc65c832 | ||
|
|
feed3612cc | ||
|
|
ca4fdad6de | ||
|
|
b024dd7113 | ||
|
|
c8513b3d56 | ||
|
|
86aa539ad9 | ||
|
|
ae37d1d6fe | ||
|
|
2e90388a4f | ||
|
|
8b123902b2 | ||
|
|
9af30a2ec8 | ||
|
|
87347f3613 | ||
|
|
b9939a1420 | ||
|
|
d0bb2f01e7 | ||
|
|
3abfce5703 | ||
|
|
3aa2a54b56 | ||
|
|
c37b60e9dd | ||
|
|
812ed9d57a | ||
|
|
71749e7234 | ||
|
|
014a372c5c | ||
|
|
884367ea38 | ||
|
|
1812decae3 | ||
|
|
3e1e8881d6 | ||
|
|
1c68bc0661 | ||
|
|
932c4ec1f4 | ||
|
|
786648d1ca | ||
|
|
2b20b48389 | ||
|
|
e878b68975 | ||
|
|
2342e227ed | ||
|
|
9d0ddc4cd9 | ||
|
|
524a9fe9da | ||
|
|
8a37ea2f4a | ||
|
|
18d1ac8356 | ||
|
|
319597d449 | ||
|
|
53a482fe74 | ||
|
|
68da521f53 | ||
|
|
b69285c55b | ||
|
|
43da5a1dbf | ||
|
|
9c9b9666b4 | ||
|
|
42fa092bd2 | ||
|
|
e1b8271060 | ||
|
|
7e30209b5f | ||
|
|
8054b92b30 | ||
|
|
bc772ada79 | ||
|
|
78947f4258 | ||
|
|
791f5e9a56 | ||
|
|
c536c79434 | ||
|
|
1525a14753 | ||
|
|
9eeecf0179 | ||
|
|
5cbee1e4d3 | ||
|
|
8a7e9a40fd | ||
|
|
4cc73e7372 | ||
|
|
cfffbb39b5 | ||
|
|
0c8ba314a5 | ||
|
|
7de2815c8c | ||
|
|
66345ee5f5 | ||
|
|
931635d56c | ||
|
|
44f473ba27 | ||
|
|
0aef68f55a | ||
|
|
ce9dfcb87c | ||
|
|
2bc3e5d18a | ||
|
|
fb443658e8 | ||
|
|
8cbbadf500 | ||
|
|
20b566852f | ||
|
|
6f670e8408 | ||
|
|
3ac09c2b37 | ||
|
|
d457e52723 | ||
|
|
fd660ac655 | ||
|
|
fceb882670 | ||
|
|
64630b1c7e | ||
|
|
7976d4401c | ||
|
|
1eaff8c398 | ||
|
|
373e394d59 | ||
|
|
4d68be3359 | ||
|
|
8eba77edad | ||
|
|
380b502cc4 | ||
|
|
c45af2c29c | ||
|
|
ebde2a65f8 | ||
|
|
1f6f73848c | ||
|
|
3fa14e1a6f | ||
|
|
f2e637e17c | ||
|
|
0d129893cf | ||
|
|
c862514fe2 | ||
|
|
ae15be5357 | ||
|
|
04d5010f78 | ||
|
|
344a30b47b | ||
|
|
7859de0f0f | ||
|
|
43e2bc986a | ||
|
|
31f85c57eb | ||
|
|
98af04bc58 | ||
|
|
c04b895686 | ||
|
|
34535262eb | ||
|
|
7b7615c68f | ||
|
|
6e0f2f7fe4 | ||
|
|
fbde71ccc4 | ||
|
|
6f2187ed0a | ||
|
|
943d6bdd04 | ||
|
|
27604385a3 | ||
|
|
1ddacb086e | ||
|
|
106627660e | ||
|
|
4103227078 | ||
|
|
d6a86c275c | ||
|
|
e6838a19e1 | ||
|
|
3c047a59de | ||
|
|
be7654d6ca | ||
|
|
2b6c984791 | ||
|
|
e358994000 | ||
|
|
38cb3ea380 | ||
|
|
498d9e422b | ||
|
|
c0f7da40f7 | ||
|
|
2f85b35bd5 | ||
|
|
d731366d86 | ||
|
|
1c4d5be077 | ||
|
|
063fc88361 | ||
|
|
b27fd2ae18 | ||
|
|
ca4da3ea8b | ||
|
|
57c1cad799 | ||
|
|
60f8bd160d | ||
|
|
4e805cd792 | ||
|
|
e356e02f31 | ||
|
|
e64ce41167 | ||
|
|
eb9109375e | ||
|
|
c9a136324d | ||
|
|
d114d5de61 | ||
|
|
8add169a45 | ||
|
|
deaf9b9563 | ||
|
|
ac551c5f0e | ||
|
|
51ebb7f7bc | ||
|
|
b0ee4dccdc | ||
|
|
80ff07f744 | ||
|
|
596bcbc271 | ||
|
|
32bfde0552 | ||
|
|
3cab378fde | ||
|
|
fcc20436b7 | ||
|
|
d6bd0d1652 | ||
|
|
b3ce559fbb | ||
|
|
e78da7a9e3 | ||
|
|
3354b7ceb1 | ||
|
|
4e41ecd121 | ||
|
|
5b9aa7199f | ||
|
|
4d8389601c | ||
|
|
211e583e7d | ||
|
|
e8343a3274 | ||
|
|
98d5acdf48 | ||
|
|
999d2f4d15 | ||
|
|
203db7ab4a | ||
|
|
2df8577676 | ||
|
|
af6987594e | ||
|
|
cf3f907c5b | ||
|
|
de8fd9efc4 | ||
|
|
bf3192d54e | ||
|
|
dfe49efef2 | ||
|
|
9d0175c018 | ||
|
|
77e5c4bfb2 | ||
|
|
6843d5ab59 | ||
|
|
f13bade19e | ||
|
|
6d2e4af43f | ||
|
|
d1208e30c2 | ||
|
|
dc9f05d975 | ||
|
|
4600e21f3d | ||
|
|
510061cc75 | ||
|
|
fc89234adc | ||
|
|
b2146f019e | ||
|
|
859a049646 | ||
|
|
4053476ff6 | ||
|
|
39a7a4ebf8 | ||
|
|
701a97184d | ||
|
|
997b926611 | ||
|
|
04fbccf982 | ||
|
|
7f6f5c5c4c | ||
|
|
246fa10785 | ||
|
|
e8e71f36c4 | ||
|
|
355b47279e | ||
|
|
984b1d94ec | ||
|
|
cca3567c34 | ||
|
|
e0218e79c5 | ||
|
|
1027bccfed | ||
|
|
5a94caa94b | ||
|
|
b995a015b5 | ||
|
|
e646396044 | ||
|
|
b9bf0d14b9 | ||
|
|
2cc49aa479 | ||
|
|
785acd7d98 | ||
|
|
1f09b9eb71 | ||
|
|
6af22067d6 | ||
|
|
01d9fcd220 | ||
|
|
a29d368d68 | ||
|
|
9feb6e65e1 | ||
|
|
d1c33d001b | ||
|
|
b069372c18 | ||
|
|
a74cf7162b | ||
|
|
a8c8ff8e01 | ||
|
|
e11b9e6f13 | ||
|
|
eee4222d54 | ||
|
|
40daaa0afc | ||
|
|
6b9225f039 | ||
|
|
91b3991fa4 | ||
|
|
eda6d43137 | ||
|
|
212a6182c1 | ||
|
|
cfc9643e8e | ||
|
|
d970431b6d | ||
|
|
ee117107a0 | ||
|
|
62b567225e | ||
|
|
6d4a3bed38 | ||
|
|
405701009d | ||
|
|
65a23e8c30 | ||
|
|
b10ae03f80 | ||
|
|
2a842989e2 | ||
|
|
c3ebcc491e | ||
|
|
524fac64a3 | ||
|
|
eb3387da9f | ||
|
|
82a1f1f5bb | ||
|
|
0843b9d468 | ||
|
|
8de53b30a4 | ||
|
|
a1feac5a8e | ||
|
|
032c1b54d3 | ||
|
|
f118e72670 | ||
|
|
ca1b4f9b98 | ||
|
|
2692d6df71 | ||
|
|
73b0664d2a | ||
|
|
c2617efe4f | ||
|
|
69c49818fa | ||
|
|
ed24f235a2 | ||
|
|
30474f03e2 | ||
|
|
df8397c2b9 | ||
|
|
7a12bfa614 | ||
|
|
916e127191 | ||
|
|
bcf74da7d0 | ||
|
|
0f660f56b2 | ||
|
|
5327299267 | ||
|
|
03a4985ba7 | ||
|
|
0e35ebdcec | ||
|
|
14ef0e0da5 | ||
|
|
89d3bad8ce | ||
|
|
a88e3f1a89 | ||
|
|
d84ba2dcc1 | ||
|
|
a3f6d74ca2 | ||
|
|
2b78b02ea0 | ||
|
|
4df7a62c89 | ||
|
|
6590012517 | ||
|
|
d92ae7b504 | ||
|
|
1a780fa3d4 | ||
|
|
6aabbe61e6 | ||
|
|
39d119991e | ||
|
|
436b5748c0 | ||
|
|
f6fbd50995 | ||
|
|
f5ea97c8b9 | ||
|
|
0513be8644 | ||
|
|
0735bba5e2 | ||
|
|
c4d5457d46 | ||
|
|
570c9b26b5 | ||
|
|
6e31ea6f9f | ||
|
|
4cb7646afb | ||
|
|
d1e6975809 | ||
|
|
f07a97be74 | ||
|
|
2cfc9c9a95 | ||
|
|
3119fe2a1e | ||
|
|
5078800250 | ||
|
|
28c2affaa7 | ||
|
|
8b0e4ccbe5 | ||
|
|
986bb47b07 | ||
|
|
669b20cf82 | ||
|
|
dd23663553 | ||
|
|
b84ae1b989 | ||
|
|
ca844b16a4 | ||
|
|
747e284f17 | ||
|
|
c281b6972d | ||
|
|
e80216eef0 | ||
|
|
871bdb1183 | ||
|
|
5b8b9113ee | ||
|
|
8c26498284 | ||
|
|
f18319754b | ||
|
|
3a256dfb71 | ||
|
|
776448a1b8 | ||
|
|
6acc92b769 | ||
|
|
bc09a19ced | ||
|
|
756617ae64 | ||
|
|
3d0fde8e1b | ||
|
|
b18859eee8 | ||
|
|
35f833a56f | ||
|
|
d56dfc4a7b | ||
|
|
c7aaa31db8 | ||
|
|
9bc774e774 | ||
|
|
d750876367 | ||
|
|
8fd679fa67 | ||
|
|
778cc3b9b9 | ||
|
|
0223cda149 | ||
|
|
23b27e6c2c | ||
|
|
910b90ee23 | ||
|
|
8efab521bf | ||
|
|
8bdf895b4a | ||
|
|
03b052702b | ||
|
|
132b292cba | ||
|
|
b7c22a2d38 | ||
|
|
e9f625d6eb | ||
|
|
3ff89c50e3 | ||
|
|
59ce474e20 | ||
|
|
4e10761876 | ||
|
|
703c1aa486 | ||
|
|
48c940f653 | ||
|
|
907c5e8a82 | ||
|
|
a2b64e1109 | ||
|
|
5a3493c33e | ||
|
|
85c19f664d | ||
|
|
4a61b67350 | ||
|
|
1c7d92a4ce | ||
|
|
86dfea85ac | ||
|
|
39aee6dffe | ||
|
|
3413df573e | ||
|
|
216a87a38c | ||
|
|
994151e70a | ||
|
|
71b8d5a247 | ||
|
|
e0d0981073 | ||
|
|
a77bc1a099 | ||
|
|
ef57c77719 | ||
|
|
7ecfca7f18 | ||
|
|
3e76d11fc8 | ||
|
|
f42904f8e5 | ||
|
|
551a7bc285 | ||
|
|
a136e400d5 | ||
|
|
a057f24ad9 | ||
|
|
de255bb7d1 | ||
|
|
08b277bf94 | ||
|
|
b91bca769c | ||
|
|
4ec983a2fe | ||
|
|
5ade945037 | ||
|
|
b52d813aa4 | ||
|
|
b09808d7a5 | ||
|
|
d2c6c44499 | ||
|
|
62d774d1c9 | ||
|
|
c65cb1e393 | ||
|
|
b467f56783 | ||
|
|
60782d4095 | ||
|
|
af2ddcdb83 | ||
|
|
9d6812bb8d | ||
|
|
0a0cbdcb3a | ||
|
|
9e4d1835ab | ||
|
|
592d5bac61 | ||
|
|
33966bf105 | ||
|
|
3282f444e8 | ||
|
|
50b2bac8a1 | ||
|
|
441d34677c | ||
|
|
8ef31d682d | ||
|
|
3dfcf28ce7 | ||
|
|
e12f3147e4 | ||
|
|
ec6a17570c | ||
|
|
c631e665a5 | ||
|
|
cf285407f5 | ||
|
|
f8734c9614 | ||
|
|
75598ee8ac | ||
|
|
ca20a8a732 | ||
|
|
2dfebcb79e | ||
|
|
432d484e07 | ||
|
|
fee1b3f98f | ||
|
|
6d3ee00fdc | ||
|
|
6ba7329b2a | ||
|
|
147794e17e | ||
|
|
9461620091 | ||
|
|
21dda92616 | ||
|
|
e5a5c115da | ||
|
|
92789b167a | ||
|
|
419db41f09 | ||
|
|
240b112ac3 | ||
|
|
c815417d3a | ||
|
|
d864eb84f9 | ||
|
|
0f1a7197b7 | ||
|
|
8fc57e1291 | ||
|
|
36df81d8eb | ||
|
|
a16fde7a3c | ||
|
|
466072caf9 | ||
|
|
a6b67e73d8 | ||
|
|
5aea904179 | ||
|
|
14ea7677ad | ||
|
|
7429455261 | ||
|
|
c28562847c | ||
|
|
d9db312902 | ||
|
|
5467e94e21 | ||
|
|
58b61b73ac | ||
|
|
b0ea406130 | ||
|
|
80455d09c2 | ||
|
|
f9c924f9b6 | ||
|
|
de66f43616 | ||
|
|
7b0487f2d9 | ||
|
|
877b1661aa | ||
|
|
464aea125e | ||
|
|
fbeaee13c0 | ||
|
|
71dcbf830f | ||
|
|
68f8aab37e | ||
|
|
1b719c8903 | ||
|
|
182c30112e | ||
|
|
ccd3daf937 | ||
|
|
60c9844062 | ||
|
|
06fdcce823 | ||
|
|
7cc8e0f776 | ||
|
|
0ae9122740 | ||
|
|
d5e701a658 | ||
|
|
0eb14f1bf4 | ||
|
|
2adebc1304 | ||
|
|
c5f291943e | ||
|
|
73c6fa415d | ||
|
|
45b2972d71 | ||
|
|
212721a833 | ||
|
|
72a9a2e00b | ||
|
|
4684c2e480 | ||
|
|
93d35dcb20 | ||
|
|
1d9bfa53cd | ||
|
|
6677bd937c | ||
|
|
30fd3fae78 | ||
|
|
1967b1d443 | ||
|
|
e49425a505 | ||
|
|
1c4f447355 | ||
|
|
5c10519a8e | ||
|
|
8262b3ed60 | ||
|
|
ed7b9d8bb6 | ||
|
|
688adbc386 | ||
|
|
62e900a712 | ||
|
|
9a3a8678a8 | ||
|
|
1e6377aa05 | ||
|
|
16bbfa114a | ||
|
|
9c51005016 | ||
|
|
c41c0c7a52 | ||
|
|
c3d55c3fe2 | ||
|
|
5abb4c6019 | ||
|
|
ebcde77c01 | ||
|
|
7d9c313c84 | ||
|
|
459a2e9109 | ||
|
|
efa46b9454 | ||
|
|
edc36599e9 | ||
|
|
c54a9d92b9 | ||
|
|
92e20524bc | ||
|
|
5e80065d46 | ||
|
|
3df0e55421 | ||
|
|
245154d5b8 | ||
|
|
e69996e39d | ||
|
|
634803033c | ||
|
|
0f27517b92 | ||
|
|
fe15c0fd7a | ||
|
|
aa17bb3924 | ||
|
|
abb43f8a4e | ||
|
|
c2d49ab370 | ||
|
|
9aeeec155a | ||
|
|
544617eae1 | ||
|
|
7032f8b8b0 | ||
|
|
26f9c1d324 | ||
|
|
b8835cddc4 | ||
|
|
38018c3c70 | ||
|
|
08625b668a | ||
|
|
cc5e314c2b | ||
|
|
ba93f6c291 | ||
|
|
6561b6d292 | ||
|
|
a6fdc36ea5 | ||
|
|
1f9efacd1d | ||
|
|
7a963542cd | ||
|
|
2d8b6446c8 | ||
|
|
7a69bff0e0 | ||
|
|
bfe8cc2336 | ||
|
|
2c02514fcf | ||
|
|
17f17f150b | ||
|
|
f669d1b968 | ||
|
|
99fe51e6aa | ||
|
|
20f285d3a4 | ||
|
|
2c960d58e7 | ||
|
|
7e44f2081f | ||
|
|
99701cb871 | ||
|
|
c2449a04c0 | ||
|
|
166eec29ec | ||
|
|
46dd2b9742 | ||
|
|
5d5c150f9b | ||
|
|
dc0107dd8e | ||
|
|
b05dcdbb8b | ||
|
|
d08ce2a641 | ||
|
|
6ab705308a | ||
|
|
7aee6fbf5b | ||
|
|
4bac52602a | ||
|
|
deda3a3213 | ||
|
|
ab4dfb92ce | ||
|
|
913dba7a19 | ||
|
|
677e05d643 | ||
|
|
ef0fded50f | ||
|
|
3f5fd1a81b | ||
|
|
f3b91a2aef | ||
|
|
1c246388e2 | ||
|
|
8969ad36ee | ||
|
|
ef10b99d33 | ||
|
|
2355751625 | ||
|
|
7481a7e638 | ||
|
|
a80da76599 | ||
|
|
b9f57016c8 | ||
|
|
c825dc181e | ||
|
|
c7404cd1a0 | ||
|
|
c91549d129 | ||
|
|
2b970b0df2 | ||
|
|
0210ed9b70 | ||
|
|
72d0fc82a9 | ||
|
|
e430d79c81 | ||
|
|
ca7bb696b3 | ||
|
|
d07022c89a | ||
|
|
33f713d17d | ||
|
|
a7df615d95 | ||
|
|
f003209b26 | ||
|
|
4864b90936 | ||
|
|
275e6f26af | ||
|
|
9fbc295947 | ||
|
|
db8ff631ce | ||
|
|
1cbfc6a82b | ||
|
|
9550182889 | ||
|
|
ed38882667 | ||
|
|
924e22988d | ||
|
|
210843442d | ||
|
|
c8d3a24cff | ||
|
|
bca13aea17 | ||
|
|
653c7a72c5 | ||
|
|
9a366cd78a | ||
|
|
911e7a47f1 | ||
|
|
c9853945cc | ||
|
|
ff9b756e79 | ||
|
|
1be210d78b | ||
|
|
5fdbdf4998 | ||
|
|
cf4cc58f5e | ||
|
|
fe69b2cdbc | ||
|
|
97ed79b7f6 | ||
|
|
ccb5132e40 | ||
|
|
509e55c183 | ||
|
|
2e31e2a372 | ||
|
|
a59a402893 | ||
|
|
8017717311 | ||
|
|
7e7db12fa4 | ||
|
|
3058892a72 | ||
|
|
5283b8ce19 | ||
|
|
11badf807a | ||
|
|
bbe1917e01 | ||
|
|
2d2a995a83 | ||
|
|
048132d912 | ||
|
|
7197203364 | ||
|
|
7679b8dbd3 | ||
|
|
dbc3b9e05e | ||
|
|
57ec2a5e1e | ||
|
|
847e739fc9 | ||
|
|
a06c9bc69a | ||
|
|
b533e6441b | ||
|
|
bde8bc0d6a | ||
|
|
036bf65280 | ||
|
|
bb375e389c | ||
|
|
b8e6deacc8 | ||
|
|
0aba0eaa48 | ||
|
|
0b51c3c73d | ||
|
|
0b2317f344 | ||
|
|
9ebd12c9df | ||
|
|
f4c9545366 | ||
|
|
d4b75b0fd2 | ||
|
|
3d1d60239b | ||
|
|
d193bbd414 | ||
|
|
ab94025923 | ||
|
|
262a2971ea | ||
|
|
b66dadc64b | ||
|
|
c9ccc6c888 | ||
|
|
9e70c551cc | ||
|
|
e3009ba13c | ||
|
|
d935a31057 | ||
|
|
62a099dcfd | ||
|
|
f1161213b3 | ||
|
|
9a3985ff94 | ||
|
|
8e12472ac4 | ||
|
|
2b5deed723 | ||
|
|
2b81a9b7dc | ||
|
|
d18a87cc49 | ||
|
|
c27acd9a8f | ||
|
|
1afff76e4d | ||
|
|
0ba2cb91cd | ||
|
|
9920be51f7 | ||
|
|
041cf3a53b | ||
|
|
6af4b091bd | ||
|
|
7783d8d318 | ||
|
|
de784a3bd8 | ||
|
|
e3556e0a87 | ||
|
|
f3c56acfd4 | ||
|
|
2bbc33dc37 | ||
|
|
2026580834 | ||
|
|
fed616b171 | ||
|
|
23d64e5092 | ||
|
|
3705f3e35e | ||
|
|
6ec605691b | ||
|
|
300e9e6779 | ||
|
|
e6a8bd9c73 | ||
|
|
944a45ce9a | ||
|
|
f3015637cd | ||
|
|
86472c9a62 | ||
|
|
c1680ad72b | ||
|
|
251e6a8b0b | ||
|
|
01f34937a5 | ||
|
|
3790f7d583 | ||
|
|
cf5bec4cfa | ||
|
|
de77ef0b5b | ||
|
|
f5d37cd297 | ||
|
|
e88ef5d878 | ||
|
|
35dbc84b49 | ||
|
|
23b0bb7453 | ||
|
|
42c388e186 | ||
|
|
9a58c47093 | ||
|
|
1b26ef69c7 | ||
|
|
6f9259dc9b | ||
|
|
7d0e1ddfed | ||
|
|
f01183914c | ||
|
|
1b0685a4d2 | ||
|
|
a09ebf7d9a | ||
|
|
97f6555841 | ||
|
|
289e212aa9 | ||
|
|
d9882ae1e2 | ||
|
|
30cd285b81 | ||
|
|
3b4bf4325c | ||
|
|
5813aef393 | ||
|
|
5d318f994c | ||
|
|
4fc541e2f4 | ||
|
|
56624074de | ||
|
|
3dab2a3405 | ||
|
|
b9e5baaf4d | ||
|
|
072bafe72a | ||
|
|
017e366f88 | ||
|
|
a1a2d537b0 | ||
|
|
938afcf206 | ||
|
|
624f7c2146 | ||
|
|
95a82439af | ||
|
|
3b2e6d841b | ||
|
|
d9ef13ae2f | ||
|
|
47f1a97703 | ||
|
|
431ff293bc | ||
|
|
7feec1b445 | ||
|
|
c7c30c118a | ||
|
|
61983ec946 | ||
|
|
08e7eccaf1 | ||
|
|
1f01ad0b57 | ||
|
|
028ffa667a | ||
|
|
9d1730d9de | ||
|
|
243fdc94f2 | ||
|
|
cb7eb14a09 | ||
|
|
9568a56de0 | ||
|
|
dfb171233c | ||
|
|
d15deac105 | ||
|
|
8e2cd1234a | ||
|
|
baac7a6cc6 | ||
|
|
964aff613c | ||
|
|
65f21be0db | ||
|
|
a5325ca5d4 | ||
|
|
47e6132e28 | ||
|
|
8775f043d7 | ||
|
|
972e5c88a9 | ||
|
|
a8bed6daea | ||
|
|
011dfe8da4 | ||
|
|
57cab9ccc8 | ||
|
|
aaa7a54cad | ||
|
|
44f10aca25 | ||
|
|
16e9831909 | ||
|
|
d59d53495f | ||
|
|
9a79a66380 | ||
|
|
73edf45567 | ||
|
|
3c1eef3587 | ||
|
|
4066c13d82 | ||
|
|
5609608e09 | ||
|
|
1929c84b88 | ||
|
|
42b5ee41da | ||
|
|
9be823dc71 | ||
|
|
a255caf715 | ||
|
|
8494e3ebca | ||
|
|
bda2b3b85c | ||
|
|
97d2c50d0b | ||
|
|
dac44bc2fb | ||
|
|
0ac7776cbb | ||
|
|
6c1cadadbe | ||
|
|
2cc47d4ee2 | ||
|
|
ad4b79106a | ||
|
|
08ef5b8001 | ||
|
|
fa32a643c7 | ||
|
|
7473bdad0c | ||
|
|
28bae7bb83 | ||
|
|
f85a8c71ca | ||
|
|
33ea18e49c | ||
|
|
32f13aadf8 | ||
|
|
c448dbe832 | ||
|
|
f00d7fd59e | ||
|
|
104e2ccc20 | ||
|
|
fdfa8c1c3b | ||
|
|
9b4d821a9b | ||
|
|
9480e6059b | ||
|
|
d1c51602d2 | ||
|
|
7ae777a825 | ||
|
|
b84b20bfcc | ||
|
|
d5d43469ac | ||
|
|
27e967481c | ||
|
|
109dc634e6 | ||
|
|
3ffb08968a | ||
|
|
6da9c2bbbc | ||
|
|
cbf8fb0da9 | ||
|
|
db7bc750d7 | ||
|
|
ff977f2f3d | ||
|
|
e5469fcd98 | ||
|
|
c122af1b0c | ||
|
|
74d08316c1 | ||
|
|
7cddb1f63f | ||
|
|
d5a6dc11ad | ||
|
|
838304da21 | ||
|
|
0de4a88a2a | ||
|
|
f59874f783 | ||
|
|
4c65257273 | ||
|
|
620809c05e | ||
|
|
7137a7278e | ||
|
|
f9d6eb6c65 | ||
|
|
237f3ff325 | ||
|
|
1feb7272bb | ||
|
|
f7e91ed3db | ||
|
|
42c817a7fe | ||
|
|
edde446f1c | ||
|
|
5f53b1da29 | ||
|
|
e228dc14ea | ||
|
|
e5fce89ae9 | ||
|
|
716e5bd169 | ||
|
|
7b9431caf2 | ||
|
|
2d8cad119f | ||
|
|
f928f38ce3 | ||
|
|
a49d03d242 | ||
|
|
3164fb2295 | ||
|
|
4a76c85389 | ||
|
|
c85bdab9be | ||
|
|
864e0948a3 | ||
|
|
53a3951390 | ||
|
|
9c81dc8c6e | ||
|
|
19b958de49 | ||
|
|
76f204bebb | ||
|
|
266cd52dea | ||
|
|
b1d52910df | ||
|
|
80c6edc221 | ||
|
|
6cad47e7f6 | ||
|
|
94d5ec961b | ||
|
|
f595cda94e | ||
|
|
c2c2ad928a | ||
|
|
be996be280 | ||
|
|
5548f11100 | ||
|
|
22cb241520 | ||
|
|
ec982414fd | ||
|
|
e828cd7f19 | ||
|
|
c01ca8edda | ||
|
|
c7a6832c40 | ||
|
|
0c5ac9027c | ||
|
|
e535927a50 | ||
|
|
9542bab406 | ||
|
|
8db60416bf | ||
|
|
d9a0f9e8fe | ||
|
|
380daf6b99 | ||
|
|
03455564a3 | ||
|
|
a6521cb0c0 | ||
|
|
94f233f4af | ||
|
|
b9afbad661 | ||
|
|
5dca7d2116 | ||
|
|
ebc7715ffd | ||
|
|
cbdd175831 | ||
|
|
54d791782c | ||
|
|
08a463a8c6 | ||
|
|
3b641d2db8 | ||
|
|
82e5ed6939 | ||
|
|
381838a431 | ||
|
|
73dedab201 | ||
|
|
168de49a8f | ||
|
|
bda6613300 | ||
|
|
b3d369e1e5 | ||
|
|
cfdc794fb0 | ||
|
|
e076b30635 | ||
|
|
d868d5c90d | ||
|
|
a896cd6beb | ||
|
|
5ef6b7576b | ||
|
|
f38ef2856b | ||
|
|
fa859723b5 | ||
|
|
040b7190a6 | ||
|
|
20c7502b71 | ||
|
|
6e9be4ab01 | ||
|
|
1a2467432d | ||
|
|
b1400f81a1 | ||
|
|
9267ed669c | ||
|
|
6b3899394f | ||
|
|
2c797b7295 | ||
|
|
24577a2c81 | ||
|
|
a144f24e73 | ||
|
|
57c081069f | ||
|
|
c558cc7cef | ||
|
|
e89f919aa1 | ||
|
|
de47cf88ab | ||
|
|
45d5458526 | ||
|
|
480d2f3801 | ||
|
|
5b9d778425 | ||
|
|
ced4a056e5 | ||
|
|
1aa49ce49c | ||
|
|
19e54584a2 | ||
|
|
eb8bd5b2d1 | ||
|
|
821580737c | ||
|
|
1e6807cb24 | ||
|
|
e461af354e | ||
|
|
fe191320e3 | ||
|
|
3af30a0e9e | ||
|
|
3197cac20f | ||
|
|
3990f3f51b | ||
|
|
648fb81d36 | ||
|
|
476346379e | ||
|
|
abf486b73e | ||
|
|
a514adb7a8 | ||
|
|
5caa9254d9 | ||
|
|
8cf212fb13 | ||
|
|
8906153849 | ||
|
|
896ad75252 | ||
|
|
14b5dacb64 | ||
|
|
b80fce8c10 | ||
|
|
36df95ca78 | ||
|
|
33a8f76472 | ||
|
|
523a2f8471 | ||
|
|
f97015b183 | ||
|
|
f8289a00a6 | ||
|
|
61d05ebce7 | ||
|
|
bbc5d8ff44 | ||
|
|
cdc28eb991 | ||
|
|
679425894f | ||
|
|
511e56d0dd | ||
|
|
dbbba889c0 | ||
|
|
bf2ce5cffd | ||
|
|
a25caeff01 | ||
|
|
f51a3f2ae3 | ||
|
|
f57f29d9ee | ||
|
|
1e09236868 | ||
|
|
fc6fefd224 | ||
|
|
afe07e9d56 | ||
|
|
82bc012da3 | ||
|
|
e69a50c5ee | ||
|
|
193a1f478b | ||
|
|
6e29c5d9e1 | ||
|
|
2f9c93bc53 | ||
|
|
8c2cb9fa45 | ||
|
|
dbb4ae4373 | ||
|
|
3306d08819 | ||
|
|
011d25de6b | ||
|
|
f0b24a8e40 | ||
|
|
a648988bbf | ||
|
|
3a2ab23eee | ||
|
|
9918215509 | ||
|
|
28029d2098 | ||
|
|
95073d8269 | ||
|
|
b493ed96b0 | ||
|
|
e2df067f8a | ||
|
|
a15ed20ed7 | ||
|
|
a938cdf730 | ||
|
|
750d3685e4 | ||
|
|
f48ecd8792 | ||
|
|
e60763e771 | ||
|
|
ef323f6943 | ||
|
|
9e546c3b9f | ||
|
|
317fb80c01 | ||
|
|
c03076e711 | ||
|
|
a6c26b7bca | ||
|
|
47eb600ccb | ||
|
|
a8a6d3d9fb | ||
|
|
a288bae3f5 | ||
|
|
cefc39f98d | ||
|
|
2018e571ea | ||
|
|
43ba12ea40 | ||
|
|
438acdd56e | ||
|
|
96a5d4c3f5 | ||
|
|
b81fb91708 | ||
|
|
817245b363 | ||
|
|
8895e96f71 | ||
|
|
e5dd87ab66 | ||
|
|
600d002cdb | ||
|
|
324109c59b | ||
|
|
5bdf931212 | ||
|
|
8a80d89f9f | ||
|
|
575a0be70d | ||
|
|
16b5ae6c64 | ||
|
|
d2acacf830 | ||
|
|
64274e0828 | ||
|
|
7e11c9f106 | ||
|
|
da1569fbb4 | ||
|
|
5edf4d5e6e | ||
|
|
ceac667a71 | ||
|
|
407a9bb15c | ||
|
|
30a7e97dd7 | ||
|
|
fa33aeae4c | ||
|
|
b43599167e | ||
|
|
b15dbe08ec | ||
|
|
3965327004 | ||
|
|
086be8e55b | ||
|
|
e3e63731d3 | ||
|
|
25c3f937cc | ||
|
|
7dbe446bef | ||
|
|
cf1d4c8f06 | ||
|
|
590620c651 | ||
|
|
ecb238740c | ||
|
|
163277fd16 | ||
|
|
7f651b4667 | ||
|
|
bdf0824e30 | ||
|
|
1f16bf4002 | ||
|
|
6dbcac8666 | ||
|
|
841cc622da | ||
|
|
27489ce1a2 | ||
|
|
20a6e6c702 | ||
|
|
bf116039f9 | ||
|
|
baf333d475 | ||
|
|
6f4328a31f | ||
|
|
c89ddf9c9e | ||
|
|
23d705cfbb | ||
|
|
7787126f42 | ||
|
|
f0eeee7c44 | ||
|
|
54e52f1c60 | ||
|
|
5961c303f5 | ||
|
|
4a9bfb0717 | ||
|
|
5d2b6d84b4 | ||
|
|
58b2ba44a9 | ||
|
|
345ee10afe | ||
|
|
155e1ef570 | ||
|
|
4bfa5b3076 | ||
|
|
dd6b0e8225 | ||
|
|
2bf2c2c3e4 | ||
|
|
9595b87b4e | ||
|
|
45d8d4528e | ||
|
|
a380a996b6 | ||
|
|
4837ad1984 | ||
|
|
9b9f724e37 | ||
|
|
e56e9dd503 | ||
|
|
964bf540a8 | ||
|
|
1f5afb045b | ||
|
|
f238ee1207 | ||
|
|
ded5fe44e1 | ||
|
|
2340fe87c1 | ||
|
|
8ff3abbd28 | ||
|
|
8ca64f26fd | ||
|
|
03b499568e | ||
|
|
729df9d1c7 | ||
|
|
cc10c896c7 | ||
|
|
b97fcc789d | ||
|
|
87323975d2 | ||
|
|
19490a6ccb | ||
|
|
13694ffcc8 | ||
|
|
12c9a7158a | ||
|
|
727ed43cf3 | ||
|
|
86b40ec069 | ||
|
|
4b27431edb | ||
|
|
91c4532347 | ||
|
|
45ad80dd49 | ||
|
|
6fcbcc583d | ||
|
|
dd855b1920 | ||
|
|
91406e5079 | ||
|
|
3402b9b53a | ||
|
|
2eeb49f08b | ||
|
|
cf0db9c132 | ||
|
|
ec3bbd900e | ||
|
|
81af2b2dc8 | ||
|
|
9b25930340 | ||
|
|
1a1ae4dbcb | ||
|
|
0adbc36a3d | ||
|
|
ba37cc4e06 | ||
|
|
4d2f16d092 | ||
|
|
d181e530a3 | ||
|
|
c718affad2 | ||
|
|
be60059bea | ||
|
|
a646f3599a | ||
|
|
59e11b0492 | ||
|
|
0c894935eb | ||
|
|
10495b0f3d | ||
|
|
20fb980ec4 | ||
|
|
741f65bf27 | ||
|
|
7448387466 | ||
|
|
e7da9c0510 | ||
|
|
79d0813092 | ||
|
|
81a7fa8e45 | ||
|
|
b52030f56d | ||
|
|
c0dee9a37c | ||
|
|
65fee3fc97 | ||
|
|
18a26b4184 | ||
|
|
bd47066299 | ||
|
|
5414983f3d | ||
|
|
946da3d593 | ||
|
|
88c9ea6409 | ||
|
|
533b985749 | ||
|
|
6362d16783 | ||
|
|
dfdd11c0f4 | ||
|
|
de263a7630 | ||
|
|
d1b2fc2e2b | ||
|
|
23c771747e | ||
|
|
a5437968b9 | ||
|
|
d90a021659 | ||
|
|
a800457f7a | ||
|
|
d7bb25f416 | ||
|
|
556ce21343 | ||
|
|
6062f31223 | ||
|
|
8fc71b3eff | ||
|
|
f551280606 | ||
|
|
7b6293e9ea | ||
|
|
9914a6b001 | ||
|
|
346d3f81c3 | ||
|
|
8d6398bb4d | ||
|
|
c9c3f6a383 | ||
|
|
e4922681a7 | ||
|
|
2c03f084e3 | ||
|
|
12c86e9992 | ||
|
|
0586f3958e | ||
|
|
a504f00b64 | ||
|
|
b72b8c2526 | ||
|
|
e5c3a8f5d2 | ||
|
|
8d659cff85 | ||
|
|
65003cfb82 | ||
|
|
7b77575a13 | ||
|
|
19cd0c09d4 | ||
|
|
7103be131c | ||
|
|
ee73cde0e7 | ||
|
|
2dfd732d04 | ||
|
|
53390e748d | ||
|
|
7e6d641e4e | ||
|
|
6a28df8884 | ||
|
|
4725c30dfc | ||
|
|
65c4d10630 | ||
|
|
8cbef7f43d | ||
|
|
e74e713256 | ||
|
|
4d805b172a | ||
|
|
04353a43b7 | ||
|
|
1b6a129d94 | ||
|
|
63789c5499 | ||
|
|
ca186459a8 | ||
|
|
9d964a2224 | ||
|
|
6bf616cda0 | ||
|
|
c347577bb6 | ||
|
|
e192c729e6 | ||
|
|
7b578b5549 | ||
|
|
57223bc514 | ||
|
|
166e52a779 | ||
|
|
95cf1da439 | ||
|
|
c1b89f1b21 | ||
|
|
98e2dea7c6 | ||
|
|
a765abcbc9 | ||
|
|
0a5473a631 | ||
|
|
f8491cc4a3 | ||
|
|
b6f928e5ff | ||
|
|
25b172e7f6 | ||
|
|
a6f0bbd169 | ||
|
|
2cbcea03f6 | ||
|
|
1a71ea92ff | ||
|
|
9f88be07dd | ||
|
|
3af4a03e10 | ||
|
|
b864c748b6 | ||
|
|
1af2a227b2 | ||
|
|
bf06eb9e5d | ||
|
|
9aee7740f6 | ||
|
|
6cba0a8ba6 | ||
|
|
6f50d63fdc | ||
|
|
bbe0f0664b | ||
|
|
259d971155 | ||
|
|
1ecb6ceada | ||
|
|
b5b6594cb2 | ||
|
|
e470d9f6ed | ||
|
|
357e2d8ab2 | ||
|
|
bd7bb907a5 | ||
|
|
8f4fd33626 | ||
|
|
3c5278af92 | ||
|
|
f7ef5091ea | ||
|
|
fa7fe40dda | ||
|
|
7b5a465065 | ||
|
|
7e91c816f0 | ||
|
|
96e0aa80e9 | ||
|
|
c55577baa1 | ||
|
|
fd604741fa | ||
|
|
e2ae2b50b4 | ||
|
|
b0aa221fce | ||
|
|
1a2dd7eb77 | ||
|
|
0d343fed34 | ||
|
|
f96ddc9827 | ||
|
|
08dabc6364 | ||
|
|
eac1750c94 | ||
|
|
5ab845a6d5 | ||
|
|
d298f83a25 | ||
|
|
3a94c9db52 | ||
|
|
37356e2107 | ||
|
|
8a2315374a | ||
|
|
47af02a912 | ||
|
|
ed32de0dd8 | ||
|
|
853eca7abd | ||
|
|
8e19a9e0e9 | ||
|
|
5c0dadb6f6 | ||
|
|
ef7f08369e | ||
|
|
30d1a798c2 | ||
|
|
ce58c8d7c7 | ||
|
|
6231887d25 | ||
|
|
39fb1a223a | ||
|
|
5b32422491 | ||
|
|
93e8c14766 | ||
|
|
3b9568bb46 | ||
|
|
1e81e0d25d | ||
|
|
f5f30eb891 | ||
|
|
bdb215c2f1 | ||
|
|
18e20503f2 | ||
|
|
3f8e684287 | ||
|
|
fb9aac9028 | ||
|
|
d9022b782c | ||
|
|
81696d9e60 | ||
|
|
15d3fefbbe | ||
|
|
73d4f73ccc | ||
|
|
5c10898c73 | ||
|
|
9289886f45 | ||
|
|
e2b5259226 | ||
|
|
cedd7eb91a | ||
|
|
f3bbb4295d | ||
|
|
611596506d | ||
|
|
d06618ae36 | ||
|
|
778aa9431f | ||
|
|
fd3326602b | ||
|
|
53700d6f63 | ||
|
|
07546318a5 | ||
|
|
12c90c9542 | ||
|
|
e9676c01cb | ||
|
|
bbfa067f95 | ||
|
|
0eb05bf7fc | ||
|
|
312a8e57d4 | ||
|
|
7906f4b74b | ||
|
|
660cc073e9 | ||
|
|
431687b00e | ||
|
|
758c7f0d0a | ||
|
|
6ef83182dd | ||
|
|
e98f5a922d | ||
|
|
95028e8f52 | ||
|
|
6754db99f9 | ||
|
|
8322ac6f87 | ||
|
|
9e7b190cd0 | ||
|
|
e1cca0d224 | ||
|
|
844ed45c26 | ||
|
|
541aa33833 | ||
|
|
e130cae470 | ||
|
|
4f91b7fc3d | ||
|
|
750fc431f3 | ||
|
|
d883e11fac | ||
|
|
f587ca0ba8 | ||
|
|
af19ac7baf | ||
|
|
8904c39e81 | ||
|
|
cec6c67d93 | ||
|
|
9643bc4803 | ||
|
|
8c1b5dc435 | ||
|
|
e0bd6f7c06 | ||
|
|
79823b6029 | ||
|
|
e814feecab | ||
|
|
dcc969bf32 | ||
|
|
5247b128f9 | ||
|
|
801be657ad | ||
|
|
7e2e266096 | ||
|
|
1473edae68 | ||
|
|
cbc584cfb2 | ||
|
|
1ad9097831 | ||
|
|
67fb16e787 | ||
|
|
b3b0da8a95 | ||
|
|
0d27c9e3da | ||
|
|
c0faa3d075 | ||
|
|
a67550857a | ||
|
|
7687afd19a | ||
|
|
caf14ff5f9 | ||
|
|
11af631b32 | ||
|
|
1635fadc38 | ||
|
|
49966b1096 | ||
|
|
934f2ec361 | ||
|
|
f0d18f82d5 | ||
|
|
9f22f3e999 | ||
|
|
100289dc2b | ||
|
|
029b90b237 | ||
|
|
f6aff482a2 | ||
|
|
d0716c22f0 | ||
|
|
432335d17e | ||
|
|
d2db31e9be | ||
|
|
28e390975e | ||
|
|
65604d745a | ||
|
|
6bb7aff4ad | ||
|
|
2a839a56f0 | ||
|
|
7a815e6d4c | ||
|
|
619f5ffab4 | ||
|
|
ec6abd4eac | ||
|
|
1d12327219 | ||
|
|
ca455ceade | ||
|
|
93fdad4dd0 | ||
|
|
006cbbb953 | ||
|
|
b5152a2c80 | ||
|
|
933f986ba0 | ||
|
|
d63c8c925c | ||
|
|
5dbfc2ae14 | ||
|
|
e77ca97b39 | ||
|
|
f5d407d2de | ||
|
|
3019ece8c3 | ||
|
|
8704c75843 | ||
|
|
cf0967cd4d | ||
|
|
63f297704c | ||
|
|
f674374be2 | ||
|
|
cbef9c8ec6 | ||
|
|
be502be2b3 | ||
|
|
7687eb1348 | ||
|
|
882b1c8a64 | ||
|
|
8f9ba8cb35 | ||
|
|
152267193e | ||
|
|
fbca4f45de | ||
|
|
90c13a4082 | ||
|
|
9c10e524d7 | ||
|
|
cf4d00e2ed | ||
|
|
8b44dbbeaf | ||
|
|
2ad1ded684 | ||
|
|
7bc5881d95 | ||
|
|
4845159dba | ||
|
|
208b862b2b | ||
|
|
616273166f | ||
|
|
823f230009 | ||
|
|
8ee85ca1a0 | ||
|
|
079d66ad65 | ||
|
|
aac03a8565 | ||
|
|
d07542f30c | ||
|
|
812de4749d | ||
|
|
475b0b1c8f | ||
|
|
0c493bad14 | ||
|
|
c7475f88ce | ||
|
|
af01e7403f | ||
|
|
2de123901b | ||
|
|
ba366834f9 | ||
|
|
c551912488 | ||
|
|
07c20f36c9 | ||
|
|
4d1a30c34d | ||
|
|
708d2ef031 | ||
|
|
89b8074f37 | ||
|
|
de580103bb | ||
|
|
f4d879dad2 | ||
|
|
cbf0d1c711 | ||
|
|
d6ebaf43bd | ||
|
|
70d6e957cc | ||
|
|
e3468b5c8d | ||
|
|
a16150ba59 | ||
|
|
0be9e9bc96 | ||
|
|
c4d3af06b9 | ||
|
|
6c910f5a53 | ||
|
|
a2b36e9479 | ||
|
|
d77d3be2cd | ||
|
|
503dd2ad72 | ||
|
|
c648dae172 | ||
|
|
d9e7a740cf | ||
|
|
33de3c1396 | ||
|
|
5d1cd5de75 | ||
|
|
93021656e2 | ||
|
|
316972ba3d | ||
|
|
89ec22dbab | ||
|
|
4c50a6ec11 | ||
|
|
19b1a6a574 | ||
|
|
9cb2b48bae | ||
|
|
18d03b7ce3 | ||
|
|
04371e8aa0 | ||
|
|
16ed6055a4 | ||
|
|
45a6718d89 | ||
|
|
f6f56995b6 | ||
|
|
a5da09d021 | ||
|
|
9b916b9092 | ||
|
|
5cb53c3e3b | ||
|
|
fa55191516 | ||
|
|
47f613a758 | ||
|
|
24021e6c6d | ||
|
|
ae38590649 | ||
|
|
c1eacbf7bf | ||
|
|
c3b8434a83 | ||
|
|
311408da77 | ||
|
|
3caba5d77a | ||
|
|
1fe0f52848 | ||
|
|
3ca082084b | ||
|
|
9e61b96980 | ||
|
|
348b72eb74 | ||
|
|
45bf557b6f | ||
|
|
75a9e98c4b | ||
|
|
b7b414b3f2 | ||
|
|
984336923a | ||
|
|
17b05dac26 | ||
|
|
ff1b331062 | ||
|
|
2dfc33d500 | ||
|
|
03ae63a2b9 | ||
|
|
e0b2776c68 | ||
|
|
069b8f53c1 | ||
|
|
f91921ed0c | ||
|
|
de2be5d46d | ||
|
|
544f91648c | ||
|
|
cf0ba9dfd3 | ||
|
|
4402814b0d | ||
|
|
d51d9559ae | ||
|
|
fc0919e4aa | ||
|
|
de5e8f638d | ||
|
|
e2a7b58926 | ||
|
|
f0cce97d3a | ||
|
|
bfa08e6166 | ||
|
|
f6a5220c3e | ||
|
|
0ff2e3d774 | ||
|
|
5a752c4a1f | ||
|
|
36b619d9da | ||
|
|
9dd89b36a3 | ||
|
|
cc529bdf06 | ||
|
|
531d7b67a6 | ||
|
|
68e79a35d7 | ||
|
|
ab0c01da0f | ||
|
|
6f51054330 | ||
|
|
12277fb0a7 | ||
|
|
709d8e47f5 | ||
|
|
0a1ce03a51 | ||
|
|
981ab4bd89 | ||
|
|
b998215e11 | ||
|
|
4ee400466c | ||
|
|
c9747a4594 | ||
|
|
9c5d4bc4d6 | ||
|
|
663f1b3212 | ||
|
|
e2a1c94551 | ||
|
|
d737142a7b | ||
|
|
a952ac163d | ||
|
|
7aa7c13dbd | ||
|
|
cec7937891 | ||
|
|
7cf7b53ece | ||
|
|
a32564ac1e | ||
|
|
b231a71291 | ||
|
|
1d9b94384c | ||
|
|
cf2daaaa25 | ||
|
|
1a0ce157fb | ||
|
|
831c74364b | ||
|
|
a50c6098f4 | ||
|
|
16261883e5 | ||
|
|
babda19050 | ||
|
|
c78200af7a | ||
|
|
64ba722bc5 | ||
|
|
8e64466ebf | ||
|
|
c0bb93e257 | ||
|
|
9707f08a28 | ||
|
|
9af3254cc8 | ||
|
|
ad83a4f870 | ||
|
|
86b0cd228e | ||
|
|
f8b4400897 | ||
|
|
5b01ce1c8a | ||
|
|
439accf746 | ||
|
|
69174d3385 | ||
|
|
68bb1351a1 | ||
|
|
5fc406b014 | ||
|
|
5b9218c083 | ||
|
|
d212e884ca | ||
|
|
cebeb347bb | ||
|
|
9235f30c81 | ||
|
|
1bfff15a4e | ||
|
|
b8121b20a4 | ||
|
|
a9bb7c1932 | ||
|
|
b2a7c71449 | ||
|
|
ac11fb5b1e | ||
|
|
e45428bc6c | ||
|
|
ff510396d3 | ||
|
|
7fb34b26e7 | ||
|
|
04f620dc8a | ||
|
|
31d0d13818 | ||
|
|
db5b1b2dcf | ||
|
|
796872022c | ||
|
|
002f7d41a2 | ||
|
|
401f25319c | ||
|
|
572a3de60f | ||
|
|
6d4c194601 | ||
|
|
2f2013b0df | ||
|
|
8521d9a340 | ||
|
|
70b7b035f5 | ||
|
|
a002299c3e | ||
|
|
9bfedb98c4 | ||
|
|
f429e72a40 | ||
|
|
6908b89731 | ||
|
|
8d24b2067e | ||
|
|
64d2dad9c1 | ||
|
|
7b2609408d | ||
|
|
cf49e46c2c | ||
|
|
1b3bdd0197 | ||
|
|
45d3718ed6 | ||
|
|
5d414fb8e6 | ||
|
|
abb25ab7cd | ||
|
|
5802d74f89 | ||
|
|
643ab9201f | ||
|
|
388ff2a7ca | ||
|
|
cfcee9c58b | ||
|
|
d3ee3104f3 | ||
|
|
827377e3d1 | ||
|
|
9aa8b74e5c | ||
|
|
178836829d | ||
|
|
075c31a508 |
No files matched your search
@@ -0,0 +1,66 @@
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: maven
|
||||
directory: /
|
||||
schedule:
|
||||
interval: weekly
|
||||
day: monday
|
||||
time: "09:00"
|
||||
timezone: Asia/Shanghai
|
||||
open-pull-requests-limit: 5
|
||||
# 默认只自动处理 Maven patch 升级;LangChain4j 小版本升级也交给 Dependabot 自动建 PR。
|
||||
allow:
|
||||
- dependency-name: "*"
|
||||
update-types:
|
||||
- version-update:semver-patch
|
||||
- dependency-name: "dev.langchain4j:*"
|
||||
update-types:
|
||||
- version-update:semver-minor
|
||||
ignore:
|
||||
# 完全忽略 IJPay 的所有升级。
|
||||
- dependency-name: "com.github.javen205:IJPay-*"
|
||||
# 完全忽略 MyBatis-Plus BOM 的所有升级。
|
||||
- dependency-name: "com.baomidou:mybatis-plus-bom"
|
||||
# 完全忽略 MyBatis-Plus-Join 的所有升级。
|
||||
- dependency-name: "com.github.yulichang:mybatis-plus-join-*"
|
||||
# major 升级涉及迁移风险,仍保留人工评估。
|
||||
- dependency-name: "*"
|
||||
update-types:
|
||||
- version-update:semver-major
|
||||
commit-message:
|
||||
prefix: chore(deps)
|
||||
groups:
|
||||
# LangChain4j 单独分组,避免与普通 Maven patch 升级混在一个 PR。
|
||||
langchain4j:
|
||||
patterns:
|
||||
- "dev.langchain4j:*"
|
||||
update-types:
|
||||
- patch
|
||||
- minor
|
||||
maven-dependencies:
|
||||
patterns:
|
||||
- "*"
|
||||
exclude-patterns:
|
||||
- "dev.langchain4j:*"
|
||||
update-types:
|
||||
- patch
|
||||
|
||||
- package-ecosystem: github-actions
|
||||
directory: /
|
||||
schedule:
|
||||
interval: weekly
|
||||
day: monday
|
||||
time: "09:30"
|
||||
timezone: Asia/Shanghai
|
||||
open-pull-requests-limit: 3
|
||||
ignore:
|
||||
- dependency-name: "*"
|
||||
update-types:
|
||||
- version-update:semver-minor
|
||||
- version-update:semver-major
|
||||
commit-message:
|
||||
prefix: ci(deps)
|
||||
groups:
|
||||
github-actions:
|
||||
patterns:
|
||||
- "*"
|
||||
@@ -0,0 +1,74 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
pull_request:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
maven-build:
|
||||
name: Maven build (Java ${{ matrix.java-version }})
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
java-version: ['17', '25']
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Set up JDK ${{ matrix.java-version }}
|
||||
uses: actions/setup-java@v5
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: ${{ matrix.java-version }}
|
||||
cache: maven
|
||||
|
||||
- name: Add JDK 25 annotation processor profile
|
||||
if: matrix.java-version == '25'
|
||||
run: |
|
||||
python - <<'PY'
|
||||
from pathlib import Path
|
||||
|
||||
pom = Path('pom.xml')
|
||||
content = pom.read_text()
|
||||
profile = '''\
|
||||
<profile>
|
||||
<id>jdk25-annotation-processor</id>
|
||||
<activation>
|
||||
<jdk>[25,)</jdk>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
<annotationProcessorPaths>
|
||||
<path>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
</path>
|
||||
</annotationProcessorPaths>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
'''
|
||||
|
||||
marker = ' </profiles>'
|
||||
if marker not in content:
|
||||
raise SystemExit('Cannot find root pom.xml profiles section.')
|
||||
if 'jdk25-annotation-processor' not in content:
|
||||
content = content.replace(marker, profile + marker, 1)
|
||||
pom.write_text(content)
|
||||
PY
|
||||
|
||||
- name: Build with Maven
|
||||
run: mvn -B -ntp clean install
|
||||
+10
-1
@@ -26,7 +26,6 @@ rebel.xml
|
||||
nbproject/private/
|
||||
build/
|
||||
nbbuild/
|
||||
dist/
|
||||
nbdist/
|
||||
.nb-gradle/
|
||||
|
||||
@@ -50,6 +49,7 @@ target/
|
||||
*.java~
|
||||
*.properties~
|
||||
*.xml~
|
||||
sessionStore
|
||||
|
||||
### system ignore ###
|
||||
.DS_Store
|
||||
@@ -58,6 +58,15 @@ Servers
|
||||
.metadata
|
||||
upload
|
||||
gen_code
|
||||
application-preview.yml
|
||||
|
||||
### node ###
|
||||
node_modules
|
||||
|
||||
### claude code ###
|
||||
.claude
|
||||
docs
|
||||
|
||||
### test
|
||||
aitest
|
||||
.vectorex
|
||||
+16
-13
@@ -1,19 +1,22 @@
|
||||
### 版本信息
|
||||
- 提问务必按以下模板,提交详细信息。
|
||||
|
||||
- 错误信息多多益善、错误截图多多益善。
|
||||
|
||||
---
|
||||
---
|
||||
|
||||
### 环境信息
|
||||
- pigx版本:
|
||||
- 操作系统:
|
||||
- 是否修改包名:
|
||||
|
||||
- 是否修改包名:
|
||||
|
||||
### 提供详细日志、截图、回显步骤
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
### 报错信息 (注意格式化)
|
||||
|
||||
```
|
||||
|
||||
这里粘贴代码或者、日志
|
||||
|
||||
```
|
||||
|
||||
### 问题描述(包括回显步骤、截图 (此项没有直接关闭、不予解决))
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
# Repository Guidelines
|
||||
|
||||
## Project Structure & Module Organization
|
||||
|
||||
pigx aggregates Spring Cloud services through the root `pom.xml`. Runtime services sit under dedicated folders:
|
||||
`pigx-register` (service discovery/Nacos), `pigx-gateway` (edge routing), `pigx-auth` (OAuth2), `pigx-upms` (user &
|
||||
permission), `pigx-flow` (workflow), `pigx-app-server`, and `pigx-visual` (monitoring plus
|
||||
schedulers). Shared libraries and DTOs live in `pigx-common`. Sample SQL and Docker build contexts reside in `db/`,
|
||||
while infra manifests live in `docker-compose.yml`. Every module uses the standard `src/main/java` and `src/test/java`
|
||||
layout.
|
||||
|
||||
## Build, Test, and Development Commands
|
||||
|
||||
Focused Maven commands are allowed only for test execution. They must not be used to package, start, or restart
|
||||
services.
|
||||
|
||||
## Testing Guidelines
|
||||
|
||||
Use `spring-boot-starter-test` (JUnit 5, AssertJ, Mockito) for unit and slice tests. Name classes `*Tests.java` and
|
||||
colocate fixtures in `src/test/resources`. Target >70% line coverage on the service layer that guards authentication,
|
||||
gateway filters, and approval flows. Before opening a PR, run the focused tests required by the change, then perform
|
||||
the required runtime validation. Do not use `mvn verify` as a build shortcut unless the user explicitly requests it.
|
||||
|
||||
## Commit & Pull Request Guidelines
|
||||
|
||||
Follow the repo’s `type(scope): summary` history, e.g. `fix(upms): clear login failure cache` or
|
||||
`feat(ai-voice): add speech transcription`. Each PR must describe the impact area, list affected modules, and reference
|
||||
internal tickets or issues. Attach curl/Postman snippets or screenshots whenever UI or OpenAPI responses change. Rebase
|
||||
on `ai-dev`, avoid committing generated artifacts, and call out schema/config updates explicitly.
|
||||
|
||||
## Security & Configuration Tips
|
||||
|
||||
Never commit environment secrets; rely on `docker-compose.yml` plus `.env` overrides ignored by Git. Keep `db/` seed
|
||||
data sanitized, and drive end-to-end checks against `pigx-register` (ports 8848/9848) with `pigx-gateway` (9999) so
|
||||
discovery behavior matches production.
|
||||
|
||||
## Behavioral Guidelines
|
||||
|
||||
The following four rules apply to all tasks and take precedence over other default behaviors.
|
||||
|
||||
### 1. Think Before Coding
|
||||
|
||||
- When requirements are ambiguous, ask first — never make silent assumptions
|
||||
- If a simpler solution exists, say so explicitly rather than quietly picking a direction
|
||||
- When something is unclear, surface the confusion instead of pushing forward with guesswork
|
||||
|
||||
### 2. Prefer Simplicity
|
||||
|
||||
- Use the minimum code needed to solve the current problem; add nothing unrequested
|
||||
- Do not introduce abstractions for one-off code or design for hypothetical future needs
|
||||
- Ask yourself: would a senior engineer call this over-engineered?
|
||||
|
||||
### 3. Surgical Changes
|
||||
|
||||
- Only touch what the task requires; do not refactor adjacent code as a side effect
|
||||
- Do not alter style or structure unrelated to the current task
|
||||
- Every changed line must trace directly to a stated requirement
|
||||
|
||||
### 4. Goal-Driven Execution
|
||||
|
||||
- Convert vague instructions into verifiable goals — prefer tests as the success criterion
|
||||
- "Fix a bug" → write a failing test that reproduces it, then make it pass
|
||||
- "Add validation" → write tests covering invalid inputs, then make them pass
|
||||
@@ -1,4 +1,4 @@
|
||||
Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
Copyright (c) 2018-2026, lengleng All rights reserved.
|
||||
|
||||
协议和授权
|
||||
pigX并非一个开源软件,作者保留全部的权利。
|
||||
|
||||
@@ -1,21 +1,20 @@
|
||||
## 协议和授权
|
||||
|
||||
pigX并非一个开源软件,作者保留全部的权利。
|
||||
pigX 并非一个开源软件,作者保留全部的权利。
|
||||
擅自窃用,即属严重侵权行为,与盗窃无异。产生的一切任何后果责任由侵权者自负。
|
||||
|
||||
### 🌹权益
|
||||
|
||||
1. 个人使用
|
||||
2. 允许用于学习、毕设等。
|
||||
## 商业使用
|
||||
- [商用请购买商业授权](https://pig4cloud.com)
|
||||
- [使用对应的专属版本](https://pig4cloud.com/data/other/form3.html)
|
||||
|
||||
### 🚫禁止
|
||||
|
||||
1. 将本项目的部分或全部代码和资源进行任何形式的再发行(尤其上传GitHub、Gitee )
|
||||
2. 利用本项目的部分或全部代码和资源进行`任何商业行为`
|
||||
将本项目的部分或全部代码和资源进行任何形式的再发行(上传GitHub、Gitee )
|
||||
|
||||
### 免责声明
|
||||
### 侵权处理
|
||||
|
||||
PigX 未对任何组织、团队,书面授权商业使用。如若出现任何商业后果、纠纷和本人无关,特此声明
|
||||
- 支付¥ 100000 侵权费用(含我方法律援助费用),本团队已完全委托博睿律师事务所 司法保护
|
||||
- 个人行为将直接收集材料邮寄贵司侵权律师函,若出现司法诉讼将直接影响当事人征信档案等特此说明
|
||||
|
||||
## 贡献代码
|
||||
|
||||
|
||||
+3292
File diff suppressed because it is too large.
Load diff
+17
-2
@@ -2,7 +2,7 @@
|
||||
create database `pigxx` default character set utf8mb4 collate utf8mb4_general_ci;
|
||||
|
||||
-- pigx 工作流相关库
|
||||
create database `pigxx_ac` default character set utf8mb4 collate utf8mb4_general_ci;
|
||||
create database `pigxx_flow` default character set utf8mb4 collate utf8mb4_general_ci;
|
||||
|
||||
-- pigx 任务相关库
|
||||
create database `pigxx_job` default character set utf8mb4 collate utf8mb4_general_ci;
|
||||
@@ -11,4 +11,19 @@ create database `pigxx_job` default character set utf8mb4 collate utf8mb4_genera
|
||||
create database `pigxx_mp` default character set utf8mb4 collate utf8mb4_general_ci;
|
||||
|
||||
-- pigx nacos配置相关库
|
||||
create database `pigxx_config` default character set utf8mb4 collate utf8mb4_general_ci;
|
||||
create database `pigxx_config` default character set utf8mb4 collate utf8mb4_general_ci;
|
||||
|
||||
-- pigx pay配置相关库
|
||||
create database `pigxx_pay` default character set utf8mb4 collate utf8mb4_general_ci;
|
||||
|
||||
-- pigx codegen相关库
|
||||
create database `pigxx_codegen` default character set utf8mb4 collate utf8mb4_general_ci;
|
||||
|
||||
-- pigx report相关库
|
||||
create database `pigxx_report` default character set utf8mb4 collate utf8mb4_general_ci;
|
||||
|
||||
-- pigx bi 报表相关的数据库
|
||||
create database `pigxx_bi` default character set utf8mb4 collate utf8mb4_general_ci;
|
||||
|
||||
-- pigx app 模块相关的数据库
|
||||
create database `pigxx_app` default character set utf8mb4 collate utf8mb4_general_ci;
|
||||
+1409
-251
File diff suppressed because it is too large.
Load diff
@@ -1,688 +0,0 @@
|
||||
/*
|
||||
Navicat Premium Data Transfer
|
||||
|
||||
Source Server : localhost
|
||||
Source Server Type : MySQL
|
||||
Source Server Version : 50723
|
||||
Source Host : localhost
|
||||
Source Database : pigxx_ac
|
||||
|
||||
Target Server Type : MySQL
|
||||
Target Server Version : 50723
|
||||
File Encoding : utf-8
|
||||
|
||||
Date: 01/09/2019 11:09:48 AM
|
||||
*/
|
||||
USE pigxx_ac;
|
||||
|
||||
SET NAMES utf8;
|
||||
SET FOREIGN_KEY_CHECKS = 0;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for `ACT_EVT_LOG`
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `ACT_EVT_LOG`;
|
||||
CREATE TABLE `ACT_EVT_LOG` (
|
||||
`LOG_NR_` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`TYPE_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
|
||||
`PROC_DEF_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
|
||||
`PROC_INST_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
|
||||
`EXECUTION_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
|
||||
`TASK_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
|
||||
`TIME_STAMP_` timestamp(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3),
|
||||
`USER_ID_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
|
||||
`DATA_` longblob,
|
||||
`LOCK_OWNER_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
|
||||
`LOCK_TIME_` timestamp(3) NULL DEFAULT NULL,
|
||||
`IS_PROCESSED_` tinyint(4) DEFAULT '0',
|
||||
PRIMARY KEY (`LOG_NR_`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for `ACT_GE_BYTEARRAY`
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `ACT_GE_BYTEARRAY`;
|
||||
CREATE TABLE `ACT_GE_BYTEARRAY` (
|
||||
`ID_` varchar(64) COLLATE utf8_bin NOT NULL,
|
||||
`REV_` int(11) DEFAULT NULL,
|
||||
`NAME_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
|
||||
`DEPLOYMENT_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
|
||||
`BYTES_` longblob,
|
||||
`GENERATED_` tinyint(4) DEFAULT NULL,
|
||||
PRIMARY KEY (`ID_`),
|
||||
KEY `ACT_FK_BYTEARR_DEPL` (`DEPLOYMENT_ID_`),
|
||||
CONSTRAINT `ACT_FK_BYTEARR_DEPL` FOREIGN KEY (`DEPLOYMENT_ID_`) REFERENCES `ACT_RE_DEPLOYMENT` (`ID_`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of `ACT_GE_BYTEARRAY`
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `ACT_GE_BYTEARRAY` VALUES ('12510', '1', '请教流程.bpmn20.xml', '12509', 0x3c3f786d6c2076657273696f6e3d27312e302720656e636f64696e673d275554462d38273f3e0a3c646566696e6974696f6e7320786d6c6e733d22687474703a2f2f7777772e6f6d672e6f72672f737065632f42504d4e2f32303130303532342f4d4f44454c2220786d6c6e733a7873693d22687474703a2f2f7777772e77332e6f72672f323030312f584d4c536368656d612d696e7374616e63652220786d6c6e733a7873643d22687474703a2f2f7777772e77332e6f72672f323030312f584d4c536368656d612220786d6c6e733a61637469766974693d22687474703a2f2f61637469766974692e6f72672f62706d6e2220786d6c6e733a62706d6e64693d22687474703a2f2f7777772e6f6d672e6f72672f737065632f42504d4e2f32303130303532342f44492220786d6c6e733a6f6d6764633d22687474703a2f2f7777772e6f6d672e6f72672f737065632f44442f32303130303532342f44432220786d6c6e733a6f6d6764693d22687474703a2f2f7777772e6f6d672e6f72672f737065632f44442f32303130303532342f44492220747970654c616e67756167653d22687474703a2f2f7777772e77332e6f72672f323030312f584d4c536368656d61222065787072657373696f6e4c616e67756167653d22687474703a2f2f7777772e77332e6f72672f313939392f585061746822207461726765744e616d6573706163653d22687474703a2f2f7777772e61637469766974692e6f72672f70726f63657373646566223e0a20203c70726f636573732069643d224c6561766542696c6c22206e616d653d224c6561766542696c6c2220697345786563757461626c653d2274727565223e0a202020203c73746172744576656e742069643d227369642d33414335453536332d453645332d343737372d423434362d30343736443838344331314422206e616d653d22e68f90e4baa4222f3e0a202020203c757365725461736b2069643d227369642d38433845373242432d353330322d343041372d413031372d30344542394641393136444122206e616d653d22e794a8e688b7e68f90e4baa4223e0a2020202020203c657874656e73696f6e456c656d656e74733e0a20202020202020203c61637469766974693a7461736b4c697374656e6572206576656e743d226372656174652220636c6173733d22636f6d2e70696734636c6f75642e706967782e6163742e6c697374656e65722e4c6561766550726f636573735461736b4c697374656e6572222f3e0a2020202020203c2f657874656e73696f6e456c656d656e74733e0a202020203c2f757365725461736b3e0a202020203c757365725461736b2069643d227369642d33354144463030362d353743302d343745302d394235422d41463432344530413745344522206e616d653d22e7bb84e995bfe5aea1e689b9223e0a2020202020203c657874656e73696f6e456c656d656e74733e0a20202020202020203c61637469766974693a7461736b4c697374656e6572206576656e743d226372656174652220636c6173733d22636f6d2e70696734636c6f75642e706967782e6163742e6c697374656e65722e4c6561766550726f636573735461736b4c697374656e6572222f3e0a2020202020203c2f657874656e73696f6e456c656d656e74733e0a202020203c2f757365725461736b3e0a202020203c656e644576656e742069643d227369642d30353539313044422d314445362d344243342d423532372d32334641373139444532363522206e616d653d22e7bb93e69d9f222f3e0a202020203c73657175656e6365466c6f772069643d227369642d32424346433631362d374438412d343134312d414633462d3841433138454131303044462220736f757263655265663d227369642d33414335453536332d453645332d343737372d423434362d30343736443838344331314422207461726765745265663d227369642d38433845373242432d353330322d343041372d413031372d303445423946413931364441222f3e0a202020203c73657175656e6365466c6f772069643d227369642d45464334383546312d414543392d343536392d423430312d44313644453538463637333722206e616d653d22e5aea1e689b92220736f757263655265663d227369642d38433845373242432d353330322d343041372d413031372d30344542394641393136444122207461726765745265663d227369642d33354144463030362d353743302d343745302d394235422d414634323445304137453445222f3e0a202020203c73657175656e6365466c6f772069643d227369642d38344242323430352d384530322d344442392d384632392d45394242423033324330443922206e616d653d22e9a9b3e59b9e2220736f757263655265663d227369642d33354144463030362d353743302d343745302d394235422d41463432344530413745344522207461726765745265663d227369642d38433845373242432d353330322d343041372d413031372d303445423946413931364441223e0a2020202020203c636f6e646974696f6e45787072657373696f6e207873693a747970653d2274466f726d616c45787072657373696f6e223e3c215b43444154415b247b666c61672e657175616c732827e9a9b3e59b9e27297d5d5d3e3c2f636f6e646974696f6e45787072657373696f6e3e0a202020203c2f73657175656e6365466c6f773e0a202020203c73657175656e6365466c6f772069643d227369642d36393830363236352d423636302d344239322d423744392d38444532413535433530373922206e616d653d22e5aea1e689b92220736f757263655265663d227369642d33354144463030362d353743302d343745302d394235422d41463432344530413745344522207461726765745265663d227369642d30353539313044422d314445362d344243342d423532372d323346413731394445323635222f3e0a20203c2f70726f636573733e0a20203c62706d6e64693a42504d4e4469616772616d2069643d2242504d4e4469616772616d5f4c6561766542696c6c223e0a202020203c62706d6e64693a42504d4e506c616e652062706d6e456c656d656e743d224c6561766542696c6c222069643d2242504d4e506c616e655f4c6561766542696c6c223e0a2020202020203c62706d6e64693a42504d4e53686170652062706d6e456c656d656e743d227369642d33414335453536332d453645332d343737372d423434362d303437364438383443313144222069643d2242504d4e53686170655f7369642d33414335453536332d453645332d343737372d423434362d303437364438383443313144223e0a20202020202020203c6f6d6764633a42Line truncated
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for `ACT_GE_PROPERTY`
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `ACT_GE_PROPERTY`;
|
||||
CREATE TABLE `ACT_GE_PROPERTY` (
|
||||
`NAME_` varchar(64) COLLATE utf8_bin NOT NULL,
|
||||
`VALUE_` varchar(300) COLLATE utf8_bin DEFAULT NULL,
|
||||
`REV_` int(11) DEFAULT NULL,
|
||||
PRIMARY KEY (`NAME_`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of `ACT_GE_PROPERTY`
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `ACT_GE_PROPERTY` VALUES ('next.dbid', '32501', '14'), ('schema.history', 'create(5.22.0.0)', '1'), ('schema.version', '5.22.0.0', '1');
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for `ACT_HI_ACTINST`
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `ACT_HI_ACTINST`;
|
||||
CREATE TABLE `ACT_HI_ACTINST` (
|
||||
`ID_` varchar(64) COLLATE utf8_bin NOT NULL,
|
||||
`PROC_DEF_ID_` varchar(64) COLLATE utf8_bin NOT NULL,
|
||||
`PROC_INST_ID_` varchar(64) COLLATE utf8_bin NOT NULL,
|
||||
`EXECUTION_ID_` varchar(64) COLLATE utf8_bin NOT NULL,
|
||||
`ACT_ID_` varchar(255) COLLATE utf8_bin NOT NULL,
|
||||
`TASK_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
|
||||
`CALL_PROC_INST_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
|
||||
`ACT_NAME_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
|
||||
`ACT_TYPE_` varchar(255) COLLATE utf8_bin NOT NULL,
|
||||
`ASSIGNEE_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
|
||||
`START_TIME_` datetime(3) NOT NULL,
|
||||
`END_TIME_` datetime(3) DEFAULT NULL,
|
||||
`DURATION_` bigint(20) DEFAULT NULL,
|
||||
`TENANT_ID_` varchar(255) COLLATE utf8_bin DEFAULT '',
|
||||
PRIMARY KEY (`ID_`),
|
||||
KEY `ACT_IDX_HI_ACT_INST_START` (`START_TIME_`),
|
||||
KEY `ACT_IDX_HI_ACT_INST_END` (`END_TIME_`),
|
||||
KEY `ACT_IDX_HI_ACT_INST_PROCINST` (`PROC_INST_ID_`,`ACT_ID_`),
|
||||
KEY `ACT_IDX_HI_ACT_INST_EXEC` (`EXECUTION_ID_`,`ACT_ID_`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of `ACT_HI_ACTINST`
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `ACT_HI_ACTINST` VALUES ('30106', 'LeaveBill:1:30104', '30105', '30105', 'start', null, null, '开始', 'startEvent', null, '2018-12-18 22:51:52.599', '2018-12-18 22:51:52.600', '1', '1'), ('30107', 'LeaveBill:1:30104', '30105', '30105', 'user', '30108', null, '用户提交', 'userTask', null, '2018-12-18 22:51:52.600', '2018-12-18 22:52:05.817', '13217', '1'), ('30114', 'LeaveBill:1:30104', '30105', '30105', 'pm', '30115', null, '组长审批', 'userTask', null, '2018-12-18 22:52:05.817', '2018-12-18 22:52:11.607', '5790', '1'), ('30118', 'LeaveBill:1:30104', '30105', '30105', 'user', '30119', null, '用户提交', 'userTask', null, '2018-12-18 22:52:11.607', null, null, '1');
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for `ACT_HI_ATTACHMENT`
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `ACT_HI_ATTACHMENT`;
|
||||
CREATE TABLE `ACT_HI_ATTACHMENT` (
|
||||
`ID_` varchar(64) COLLATE utf8_bin NOT NULL,
|
||||
`REV_` int(11) DEFAULT NULL,
|
||||
`USER_ID_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
|
||||
`NAME_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
|
||||
`DESCRIPTION_` varchar(4000) COLLATE utf8_bin DEFAULT NULL,
|
||||
`TYPE_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
|
||||
`TASK_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
|
||||
`PROC_INST_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
|
||||
`URL_` varchar(4000) COLLATE utf8_bin DEFAULT NULL,
|
||||
`CONTENT_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
|
||||
`TIME_` datetime(3) DEFAULT NULL,
|
||||
PRIMARY KEY (`ID_`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for `ACT_HI_COMMENT`
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `ACT_HI_COMMENT`;
|
||||
CREATE TABLE `ACT_HI_COMMENT` (
|
||||
`ID_` varchar(64) COLLATE utf8_bin NOT NULL,
|
||||
`TYPE_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
|
||||
`TIME_` datetime(3) NOT NULL,
|
||||
`USER_ID_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
|
||||
`TASK_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
|
||||
`PROC_INST_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
|
||||
`ACTION_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
|
||||
`MESSAGE_` varchar(4000) COLLATE utf8_bin DEFAULT NULL,
|
||||
`FULL_MSG_` longblob,
|
||||
PRIMARY KEY (`ID_`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of `ACT_HI_COMMENT`
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `ACT_HI_COMMENT` VALUES ('30111', 'comment', '2018-12-18 22:52:05.805', 'admin', '30108', '30105', 'AddComment', '1', 0x31), ('30117', 'comment', '2018-12-18 22:52:11.589', 'admin', '30115', '30105', 'AddComment', '2', 0x32);
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for `ACT_HI_DETAIL`
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `ACT_HI_DETAIL`;
|
||||
CREATE TABLE `ACT_HI_DETAIL` (
|
||||
`ID_` varchar(64) COLLATE utf8_bin NOT NULL,
|
||||
`TYPE_` varchar(255) COLLATE utf8_bin NOT NULL,
|
||||
`PROC_INST_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
|
||||
`EXECUTION_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
|
||||
`TASK_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
|
||||
`ACT_INST_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
|
||||
`NAME_` varchar(255) COLLATE utf8_bin NOT NULL,
|
||||
`VAR_TYPE_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
|
||||
`REV_` int(11) DEFAULT NULL,
|
||||
`TIME_` datetime(3) NOT NULL,
|
||||
`BYTEARRAY_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
|
||||
`DOUBLE_` double DEFAULT NULL,
|
||||
`LONG_` bigint(20) DEFAULT NULL,
|
||||
`TEXT_` varchar(4000) COLLATE utf8_bin DEFAULT NULL,
|
||||
`TEXT2_` varchar(4000) COLLATE utf8_bin DEFAULT NULL,
|
||||
PRIMARY KEY (`ID_`),
|
||||
KEY `ACT_IDX_HI_DETAIL_PROC_INST` (`PROC_INST_ID_`),
|
||||
KEY `ACT_IDX_HI_DETAIL_ACT_INST` (`ACT_INST_ID_`),
|
||||
KEY `ACT_IDX_HI_DETAIL_TIME` (`TIME_`),
|
||||
KEY `ACT_IDX_HI_DETAIL_NAME` (`NAME_`),
|
||||
KEY `ACT_IDX_HI_DETAIL_TASK_ID` (`TASK_ID_`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for `ACT_HI_IDENTITYLINK`
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `ACT_HI_IDENTITYLINK`;
|
||||
CREATE TABLE `ACT_HI_IDENTITYLINK` (
|
||||
`ID_` varchar(64) COLLATE utf8_bin NOT NULL,
|
||||
`GROUP_ID_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
|
||||
`TYPE_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
|
||||
`USER_ID_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
|
||||
`TASK_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
|
||||
`PROC_INST_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
|
||||
PRIMARY KEY (`ID_`),
|
||||
KEY `ACT_IDX_HI_IDENT_LNK_USER` (`USER_ID_`),
|
||||
KEY `ACT_IDX_HI_IDENT_LNK_TASK` (`TASK_ID_`),
|
||||
KEY `ACT_IDX_HI_IDENT_LNK_PROCINST` (`PROC_INST_ID_`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of `ACT_HI_IDENTITYLINK`
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `ACT_HI_IDENTITYLINK` VALUES ('30109', null, 'candidate', 'admin', '30108', null), ('30110', null, 'participant', 'admin', null, '30105'), ('30116', null, 'candidate', 'admin', '30115', null), ('30120', null, 'candidate', 'admin', '30119', null);
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for `ACT_HI_PROCINST`
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `ACT_HI_PROCINST`;
|
||||
CREATE TABLE `ACT_HI_PROCINST` (
|
||||
`ID_` varchar(64) COLLATE utf8_bin NOT NULL,
|
||||
`PROC_INST_ID_` varchar(64) COLLATE utf8_bin NOT NULL,
|
||||
`BUSINESS_KEY_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
|
||||
`PROC_DEF_ID_` varchar(64) COLLATE utf8_bin NOT NULL,
|
||||
`START_TIME_` datetime(3) NOT NULL,
|
||||
`END_TIME_` datetime(3) DEFAULT NULL,
|
||||
`DURATION_` bigint(20) DEFAULT NULL,
|
||||
`START_USER_ID_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
|
||||
`START_ACT_ID_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
|
||||
`END_ACT_ID_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
|
||||
`SUPER_PROCESS_INSTANCE_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
|
||||
`DELETE_REASON_` varchar(4000) COLLATE utf8_bin DEFAULT NULL,
|
||||
`TENANT_ID_` varchar(255) COLLATE utf8_bin DEFAULT '',
|
||||
`NAME_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
|
||||
PRIMARY KEY (`ID_`),
|
||||
UNIQUE KEY `PROC_INST_ID_` (`PROC_INST_ID_`),
|
||||
KEY `ACT_IDX_HI_PRO_INST_END` (`END_TIME_`),
|
||||
KEY `ACT_IDX_HI_PRO_I_BUSKEY` (`BUSINESS_KEY_`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of `ACT_HI_PROCINST`
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `ACT_HI_PROCINST` VALUES ('30105', '30105', 'LeaveBill_6', 'LeaveBill:1:30104', '2018-12-18 22:51:52.599', null, null, null, 'start', null, null, null, '1', null);
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for `ACT_HI_TASKINST`
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `ACT_HI_TASKINST`;
|
||||
CREATE TABLE `ACT_HI_TASKINST` (
|
||||
`ID_` varchar(64) COLLATE utf8_bin NOT NULL,
|
||||
`PROC_DEF_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
|
||||
`TASK_DEF_KEY_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
|
||||
`PROC_INST_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
|
||||
`EXECUTION_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
|
||||
`NAME_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
|
||||
`PARENT_TASK_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
|
||||
`DESCRIPTION_` varchar(4000) COLLATE utf8_bin DEFAULT NULL,
|
||||
`OWNER_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
|
||||
`ASSIGNEE_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
|
||||
`START_TIME_` datetime(3) NOT NULL,
|
||||
`CLAIM_TIME_` datetime(3) DEFAULT NULL,
|
||||
`END_TIME_` datetime(3) DEFAULT NULL,
|
||||
`DURATION_` bigint(20) DEFAULT NULL,
|
||||
`DELETE_REASON_` varchar(4000) COLLATE utf8_bin DEFAULT NULL,
|
||||
`PRIORITY_` int(11) DEFAULT NULL,
|
||||
`DUE_DATE_` datetime(3) DEFAULT NULL,
|
||||
`FORM_KEY_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
|
||||
`CATEGORY_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
|
||||
`TENANT_ID_` varchar(255) COLLATE utf8_bin DEFAULT '',
|
||||
PRIMARY KEY (`ID_`),
|
||||
KEY `ACT_IDX_HI_TASK_INST_PROCINST` (`PROC_INST_ID_`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of `ACT_HI_TASKINST`
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `ACT_HI_TASKINST` VALUES ('30108', 'LeaveBill:1:30104', 'user', '30105', '30105', '用户提交', null, null, null, null, '2018-12-18 22:51:52.601', null, '2018-12-18 22:52:05.815', '13214', 'completed', '50', null, null, null, '1'), ('30115', 'LeaveBill:1:30104', 'pm', '30105', '30105', '组长审批', null, null, null, null, '2018-12-18 22:52:05.817', null, '2018-12-18 22:52:11.603', '5786', 'completed', '50', null, null, null, '1'), ('30119', 'LeaveBill:1:30104', 'user', '30105', '30105', '用户提交', null, null, null, null, '2018-12-18 22:52:11.607', null, null, null, null, '50', null, null, null, '1');
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for `ACT_HI_VARINST`
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `ACT_HI_VARINST`;
|
||||
CREATE TABLE `ACT_HI_VARINST` (
|
||||
`ID_` varchar(64) COLLATE utf8_bin NOT NULL,
|
||||
`PROC_INST_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
|
||||
`EXECUTION_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
|
||||
`TASK_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
|
||||
`NAME_` varchar(255) COLLATE utf8_bin NOT NULL,
|
||||
`VAR_TYPE_` varchar(100) COLLATE utf8_bin DEFAULT NULL,
|
||||
`REV_` int(11) DEFAULT NULL,
|
||||
`BYTEARRAY_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
|
||||
`DOUBLE_` double DEFAULT NULL,
|
||||
`LONG_` bigint(20) DEFAULT NULL,
|
||||
`TEXT_` varchar(4000) COLLATE utf8_bin DEFAULT NULL,
|
||||
`TEXT2_` varchar(4000) COLLATE utf8_bin DEFAULT NULL,
|
||||
`CREATE_TIME_` datetime(3) DEFAULT NULL,
|
||||
`LAST_UPDATED_TIME_` datetime(3) DEFAULT NULL,
|
||||
PRIMARY KEY (`ID_`),
|
||||
KEY `ACT_IDX_HI_PROCVAR_PROC_INST` (`PROC_INST_ID_`),
|
||||
KEY `ACT_IDX_HI_PROCVAR_NAME_TYPE` (`NAME_`,`VAR_TYPE_`),
|
||||
KEY `ACT_IDX_HI_PROCVAR_TASK_ID` (`TASK_ID_`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of `ACT_HI_VARINST`
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `ACT_HI_VARINST` VALUES ('30112', '30105', '30105', null, 'days', 'integer', '1', null, null, '11', '11', null, '2018-12-18 22:52:05.813', '2018-12-18 22:52:11.598'), ('30113', '30105', '30105', null, 'flag', 'string', '1', null, null, null, '驳回', null, '2018-12-18 22:52:05.813', '2018-12-18 22:52:11.600');
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for `ACT_ID_GROUP`
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `ACT_ID_GROUP`;
|
||||
CREATE TABLE `ACT_ID_GROUP` (
|
||||
`ID_` varchar(64) COLLATE utf8_bin NOT NULL,
|
||||
`REV_` int(11) DEFAULT NULL,
|
||||
`NAME_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
|
||||
`TYPE_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
|
||||
PRIMARY KEY (`ID_`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for `ACT_ID_INFO`
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `ACT_ID_INFO`;
|
||||
CREATE TABLE `ACT_ID_INFO` (
|
||||
`ID_` varchar(64) COLLATE utf8_bin NOT NULL,
|
||||
`REV_` int(11) DEFAULT NULL,
|
||||
`USER_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
|
||||
`TYPE_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
|
||||
`KEY_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
|
||||
`VALUE_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
|
||||
`PASSWORD_` longblob,
|
||||
`PARENT_ID_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
|
||||
PRIMARY KEY (`ID_`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for `ACT_ID_MEMBERSHIP`
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `ACT_ID_MEMBERSHIP`;
|
||||
CREATE TABLE `ACT_ID_MEMBERSHIP` (
|
||||
`USER_ID_` varchar(64) COLLATE utf8_bin NOT NULL,
|
||||
`GROUP_ID_` varchar(64) COLLATE utf8_bin NOT NULL,
|
||||
PRIMARY KEY (`USER_ID_`,`GROUP_ID_`),
|
||||
KEY `ACT_FK_MEMB_GROUP` (`GROUP_ID_`),
|
||||
CONSTRAINT `ACT_FK_MEMB_GROUP` FOREIGN KEY (`GROUP_ID_`) REFERENCES `ACT_ID_GROUP` (`ID_`),
|
||||
CONSTRAINT `ACT_FK_MEMB_USER` FOREIGN KEY (`USER_ID_`) REFERENCES `ACT_ID_USER` (`ID_`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for `ACT_ID_USER`
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `ACT_ID_USER`;
|
||||
CREATE TABLE `ACT_ID_USER` (
|
||||
`ID_` varchar(64) COLLATE utf8_bin NOT NULL,
|
||||
`REV_` int(11) DEFAULT NULL,
|
||||
`FIRST_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
|
||||
`LAST_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
|
||||
`EMAIL_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
|
||||
`PWD_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
|
||||
`PICTURE_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
|
||||
PRIMARY KEY (`ID_`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for `ACT_PROCDEF_INFO`
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `ACT_PROCDEF_INFO`;
|
||||
CREATE TABLE `ACT_PROCDEF_INFO` (
|
||||
`ID_` varchar(64) COLLATE utf8_bin NOT NULL,
|
||||
`PROC_DEF_ID_` varchar(64) COLLATE utf8_bin NOT NULL,
|
||||
`REV_` int(11) DEFAULT NULL,
|
||||
`INFO_JSON_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
|
||||
PRIMARY KEY (`ID_`),
|
||||
UNIQUE KEY `ACT_UNIQ_INFO_PROCDEF` (`PROC_DEF_ID_`),
|
||||
KEY `ACT_IDX_INFO_PROCDEF` (`PROC_DEF_ID_`),
|
||||
KEY `ACT_FK_INFO_JSON_BA` (`INFO_JSON_ID_`),
|
||||
CONSTRAINT `ACT_FK_INFO_JSON_BA` FOREIGN KEY (`INFO_JSON_ID_`) REFERENCES `ACT_GE_BYTEARRAY` (`ID_`),
|
||||
CONSTRAINT `ACT_FK_INFO_PROCDEF` FOREIGN KEY (`PROC_DEF_ID_`) REFERENCES `ACT_RE_PROCDEF` (`ID_`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for `ACT_RE_DEPLOYMENT`
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `ACT_RE_DEPLOYMENT`;
|
||||
CREATE TABLE `ACT_RE_DEPLOYMENT` (
|
||||
`ID_` varchar(64) COLLATE utf8_bin NOT NULL,
|
||||
`NAME_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
|
||||
`CATEGORY_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
|
||||
`TENANT_ID_` varchar(255) COLLATE utf8_bin DEFAULT '',
|
||||
`DEPLOY_TIME_` timestamp(3) NULL DEFAULT NULL,
|
||||
PRIMARY KEY (`ID_`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of `ACT_RE_DEPLOYMENT`
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `ACT_RE_DEPLOYMENT` VALUES ('12509', '请教流程', null, '1', '2018-11-11 01:47:50.296'), ('30101', '请假流程', null, '1', '2018-12-18 22:50:23.963');
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for `ACT_RE_MODEL`
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `ACT_RE_MODEL`;
|
||||
CREATE TABLE `ACT_RE_MODEL` (
|
||||
`ID_` varchar(64) COLLATE utf8_bin NOT NULL,
|
||||
`REV_` int(11) DEFAULT NULL,
|
||||
`NAME_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
|
||||
`KEY_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
|
||||
`CATEGORY_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
|
||||
`CREATE_TIME_` timestamp(3) NULL DEFAULT NULL,
|
||||
`LAST_UPDATE_TIME_` timestamp(3) NULL DEFAULT NULL,
|
||||
`VERSION_` int(11) DEFAULT NULL,
|
||||
`META_INFO_` varchar(4000) COLLATE utf8_bin DEFAULT NULL,
|
||||
`DEPLOYMENT_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
|
||||
`EDITOR_SOURCE_VALUE_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
|
||||
`EDITOR_SOURCE_EXTRA_VALUE_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
|
||||
`TENANT_ID_` varchar(255) COLLATE utf8_bin DEFAULT '',
|
||||
PRIMARY KEY (`ID_`),
|
||||
KEY `ACT_FK_MODEL_SOURCE` (`EDITOR_SOURCE_VALUE_ID_`),
|
||||
KEY `ACT_FK_MODEL_SOURCE_EXTRA` (`EDITOR_SOURCE_EXTRA_VALUE_ID_`),
|
||||
KEY `ACT_FK_MODEL_DEPLOYMENT` (`DEPLOYMENT_ID_`),
|
||||
CONSTRAINT `ACT_FK_MODEL_DEPLOYMENT` FOREIGN KEY (`DEPLOYMENT_ID_`) REFERENCES `ACT_RE_DEPLOYMENT` (`ID_`),
|
||||
CONSTRAINT `ACT_FK_MODEL_SOURCE` FOREIGN KEY (`EDITOR_SOURCE_VALUE_ID_`) REFERENCES `ACT_GE_BYTEARRAY` (`ID_`),
|
||||
CONSTRAINT `ACT_FK_MODEL_SOURCE_EXTRA` FOREIGN KEY (`EDITOR_SOURCE_EXTRA_VALUE_ID_`) REFERENCES `ACT_GE_BYTEARRAY` (`ID_`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of `ACT_RE_MODEL`
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `ACT_RE_MODEL` VALUES ('1', '13', '请假流程', 'LeaveBill', 'LeaveBill', '2018-11-10 22:52:35.569', '2018-12-18 22:47:07.638', '1', '{\"name\":\"请假流程\",\"revision\":1,\"description\":\"内置请假流程。\"}', null, '2', '3', '1');
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for `ACT_RE_PROCDEF`
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `ACT_RE_PROCDEF`;
|
||||
CREATE TABLE `ACT_RE_PROCDEF` (
|
||||
`ID_` varchar(64) COLLATE utf8_bin NOT NULL,
|
||||
`REV_` int(11) DEFAULT NULL,
|
||||
`CATEGORY_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
|
||||
`NAME_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
|
||||
`KEY_` varchar(255) COLLATE utf8_bin NOT NULL,
|
||||
`VERSION_` int(11) NOT NULL,
|
||||
`DEPLOYMENT_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
|
||||
`RESOURCE_NAME_` varchar(4000) COLLATE utf8_bin DEFAULT NULL,
|
||||
`DGRM_RESOURCE_NAME_` varchar(4000) COLLATE utf8_bin DEFAULT NULL,
|
||||
`DESCRIPTION_` varchar(4000) COLLATE utf8_bin DEFAULT NULL,
|
||||
`HAS_START_FORM_KEY_` tinyint(4) DEFAULT NULL,
|
||||
`HAS_GRAPHICAL_NOTATION_` tinyint(4) DEFAULT NULL,
|
||||
`SUSPENSION_STATE_` int(11) DEFAULT NULL,
|
||||
`TENANT_ID_` varchar(255) COLLATE utf8_bin DEFAULT '',
|
||||
PRIMARY KEY (`ID_`),
|
||||
UNIQUE KEY `ACT_UNIQ_PROCDEF` (`KEY_`,`VERSION_`,`TENANT_ID_`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of `ACT_RE_PROCDEF`
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `ACT_RE_PROCDEF` VALUES ('LeaveBill:1:30104', '2', 'LeaveBill', 'LeaveBill', 'LeaveBill', '1', '30101', '请假流程.bpmn20.xml', '请假流程.LeaveBill.png', null, '0', '1', '1', '1');
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for `ACT_RU_EVENT_SUBSCR`
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `ACT_RU_EVENT_SUBSCR`;
|
||||
CREATE TABLE `ACT_RU_EVENT_SUBSCR` (
|
||||
`ID_` varchar(64) COLLATE utf8_bin NOT NULL,
|
||||
`REV_` int(11) DEFAULT NULL,
|
||||
`EVENT_TYPE_` varchar(255) COLLATE utf8_bin NOT NULL,
|
||||
`EVENT_NAME_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
|
||||
`EXECUTION_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
|
||||
`PROC_INST_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
|
||||
`ACTIVITY_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
|
||||
`CONFIGURATION_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
|
||||
`CREATED_` timestamp(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
|
||||
`PROC_DEF_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
|
||||
`TENANT_ID_` varchar(255) COLLATE utf8_bin DEFAULT '',
|
||||
PRIMARY KEY (`ID_`),
|
||||
KEY `ACT_IDX_EVENT_SUBSCR_CONFIG_` (`CONFIGURATION_`),
|
||||
KEY `ACT_FK_EVENT_EXEC` (`EXECUTION_ID_`),
|
||||
CONSTRAINT `ACT_FK_EVENT_EXEC` FOREIGN KEY (`EXECUTION_ID_`) REFERENCES `ACT_RU_EXECUTION` (`ID_`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for `ACT_RU_EXECUTION`
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `ACT_RU_EXECUTION`;
|
||||
CREATE TABLE `ACT_RU_EXECUTION` (
|
||||
`ID_` varchar(64) COLLATE utf8_bin NOT NULL,
|
||||
`REV_` int(11) DEFAULT NULL,
|
||||
`PROC_INST_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
|
||||
`BUSINESS_KEY_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
|
||||
`PARENT_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
|
||||
`PROC_DEF_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
|
||||
`SUPER_EXEC_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
|
||||
`ACT_ID_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
|
||||
`IS_ACTIVE_` tinyint(4) DEFAULT NULL,
|
||||
`IS_CONCURRENT_` tinyint(4) DEFAULT NULL,
|
||||
`IS_SCOPE_` tinyint(4) DEFAULT NULL,
|
||||
`IS_EVENT_SCOPE_` tinyint(4) DEFAULT NULL,
|
||||
`SUSPENSION_STATE_` int(11) DEFAULT NULL,
|
||||
`CACHED_ENT_STATE_` int(11) DEFAULT NULL,
|
||||
`TENANT_ID_` varchar(255) COLLATE utf8_bin DEFAULT '',
|
||||
`NAME_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
|
||||
`LOCK_TIME_` timestamp(3) NULL DEFAULT NULL,
|
||||
PRIMARY KEY (`ID_`),
|
||||
KEY `ACT_IDX_EXEC_BUSKEY` (`BUSINESS_KEY_`),
|
||||
KEY `ACT_FK_EXE_PROCINST` (`PROC_INST_ID_`),
|
||||
KEY `ACT_FK_EXE_PARENT` (`PARENT_ID_`),
|
||||
KEY `ACT_FK_EXE_SUPER` (`SUPER_EXEC_`),
|
||||
KEY `ACT_FK_EXE_PROCDEF` (`PROC_DEF_ID_`),
|
||||
CONSTRAINT `ACT_FK_EXE_PARENT` FOREIGN KEY (`PARENT_ID_`) REFERENCES `ACT_RU_EXECUTION` (`ID_`),
|
||||
CONSTRAINT `ACT_FK_EXE_PROCDEF` FOREIGN KEY (`PROC_DEF_ID_`) REFERENCES `ACT_RE_PROCDEF` (`ID_`),
|
||||
CONSTRAINT `ACT_FK_EXE_PROCINST` FOREIGN KEY (`PROC_INST_ID_`) REFERENCES `ACT_RU_EXECUTION` (`ID_`) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
CONSTRAINT `ACT_FK_EXE_SUPER` FOREIGN KEY (`SUPER_EXEC_`) REFERENCES `ACT_RU_EXECUTION` (`ID_`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of `ACT_RU_EXECUTION`
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `ACT_RU_EXECUTION` VALUES ('30105', '3', '30105', 'LeaveBill_6', null, 'LeaveBill:1:30104', null, 'user', '1', '0', '1', '0', '1', '2', '1', null, null);
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for `ACT_RU_IDENTITYLINK`
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `ACT_RU_IDENTITYLINK`;
|
||||
CREATE TABLE `ACT_RU_IDENTITYLINK` (
|
||||
`ID_` varchar(64) COLLATE utf8_bin NOT NULL,
|
||||
`REV_` int(11) DEFAULT NULL,
|
||||
`GROUP_ID_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
|
||||
`TYPE_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
|
||||
`USER_ID_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
|
||||
`TASK_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
|
||||
`PROC_INST_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
|
||||
`PROC_DEF_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
|
||||
PRIMARY KEY (`ID_`),
|
||||
KEY `ACT_IDX_IDENT_LNK_USER` (`USER_ID_`),
|
||||
KEY `ACT_IDX_IDENT_LNK_GROUP` (`GROUP_ID_`),
|
||||
KEY `ACT_IDX_ATHRZ_PROCEDEF` (`PROC_DEF_ID_`),
|
||||
KEY `ACT_FK_TSKASS_TASK` (`TASK_ID_`),
|
||||
KEY `ACT_FK_IDL_PROCINST` (`PROC_INST_ID_`),
|
||||
CONSTRAINT `ACT_FK_ATHRZ_PROCEDEF` FOREIGN KEY (`PROC_DEF_ID_`) REFERENCES `ACT_RE_PROCDEF` (`ID_`),
|
||||
CONSTRAINT `ACT_FK_IDL_PROCINST` FOREIGN KEY (`PROC_INST_ID_`) REFERENCES `ACT_RU_EXECUTION` (`ID_`),
|
||||
CONSTRAINT `ACT_FK_TSKASS_TASK` FOREIGN KEY (`TASK_ID_`) REFERENCES `ACT_RU_TASK` (`ID_`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of `ACT_RU_IDENTITYLINK`
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `ACT_RU_IDENTITYLINK` VALUES ('30110', '1', null, 'participant', 'admin', null, '30105', null), ('30120', '1', null, 'candidate', 'admin', '30119', null, null);
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for `ACT_RU_JOB`
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `ACT_RU_JOB`;
|
||||
CREATE TABLE `ACT_RU_JOB` (
|
||||
`ID_` varchar(64) COLLATE utf8_bin NOT NULL,
|
||||
`REV_` int(11) DEFAULT NULL,
|
||||
`TYPE_` varchar(255) COLLATE utf8_bin NOT NULL,
|
||||
`LOCK_EXP_TIME_` timestamp(3) NULL DEFAULT NULL,
|
||||
`LOCK_OWNER_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
|
||||
`EXCLUSIVE_` tinyint(1) DEFAULT NULL,
|
||||
`EXECUTION_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
|
||||
`PROCESS_INSTANCE_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
|
||||
`PROC_DEF_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
|
||||
`RETRIES_` int(11) DEFAULT NULL,
|
||||
`EXCEPTION_STACK_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
|
||||
`EXCEPTION_MSG_` varchar(4000) COLLATE utf8_bin DEFAULT NULL,
|
||||
`DUEDATE_` timestamp(3) NULL DEFAULT NULL,
|
||||
`REPEAT_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
|
||||
`HANDLER_TYPE_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
|
||||
`HANDLER_CFG_` varchar(4000) COLLATE utf8_bin DEFAULT NULL,
|
||||
`TENANT_ID_` varchar(255) COLLATE utf8_bin DEFAULT '',
|
||||
PRIMARY KEY (`ID_`),
|
||||
KEY `ACT_FK_JOB_EXCEPTION` (`EXCEPTION_STACK_ID_`),
|
||||
CONSTRAINT `ACT_FK_JOB_EXCEPTION` FOREIGN KEY (`EXCEPTION_STACK_ID_`) REFERENCES `ACT_GE_BYTEARRAY` (`ID_`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for `ACT_RU_TASK`
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `ACT_RU_TASK`;
|
||||
CREATE TABLE `ACT_RU_TASK` (
|
||||
`ID_` varchar(64) COLLATE utf8_bin NOT NULL,
|
||||
`REV_` int(11) DEFAULT NULL,
|
||||
`EXECUTION_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
|
||||
`PROC_INST_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
|
||||
`PROC_DEF_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
|
||||
`NAME_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
|
||||
`PARENT_TASK_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
|
||||
`DESCRIPTION_` varchar(4000) COLLATE utf8_bin DEFAULT NULL,
|
||||
`TASK_DEF_KEY_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
|
||||
`OWNER_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
|
||||
`ASSIGNEE_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
|
||||
`DELEGATION_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
|
||||
`PRIORITY_` int(11) DEFAULT NULL,
|
||||
`CREATE_TIME_` timestamp(3) NULL DEFAULT NULL,
|
||||
`DUE_DATE_` datetime(3) DEFAULT NULL,
|
||||
`CATEGORY_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
|
||||
`SUSPENSION_STATE_` int(11) DEFAULT NULL,
|
||||
`TENANT_ID_` varchar(255) COLLATE utf8_bin DEFAULT '',
|
||||
`FORM_KEY_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
|
||||
PRIMARY KEY (`ID_`),
|
||||
KEY `ACT_IDX_TASK_CREATE` (`CREATE_TIME_`),
|
||||
KEY `ACT_FK_TASK_EXE` (`EXECUTION_ID_`),
|
||||
KEY `ACT_FK_TASK_PROCINST` (`PROC_INST_ID_`),
|
||||
KEY `ACT_FK_TASK_PROCDEF` (`PROC_DEF_ID_`),
|
||||
CONSTRAINT `ACT_FK_TASK_EXE` FOREIGN KEY (`EXECUTION_ID_`) REFERENCES `ACT_RU_EXECUTION` (`ID_`),
|
||||
CONSTRAINT `ACT_FK_TASK_PROCDEF` FOREIGN KEY (`PROC_DEF_ID_`) REFERENCES `ACT_RE_PROCDEF` (`ID_`),
|
||||
CONSTRAINT `ACT_FK_TASK_PROCINST` FOREIGN KEY (`PROC_INST_ID_`) REFERENCES `ACT_RU_EXECUTION` (`ID_`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of `ACT_RU_TASK`
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `ACT_RU_TASK` VALUES ('30119', '1', '30105', '30105', 'LeaveBill:1:30104', '用户提交', null, null, 'user', null, null, null, '50', '2018-12-18 22:52:11.607', null, null, '1', '1', null);
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for `ACT_RU_VARIABLE`
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `ACT_RU_VARIABLE`;
|
||||
CREATE TABLE `ACT_RU_VARIABLE` (
|
||||
`ID_` varchar(64) COLLATE utf8_bin NOT NULL,
|
||||
`REV_` int(11) DEFAULT NULL,
|
||||
`TYPE_` varchar(255) COLLATE utf8_bin NOT NULL,
|
||||
`NAME_` varchar(255) COLLATE utf8_bin NOT NULL,
|
||||
`EXECUTION_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
|
||||
`PROC_INST_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
|
||||
`TASK_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
|
||||
`BYTEARRAY_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
|
||||
`DOUBLE_` double DEFAULT NULL,
|
||||
`LONG_` bigint(20) DEFAULT NULL,
|
||||
`TEXT_` varchar(4000) COLLATE utf8_bin DEFAULT NULL,
|
||||
`TEXT2_` varchar(4000) COLLATE utf8_bin DEFAULT NULL,
|
||||
PRIMARY KEY (`ID_`),
|
||||
KEY `ACT_IDX_VARIABLE_TASK_ID` (`TASK_ID_`),
|
||||
KEY `ACT_FK_VAR_EXE` (`EXECUTION_ID_`),
|
||||
KEY `ACT_FK_VAR_PROCINST` (`PROC_INST_ID_`),
|
||||
KEY `ACT_FK_VAR_BYTEARRAY` (`BYTEARRAY_ID_`),
|
||||
CONSTRAINT `ACT_FK_VAR_BYTEARRAY` FOREIGN KEY (`BYTEARRAY_ID_`) REFERENCES `ACT_GE_BYTEARRAY` (`ID_`),
|
||||
CONSTRAINT `ACT_FK_VAR_EXE` FOREIGN KEY (`EXECUTION_ID_`) REFERENCES `ACT_RU_EXECUTION` (`ID_`),
|
||||
CONSTRAINT `ACT_FK_VAR_PROCINST` FOREIGN KEY (`PROC_INST_ID_`) REFERENCES `ACT_RU_EXECUTION` (`ID_`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of `ACT_RU_VARIABLE`
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `ACT_RU_VARIABLE` VALUES ('30112', '1', 'integer', 'days', '30105', '30105', null, null, null, '11', '11', null), ('30113', '2', 'string', 'flag', '30105', '30105', null, null, null, null, '驳回', null);
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for `oa_leave_bill`
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `oa_leave_bill`;
|
||||
CREATE TABLE `oa_leave_bill` (
|
||||
`leave_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`username` varchar(40) DEFAULT NULL COMMENT '用户名',
|
||||
`days` int(4) DEFAULT NULL COMMENT '请假天数',
|
||||
`content` varchar(255) DEFAULT NULL COMMENT '备注',
|
||||
`state` char(1) DEFAULT '0' COMMENT '状态',
|
||||
`leave_time` datetime DEFAULT NULL COMMENT '请假时间',
|
||||
`create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`update_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||
`del_flag` char(1) DEFAULT '0' COMMENT '删除标识',
|
||||
`tenant_id` int(11) NOT NULL COMMENT '所属租户',
|
||||
PRIMARY KEY (`leave_id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of `oa_leave_bill`
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `oa_leave_bill` VALUES ('2', 'admin', '16', '2018-12-19 12:00', '1', '2018-12-19 12:00:00', '2018-12-18 22:35:45', '2018-12-18 22:37:13', '0', '1'), ('3', 'admin', '20', '2018-12-22 12:00', '1', '2018-12-22 12:00:00', '2018-12-18 22:41:11', '2018-12-18 22:41:27', '0', '1'), ('4', 'admin', '22', '111', '1', '2018-12-03 12:00:00', '2018-12-18 22:42:45', '2018-12-18 22:42:50', '0', '1'), ('5', 'admin', '20', '11111', '1', '2018-12-12 12:00:00', '2018-12-18 22:45:30', '2018-12-18 22:45:34', '0', '1'), ('6', 'admin', '11', '12', '1', '2018-12-04 12:00:00', '2018-12-18 22:51:19', '2018-12-18 22:51:52', '0', '1');
|
||||
COMMIT;
|
||||
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
@@ -0,0 +1,334 @@
|
||||
-- 本文件仅用于初始化,不用于升级已有数据库。
|
||||
USE pigxx_flow;
|
||||
|
||||
SET NAMES utf8mb4;
|
||||
SET FOREIGN_KEY_CHECKS = 0;
|
||||
|
||||
CREATE TABLE `bpm_oa_leave` (
|
||||
`id` BIGINT NOT NULL COMMENT '主键',
|
||||
`process_instance_id` VARCHAR(64) DEFAULT NULL COMMENT '流程实例编号',
|
||||
`username` VARCHAR(255) NOT NULL COMMENT '申请人',
|
||||
`leave_type` SMALLINT NOT NULL COMMENT '请假类型',
|
||||
`leave_reason` VARCHAR(255) DEFAULT NULL COMMENT '请假原因',
|
||||
`start_time` DATETIME(6) NOT NULL COMMENT '开始时间',
|
||||
`end_time` DATETIME(6) NOT NULL COMMENT '结束时间',
|
||||
`leave_day` SMALLINT NOT NULL COMMENT '请假天数',
|
||||
`leave_status` SMALLINT DEFAULT NULL COMMENT '请假结果',
|
||||
`create_by` VARCHAR(64) DEFAULT '' COMMENT '创建者',
|
||||
`create_time` DATETIME(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) COMMENT '创建时间',
|
||||
`update_by` VARCHAR(64) DEFAULT '' COMMENT '更新者',
|
||||
`update_time` DATETIME(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6) COMMENT '更新时间',
|
||||
`del_flag` CHAR(1) NOT NULL DEFAULT '0' COMMENT '是否删除',
|
||||
`tenant_id` BIGINT NOT NULL DEFAULT 0 COMMENT '租户编号',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='请假申请表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for process
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `process`;
|
||||
CREATE TABLE `process` (
|
||||
`id` bigint NOT NULL COMMENT '用户id',
|
||||
`del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '删除标志',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
|
||||
`flow_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '表单ID',
|
||||
`name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '表单名称',
|
||||
`logo` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '图标配置',
|
||||
`settings` json DEFAULT NULL COMMENT '设置项',
|
||||
`group_id` bigint NOT NULL COMMENT '分组ID',
|
||||
`form_config` json NOT NULL COMMENT '表单设置信息',
|
||||
`form_items` json NOT NULL COMMENT '表单设置内容',
|
||||
`process` json NOT NULL COMMENT '流程设置内容',
|
||||
`remark` varchar(125) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '备注',
|
||||
`sort` int NOT NULL,
|
||||
`is_hidden` char(1) NOT NULL COMMENT '0 正常 1=隐藏',
|
||||
`is_stop` char(1) NOT NULL COMMENT '0 正常 1=停用 ',
|
||||
`admin_id` bigint DEFAULT NULL COMMENT '流程管理员',
|
||||
`unique_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '唯一性id',
|
||||
`admin_list` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '管理员',
|
||||
`range_show` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '范围描述显示',
|
||||
`print_template` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '打印模板',
|
||||
`tenant_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '所属租户id',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
UNIQUE KEY `idx_form_id` (`flow_id`) USING BTREE,
|
||||
KEY `process_idx_id` (`id`) USING BTREE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=182 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='流程定义数据';
|
||||
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for process_copy
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `process_copy`;
|
||||
CREATE TABLE `process_copy` (
|
||||
`id` bigint NOT NULL COMMENT '用户id',
|
||||
`del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '删除标志',
|
||||
`create_time` datetime COMMENT '创建时间',
|
||||
`update_time` datetime COMMENT '更新时间',
|
||||
`start_time` datetime NOT NULL COMMENT ' 流程发起时间',
|
||||
`node_time` datetime NOT NULL COMMENT '当前节点时间',
|
||||
`start_user_id` bigint NOT NULL COMMENT '发起人',
|
||||
`flow_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '流程id',
|
||||
`process_instance_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '实例id',
|
||||
`node_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '节点id',
|
||||
`group_id` bigint NOT NULL COMMENT '分组id',
|
||||
`group_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '分组名称',
|
||||
`process_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '流程名称',
|
||||
`node_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '节点 名称',
|
||||
`form_data` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '表单数据',
|
||||
`user_id` bigint NOT NULL COMMENT '抄送人id',
|
||||
`tenant_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '所属租户id',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
KEY `copy_idx_id` (`id`) USING BTREE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=74 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='流程抄送数据';
|
||||
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for process_group
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `process_group`;
|
||||
CREATE TABLE `process_group` (
|
||||
`id` bigint NOT NULL COMMENT '用户id',
|
||||
`del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '删除标志',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
|
||||
`group_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '分组名',
|
||||
`sort` int NOT NULL DEFAULT '0' COMMENT '排序',
|
||||
`tenant_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '所属租户id',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
KEY `group_idx_id` (`id`) USING BTREE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='流程分组';
|
||||
|
||||
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for process_instance_record
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `process_instance_record`;
|
||||
CREATE TABLE `process_instance_record` (
|
||||
`id` bigint NOT NULL COMMENT '用户id',
|
||||
`name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '流程名字',
|
||||
`logo` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '头像',
|
||||
`user_id` bigint NOT NULL COMMENT '用户id',
|
||||
`del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '删除标志',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
`update_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||
`flow_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '流程id',
|
||||
`process_instance_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '流程实例id',
|
||||
`form_data` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT '表单数据',
|
||||
`group_id` bigint DEFAULT NULL COMMENT '组id',
|
||||
`group_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '组名称',
|
||||
`status` int DEFAULT '1' COMMENT '状态',
|
||||
`finish_reason` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '结束原因',
|
||||
`end_time` datetime DEFAULT NULL COMMENT '结束时间',
|
||||
`parent_process_instance_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '上级流程实例id',
|
||||
`tenant_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '所属租户id',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
KEY `record_idx_id` (`id`) USING BTREE,
|
||||
KEY `record_idx_dep_id` (`user_id`) USING BTREE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=366 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='流程记录';
|
||||
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for process_node_data
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `process_node_data`;
|
||||
CREATE TABLE `process_node_data` (
|
||||
`id` bigint NOT NULL COMMENT '用户id',
|
||||
`del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '删除标志',
|
||||
`create_time` datetime COMMENT '创建时间',
|
||||
`update_time` datetime COMMENT '更新时间',
|
||||
`process_definition_id` varchar(64) DEFAULT NULL COMMENT '引擎流程定义ID,发布版本快照',
|
||||
`flow_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '流程id',
|
||||
`data` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '表单数据',
|
||||
`node_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||
`tenant_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '所属租户id',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
UNIQUE KEY `uk_node_definition` (`tenant_id`,`process_definition_id`,`node_id`),
|
||||
KEY `data_idx_id` (`id`) USING BTREE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=1195 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='流程节点数据';
|
||||
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for process_node_record
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `process_node_record`;
|
||||
CREATE TABLE `process_node_record` (
|
||||
`id` bigint NOT NULL COMMENT '用户id',
|
||||
`del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '删除标志',
|
||||
`create_time` datetime COMMENT '创建时间',
|
||||
`update_time` datetime COMMENT '更新时间',
|
||||
`flow_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '流程id',
|
||||
`process_instance_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '流程实例id',
|
||||
`data` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT '表单数据',
|
||||
`node_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||
`node_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '节点类型',
|
||||
`node_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '节点名字',
|
||||
`status` int NOT NULL COMMENT '节点状态',
|
||||
`start_time` datetime NOT NULL COMMENT '开始时间',
|
||||
`end_time` datetime DEFAULT NULL COMMENT '结束时间',
|
||||
`execution_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '执行id',
|
||||
`tenant_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '所属租户id',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
KEY `node_idx_id` (`id`) USING BTREE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=1435 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='流程节点记录';
|
||||
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for process_node_record_assign_user
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `process_node_record_assign_user`;
|
||||
CREATE TABLE `process_node_record_assign_user` (
|
||||
`id` bigint NOT NULL COMMENT '用户id',
|
||||
`del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '删除标志',
|
||||
`create_time` datetime COMMENT '创建时间',
|
||||
`update_time` datetime COMMENT '更新时间',
|
||||
`flow_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '流程id',
|
||||
`process_instance_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '流程实例id',
|
||||
`data` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT '表单数据',
|
||||
`node_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||
`user_id` bigint NOT NULL COMMENT ' 用户id',
|
||||
`status` int NOT NULL COMMENT '节点状态',
|
||||
`start_time` datetime NOT NULL COMMENT '开始时间',
|
||||
`end_time` datetime DEFAULT NULL COMMENT '结束时间',
|
||||
`execution_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '执行id',
|
||||
`task_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT ' 任务id',
|
||||
`approve_desc` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '审批意见',
|
||||
`node_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT ' 节点名称',
|
||||
`task_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '任务类型',
|
||||
`local_data` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT '表单本地数据',
|
||||
`node_record_id` bigint NOT NULL COMMENT '本轮节点执行记录id',
|
||||
`assignment_origin` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'ORIGINAL' COMMENT '分配来源 ORIGINAL/ADD_SIGN',
|
||||
`initial_user_id` bigint NOT NULL COMMENT '本份待办最初分配用户id',
|
||||
`add_sign_record_id` bigint DEFAULT NULL COMMENT '动态加签批次记录id',
|
||||
`tenant_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '所属租户id',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
UNIQUE KEY `uk_node_record_user` (`tenant_id`,`node_record_id`,`user_id`) USING BTREE,
|
||||
KEY `user_idx_id` (`id`) USING BTREE,
|
||||
KEY `idx_add_sign_record_id` (`add_sign_record_id`) USING BTREE,
|
||||
KEY `idx_assign_tenant_instance_del` (`tenant_id`,`process_instance_id`,`del_flag`) USING BTREE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=597 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='流程节点记录-执行人';
|
||||
|
||||
-- Flowable 列表查询索引:act_* 表由引擎初始化,不在本脚本中创建。
|
||||
-- 首次启动完成后,在业务库手动执行以下 SQL 一次;已有同名索引时不要重复执行。
|
||||
-- 待办:按审批人筛选、创建时间排序。
|
||||
-- ALTER TABLE `act_ru_task`
|
||||
-- ADD INDEX `idx_task_assignee_create` (`ASSIGNEE_`, `CREATE_TIME_`),
|
||||
-- ALGORITHM=INPLACE, LOCK=NONE;
|
||||
-- 已办:按审批人及结束时间查询、统计。
|
||||
-- ALTER TABLE `act_hi_actinst`
|
||||
-- ADD INDEX `idx_act_assignee_end` (`ASSIGNEE_`, `END_TIME_`),
|
||||
-- ALGORITHM=INPLACE, LOCK=NONE;
|
||||
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for process_task_add_sign_record
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `process_task_add_sign_record`;
|
||||
CREATE TABLE `process_task_add_sign_record` (
|
||||
`id` bigint NOT NULL COMMENT '主键id',
|
||||
`del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '删除标志',
|
||||
`create_time` datetime COMMENT '创建时间',
|
||||
`update_time` datetime COMMENT '更新时间',
|
||||
`flow_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '流程id',
|
||||
`process_instance_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '流程实例id',
|
||||
`node_record_id` bigint NOT NULL COMMENT '本轮节点执行记录id',
|
||||
`node_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '节点id',
|
||||
`source_task_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '发起加签的任务id',
|
||||
`added_by_user_id` bigint NOT NULL COMMENT '加签发起人id',
|
||||
`reason` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '加签原因',
|
||||
`target_user_ids` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '本批次目标用户快照',
|
||||
`participant_user_ids_before` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '操作前参与人快照',
|
||||
`participant_user_ids_after` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '操作后参与人快照',
|
||||
`tenant_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '所属租户id',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
KEY `idx_add_sign_node_record` (`tenant_id`,`node_record_id`) USING BTREE,
|
||||
KEY `idx_add_sign_process_instance` (`tenant_id`,`process_instance_id`) USING BTREE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='流程动态加签批次记录';
|
||||
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for process_starter
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `process_starter`;
|
||||
CREATE TABLE `process_starter` (
|
||||
`id` bigint NOT NULL COMMENT '用户id',
|
||||
`del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '删除标志',
|
||||
`create_time` datetime COMMENT '创建时间',
|
||||
`update_time` datetime COMMENT '更新时间',
|
||||
`type_id` bigint NOT NULL COMMENT '用户id或者部门id',
|
||||
`type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT ' 类型 user dept',
|
||||
`process_id` bigint NOT NULL COMMENT '流程id',
|
||||
`tenant_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '所属租户id',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
KEY `starter_idx_id` (`id`) USING BTREE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=217 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='流程发起人';
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for bmp_oa_leave
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `bmp_oa_leave`;
|
||||
CREATE TABLE `bmp_oa_leave` (
|
||||
`id` bigint NOT NULL COMMENT '请假表单主键',
|
||||
`username` varchar(255) COLLATE utf8mb4_general_ci NOT NULL COMMENT '申请人',
|
||||
`leave_type` int NOT NULL COMMENT '请假类型',
|
||||
`leave_reason` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '请假原因',
|
||||
`start_time` datetime NOT NULL COMMENT '开始时间',
|
||||
`end_time` datetime NOT NULL COMMENT '结束时间',
|
||||
`leave_day` int NOT NULL COMMENT '请假天数',
|
||||
`leave_status` int DEFAULT NULL COMMENT '请假结果',
|
||||
`process_instance_id` varchar(64) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '流程实例的编号',
|
||||
`create_by` varchar(64) COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '创建者',
|
||||
`create_time` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) COMMENT '创建时间',
|
||||
`update_by` varchar(64) COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '更新者',
|
||||
`update_time` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6) COMMENT '更新时间',
|
||||
`del_flag` char(1) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '0' COMMENT '是否删除',
|
||||
`tenant_id` bigint NOT NULL DEFAULT '0' COMMENT '租户编号',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='请假表单';
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for flow_draft
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `flow_draft`;
|
||||
CREATE TABLE `flow_draft` (
|
||||
`id` varchar(36) COLLATE utf8mb4_general_ci NOT NULL COMMENT '草稿ID',
|
||||
`tenant_id` bigint NOT NULL COMMENT '所属租户ID',
|
||||
`user_id` bigint NOT NULL COMMENT '草稿所属用户ID',
|
||||
`kind` varchar(16) COLLATE utf8mb4_general_ci NOT NULL COMMENT '草稿类型:DESIGN 流程设计,APPLICATION 申请',
|
||||
`flow_id` varchar(64) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '关联流程ID,未建立流程时为空串',
|
||||
`title` varchar(200) COLLATE utf8mb4_general_ci NOT NULL COMMENT '草稿标题',
|
||||
`payload` longtext COLLATE utf8mb4_general_ci NOT NULL COMMENT '草稿内容 JSON,最多 1 MB',
|
||||
`revision` bigint NOT NULL COMMENT '乐观锁版本号',
|
||||
`updated_at` timestamp(3) NOT NULL COMMENT '最后保存时间',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_draft_owner` (`tenant_id`,`user_id`,`kind`,`updated_at`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='个人流程草稿';
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for flow_notice
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `flow_notice`;
|
||||
CREATE TABLE `flow_notice` (
|
||||
`id` varchar(36) COLLATE utf8mb4_general_ci NOT NULL COMMENT '通知事件ID',
|
||||
`tenant_id` bigint NOT NULL COMMENT '所属租户ID',
|
||||
`user_id` varchar(64) COLLATE utf8mb4_general_ci NOT NULL COMMENT '接收人ID,超时提醒到期前为空串',
|
||||
`event_key` varchar(180) COLLATE utf8mb4_general_ci NOT NULL COMMENT '事件去重键',
|
||||
`kind` varchar(16) COLLATE utf8mb4_general_ci NOT NULL COMMENT '通知类型:TODO 待办,URGE 催办,OVERDUE 超时提醒',
|
||||
`title` varchar(200) COLLATE utf8mb4_general_ci NOT NULL COMMENT '通知标题',
|
||||
`task_id` varchar(64) COLLATE utf8mb4_general_ci NOT NULL COMMENT '引擎任务ID',
|
||||
`instance_id` varchar(64) COLLATE utf8mb4_general_ci NOT NULL COMMENT '引擎流程实例ID',
|
||||
`created_at` timestamp(3) NOT NULL COMMENT '创建时间',
|
||||
`status` varchar(16) COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'SENT' COMMENT '状态:PENDING 待到期,READY 待投递,SENT 已投递,REMOVING 待撤销,CANCELLED 已取消,DISABLED 已停用',
|
||||
`scheduled_at` timestamp(3) NULL DEFAULT NULL COMMENT '计划投递或到期时间',
|
||||
`sent_at` timestamp(3) NULL DEFAULT NULL COMMENT '投递到统一站内信的时间',
|
||||
`reminder_key` varchar(64) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '超时提醒任务ID,每个任务最多一条',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `uk_notice_event` (`tenant_id`,`user_id`,`event_key`),
|
||||
UNIQUE KEY `uk_notice_reminder` (`tenant_id`,`reminder_key`),
|
||||
KEY `idx_notice_owner` (`tenant_id`,`user_id`,`created_at`),
|
||||
KEY `idx_notice_due` (`status`,`scheduled_at`),
|
||||
KEY `idx_notice_task` (`tenant_id`,`task_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='流程通知事件';
|
||||
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
+339
-220
@@ -1,320 +1,439 @@
|
||||
/*
|
||||
my.cnf 设置数据库表名小写
|
||||
--lower_case_table_names=1
|
||||
*/
|
||||
USE pigxx_job;
|
||||
|
||||
SET NAMES utf8;
|
||||
SET NAMES utf8mb4;
|
||||
SET FOREIGN_KEY_CHECKS = 0;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for `job_execution_log`
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `job_execution_log`;
|
||||
CREATE TABLE `job_execution_log` (
|
||||
`id` varchar(40) NOT NULL,
|
||||
`job_name` varchar(100) NOT NULL,
|
||||
`task_id` varchar(255) NOT NULL,
|
||||
`hostname` varchar(255) NOT NULL,
|
||||
`ip` varchar(50) NOT NULL,
|
||||
`sharding_item` int(11) NOT NULL,
|
||||
`execution_source` varchar(20) NOT NULL,
|
||||
`failure_cause` varchar(4000) DEFAULT NULL,
|
||||
`is_success` int(11) NOT NULL,
|
||||
`start_time` timestamp NULL DEFAULT NULL,
|
||||
`complete_time` timestamp NULL DEFAULT NULL,
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='任务日志表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for `job_status_trace_log`
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `job_status_trace_log`;
|
||||
CREATE TABLE `job_status_trace_log` (
|
||||
`id` varchar(40) NOT NULL,
|
||||
`job_name` varchar(100) NOT NULL,
|
||||
`original_task_id` varchar(255) NOT NULL,
|
||||
`task_id` varchar(255) NOT NULL,
|
||||
`slave_id` varchar(50) NOT NULL,
|
||||
`source` varchar(50) NOT NULL,
|
||||
`execution_type` varchar(20) NOT NULL,
|
||||
`sharding_item` varchar(100) NOT NULL,
|
||||
`state` varchar(20) NOT NULL,
|
||||
`message` varchar(4000) DEFAULT NULL,
|
||||
`creation_time` timestamp NULL DEFAULT NULL,
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
KEY `TASK_ID_STATE_INDEX` (`task_id`,`state`) USING BTREE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='任务轨迹表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for `qrtz_blob_triggers`
|
||||
-- Table structure for qrtz_blob_triggers
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `qrtz_blob_triggers`;
|
||||
CREATE TABLE `qrtz_blob_triggers` (
|
||||
`sched_name` varchar(120) NOT NULL,
|
||||
`trigger_name` varchar(200) NOT NULL,
|
||||
`trigger_group` varchar(200) NOT NULL,
|
||||
`blob_data` blob,
|
||||
PRIMARY KEY (`sched_name`,`trigger_name`,`trigger_group`) USING BTREE,
|
||||
CONSTRAINT `qrtz_blob_triggers_ibfk_1` FOREIGN KEY (`sched_name`, `trigger_name`, `trigger_group`) REFERENCES `qrtz_triggers` (`sched_name`, `trigger_name`, `trigger_group`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
|
||||
`sched_name` varchar(120) CHARACTER SET utf8mb4 NOT NULL,
|
||||
`trigger_name` varchar(200) CHARACTER SET utf8mb4 NOT NULL,
|
||||
`trigger_group` varchar(200) CHARACTER SET utf8mb4 NOT NULL,
|
||||
`blob_data` blob,
|
||||
PRIMARY KEY (`sched_name`,`trigger_name`,`trigger_group`) USING BTREE,
|
||||
CONSTRAINT `qrtz_blob_triggers_ibfk_1` FOREIGN KEY (`sched_name`, `trigger_name`, `trigger_group`) REFERENCES `qrtz_triggers` (`sched_name`, `trigger_name`, `trigger_group`) ON DELETE RESTRICT ON UPDATE RESTRICT
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for `qrtz_calendars`
|
||||
-- Records of qrtz_blob_triggers
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for qrtz_calendars
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `qrtz_calendars`;
|
||||
CREATE TABLE `qrtz_calendars` (
|
||||
`sched_name` varchar(120) NOT NULL,
|
||||
`calendar_name` varchar(200) NOT NULL,
|
||||
`calendar` blob NOT NULL,
|
||||
PRIMARY KEY (`sched_name`,`calendar_name`) USING BTREE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
|
||||
`sched_name` varchar(120) CHARACTER SET utf8mb4 NOT NULL,
|
||||
`calendar_name` varchar(200) CHARACTER SET utf8mb4 NOT NULL,
|
||||
`calendar` blob NOT NULL,
|
||||
PRIMARY KEY (`sched_name`,`calendar_name`) USING BTREE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for `qrtz_cron_triggers`
|
||||
-- Records of qrtz_calendars
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for qrtz_cron_triggers
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `qrtz_cron_triggers`;
|
||||
CREATE TABLE `qrtz_cron_triggers` (
|
||||
`sched_name` varchar(120) NOT NULL,
|
||||
`trigger_name` varchar(200) NOT NULL,
|
||||
`trigger_group` varchar(200) NOT NULL,
|
||||
`cron_expression` varchar(200) NOT NULL,
|
||||
`time_zone_id` varchar(80) DEFAULT NULL,
|
||||
PRIMARY KEY (`sched_name`,`trigger_name`,`trigger_group`) USING BTREE,
|
||||
CONSTRAINT `qrtz_cron_triggers_ibfk_1` FOREIGN KEY (`sched_name`, `trigger_name`, `trigger_group`) REFERENCES `qrtz_triggers` (`sched_name`, `trigger_name`, `trigger_group`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
|
||||
`sched_name` varchar(120) CHARACTER SET utf8mb4 NOT NULL,
|
||||
`trigger_name` varchar(200) CHARACTER SET utf8mb4 NOT NULL,
|
||||
`trigger_group` varchar(200) CHARACTER SET utf8mb4 NOT NULL,
|
||||
`cron_expression` varchar(200) CHARACTER SET utf8mb4 NOT NULL,
|
||||
`time_zone_id` varchar(80) CHARACTER SET utf8mb4 DEFAULT NULL,
|
||||
PRIMARY KEY (`sched_name`,`trigger_name`,`trigger_group`) USING BTREE,
|
||||
CONSTRAINT `qrtz_cron_triggers_ibfk_1` FOREIGN KEY (`sched_name`, `trigger_name`, `trigger_group`) REFERENCES `qrtz_triggers` (`sched_name`, `trigger_name`, `trigger_group`) ON DELETE RESTRICT ON UPDATE RESTRICT
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of `qrtz_cron_triggers`
|
||||
-- Records of qrtz_cron_triggers
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `qrtz_cron_triggers` VALUES ('clusteredScheduler', '测试任务', 'demo', '0 * * * * ? *', 'Asia/Shanghai');
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for `qrtz_fired_triggers`
|
||||
-- Table structure for qrtz_fired_triggers
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `qrtz_fired_triggers`;
|
||||
CREATE TABLE `qrtz_fired_triggers` (
|
||||
`sched_name` varchar(120) NOT NULL,
|
||||
`entry_id` varchar(95) NOT NULL,
|
||||
`trigger_name` varchar(200) NOT NULL,
|
||||
`trigger_group` varchar(200) NOT NULL,
|
||||
`instance_name` varchar(200) NOT NULL,
|
||||
`fired_time` bigint(13) NOT NULL,
|
||||
`sched_time` bigint(13) NOT NULL,
|
||||
`priority` int(11) NOT NULL,
|
||||
`state` varchar(16) NOT NULL,
|
||||
`job_name` varchar(200) DEFAULT NULL,
|
||||
`job_group` varchar(200) DEFAULT NULL,
|
||||
`is_nonconcurrent` varchar(1) DEFAULT NULL,
|
||||
`requests_recovery` varchar(1) DEFAULT NULL,
|
||||
PRIMARY KEY (`sched_name`,`entry_id`) USING BTREE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
|
||||
`sched_name` varchar(120) CHARACTER SET utf8mb4 NOT NULL,
|
||||
`entry_id` varchar(95) CHARACTER SET utf8mb4 NOT NULL,
|
||||
`trigger_name` varchar(200) CHARACTER SET utf8mb4 NOT NULL,
|
||||
`trigger_group` varchar(200) CHARACTER SET utf8mb4 NOT NULL,
|
||||
`instance_name` varchar(200) CHARACTER SET utf8mb4 NOT NULL,
|
||||
`fired_time` bigint NOT NULL,
|
||||
`sched_time` bigint NOT NULL,
|
||||
`priority` int NOT NULL,
|
||||
`state` varchar(16) CHARACTER SET utf8mb4 NOT NULL,
|
||||
`job_name` varchar(200) CHARACTER SET utf8mb4 DEFAULT NULL,
|
||||
`job_group` varchar(200) CHARACTER SET utf8mb4 DEFAULT NULL,
|
||||
`is_nonconcurrent` varchar(1) CHARACTER SET utf8mb4 DEFAULT NULL,
|
||||
`requests_recovery` varchar(1) CHARACTER SET utf8mb4 DEFAULT NULL,
|
||||
PRIMARY KEY (`sched_name`,`entry_id`) USING BTREE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for `qrtz_job_details`
|
||||
-- Records of qrtz_fired_triggers
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for qrtz_job_details
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `qrtz_job_details`;
|
||||
CREATE TABLE `qrtz_job_details` (
|
||||
`sched_name` varchar(120) NOT NULL,
|
||||
`job_name` varchar(200) NOT NULL,
|
||||
`job_group` varchar(200) NOT NULL,
|
||||
`description` varchar(250) DEFAULT NULL,
|
||||
`job_class_name` varchar(250) NOT NULL,
|
||||
`is_durable` varchar(1) NOT NULL,
|
||||
`is_nonconcurrent` varchar(1) NOT NULL,
|
||||
`is_update_data` varchar(1) NOT NULL,
|
||||
`requests_recovery` varchar(1) NOT NULL,
|
||||
`job_data` blob,
|
||||
PRIMARY KEY (`sched_name`,`job_name`,`job_group`) USING BTREE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
|
||||
`sched_name` varchar(120) CHARACTER SET utf8mb4 NOT NULL,
|
||||
`job_name` varchar(200) CHARACTER SET utf8mb4 NOT NULL,
|
||||
`job_group` varchar(200) CHARACTER SET utf8mb4 NOT NULL,
|
||||
`description` varchar(250) CHARACTER SET utf8mb4 DEFAULT NULL,
|
||||
`job_class_name` varchar(250) CHARACTER SET utf8mb4 NOT NULL,
|
||||
`is_durable` varchar(1) CHARACTER SET utf8mb4 NOT NULL,
|
||||
`is_nonconcurrent` varchar(1) CHARACTER SET utf8mb4 NOT NULL,
|
||||
`is_update_data` varchar(1) CHARACTER SET utf8mb4 NOT NULL,
|
||||
`requests_recovery` varchar(1) CHARACTER SET utf8mb4 NOT NULL,
|
||||
`job_data` blob,
|
||||
PRIMARY KEY (`sched_name`,`job_name`,`job_group`) USING BTREE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of `qrtz_job_details`
|
||||
-- Records of qrtz_job_details
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `qrtz_job_details` VALUES ('clusteredScheduler', '测试任务', 'demo', null, 'com.pig4cloud.pigx.daemon.quartz.config.PigxQuartzFactory', '0', '1', '0', '0', 0xaced0005737200156f72672e71756172747a2e4a6f62446174614d61709fb083e8bfa9b0cb020000787200266f72672e71756172747a2e7574696c732e537472696e674b65794469727479466c61674d61708208e8c3fbc55d280200015a0013616c6c6f77735472616e7369656e74446174617872001d6f72672e71756172747a2e7574696c732e4469727479466c61674d617013e62ead28760ace0200025a000564697274794c00036d617074000f4c6a6176612f7574696c2f4d61703b787001737200116a6176612e7574696c2e486173684d61700507dac1c31660d103000246000a6c6f6164466163746f724900097468726573686f6c6478703f4000000000000c7708000000100000000174000b7363686564756c654a6f627372002e636f6d2e70696734636c6f75642e706967782e6461656d6f6e2e71756172747a2e656e746974792e5379734a6f6200000000000000010200174c0009636c6173734e616d657400124c6a6176612f6c616e672f537472696e673b4c0008637265617465427971007e00094c000a63726561746554696d657400194c6a6176612f74696d652f4c6f63616c4461746554696d653b4c000e63726f6e45787072657373696f6e71007e00094c000b657865637574655061746871007e00094c00106a6f624578656375746553746174757371007e00094c00086a6f6247726f757071007e00094c00056a6f6249647400134c6a6176612f6c616e672f496e74656765723b4c00076a6f624e616d6571007e00094c00086a6f624f7264657271007e00094c00096a6f6253746174757371007e00094c000d6a6f6254656e616e745479706571007e00094c00076a6f625479706571007e00094c000a6d6574686f644e616d6571007e00094c00116d6574686f64506172616d7356616c756571007e00094c000d6d697366697265506f6c69637971007e00094c00086e65787454696d6571007e000a4c000c70726576696f757354696d6571007e000a4c000672656d61726b71007e00094c0009737461727454696d6571007e000a4c000874656e616e74496471007e000b4c0008757064617465427971007e00094c000a75706461746554696d6571007e000a78720035636f6d2e62616f6d69646f752e6d796261746973706c75732e657874656e73696f6e2e6163746976657265636f72642e4d6f64656c0000000000000001020000787074000464656d6f74000561646d696e7372000d6a6176612e74696d652e536572955d84ba1b2248b20c00007870770a05000007e303190e00f17874000d30202a202a202a202a203f202a7400007400013074000464656d6f737200116a6176612e6c616e672e496e746567657212e2a0a4f781873802000149000576616c7565787200106a6176612e6c616e672e4e756d62657286ac951d0b94e08b02000078700000000174000ce6b58be8af95e4bbbbe58aa17400013574000133740001317400013274000a64656d6f4d6574686f6474000970696734636c6f7564740001337371007e0010770905000007e3031916e2787371007e0010770a05000007e30319161ccd78740020e6bc94e7a4ba537072696e67204265616ee79a84e5ae9ae697b6e4bbbbe58aa17371007e0010770a05000007e303191600de7871007e001874000561646d696e7371007e0010770a05000007e303190e00f1787800);
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for `qrtz_locks`
|
||||
-- Table structure for qrtz_locks
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `qrtz_locks`;
|
||||
CREATE TABLE `qrtz_locks` (
|
||||
`sched_name` varchar(120) NOT NULL,
|
||||
`lock_name` varchar(40) NOT NULL,
|
||||
PRIMARY KEY (`sched_name`,`lock_name`) USING BTREE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
|
||||
`sched_name` varchar(120) CHARACTER SET utf8mb4 NOT NULL,
|
||||
`lock_name` varchar(40) CHARACTER SET utf8mb4 NOT NULL,
|
||||
PRIMARY KEY (`sched_name`,`lock_name`) USING BTREE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of `qrtz_locks`
|
||||
-- Records of qrtz_locks
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `qrtz_locks` VALUES ('clusteredScheduler', 'STATE_ACCESS'), ('clusteredScheduler', 'TRIGGER_ACCESS');
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for `qrtz_paused_trigger_grps`
|
||||
-- Table structure for qrtz_paused_trigger_grps
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `qrtz_paused_trigger_grps`;
|
||||
CREATE TABLE `qrtz_paused_trigger_grps` (
|
||||
`sched_name` varchar(120) NOT NULL,
|
||||
`trigger_group` varchar(200) NOT NULL,
|
||||
PRIMARY KEY (`sched_name`,`trigger_group`) USING BTREE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
|
||||
`sched_name` varchar(120) CHARACTER SET utf8mb4 NOT NULL,
|
||||
`trigger_group` varchar(200) CHARACTER SET utf8mb4 NOT NULL,
|
||||
PRIMARY KEY (`sched_name`,`trigger_group`) USING BTREE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for `qrtz_scheduler_state`
|
||||
-- Records of qrtz_paused_trigger_grps
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for qrtz_scheduler_state
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `qrtz_scheduler_state`;
|
||||
CREATE TABLE `qrtz_scheduler_state` (
|
||||
`sched_name` varchar(120) NOT NULL,
|
||||
`instance_name` varchar(200) NOT NULL,
|
||||
`last_checkin_time` bigint(13) NOT NULL,
|
||||
`checkin_interval` bigint(13) NOT NULL,
|
||||
PRIMARY KEY (`sched_name`,`instance_name`) USING BTREE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
|
||||
`sched_name` varchar(120) CHARACTER SET utf8mb4 NOT NULL,
|
||||
`instance_name` varchar(200) CHARACTER SET utf8mb4 NOT NULL,
|
||||
`last_checkin_time` bigint NOT NULL,
|
||||
`checkin_interval` bigint NOT NULL,
|
||||
PRIMARY KEY (`sched_name`,`instance_name`) USING BTREE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of `qrtz_scheduler_state`
|
||||
-- Records of qrtz_scheduler_state
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `qrtz_scheduler_state` VALUES ('clusteredScheduler', 'lengleng1553564320591', '1553568907589', '10000');
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for `qrtz_simple_triggers`
|
||||
-- Table structure for qrtz_simple_triggers
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `qrtz_simple_triggers`;
|
||||
CREATE TABLE `qrtz_simple_triggers` (
|
||||
`sched_name` varchar(120) NOT NULL,
|
||||
`trigger_name` varchar(200) NOT NULL,
|
||||
`trigger_group` varchar(200) NOT NULL,
|
||||
`repeat_count` bigint(7) NOT NULL,
|
||||
`repeat_interval` bigint(12) NOT NULL,
|
||||
`times_triggered` bigint(10) NOT NULL,
|
||||
PRIMARY KEY (`sched_name`,`trigger_name`,`trigger_group`) USING BTREE,
|
||||
CONSTRAINT `QRTZ_SIMPLE_TRIGGERS_IBFK_1` FOREIGN KEY (`sched_name`, `trigger_name`, `trigger_group`) REFERENCES `qrtz_triggers` (`sched_name`, `trigger_name`, `trigger_group`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
|
||||
`sched_name` varchar(120) CHARACTER SET utf8mb4 NOT NULL,
|
||||
`trigger_name` varchar(200) CHARACTER SET utf8mb4 NOT NULL,
|
||||
`trigger_group` varchar(200) CHARACTER SET utf8mb4 NOT NULL,
|
||||
`repeat_count` bigint NOT NULL,
|
||||
`repeat_interval` bigint NOT NULL,
|
||||
`times_triggered` bigint NOT NULL,
|
||||
PRIMARY KEY (`sched_name`,`trigger_name`,`trigger_group`) USING BTREE,
|
||||
CONSTRAINT `QRTZ_SIMPLE_TRIGGERS_IBFK_1` FOREIGN KEY (`sched_name`, `trigger_name`, `trigger_group`) REFERENCES `qrtz_triggers` (`sched_name`, `trigger_name`, `trigger_group`) ON DELETE RESTRICT ON UPDATE RESTRICT
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for `qrtz_simprop_triggers`
|
||||
-- Records of qrtz_simple_triggers
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for qrtz_simprop_triggers
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `qrtz_simprop_triggers`;
|
||||
CREATE TABLE `qrtz_simprop_triggers` (
|
||||
`sched_name` varchar(120) NOT NULL,
|
||||
`trigger_name` varchar(200) NOT NULL,
|
||||
`trigger_group` varchar(200) NOT NULL,
|
||||
`str_prop_1` varchar(512) DEFAULT NULL,
|
||||
`str_prop_2` varchar(512) DEFAULT NULL,
|
||||
`str_prop_3` varchar(512) DEFAULT NULL,
|
||||
`int_prop_1` int(11) DEFAULT NULL,
|
||||
`int_prop_2` int(11) DEFAULT NULL,
|
||||
`long_prop_1` bigint(20) DEFAULT NULL,
|
||||
`long_prop_2` bigint(20) DEFAULT NULL,
|
||||
`dec_prop_1` decimal(13,4) DEFAULT NULL,
|
||||
`dec_prop_2` decimal(13,4) DEFAULT NULL,
|
||||
`bool_prop_1` varchar(1) DEFAULT NULL,
|
||||
`bool_prop_2` varchar(1) DEFAULT NULL,
|
||||
PRIMARY KEY (`sched_name`,`trigger_name`,`trigger_group`) USING BTREE,
|
||||
CONSTRAINT `QRTZ_SIMPROP_TRIGGERS_IBFK_1` FOREIGN KEY (`sched_name`, `trigger_name`, `trigger_group`) REFERENCES `qrtz_triggers` (`sched_name`, `trigger_name`, `trigger_group`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
|
||||
`sched_name` varchar(120) CHARACTER SET utf8mb4 NOT NULL,
|
||||
`trigger_name` varchar(200) CHARACTER SET utf8mb4 NOT NULL,
|
||||
`trigger_group` varchar(200) CHARACTER SET utf8mb4 NOT NULL,
|
||||
`str_prop_1` varchar(512) CHARACTER SET utf8mb4 DEFAULT NULL,
|
||||
`str_prop_2` varchar(512) CHARACTER SET utf8mb4 DEFAULT NULL,
|
||||
`str_prop_3` varchar(512) CHARACTER SET utf8mb4 DEFAULT NULL,
|
||||
`int_prop_1` int DEFAULT NULL,
|
||||
`int_prop_2` int DEFAULT NULL,
|
||||
`long_prop_1` bigint DEFAULT NULL,
|
||||
`long_prop_2` bigint DEFAULT NULL,
|
||||
`dec_prop_1` decimal(13,4) DEFAULT NULL,
|
||||
`dec_prop_2` decimal(13,4) DEFAULT NULL,
|
||||
`bool_prop_1` varchar(1) CHARACTER SET utf8mb4 DEFAULT NULL,
|
||||
`bool_prop_2` varchar(1) CHARACTER SET utf8mb4 DEFAULT NULL,
|
||||
PRIMARY KEY (`sched_name`,`trigger_name`,`trigger_group`) USING BTREE,
|
||||
CONSTRAINT `QRTZ_SIMPROP_TRIGGERS_IBFK_1` FOREIGN KEY (`sched_name`, `trigger_name`, `trigger_group`) REFERENCES `qrtz_triggers` (`sched_name`, `trigger_name`, `trigger_group`) ON DELETE RESTRICT ON UPDATE RESTRICT
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for `qrtz_triggers`
|
||||
-- Records of qrtz_simprop_triggers
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for qrtz_triggers
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `qrtz_triggers`;
|
||||
CREATE TABLE `qrtz_triggers` (
|
||||
`sched_name` varchar(120) NOT NULL,
|
||||
`trigger_name` varchar(200) NOT NULL,
|
||||
`trigger_group` varchar(200) NOT NULL,
|
||||
`job_name` varchar(200) NOT NULL,
|
||||
`job_group` varchar(200) NOT NULL,
|
||||
`description` varchar(250) DEFAULT NULL,
|
||||
`next_fire_time` bigint(13) DEFAULT NULL,
|
||||
`prev_fire_time` bigint(13) DEFAULT NULL,
|
||||
`priority` int(11) DEFAULT NULL,
|
||||
`trigger_state` varchar(16) NOT NULL,
|
||||
`trigger_type` varchar(8) NOT NULL,
|
||||
`start_time` bigint(13) NOT NULL,
|
||||
`end_time` bigint(13) DEFAULT NULL,
|
||||
`calendar_name` varchar(200) DEFAULT NULL,
|
||||
`misfire_instr` smallint(2) DEFAULT NULL,
|
||||
`job_data` blob,
|
||||
PRIMARY KEY (`sched_name`,`trigger_name`,`trigger_group`) USING BTREE,
|
||||
KEY `sched_name` (`sched_name`,`job_name`,`job_group`) USING BTREE,
|
||||
CONSTRAINT `qrtz_triggers_ibfk_1` FOREIGN KEY (`sched_name`, `job_name`, `job_group`) REFERENCES `qrtz_job_details` (`sched_name`, `job_name`, `job_group`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
|
||||
`sched_name` varchar(120) CHARACTER SET utf8mb4 NOT NULL,
|
||||
`trigger_name` varchar(200) CHARACTER SET utf8mb4 NOT NULL,
|
||||
`trigger_group` varchar(200) CHARACTER SET utf8mb4 NOT NULL,
|
||||
`job_name` varchar(200) CHARACTER SET utf8mb4 NOT NULL,
|
||||
`job_group` varchar(200) CHARACTER SET utf8mb4 NOT NULL,
|
||||
`description` varchar(250) CHARACTER SET utf8mb4 DEFAULT NULL,
|
||||
`next_fire_time` bigint DEFAULT NULL,
|
||||
`prev_fire_time` bigint DEFAULT NULL,
|
||||
`priority` int DEFAULT NULL,
|
||||
`trigger_state` varchar(16) CHARACTER SET utf8mb4 NOT NULL,
|
||||
`trigger_type` varchar(8) CHARACTER SET utf8mb4 NOT NULL,
|
||||
`start_time` bigint NOT NULL,
|
||||
`end_time` bigint DEFAULT NULL,
|
||||
`calendar_name` varchar(200) CHARACTER SET utf8mb4 DEFAULT NULL,
|
||||
`misfire_instr` smallint DEFAULT NULL,
|
||||
`job_data` blob,
|
||||
PRIMARY KEY (`sched_name`,`trigger_name`,`trigger_group`) USING BTREE,
|
||||
KEY `sched_name` (`sched_name`,`job_name`,`job_group`) USING BTREE,
|
||||
CONSTRAINT `qrtz_triggers_ibfk_1` FOREIGN KEY (`sched_name`, `job_name`, `job_group`) REFERENCES `qrtz_job_details` (`sched_name`, `job_name`, `job_group`) ON DELETE RESTRICT ON UPDATE RESTRICT
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of `qrtz_triggers`
|
||||
-- Records of qrtz_triggers
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `qrtz_triggers` VALUES ('clusteredScheduler', '测试任务', 'demo', '测试任务', 'demo', null, '1553568960000', '1553568900000', '5', 'WAITING', 'CRON', '1553564598000', '0', null, '2', '');
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for `sys_job`
|
||||
-- Table structure for sys_job
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `sys_job`;
|
||||
CREATE TABLE `sys_job` (
|
||||
`job_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '任务id',
|
||||
`job_name` varchar(64) NOT NULL COMMENT '任务名称',
|
||||
`job_group` varchar(64) NOT NULL COMMENT '任务组名',
|
||||
`job_order` char(1) DEFAULT NULL COMMENT '组内执行顺利,值越大执行优先级越高,最大值9,最小值1',
|
||||
`job_type` char(1) NOT NULL DEFAULT '1' COMMENT '1、java类;2、spring bean名称;3、rest调用;4、jar调用;9其他',
|
||||
`execute_path` varchar(500) DEFAULT NULL COMMENT 'job_type=3时,rest调用地址,仅支持rest get协议,需要增加String返回值,0成功,1失败;job_type=4时,jar路径;其它值为空',
|
||||
`class_name` varchar(500) DEFAULT NULL COMMENT 'job_type=1时,类完整路径;job_type=2时,spring bean名称;其它值为空',
|
||||
`method_name` varchar(500) DEFAULT NULL COMMENT '任务方法',
|
||||
`method_params_value` varchar(2000) DEFAULT NULL COMMENT '参数值',
|
||||
`cron_expression` varchar(255) DEFAULT NULL COMMENT 'cron执行表达式',
|
||||
`misfire_policy` varchar(20) DEFAULT '3' COMMENT '错失执行策略(1错失周期立即执行 2错失周期执行一次 3下周期执行)',
|
||||
`job_tenant_type` char(1) DEFAULT '1' COMMENT '1、多租户任务;2、非多租户任务',
|
||||
`job_status` char(1) DEFAULT '0' COMMENT '状态(1、未发布;2、运行中;3、暂停;4、删除;)',
|
||||
`job_execute_status` char(1) DEFAULT '0' COMMENT '状态(0正常 1异常)',
|
||||
`create_by` varchar(64) DEFAULT NULL COMMENT '创建者',
|
||||
`create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`update_by` varchar(64) DEFAULT '' COMMENT '更新者',
|
||||
`update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||
`start_time` timestamp NULL DEFAULT NULL COMMENT '初次执行时间',
|
||||
`previous_time` timestamp NULL DEFAULT NULL COMMENT '上次执行时间',
|
||||
`next_time` timestamp NULL DEFAULT NULL COMMENT '下次执行时间',
|
||||
`tenant_id` int(11) DEFAULT '1' COMMENT '租户',
|
||||
`remark` varchar(500) DEFAULT '' COMMENT '备注信息',
|
||||
PRIMARY KEY (`job_id`,`job_name`,`job_group`) USING BTREE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='定时任务调度表';
|
||||
`job_id` bigint NOT NULL COMMENT '任务id',
|
||||
`job_name` varchar(64) CHARACTER SET utf8mb4 NOT NULL COMMENT '任务名称',
|
||||
`job_group` varchar(64) CHARACTER SET utf8mb4 NOT NULL COMMENT '任务组名',
|
||||
`job_order` char(1) CHARACTER SET utf8mb4 DEFAULT '1' COMMENT '组内执行顺利,值越大执行优先级越高,最大值9,最小值1',
|
||||
`job_type` char(1) CHARACTER SET utf8mb4 NOT NULL DEFAULT '1' COMMENT '1、java类;2、spring bean名称;3、rest调用;4、jar调用;9其他',
|
||||
`execute_path` varchar(500) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT 'job_type=3时,rest调用地址,仅支持rest get协议,需要增加String返回值,0成功,1失败;job_type=4时,jar路径;其它值为空',
|
||||
`class_name` varchar(500) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT 'job_type=1时,类完整路径;job_type=2时,spring bean名称;其它值为空',
|
||||
`method_name` varchar(500) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '任务方法',
|
||||
`method_params_value` varchar(2000) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '参数值',
|
||||
`cron_expression` varchar(255) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT 'cron执行表达式',
|
||||
`misfire_policy` varchar(20) CHARACTER SET utf8mb4 DEFAULT '3' COMMENT '错失执行策略(1错失周期立即执行 2错失周期执行一次 3下周期执行)',
|
||||
`job_tenant_type` char(1) CHARACTER SET utf8mb4 DEFAULT '1' COMMENT '1、多租户任务;2、非多租户任务',
|
||||
`job_status` char(1) CHARACTER SET utf8mb4 DEFAULT '0' COMMENT '状态(1、未发布;2、运行中;3、暂停;4、删除;)',
|
||||
`job_execute_status` char(1) CHARACTER SET utf8mb4 DEFAULT '0' COMMENT '状态(0正常 1异常)',
|
||||
`create_by` varchar(64) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '创建者',
|
||||
`create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`update_by` varchar(64) CHARACTER SET utf8mb4 DEFAULT '' COMMENT '更新者',
|
||||
`update_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||
`start_time` timestamp NULL DEFAULT NULL COMMENT '初次执行时间',
|
||||
`previous_time` timestamp NULL DEFAULT NULL COMMENT '上次执行时间',
|
||||
`next_time` timestamp NULL DEFAULT NULL COMMENT '下次执行时间',
|
||||
`tenant_id` bigint DEFAULT '1' COMMENT '租户',
|
||||
`remark` varchar(500) CHARACTER SET utf8mb4 DEFAULT '' COMMENT '备注信息',
|
||||
PRIMARY KEY (`job_id`,`job_name`,`job_group`) USING BTREE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='定时任务调度表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of `sys_job`
|
||||
-- Records of sys_job
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `sys_job` VALUES ('1', '测试任务', 'demo', '5', '2', '', 'demo', 'demoMethod', 'pig4cloud', '0 * * * * ? *', '3', '1', '2', '0', 'admin', '2019-03-25 14:00:14', 'admin', '2019-03-25 14:00:14', '2019-03-26 09:43:18', '2019-03-26 10:55:00', '2019-03-26 10:56:00', '1', '演示Spring Bean的定时任务');
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for `sys_job_log`
|
||||
-- Table structure for sys_job_log
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `sys_job_log`;
|
||||
CREATE TABLE `sys_job_log` (
|
||||
`job_log_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '任务日志ID',
|
||||
`job_id` int(11) NOT NULL COMMENT '任务id',
|
||||
`job_name` varchar(64) DEFAULT NULL COMMENT '任务名称',
|
||||
`job_group` varchar(64) DEFAULT NULL COMMENT '任务组名',
|
||||
`job_order` char(1) DEFAULT NULL COMMENT '组内执行顺利,值越大执行优先级越高,最大值9,最小值1',
|
||||
`job_type` char(1) NOT NULL DEFAULT '1' COMMENT '1、java类;2、spring bean名称;3、rest调用;4、jar调用;9其他',
|
||||
`execute_path` varchar(500) DEFAULT NULL COMMENT 'job_type=3时,rest调用地址,仅支持post协议;job_type=4时,jar路径;其它值为空',
|
||||
`class_name` varchar(500) DEFAULT NULL COMMENT 'job_type=1时,类完整路径;job_type=2时,spring bean名称;其它值为空',
|
||||
`method_name` varchar(500) DEFAULT NULL COMMENT '任务方法',
|
||||
`method_params_value` varchar(2000) DEFAULT NULL COMMENT '参数值',
|
||||
`cron_expression` varchar(255) DEFAULT NULL COMMENT 'cron执行表达式',
|
||||
`job_message` varchar(500) DEFAULT NULL COMMENT '日志信息',
|
||||
`job_log_status` char(1) DEFAULT '0' COMMENT '执行状态(0正常 1失败)',
|
||||
`execute_time` varchar(30) DEFAULT NULL COMMENT '执行时间',
|
||||
`exception_info` varchar(2000) DEFAULT '' COMMENT '异常信息',
|
||||
`create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`tenant_id` int(11) NOT NULL DEFAULT '1' COMMENT '租户id',
|
||||
PRIMARY KEY (`job_log_id`) USING BTREE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='定时任务执行日志表';
|
||||
`job_log_id` bigint NOT NULL COMMENT '任务日志ID',
|
||||
`job_id` bigint NOT NULL COMMENT '任务id',
|
||||
`job_name` varchar(64) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '任务名称',
|
||||
`job_group` varchar(64) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '任务组名',
|
||||
`job_order` char(1) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '组内执行顺利,值越大执行优先级越高,最大值9,最小值1',
|
||||
`job_type` char(1) CHARACTER SET utf8mb4 NOT NULL DEFAULT '1' COMMENT '1、java类;2、spring bean名称;3、rest调用;4、jar调用;9其他',
|
||||
`execute_path` varchar(500) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT 'job_type=3时,rest调用地址,仅支持post协议;job_type=4时,jar路径;其它值为空',
|
||||
`class_name` varchar(500) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT 'job_type=1时,类完整路径;job_type=2时,spring bean名称;其它值为空',
|
||||
`method_name` varchar(500) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '任务方法',
|
||||
`method_params_value` varchar(2000) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '参数值',
|
||||
`cron_expression` varchar(255) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT 'cron执行表达式',
|
||||
`job_message` varchar(500) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '日志信息',
|
||||
`job_log_status` char(1) CHARACTER SET utf8mb4 DEFAULT '0' COMMENT '执行状态(0正常 1失败)',
|
||||
`execute_time` varchar(30) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '执行时间',
|
||||
`exception_info` varchar(2000) CHARACTER SET utf8mb4 DEFAULT '' COMMENT '异常信息',
|
||||
`scheduled_fire_time` datetime DEFAULT NULL COMMENT '计划触发时间',
|
||||
`fire_instance_id` varchar(128) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT 'Quartz触发实例ID',
|
||||
`dedup_status` char(1) CHARACTER SET utf8mb4 DEFAULT '0' COMMENT '去重状态(0正常执行 1同一触发点重复 2任务运行中跳过)',
|
||||
`create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`tenant_id` bigint NOT NULL DEFAULT '1' COMMENT '租户id',
|
||||
PRIMARY KEY (`job_log_id`) USING BTREE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='定时任务执行日志表';
|
||||
|
||||
CREATE TABLE `xxl_job_group` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`app_name` varchar(64) NOT NULL COMMENT '执行器AppName',
|
||||
`title` varchar(64) NOT NULL COMMENT '执行器名称',
|
||||
`address_type` tinyint(4) NOT NULL DEFAULT '0' COMMENT '执行器地址类型:0=自动注册、1=手动录入',
|
||||
`address_list` text COMMENT '执行器地址列表,多地址逗号分隔',
|
||||
`update_time` datetime DEFAULT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
CREATE TABLE `xxl_job_registry` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`registry_group` varchar(50) NOT NULL,
|
||||
`registry_key` varchar(255) NOT NULL,
|
||||
`registry_value` varchar(255) NOT NULL,
|
||||
`update_time` datetime DEFAULT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `i_g_k_v` (`registry_group`,`registry_key`,`registry_value`) USING BTREE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
CREATE TABLE `xxl_job_info` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`job_group` int(11) NOT NULL COMMENT '执行器主键ID',
|
||||
`job_desc` varchar(255) NOT NULL,
|
||||
`add_time` datetime DEFAULT NULL,
|
||||
`update_time` datetime DEFAULT NULL,
|
||||
`author` varchar(64) DEFAULT NULL COMMENT '作者',
|
||||
`alarm_email` varchar(255) DEFAULT NULL COMMENT '报警邮件',
|
||||
`schedule_type` varchar(50) NOT NULL DEFAULT 'NONE' COMMENT '调度类型',
|
||||
`schedule_conf` varchar(128) DEFAULT NULL COMMENT '调度配置,值含义取决于调度类型',
|
||||
`misfire_strategy` varchar(50) NOT NULL DEFAULT 'DO_NOTHING' COMMENT '调度过期策略',
|
||||
`executor_route_strategy` varchar(50) DEFAULT NULL COMMENT '执行器路由策略',
|
||||
`executor_handler` varchar(255) DEFAULT NULL COMMENT '任务handler',
|
||||
`executor_param` text DEFAULT NULL COMMENT '任务参数',
|
||||
`executor_block_strategy` varchar(50) DEFAULT NULL COMMENT '阻塞处理策略',
|
||||
`executor_timeout` int(11) NOT NULL DEFAULT '0' COMMENT '任务执行超时时间,单位秒',
|
||||
`executor_fail_retry_count` int(11) NOT NULL DEFAULT '0' COMMENT '失败重试次数',
|
||||
`glue_type` varchar(50) NOT NULL COMMENT 'GLUE类型',
|
||||
`glue_source` mediumtext COMMENT 'GLUE源代码',
|
||||
`glue_remark` varchar(128) DEFAULT NULL COMMENT 'GLUE备注',
|
||||
`glue_updatetime` datetime DEFAULT NULL COMMENT 'GLUE更新时间',
|
||||
`child_jobid` varchar(255) DEFAULT NULL COMMENT '子任务ID,多个逗号分隔',
|
||||
`trigger_status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '调度状态:0-停止,1-运行',
|
||||
`trigger_last_time` bigint(13) NOT NULL DEFAULT '0' COMMENT '上次调度时间',
|
||||
`trigger_next_time` bigint(13) NOT NULL DEFAULT '0' COMMENT '下次调度时间',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
CREATE TABLE `xxl_job_logglue` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`job_id` int(11) NOT NULL COMMENT '任务,主键ID',
|
||||
`glue_type` varchar(50) DEFAULT NULL COMMENT 'GLUE类型',
|
||||
`glue_source` mediumtext COMMENT 'GLUE源代码',
|
||||
`glue_remark` varchar(128) NOT NULL COMMENT 'GLUE备注',
|
||||
`add_time` datetime DEFAULT NULL,
|
||||
`update_time` datetime DEFAULT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
CREATE TABLE `xxl_job_log` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`job_group` int(11) NOT NULL COMMENT '执行器主键ID',
|
||||
`job_id` int(11) NOT NULL COMMENT '任务,主键ID',
|
||||
`executor_address` varchar(255) DEFAULT NULL COMMENT '执行器地址,本次执行的地址',
|
||||
`executor_handler` varchar(255) DEFAULT NULL COMMENT '任务handler',
|
||||
`executor_param` text DEFAULT NULL COMMENT '任务参数',
|
||||
`executor_sharding_param` varchar(20) DEFAULT NULL COMMENT '任务分片参数,格式如 1/2',
|
||||
`executor_fail_retry_count` int(11) NOT NULL DEFAULT '0' COMMENT '失败重试次数',
|
||||
`trigger_time` datetime DEFAULT NULL COMMENT '调度-时间',
|
||||
`trigger_code` int(11) NOT NULL COMMENT '调度-结果',
|
||||
`trigger_msg` text COMMENT '调度-日志',
|
||||
`handle_time` datetime DEFAULT NULL COMMENT '执行-时间',
|
||||
`handle_code` int(11) NOT NULL COMMENT '执行-状态',
|
||||
`handle_msg` text COMMENT '执行-日志',
|
||||
`alarm_status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '告警状态:0-默认、1-无需告警、2-告警成功、3-告警失败',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `I_trigger_time` (`trigger_time`),
|
||||
KEY `I_handle_code` (`handle_code`),
|
||||
KEY `I_jobgroup` (`job_group`),
|
||||
KEY `I_jobid` (`job_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
CREATE TABLE `xxl_job_log_report` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`trigger_day` datetime DEFAULT NULL COMMENT '调度-时间',
|
||||
`running_count` int(11) NOT NULL DEFAULT '0' COMMENT '运行中-日志数量',
|
||||
`suc_count` int(11) NOT NULL DEFAULT '0' COMMENT '执行成功-日志数量',
|
||||
`fail_count` int(11) NOT NULL DEFAULT '0' COMMENT '执行失败-日志数量',
|
||||
`update_time` datetime DEFAULT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `i_trigger_day` (`trigger_day`) USING BTREE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
CREATE TABLE `xxl_job_lock` (
|
||||
`lock_name` varchar(50) NOT NULL COMMENT '锁名称',
|
||||
PRIMARY KEY (`lock_name`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
CREATE TABLE `xxl_job_user` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`username` varchar(50) NOT NULL COMMENT '账号',
|
||||
`password` varchar(100) NOT NULL COMMENT '密码加密信息',
|
||||
`token` varchar(100) DEFAULT NULL COMMENT '登录token',
|
||||
`role` tinyint(4) NOT NULL COMMENT '角色:0-普通用户、1-管理员',
|
||||
`permission` varchar(255) DEFAULT NULL COMMENT '权限:执行器ID列表,多个逗号分割',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `i_username` (`username`) USING BTREE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
INSERT INTO `xxl_job_group`(`id`, `app_name`, `title`, `address_type`, `address_list`, `update_time`)
|
||||
VALUES (1, 'pigx-daemon-elastic-job', 'PIGX定时任务执行器', 0, NULL, now());
|
||||
|
||||
INSERT INTO `xxl_job_info`(`id`, `job_group`, `job_desc`, `add_time`, `update_time`, `author`, `alarm_email`,
|
||||
`schedule_type`, `schedule_conf`, `misfire_strategy`, `executor_route_strategy`,
|
||||
`executor_handler`, `executor_param`, `executor_block_strategy`, `executor_timeout`,
|
||||
`executor_fail_retry_count`, `glue_type`, `glue_source`, `glue_remark`, `glue_updatetime`,
|
||||
`child_jobid`)
|
||||
VALUES (1, 1, '示例任务01', now(), now(), 'XXL', '', 'CRON', '0 0 0 * * ? *',
|
||||
'DO_NOTHING', 'FIRST', 'demoJobHandler', '', 'SERIAL_EXECUTION', 0, 0, 'BEAN', '', 'GLUE代码初始化',
|
||||
now(), '');
|
||||
|
||||
INSERT INTO `xxl_job_user`(`id`, `username`, `password`, `role`, `permission`)
|
||||
VALUES (1, 'admin', '8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92', 1, NULL);
|
||||
|
||||
INSERT INTO `xxl_job_lock` (`lock_name`)
|
||||
VALUES ('schedule_lock');
|
||||
|
||||
commit;
|
||||
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
+163
-98
@@ -1,132 +1,197 @@
|
||||
/*
|
||||
Navicat Premium Data Transfer
|
||||
|
||||
Source Server : localhost
|
||||
Source Server Type : MySQL
|
||||
Source Server Version : 50723
|
||||
Source Host : localhost
|
||||
Source Database : pigxx_mp
|
||||
|
||||
Target Server Type : MySQL
|
||||
Target Server Version : 50723
|
||||
File Encoding : utf-8
|
||||
|
||||
Date: 04/15/2019 22:16:01 PM
|
||||
*/
|
||||
USE pigxx_mp;
|
||||
|
||||
SET NAMES utf8;
|
||||
SET NAMES utf8mb4;
|
||||
SET FOREIGN_KEY_CHECKS = 0;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for `wx_account`
|
||||
-- Table structure for wx_account
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `wx_account`;
|
||||
CREATE TABLE `wx_account` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`name` varchar(100) DEFAULT NULL COMMENT '公众号名称',
|
||||
`account` varchar(100) DEFAULT NULL COMMENT '公众号账户',
|
||||
`appid` varchar(100) DEFAULT NULL COMMENT '公众号appid',
|
||||
`appsecret` varchar(100) DEFAULT NULL COMMENT '公众号密钥',
|
||||
`url` varchar(100) DEFAULT NULL COMMENT '公众号url',
|
||||
`token` varchar(100) DEFAULT NULL COMMENT '公众号token',
|
||||
`aeskey` varchar(300) DEFAULT NULL COMMENT '加密密钥',
|
||||
`qr_url` varchar(200) DEFAULT NULL COMMENT '二维码图片URL',
|
||||
`create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||
`del_flag` char(1) NOT NULL DEFAULT '0' COMMENT '删除标记',
|
||||
`tenant_id` int(11) DEFAULT NULL COMMENT '租户Id',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='公众号账户表';
|
||||
`id` bigint(20) NOT NULL COMMENT '主键ID',
|
||||
`name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '名称',
|
||||
`account` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '账号',
|
||||
`appid` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '应用ID',
|
||||
`appsecret` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '应用秘钥',
|
||||
`url` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'URL地址',
|
||||
`token` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Token令牌',
|
||||
`aeskey` varchar(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '消息加解密密钥',
|
||||
`qr_url` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '二维码URL地址',
|
||||
`create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`update_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||
`del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '删除标记,0未删除,1已删除',
|
||||
`tenant_id` bigint(20) DEFAULT NULL COMMENT '租户ID',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='公众号账户表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for `wx_account_fans`
|
||||
-- Records of wx_account
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for wx_account_fans
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `wx_account_fans`;
|
||||
CREATE TABLE `wx_account_fans` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`openid` varchar(100) CHARACTER SET utf8 DEFAULT NULL COMMENT '用户标识',
|
||||
`subscribe_status` char(1) CHARACTER SET utf8 DEFAULT NULL COMMENT '订阅状态,0未关注,1已关注',
|
||||
`id` bigint(20) NOT NULL COMMENT '主键ID',
|
||||
`openid` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '粉丝openid',
|
||||
`subscribe_status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '订阅状态,0未订阅,1已订阅',
|
||||
`subscribe_time` datetime DEFAULT NULL COMMENT '订阅时间',
|
||||
`nickname` varchar(255) DEFAULT NULL COMMENT '昵称',
|
||||
`gender` varchar(10) CHARACTER SET utf8 DEFAULT NULL COMMENT '性别,1男,2女,0未知',
|
||||
`language` varchar(30) CHARACTER SET utf8 DEFAULT NULL COMMENT '语言',
|
||||
`country` varchar(30) CHARACTER SET utf8 DEFAULT NULL COMMENT '国家',
|
||||
`province` varchar(30) CHARACTER SET utf8 DEFAULT NULL COMMENT '省份',
|
||||
`city` varchar(30) CHARACTER SET utf8 DEFAULT NULL COMMENT '城市',
|
||||
`headimg_url` varchar(500) CHARACTER SET utf8 DEFAULT NULL COMMENT '头像地址',
|
||||
`remark` varchar(500) CHARACTER SET utf8 DEFAULT NULL COMMENT '备注',
|
||||
`wx_account_id` int(11) DEFAULT NULL COMMENT '微信公众号ID',
|
||||
`wx_account_name` varchar(32) CHARACTER SET utf8 DEFAULT NULL,
|
||||
`wx_account_appid` varchar(100) CHARACTER SET utf8 DEFAULT NULL COMMENT '微信公众号appid',
|
||||
`nickname` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '昵称',
|
||||
`gender` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '性别',
|
||||
`language` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '语言',
|
||||
`country` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '国家',
|
||||
`province` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '省份',
|
||||
`city` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '城市',
|
||||
`tag_ids` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '分组ID',
|
||||
`headimg_url` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '头像URL地址',
|
||||
`remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '备注信息',
|
||||
`wx_account_id` bigint(20) DEFAULT NULL COMMENT '微信公众号ID',
|
||||
`wx_account_name` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '微信公众号名称',
|
||||
`wx_account_appid` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '微信公众号AppID',
|
||||
`create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||
`del_flag` char(1) CHARACTER SET utf8 NOT NULL DEFAULT '0' COMMENT '删除标记',
|
||||
`tenant_id` int(11) DEFAULT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_1` (`openid`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='微信公众号粉丝表';
|
||||
`del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '删除标记,0未删除,1已删除',
|
||||
`tenant_id` bigint(20) DEFAULT NULL COMMENT '租户ID',
|
||||
`is_black` int(255) DEFAULT NULL COMMENT '是否在黑名单',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
KEY `idx_1` (`openid`) USING BTREE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='微信公众号粉丝表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for `wx_fans_msg`
|
||||
-- Records of wx_account_fans
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `wx_fans_msg`;
|
||||
CREATE TABLE `wx_fans_msg` (
|
||||
`id` int(10) NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`openid` varchar(100) DEFAULT NULL COMMENT '用户标识',
|
||||
`nickname` varchar(100) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '昵称',
|
||||
`headimg_url` varchar(500) DEFAULT NULL COMMENT '头像地址',
|
||||
`wx_account_appid` varchar(255) DEFAULT NULL,
|
||||
`wx_account_name` varchar(255) DEFAULT NULL,
|
||||
`wx_account_id` int(11) DEFAULT NULL COMMENT '微信账号ID',
|
||||
`msg_id` bigint(20) DEFAULT NULL COMMENT '消息ID',
|
||||
`msg_type` varchar(32) DEFAULT NULL COMMENT '消息类型',
|
||||
`content` varchar(500) DEFAULT NULL COMMENT '内容',
|
||||
`res_content` varchar(3000) DEFAULT NULL COMMENT '最近一条回复内容',
|
||||
`is_res` char(1) DEFAULT '0' COMMENT '是否已回复',
|
||||
`media_id` varchar(100) DEFAULT NULL COMMENT '微信素材ID',
|
||||
`pic_url` varchar(500) DEFAULT NULL COMMENT '微信图片URL',
|
||||
`pic_path` varchar(500) DEFAULT NULL COMMENT '本地图片路径',
|
||||
BEGIN;
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for wx_account_tag
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `wx_account_tag`;
|
||||
CREATE TABLE `wx_account_tag` (
|
||||
`id` bigint(20) NOT NULL COMMENT '主键ID',
|
||||
`tag` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '标签名称',
|
||||
`create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT '创建人',
|
||||
`update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT '修改人',
|
||||
`create_time` datetime COMMENT '创建时间',
|
||||
`update_time` datetime COMMENT '修改时间',
|
||||
`del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '0' COMMENT '删除标记,0未删除,1已删除',
|
||||
`tenant_id` bigint(20) NOT NULL COMMENT '租户ID',
|
||||
`wx_account_id` bigint(20) NOT NULL COMMENT '微信公众号ID',
|
||||
`wx_account_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '微信公众号名称',
|
||||
`wx_account_appid` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '微信公众号AppID',
|
||||
`tag_id` bigint(20) NOT NULL COMMENT '标签ID',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='微信公众号标签表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of wx_account_tag
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for wx_auto_reply
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `wx_auto_reply`;
|
||||
CREATE TABLE `wx_auto_reply` (
|
||||
`id` bigint(20) NOT NULL COMMENT '主键',
|
||||
`type` char(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '类型(1、关注时回复;2、消息回复;3、关键词回复)',
|
||||
`req_key` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '关键词',
|
||||
`req_type` char(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '请求消息类型(text:文本;image:图片;voice:语音;video:视频;shortvideo:小视频;location:地理位置)',
|
||||
`rep_type` char(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '回复消息类型(text:文本;image:图片;voice:语音;video:视频;music:音乐;news:图文)',
|
||||
`rep_mate` char(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '回复类型文本匹配类型(1、全匹配,2、半匹配)',
|
||||
`rep_content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT '回复类型文本保存文字',
|
||||
`rep_media_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '回复类型imge、voice、news、video的mediaID或音乐缩略图的媒体id',
|
||||
`rep_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '回复的素材名、视频和音乐的标题',
|
||||
`rep_desc` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '视频和音乐的描述',
|
||||
`rep_url` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '链接',
|
||||
`rep_hq_url` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '高质量链接',
|
||||
`rep_thumb_media_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '缩略图的媒体id',
|
||||
`rep_thumb_url` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '缩略图url',
|
||||
`content` json DEFAULT NULL COMMENT '图文消息的内容',
|
||||
`app_id` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '公众号ID',
|
||||
`remark` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '备注',
|
||||
`del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '逻辑删除标记(0:显示;1:隐藏)',
|
||||
`create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||
`del_flag` char(1) DEFAULT '0' COMMENT '删除标记',
|
||||
`tenant_id` int(11) DEFAULT NULL COMMENT '租户',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='粉丝消息表 ';
|
||||
`tenant_id` bigint(20) DEFAULT NULL COMMENT '租户ID',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='微信自动回复';
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for `wx_fans_msg_res`
|
||||
-- Records of wx_auto_reply
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `wx_fans_msg_res`;
|
||||
CREATE TABLE `wx_fans_msg_res` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`fans_msg_id` int(11) DEFAULT NULL COMMENT '粉丝消息ID',
|
||||
`res_content` text COMMENT '回复内容',
|
||||
`user_id` varchar(32) DEFAULT NULL COMMENT '用户ID',
|
||||
`user_name` varchar(32) DEFAULT NULL COMMENT '用户名',
|
||||
`create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||
`del_flag` char(1) DEFAULT '0' COMMENT '删除标识',
|
||||
`tenant_id` int(11) DEFAULT NULL COMMENT '租户表',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='回复粉丝消息历史表 ';
|
||||
BEGIN;
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for `wx_menu`
|
||||
-- Table structure for wx_mp_menu
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `wx_mp_menu`;
|
||||
CREATE TABLE `wx_mp_menu` (
|
||||
`id` int(10) NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`id` bigint(20) NOT NULL COMMENT '主键',
|
||||
`menu` json DEFAULT NULL COMMENT '菜单',
|
||||
`wx_account_id` int(11) DEFAULT NULL,
|
||||
`wx_account_appid` varchar(100) DEFAULT NULL,
|
||||
`wx_account_name` varchar(32) DEFAULT NULL,
|
||||
`wx_account_id` bigint(20) DEFAULT NULL COMMENT '公众号ID',
|
||||
`wx_account_appid` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '公众号APPID',
|
||||
`wx_account_name` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '公众号名称',
|
||||
`create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||
`del_flag` char(1) DEFAULT '0' COMMENT '删除标记',
|
||||
`tenant_id` int(11) DEFAULT NULL COMMENT '租户ID',
|
||||
`pub_flag` char(1) DEFAULT '0' COMMENT '发布标志',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='微信菜单表';
|
||||
`del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '删除标记',
|
||||
`pub_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '发布标志',
|
||||
`tenant_id` bigint(20) DEFAULT NULL COMMENT '租户ID',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='微信菜单表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of wx_mp_menu
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for wx_msg
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `wx_msg`;
|
||||
CREATE TABLE `wx_msg` (
|
||||
`id` bigint(20) NOT NULL COMMENT '主键',
|
||||
`app_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '公众号名称',
|
||||
`app_logo` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '公众号logo',
|
||||
`wx_user_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '微信用户ID',
|
||||
`nick_name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '微信用户昵称',
|
||||
`headimg_url` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '微信用户头像',
|
||||
`type` char(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '消息分类(1、用户发给公众号;2、公众号发给用户;)',
|
||||
`rep_type` char(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '消息类型(text:文本;image:图片;voice:语音;video:视频;shortvideo:小视频;location:地理位置;music:音乐;news:图文;event:推送事件)',
|
||||
`rep_event` char(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '事件类型(subscribe:关注;unsubscribe:取关;CLICK、VIEW:菜单事件)',
|
||||
`rep_content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT '回复类型文本保存文字、地理位置信息',
|
||||
`rep_media_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '回复类型imge、voice、news、video的mediaID或音乐缩略图的媒体id',
|
||||
`rep_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '回复的素材名、视频和音乐的标题',
|
||||
`rep_desc` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '视频和音乐的描述',
|
||||
`rep_url` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '链接',
|
||||
`rep_hq_url` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '高质量链接',
|
||||
`content` json DEFAULT NULL COMMENT '图文消息的内容',
|
||||
`rep_thumb_media_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '缩略图的媒体id',
|
||||
`rep_thumb_url` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '缩略图url',
|
||||
`rep_location_x` double DEFAULT NULL COMMENT '地理位置维度',
|
||||
`rep_location_y` double DEFAULT NULL COMMENT '地理位置经度',
|
||||
`rep_scale` double DEFAULT NULL COMMENT '地图缩放大小',
|
||||
`read_flag` char(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '1' COMMENT '已读标记(1:是;0:否)',
|
||||
`app_id` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '公众号ID',
|
||||
`open_id` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '微信唯一标识',
|
||||
`remark` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '备注',
|
||||
`del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '逻辑删除标记(0:显示;1:隐藏)',
|
||||
`create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||
`tenant_id` bigint(20) DEFAULT NULL COMMENT '租户ID',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='微信消息';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of wx_msg
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
COMMIT;
|
||||
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
+265
-110
@@ -1,99 +1,125 @@
|
||||
/*
|
||||
Navicat Premium Data Transfer
|
||||
|
||||
Source Server : localhost
|
||||
Source Server Type : MySQL
|
||||
Source Server Version : 50723
|
||||
Source Host : localhost
|
||||
Source Database : pigxx_config
|
||||
|
||||
Target Server Type : MySQL
|
||||
Target Server Version : 50723
|
||||
File Encoding : utf-8
|
||||
|
||||
Date: 05/18/2019 15:19:14 PM
|
||||
*/
|
||||
USE pigxx_config;
|
||||
|
||||
SET NAMES utf8;
|
||||
SET NAMES utf8mb4;
|
||||
SET FOREIGN_KEY_CHECKS = 0;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for `config_info`
|
||||
-- Table structure for config_info
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `config_info`;
|
||||
CREATE TABLE `config_info` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT 'id',
|
||||
`data_id` varchar(255) COLLATE utf8_bin NOT NULL COMMENT 'data_id',
|
||||
`group_id` varchar(255) COLLATE utf8_bin DEFAULT NULL,
|
||||
`group_id` varchar(128) COLLATE utf8_bin DEFAULT NULL COMMENT 'group_id',
|
||||
`content` longtext COLLATE utf8_bin NOT NULL COMMENT 'content',
|
||||
`md5` varchar(32) COLLATE utf8_bin DEFAULT NULL COMMENT 'md5',
|
||||
`gmt_create` datetime NOT NULL DEFAULT '2010-05-05 00:00:00' COMMENT '创建时间',
|
||||
`gmt_modified` datetime NOT NULL DEFAULT '2010-05-05 00:00:00' COMMENT '修改时间',
|
||||
`gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间',
|
||||
`src_user` text COLLATE utf8_bin COMMENT 'source user',
|
||||
`src_ip` varchar(20) COLLATE utf8_bin DEFAULT NULL COMMENT 'source ip',
|
||||
`app_name` varchar(128) COLLATE utf8_bin DEFAULT NULL,
|
||||
`src_ip` varchar(50) COLLATE utf8_bin DEFAULT NULL COMMENT 'source ip',
|
||||
`app_name` varchar(128) COLLATE utf8_bin DEFAULT NULL COMMENT 'app_name',
|
||||
`tenant_id` varchar(128) COLLATE utf8_bin DEFAULT '' COMMENT '租户字段',
|
||||
`c_desc` varchar(256) COLLATE utf8_bin DEFAULT NULL,
|
||||
`c_use` varchar(64) COLLATE utf8_bin DEFAULT NULL,
|
||||
`effect` varchar(64) COLLATE utf8_bin DEFAULT NULL,
|
||||
`type` varchar(64) COLLATE utf8_bin DEFAULT NULL,
|
||||
`c_schema` text COLLATE utf8_bin,
|
||||
`c_desc` varchar(256) COLLATE utf8_bin DEFAULT NULL COMMENT 'configuration description',
|
||||
`c_use` varchar(64) COLLATE utf8_bin DEFAULT NULL COMMENT 'configuration usage',
|
||||
`effect` varchar(64) COLLATE utf8_bin DEFAULT NULL COMMENT '配置生效的描述',
|
||||
`type` varchar(64) COLLATE utf8_bin DEFAULT NULL COMMENT '配置的类型',
|
||||
`c_schema` text COLLATE utf8_bin COMMENT '配置的模式',
|
||||
`encrypted_data_key` varchar(1024) COLLATE utf8_bin NOT NULL DEFAULT '' COMMENT '密钥',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `uk_configinfo_datagrouptenant` (`data_id`,`group_id`,`tenant_id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=34 DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='config_info';
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='config_info';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of `config_info`
|
||||
-- Records of config_info
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `config_info` VALUES ('1', 'application-dev.yml', 'DEFAULT_GROUP', 'jasypt:\n encryptor:\n password: pigx\n\nspring:\n redis:\n password:\n host: ${REDIS-HOST:pigx-redis}\n\n\nmanagement:\n endpoints:\n web:\n exposure:\n include: \'*\'\n\nfeign:\n hystrix:\n enabled: true\n okhttp:\n enabled: true\n httpclient:\n enabled: false\n client:\n config:\n default:\n connectTimeout: 10000\n readTimeout: 10000\n compression:\n request:\n enabled: true\n response:\n enabled: true\n# hystrix If you need to use ThreadLocal bound variables in your RequestInterceptor`s\n# you will need to either set the thread isolation strategy for Hystrix to `SEMAPHORE or disable Hystrix in Feign.\nhystrix:\n command:\n default:\n execution:\n isolation:\n strategy: SEMAPHORE\n thread:\n timeoutInMilliseconds: 60000\n shareSecurityContext: true\n\n\nribbon:\n ReadTimeout: 10000\n ConnectTimeout: 10000\n\n\nmybatis-plus:\n mapper-locations: classpath:/mapper/*Mapper.xml\n global-config:\n banner: false\n db-config:\n id-type: auto\n\n\nswagger:\n title: PigX Swagger API\n license: Powered By PigX\n licenseUrl: https://pig4cloud.com/\n terms-of-service-url: https://pig4cloud.com/\n contact:\n email: wangiegie@gmail.com\n url: https://pig4cloud.com/about.html\n authorization:\n name: pigX OAuth\n auth-regex: ^.*$\n authorization-scope-list:\n - scope: server\n description: server all\n token-url-list:\n - http://${GATEWAY-HOST:pigx-gateway}:${GATEWAY-PORT:9999}/auth/oauth/token\n\nsecurity:\n oauth2:\n client:\n ignore-urls:\n - /actuator/**\n - /v2/api-docs\n resource:\n loadBalanced: true\n token-info-uri: http://${AUTH-HOST:pigx-auth}/oauth/check_token\n\n#dsdsa来电二中文呀', '4d6f2c325d0c230431b2d298069182f6', '2019-04-18 02:10:20', '2019-05-07 21:05:09', null, '0:0:0:0:0:0:0:1', '', '', '通用配置文件', null, null, 'yaml', null), ('2', 'pigx-activiti-dev.yml', 'DEFAULT_GROUP', '## spring security 配置\nsecurity:\n oauth2:\n client:\n client-id: ENC(gPFcUOmJm8WqM3k3eSqS0Q==)\n client-secret: ENC(gPFcUOmJm8WqM3k3eSqS0Q==)\n scope: server\n ignore-urls:\n - \'/actuator/**\'\n - \'/v2/api-docs\'\n - \'/editor-app/**\'\n - \'/modeler.html\'\n - \'/ws/**\'\nspring:\n autoconfigure:\n exclude: org.activiti.spring.boot.SecurityAutoConfiguration\n activiti:\n check-process-definitions: false\n datasource:\n type: com.alibaba.druid.pool.DruidDataSource\n druid:\n driver-class-name: com.mysql.cj.jdbc.Driver\n username: ${MYSQL-USER:root}\n password: ${MYSQL-PWD:root}\n url: jdbc:mysql://${MYSQL-HOST:pigx-mysql}:${MYSQL-PORT:3306}/${MYSQL-DB:pigxx_ac}?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&allowMultiQueries=true\n\n# 租户表维护\npigx:\n tenant:\n column: tenant_id\n tables:\n - oa_leave_bill', 'f9ae6f353c354f3a398373a6fe93e543', '2019-04-18 02:10:56', '2019-05-14 15:14:56', null, '127.0.0.1', '', '', '工作流配置文件', null, null, 'yaml', null), ('3', 'pigx-auth-dev.yml', 'DEFAULT_GROUP', '# 数据源\nspring:\n datasource:\n type: com.alibaba.druid.pool.DruidDataSource\n druid:\n driver-class-name: com.mysql.cj.jdbc.Driver\n username: ${MYSQL-USER:root}\n password: ${MYSQL-PWD:root}\n url: jdbc:mysql://${MYSQL-HOST:pigx-mysql}:${MYSQL-PORT:3306}/${MYSQL-DB:pigxx}?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&allowMultiQueries=true\n freemarker:\n allow-request-override: false\n allow-session-override: false\n cache: true\n charset: UTF-8\n check-template-location: true\n content-type: text/html\n enabled: true\n expose-request-attributes: false\n expose-session-attributes: false\n expose-spring-macro-helpers: true\n prefer-file-system-access: true\n suffix: .ftl\n template-loader-path: classpath:/templates/', '7065ac5cb6d799bfd290ad3eaf19d838', '2019-04-18 02:11:32', '2019-05-14 15:15:26', null, '127.0.0.1', '', '', '认证中心配置文件', null, null, 'yaml', null), ('4', 'pigx-codegen-dev.yml', 'DEFAULT_GROUP', '## spring security 配置\nsecurity:\n oauth2:\n client:\n client-id: ENC(gPFcUOmJm8WqM3k3eSqS0Q==)\n client-secret: ENC(gPFcUOmJm8WqM3k3eSqS0Q==)\n scope: server\n# 数据源\nspring:\n datasource:\n type: com.alibaba.druid.pool.DruidDataSource\n druid:\n driver-class-name: com.mysql.cj.jdbc.Driver\n username: ${MYSQL-USER:root}\n password: ${MYSQL-PWD:root}\n url: jdbc:mysql://${MYSQL-HOST:pigx-mysql}:${MYSQL-PORT:3306}/${MYSQL-DB:pigxx}?cLine truncated
|
||||
INSERT INTO `config_info` (`id`, `data_id`, `group_id`, `content`, `md5`, `gmt_create`, `gmt_modified`, `src_user`,
|
||||
`src_ip`, `app_name`, `tenant_id`, `c_desc`, `c_use`, `effect`, `type`, `c_schema`,
|
||||
`encrypted_data_key`)
|
||||
VALUES (1, 'application-dev.yml', 'DEFAULT_GROUP',
|
||||
'# 配置文件加密根密码\njasypt:\n encryptor:\n password: pigx\n algorithm: PBEWithMD5AndDES\n iv-generator-classname: org.jasypt.iv.NoIvGenerator\n\nspring:\n jackson:\n use-jackson2-defaults: true\n data:\n redis:\n host: pigx-redis\n servlet:\n multipart:\n max-file-size: 100MB\n max-request-size: 100MB\n cloud:\n refresh:\n never-refreshable: dataSource\n compatibility-verifier:\n enabled: false\n nacos:\n discovery:\n naming-async-query-subscribe-service: true\n sentinel:\n eager: true\n transport:\n dashboard: pigx-sentinel:5020\n openfeign:\n sentinel:\n enabled: true\n okhttp:\n enabled: true\n httpclient:\n enabled: false\n connection-timeout: 20000\n compression:\n request:\n min-request-size: 5120\n enabled: true\n response:\n enabled: true\n\n# 端点对外暴露\nmanagement:\n endpoints:\n web:\n exposure:\n include: \' *\' \n endpoint:\n restart:\n access: none\n health:\n show-details: ALWAYS\n\n#开启灰度\ngray:\n rule:\n enabled: true\n\n# liteflow配置\nliteflow:\n # 分支超时时间调整为 150 秒\n when-max-wait-time: 150000\n\n# mybatis-plus 配置\nmybatis-plus:\n mapper-locations: classpath:/mapper/*Mapper.xml\n global-config:\n capitalMode: true\n banner: false\n db-config:\n id-type: auto\n where-strategy: not_empty\n insert-strategy: not_empty\n update-strategy: not_null\n sequence:\n worker-id: ${random.int(1,31)}\n datacenter-id: ${random.int(1,31)}\n type-handlers-package: com.pig4cloud.pigx.common.data.handler\n configuration:\n jdbc-type-for-null: \'null\'\n call-setters-on-nulls: true\n shrink-whitespaces-in-sql: true\nmybatis-plus-join:\n banner: false #关闭连表查询组件banner',
|
||||
'0dc3faa0d9871245282f6b7d4f2249c0', '2022-12-16 10:44:25', '2023-08-14 11:44:19', 'nacos', '127.0.0.1', '',
|
||||
'public', '', '', '', 'yaml', '', '');
|
||||
INSERT INTO `config_info` (`id`, `data_id`, `group_id`, `content`, `md5`, `gmt_create`, `gmt_modified`, `src_user`, `src_ip`, `app_name`, `tenant_id`, `c_desc`, `c_use`, `effect`, `type`, `c_schema`, `encrypted_data_key`) VALUES (2, 'pigx-auth-dev.yml', 'DEFAULT_GROUP', '# 数据源\nspring:\n freemarker:\n allow-request-override: false\n allow-session-override: false\n cache: true\n charset: UTF-8\n check-template-location: true\n content-type: text/html\n enabled: true\n expose-request-attributes: false\n expose-session-attributes: false\n expose-spring-macro-helpers: true\n prefer-file-system-access: true\n suffix: .ftl\n template-loader-path: classpath:/templates/\n\n# 前端登录验证码\nsecurity:\n encodeKey: \'pigxpigxpigxpigx\'\n# 验证码相关配置参考: http://t.cn/A647jEdu\naj:\n captcha:\n cache-type: redis\n water-mark: pig4cloud', 'bb6bd9b9e21afdec3d6c88636387df96', '2022-12-16 10:44:25', '2024-04-20 22:47:21', 'nacos', '127.0.0.1', '', 'public', '', '', '', 'yaml', '', '');
|
||||
INSERT INTO `config_info` (`id`, `data_id`, `group_id`, `content`, `md5`, `gmt_create`, `gmt_modified`, `src_user`, `src_ip`, `app_name`, `tenant_id`, `c_desc`, `c_use`, `effect`, `type`, `c_schema`, `encrypted_data_key`) VALUES (3, 'pigx-codegen-dev.yml', 'DEFAULT_GROUP', '# 数据源\nspring:\n datasource:\n type: com.alibaba.druid.pool.DruidDataSource\n druid:\n driver-class-name: com.mysql.cj.jdbc.Driver\n username: ${MYSQL_USER:root}\n password: ${MYSQL_PWD:root}\n url: jdbc:mysql://${MYSQL_HOST:pigx-mysql}:${MYSQL_PORT:3306}/${MYSQL_DB:pigxx_codegen}?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&allowMultiQueries=true&allowPublicKeyRetrieval=true\n', 'e9ca4622d920568cb5daf08145b63b1e', '2022-12-16 10:44:25', '2024-02-22 15:08:09', 'nacos', '127.0.0.1', '', 'public', '', '', '', 'yaml', '', '');
|
||||
INSERT INTO `config_info` (`id`, `data_id`, `group_id`, `content`, `md5`, `gmt_create`, `gmt_modified`, `src_user`, `src_ip`, `app_name`, `tenant_id`, `c_desc`, `c_use`, `effect`, `type`, `c_schema`, `encrypted_data_key`) VALUES (4, 'pigx-daemon-elastic-job-dev.yml', 'DEFAULT_GROUP', '# 数据源\nspring:\n datasource:\n type: com.alibaba.druid.pool.DruidDataSource\n druid:\n driver-class-name: com.mysql.cj.jdbc.Driver\n username: ${MYSQL_USER:root}\n password: ${MYSQL_PWD:root}\n url: jdbc:mysql://${MYSQL_HOST:pigx-mysql}:${MYSQL_PORT:3306}/${MYSQL_DB:pigxx_job}?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&allowMultiQueries=true&allowPublicKeyRetrieval=true\n\n# XXL-Job 配置\nxxl:\n job:\n accessToken: default_token', 'ac1b92ceacc451eac15942131e04c6dd', '2022-12-16 10:44:25', '2023-04-07 14:14:50', 'nacos', '127.0.0.1', '', 'public', '', '', '', 'yaml', '', '');
|
||||
INSERT INTO `config_info` (`id`, `data_id`, `group_id`, `content`, `md5`, `gmt_create`, `gmt_modified`, `src_user`, `src_ip`, `app_name`, `tenant_id`, `c_desc`, `c_use`, `effect`, `type`, `c_schema`, `encrypted_data_key`) VALUES (5, 'pigx-gateway-dev.yml', 'DEFAULT_GROUP', '# 固定路由转发配置 无修改\nspring:\n cloud:\n gateway:\n server:\n webflux:\n routes:\n - id: openapi\n uri: lb://pigx-gateway\n predicates:\n - Path=/v3/api-docs/**\n filters:\n - RewritePath=/v3/api-docs/(?<path>.*), /$\\{path}/$\\{path}/v3/api-docs\n\n# gateway 刷新端点\nmanagement:\n endpoint:\n gateway:\n access: unrestricted\n', 'd9454d877ff3d8bd3fd0d5be99810195', '2022-12-16 10:44:25', '2024-04-20 22:47:02', 'nacos', '127.0.0.1', '', 'public', '', '', '', 'yaml', '', '');
|
||||
INSERT INTO `config_info` (`id`, `data_id`, `group_id`, `content`, `md5`, `gmt_create`, `gmt_modified`, `src_user`, `src_ip`, `app_name`, `tenant_id`, `c_desc`, `c_use`, `effect`, `type`, `c_schema`, `encrypted_data_key`) VALUES (6, 'pigx-monitor-dev.yml', 'DEFAULT_GROUP', 'spring:\n # 安全配置\n security:\n user:\n name: ENC(rZHA4LW5hHmhLAAzJoFNag==) # pigx\n password: ENC(bjeyh+Aeii3kHXkoo00ZUw==) # pigx\n autoconfigure:\n exclude: com.pig4cloud.pigx.common.core.config.JacksonConfiguration\n boot:\n admin:\n ui:\n title: \'pigx 服务状态监控\'\n brand: \'pigx 服务状态监控\'\n external-views:\n - label: \"SQL监控\"\n url: /druid/sql.html\n order: 2000\n iframe: true\nmanagement:\n endpoints:\n web:\n exposure:\n include: \'*\'\n endpoint:\n health:\n show-details: ALWAYS #显示详细信息\n\n\n# druid 监控的服务\nmonitor:\n applications:\n - pigx-upms-biz\n', '2bb39e4dee3f90d4186d1e42aa666d2a', '2022-12-16 10:44:25', '2023-04-07 14:12:09', 'nacos', '127.0.0.1', '', 'public', '', '', '', 'yaml', '', '');
|
||||
INSERT INTO `config_info` (`id`, `data_id`, `group_id`, `content`, `md5`, `gmt_create`, `gmt_modified`, `src_user`, `src_ip`, `app_name`, `tenant_id`, `c_desc`, `c_use`, `effect`, `type`, `c_schema`, `encrypted_data_key`) VALUES (7, 'pigx-upms-biz-dev.yml', 'DEFAULT_GROUP', '## spring security 配置\nsecurity:\n oauth2:\n client:\n ignore-urls:\n - /druid/**\n\n# 数据源\nspring:\n datasource:\n type: com.alibaba.druid.pool.DruidDataSource\n druid:\n driver-class-name: com.mysql.cj.jdbc.Driver\n username: ${MYSQL_USER:root}\n password: ${MYSQL_PWD:root}\n url: jdbc:mysql://${MYSQL_HOST:pigx-mysql}:${MYSQL_PORT:3306}/${MYSQL_DB:pigxx}?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&allowMultiQueries=true&allowPublicKeyRetrieval=true\n stat-view-servlet:\n enabled: true\n allow: \"\"\n url-pattern: /druid/*\n #login-username: admin\n #login-password: admin\n filter:\n stat:\n enabled: true\n log-slow-sql: true\n slow-sql-millis: 10000\n merge-sql: false\n wall:\n config:\n multi-statement-allow: true\n\n# 本地文件系统\nfile:\n type: local\n local:\n basePath: /Users/lengleng/Downloads/files', '31570b7a880625228335b7f7e5aaa312', '2022-12-16 10:44:25', '2024-02-22 15:08:36', 'nacos', '127.0.0.1', '', 'public', '', '', '', 'yaml', '', '');
|
||||
INSERT INTO `config_info` (`id`, `data_id`, `group_id`, `content`, `md5`, `gmt_create`, `gmt_modified`, `src_user`, `src_ip`, `app_name`, `tenant_id`, `c_desc`, `c_use`, `effect`, `type`, `c_schema`, `encrypted_data_key`) VALUES (8, 'pigx-daemon-quartz-dev.yml', 'DEFAULT_GROUP', '# 数据源\nspring:\n datasource:\n type: com.alibaba.druid.pool.DruidDataSource\n druid:\n driver-class-name: com.mysql.cj.jdbc.Driver\n username: ${MYSQL_USER:root}\n password: ${MYSQL_PWD:root}\n url: jdbc:mysql://${MYSQL_HOST:pigx-mysql}:${MYSQL_PORT:3306}/${MYSQL_DB:pigxx_job}?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&allowMultiQueries=true&allowPublicKeyRetrieval=true\n', 'caa1a7ea301239a18e9a43699e43707e', '2022-12-16 10:44:25', '2024-04-19 21:49:00', 'nacos', '127.0.0.1', '', 'public', '', '', '', 'yaml', '', '');
|
||||
INSERT INTO `config_info` (`id`, `data_id`, `group_id`, `content`, `md5`, `gmt_create`, `gmt_modified`, `src_user`, `src_ip`, `app_name`, `tenant_id`, `c_desc`, `c_use`, `effect`, `type`, `c_schema`, `encrypted_data_key`) VALUES (9, 'pigx-pay-platform-dev.yml', 'DEFAULT_GROUP', '# 数据源\nspring:\n datasource:\n type: com.alibaba.druid.pool.DruidDataSource\n druid:\n driver-class-name: com.mysql.cj.jdbc.Driver\n username: ${MYSQL_USER:root}\n password: ${MYSQL_PWD:root}\n url: jdbc:mysql://${MYSQL_HOST:pigx-mysql}:${MYSQL_PORT:3306}/${MYSQL_DB:pigxx_pay}?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&allowMultiQueries=true&allowPublicKeyRetrieval=true\n freemarker:\n allow-request-override: false\n allow-session-override: false\n cache: true\n charset: UTF-8\n check-template-location: true\n content-type: text/html\n enabled: true\n expose-request-attributes: false\n expose-session-attributes: false\n expose-spring-macro-helpers: true\n prefer-file-system-access: true\n suffix: .ftl\n template-loader-path: classpath:/templates/\n# 租户表维护\npigx:\n pay:\n test: lengleng\n aliPayConfig:\n expire-time: 30\n return-url: http://pig4cloud.com\n notify-url: http://payx.yunjihuitong.com/pay/notify/ali/callbak\n wxPayConfig:\n notify-url: https://admin.pig4cloud.com/pay/notify/wx/callbak\n mergePayConfig:\n return-url: http://pig4cloud.com\n notify-url: http://wechat.pigx.top/pay/notify/merge/callbak\n xsequence: #发号器相关配置\n db:\n retry-times: 3\n table-name: pay_sequence', 'f4e5734a99f3c1f059071deac081b33d', '2022-12-16 10:44:25', '2024-02-22 15:09:08', 'nacos', '127.0.0.1', '', 'public', '', '', '', 'yaml', '', '');
|
||||
INSERT INTO `config_info` (`id`, `data_id`, `group_id`, `content`, `md5`, `gmt_create`, `gmt_modified`, `src_user`, `src_ip`, `app_name`, `tenant_id`, `c_desc`, `c_use`, `effect`, `type`, `c_schema`, `encrypted_data_key`) VALUES (11, 'pigx-mp-platform-dev.yml', 'DEFAULT_GROUP', '# 数据源\nspring:\n datasource:\n type: com.alibaba.druid.pool.DruidDataSource\n druid:\n driver-class-name: com.mysql.cj.jdbc.Driver\n username: ${MYSQL_USER:root}\n password: ${MYSQL_PWD:root}\n url: jdbc:mysql://${MYSQL_HOST:pigx-mysql}:${MYSQL_PORT:3306}/${MYSQL_DB:pigxx_mp}?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&allowMultiQueries=true&allowPublicKeyRetrieval=true\n', 'ae40865200e414d06d63d96f257f372e', '2022-12-16 10:44:25', '2024-02-22 15:09:20', 'nacos', '127.0.0.1', '', 'public', '', '', '', 'yaml', '', '');
|
||||
INSERT INTO `config_info` (`id`, `data_id`, `group_id`, `content`, `md5`, `gmt_create`, `gmt_modified`, `src_user`, `src_ip`, `app_name`, `tenant_id`, `c_desc`, `c_use`, `effect`, `type`, `c_schema`, `encrypted_data_key`) VALUES (12, 'pigx-xxl-job-admin-dev.yml', 'DEFAULT_GROUP', '# XXL-Job Admin 微服务配置\n# Actuator 监控配置\nmanagement:\n endpoints:\n web:\n base-path: /actuator\n health:\n mail:\n enabled: false\n\n# Spring 配置\nspring:\n # MVC 配置\n mvc:\n servlet:\n load-on-startup: 0\n static-path-pattern: /static/**\n\n # 静态资源配置\n web:\n resources:\n static-locations: classpath:/static/\n\n # Freemarker 模板引擎配置\n freemarker:\n template-loader-path: classpath:/templates/\n suffix: .ftl\n charset: UTF-8\n request-context-attribute: request\n settings:\n number_format: 0.##########\n new_builtin_class_resolver: safer\n\n # 数据源配置\n datasource:\n type: com.alibaba.druid.pool.DruidDataSource\n druid:\n driver-class-name: com.mysql.cj.jdbc.Driver\n username: ${MYSQL_USER:root}\n password: ${MYSQL_PWD:root}\n url: jdbc:mysql://${MYSQL_HOST:pigx-mysql}:${MYSQL_PORT:3306}/${MYSQL_DB:pigxx_job}?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&allowMultiQueries=true&allowPublicKeyRetrieval=true\n\n # 邮件服务配置\n mail:\n host: smtp.qq.com\n port: 25\n username: xxx@qq.com\n from: xxx@qq.com\n password: xxx\n properties:\n mail:\n smtp:\n auth: true\n starttls:\n enable: true\n required: true\n socketFactory:\n class: javax.net.ssl.SSLSocketFactory\n\n# MyBatis 配置\nmybatis:\n mapper-locations: classpath:/mapper/**/*Mapper.xml\n\n# XXL-Job 配置\nxxl:\n job:\n # 访问令牌\n accessToken: default_token\n # 超时时间(秒)\n timeout: 3\n # 国际化 (zh_CN, zh_TC, en)\n i18n: zh_CN\n # 触发器线程池最大线程数\n triggerpool:\n fast:\n max: 300\n slow:\n max: 200\n # 调度批次大小\n schedule:\n batchsize: 100\n # 日志保留天数\n logretentiondays: 30\n\n# XXL-SSO 单点登录配置\nxxl-sso:\n token:\n key: xxl_job_login_token\n timeout: 604800000\n client:\n excluded:\n paths:\n login:\n path: /auth/login', 'e4e88bd4e91599ae03854a8dfe491786', '2022-12-16 10:44:25', '2026-05-01 23:02:41', 'nacos', '127.0.0.1', '', 'public', '', '', '', 'yaml', '', '');
|
||||
INSERT INTO `config_info` (`id`, `data_id`, `group_id`, `content`, `md5`, `gmt_create`, `gmt_modified`, `src_user`, `src_ip`, `app_name`, `tenant_id`, `c_desc`, `c_use`, `effect`, `type`, `c_schema`, `encrypted_data_key`) VALUES (13, 'pigx-report-platform-dev.yml', 'DEFAULT_GROUP', 'spring:\n datasource:\n type: com.alibaba.druid.pool.DruidDataSource\n druid:\n driver-class-name: com.mysql.cj.jdbc.Driver\n username: ${MYSQL_USER:root}\n password: ${MYSQL_PWD:root}\n url: jdbc:mysql://${MYSQL_HOST:pigx-mysql}:${MYSQL_PORT:3306}/${MYSQL_DB:pigxx_report}?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&allowMultiQueries=true&allowPublicKeyRetrieval=true\n jpa:\n database-platform: org.hibernate.dialect.MySQLDialect\n\nsecurity:\n oauth2:\n client:\n ignore-urls:\n - /\n - /api/project/getData\n - /static/**\n - /api/project/get-file/*\n\n# 文件上传路径\ngv:\n img-path: /Users/lengleng/Downloads/img/\n', 'ce3fde4b4592cdd61feb2e443b2ddfe5', '2022-12-16 10:44:25', '2023-04-07 12:56:57', 'nacos', '127.0.0.1', '', 'public', '', '', '', 'yaml', '', '');
|
||||
INSERT INTO `config_info` (`id`, `data_id`, `group_id`, `content`, `md5`, `gmt_create`, `gmt_modified`, `src_user`, `src_ip`, `app_name`, `tenant_id`, `c_desc`, `c_use`, `effect`, `type`, `c_schema`, `encrypted_data_key`) VALUES (14, 'pigx-jimu-platform-dev.yml', 'DEFAULT_GROUP', 'spring:\n #配置静态资源\n mvc:\n static-path-pattern: /**\n #配置数据库\n datasource:\n type: com.alibaba.druid.pool.DruidDataSource\n druid:\n driver-class-name: com.mysql.cj.jdbc.Driver\n username: ${MYSQL_USER:root}\n password: ${MYSQL_PWD:root}\n url: jdbc:mysql://${MYSQL_HOST:pigx-mysql}:${MYSQL_PORT:3306}/${MYSQL_DB:pigxx_bi}?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&allowMultiQueries=true&allowPublicKeyRetrieval=true\n \n#JimuReport[minidao配置]\nminidao :\n base-package: org.jeecg.modules.jmreport.*,org.jeecg.modules.drag.*\n db-type: mysql\n#JimuReport[上传配置]\njeecg :\n jmreport:\n customPrePath: /api/jimu\n # 自动保存\n autoSave: true\n # 单位毫秒 默认5*60*1000 \n interval: 10000\n # local|minio|alioss\n uploadType: local\n # local\n path :\n #文件路径A\n upload: ~/jimu/data\n # alioss\n oss:\n endpoint: oss-cn-beijing.aliyuncs.com\n accessKey: ??\n secretKey: ??\n staticDomain: ??\n bucketName: ??\n # minio\n minio:\n minio_url: http://minio.jeecg.com\n minio_name: ??\n minio_pass: ??\n bucketName: ??\n#输出sql日志\nlogging:\n level:\n org.jeecg.modules.jmreport : debug', '898d86e9ae9110a0081f7d346487fe6a', '2022-12-16 10:44:25', '2024-01-30 20:44:36', 'nacos', '127.0.0.1', '', 'public', '', '', '', 'yaml', '', '');
|
||||
INSERT INTO `config_info` (`id`, `data_id`, `group_id`, `content`, `md5`, `gmt_create`, `gmt_modified`, `src_user`, `src_ip`, `app_name`, `tenant_id`, `c_desc`, `c_use`, `effect`, `type`, `c_schema`, `encrypted_data_key`) VALUES (15, 'pigx-app-server-biz-dev.yml', 'DEFAULT_GROUP', '# 数据源\nspring:\n datasource:\n type: com.alibaba.druid.pool.DruidDataSource\n druid:\n driver-class-name: com.mysql.cj.jdbc.Driver\n username: ${MYSQL_USER:root}\n password: ${MYSQL_PWD:root}\n url: jdbc:mysql://${MYSQL_HOST:pigx-mysql}:${MYSQL_PORT:3306}/${MYSQL_DB:pigxx_app}?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&allowMultiQueries=true&allowPublicKeyRetrieval=true', 'e4668a1854e92a5a666e83479ef7d26a', '2022-12-19 10:30:07', '2024-02-22 15:09:50', 'nacos', '127.0.0.1', '', 'public', '', '', '', 'yaml', '', '');
|
||||
INSERT INTO `config_info` (`id`, `data_id`, `group_id`, `content`, `md5`, `gmt_create`, `gmt_modified`, `src_user`, `src_ip`, `app_name`, `tenant_id`, `c_desc`, `c_use`, `effect`, `type`, `c_schema`, `encrypted_data_key`) VALUES (16, 'pigx-flow-biz-dev.yml', 'DEFAULT_GROUP', '# 数据源\nspring:\n datasource:\n type: com.alibaba.druid.pool.DruidDataSource\n druid:\n driver-class-name: com.mysql.cj.jdbc.Driver\n username: ${MYSQL_USER:root}\n password: ${MYSQL_PWD:root}\n url: jdbc:mysql://${MYSQL_HOST:pigx-mysql}:${MYSQL_PORT:3306}/${MYSQL_DB:pigxx_flow}?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&allowMultiQueries=true&nullCatalogMeansCurrent=true\n\n# flowable 配置\nflowable:\n variable-json-mapper: jackson2', '233121e20445609e1ba378c3686ea7d5', '2023-07-28 13:41:32', '2023-07-28 13:43:36', 'nacos', '127.0.0.1', '', 'public', 'flowable 工作引擎', '', '', 'yaml', '', '');
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for `config_info_aggr`
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `config_info_aggr`;
|
||||
CREATE TABLE `config_info_aggr` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
|
||||
`data_id` varchar(255) COLLATE utf8_bin NOT NULL COMMENT 'data_id',
|
||||
`group_id` varchar(255) COLLATE utf8_bin NOT NULL COMMENT 'group_id',
|
||||
`datum_id` varchar(255) COLLATE utf8_bin NOT NULL COMMENT 'datum_id',
|
||||
`content` longtext COLLATE utf8_bin NOT NULL COMMENT '内容',
|
||||
`gmt_modified` datetime NOT NULL COMMENT '修改时间',
|
||||
`app_name` varchar(128) COLLATE utf8_bin DEFAULT NULL,
|
||||
`tenant_id` varchar(128) COLLATE utf8_bin DEFAULT '' COMMENT '租户字段',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `uk_configinfoaggr_datagrouptenantdatum` (`data_id`,`group_id`,`tenant_id`,`datum_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='增加租户字段';
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for `config_info_beta`
|
||||
-- Table structure for config_info_beta
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `config_info_beta`;
|
||||
CREATE TABLE `config_info_beta` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT 'id',
|
||||
`data_id` varchar(255) COLLATE utf8_bin NOT NULL COMMENT 'data_id',
|
||||
`group_id` varchar(128) COLLATE utf8_bin NOT NULL COMMENT 'group_id',
|
||||
`app_name` varchar(128) COLLATE utf8_bin DEFAULT NULL COMMENT 'app_name',
|
||||
`content` longtext COLLATE utf8_bin NOT NULL COMMENT 'content',
|
||||
`beta_ips` varchar(1024) COLLATE utf8_bin DEFAULT NULL COMMENT 'betaIps',
|
||||
`md5` varchar(32) COLLATE utf8_bin DEFAULT NULL COMMENT 'md5',
|
||||
`gmt_create` datetime NOT NULL DEFAULT '2010-05-05 00:00:00' COMMENT '创建时间',
|
||||
`gmt_modified` datetime NOT NULL DEFAULT '2010-05-05 00:00:00' COMMENT '修改时间',
|
||||
`gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间',
|
||||
`src_user` text COLLATE utf8_bin COMMENT 'source user',
|
||||
`src_ip` varchar(20) COLLATE utf8_bin DEFAULT NULL COMMENT 'source ip',
|
||||
`src_ip` varchar(50) COLLATE utf8_bin DEFAULT NULL COMMENT 'source ip',
|
||||
`tenant_id` varchar(128) COLLATE utf8_bin DEFAULT '' COMMENT '租户字段',
|
||||
`encrypted_data_key` varchar(1024) COLLATE utf8_bin NOT NULL DEFAULT '' COMMENT '密钥',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `uk_configinfobeta_datagrouptenant` (`data_id`,`group_id`,`tenant_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='config_info_beta';
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for `config_info_tag`
|
||||
-- Records of config_info_beta
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for config_info_gray
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `config_info_gray`;
|
||||
CREATE TABLE `config_info_gray` (
|
||||
`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
|
||||
`data_id` varchar(255) NOT NULL COMMENT 'data_id',
|
||||
`group_id` varchar(128) NOT NULL COMMENT 'group_id',
|
||||
`content` longtext NOT NULL COMMENT 'content',
|
||||
`md5` varchar(32) DEFAULT NULL COMMENT 'md5',
|
||||
`src_user` text COMMENT 'src_user',
|
||||
`src_ip` varchar(100) DEFAULT NULL COMMENT 'src_ip',
|
||||
`gmt_create` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) COMMENT 'gmt_create',
|
||||
`gmt_modified` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) COMMENT 'gmt_modified',
|
||||
`app_name` varchar(128) DEFAULT NULL COMMENT 'app_name',
|
||||
`tenant_id` varchar(128) DEFAULT '' COMMENT 'tenant_id',
|
||||
`gray_name` varchar(128) NOT NULL COMMENT 'gray_name',
|
||||
`gray_rule` text NOT NULL COMMENT 'gray_rule',
|
||||
`encrypted_data_key` varchar(256) NOT NULL DEFAULT '' COMMENT 'encrypted_data_key',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `uk_configinfogray_datagrouptenantgray` (`data_id`,`group_id`,`tenant_id`,`gray_name`),
|
||||
KEY `idx_dataid_gmt_modified` (`data_id`,`gmt_modified`),
|
||||
KEY `idx_gmt_modified` (`gmt_modified`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='config_info_gray';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of config_info_gray
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for config_info_tag
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `config_info_tag`;
|
||||
CREATE TABLE `config_info_tag` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT 'id',
|
||||
`data_id` varchar(255) COLLATE utf8_bin NOT NULL COMMENT 'data_id',
|
||||
`group_id` varchar(128) COLLATE utf8_bin NOT NULL COMMENT 'group_id',
|
||||
`tenant_id` varchar(128) COLLATE utf8_bin DEFAULT '' COMMENT 'tenant_id',
|
||||
@@ -101,136 +127,265 @@ CREATE TABLE `config_info_tag` (
|
||||
`app_name` varchar(128) COLLATE utf8_bin DEFAULT NULL COMMENT 'app_name',
|
||||
`content` longtext COLLATE utf8_bin NOT NULL COMMENT 'content',
|
||||
`md5` varchar(32) COLLATE utf8_bin DEFAULT NULL COMMENT 'md5',
|
||||
`gmt_create` datetime NOT NULL DEFAULT '2010-05-05 00:00:00' COMMENT '创建时间',
|
||||
`gmt_modified` datetime NOT NULL DEFAULT '2010-05-05 00:00:00' COMMENT '修改时间',
|
||||
`gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间',
|
||||
`src_user` text COLLATE utf8_bin COMMENT 'source user',
|
||||
`src_ip` varchar(20) COLLATE utf8_bin DEFAULT NULL COMMENT 'source ip',
|
||||
`src_ip` varchar(50) COLLATE utf8_bin DEFAULT NULL COMMENT 'source ip',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `uk_configinfotag_datagrouptenanttag` (`data_id`,`group_id`,`tenant_id`,`tag_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='config_info_tag';
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for `config_tags_relation`
|
||||
-- Records of config_info_tag
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for config_tags_relation
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `config_tags_relation`;
|
||||
CREATE TABLE `config_tags_relation` (
|
||||
`id` bigint(20) NOT NULL COMMENT 'id',
|
||||
`id` bigint NOT NULL COMMENT 'id',
|
||||
`tag_name` varchar(128) COLLATE utf8_bin NOT NULL COMMENT 'tag_name',
|
||||
`tag_type` varchar(64) COLLATE utf8_bin DEFAULT NULL COMMENT 'tag_type',
|
||||
`data_id` varchar(255) COLLATE utf8_bin NOT NULL COMMENT 'data_id',
|
||||
`group_id` varchar(128) COLLATE utf8_bin NOT NULL COMMENT 'group_id',
|
||||
`tenant_id` varchar(128) COLLATE utf8_bin DEFAULT '' COMMENT 'tenant_id',
|
||||
`nid` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`nid` bigint NOT NULL AUTO_INCREMENT COMMENT 'nid, 自增长标识',
|
||||
PRIMARY KEY (`nid`),
|
||||
UNIQUE KEY `uk_configtagrelation_configidtag` (`id`,`tag_name`,`tag_type`),
|
||||
KEY `idx_tenant_id` (`tenant_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='config_tag_relation';
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for `group_capacity`
|
||||
-- Records of config_tags_relation
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for group_capacity
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `group_capacity`;
|
||||
CREATE TABLE `group_capacity` (
|
||||
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
|
||||
`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
|
||||
`group_id` varchar(128) COLLATE utf8_bin NOT NULL DEFAULT '' COMMENT 'Group ID,空字符表示整个集群',
|
||||
`quota` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '配额,0表示使用默认值',
|
||||
`usage` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '使用量',
|
||||
`max_size` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '单个配置大小上限,单位为字节,0表示使用默认值',
|
||||
`max_aggr_count` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '聚合子配置最大个数,,0表示使用默认值',
|
||||
`max_aggr_size` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '单个聚合数据的子配置大小上限,单位为字节,0表示使用默认值',
|
||||
`max_history_count` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '最大变更历史数量',
|
||||
`gmt_create` datetime NOT NULL DEFAULT '2010-05-05 00:00:00' COMMENT '创建时间',
|
||||
`gmt_modified` datetime NOT NULL DEFAULT '2010-05-05 00:00:00' COMMENT '修改时间',
|
||||
`quota` int unsigned NOT NULL DEFAULT '0' COMMENT '配额,0表示使用默认值',
|
||||
`usage` int unsigned NOT NULL DEFAULT '0' COMMENT '使用量',
|
||||
`max_size` int unsigned NOT NULL DEFAULT '0' COMMENT '单个配置大小上限,单位为字节,0表示使用默认值',
|
||||
`max_aggr_count` int unsigned NOT NULL DEFAULT '0' COMMENT '聚合子配置最大个数,,0表示使用默认值',
|
||||
`max_aggr_size` int unsigned NOT NULL DEFAULT '0' COMMENT '单个聚合数据的子配置大小上限,单位为字节,0表示使用默认值',
|
||||
`max_history_count` int unsigned NOT NULL DEFAULT '0' COMMENT '最大变更历史数量',
|
||||
`gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `uk_group_id` (`group_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='集群、各Group容量信息表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for `his_config_info`
|
||||
-- Records of group_capacity
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for his_config_info
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `his_config_info`;
|
||||
CREATE TABLE `his_config_info` (
|
||||
`id` bigint(64) unsigned NOT NULL,
|
||||
`nid` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`data_id` varchar(255) COLLATE utf8_bin NOT NULL,
|
||||
`group_id` varchar(128) COLLATE utf8_bin NOT NULL,
|
||||
`id` bigint unsigned NOT NULL COMMENT 'id',
|
||||
`nid` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'nid, 自增标识',
|
||||
`data_id` varchar(255) COLLATE utf8_bin NOT NULL COMMENT 'data_id',
|
||||
`group_id` varchar(128) COLLATE utf8_bin NOT NULL COMMENT 'group_id',
|
||||
`app_name` varchar(128) COLLATE utf8_bin DEFAULT NULL COMMENT 'app_name',
|
||||
`content` longtext COLLATE utf8_bin NOT NULL,
|
||||
`md5` varchar(32) COLLATE utf8_bin DEFAULT NULL,
|
||||
`gmt_create` datetime NOT NULL DEFAULT '2010-05-05 00:00:00',
|
||||
`gmt_modified` datetime NOT NULL DEFAULT '2010-05-05 00:00:00',
|
||||
`src_user` text COLLATE utf8_bin,
|
||||
`src_ip` varchar(20) COLLATE utf8_bin DEFAULT NULL,
|
||||
`op_type` char(10) COLLATE utf8_bin DEFAULT NULL,
|
||||
`content` longtext COLLATE utf8_bin NOT NULL COMMENT 'content',
|
||||
`md5` varchar(32) COLLATE utf8_bin DEFAULT NULL COMMENT 'md5',
|
||||
`gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间',
|
||||
`src_user` text COLLATE utf8_bin COMMENT 'source user',
|
||||
`src_ip` varchar(50) COLLATE utf8_bin DEFAULT NULL COMMENT 'source ip',
|
||||
`op_type` char(10) COLLATE utf8_bin DEFAULT NULL COMMENT 'operation type',
|
||||
`tenant_id` varchar(128) COLLATE utf8_bin DEFAULT '' COMMENT '租户字段',
|
||||
`encrypted_data_key` varchar(1024) COLLATE utf8_bin NOT NULL DEFAULT '' COMMENT '密钥',
|
||||
`publish_type` varchar(50) COLLATE utf8_bin DEFAULT 'formal' COMMENT 'publish type gray or formal',
|
||||
`gray_name` varchar(50) COLLATE utf8_bin DEFAULT NULL COMMENT 'gray name',
|
||||
`ext_info` longtext COLLATE utf8_bin COMMENT 'ext info',
|
||||
PRIMARY KEY (`nid`),
|
||||
KEY `idx_gmt_create` (`gmt_create`),
|
||||
KEY `idx_gmt_modified` (`gmt_modified`),
|
||||
KEY `idx_did` (`data_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='多租户改造';
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='多租户改造';
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for `roles`
|
||||
-- Table structure for permissions
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `permissions`;
|
||||
CREATE TABLE `permissions` (
|
||||
`role` varchar(50) NOT NULL COMMENT 'role',
|
||||
`resource` varchar(128) NOT NULL COMMENT 'resource',
|
||||
`action` varchar(8) NOT NULL COMMENT 'action',
|
||||
UNIQUE KEY `uk_role_permission` (`role`,`resource`,`action`) USING BTREE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of permissions
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for roles
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `roles`;
|
||||
CREATE TABLE `roles` (
|
||||
`username` varchar(50) NOT NULL,
|
||||
`role` varchar(50) NOT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
||||
`username` varchar(50) NOT NULL COMMENT 'username',
|
||||
`role` varchar(50) NOT NULL COMMENT 'role',
|
||||
UNIQUE KEY `idx_user_role` (`username`,`role`) USING BTREE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for `tenant_capacity`
|
||||
-- Records of roles
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `roles` (`username`, `role`) VALUES ('nacos', 'ROLE_ADMIN');
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for tenant_capacity
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `tenant_capacity`;
|
||||
CREATE TABLE `tenant_capacity` (
|
||||
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
|
||||
`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
|
||||
`tenant_id` varchar(128) COLLATE utf8_bin NOT NULL DEFAULT '' COMMENT 'Tenant ID',
|
||||
`quota` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '配额,0表示使用默认值',
|
||||
`usage` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '使用量',
|
||||
`max_size` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '单个配置大小上限,单位为字节,0表示使用默认值',
|
||||
`max_aggr_count` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '聚合子配置最大个数',
|
||||
`max_aggr_size` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '单个聚合数据的子配置大小上限,单位为字节,0表示使用默认值',
|
||||
`max_history_count` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '最大变更历史数量',
|
||||
`gmt_create` datetime NOT NULL DEFAULT '2010-05-05 00:00:00' COMMENT '创建时间',
|
||||
`gmt_modified` datetime NOT NULL DEFAULT '2010-05-05 00:00:00' COMMENT '修改时间',
|
||||
`quota` int unsigned NOT NULL DEFAULT '0' COMMENT '配额,0表示使用默认值',
|
||||
`usage` int unsigned NOT NULL DEFAULT '0' COMMENT '使用量',
|
||||
`max_size` int unsigned NOT NULL DEFAULT '0' COMMENT '单个配置大小上限,单位为字节,0表示使用默认值',
|
||||
`max_aggr_count` int unsigned NOT NULL DEFAULT '0' COMMENT '聚合子配置最大个数',
|
||||
`max_aggr_size` int unsigned NOT NULL DEFAULT '0' COMMENT '单个聚合数据的子配置大小上限,单位为字节,0表示使用默认值',
|
||||
`max_history_count` int unsigned NOT NULL DEFAULT '0' COMMENT '最大变更历史数量',
|
||||
`gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `uk_tenant_id` (`tenant_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='租户容量信息表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for `tenant_info`
|
||||
-- Records of tenant_capacity
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for tenant_info
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `tenant_info`;
|
||||
CREATE TABLE `tenant_info` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT 'id',
|
||||
`kp` varchar(128) COLLATE utf8_bin NOT NULL COMMENT 'kp',
|
||||
`tenant_id` varchar(128) COLLATE utf8_bin DEFAULT '' COMMENT 'tenant_id',
|
||||
`tenant_name` varchar(128) COLLATE utf8_bin DEFAULT '' COMMENT 'tenant_name',
|
||||
`tenant_desc` varchar(256) COLLATE utf8_bin DEFAULT NULL COMMENT 'tenant_desc',
|
||||
`create_source` varchar(32) COLLATE utf8_bin DEFAULT NULL COMMENT 'create_source',
|
||||
`gmt_create` bigint(20) NOT NULL COMMENT '创建时间',
|
||||
`gmt_modified` bigint(20) NOT NULL COMMENT '修改时间',
|
||||
`gmt_create` bigint NOT NULL COMMENT '创建时间',
|
||||
`gmt_modified` bigint NOT NULL COMMENT '修改时间',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `uk_tenant_info_kptenantid` (`kp`,`tenant_id`),
|
||||
KEY `idx_tenant_id` (`tenant_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='tenant_info';
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for `users`
|
||||
-- Records of tenant_info
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for users
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `users`;
|
||||
CREATE TABLE `users` (
|
||||
`username` varchar(50) NOT NULL,
|
||||
`password` varchar(500) NOT NULL,
|
||||
`enabled` tinyint(1) NOT NULL,
|
||||
`username` varchar(50) NOT NULL COMMENT 'username',
|
||||
`password` varchar(500) NOT NULL COMMENT 'password',
|
||||
`enabled` tinyint(1) NOT NULL COMMENT 'enabled',
|
||||
PRIMARY KEY (`username`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of `users`
|
||||
-- Records of users
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `users` VALUES ('nacos', '$2a$10$EuWPZHzz32dJN7jexM34MOeYirDdFAZm2kuWj7VEOJhhZkDrxfvUu', '1');
|
||||
INSERT INTO `users` (`username`, `password`, `enabled`) VALUES ('nacos', '$2a$10$W6PKgRTzXUp6R/NY853Kn.nRaIcX3whIMTZ/WWkNqo2MTOeSBjKJq', 1);
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for pipeline_execution
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `pipeline_execution`;
|
||||
CREATE TABLE `pipeline_execution` (
|
||||
`execution_id` varchar(64) NOT NULL COMMENT '执行ID',
|
||||
`resource_type` varchar(32) NOT NULL COMMENT '资源类型',
|
||||
`resource_name` varchar(256) NOT NULL COMMENT '资源名称',
|
||||
`namespace_id` varchar(128) DEFAULT NULL COMMENT '命名空间ID',
|
||||
`version` varchar(64) DEFAULT NULL COMMENT '版本',
|
||||
`status` varchar(32) NOT NULL COMMENT '执行状态',
|
||||
`pipeline` longtext NOT NULL COMMENT 'pipeline节点结果JSON',
|
||||
`create_time` bigint(20) NOT NULL COMMENT '创建时间',
|
||||
`update_time` bigint(20) NOT NULL COMMENT '修改时间',
|
||||
PRIMARY KEY (`execution_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='AI资源发布审核Pipeline执行记录';
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for ai_resource
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `ai_resource`;
|
||||
CREATE TABLE `ai_resource` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
|
||||
`gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间',
|
||||
`name` varchar(256) NOT NULL COMMENT '资源名称',
|
||||
`type` varchar(32) NOT NULL COMMENT '资源类型',
|
||||
`c_desc` varchar(2048) DEFAULT NULL COMMENT '资源描述',
|
||||
`status` varchar(32) DEFAULT NULL COMMENT '资源状态',
|
||||
`namespace_id` varchar(128) NOT NULL DEFAULT '' COMMENT '命名空间ID',
|
||||
`biz_tags` varchar(1024) DEFAULT NULL COMMENT '业务标签',
|
||||
`ext` longtext DEFAULT NULL COMMENT '扩展信息(JSON)',
|
||||
`c_from` varchar(256) NOT NULL DEFAULT 'local' COMMENT '来源标识(导入/同步来源)',
|
||||
`version_info` longtext DEFAULT NULL COMMENT '版本信息(JSON)',
|
||||
`meta_version` bigint(20) NOT NULL DEFAULT 1 COMMENT '元数据版本(乐观锁)',
|
||||
`scope` varchar(16) NOT NULL DEFAULT 'PRIVATE' COMMENT '可见性: PUBLIC/PRIVATE',
|
||||
`owner` varchar(128) NOT NULL DEFAULT '' COMMENT '创建者用户名',
|
||||
`download_count` bigint(20) NOT NULL DEFAULT 0 COMMENT '下载次数',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `uk_ai_resource_ns_name_type` (`namespace_id`,`name`,`type`,`c_from`),
|
||||
KEY `idx_ai_resource_name` (`name`),
|
||||
KEY `idx_ai_resource_type` (`type`),
|
||||
KEY `idx_ai_resource_gmt_modified` (`gmt_modified`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='AI资源元数据表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for ai_resource_version
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `ai_resource_version`;
|
||||
CREATE TABLE `ai_resource_version` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
|
||||
`gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间',
|
||||
`type` varchar(32) NOT NULL COMMENT '资源类型',
|
||||
`author` varchar(128) DEFAULT NULL COMMENT '作者',
|
||||
`name` varchar(256) NOT NULL COMMENT '资源名称',
|
||||
`c_desc` varchar(2048) DEFAULT NULL COMMENT '版本描述',
|
||||
`status` varchar(32) NOT NULL COMMENT '版本状态',
|
||||
`version` varchar(64) NOT NULL COMMENT '版本号',
|
||||
`namespace_id` varchar(128) NOT NULL DEFAULT '' COMMENT '命名空间ID',
|
||||
`storage` longtext DEFAULT NULL COMMENT '存储信息(JSON)',
|
||||
`publish_pipeline_info` longtext DEFAULT NULL COMMENT '发布流水线信息(JSON)',
|
||||
`download_count` bigint(20) NOT NULL DEFAULT 0 COMMENT '下载次数',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `uk_ai_resource_ver_ns_name_type_ver` (`namespace_id`,`name`,`type`,`version`),
|
||||
KEY `idx_ai_resource_ver_name` (`name`),
|
||||
KEY `idx_ai_resource_ver_status` (`status`),
|
||||
KEY `idx_ai_resource_ver_gmt_modified` (`gmt_modified`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='AI资源版本表';
|
||||
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
@@ -0,0 +1,169 @@
|
||||
USE pigxx_pay;
|
||||
|
||||
SET NAMES utf8mb4;
|
||||
SET FOREIGN_KEY_CHECKS = 0;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for pay_channel
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `pay_channel`;
|
||||
CREATE TABLE `pay_channel` (
|
||||
`id` bigint(20) NOT NULL COMMENT '渠道主键ID',
|
||||
`mch_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '商户ID',
|
||||
`channel_id` varchar(24) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '渠道ID',
|
||||
`channel_name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '渠道名称',
|
||||
`channel_mch_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '渠道商户ID',
|
||||
`return_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '前端回调地址',
|
||||
`notify_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '后端回调地址',
|
||||
`state` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '状态',
|
||||
`param` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT '参数',
|
||||
`remark` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '备注',
|
||||
`del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '删除标志',
|
||||
`create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||
`tenant_id` bigint(20) DEFAULT NULL COMMENT '租户ID',
|
||||
`app_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '应用ID',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='支付渠道表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of pay_channel
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for pay_goods_order
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `pay_goods_order`;
|
||||
CREATE TABLE `pay_goods_order` (
|
||||
`goods_order_id` bigint(20) NOT NULL COMMENT '商品订单ID',
|
||||
`goods_id` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '商品ID',
|
||||
`goods_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '商品名称',
|
||||
`amount` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '金额',
|
||||
`user_id` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '用户ID',
|
||||
`status` varchar(4) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '0' COMMENT '订单状态:订单生成(0)、支付成功(1)、处理完成(2)、处理失败(-1)',
|
||||
`pay_order_id` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '支付订单ID',
|
||||
`del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '删除标志',
|
||||
`create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||
`tenant_id` bigint(20) DEFAULT NULL COMMENT '租户ID',
|
||||
PRIMARY KEY (`goods_order_id`) USING BTREE,
|
||||
UNIQUE KEY `IDX_PayOrderId` (`pay_order_id`) USING BTREE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='商品订单表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of pay_goods_order
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for pay_notify_record
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `pay_notify_record`;
|
||||
CREATE TABLE `pay_notify_record` (
|
||||
`id` bigint(20) NOT NULL COMMENT 'ID',
|
||||
`notify_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '通知ID',
|
||||
`request` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '请求内容',
|
||||
`response` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '响应内容',
|
||||
`order_no` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '订单号',
|
||||
`http_status` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'http状态',
|
||||
`del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '删除标志',
|
||||
`create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||
`tenant_id` bigint(20) DEFAULT NULL COMMENT '租户ID',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='通知记录日志表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of pay_notify_record
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for pay_refund_order
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `pay_refund_order`;
|
||||
CREATE TABLE `pay_refund_order` (
|
||||
`refund_order_id` bigint(20) NOT NULL COMMENT '退款订单ID',
|
||||
`pay_order_id` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '支付订单号',
|
||||
`channel_pay_order_no` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '渠道支付订单号',
|
||||
`mch_id` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '商户号',
|
||||
`mch_refund_no` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '商户退款单号',
|
||||
`channel_id` varchar(24) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '渠道ID',
|
||||
`pay_amount` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '支付金额',
|
||||
`refund_amount` bigint(20) NOT NULL COMMENT '退款金额,单位分',
|
||||
`currency` varchar(3) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '币种',
|
||||
`status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '退款状态:0-订单生成,1-退款中,2-退款成功,3-退款失败,4-业务处理完成',
|
||||
`result` tinyint(4) NOT NULL DEFAULT '0' COMMENT '退款结果:0-不确认结果,1-等待手动处理,2-确认成功,3-确认失败',
|
||||
`client_ip` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '客户端IP',
|
||||
`device` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '设备信息',
|
||||
`remark` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '备注信息',
|
||||
`channel_user` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '渠道用户标识',
|
||||
`username` varchar(24) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '用户名',
|
||||
`channel_mch_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '渠道商户号',
|
||||
`channel_order_no` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '渠道订单号',
|
||||
`channel_err_code` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '渠道错误码',
|
||||
`channel_err_msg` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '渠道错误信息',
|
||||
`extra` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '附加信息',
|
||||
`notify_url` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '通知URL',
|
||||
`param1` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '扩展参数1',
|
||||
`param2` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '扩展参数2',
|
||||
`expire_time` datetime DEFAULT NULL COMMENT '订单失效时间',
|
||||
`refund_succ_time` datetime DEFAULT NULL COMMENT '订单退款成功时间',
|
||||
`del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '删除标志',
|
||||
`create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||
`tenant_id` bigint(20) DEFAULT NULL COMMENT '租户ID',
|
||||
PRIMARY KEY (`refund_order_id`) USING BTREE,
|
||||
UNIQUE KEY `IDX_MchId_MchOrderNo` (`mch_id`,`mch_refund_no`) USING BTREE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='退款订单表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of pay_refund_order
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for pay_trade_order
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `pay_trade_order`;
|
||||
CREATE TABLE `pay_trade_order` (
|
||||
`order_id` bigint(20) NOT NULL COMMENT '订单ID',
|
||||
`channel_id` varchar(24) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '渠道ID',
|
||||
`amount` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '支付金额',
|
||||
`currency` varchar(3) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '币种',
|
||||
`status` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '0' COMMENT '支付状态:0-订单生成,1-支付中(目前未使用),2-支付成功,3-业务处理完成',
|
||||
`client_ip` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '客户端IP',
|
||||
`device` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '设备信息',
|
||||
`subject` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '标题',
|
||||
`body` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '内容',
|
||||
`extra` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '附加信息',
|
||||
`channel_mch_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '渠道商户号',
|
||||
`channel_order_no` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '渠道订单号',
|
||||
`err_code` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '错误码',
|
||||
`err_msg` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '错误信息',
|
||||
`param1` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '扩展参数1',
|
||||
`param2` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '扩展参数2',
|
||||
`notify_url` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '通知URL',
|
||||
`notify_count` tinyint(4) DEFAULT '0' COMMENT '通知次数',
|
||||
`last_notify_time` bigint(20) DEFAULT NULL COMMENT '最后一次通知时间',
|
||||
`expire_time` bigint(20) DEFAULT NULL COMMENT '订单失效时间',
|
||||
`pay_succ_time` datetime DEFAULT NULL COMMENT '订单支付成功时间',
|
||||
`create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||
`del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '删除标志',
|
||||
`tenant_id` bigint(20) DEFAULT NULL COMMENT '租户ID',
|
||||
PRIMARY KEY (`order_id`) USING BTREE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='支付订单表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of pay_trade_order
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
COMMIT;
|
||||
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
@@ -0,0 +1,366 @@
|
||||
USE pigxx_codegen;
|
||||
|
||||
SET NAMES utf8mb4;
|
||||
SET FOREIGN_KEY_CHECKS = 0;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for gen_datasource_conf
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `gen_datasource_conf`;
|
||||
CREATE TABLE `gen_datasource_conf` (
|
||||
`id` bigint NOT NULL COMMENT '主键',
|
||||
`name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '别名',
|
||||
`url` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'jdbcurl',
|
||||
`username` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '用户名',
|
||||
`password` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '密码',
|
||||
`create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新',
|
||||
`del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '删除标记',
|
||||
`tenant_id` bigint DEFAULT NULL COMMENT '租户ID',
|
||||
`ds_type` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '数据库类型',
|
||||
`conf_type` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '配置类型',
|
||||
`ds_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '数据库名称',
|
||||
`instance` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '实例',
|
||||
`port` int DEFAULT NULL COMMENT '端口',
|
||||
`host` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '主机',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='数据源表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of gen_datasource_conf
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for gen_field_type
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `gen_field_type`;
|
||||
CREATE TABLE `gen_field_type` (
|
||||
`id` bigint NOT NULL COMMENT 'id',
|
||||
`column_type` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '字段类型',
|
||||
`attr_type` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '属性类型',
|
||||
`package_name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '属性包名',
|
||||
`default_form_type` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '默认表单类型',
|
||||
`default_query_form_type` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '默认查询表单类型',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
`create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '创建人',
|
||||
`update_time` datetime DEFAULT NULL COMMENT '修改时间',
|
||||
`update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '修改人',
|
||||
`del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '删除标记',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `column_type` (`column_type`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=1634915190321451010 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='字段类型管理';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of gen_field_type
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `gen_field_type` (`id`, `column_type`, `attr_type`, `package_name`, `default_form_type`, `default_query_form_type`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`) VALUES (1,'datetime','LocalDateTime','java.time.LocalDateTime','datetime','datetimerange','2023-02-06 08:45:10',NULL,NULL,NULL,'0');
|
||||
INSERT INTO `gen_field_type` (`id`, `column_type`, `attr_type`, `package_name`, `default_form_type`, `default_query_form_type`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`) VALUES (2,'date','LocalDate','java.time.LocalDate','date','daterange','2023-02-06 08:45:10',NULL,NULL,NULL,'0');
|
||||
INSERT INTO `gen_field_type` (`id`, `column_type`, `attr_type`, `package_name`, `default_form_type`, `default_query_form_type`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`) VALUES (3,'tinyint','Integer',NULL,'number','number','2023-02-06 08:45:11',NULL,NULL,NULL,'0');
|
||||
INSERT INTO `gen_field_type` (`id`, `column_type`, `attr_type`, `package_name`, `default_form_type`, `default_query_form_type`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`) VALUES (4,'smallint','Integer',NULL,'number','number','2023-02-06 08:45:11',NULL,NULL,NULL,'0');
|
||||
INSERT INTO `gen_field_type` (`id`, `column_type`, `attr_type`, `package_name`, `default_form_type`, `default_query_form_type`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`) VALUES (5,'mediumint','Integer',NULL,'number','number','2023-02-06 08:45:11',NULL,NULL,NULL,'0');
|
||||
INSERT INTO `gen_field_type` (`id`, `column_type`, `attr_type`, `package_name`, `default_form_type`, `default_query_form_type`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`) VALUES (6,'int','Integer',NULL,'number','number','2023-02-06 08:45:11',NULL,NULL,NULL,'0');
|
||||
INSERT INTO `gen_field_type` (`id`, `column_type`, `attr_type`, `package_name`, `default_form_type`, `default_query_form_type`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`) VALUES (7,'integer','Integer',NULL,'number','number','2023-02-06 08:45:11',NULL,NULL,NULL,'0');
|
||||
INSERT INTO `gen_field_type` (`id`, `column_type`, `attr_type`, `package_name`, `default_form_type`, `default_query_form_type`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`) VALUES (8,'bigint','Long',NULL,'number','number','2023-02-06 08:45:11',NULL,NULL,NULL,'0');
|
||||
INSERT INTO `gen_field_type` (`id`, `column_type`, `attr_type`, `package_name`, `default_form_type`, `default_query_form_type`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`) VALUES (9,'float','Float',NULL,'number','number','2023-02-06 08:45:11',NULL,NULL,NULL,'0');
|
||||
INSERT INTO `gen_field_type` (`id`, `column_type`, `attr_type`, `package_name`, `default_form_type`, `default_query_form_type`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`) VALUES (10,'double','Double',NULL,'number','number','2023-02-06 08:45:11',NULL,NULL,NULL,'0');
|
||||
INSERT INTO `gen_field_type` (`id`, `column_type`, `attr_type`, `package_name`, `default_form_type`, `default_query_form_type`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`) VALUES (11,'decimal','BigDecimal','java.math.BigDecimal','number','number','2023-02-06 08:45:11',NULL,NULL,NULL,'0');
|
||||
INSERT INTO `gen_field_type` (`id`, `column_type`, `attr_type`, `package_name`, `default_form_type`, `default_query_form_type`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`) VALUES (12,'bit','Boolean',NULL,'radio','radio','2023-02-06 08:45:11',NULL,NULL,NULL,'0');
|
||||
INSERT INTO `gen_field_type` (`id`, `column_type`, `attr_type`, `package_name`, `default_form_type`, `default_query_form_type`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`) VALUES (13,'char','String',NULL,'radio','radio','2023-02-06 08:45:11',NULL,NULL,NULL,'0');
|
||||
INSERT INTO `gen_field_type` (`id`, `column_type`, `attr_type`, `package_name`, `default_form_type`, `default_query_form_type`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`) VALUES (14,'varchar','String',NULL,'text','text','2023-02-06 08:45:11',NULL,NULL,NULL,'0');
|
||||
INSERT INTO `gen_field_type` (`id`, `column_type`, `attr_type`, `package_name`, `default_form_type`, `default_query_form_type`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`) VALUES (15,'tinytext','String',NULL,'textarea','text','2023-02-06 08:45:11',NULL,NULL,NULL,'0');
|
||||
INSERT INTO `gen_field_type` (`id`, `column_type`, `attr_type`, `package_name`, `default_form_type`, `default_query_form_type`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`) VALUES (16,'text','String',NULL,'textarea','text','2023-02-06 08:45:11',NULL,NULL,NULL,'0');
|
||||
INSERT INTO `gen_field_type` (`id`, `column_type`, `attr_type`, `package_name`, `default_form_type`, `default_query_form_type`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`) VALUES (17,'mediumtext','String',NULL,'textarea','text','2023-02-06 08:45:11',NULL,NULL,NULL,'0');
|
||||
INSERT INTO `gen_field_type` (`id`, `column_type`, `attr_type`, `package_name`, `default_form_type`, `default_query_form_type`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`) VALUES (18,'longtext','String',NULL,'textarea','text','2023-02-06 08:45:11',NULL,NULL,NULL,'0');
|
||||
INSERT INTO `gen_field_type` (`id`, `column_type`, `attr_type`, `package_name`, `default_form_type`, `default_query_form_type`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`) VALUES (19,'timestamp','LocalDateTime','java.time.LocalDateTime','datetime','datetimerange','2023-02-06 08:45:11',NULL,NULL,NULL,'0');
|
||||
INSERT INTO `gen_field_type` (`id`, `column_type`, `attr_type`, `package_name`, `default_form_type`, `default_query_form_type`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`) VALUES (20,'NUMBER','Integer',NULL,'number','number','2023-02-06 08:45:11',NULL,NULL,NULL,'0');
|
||||
INSERT INTO `gen_field_type` (`id`, `column_type`, `attr_type`, `package_name`, `default_form_type`, `default_query_form_type`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`) VALUES (21,'BINARY_INTEGER','Integer',NULL,'number','number','2023-02-06 08:45:12',NULL,NULL,NULL,'0');
|
||||
INSERT INTO `gen_field_type` (`id`, `column_type`, `attr_type`, `package_name`, `default_form_type`, `default_query_form_type`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`) VALUES (22,'BINARY_FLOAT','Float',NULL,'number','number','2023-02-06 08:45:12',NULL,NULL,NULL,'0');
|
||||
INSERT INTO `gen_field_type` (`id`, `column_type`, `attr_type`, `package_name`, `default_form_type`, `default_query_form_type`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`) VALUES (23,'BINARY_DOUBLE','Double',NULL,'number','number','2023-02-06 08:45:12',NULL,NULL,NULL,'0');
|
||||
INSERT INTO `gen_field_type` (`id`, `column_type`, `attr_type`, `package_name`, `default_form_type`, `default_query_form_type`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`) VALUES (24,'VARCHAR2','String',NULL,'text','text','2023-02-06 08:45:12',NULL,NULL,NULL,'0');
|
||||
INSERT INTO `gen_field_type` (`id`, `column_type`, `attr_type`, `package_name`, `default_form_type`, `default_query_form_type`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`) VALUES (25,'NVARCHAR','String',NULL,'text','text','2023-02-06 08:45:12',NULL,NULL,NULL,'0');
|
||||
INSERT INTO `gen_field_type` (`id`, `column_type`, `attr_type`, `package_name`, `default_form_type`, `default_query_form_type`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`) VALUES (26,'NVARCHAR2','String',NULL,'text','text','2023-02-06 08:45:12',NULL,NULL,NULL,'0');
|
||||
INSERT INTO `gen_field_type` (`id`, `column_type`, `attr_type`, `package_name`, `default_form_type`, `default_query_form_type`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`) VALUES (27,'CLOB','String',NULL,'textarea','text','2023-02-06 08:45:12',NULL,NULL,NULL,'0');
|
||||
INSERT INTO `gen_field_type` (`id`, `column_type`, `attr_type`, `package_name`, `default_form_type`, `default_query_form_type`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`) VALUES (28,'int8','Long',NULL,'number','number','2023-02-06 08:45:12',NULL,NULL,NULL,'0');
|
||||
INSERT INTO `gen_field_type` (`id`, `column_type`, `attr_type`, `package_name`, `default_form_type`, `default_query_form_type`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`) VALUES (29,'int4','Integer',NULL,'number','number','2023-02-06 08:45:12',NULL,NULL,NULL,'0');
|
||||
INSERT INTO `gen_field_type` (`id`, `column_type`, `attr_type`, `package_name`, `default_form_type`, `default_query_form_type`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`) VALUES (30,'int2','Integer',NULL,'number','number','2023-02-06 08:45:12',NULL,NULL,NULL,'0');
|
||||
INSERT INTO `gen_field_type` (`id`, `column_type`, `attr_type`, `package_name`, `default_form_type`, `default_query_form_type`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`) VALUES (31,'numeric','BigDecimal','java.math.BigDecimal','number','number','2023-02-06 08:45:12',NULL,NULL,NULL,'0');
|
||||
INSERT INTO `gen_field_type` (`id`, `column_type`, `attr_type`, `package_name`, `default_form_type`, `default_query_form_type`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`) VALUES (32,'json','String',NULL,'textarea','text','2023-02-06 08:45:12',NULL,NULL,NULL,'0');
|
||||
INSERT INTO `gen_field_type` (`id`, `column_type`, `attr_type`, `package_name`, `default_form_type`, `default_query_form_type`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`) VALUES (33,'BPCHAR','String',NULL,'text','text','2026-04-07 20:27:29',NULL,NULL,NULL,'0');
|
||||
INSERT INTO `gen_field_type` (`id`, `column_type`, `attr_type`, `package_name`, `default_form_type`, `default_query_form_type`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`) VALUES (34,'time','LocalTime','java.time.LocalTime','text','text','2026-04-07 20:47:09',NULL,'2026-04-07 20:47:09',NULL,'0');
|
||||
INSERT INTO `gen_field_type` (`id`, `column_type`, `attr_type`, `package_name`, `default_form_type`, `default_query_form_type`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`) VALUES (35,'year','Integer',NULL,'number','number','2026-04-07 20:47:09',NULL,'2026-04-07 20:47:09',NULL,'0');
|
||||
INSERT INTO `gen_field_type` (`id`, `column_type`, `attr_type`, `package_name`, `default_form_type`, `default_query_form_type`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`) VALUES (36,'enum','String',NULL,'text','text','2026-04-07 20:47:09',NULL,'2026-04-07 20:47:09',NULL,'0');
|
||||
INSERT INTO `gen_field_type` (`id`, `column_type`, `attr_type`, `package_name`, `default_form_type`, `default_query_form_type`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`) VALUES (37,'set','String',NULL,'text','text','2026-04-07 20:47:09',NULL,'2026-04-07 20:47:09',NULL,'0');
|
||||
INSERT INTO `gen_field_type` (`id`, `column_type`, `attr_type`, `package_name`, `default_form_type`, `default_query_form_type`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`) VALUES (38,'bool','Boolean',NULL,'radio','radio','2026-04-07 20:47:09',NULL,'2026-04-07 20:47:09',NULL,'0');
|
||||
INSERT INTO `gen_field_type` (`id`, `column_type`, `attr_type`, `package_name`, `default_form_type`, `default_query_form_type`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`) VALUES (39,'boolean','Boolean',NULL,'radio','radio','2026-04-07 20:47:09',NULL,'2026-04-07 20:47:09',NULL,'0');
|
||||
INSERT INTO `gen_field_type` (`id`, `column_type`, `attr_type`, `package_name`, `default_form_type`, `default_query_form_type`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`) VALUES (40,'float4','Float',NULL,'number','number','2026-04-07 20:47:09',NULL,'2026-04-07 20:47:09',NULL,'0');
|
||||
INSERT INTO `gen_field_type` (`id`, `column_type`, `attr_type`, `package_name`, `default_form_type`, `default_query_form_type`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`) VALUES (41,'float8','Double',NULL,'number','number','2026-04-07 20:47:09',NULL,'2026-04-07 20:47:09',NULL,'0');
|
||||
INSERT INTO `gen_field_type` (`id`, `column_type`, `attr_type`, `package_name`, `default_form_type`, `default_query_form_type`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`) VALUES (42,'jsonb','String',NULL,'textarea','text','2026-04-07 20:47:09',NULL,'2026-04-07 20:47:09',NULL,'0');
|
||||
INSERT INTO `gen_field_type` (`id`, `column_type`, `attr_type`, `package_name`, `default_form_type`, `default_query_form_type`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`) VALUES (43,'uuid','String',NULL,'text','text','2026-04-07 20:47:09',NULL,'2026-04-07 20:47:09',NULL,'0');
|
||||
INSERT INTO `gen_field_type` (`id`, `column_type`, `attr_type`, `package_name`, `default_form_type`, `default_query_form_type`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`) VALUES (44,'serial','Integer',NULL,'number','number','2026-04-07 20:47:09',NULL,'2026-04-07 20:47:09',NULL,'0');
|
||||
INSERT INTO `gen_field_type` (`id`, `column_type`, `attr_type`, `package_name`, `default_form_type`, `default_query_form_type`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`) VALUES (45,'bigserial','Long',NULL,'number','number','2026-04-07 20:47:09',NULL,'2026-04-07 20:47:09',NULL,'0');
|
||||
INSERT INTO `gen_field_type` (`id`, `column_type`, `attr_type`, `package_name`, `default_form_type`, `default_query_form_type`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`) VALUES (46,'smallserial','Integer',NULL,'number','number','2026-04-07 20:47:09',NULL,'2026-04-07 20:47:09',NULL,'0');
|
||||
INSERT INTO `gen_field_type` (`id`, `column_type`, `attr_type`, `package_name`, `default_form_type`, `default_query_form_type`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`) VALUES (47,'timestamptz','LocalDateTime','java.time.LocalDateTime','datetime','datetimerange','2026-04-07 20:47:09',NULL,'2026-04-07 20:47:09',NULL,'0');
|
||||
INSERT INTO `gen_field_type` (`id`, `column_type`, `attr_type`, `package_name`, `default_form_type`, `default_query_form_type`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`) VALUES (48,'timetz','String',NULL,'text','text','2026-04-07 20:47:09',NULL,'2026-04-07 20:47:09',NULL,'0');
|
||||
INSERT INTO `gen_field_type` (`id`, `column_type`, `attr_type`, `package_name`, `default_form_type`, `default_query_form_type`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`) VALUES (49,'bytea','String',NULL,'textarea','text','2026-04-07 20:47:09',NULL,'2026-04-07 20:47:09',NULL,'0');
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for gen_group
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `gen_group`;
|
||||
CREATE TABLE `gen_group` (
|
||||
`id` bigint NOT NULL,
|
||||
`group_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '分组名称',
|
||||
`group_desc` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '分组描述',
|
||||
`tenant_id` bigint NOT NULL COMMENT '租户ID',
|
||||
`create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT ' ' COMMENT '创建人',
|
||||
`update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT ' ' COMMENT '修改人',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建人',
|
||||
`update_time` datetime DEFAULT NULL COMMENT '修改人',
|
||||
`del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '删除标记',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='模板分组';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of gen_group
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `gen_group` (`id`, `group_name`, `group_desc`, `tenant_id`, `create_by`, `update_by`, `create_time`, `update_time`, `del_flag`) VALUES (1,'单表增删改查V202611',NULL,1,'admin','admin','2026-04-08 17:38:24','2026-04-08 17:38:24','0');
|
||||
INSERT INTO `gen_group` (`id`, `group_name`, `group_desc`, `tenant_id`, `create_by`, `update_by`, `create_time`, `update_time`, `del_flag`) VALUES (2,'主子表增删改查V202611',NULL,1,'admin','admin','2026-04-08 17:38:24','2026-04-08 17:38:24','0');
|
||||
INSERT INTO `gen_group` (`id`, `group_name`, `group_desc`, `tenant_id`, `create_by`, `update_by`, `create_time`, `update_time`, `del_flag`) VALUES (3,'树形表格增删改查V202611',NULL,1,'admin','admin','2026-04-08 17:38:24','2026-04-08 17:38:24','0');
|
||||
INSERT INTO `gen_group` (`id`, `group_name`, `group_desc`, `tenant_id`, `create_by`, `update_by`, `create_time`, `update_time`, `del_flag`) VALUES (4,'左树右表增删改查V202611',NULL,1,'admin','admin','2026-04-08 17:38:24','2026-04-08 17:38:24','0');
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for gen_table
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `gen_table`;
|
||||
CREATE TABLE `gen_table` (
|
||||
`id` bigint NOT NULL COMMENT 'id',
|
||||
`table_name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '表名',
|
||||
`class_name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '类名',
|
||||
`db_type` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '数据库类型',
|
||||
`table_comment` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '说明',
|
||||
`author` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '作者',
|
||||
`email` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '邮箱',
|
||||
`package_name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '项目包名',
|
||||
`version` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '项目版本号',
|
||||
`i18n` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '是否生成带有i18n 0 不带有 1带有',
|
||||
`style` bigint DEFAULT NULL COMMENT '代码风格',
|
||||
`sync_menu_id` bigint DEFAULT NULL COMMENT '所属菜单ID',
|
||||
`sync_route` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '是否自动同步路由',
|
||||
`child_table_name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '子表名称',
|
||||
`main_field` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '主表关联键',
|
||||
`child_field` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '子表关联键',
|
||||
`parent_field` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '父表关联键',
|
||||
`name_field` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '名称字段',
|
||||
`generator_type` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '生成方式 0:zip压缩包 1:自定义目录',
|
||||
`backend_path` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '后端生成路径',
|
||||
`frontend_path` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '前端生成路径',
|
||||
`module_name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '模块名',
|
||||
`function_name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '功能名',
|
||||
`form_layout` tinyint DEFAULT NULL COMMENT '表单布局 1:一列 2:两列',
|
||||
`ds_name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '数据源ID',
|
||||
`baseclass_id` bigint DEFAULT NULL COMMENT '基类ID',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `table_name_idx` (`table_name`,`ds_name`) USING BTREE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='代码生成表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of gen_table
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for gen_table_column
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `gen_table_column`;
|
||||
CREATE TABLE `gen_table_column` (
|
||||
`id` bigint NOT NULL COMMENT 'id',
|
||||
`ds_name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '数据源名称',
|
||||
`table_name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '表名称',
|
||||
`field_name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '字段名称',
|
||||
`field_type` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '字段类型',
|
||||
`field_comment` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '字段说明',
|
||||
`attr_name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '属性名',
|
||||
`attr_type` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '属性类型',
|
||||
`package_name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '属性包名',
|
||||
`sort` int DEFAULT NULL COMMENT '排序',
|
||||
`auto_fill` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '自动填充 DEFAULT、INSERT、UPDATE、INSERT_UPDATE',
|
||||
`primary_pk` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '主键 0:否 1:是',
|
||||
`base_field` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '基类字段 0:否 1:是',
|
||||
`form_item` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '表单项 0:否 1:是',
|
||||
`form_required` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '表单必填 0:否 1:是',
|
||||
`form_type` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '表单类型',
|
||||
`form_validator` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '表单效验',
|
||||
`grid_item` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '列表项 0:否 1:是',
|
||||
`grid_sort` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '列表排序 0:否 1:是',
|
||||
`query_item` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '查询项 0:否 1:是',
|
||||
`query_type` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '查询方式',
|
||||
`query_form_type` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '查询表单类型',
|
||||
`field_dict` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '字典类型',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='代码生成表字段';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of gen_table_column
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for gen_template
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `gen_template`;
|
||||
CREATE TABLE `gen_template` (
|
||||
`id` bigint NOT NULL COMMENT '主键',
|
||||
`template_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '模板名称',
|
||||
`generator_path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '模板路径',
|
||||
`template_desc` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '模板描述',
|
||||
`template_code` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '模板代码',
|
||||
`create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新',
|
||||
`del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '0' COMMENT '删除标记',
|
||||
`tenant_id` bigint NOT NULL COMMENT '租户ID',
|
||||
`create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT ' ' COMMENT '创建人',
|
||||
`update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT ' ' COMMENT '修改人',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='模板';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of gen_template
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `gen_template` (`id`, `template_name`, `generator_path`, `template_desc`, `template_code`, `create_time`, `update_time`, `del_flag`, `tenant_id`, `create_by`, `update_by`) VALUES (1,'ControllerV202611','${backendPath}/src/main/java/${packagePath}/${moduleName}/controller/${ClassName}Controller.java','ControllerV202611','## 查询条件按需导入:字符串字段和组织关键字用 StrUtil,其余类型用 Objects;复选框与日期范围两者都不用\n#set($needStrUtil = false)\n#set($needObjects = false)\n#foreach($field in $queryList)\n#if($field.formType == \'checkbox\' || $field.queryFormType == \'daterange\' || $field.queryFormType == \'datetimerange\')\n#elseif($field.formType.startsWith(\'org-\') || $field.attrType == \'String\')\n#set($needStrUtil = true)\n#else\n#set($needObjects = true)\n#end\n#end\n#set($hasOrgQuery = false)\n#foreach($field in $queryList)\n#if($field.formType.startsWith(\'org-\'))\n#set($hasOrgQuery = true)\n#end\n#end\n## 组织字段以 [{id,name}] JSON 存储,按 ${attrName}Keyword 对整列模糊查询,分页和导出共用\n#macro(orgKeywordParams)#foreach($field in $queryList)#if($field.formType.startsWith(\'org-\')), @RequestParam(required = false) String ${field.attrName}Keyword#end#end#end\n#macro(orgKeywordDecl)#foreach($field in $queryList)#if($field.formType.startsWith(\'org-\')), String ${field.attrName}Keyword#end#end#end\n#macro(orgKeywordArgs)#foreach($field in $queryList)#if($field.formType.startsWith(\'org-\')), ${field.attrName}Keyword#end#end#end\n#macro(orgKeywordFilters)\n#if($hasOrgQuery)\n // 组织字段对整列 JSON 做 LIKE:关键字为数字或 id/name 时会误命中,需精确匹配时改用数据库 JSON 函数\n#end\n#foreach($field in $queryList)\n#if($field.formType.startsWith(\'org-\'))\n wrapper.like(StrUtil.isNotBlank(${field.attrName}Keyword), ${ClassName}Entity::$str.getProperty($field.attrName), ${field.attrName}Keyword);\n#end\n#end\n#end\n#set($permissionPrefix = \"${moduleName}_${functionName}\")\n#set($permissionPrefix = $permissionPrefix.toLowerCase())\npackage ${package}.${moduleName}.controller;\n\n#if($needStrUtil)\nimport cn.hutool.core.util.StrUtil;\n#end\nimport cn.hutool.core.util.ArrayUtil;\nimport cn.hutool.core.collection.CollUtil;\nimport com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;\nimport com.baomidou.mybatisplus.core.toolkit.Wrappers;\nimport com.baomidou.mybatisplus.extension.plugins.pagination.Page;\nimport ${package}.common.core.util.R;\nimport ${package}.common.log.annotation.SysLog;\n#if($opensource)\nimport com.pig4cloud.plugin.excel.annotation.ResponseExcel;\nimport com.pig4cloud.plugin.excel.annotation.RequestExcel;\n#else\nimport ${package}.common.excel.annotation.ResponseExcel;\nimport ${package}.common.excel.annotation.RequestExcel;\n#end\nimport ${entityClassName};\nimport ${package}.${moduleName}.service.${ClassName}Service;\n\nimport io.swagger.v3.oas.annotations.security.SecurityRequirement;\n#if($isSpringBoot3)\nimport ${package}.common.security.annotation.HasPermission;\nimport org.springdoc.core.annotations.ParameterObject;\n#else\nimport org.springframework.security.access.prepost.PreAuthorize;\nimport org.springdoc.api.annotations.ParameterObject;\n#end\nimport org.springframework.http.HttpHeaders;\nimport io.swagger.v3.oas.annotations.tags.Tag;\nimport io.swagger.v3.oas.annotations.Operation;\nimport lombok.RequiredArgsConstructor;\nimport org.springframework.validation.BindingResult;\nimport org.springframework.web.bind.annotation.*;\n\nimport java.util.List;\n#if($needObjects)\nimport java.util.Objects;\n#end\n\n/**\n * ${tableComment}\n *\n * @author ${author}\n * @date ${datetime}\n */\n@RestController\n@RequiredArgsConstructor\n@RequestMapping(\"/${functionName}\" )\n@Tag(description = \"${functionName}\" , name = \"${tableComment}管理\" )\n@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)\npublic class ${ClassName}Controller {\n\n private final ${ClassName}Service ${className}Service;\n\n /**\n * 分页查询\n * @param page 分页对象\n * @param ${className} ${tableComment}\n * @return\n */\n @Operation(summary = \"分页查询\" , description = \"分页查询\" )\n @GetMapping(\"/page\" )\n #if($isSpringBoot3)\n @HasPermission(\"${permissionPrefix}_view\")\n #else\n @PreAuthorize(\"@pms.hasPermission(\'${permissionPrefix}_view\')\" )\n #end\n public R get${ClassName}Page(@ParameterObject Page page, @ParameterObject ${ClassName}Entity ${className}#orgKeywordParams()) {\n return R.ok(${className}Service.page(page, buildQueryWrapper(${className}#orgKeywordArgs())));\n }\n\n /**\n * 列表与导出共用的查询条件,保证导出结果与列表一致\n */\n private LambdaQueryWrapper<${ClassName}Entity> buildQueryWrapper(${ClassName}Entity ${className}#orgKeywordDecl()) {\n LambdaQueryWrapper<${ClassName}Entity> wrapper = Wrappers.lambdaLine truncated
|
||||
INSERT INTO `gen_template` (`id`, `template_name`, `generator_path`, `template_desc`, `template_code`, `create_time`, `update_time`, `del_flag`, `tenant_id`, `create_by`, `update_by`) VALUES (2,'ServiceV202611','${backendPath}/src/main/java/${packagePath}/${moduleName}/service/${ClassName}Service.java','ServiceV202611','package ${package}.${moduleName}.service;\n\nimport com.baomidou.mybatisplus.spring.service.IService;\nimport ${entityClassName};\n\npublic interface ${ClassName}Service extends IService<${ClassName}Entity> {\n\n}\n','2026-04-08 17:38:24','2026-04-08 17:38:24','0',1,'admin','admin');
|
||||
INSERT INTO `gen_template` (`id`, `template_name`, `generator_path`, `template_desc`, `template_code`, `create_time`, `update_time`, `del_flag`, `tenant_id`, `create_by`, `update_by`) VALUES (3,'ServiceImplV202611','${backendPath}/src/main/java/${packagePath}/${moduleName}/service/impl/${ClassName}ServiceImpl.java','ServiceImplV202611','package ${package}.${moduleName}.service.impl;\n\nimport com.baomidou.mybatisplus.spring.service.impl.ServiceImpl;\nimport ${entityClassName};\nimport ${package}.${moduleName}.mapper.${ClassName}Mapper;\nimport ${package}.${moduleName}.service.${ClassName}Service;\nimport org.springframework.stereotype.Service;\n\n/**\n * ${tableComment}\n *\n * @author ${author}\n * @date ${datetime}\n */\n@Service\npublic class ${ClassName}ServiceImpl extends ServiceImpl<${ClassName}Mapper, ${ClassName}Entity> implements ${ClassName}Service {\n\n}\n','2026-04-08 17:38:24','2026-04-08 17:38:24','0',1,'admin','admin');
|
||||
INSERT INTO `gen_template` (`id`, `template_name`, `generator_path`, `template_desc`, `template_code`, `create_time`, `update_time`, `del_flag`, `tenant_id`, `create_by`, `update_by`) VALUES (4,'实体V202611','${entityPath}/src/main/java/${entityPackagePath}/${ClassName}Entity.java','实体V202611','#set($hasOrg = false)\n#foreach($field in $fieldList)\n#if($field.formType.startsWith(\'org-\'))\n#set($hasOrg = true)\n#end\n#end\npackage ${entityPackage};\n\nimport com.baomidou.mybatisplus.annotation.*;\nimport com.baomidou.mybatisplus.spring.activerecord.Model;\nimport io.swagger.v3.oas.annotations.media.Schema;\nimport lombok.Data;\nimport lombok.EqualsAndHashCode;\n#if($hasOrg)\nimport com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;\nimport ${package}.common.core.util.OrgRef;\nimport org.apache.fesod.sheet.annotation.ExcelIgnore;\nimport java.util.List;\n#end\n#if($isTenant)\nimport ${package}.common.core.util.TenantTable;\n#end\n#foreach($import in $importList)\n#if(!$import.startsWith(\'java.lang.\'))\nimport $import;\n#end\n#end\n\n/**\n * ${tableComment}\n *\n * @author ${author}\n * @date ${datetime}\n */\n@Data\n#if($isTenant)\n@TenantTable\n#end\n@TableName(value = \"${tableName}\"#if($hasOrg), autoResultMap = true#end)\n@EqualsAndHashCode(callSuper = true)\n@Schema(description = \"${tableComment}\")\npublic class ${ClassName}Entity extends Model<${ClassName}Entity> {\n\n#foreach ($field in $fieldList)\n#if(${field.fieldComment})#set($comment=${field.fieldComment})#else #set($comment=${field.attrName})#end\n\n /**\n * $comment\n */\n#if($field.primaryPk == \'1\')\n @TableId(type = IdType.ASSIGN_ID)\n#end\n#if($field.formType.startsWith(\'org-\'))\n @TableField(typeHandler = JacksonTypeHandler.class#if($field.autoFill == \'INSERT\' || $field.autoFill == \'INSERT_UPDATE\' || $field.autoFill == \'UPDATE\'), fill = FieldFill.${field.autoFill}#end)\n @ExcelIgnore\n#elseif($field.autoFill == \'INSERT\')\n @TableField(fill = FieldFill.INSERT)\n#elseif($field.autoFill == \'INSERT_UPDATE\')\n @TableField(fill = FieldFill.INSERT_UPDATE)\n#elseif($field.autoFill == \'UPDATE\')\n @TableField(fill = FieldFill.UPDATE)\n#end\n#if($field.fieldName == \'del_flag\')\n @TableLogic\n @TableField(fill = FieldFill.INSERT)\n#end\n @Schema(description=\"$comment\"#if($field.hidden),hidden=$field.hidden#end)\n#if($field.formType.startsWith(\'org-\'))\n private List<OrgRef> $field.attrName;\n#elseif($field.formType == \'checkbox\')\n private ${field.attrType}[] $field.attrName;\n#elseif($field.formType == \'daterange\' || $field.formType == \'datetimerange\')\n private String[] $field.attrName;\n#else\n private $field.attrType $field.attrName;\n#end\n#end\n#foreach ($field in $queryList)\n#if($field.queryFormType == \'daterange\' || $field.queryFormType == \'datetimerange\')\n#if(${field.fieldComment})#set($comment=${field.fieldComment})#else #set($comment=${field.attrName})#end\n\n /**\n * $comment 查询范围\n */\n @TableField(exist = false)\n @Schema(description=\"$comment 查询范围\",hidden=true)\n private String[] ${field.attrName}Range;\n#end\n#end\n}\n','2026-04-08 17:38:24','2026-04-08 17:38:24','0',1,'admin','admin');
|
||||
INSERT INTO `gen_template` (`id`, `template_name`, `generator_path`, `template_desc`, `template_code`, `create_time`, `update_time`, `del_flag`, `tenant_id`, `create_by`, `update_by`) VALUES (5,'MapperV202611','${backendPath}/src/main/java/${packagePath}/${moduleName}/mapper/${ClassName}Mapper.java','MapperV202611','package ${package}.${moduleName}.mapper;\n\n\nimport com.baomidou.mybatisplus.core.mapper.BaseMapper;\nimport ${entityClassName};\nimport org.apache.ibatis.annotations.Mapper;\n\n@Mapper\npublic interface ${ClassName}Mapper extends BaseMapper<${ClassName}Entity> {\n\n}\n','2026-04-08 17:38:24','2026-04-08 17:38:24','0',1,'admin','admin');
|
||||
INSERT INTO `gen_template` (`id`, `template_name`, `generator_path`, `template_desc`, `template_code`, `create_time`, `update_time`, `del_flag`, `tenant_id`, `create_by`, `update_by`) VALUES (6,'Mapper.xmlV202611','${backendPath}/src/main/resources/mapper/${ClassName}Mapper.xml','Mapper.xmlV202611','<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE mapper PUBLIC \"-//mybatis.org//DTD Mapper 3.0//EN\" \"http://mybatis.org/dtd/mybatis-3-mapper.dtd\">\n\n<mapper namespace=\"${package}.${moduleName}.mapper.${ClassName}Mapper\">\n\n <resultMap id=\"${className}Map\" type=\"${entityClassName}\">\n#foreach ($field in $fieldList)\n #if($field.primaryPk == \'1\')\n <id property=\"$field.attrName\" column=\"$field.fieldName\"/>\n #else\n <result property=\"$field.attrName\" column=\"$field.fieldName\"#if($field.formType.startsWith(\'org-\')) typeHandler=\"com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler\"#end/>\n #end\n#end\n </resultMap>\n</mapper>\n','2026-04-08 17:38:24','2026-04-08 17:38:24','0',1,'admin','admin');
|
||||
INSERT INTO `gen_template` (`id`, `template_name`, `generator_path`, `template_desc`, `template_code`, `create_time`, `update_time`, `del_flag`, `tenant_id`, `create_by`, `update_by`) VALUES (7,'权限菜单V202611','${backendPath}/menu/${functionName}_menu.sql','权限菜单V202611','#set($permissionPrefix = \"${moduleName}_${functionName}\")\n#set($permissionPrefix = $permissionPrefix.toLowerCase())\n-- 该脚本不要直接执行, 注意维护菜单的父节点ID 默认 父节点-1 , #if(!$opensource)默认租户 1#end\n#set($menuId=${dateTool.getSystemTime()})\n\n-- 菜单SQL\ninsert into sys_menu ( menu_id,parent_id, path, permission, menu_type, icon, del_flag, create_time, sort_order, update_time, name#if(!$opensource), tenant_id#end)\nvalues (${menuId}, \'-1\', \'/${moduleName}/${functionName}/index\', \'\', \'0\', \'icon-bangzhushouji\', \'0\', null , \'8\', null , \'${tableComment}管理\'#if(!$opensource), 1#end);\n\n-- 菜单对应按钮SQL\ninsert into sys_menu ( menu_id,parent_id, permission, menu_type, path, icon, del_flag, create_time, sort_order, update_time, name#if(!$opensource), tenant_id#end)\nvalues (${math.add($menuId,1)},${menuId}, \'${permissionPrefix}_view\', \'1\', null, \'1\', \'0\', null, \'0\', null, \'${tableComment}查看\'#if(!$opensource), 1#end);\n\ninsert into sys_menu ( menu_id,parent_id, permission, menu_type, path, icon, del_flag, create_time, sort_order, update_time, name#if(!$opensource), tenant_id#end)\nvalues (${math.add($menuId,2)},${menuId}, \'${permissionPrefix}_add\', \'1\', null, \'1\', \'0\', null, \'1\', null, \'${tableComment}新增\'#if(!$opensource), 1#end);\n\ninsert into sys_menu (menu_id, parent_id, permission, menu_type, path, icon, del_flag, create_time, sort_order, update_time, name#if(!$opensource), tenant_id#end)\nvalues (${math.add($menuId,3)},${menuId}, \'${permissionPrefix}_edit\', \'1\', null, \'1\', \'0\', null, \'2\', null, \'${tableComment}修改\'#if(!$opensource), 1#end);\n\ninsert into sys_menu (menu_id, parent_id, permission, menu_type, path, icon, del_flag, create_time, sort_order, update_time, name#if(!$opensource), tenant_id#end)\nvalues (${math.add($menuId,4)},${menuId}, \'${permissionPrefix}_del\', \'1\', null, \'1\', \'0\', null, \'3\', null, \'${tableComment}删除\'#if(!$opensource), 1#end);\n\ninsert into sys_menu ( menu_id,parent_id, permission, menu_type, path, icon, del_flag, create_time, sort_order, update_time, name#if(!$opensource), tenant_id#end)\nvalues (${math.add($menuId,5)},${menuId}, \'${permissionPrefix}_export\', \'1\', null, \'1\', \'0\', null, \'3\', null, \'导入导出\'#if(!$opensource), 1#end);\n','2026-04-08 17:38:24','2026-04-08 17:38:24','0',1,'admin','admin');
|
||||
INSERT INTO `gen_template` (`id`, `template_name`, `generator_path`, `template_desc`, `template_code`, `create_time`, `update_time`, `del_flag`, `tenant_id`, `create_by`, `update_by`) VALUES (8,'api.tsV202611','${frontendPath}/src/api/${moduleName}/${functionName}.ts','api.tsV202611','import request from \"/@/utils/request\"\n\n// ========== 基础CRUD接口 ==========\n\n/**\n * 分页查询列表数据\n * @param query - 查询参数对象\n * @returns Promise<分页数据>\n */\nexport function fetchList(query?: Object) {\n return request({\n url: \'/${moduleName}/${functionName}/page\',\n method: \'get\',\n params: query\n })\n}\n\n/**\n * 新增数据\n * @param obj - 要新增的数据对象\n * @returns Promise<boolean> - 操作结果\n */\nexport function addObj(obj?: Object) {\n return request({\n url: \'/${moduleName}/${functionName}\',\n method: \'post\',\n data: obj\n })\n}\n\n/**\n * 获取详情数据\n * @param obj - 查询参数对象(包含ID等)\n * @returns Promise<数据详情>\n */\nexport function getObj(obj?: Object) {\n return request({\n url: \'/${moduleName}/${functionName}/details\',\n method: \'get\',\n params: obj\n })\n}\n\n/**\n * 批量删除数据\n * @param ids - 要删除的ID数组\n * @returns Promise<操作结果>\n */\nexport function delObjs(ids?: Object) {\n return request({\n url: \'/${moduleName}/${functionName}\',\n method: \'delete\',\n data: ids\n })\n}\n\n/**\n * 更新数据\n * @param obj - 要更新的数据对象\n * @returns Promise<操作结果>\n */\nexport function putObj(obj?: Object) {\n return request({\n url: \'/${moduleName}/${functionName}\',\n method: \'put\',\n data: obj\n })\n}\n\n// ========== 工具函数 ==========\n\n/**\n * 验证字段值唯一性\n * @param rule - 验证规则对象\n * @param value - 要验证的值\n * @param callback - 验证回调函数\n * @param isEdit - 是否为编辑模式\n * \n * @example\n * // 在表单验证规则中使用\n * fieldName: [\n * {\n * validator: (rule, value, callback) => {\n * validateExist(rule, value, callback, form.${pk.attrName} !== \'\');\n * },\n * trigger: \'blur\',\n * },\n * ]\n */\nexport function validateExist(rule: any, value: any, callback: any, isEdit: boolean) {\n // 编辑模式下跳过验证\n if (isEdit) {\n return callback();\n }\n\n // 查询是否存在相同值\n getObj({ [rule.field]: value }).then((response) => {\n const result = response.data;\n if (result !== null && result.length > 0) {\n callback(new Error(\'数据已经存在\'));\n } else {\n callback();\n }\n });\n}\n\n#if($ChildClassName)\n// ========== 子表相关接口 ==========\n\n/**\n * 删除子表数据\n * @param ids - 要删除的子表数据ID数组\n * @returns Promise<操作结果>\n */\nexport function delChildObj(ids?: Object) {\n return request({\n url: \'/${moduleName}/${functionName}/child\',\n method: \'delete\',\n data: ids\n })\n}\n#end\n','2026-04-08 17:38:24','2026-04-08 17:38:24','0',1,'admin','admin');
|
||||
INSERT INTO `gen_template` (`id`, `template_name`, `generator_path`, `template_desc`, `template_code`, `create_time`, `update_time`, `del_flag`, `tenant_id`, `create_by`, `update_by`) VALUES (9,'表格V202611','${frontendPath}/src/views/${moduleName}/${functionName}/index.vue','表格V202611','## 有字典字段时才导入 useDict\n#set($hasDictField = false)\n#foreach($field in $queryList)\n#if($field.fieldDict)\n#set($hasDictField = true)\n#end\n#end\n#foreach($field in $gridList)\n#if($field.fieldDict)\n#set($hasDictField = true)\n#end\n#end\n## 开关:按属性类型决定开/关的值,Boolean 用 true/false,整型用 1/0,其余用 \'1\'/\'0\'\n#macro(switchValues $f)\n#if($f.attrType == \'Boolean\')\n#set($switchOn = \'true\')\n#set($switchOff = \'false\')\n#elseif($f.attrType == \'Integer\' || $f.attrType == \'Long\' || $f.attrType == \'Short\')\n#set($switchOn = \'1\')\n#set($switchOff = \'0\')\n#else\n#set($switchOn = "\'1\'")\n#set($switchOff = "\'0\'")\n#end\n#end\n#set($permissionPrefix = "${moduleName}_${functionName}")\n#set($permissionPrefix = $permissionPrefix.toLowerCase())\n<template>\n <div class="layout-padding">\n <div class="layout-padding-auto layout-padding-view">\n#if($queryList)\n <!-- 查询表单区域 -->\n <el-row v-show="showSearch">\n <el-form :model="state.queryForm" ref="queryRef" :inline="true" @keyup.enter="getDataList">\n#foreach($field in $queryList)\n#if($field.formType.startsWith(\'org-\'))#set($queryKey = "${field.attrName}Keyword")#else#set($queryKey = $field.attrName)#end\n#if($field.queryFormType == \'select\')\n <el-form-item label="#if(${field.fieldComment})${field.fieldComment}#else${field.attrName}#end" prop="${field.attrName}">\n <el-select v-model="state.queryForm.${field.attrName}" placeholder="请选择#if(${field.fieldComment})${field.fieldComment}#else${field.attrName}#end">\n#if($field.fieldDict)\n <el-option \n :label="item.label" \n :value="item.value" \n v-for="(item, index) in ${field.fieldDict}" \n :key="index"\n />\n#else\n <el-option label="请选择" value="0" />\n#end\n </el-select>\n </el-form-item>\n#elseif($field.queryFormType == \'date\')\n <el-form-item label="#if(${field.fieldComment})${field.fieldComment}#else${field.attrName}#end" prop="${field.attrName}">\n <el-date-picker\n type="date"\n placeholder="请输入#if(${field.fieldComment})${field.fieldComment}#else${field.attrName}#end"\n v-model="state.queryForm.${field.attrName}"\n :value-format="dateStr"\n />\n </el-form-item>\n#elseif($field.queryFormType == \'daterange\')\n <el-form-item label="#if(${field.fieldComment})${field.fieldComment}#else${field.attrName}#end" prop="${field.attrName}Range">\n <el-date-picker\n type="daterange"\n range-separator="至"\n start-placeholder="开始日期"\n end-placeholder="结束日期"\n v-model="state.queryForm.${field.attrName}Range"\n :value-format="dateStr"\n />\n </el-form-item>\n#elseif($field.queryFormType == \'datetime\')\n <el-form-item label="#if(${field.fieldComment})${field.fieldComment}#else${field.attrName}#end" prop="${field.attrName}">\n <el-date-picker\n type="datetime"\n placeholder="请输入#if(${field.fieldComment})${field.fieldComment}#else${field.attrName}#end"\n v-model="state.queryForm.${field.attrName}"\n :value-format="dateTimeStr"\n />\n </el-form-item>\n#elseif($field.queryFormType == \'datetimerange\')\n <el-form-item label="#if(${field.fieldComment})${field.fieldComment}#else${field.attrName}#end" prop="${field.attrName}Range">\n <el-date-picker\n type="datetimerange"\n range-separator="至"\n start-placeholder="开始时间"\n end-placeholder="结束时间"\n v-model="state.queryForm.${field.attrName}Range"\n :value-format="dateTimeStr"\n />\n </el-form-item>\n#elseif($field.formType == \'radio\')\n <el-form-item label="#if(${field.fieldComment})${field.fieldComment}#else${field.attrName}#end" prop="${field.attrName}">\n <el-radio-group v-model="state.queryForm.${field.attrName}">\n#if($field.fieldDict)\n <el-radio \n :label="item.value" \n v-for="(item, index) in ${field.fieldDict}" \n border \n :key="index"\n >\n {{ item.label }}\n </el-radio>\n#else\n <el-radio label="${field.fieldComment}" border>\n ${field.fieldComment}\n </el-radio>\n#end\n </el-rLine truncated
|
||||
INSERT INTO `gen_template` (`id`, `template_name`, `generator_path`, `template_desc`, `template_code`, `create_time`, `update_time`, `del_flag`, `tenant_id`, `create_by`, `update_by`) VALUES (10,'表单V202611','${frontendPath}/src/views/${moduleName}/${functionName}/form.vue','表单V202611','## 有字典字段时才导入 useDict\n#set($hasDictField = false)\n#foreach($field in $formList)\n#if($field.fieldDict)\n#set($hasDictField = true)\n#end\n#end\n#set($hasDuplicate = false)\n#foreach($field in $formList)\n#if($field.formValidator == \'duplicate\')\n#set($hasDuplicate = true)\n#end\n#end\n## 开关:按属性类型决定开/关的值,Boolean 用 true/false,整型用 1/0,其余用 \'1\'/\'0\'\n#macro(switchValues $f)\n#if($f.attrType == \'Boolean\')\n#set($switchOn = \'true\')\n#set($switchOff = \'false\')\n#elseif($f.attrType == \'Integer\' || $f.attrType == \'Long\' || $f.attrType == \'Short\')\n#set($switchOn = \'1\')\n#set($switchOff = \'0\')\n#else\n#set($switchOn = "\'1\'")\n#set($switchOff = "\'0\'")\n#end\n#end\n#set($hasOrg = false)\n#foreach($field in $formList)\n#if($field.formType.startsWith(\'org-\'))\n#set($hasOrg = true)\n#end\n#end\n<template>\n <el-dialog :title="form.${pk.attrName} ? \'编辑\' : \'新增\'" v-model="visible"\n :close-on-click-modal="false" draggable>\n <el-form ref="dataFormRef" :model="form" :rules="dataRules" label-width="90px" v-loading="loading">\n <el-row :gutter="24">\n#foreach($field in $formList)\n#if($field.attrName != ${pk.attrName})\n#if($formLayout == 1)\n <el-col :span="24" class="mb20">\n#elseif($formLayout == 2)\n <el-col :span="12" class="mb20">\n#end\n#if($field.formType.startsWith(\'org-\'))\n#set($orgType = $field.formType.replace(\'org-\', \'\').replace(\'-multiple\', \'\'))\n <el-form-item label="${field.fieldComment}" prop="${field.attrName}">\n <OrgSelect v-model="form.${field.attrName}" value-type="item" type="${orgType}" :multiple="#if($field.formType.endsWith(\'-multiple\'))true#else false#end" label="${field.fieldComment}" :disabled="loading" />\n </el-form-item>\n </el-col>\n#elseif($field.formType == \'switch\')\n#switchValues($field)\n <el-form-item label="#if(${field.fieldComment})${field.fieldComment}#else${field.attrName}#end" prop="${field.attrName}">\n <el-switch :model-value="String(form.${field.attrName}) === String($switchOn)" @change="(checked) => (form.${field.attrName} = checked ? $switchOn : $switchOff)" />\n </el-form-item>\n </el-col>\n#elseif($field.formType == \'text\')\n <el-form-item label="#if(${field.fieldComment})${field.fieldComment}#else${field.attrName}#end" prop="${field.attrName}">\n <el-input v-model="form.${field.attrName}" placeholder="请输入#if(${field.fieldComment})${field.fieldComment}#else${field.attrName}#end"/>\n </el-form-item>\n </el-col>\n#elseif($field.formType == \'textarea\')\n <el-form-item label="#if(${field.fieldComment})${field.fieldComment}#else${field.attrName}#end" prop="${field.attrName}">\n <el-input type="textarea" v-model="form.${field.attrName}" placeholder="请输入#if(${field.fieldComment})${field.fieldComment}#else${field.attrName}#end"/>\n </el-form-item>\n </el-col>\n#elseif($field.formType == \'select\')\n <el-form-item label="#if(${field.fieldComment})${field.fieldComment}#else${field.attrName}#end" prop="${field.attrName}">\n <el-select v-model="form.${field.attrName}" placeholder="请选择#if(${field.fieldComment})${field.fieldComment}#else${field.attrName}#end">\n#if($field.fieldDict)\n <el-option :value="item.value" :label="item.label" v-for="(item, index) in ${field.fieldDict}" :key="index"></el-option>\n#else\n <el-option label="请选择" value="0"></el-option>\n#end\n </el-select>\n </el-form-item>\n </el-col>\n#elseif($field.formType == \'radio\')\n <el-form-item label="#if(${field.fieldComment})${field.fieldComment}#else${field.attrName}#end" prop="${field.attrName}">\n <el-radio-group v-model="form.${field.attrName}">\n#if($field.fieldDict)\n <el-radio :label="item.value" v-for="(item, index) in ${field.fieldDict}" border :key="index">{{ item.label }}</el-radio>\n#else\n <el-radio label="${field.fieldComment}" border>${field.fieldComment}</el-radio>\n#end\n </el-radio-group>\n </el-form-item>\n </el-col>\n#elseif($field.formType == \'checkbox\')\n <el-form-item label="#if(${field.fieldComment})${field.fieldComment}#else${field.attrName}#end" prop="${field.attrName}">\n <el-checkbox-group v-model="form.${field.attrName}">\n#if($field.fieldDict)\n <el-checkbox :label="item.value" v-for="(item, index) in ${field.fieldDict}" :key="index">{{ item.label }}</el-checkbox>\n#else\n <el-checkbox label="启用"Line truncated
|
||||
INSERT INTO `gen_template` (`id`, `template_name`, `generator_path`, `template_desc`, `template_code`, `create_time`, `update_time`, `del_flag`, `tenant_id`, `create_by`, `update_by`) VALUES (11,'主子ServiceV202611','${backendPath}/src/main/java/${packagePath}/${moduleName}/service/${ClassName}Service.java','主子ServiceV202611','#foreach($field in $childFieldList)\n#if($field.primaryPk == \'1\')\n#set($childPk = $field)\n#end\n#end\npackage ${package}.${moduleName}.service;\n\nimport com.github.yulichang.extension.mapping.base.MPJDeepService;\nimport ${entityClassName};\n\npublic interface ${ClassName}Service extends MPJDeepService<${ClassName}Entity> {\n Boolean saveDeep(${ClassName}Entity ${className});\n\n Boolean updateDeep(${ClassName}Entity ${className});\n\n Boolean removeDeep(${pk.attrType}[] ids);\n\n Boolean removeChild(${childPk.attrType}[] ids);\n}\n','2026-04-08 17:38:24','2026-04-08 17:38:24','0',1,'admin','admin');
|
||||
INSERT INTO `gen_template` (`id`, `template_name`, `generator_path`, `template_desc`, `template_code`, `create_time`, `update_time`, `del_flag`, `tenant_id`, `create_by`, `update_by`) VALUES (12,'主子ServiceImplV202611','${backendPath}/src/main/java/${packagePath}/${moduleName}/service/impl/${ClassName}ServiceImpl.java','主子ServiceImplV202611','#foreach($field in $childFieldList)\n#if($field.primaryPk == \'1\')\n#set($childPk = $field)\n#end\n#end\npackage ${package}.${moduleName}.service.impl;\n\nimport com.baomidou.mybatisplus.spring.service.impl.ServiceImpl;\nimport ${entityClassName};\nimport ${package}.${moduleName}.mapper.${ClassName}Mapper;\nimport ${package}.${moduleName}.service.${ClassName}Service;\nimport org.springframework.stereotype.Service;\nimport cn.hutool.core.collection.CollUtil;\nimport com.baomidou.mybatisplus.core.toolkit.Wrappers;\nimport ${entityPackage}.${ChildClassName}Entity;\nimport ${package}.${moduleName}.mapper.${ChildClassName}Mapper;\nimport org.springframework.transaction.annotation.Transactional;\nimport lombok.RequiredArgsConstructor;\nimport java.util.Objects;\nimport java.util.List;\nimport java.util.stream.Collectors;\n\n/**\n * ${tableComment}\n *\n * @author ${author}\n * @date ${datetime}\n */\n@Service\n@RequiredArgsConstructor\npublic class ${ClassName}ServiceImpl extends ServiceImpl<${ClassName}Mapper, ${ClassName}Entity> implements ${ClassName}Service {\n\n private final ${ChildClassName}Mapper ${childClassName}Mapper;\n\n @Override\n @Transactional(rollbackFor = Exception.class)\n public Boolean saveDeep(${ClassName}Entity ${className}) {\n baseMapper.insert(${className});\n for (${ChildClassName}Entity ${childClassName} : ${className}.get${ChildClassName}List()) {\n ${childClassName}.$str.setProperty($childField)(${className}.$str.getProperty($mainField)());\n ${childClassName}Mapper.insert( ${childClassName});\n }\n\n return Boolean.TRUE;\n }\n\n @Override\n @Transactional(rollbackFor = Exception.class)\n public Boolean updateDeep(${ClassName}Entity ${className}) {\n baseMapper.updateById(${className});\n for (${ChildClassName}Entity ${childClassName} : ${className}.get${ChildClassName}List()) {\n#set($getChildPkName=$str.getProperty(${childPk.attrName}))\n if (Objects.isNull(${childClassName}.$getChildPkName())) {\n ${childClassName}.$str.setProperty($childField)(${className}.$str.getProperty($mainField)());\n ${childClassName}Mapper.insert(${childClassName});\n } else {\n ${childClassName}Mapper.updateById(${childClassName});\n }\n }\n return Boolean.TRUE;\n }\n\n @Override\n @Transactional(rollbackFor = Exception.class)\n public Boolean removeDeep(${pk.attrType}[] ids) {\n List<${ClassName}Entity> records = baseMapper.selectBatchIds(CollUtil.toList(ids));\n if (CollUtil.isEmpty(records)) {\n return Boolean.TRUE;\n }\n ${childClassName}Mapper.delete(Wrappers.<${ChildClassName}Entity>lambdaQuery()\n .in(${ChildClassName}Entity::$str.getProperty($childField), records.stream()\n .map(${ClassName}Entity::$str.getProperty($mainField)).collect(Collectors.toList())));\n baseMapper.deleteBatchIds(CollUtil.toList(ids));\n return Boolean.TRUE;\n }\n\n @Override\n @Transactional(rollbackFor = Exception.class)\n public Boolean removeChild(${childPk.attrType}[] ids) {\n ${childClassName}Mapper.deleteBatchIds(CollUtil.toList(ids));\n return Boolean.TRUE;\n }\n}\n','2026-04-08 17:38:24','2026-04-08 17:38:24','0',1,'admin','admin');
|
||||
INSERT INTO `gen_template` (`id`, `template_name`, `generator_path`, `template_desc`, `template_code`, `create_time`, `update_time`, `del_flag`, `tenant_id`, `create_by`, `update_by`) VALUES (13,'主实体V202611','${entityPath}/src/main/java/${entityPackagePath}/${ClassName}Entity.java','主实体V202611','#set($hasOrg = false)\n#foreach($field in $fieldList)\n#if($field.formType.startsWith(\'org-\'))\n#set($hasOrg = true)\n#end\n#end\npackage ${entityPackage};\n\nimport com.baomidou.mybatisplus.annotation.*;\nimport com.baomidou.mybatisplus.spring.activerecord.Model;\nimport io.swagger.v3.oas.annotations.media.Schema;\nimport lombok.Data;\nimport lombok.EqualsAndHashCode;\n#if($hasOrg)\nimport com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;\nimport ${package}.common.core.util.OrgRef;\n#end\n#if($isTenant)\nimport ${package}.common.core.util.TenantTable;\n#end\n#foreach($import in $importList)\n#if(!$import.startsWith(\'java.lang.\'))\nimport $import;\n#end\n#end\nimport org.apache.fesod.sheet.annotation.ExcelIgnore;\nimport com.github.yulichang.annotation.EntityMapping;\nimport java.util.List;\n\n/**\n * ${tableComment}\n *\n * @author ${author}\n * @date ${datetime}\n */\n@Data\n#if($isTenant)\n@TenantTable\n#end\n@TableName(value = \"${tableName}\"#if($hasOrg), autoResultMap = true#end)\n@EqualsAndHashCode(callSuper = true)\n@Schema(description = \"${tableComment}\")\npublic class ${ClassName}Entity extends Model<${ClassName}Entity> {\n\n#foreach ($field in $fieldList)\n#if(${field.fieldComment})#set($comment=${field.fieldComment})#else #set($comment=${field.attrName})#end\n\n /**\n * $comment\n */\n#if($field.primaryPk == \'1\')\n @TableId(type = IdType.ASSIGN_ID)\n#end\n#if($field.formType.startsWith(\'org-\'))\n @TableField(typeHandler = JacksonTypeHandler.class#if($field.autoFill == \'INSERT\' || $field.autoFill == \'INSERT_UPDATE\' || $field.autoFill == \'UPDATE\'), fill = FieldFill.${field.autoFill}#end)\n @ExcelIgnore\n#elseif($field.autoFill == \'INSERT\')\n @TableField(fill = FieldFill.INSERT)\n#elseif($field.autoFill == \'INSERT_UPDATE\')\n @TableField(fill = FieldFill.INSERT_UPDATE)\n#elseif($field.autoFill == \'UPDATE\')\n @TableField(fill = FieldFill.UPDATE)\n#end\n#if($field.fieldName == \'del_flag\')\n @TableLogic\n @TableField(fill = FieldFill.INSERT)\n#end\n @Schema(description=\"$comment\"#if($field.hidden),hidden=$field.hidden#end)\n#if($field.formType.startsWith(\'org-\'))\n private List<OrgRef> $field.attrName;\n#elseif($field.formType == \'checkbox\')\n private ${field.attrType}[] $field.attrName;\n#elseif($field.formType == \'daterange\' || $field.formType == \'datetimerange\')\n @TableField(typeHandler = JacksonTypeHandler.class)\n private String[] $field.attrName;\n#else\n private $field.attrType $field.attrName;\n#end\n#end\n#foreach ($field in $queryList)\n#if($field.queryFormType == \'daterange\' || $field.queryFormType == \'datetimerange\')\n#if(${field.fieldComment})#set($comment=${field.fieldComment})#else #set($comment=${field.attrName})#end\n\n /**\n * $comment 查询范围\n */\n @TableField(exist = false)\n @Schema(description=\"$comment 查询范围\",hidden=true)\n private String[] ${field.attrName}Range;\n#end\n#end\n @ExcelIgnore\n @TableField(exist = false)\n @EntityMapping(thisField = \"$mainField\", joinField = \"$childField\")\n private List<${ChildClassName}Entity> ${childClassName}List;\n}\n','2026-04-08 17:38:24','2026-04-08 17:38:24','0',1,'admin','admin');
|
||||
INSERT INTO `gen_template` (`id`, `template_name`, `generator_path`, `template_desc`, `template_code`, `create_time`, `update_time`, `del_flag`, `tenant_id`, `create_by`, `update_by`) VALUES (14,'MapperV202611','${backendPath}/src/main/java/${packagePath}/${moduleName}/mapper/${ClassName}Mapper.java','MapperV202611','package ${package}.${moduleName}.mapper;\n\n\nimport com.baomidou.mybatisplus.core.mapper.BaseMapper;\nimport ${entityClassName};\nimport org.apache.ibatis.annotations.Mapper;\n\n@Mapper\npublic interface ${ClassName}Mapper extends BaseMapper<${ClassName}Entity> {\n\n}\n','2026-04-08 17:38:24','2026-04-08 17:38:24','0',1,'admin','admin');
|
||||
INSERT INTO `gen_template` (`id`, `template_name`, `generator_path`, `template_desc`, `template_code`, `create_time`, `update_time`, `del_flag`, `tenant_id`, `create_by`, `update_by`) VALUES (15,'Mapper.xmlV202611','${backendPath}/src/main/resources/mapper/${ClassName}Mapper.xml','Mapper.xmlV202611','<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE mapper PUBLIC \"-//mybatis.org//DTD Mapper 3.0//EN\" \"http://mybatis.org/dtd/mybatis-3-mapper.dtd\">\n\n<mapper namespace=\"${package}.${moduleName}.mapper.${ClassName}Mapper\">\n\n <resultMap id=\"${className}Map\" type=\"${entityClassName}\">\n#foreach ($field in $fieldList)\n #if($field.primaryPk == \'1\')\n <id property=\"$field.attrName\" column=\"$field.fieldName\"/>\n #else\n <result property=\"$field.attrName\" column=\"$field.fieldName\"#if($field.formType.startsWith(\'org-\')) typeHandler=\"com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler\"#end/>\n #end\n#end\n </resultMap>\n</mapper>\n','2026-04-08 17:38:24','2026-04-08 17:38:24','0',1,'admin','admin');
|
||||
INSERT INTO `gen_template` (`id`, `template_name`, `generator_path`, `template_desc`, `template_code`, `create_time`, `update_time`, `del_flag`, `tenant_id`, `create_by`, `update_by`) VALUES (16,'权限菜单V202611','${backendPath}/menu/${functionName}_menu.sql','权限菜单V202611','#set($permissionPrefix = \"${moduleName}_${functionName}\")\n#set($permissionPrefix = $permissionPrefix.toLowerCase())\n-- 该脚本不要直接执行, 注意维护菜单的父节点ID 默认 父节点-1 , #if(!$opensource)默认租户 1#end\n#set($menuId=${dateTool.getSystemTime()})\n\n-- 菜单SQL\ninsert into sys_menu ( menu_id,parent_id, path, permission, menu_type, icon, del_flag, create_time, sort_order, update_time, name#if(!$opensource), tenant_id#end)\nvalues (${menuId}, \'-1\', \'/${moduleName}/${functionName}/index\', \'\', \'0\', \'icon-bangzhushouji\', \'0\', null , \'8\', null , \'${tableComment}管理\'#if(!$opensource), 1#end);\n\n-- 菜单对应按钮SQL\ninsert into sys_menu ( menu_id,parent_id, permission, menu_type, path, icon, del_flag, create_time, sort_order, update_time, name#if(!$opensource), tenant_id#end)\nvalues (${math.add($menuId,1)},${menuId}, \'${permissionPrefix}_view\', \'1\', null, \'1\', \'0\', null, \'0\', null, \'${tableComment}查看\'#if(!$opensource), 1#end);\n\ninsert into sys_menu ( menu_id,parent_id, permission, menu_type, path, icon, del_flag, create_time, sort_order, update_time, name#if(!$opensource), tenant_id#end)\nvalues (${math.add($menuId,2)},${menuId}, \'${permissionPrefix}_add\', \'1\', null, \'1\', \'0\', null, \'1\', null, \'${tableComment}新增\'#if(!$opensource), 1#end);\n\ninsert into sys_menu (menu_id, parent_id, permission, menu_type, path, icon, del_flag, create_time, sort_order, update_time, name#if(!$opensource), tenant_id#end)\nvalues (${math.add($menuId,3)},${menuId}, \'${permissionPrefix}_edit\', \'1\', null, \'1\', \'0\', null, \'2\', null, \'${tableComment}修改\'#if(!$opensource), 1#end);\n\ninsert into sys_menu (menu_id, parent_id, permission, menu_type, path, icon, del_flag, create_time, sort_order, update_time, name#if(!$opensource), tenant_id#end)\nvalues (${math.add($menuId,4)},${menuId}, \'${permissionPrefix}_del\', \'1\', null, \'1\', \'0\', null, \'3\', null, \'${tableComment}删除\'#if(!$opensource), 1#end);\n\ninsert into sys_menu ( menu_id,parent_id, permission, menu_type, path, icon, del_flag, create_time, sort_order, update_time, name#if(!$opensource), tenant_id#end)\nvalues (${math.add($menuId,5)},${menuId}, \'${permissionPrefix}_export\', \'1\', null, \'1\', \'0\', null, \'3\', null, \'导入导出\'#if(!$opensource), 1#end);\n','2026-04-08 17:38:24','2026-04-08 17:38:24','0',1,'admin','admin');
|
||||
INSERT INTO `gen_template` (`id`, `template_name`, `generator_path`, `template_desc`, `template_code`, `create_time`, `update_time`, `del_flag`, `tenant_id`, `create_by`, `update_by`) VALUES (17,'api.tsV202611','${frontendPath}/src/api/${moduleName}/${functionName}.ts','api.tsV202611','import request from \"/@/utils/request\"\n\n// ========== 基础CRUD接口 ==========\n\n/**\n * 分页查询列表数据\n * @param query - 查询参数对象\n * @returns Promise<分页数据>\n */\nexport function fetchList(query?: Object) {\n return request({\n url: \'/${moduleName}/${functionName}/page\',\n method: \'get\',\n params: query\n })\n}\n\n/**\n * 新增数据\n * @param obj - 要新增的数据对象\n * @returns Promise<boolean> - 操作结果\n */\nexport function addObj(obj?: Object) {\n return request({\n url: \'/${moduleName}/${functionName}\',\n method: \'post\',\n data: obj\n })\n}\n\n/**\n * 获取详情数据\n * @param obj - 查询参数对象(包含ID等)\n * @returns Promise<数据详情>\n */\nexport function getObj(obj?: Object) {\n return request({\n url: \'/${moduleName}/${functionName}/details\',\n method: \'get\',\n params: obj\n })\n}\n\n/**\n * 批量删除数据\n * @param ids - 要删除的ID数组\n * @returns Promise<操作结果>\n */\nexport function delObjs(ids?: Object) {\n return request({\n url: \'/${moduleName}/${functionName}\',\n method: \'delete\',\n data: ids\n })\n}\n\n/**\n * 更新数据\n * @param obj - 要更新的数据对象\n * @returns Promise<操作结果>\n */\nexport function putObj(obj?: Object) {\n return request({\n url: \'/${moduleName}/${functionName}\',\n method: \'put\',\n data: obj\n })\n}\n\n// ========== 工具函数 ==========\n\n/**\n * 验证字段值唯一性\n * @param rule - 验证规则对象\n * @param value - 要验证的值\n * @param callback - 验证回调函数\n * @param isEdit - 是否为编辑模式\n * \n * @example\n * // 在表单验证规则中使用\n * fieldName: [\n * {\n * validator: (rule, value, callback) => {\n * validateExist(rule, value, callback, form.${pk.attrName} !== \'\');\n * },\n * trigger: \'blur\',\n * },\n * ]\n */\nexport function validateExist(rule: any, value: any, callback: any, isEdit: boolean) {\n // 编辑模式下跳过验证\n if (isEdit) {\n return callback();\n }\n\n // 查询是否存在相同值\n getObj({ [rule.field]: value }).then((response) => {\n const result = response.data;\n if (result !== null && result.length > 0) {\n callback(new Error(\'数据已经存在\'));\n } else {\n callback();\n }\n });\n}\n\n#if($ChildClassName)\n// ========== 子表相关接口 ==========\n\n/**\n * 删除子表数据\n * @param ids - 要删除的子表数据ID数组\n * @returns Promise<操作结果>\n */\nexport function delChildObj(ids?: Object) {\n return request({\n url: \'/${moduleName}/${functionName}/child\',\n method: \'delete\',\n data: ids\n })\n}\n#end\n','2026-04-08 17:38:24','2026-04-08 17:38:24','0',1,'admin','admin');
|
||||
INSERT INTO `gen_template` (`id`, `template_name`, `generator_path`, `template_desc`, `template_code`, `create_time`, `update_time`, `del_flag`, `tenant_id`, `create_by`, `update_by`) VALUES (18,'子实体V202611','${entityPath}/src/main/java/${entityPackagePath}/${ChildClassName}Entity.java','子实体V202611','#set($hasOrg = false)\n#foreach($field in $childFieldList)\n#if($field.formType.startsWith(\'org-\'))\n#set($hasOrg = true)\n#end\n#end\npackage ${entityPackage};\n\nimport com.baomidou.mybatisplus.annotation.*;\nimport com.baomidou.mybatisplus.spring.activerecord.Model;\nimport io.swagger.v3.oas.annotations.media.Schema;\n#if($isChildTenant)\nimport ${package}.common.core.util.TenantTable;\n#end\nimport lombok.Data;\nimport lombok.EqualsAndHashCode;\n#if($hasOrg)\nimport com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;\nimport ${package}.common.core.util.OrgRef;\nimport java.util.List;\n#end\n#set($childImports = [])\n#foreach($field in $childFieldList)\n#if($field.packageName && !$field.packageName.startsWith(\'java.lang.\') && !$childImports.contains($field.packageName))\n#set($void = $childImports.add($field.packageName))\n#end\n#end\n#foreach($import in $childImports)\nimport $import;\n#end\n\n/**\n * ${tableComment}\n *\n * @author ${author}\n * @date ${datetime}\n */\n@Data\n#if($isChildTenant)\n@TenantTable\n#end\n@TableName(value = \"${childTableName}\"#if($hasOrg), autoResultMap = true#end)\n@EqualsAndHashCode(callSuper = true)\n@Schema(description = \"${childTableName}\")\npublic class ${ChildClassName}Entity extends Model<${ChildClassName}Entity> {\n\n#foreach ($field in $childFieldList)\n#if(${field.fieldComment})#set($comment=${field.fieldComment})#else #set($comment=${field.attrName})#end\n /**\n * $comment\n */\n#if($field.primaryPk == \'1\')\n @TableId(type = IdType.ASSIGN_ID)\n#end\n#if($field.formType.startsWith(\'org-\'))\n @TableField(typeHandler = JacksonTypeHandler.class#if($field.autoFill == \'INSERT\' || $field.autoFill == \'INSERT_UPDATE\' || $field.autoFill == \'UPDATE\'), fill = FieldFill.${field.autoFill}#end)\n#elseif($field.autoFill == \'INSERT\')\n @TableField(fill = FieldFill.INSERT)\n#elseif($field.autoFill == \'INSERT_UPDATE\')\n @TableField(fill = FieldFill.INSERT_UPDATE)\n#elseif($field.autoFill == \'UPDATE\')\n @TableField(fill = FieldFill.UPDATE)\n#end\n#if($field.fieldName == \'del_flag\')\n @TableLogic\n @TableField(fill = FieldFill.INSERT)\n#end\n @Schema(description=\"$comment\"#if($field.hidden),hidden=$field.hidden#end)\n#if($field.formType.startsWith(\'org-\'))\n private List<OrgRef> $field.attrName;\n#elseif($field.formType == \'checkbox\')\n private ${field.attrType}[] $field.attrName;\n#else\n private $field.attrType $field.attrName;\n#end \n#end\n}\n','2026-04-08 17:38:24','2026-04-08 17:38:24','0',1,'admin','admin');
|
||||
INSERT INTO `gen_template` (`id`, `template_name`, `generator_path`, `template_desc`, `template_code`, `create_time`, `update_time`, `del_flag`, `tenant_id`, `create_by`, `update_by`) VALUES (19,'主子ControllerV202611','${backendPath}/src/main/java/${packagePath}/${moduleName}/controller/${ClassName}Controller.java','主子ControllerV202611','## 查询条件按需导入:字符串字段和组织关键字用 StrUtil,其余类型用 Objects;复选框与日期范围两者都不用\n#set($needStrUtil = false)\n#set($needObjects = false)\n#foreach($field in $queryList)\n#if($field.formType == \'checkbox\' || $field.queryFormType == \'daterange\' || $field.queryFormType == \'datetimerange\')\n#elseif($field.formType.startsWith(\'org-\') || $field.attrType == \'String\')\n#set($needStrUtil = true)\n#else\n#set($needObjects = true)\n#end\n#end\n#set($hasOrgQuery = false)\n#foreach($field in $queryList)\n#if($field.formType.startsWith(\'org-\'))\n#set($hasOrgQuery = true)\n#end\n#end\n## 组织字段以 [{id,name}] JSON 存储,按 ${attrName}Keyword 对整列模糊查询,分页和导出共用\n#macro(orgKeywordParams)#foreach($field in $queryList)#if($field.formType.startsWith(\'org-\')), @RequestParam(required = false) String ${field.attrName}Keyword#end#end#end\n#macro(orgKeywordDecl)#foreach($field in $queryList)#if($field.formType.startsWith(\'org-\')), String ${field.attrName}Keyword#end#end#end\n#macro(orgKeywordArgs)#foreach($field in $queryList)#if($field.formType.startsWith(\'org-\')), ${field.attrName}Keyword#end#end#end\n#macro(orgKeywordFilters)\n#if($hasOrgQuery)\n // 组织字段对整列 JSON 做 LIKE:关键字为数字或 id/name 时会误命中,需精确匹配时改用数据库 JSON 函数\n#end\n#foreach($field in $queryList)\n#if($field.formType.startsWith(\'org-\'))\n wrapper.like(StrUtil.isNotBlank(${field.attrName}Keyword), ${ClassName}Entity::$str.getProperty($field.attrName), ${field.attrName}Keyword);\n#end\n#end\n#end\n#set($permissionPrefix = \"${moduleName}_${functionName}\")\n#set($permissionPrefix = $permissionPrefix.toLowerCase())\n#foreach($field in $childFieldList)\n#if($field.primaryPk == \'1\')\n#set($childPk = $field)\n#end\n#end\npackage ${package}.${moduleName}.controller;\n\n#if($needStrUtil)\nimport cn.hutool.core.util.StrUtil;\n#end\nimport cn.hutool.core.util.ArrayUtil;\nimport com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;\nimport com.baomidou.mybatisplus.core.toolkit.Wrappers;\nimport com.baomidou.mybatisplus.extension.plugins.pagination.Page;\nimport ${package}.common.core.util.R;\nimport ${package}.common.log.annotation.SysLog;\n#if($opensource)\nimport com.pig4cloud.plugin.excel.annotation.ResponseExcel;\nimport com.pig4cloud.plugin.excel.annotation.RequestExcel;\n#else\nimport ${package}.common.excel.annotation.ResponseExcel;\nimport ${package}.common.excel.annotation.RequestExcel;\n#end\nimport ${entityClassName};\nimport ${package}.${moduleName}.service.${ClassName}Service;\nimport io.swagger.v3.oas.annotations.security.SecurityRequirement;\n#if($isSpringBoot3)\nimport ${package}.common.security.annotation.HasPermission;\nimport org.springdoc.core.annotations.ParameterObject;\n#else\nimport org.springframework.security.access.prepost.PreAuthorize;\nimport org.springdoc.api.annotations.ParameterObject;\n#end\nimport org.springframework.http.HttpHeaders;\nimport io.swagger.v3.oas.annotations.tags.Tag;\nimport io.swagger.v3.oas.annotations.Operation;\nimport lombok.RequiredArgsConstructor;\nimport org.springframework.validation.BindingResult;\nimport org.springframework.web.bind.annotation.*;\n\nimport java.util.List;\n#if($needObjects)\nimport java.util.Objects;\n#end\n\n/**\n * ${tableComment}\n *\n * @author ${author}\n * @date ${datetime}\n */\n@RestController\n@RequiredArgsConstructor\n@RequestMapping(\"/${functionName}\" )\n@Tag(description = \"${functionName}\" , name = \"${tableComment}管理\" )\n@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)\npublic class ${ClassName}Controller {\n\n private final ${ClassName}Service ${className}Service;\n\n /**\n * 分页查询\n * @param page 分页对象\n * @param ${className} ${tableComment}\n * @return\n */\n @Operation(summary = \"分页查询\" , description = \"分页查询\" )\n @GetMapping(\"/page\" )\n #if($isSpringBoot3)\n @HasPermission(\"${permissionPrefix}_view\")\n #else\n @PreAuthorize(\"@pms.hasPermission(\'${permissionPrefix}_view\')\" )\n #end\n public R get${ClassName}Page(@ParameterObject Page page, @ParameterObject ${ClassName}Entity ${className}#orgKeywordParams()) {\n return R.ok(${className}Service.page(page, buildQueryWrapper(${className}#orgKeywordArgs())));\n }\n\n /**\n * 列表与导出共用的查询条件,保证导出结果与列表一致\n */\n private LambdaQueryWrapper<${ClassName}Entity> buildQueryWrapper(${ClassName}Entity ${className}#orgKeywordDecl()) {\Line truncated
|
||||
INSERT INTO `gen_template` (`id`, `template_name`, `generator_path`, `template_desc`, `template_code`, `create_time`, `update_time`, `del_flag`, `tenant_id`, `create_by`, `update_by`) VALUES (20,'主子表单V202611','${frontendPath}/src/views/${moduleName}/${functionName}/form.vue','主子表单V202611','## 有字典字段时才导入 useDict\n#set($hasDictField = false)\n#foreach($field in $formList)\n#if($field.fieldDict)\n#set($hasDictField = true)\n#end\n#end\n#set($hasDuplicate = false)\n#foreach($field in $formList)\n#if($field.formValidator == \'duplicate\')\n#set($hasDuplicate = true)\n#end\n#end\n## 开关:按属性类型决定开/关的值,Boolean 用 true/false,整型用 1/0,其余用 \'1\'/\'0\'\n#macro(switchValues $f)\n#if($f.attrType == \'Boolean\')\n#set($switchOn = \'true\')\n#set($switchOff = \'false\')\n#elseif($f.attrType == \'Integer\' || $f.attrType == \'Long\' || $f.attrType == \'Short\')\n#set($switchOn = \'1\')\n#set($switchOff = \'0\')\n#else\n#set($switchOn = "\'1\'")\n#set($switchOff = "\'0\'")\n#end\n#end\n#set($hasOrg = false)\n#foreach($field in $formList)\n#if($field.formType.startsWith(\'org-\'))\n#set($hasOrg = true)\n#end\n#end\n#foreach($field in $childFieldList)\n#if($field.formType.startsWith(\'org-\'))\n#set($hasOrg = true)\n#end\n#end\n<template>\n <el-drawer :title="form.${pk.attrName} ? (detail ? \'详情\' : \'编辑\') : \'添加\'" v-model="visible" size="50%">\n <el-form ref="dataFormRef" :model="form" :rules="dataRules" :disabled="detail" v-loading="loading">\n <el-row :gutter="24">\n#foreach($field in $formList)\n#if($field.attrName != ${pk.attrName})\n#if($formLayout == 1)\n <el-col :span="24" class="mb20">\n#elseif($formLayout == 2)\n <el-col :span="12" class="mb20">\n#end\n#if($field.formType.startsWith(\'org-\'))\n#set($orgType = $field.formType.replace(\'org-\', \'\').replace(\'-multiple\', \'\'))\n <el-form-item label="${field.fieldComment}" prop="${field.attrName}">\n <OrgSelect v-model="form.${field.attrName}" value-type="item" type="${orgType}" :multiple="#if($field.formType.endsWith(\'-multiple\'))true#else false#end" label="${field.fieldComment}" :disabled="loading || detail" />\n </el-form-item>\n </el-col>\n#elseif($field.formType == \'switch\')\n#switchValues($field)\n <el-form-item label="#if(${field.fieldComment})${field.fieldComment}#else${field.attrName}#end" prop="${field.attrName}">\n <el-switch :model-value="String(form.${field.attrName}) === String($switchOn)" @change="(checked) => (form.${field.attrName} = checked ? $switchOn : $switchOff)" />\n </el-form-item>\n </el-col>\n#elseif($field.formType == \'text\')\n <el-form-item label="#if(${field.fieldComment})${field.fieldComment}#else${field.fieldName}#end" prop="${field.attrName}">\n <el-input v-model="form.${field.attrName}" placeholder="请输入#if(${field.fieldComment})${field.fieldComment}#else${field.fieldName}#end"/>\n </el-form-item>\n </el-col>\n#elseif($field.formType == \'textarea\')\n <el-form-item label="#if(${field.fieldComment})${field.fieldComment}#else${field.fieldName}#end" prop="${field.attrName}">\n <el-input type="textarea" v-model="form.${field.attrName}" placeholder="请输入#if(${field.fieldComment})${field.fieldComment}#else${field.fieldName}#end"/>\n </el-form-item>\n </el-col>\n#elseif($field.formType == \'select\')\n <el-form-item label="#if(${field.fieldComment})${field.fieldComment}#else${field.fieldName}#end" prop="${field.attrName}">\n <el-select v-model="form.${field.attrName}" placeholder="请选择#if(${field.fieldComment})${field.fieldComment}#else${field.fieldName}#end">\n#if($field.fieldDict)\n <el-option :value="item.value" :label="item.label" v-for="(item, index) in ${field.fieldDict}" :key="index"></el-option>\n#else\n <el-option label="请选择" value="0"></el-option>\n#end\n </el-select>\n </el-form-item>\n </el-col>\n#elseif($field.formType == \'radio\')\n <el-form-item label="#if(${field.fieldComment})${field.fieldComment}#else${field.fieldName}#end" prop="${field.attrName}">\n <el-radio-group v-model="form.${field.attrName}">\n#if($field.fieldDict)\n <el-radio :label="item.value" v-for="(item, index) in ${field.fieldDict}" border :key="index">{{ item.label }}</el-radio>\n#else\n <el-radio label="${field.fieldComment}" border>${field.fieldComment}</el-radio>\n#end\n </el-radio-group>\n </el-form-item>\n </el-col>\n#elseif($field.formType == \'checkbox\')\n <el-form-item label="#if(${field.fieldComment})${field.fieldComment}#else${field.fieldName}#end" prop="${field.attrName}">\n <el-checkbox-group v-model="form.${field.attrName}">\n#if($field.fieldDict)\n <el-checkbox :label="item.value" v-fLine truncated
|
||||
INSERT INTO `gen_template` (`id`, `template_name`, `generator_path`, `template_desc`, `template_code`, `create_time`, `update_time`, `del_flag`, `tenant_id`, `create_by`, `update_by`) VALUES (21,'主子表格V202611','${frontendPath}/src/views/${moduleName}/${functionName}/index.vue','主子表格V202611','## 有字典字段时才导入 useDict\n#set($hasDictField = false)\n#foreach($field in $queryList)\n#if($field.fieldDict)\n#set($hasDictField = true)\n#end\n#end\n#foreach($field in $gridList)\n#if($field.fieldDict)\n#set($hasDictField = true)\n#end\n#end\n## 开关:按属性类型决定开/关的值,Boolean 用 true/false,整型用 1/0,其余用 \'1\'/\'0\'\n#macro(switchValues $f)\n#if($f.attrType == \'Boolean\')\n#set($switchOn = \'true\')\n#set($switchOff = \'false\')\n#elseif($f.attrType == \'Integer\' || $f.attrType == \'Long\' || $f.attrType == \'Short\')\n#set($switchOn = \'1\')\n#set($switchOff = \'0\')\n#else\n#set($switchOn = "\'1\'")\n#set($switchOff = "\'0\'")\n#end\n#end\n#set($permissionPrefix = "${moduleName}_${functionName}")\n#set($permissionPrefix = $permissionPrefix.toLowerCase())\n<template>\n <div class="layout-padding">\n <div class="layout-padding-auto layout-padding-view">\n#if($queryList)\n <el-row v-show="showSearch">\n <el-form :model="state.queryForm" ref="queryRef" :inline="true" @keyup.enter="getDataList">\n#foreach($field in $queryList)\n#if($field.formType.startsWith(\'org-\'))#set($queryKey = "${field.attrName}Keyword")#else#set($queryKey = $field.attrName)#end\n#if($field.queryFormType == \'select\')\n <el-form-item label="#if(${field.fieldComment})${field.fieldComment}#else${field.attrName}#end" prop="${field.attrName}">\n <el-select v-model="state.queryForm.${field.attrName}" placeholder="请选择#if(${field.fieldComment})${field.fieldComment}#else${field.attrName}#end">\n#if($field.fieldDict)\n <el-option \n :label="item.label" \n :value="item.value" \n v-for="(item, index) in ${field.fieldDict}" \n :key="index">\n </el-option>\n#else\n <el-option label="请选择">0</el-option>\n#end\n </el-select>\n </el-form-item>\n#elseif($field.queryFormType == \'date\')\n <el-form-item label="#if(${field.fieldComment})${field.fieldComment}#else${field.attrName}#end" prop="${field.attrName}">\n <el-date-picker\n type="date"\n placeholder="请输入#if(${field.fieldComment})${field.fieldComment}#else${field.attrName}#end"\n :value-format="dateStr"\n v-model="state.queryForm.${field.attrName}"\n />\n </el-form-item>\n#elseif($field.queryFormType == \'daterange\')\n <el-form-item label="#if(${field.fieldComment})${field.fieldComment}#else${field.attrName}#end" prop="${field.attrName}Range">\n <el-date-picker\n type="daterange"\n range-separator="至"\n start-placeholder="开始日期"\n end-placeholder="结束日期"\n v-model="state.queryForm.${field.attrName}Range"\n :value-format="dateStr"\n />\n </el-form-item>\n#elseif($field.queryFormType == \'datetime\')\n <el-form-item label="#if(${field.fieldComment})${field.fieldComment}#else${field.attrName}#end" prop="${field.attrName}">\n <el-date-picker\n type="datetime"\n placeholder="请输入#if(${field.fieldComment})${field.fieldComment}#else${field.attrName}#end"\n :value-format="dateTimeStr"\n v-model="state.queryForm.${field.attrName}"\n />\n </el-form-item>\n#elseif($field.queryFormType == \'datetimerange\')\n <el-form-item label="#if(${field.fieldComment})${field.fieldComment}#else${field.attrName}#end" prop="${field.attrName}Range">\n <el-date-picker\n type="datetimerange"\n range-separator="至"\n start-placeholder="开始时间"\n end-placeholder="结束时间"\n v-model="state.queryForm.${field.attrName}Range"\n :value-format="dateTimeStr"\n />\n </el-form-item>\n#elseif($field.formType == \'radio\')\n <el-form-item label="#if(${field.fieldComment})${field.fieldComment}#else${field.attrName}#end" prop="${field.attrName}">\n <el-radio-group v-model="state.queryForm.${field.attrName}">\n#if($field.fieldDict)\n <el-radio \n :label="item.value" \n v-for="(item, index) in ${field.fieldDict}" \n border \n :key="index">\n {{ item.label }}\n </el-radio>\n#else\n <el-radio label="${field.fieldComment}" border>${field.fieldComment}</el-radio>\n#end\n </el-radio-group>\n </el-form-item>\n#else\n <elLine truncated
|
||||
INSERT INTO `gen_template` (`id`, `template_name`, `generator_path`, `template_desc`, `template_code`, `create_time`, `update_time`, `del_flag`, `tenant_id`, `create_by`, `update_by`) VALUES (22,'子MapperV202611','${backendPath}/src/main/java/${packagePath}/${moduleName}/mapper/${ChildClassName}Mapper.java','子MapperV202611','package ${package}.${moduleName}.mapper;\n\nimport ${package}.common.data.datascope.PigxBaseMapper;\nimport ${entityPackage}.${ChildClassName}Entity;\nimport org.apache.ibatis.annotations.Mapper;\n\n@Mapper\npublic interface ${ChildClassName}Mapper extends PigxBaseMapper<${ChildClassName}Entity> {\n\n}\n','2026-04-08 17:38:24','2026-04-08 17:38:24','0',1,'admin','admin');
|
||||
INSERT INTO `gen_template` (`id`, `template_name`, `generator_path`, `template_desc`, `template_code`, `create_time`, `update_time`, `del_flag`, `tenant_id`, `create_by`, `update_by`) VALUES (23,'树形ControllerV202611','${backendPath}/src/main/java/${packagePath}/${moduleName}/controller/${ClassName}Controller.java','树形ControllerV202611','## 查询条件按需导入:字符串字段用 StrUtil,其余类型用 Objects;复选框与日期范围两者都不用\n#set($needStrUtil = false)\n#set($needObjects = false)\n#foreach($field in $queryList)\n#if($field.formType == \'checkbox\' || $field.queryFormType == \'daterange\' || $field.queryFormType == \'datetimerange\')\n#elseif($field.formType.startsWith(\'org-\') || $field.attrType == \'String\')\n#set($needStrUtil = true)\n#else\n#set($needObjects = true)\n#end\n#end\n#set($hasOrgQuery = false)\n#foreach($field in $queryList)\n#if($field.formType.startsWith(\'org-\'))\n#set($hasOrgQuery = true)\n#end\n#end\n## 组织字段以 [{id,name}] JSON 存储,按 ${attrName}Keyword 对整列模糊查询,分页和导出共用\n#macro(orgKeywordParams)#foreach($field in $queryList)#if($field.formType.startsWith(\'org-\')), @RequestParam(required = false) String ${field.attrName}Keyword#end#end#end\n#macro(orgKeywordDecl)#foreach($field in $queryList)#if($field.formType.startsWith(\'org-\')), String ${field.attrName}Keyword#end#end#end\n#macro(orgKeywordArgs)#foreach($field in $queryList)#if($field.formType.startsWith(\'org-\')), ${field.attrName}Keyword#end#end#end\n#macro(orgKeywordFilters)\n#if($hasOrgQuery)\n // 组织字段对整列 JSON 做 LIKE:关键字为数字或 id/name 时会误命中,需精确匹配时改用数据库 JSON 函数\n#end\n#foreach($field in $queryList)\n#if($field.formType.startsWith(\'org-\'))\n wrapper.like(StrUtil.isNotBlank(${field.attrName}Keyword), ${ClassName}Entity::$str.getProperty($field.attrName), ${field.attrName}Keyword);\n#end\n#end\n#end\npackage ${package}.${moduleName}.controller;\n\n#if($queryList)\n#if($needStrUtil)\nimport cn.hutool.core.util.StrUtil;\n#end\n#end\nimport cn.hutool.core.util.ArrayUtil;\nimport cn.hutool.core.collection.CollUtil;\nimport com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;\nimport com.baomidou.mybatisplus.core.toolkit.Wrappers;\nimport ${package}.common.core.util.R;\nimport ${package}.common.log.annotation.SysLog;\n#if($opensource)\nimport com.pig4cloud.plugin.excel.annotation.ResponseExcel;\nimport com.pig4cloud.plugin.excel.annotation.RequestExcel;\n#else\nimport ${package}.common.excel.annotation.ResponseExcel;\nimport ${package}.common.excel.annotation.RequestExcel;\n#end\nimport ${entityClassName};\nimport ${package}.${moduleName}.service.${ClassName}Service;\n\nimport io.swagger.v3.oas.annotations.security.SecurityRequirement;\n#if($isSpringBoot3)\nimport ${package}.common.security.annotation.HasPermission;\nimport org.springdoc.core.annotations.ParameterObject;\n#else\nimport org.springframework.security.access.prepost.PreAuthorize;\nimport org.springdoc.api.annotations.ParameterObject;\n#end\nimport org.springframework.http.HttpHeaders;\nimport io.swagger.v3.oas.annotations.tags.Tag;\nimport io.swagger.v3.oas.annotations.Operation;\nimport lombok.RequiredArgsConstructor;\nimport org.springframework.validation.BindingResult;\nimport org.springframework.web.bind.annotation.*;\n\nimport java.util.List;\n#if($needObjects)\nimport java.util.Objects;\n#end\n\n/**\n * ${tableComment}\n *\n * @author ${author}\n * @date ${datetime}\n */\n@RestController\n@RequiredArgsConstructor\n@RequestMapping("/${functionName}" )\n@Tag(description = "${functionName}" , name = "${tableComment}管理" )\n@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)\npublic class ${ClassName}Controller {\n\n private final ${ClassName}Service ${className}Service;\n\n /**\n * 获取树形列表\n * @param ${className} ${tableComment}\n * @return\n */\n @Operation(summary = "获取树形列表" , description = "获取树形列表" )\n @GetMapping("/tree" )\n #if($isSpringBoot3)\n @HasPermission("$str.lowerCase($moduleName)_$str.lowerCase($functionName)_view")\n #else\n @PreAuthorize("@pms.hasPermission(\'$str.lowerCase($moduleName)_$str.lowerCase($functionName)_view\')" )\n #end\n public R get${ClassName}Tree(@ParameterObject ${ClassName}Entity ${className}#orgKeywordParams()) {\n return R.ok(${className}Service.buildTree(buildQueryWrapper(${className}#orgKeywordArgs())));\n }\n\n /**\n * 列表与导出共用的查询条件,保证导出结果与列表一致\n */\n private LambdaQueryWrapper<${ClassName}Entity> buildQueryWrapper(${ClassName}Entity ${className}#orgKeywordDecl()) {\n LambdaQueryWrapper<${ClassName}Entity> wrapper = Wrappers.lambdaQuery();\n#orgKeywordFilters()\n#foreach ($field in $queryList)\n#if(!$field.formType.startsWith(\'org-\'))\n#set($getAttrName=$str.getProperty($field.attLine truncated
|
||||
INSERT INTO `gen_template` (`id`, `template_name`, `generator_path`, `template_desc`, `template_code`, `create_time`, `update_time`, `del_flag`, `tenant_id`, `create_by`, `update_by`) VALUES (24,'树形ServiceV202611','${backendPath}/src/main/java/${packagePath}/${moduleName}/service/${ClassName}Service.java','树形ServiceV202611','package ${package}.${moduleName}.service;\n\nimport cn.hutool.core.lang.tree.Tree;\nimport com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;\nimport com.baomidou.mybatisplus.spring.service.IService;\nimport ${entityClassName};\n\nimport java.util.List;\n\n/**\n * ${tableComment} Service接口\n *\n * @author ${author}\n * @date ${datetime}\n */\npublic interface ${ClassName}Service extends IService<${ClassName}Entity> {\n\n /**\n * 构建树形结构数据\n * @param wrapper 查询条件\n * @return 树形结构数据\n */\n List<Tree<${pk.attrType}>> buildTree(LambdaQueryWrapper<${ClassName}Entity> wrapper);\n\n /**\n * 递归删除节点及其子节点\n * @param ids 要删除的节点ID列表\n * @return 删除结果\n */\n boolean removeBatchByIds(List<${pk.attrType}> ids);\n} ','2026-04-08 17:38:24','2026-04-08 17:38:24','0',1,'admin','admin');
|
||||
INSERT INTO `gen_template` (`id`, `template_name`, `generator_path`, `template_desc`, `template_code`, `create_time`, `update_time`, `del_flag`, `tenant_id`, `create_by`, `update_by`) VALUES (25,'树形ServiceImplV202611','${backendPath}/src/main/java/${packagePath}/${moduleName}/service/impl/${ClassName}ServiceImpl.java','树形ServiceImplV202611','## 根节点 ID 按主键类型生成,与 Tree<${pk.attrType}> 类型一致\n#if($pk.attrType == \'Long\')\n#set($treeRootId = \'0L\')\n#elseif($pk.attrType == \'String\')\n#set($treeRootId = \'"0"\')\n#else\n#set($treeRootId = \'0\')\n#end\npackage ${package}.${moduleName}.service.impl;\n\nimport cn.hutool.core.collection.CollUtil;\nimport cn.hutool.core.lang.tree.Tree;\nimport cn.hutool.core.lang.tree.TreeNode;\nimport cn.hutool.core.lang.tree.TreeUtil;\nimport com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;\nimport com.baomidou.mybatisplus.core.toolkit.Wrappers;\nimport com.baomidou.mybatisplus.spring.service.impl.ServiceImpl;\nimport ${entityClassName};\nimport ${package}.${moduleName}.mapper.${ClassName}Mapper;\nimport ${package}.${moduleName}.service.${ClassName}Service;\nimport jakarta.validation.constraints.NotNull;\nimport lombok.RequiredArgsConstructor;\nimport org.springframework.stereotype.Service;\nimport org.springframework.transaction.annotation.Transactional;\n\nimport java.util.ArrayList;\nimport java.util.HashMap;\nimport java.util.LinkedHashMap;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.Objects;\nimport java.util.function.Function;\nimport java.util.stream.Collectors;\n\n/**\n * ${tableComment} Service实现类\n *\n * @author ${author}\n * @date ${datetime}\n */\n@Service\n@RequiredArgsConstructor\npublic class ${ClassName}ServiceImpl extends ServiceImpl<${ClassName}Mapper, ${ClassName}Entity> implements ${ClassName}Service {\n\n /**\n * 构建树形结构数据\n * @param wrapper 查询条件\n * @return 树形结构数据\n */\n @Override\n public List<Tree<${pk.attrType}>> buildTree(LambdaQueryWrapper<${ClassName}Entity> wrapper) {\n // 查询命中节点,再按层补齐祖先,保留完整树路径\n List<${ClassName}Entity> allList = list(wrapper);\n \n if (CollUtil.isEmpty(allList)) {\n return new ArrayList<>();\n }\n\n Map<${pk.attrType}, ${ClassName}Entity> nodes = new LinkedHashMap<>();\n allList.forEach(entity -> nodes.put(entity.$str.getProperty($pk.attrName)(), entity));\n List<${ClassName}Entity> level = allList;\n while (!level.isEmpty()) {\n List<${pk.attrType}> parentIds = level.stream()\n .map(${ClassName}Entity::$str.getProperty($parentField))\n .filter(id -> id != null && !Objects.equals(id, ${treeRootId}) && !nodes.containsKey(id))\n .distinct()\n .toList();\n if (parentIds.isEmpty()) {\n break;\n }\n level = listByIds(parentIds);\n level.forEach(entity -> nodes.put(entity.$str.getProperty($pk.attrName)(), entity));\n }\n\n // 转换为TreeNode,仅包含命中节点及其祖先\n List<TreeNode<${pk.attrType}>> collect = nodes.values().stream().map(getNodeFunction()).toList();\n\n // 使用TreeUtil构建树形结构,根节点ID为0\n return TreeUtil.build(collect, ${treeRootId});\n }\n\n /**\n * 获取TreeNode转换函数\n * @return TreeNode转换函数\n */\n @NotNull\n private Function<${ClassName}Entity, TreeNode<${pk.attrType}>> getNodeFunction() {\n return entity -> {\n TreeNode<${pk.attrType}> node = new TreeNode<>();\n node.setId(entity.$str.getProperty($pk.attrName)());\n node.setName(entity.$str.getProperty($nameField)());\n node.setParentId(entity.$str.getProperty($parentField)() != null ? entity.$str.getProperty($parentField)() : ${treeRootId});\n\n // 扩展属性\n Map<String, Object> extra = new HashMap<>();\n#foreach($field in $fieldList)\n extra.put(${ClassName}Entity.Fields.${field.attrName}, entity.$str.getProperty($field.attrName)());\n#end\n node.setExtra(extra);\n return node;\n };\n }\n\n /**\n * 递归删除节点及其子节点\n * @param ids 要删除的节点ID列表\n * @return 删除结果\n */\n @Override\n @Transactional(rollbackFor = Exception.class)\n public boolean removeBatchByIds(List<${pk.attrType}> ids) {\n if (CollUtil.isEmpty(ids)) {\n return true;\n }\n\n // 获取所有要删除的ID(包括子节点)\n List<${pk.attrType}> allDeleteIds = new ArrayList<>(ids);\n \n for (${pk.attrType} id : ids) {\n List<${pk.attrType}> childIds = getChildIdsRecursive(id);\n allDeleteIds.addAll(childIds);\n }\n\n // 去重\n allLine truncated
|
||||
INSERT INTO `gen_template` (`id`, `template_name`, `generator_path`, `template_desc`, `template_code`, `create_time`, `update_time`, `del_flag`, `tenant_id`, `create_by`, `update_by`) VALUES (26,'树形实体V202611','${entityPath}/src/main/java/${entityPackagePath}/${ClassName}Entity.java','树形实体V202611','#set($hasOrg = false)\n#foreach($field in $fieldList)\n#if($field.formType.startsWith(\'org-\'))\n#set($hasOrg = true)\n#end\n#end\npackage ${entityPackage};\n\nimport com.baomidou.mybatisplus.annotation.*;\nimport com.baomidou.mybatisplus.spring.activerecord.Model;\nimport io.swagger.v3.oas.annotations.media.Schema;\nimport lombok.Data;\nimport lombok.EqualsAndHashCode;\nimport lombok.experimental.FieldNameConstants;\n#if($hasOrg)\nimport com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;\nimport ${package}.common.core.util.OrgRef;\nimport org.apache.fesod.sheet.annotation.ExcelIgnore;\nimport java.util.List;\n#end\n#if($isTenant)\nimport ${package}.common.core.util.TenantTable;\n#end\n#foreach($import in $importList)\n#if(!$import.startsWith(\'java.lang.\'))\nimport $import;\n#end\n#end\n\n/**\n * ${tableComment}\n *\n * @author ${author}\n * @date ${datetime}\n */\n@Data\n@FieldNameConstants\n#if($isTenant)\n@TenantTable\n#end\n@TableName(value = "${tableName}"#if($hasOrg), autoResultMap = true#end)\n@EqualsAndHashCode(callSuper = true)\n@Schema(description = "${tableComment}")\npublic class ${ClassName}Entity extends Model<${ClassName}Entity> {\n\n#foreach ($field in $fieldList)\n#if(${field.fieldComment})#set($comment=${field.fieldComment})#else #set($comment=${field.attrName})#end\n\n /**\n * $comment\n */\n#if($field.primaryPk == \'1\')\n @TableId(type = IdType.ASSIGN_ID)\n#end\n#if($field.formType.startsWith(\'org-\'))\n @TableField(typeHandler = JacksonTypeHandler.class#if($field.autoFill == \'INSERT\' || $field.autoFill == \'INSERT_UPDATE\' || $field.autoFill == \'UPDATE\'), fill = FieldFill.${field.autoFill}#end)\n @ExcelIgnore\n#elseif($field.autoFill == \'INSERT\')\n @TableField(fill = FieldFill.INSERT)\n#elseif($field.autoFill == \'INSERT_UPDATE\')\n @TableField(fill = FieldFill.INSERT_UPDATE)\n#elseif($field.autoFill == \'UPDATE\')\n @TableField(fill = FieldFill.UPDATE)\n#end\n#if($field.fieldName == \'del_flag\')\n @TableLogic\n @TableField(fill = FieldFill.INSERT)\n#end\n @Schema(description="$comment"#if($field.hidden),hidden=$field.hidden#end)\n#if($field.formType.startsWith(\'org-\'))\n private List<OrgRef> $field.attrName;\n#elseif($field.formType == \'checkbox\')\n private ${field.attrType}[] $field.attrName;\n#elseif($field.formType == \'daterange\' || $field.formType == \'datetimerange\')\n private String[] $field.attrName;\n#else\n private $field.attrType $field.attrName;\n#end\n#end\n#foreach ($field in $queryList)\n#if($field.queryFormType == \'daterange\' || $field.queryFormType == \'datetimerange\')\n#if(${field.fieldComment})#set($comment=${field.fieldComment})#else #set($comment=${field.attrName})#end\n\n /**\n * $comment 查询范围\n */\n @TableField(exist = false)\n @Schema(description="$comment 查询范围",hidden=true)\n private String[] ${field.attrName}Range;\n#end\n#end\n}\n','2026-04-08 17:38:24','2026-04-08 17:38:24','0',1,'admin','admin');
|
||||
INSERT INTO `gen_template` (`id`, `template_name`, `generator_path`, `template_desc`, `template_code`, `create_time`, `update_time`, `del_flag`, `tenant_id`, `create_by`, `update_by`) VALUES (27,'MapperV202611','${backendPath}/src/main/java/${packagePath}/${moduleName}/mapper/${ClassName}Mapper.java','MapperV202611','package ${package}.${moduleName}.mapper;\n\n\nimport com.baomidou.mybatisplus.core.mapper.BaseMapper;\nimport ${entityClassName};\nimport org.apache.ibatis.annotations.Mapper;\n\n@Mapper\npublic interface ${ClassName}Mapper extends BaseMapper<${ClassName}Entity> {\n\n}\n','2026-04-08 17:38:24','2026-04-08 17:38:24','0',1,'admin','admin');
|
||||
INSERT INTO `gen_template` (`id`, `template_name`, `generator_path`, `template_desc`, `template_code`, `create_time`, `update_time`, `del_flag`, `tenant_id`, `create_by`, `update_by`) VALUES (28,'Mapper.xmlV202611','${backendPath}/src/main/resources/mapper/${ClassName}Mapper.xml','Mapper.xmlV202611','<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE mapper PUBLIC \"-//mybatis.org//DTD Mapper 3.0//EN\" \"http://mybatis.org/dtd/mybatis-3-mapper.dtd\">\n\n<mapper namespace=\"${package}.${moduleName}.mapper.${ClassName}Mapper\">\n\n <resultMap id=\"${className}Map\" type=\"${entityClassName}\">\n#foreach ($field in $fieldList)\n #if($field.primaryPk == \'1\')\n <id property=\"$field.attrName\" column=\"$field.fieldName\"/>\n #else\n <result property=\"$field.attrName\" column=\"$field.fieldName\"#if($field.formType.startsWith(\'org-\')) typeHandler=\"com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler\"#end/>\n #end\n#end\n </resultMap>\n</mapper>\n','2026-04-08 17:38:24','2026-04-08 17:38:24','0',1,'admin','admin');
|
||||
INSERT INTO `gen_template` (`id`, `template_name`, `generator_path`, `template_desc`, `template_code`, `create_time`, `update_time`, `del_flag`, `tenant_id`, `create_by`, `update_by`) VALUES (29,'权限菜单V202611','${backendPath}/menu/${functionName}_menu.sql','权限菜单V202611','#set($permissionPrefix = \"${moduleName}_${functionName}\")\n#set($permissionPrefix = $permissionPrefix.toLowerCase())\n-- 该脚本不要直接执行, 注意维护菜单的父节点ID 默认 父节点-1 , #if(!$opensource)默认租户 1#end\n#set($menuId=${dateTool.getSystemTime()})\n\n-- 菜单SQL\ninsert into sys_menu ( menu_id,parent_id, path, permission, menu_type, icon, del_flag, create_time, sort_order, update_time, name#if(!$opensource), tenant_id#end)\nvalues (${menuId}, \'-1\', \'/${moduleName}/${functionName}/index\', \'\', \'0\', \'icon-bangzhushouji\', \'0\', null , \'8\', null , \'${tableComment}管理\'#if(!$opensource), 1#end);\n\n-- 菜单对应按钮SQL\ninsert into sys_menu ( menu_id,parent_id, permission, menu_type, path, icon, del_flag, create_time, sort_order, update_time, name#if(!$opensource), tenant_id#end)\nvalues (${math.add($menuId,1)},${menuId}, \'${permissionPrefix}_view\', \'1\', null, \'1\', \'0\', null, \'0\', null, \'${tableComment}查看\'#if(!$opensource), 1#end);\n\ninsert into sys_menu ( menu_id,parent_id, permission, menu_type, path, icon, del_flag, create_time, sort_order, update_time, name#if(!$opensource), tenant_id#end)\nvalues (${math.add($menuId,2)},${menuId}, \'${permissionPrefix}_add\', \'1\', null, \'1\', \'0\', null, \'1\', null, \'${tableComment}新增\'#if(!$opensource), 1#end);\n\ninsert into sys_menu (menu_id, parent_id, permission, menu_type, path, icon, del_flag, create_time, sort_order, update_time, name#if(!$opensource), tenant_id#end)\nvalues (${math.add($menuId,3)},${menuId}, \'${permissionPrefix}_edit\', \'1\', null, \'1\', \'0\', null, \'2\', null, \'${tableComment}修改\'#if(!$opensource), 1#end);\n\ninsert into sys_menu (menu_id, parent_id, permission, menu_type, path, icon, del_flag, create_time, sort_order, update_time, name#if(!$opensource), tenant_id#end)\nvalues (${math.add($menuId,4)},${menuId}, \'${permissionPrefix}_del\', \'1\', null, \'1\', \'0\', null, \'3\', null, \'${tableComment}删除\'#if(!$opensource), 1#end);\n\ninsert into sys_menu ( menu_id,parent_id, permission, menu_type, path, icon, del_flag, create_time, sort_order, update_time, name#if(!$opensource), tenant_id#end)\nvalues (${math.add($menuId,5)},${menuId}, \'${permissionPrefix}_export\', \'1\', null, \'1\', \'0\', null, \'3\', null, \'导入导出\'#if(!$opensource), 1#end);\n','2026-04-08 17:38:24','2026-04-08 17:38:24','0',1,'admin','admin');
|
||||
INSERT INTO `gen_template` (`id`, `template_name`, `generator_path`, `template_desc`, `template_code`, `create_time`, `update_time`, `del_flag`, `tenant_id`, `create_by`, `update_by`) VALUES (30,'树形api.tsV202611','${frontendPath}/src/api/${moduleName}/${functionName}.ts','树形api.tsV202611','import request from \"/@/utils/request\"\n\n// ========== 树形表格CRUD接口 ==========\n\n/**\n * 获取树形列表数据\n * @param query - 查询参数对象\n * @returns Promise<树形数据>\n */\nexport function fetchTreeList(query?: Object) {\n return request({\n url: \'/${moduleName}/${functionName}/tree\',\n method: \'get\',\n params: query\n })\n}\n\n/**\n * 新增数据\n * @param obj - 要新增的数据对象\n * @returns Promise<boolean> - 操作结果\n */\nexport function addObj(obj?: Object) {\n return request({\n url: \'/${moduleName}/${functionName}\',\n method: \'post\',\n data: obj\n })\n}\n\n/**\n * 获取详情数据\n * @param obj - 查询参数对象(包含ID等)\n * @returns Promise<数据详情>\n */\nexport function getObj(obj?: Object) {\n return request({\n url: \'/${moduleName}/${functionName}/details\',\n method: \'get\',\n params: obj\n })\n}\n\n/**\n * 批量删除数据(递归删除子节点)\n * @param ids - 要删除的ID数组\n * @returns Promise<操作结果>\n */\nexport function delObjs(ids?: Object) {\n return request({\n url: \'/${moduleName}/${functionName}\',\n method: \'delete\',\n data: ids\n })\n}\n\n/**\n * 更新数据\n * @param obj - 要更新的数据对象\n * @returns Promise<操作结果>\n */\nexport function putObj(obj?: Object) {\n return request({\n url: \'/${moduleName}/${functionName}\',\n method: \'put\',\n data: obj\n })\n}\n\n\n// ========== 工具函数 ==========\n\n/**\n * 验证字段值唯一性\n * @param rule - 验证规则对象\n * @param value - 要验证的值\n * @param callback - 验证回调函数\n * @param isEdit - 是否为编辑模式\n * \n * @example\n * // 在表单验证规则中使用\n * fieldName: [\n * {\n * validator: (rule, value, callback) => {\n * validateExist(rule, value, callback, form.${pk.attrName} !== \'\');\n * },\n * trigger: \'blur\',\n * },\n * ]\n */\nexport function validateExist(rule: any, value: any, callback: any, isEdit: boolean) {\n // 编辑模式下跳过验证\n if (isEdit) {\n return callback();\n }\n\n // 查询是否存在相同值\n getObj({ [rule.field]: value }).then((response) => {\n const result = response.data;\n if (result !== null && result.length > 0) {\n callback(new Error(\'数据已经存在\'));\n } else {\n callback();\n }\n });\n}','2026-04-08 17:38:24','2026-04-08 17:38:24','0',1,'admin','admin');
|
||||
INSERT INTO `gen_template` (`id`, `template_name`, `generator_path`, `template_desc`, `template_code`, `create_time`, `update_time`, `del_flag`, `tenant_id`, `create_by`, `update_by`) VALUES (31,'树形表格V202611','${frontendPath}/src/views/${moduleName}/${functionName}/index.vue','树形表格V202611','## 有字典字段时才导入 useDict\n#set($hasDictField = false)\n#foreach($field in $queryList)\n#if($field.fieldDict)\n#set($hasDictField = true)\n#end\n#end\n#foreach($field in $gridList)\n#if($field.fieldDict)\n#set($hasDictField = true)\n#end\n#end\n## 开关:按属性类型决定开/关的值,Boolean 用 true/false,整型用 1/0,其余用 \'1\'/\'0\'\n#macro(switchValues $f)\n#if($f.attrType == \'Boolean\')\n#set($switchOn = \'true\')\n#set($switchOff = \'false\')\n#elseif($f.attrType == \'Integer\' || $f.attrType == \'Long\' || $f.attrType == \'Short\')\n#set($switchOn = \'1\')\n#set($switchOff = \'0\')\n#else\n#set($switchOn = "\'1\'")\n#set($switchOff = "\'0\'")\n#end\n#end\n<template>\n <div class="layout-padding">\n <div class="layout-padding-auto layout-padding-view">\n#if($queryList)\n <!-- 查询表单区域 -->\n <el-row v-show="showSearch">\n <el-form :model="state.queryForm" ref="queryRef" :inline="true" @keyup.enter="getDataList">\n#foreach($field in $queryList)\n#if($field.formType.startsWith(\'org-\'))#set($queryKey = "${field.attrName}Keyword")#else#set($queryKey = $field.attrName)#end\n#if($field.queryFormType == \'select\')\n <el-form-item label="#if(${field.fieldComment})${field.fieldComment}#else${field.attrName}#end" prop="${queryKey}">\n <el-select v-model="state.queryForm.${queryKey}" placeholder="请选择#if(${field.fieldComment})${field.fieldComment}#else${field.attrName}#end">\n#if($field.fieldDict)\n <el-option \n :label="item.label" \n :value="item.value" \n v-for="(item, index) in ${field.fieldDict}" \n :key="index"\n />\n#else\n <el-option label="请选择" value="0" />\n#end\n </el-select>\n </el-form-item>\n#elseif($field.queryFormType == \'date\')\n <el-form-item label="#if(${field.fieldComment})${field.fieldComment}#else${field.attrName}#end" prop="${queryKey}">\n <el-date-picker \n type="date" \n placeholder="请输入#if(${field.fieldComment})${field.fieldComment}#else${field.attrName}#end" \n v-model="state.queryForm.${queryKey}"\n :value-format="dateStr"\n />\n </el-form-item>\n#elseif($field.queryFormType == \'datetime\')\n <el-form-item label="#if(${field.fieldComment})${field.fieldComment}#else${field.attrName}#end" prop="${queryKey}">\n <el-date-picker\n type="datetime"\n placeholder="请输入#if(${field.fieldComment})${field.fieldComment}#else${field.attrName}#end"\n v-model="state.queryForm.${queryKey}"\n :value-format="dateTimeStr"\n />\n </el-form-item>\n#elseif($field.queryFormType == \'daterange\')\n <el-form-item label="#if(${field.fieldComment})${field.fieldComment}#else${field.attrName}#end" prop="${field.attrName}Range">\n <el-date-picker\n type="daterange"\n range-separator="至"\n start-placeholder="开始日期"\n end-placeholder="结束日期"\n v-model="state.queryForm.${field.attrName}Range"\n :value-format="dateStr"\n />\n </el-form-item>\n#elseif($field.queryFormType == \'datetimerange\')\n <el-form-item label="#if(${field.fieldComment})${field.fieldComment}#else${field.attrName}#end" prop="${field.attrName}Range">\n <el-date-picker\n type="datetimerange"\n range-separator="至"\n start-placeholder="开始时间"\n end-placeholder="结束时间"\n v-model="state.queryForm.${field.attrName}Range"\n :value-format="dateTimeStr"\n />\n </el-form-item>\n#elseif($field.formType == \'radio\')\n <el-form-item label="#if(${field.fieldComment})${field.fieldComment}#else${field.attrName}#end" prop="${queryKey}">\n <el-radio-group v-model="state.queryForm.${queryKey}">\n#if($field.fieldDict)\n <el-radio \n :label="item.value" \n v-for="(item, index) in ${field.fieldDict}" \n border \n :key="index"\n >\n {{ item.label }}\n </el-radio>\n#else\n <el-radio label="${field.fieldComment}" border>\n ${field.fieldComment}\n </el-radio>\n#end\n </el-radio-group>\n </el-form-item>\n#else\n <el-form-item label="#if(${field.fieldComment})${field.fieldComment}#else${field.attrName}#enLine truncated
|
||||
INSERT INTO `gen_template` (`id`, `template_name`, `generator_path`, `template_desc`, `template_code`, `create_time`, `update_time`, `del_flag`, `tenant_id`, `create_by`, `update_by`) VALUES (32,'树形表单V202611','${frontendPath}/src/views/${moduleName}/${functionName}/form.vue','树形表单V202611','#set($hasDuplicate = false)\n#foreach($field in $formList)\n#if($field.formValidator == \'duplicate\')\n#set($hasDuplicate = true)\n#end\n#end\n## 开关:按属性类型决定开/关的值,Boolean 用 true/false,整型用 1/0,其余用 \'1\'/\'0\'\n#macro(switchValues $f)\n#if($f.attrType == \'Boolean\')\n#set($switchOn = \'true\')\n#set($switchOff = \'false\')\n#elseif($f.attrType == \'Integer\' || $f.attrType == \'Long\' || $f.attrType == \'Short\')\n#set($switchOn = \'1\')\n#set($switchOff = \'0\')\n#else\n#set($switchOn = "\'1\'")\n#set($switchOff = "\'0\'")\n#end\n#end\n#set($hasOrg = false)\n#foreach($field in $formList)\n#if($field.formType.startsWith(\'org-\'))\n#set($hasOrg = true)\n#end\n#end\n<template>\n <el-dialog :title="form.${pk.attrName} ? \'编辑\' : \'新增\'" v-model="visible"\n :close-on-click-modal="false" draggable>\n <el-form ref="dataFormRef" :model="form" :rules="dataRules" formDialogRef label-width="90px" v-loading="loading">\n <el-row :gutter="24">\n <!-- 父级节点选择 -->\n#if($formLayout == 1)\n <el-col :span="24" class="mb20">\n#elseif($formLayout == 2)\n <el-col :span="12" class="mb20">\n#end\n <el-form-item label="父级节点" prop="${parentField}">\n <el-tree-select\n v-model="form.${parentField}"\n :data="parentNodes"\n :props="treeSelectProps"\n check-strictly\n :render-after-expand="false"\n placeholder="请选择父级节点"\n style="width: 100%"\n clearable\n filterable\n />\n </el-form-item>\n </el-col>\n#foreach($field in $formList)\n#if($field.attrName != ${pk.attrName} && $field.attrName != ${parentField})\n#if($formLayout == 1)\n <el-col :span="24" class="mb20">\n#elseif($formLayout == 2)\n <el-col :span="12" class="mb20">\n#end\n#if($field.formType.startsWith(\'org-\'))\n#set($orgType = $field.formType.replace(\'org-\', \'\').replace(\'-multiple\', \'\'))\n <el-form-item label="${field.fieldComment}" prop="${field.attrName}">\n <OrgSelect v-model="form.${field.attrName}" value-type="item" type="${orgType}" :multiple="#if($field.formType.endsWith(\'-multiple\'))true#else false#end" label="${field.fieldComment}" :disabled="loading" />\n </el-form-item>\n </el-col>\n#elseif($field.formType == \'switch\')\n#switchValues($field)\n <el-form-item label="#if(${field.fieldComment})${field.fieldComment}#else${field.attrName}#end" prop="${field.attrName}">\n <el-switch :model-value="String(form.${field.attrName}) === String($switchOn)" @change="(checked) => (form.${field.attrName} = checked ? $switchOn : $switchOff)" />\n </el-form-item>\n </el-col>\n#elseif($field.formType == \'text\')\n <el-form-item label="#if(${field.fieldComment})${field.fieldComment}#else${field.attrName}#end" prop="${field.attrName}">\n <el-input v-model="form.${field.attrName}" placeholder="请输入#if(${field.fieldComment})${field.fieldComment}#else${field.attrName}#end"/>\n </el-form-item>\n </el-col>\n#elseif($field.formType == \'textarea\')\n <el-form-item label="#if(${field.fieldComment})${field.fieldComment}#else${field.attrName}#end" prop="${field.attrName}">\n <el-input type="textarea" v-model="form.${field.attrName}" placeholder="请输入#if(${field.fieldComment})${field.fieldComment}#else${field.attrName}#end"/>\n </el-form-item>\n </el-col>\n#elseif($field.formType == \'select\')\n <el-form-item label="#if(${field.fieldComment})${field.fieldComment}#else${field.attrName}#end" prop="${field.attrName}">\n <el-select v-model="form.${field.attrName}" placeholder="请选择#if(${field.fieldComment})${field.fieldComment}#else${field.attrName}#end">\n#if($field.fieldDict)\n <el-option :value="item.value" :label="item.label" v-for="(item, index) in ${field.fieldDict}" :key="index"></el-option>\n#else\n <el-option label="请选择" value="0"></el-option>\n#end\n </el-select>\n </el-form-item>\n </el-col>\n#elseif($field.formType == \'radio\')\n <el-form-item label="#if(${field.fieldComment})${field.fieldComment}#else${field.attrName}#end" prop="${field.attrName}">\n <el-radio-group v-model="form.${field.attrName}">\n#if($field.fieldDict)\n <el-radio :label="item.value" v-for="(item, index) in ${field.fieldDict}" border :key="index">{{ item.label }}</el-radio>\n#else\n <el-radio label="${field.fieldComment}" bordLine truncated
|
||||
INSERT INTO `gen_template` (`id`, `template_name`, `generator_path`, `template_desc`, `template_code`, `create_time`, `update_time`, `del_flag`, `tenant_id`, `create_by`, `update_by`) VALUES (33,'左树右表ControllerV202611','${backendPath}/src/main/java/${packagePath}/${moduleName}/controller/${ClassName}Controller.java','左树右表ControllerV202611','## 查询条件按需导入 StrUtil(字符串字段);Objects 用于树节点筛选,始终导入\n#set($needStrUtil = false)\n#foreach($field in $queryList)\n#if($field.formType.startsWith(\'org-\') || ($field.formType != \'checkbox\' && $field.queryFormType != \'daterange\' && $field.queryFormType != \'datetimerange\' && $field.attrType == \'String\'))\n#set($needStrUtil = true)\n#end\n#end\n#set($hasOrgQuery = false)\n#foreach($field in $queryList)\n#if($field.formType.startsWith(\'org-\'))\n#set($hasOrgQuery = true)\n#end\n#end\n## 组织字段以 [{id,name}] JSON 存储,按 ${attrName}Keyword 对整列模糊查询,分页和导出共用\n#macro(orgKeywordParams)#foreach($field in $queryList)#if($field.formType.startsWith(\'org-\')), @RequestParam(required = false) String ${field.attrName}Keyword#end#end#end\n#macro(orgKeywordDecl)#foreach($field in $queryList)#if($field.formType.startsWith(\'org-\')), String ${field.attrName}Keyword#end#end#end\n#macro(orgKeywordArgs)#foreach($field in $queryList)#if($field.formType.startsWith(\'org-\')), ${field.attrName}Keyword#end#end#end\n#macro(orgKeywordFilters)\n#if($hasOrgQuery)\n // 组织字段对整列 JSON 做 LIKE:关键字为数字或 id/name 时会误命中,需精确匹配时改用数据库 JSON 函数\n#end\n#foreach($field in $queryList)\n#if($field.formType.startsWith(\'org-\'))\n wrapper.like(StrUtil.isNotBlank(${field.attrName}Keyword), ${ClassName}Entity::$str.getProperty($field.attrName), ${field.attrName}Keyword);\n#end\n#end\n#end\npackage ${package}.${moduleName}.controller;\n\n#if($needStrUtil)\nimport cn.hutool.core.util.StrUtil;\n#end\nimport cn.hutool.core.util.ArrayUtil;\nimport cn.hutool.core.collection.CollUtil;\nimport com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;\nimport com.baomidou.mybatisplus.core.toolkit.Wrappers;\nimport com.baomidou.mybatisplus.extension.plugins.pagination.Page;\nimport ${package}.common.core.util.R;\nimport ${package}.common.log.annotation.SysLog;\n#if($opensource)\nimport com.pig4cloud.plugin.excel.annotation.ResponseExcel;\nimport com.pig4cloud.plugin.excel.annotation.RequestExcel;\n#else\nimport ${package}.common.excel.annotation.ResponseExcel;\nimport ${package}.common.excel.annotation.RequestExcel;\n#end\nimport ${entityPackage}.${ChildClassName}Entity;\nimport ${entityClassName};\nimport ${package}.${moduleName}.service.${ClassName}Service;\n\nimport io.swagger.v3.oas.annotations.security.SecurityRequirement;\n#if($isSpringBoot3)\nimport ${package}.common.security.annotation.HasPermission;\nimport org.springdoc.core.annotations.ParameterObject;\n#else\nimport org.springframework.security.access.prepost.PreAuthorize;\nimport org.springdoc.api.annotations.ParameterObject;\n#end\nimport org.springframework.http.HttpHeaders;\nimport io.swagger.v3.oas.annotations.tags.Tag;\nimport io.swagger.v3.oas.annotations.Operation;\nimport lombok.RequiredArgsConstructor;\nimport org.springframework.validation.BindingResult;\nimport org.springframework.web.bind.annotation.*;\n\nimport java.util.List;\nimport java.util.Objects;\n\n/**\n * ${tableComment}\n *\n * @author ${author}\n * @date ${datetime}\n */\n#foreach($field in $childFieldList)\n#if($field.primaryPk == \'1\')\n#set($childPkField = $field)\n#break\n#end\n#end\n#set($childFieldGetter = $str.getProperty($childField))\n@RestController\n@RequiredArgsConstructor\n@RequestMapping("/${functionName}" )\n@Tag(description = "${functionName}" , name = "${tableComment}管理" )\n@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)\npublic class ${ClassName}Controller {\n\n private final ${ClassName}Service ${className}Service;\n\n /**\n * 分页查询\n * @param page 分页对象\n * @param ${className} ${tableComment}\n * @return\n */\n @Operation(summary = "分页查询" , description = "分页查询" )\n @GetMapping("/page" )\n #if($isSpringBoot3)\n @HasPermission("$str.lowerCase($moduleName)_$str.lowerCase($functionName)_view")\n #else\n @PreAuthorize("@pms.hasPermission(\'$str.lowerCase($moduleName)_$str.lowerCase($functionName)_view\')" )\n #end\n public R get${ClassName}Page(@ParameterObject Page page, @ParameterObject ${ClassName}Entity ${className}#orgKeywordParams()) {\n return R.ok(${className}Service.page(page, buildQueryWrapper(${className}#orgKeywordArgs())));\n }\n\n /**\n * 列表与导出共用的查询条件,保证导出结果与列表一致\n */\n private LambdaQueryWrapper<${ClassName}Entity> buildQueryWrapper(${ClassName}Entity ${className}#orgKeywordDecl()) {\n LambLine truncated
|
||||
INSERT INTO `gen_template` (`id`, `template_name`, `generator_path`, `template_desc`, `template_code`, `create_time`, `update_time`, `del_flag`, `tenant_id`, `create_by`, `update_by`) VALUES (34,'左树右表ServiceV202611','${backendPath}/src/main/java/${packagePath}/${moduleName}/service/${ClassName}Service.java','左树右表ServiceV202611','package ${package}.${moduleName}.service;\n\nimport cn.hutool.core.lang.tree.Tree;\nimport com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;\nimport com.baomidou.mybatisplus.spring.service.IService;\nimport ${entityPackage}.${ChildClassName}Entity;\nimport ${entityClassName};\n\nimport java.util.List;\n\n/**\n * ${tableComment} Service接口\n *\n * @author ${author}\n * @date ${datetime}\n */\n#foreach($field in $childFieldList)\n#if($field.primaryPk == \'1\')\n#set($childPkField = $field)\n#break\n#end\n#end\npublic interface ${ClassName}Service extends IService<${ClassName}Entity> {\n\n /**\n * 构建树形结构数据\n * @param wrapper 查询条件\n * @return 树形结构数据\n */\n List<Tree<${childPkField.attrType}>> buildTree(LambdaQueryWrapper<${ChildClassName}Entity> wrapper);\n\n /**\n * 获取树节点详情\n * @param ${childClassName} 树节点查询对象\n * @return 树节点详情列表\n */\n List<${ChildClassName}Entity> getTreeDetails(${ChildClassName}Entity ${childClassName});\n\n /**\n * 保存树节点\n * @param ${childClassName} 树节点对象\n * @return 保存结果\n */\n Boolean saveTree(${ChildClassName}Entity ${childClassName});\n\n /**\n * 更新树节点\n * @param ${childClassName} 树节点对象\n * @return 更新结果\n */\n Boolean updateTree(${ChildClassName}Entity ${childClassName});\n\n /**\n * 批量删除树节点\n * @param ids 树节点ID列表\n * @return 删除结果\n */\n Boolean removeTreeByIds(${childPkField.attrType}[] ids);\n}\n','2026-04-08 17:38:24','2026-04-08 17:38:24','0',1,'admin','admin');
|
||||
INSERT INTO `gen_template` (`id`, `template_name`, `generator_path`, `template_desc`, `template_code`, `create_time`, `update_time`, `del_flag`, `tenant_id`, `create_by`, `update_by`) VALUES (35,'左树右表ServiceImplV202611','${backendPath}/src/main/java/${packagePath}/${moduleName}/service/impl/${ClassName}ServiceImpl.java','左树右表ServiceImplV202611','package ${package}.${moduleName}.service.impl;\n\nimport cn.hutool.core.collection.CollUtil;\nimport cn.hutool.core.util.ArrayUtil;\nimport cn.hutool.core.lang.tree.Tree;\nimport cn.hutool.core.lang.tree.TreeNode;\nimport cn.hutool.core.lang.tree.TreeUtil;\nimport com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;\nimport com.baomidou.mybatisplus.core.toolkit.Wrappers;\nimport com.baomidou.mybatisplus.spring.service.impl.ServiceImpl;\nimport ${entityPackage}.${ChildClassName}Entity;\nimport ${entityClassName};\nimport ${package}.${moduleName}.mapper.${ChildClassName}Mapper;\nimport ${package}.${moduleName}.mapper.${ClassName}Mapper;\nimport ${package}.${moduleName}.service.${ClassName}Service;\nimport lombok.RequiredArgsConstructor;\nimport org.springframework.stereotype.Service;\nimport org.springframework.transaction.annotation.Transactional;\n\nimport java.util.ArrayList;\nimport java.util.HashMap;\nimport java.util.HashSet;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.Objects;\nimport java.util.Set;\nimport java.util.function.Function;\n\n/**\n * ${tableComment} Service实现类\n *\n * @author ${author}\n * @date ${datetime}\n */\n#foreach($field in $childFieldList)\n#if($field.primaryPk == \'1\')\n#set($childPkField = $field)\n#set($childPkGetter = $str.getProperty($childPkField.attrName))\n#break\n#end\n#end\n#set($parentGetter = $str.getProperty($parentField))\n#set($childFieldGetter = $str.getProperty($childField))\n#if($childPkField.attrType == \'Long\')\n#set($treeRootId = \'0L\')\n#elseif($childPkField.attrType == \'String\')\n#set($treeRootId = \'\"0\"\')\n#else\n#set($treeRootId = \'0\')\n#end\n@Service\n@RequiredArgsConstructor\npublic class ${ClassName}ServiceImpl extends ServiceImpl<${ClassName}Mapper, ${ClassName}Entity> implements ${ClassName}Service {\n\n private final ${ChildClassName}Mapper ${childClassName}Mapper;\n\n /**\n * 构建树形结构数据\n * @param wrapper 查询条件\n * @return 树形结构数据\n */\n @Override\n public List<Tree<${childPkField.attrType}>> buildTree(LambdaQueryWrapper<${ChildClassName}Entity> wrapper) {\n List<${ChildClassName}Entity> allList = ${childClassName}Mapper.selectList(wrapper);\n\n if (CollUtil.isEmpty(allList)) {\n return new ArrayList<>();\n }\n\n List<TreeNode<${childPkField.attrType}>> collect = allList.stream().map(getNodeFunction()).toList();\n return TreeUtil.build(collect, ${treeRootId});\n }\n\n /**\n * 获取树节点详情\n * @param ${childClassName} 树节点查询对象\n * @return 树节点详情列表\n */\n @Override\n public List<${ChildClassName}Entity> getTreeDetails(${ChildClassName}Entity ${childClassName}) {\n return ${childClassName}Mapper.selectList(Wrappers.query(${childClassName}));\n }\n\n /**\n * 保存树节点\n * @param ${childClassName} 树节点对象\n * @return 保存结果\n */\n @Override\n @Transactional(rollbackFor = Exception.class)\n public Boolean saveTree(${ChildClassName}Entity ${childClassName}) {\n ${childClassName}.$str.setProperty($parentField)(validateParentRelation(null, ${childClassName}.$str.getProperty($parentField)()));\n return ${childClassName}Mapper.insert(${childClassName}) > 0;\n }\n\n /**\n * 更新树节点\n * @param ${childClassName} 树节点对象\n * @return 更新结果\n */\n @Override\n @Transactional(rollbackFor = Exception.class)\n public Boolean updateTree(${ChildClassName}Entity ${childClassName}) {\n ${childClassName}.$str.setProperty($parentField)(validateParentRelation(${childClassName}.$str.getProperty($childPkField.attrName)(), ${childClassName}.$str.getProperty($parentField)()));\n return ${childClassName}Mapper.updateById(${childClassName}) > 0;\n }\n\n /**\n * 批量删除树节点\n * @param ids 树节点ID列表\n * @return 删除结果\n */\n @Override\n @Transactional(rollbackFor = Exception.class)\n public Boolean removeTreeByIds(${childPkField.attrType}[] ids) {\n if (ArrayUtil.isEmpty(ids)) {\n return Boolean.TRUE;\n }\n\n for (${childPkField.attrType} id : ids) {\n if (hasChildNodes(id)) {\n throw new RuntimeException(\"当前节点存在子节点,不能删除\");\n }\n if (hasMainRecords(id)) {\n throw new RuntimeException(\"当前节点已关联主表数据,不能删除\");\n }\n }\n\n return ${childClassNameLine truncated
|
||||
INSERT INTO `gen_template` (`id`, `template_name`, `generator_path`, `template_desc`, `template_code`, `create_time`, `update_time`, `del_flag`, `tenant_id`, `create_by`, `update_by`) VALUES (36,'实体V202611','${entityPath}/src/main/java/${entityPackagePath}/${ClassName}Entity.java','实体V202611','#set($hasOrg = false)\n#foreach($field in $fieldList)\n#if($field.formType.startsWith(\'org-\'))\n#set($hasOrg = true)\n#end\n#end\npackage ${entityPackage};\n\nimport com.baomidou.mybatisplus.annotation.*;\nimport com.baomidou.mybatisplus.spring.activerecord.Model;\nimport io.swagger.v3.oas.annotations.media.Schema;\nimport lombok.Data;\nimport lombok.EqualsAndHashCode;\n#if($hasOrg)\nimport com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;\nimport ${package}.common.core.util.OrgRef;\nimport org.apache.fesod.sheet.annotation.ExcelIgnore;\nimport java.util.List;\n#end\n#if($isTenant)\nimport ${package}.common.core.util.TenantTable;\n#end\n#foreach($import in $importList)\n#if(!$import.startsWith(\'java.lang.\'))\nimport $import;\n#end\n#end\n\n/**\n * ${tableComment}\n *\n * @author ${author}\n * @date ${datetime}\n */\n@Data\n#if($isTenant)\n@TenantTable\n#end\n@TableName(value = \"${tableName}\"#if($hasOrg), autoResultMap = true#end)\n@EqualsAndHashCode(callSuper = true)\n@Schema(description = \"${tableComment}\")\npublic class ${ClassName}Entity extends Model<${ClassName}Entity> {\n\n#foreach ($field in $fieldList)\n#if(${field.fieldComment})#set($comment=${field.fieldComment})#else #set($comment=${field.attrName})#end\n\n /**\n * $comment\n */\n#if($field.primaryPk == \'1\')\n @TableId(type = IdType.ASSIGN_ID)\n#end\n#if($field.formType.startsWith(\'org-\'))\n @TableField(typeHandler = JacksonTypeHandler.class#if($field.autoFill == \'INSERT\' || $field.autoFill == \'INSERT_UPDATE\' || $field.autoFill == \'UPDATE\'), fill = FieldFill.${field.autoFill}#end)\n @ExcelIgnore\n#elseif($field.autoFill == \'INSERT\')\n @TableField(fill = FieldFill.INSERT)\n#elseif($field.autoFill == \'INSERT_UPDATE\')\n @TableField(fill = FieldFill.INSERT_UPDATE)\n#elseif($field.autoFill == \'UPDATE\')\n @TableField(fill = FieldFill.UPDATE)\n#end\n#if($field.fieldName == \'del_flag\')\n @TableLogic\n @TableField(fill = FieldFill.INSERT)\n#end\n @Schema(description=\"$comment\"#if($field.hidden),hidden=$field.hidden#end)\n#if($field.formType.startsWith(\'org-\'))\n private List<OrgRef> $field.attrName;\n#elseif($field.formType == \'checkbox\')\n private ${field.attrType}[] $field.attrName;\n#elseif($field.formType == \'daterange\' || $field.formType == \'datetimerange\')\n private String[] $field.attrName;\n#else\n private $field.attrType $field.attrName;\n#end\n#end\n#foreach ($field in $queryList)\n#if($field.queryFormType == \'daterange\' || $field.queryFormType == \'datetimerange\')\n#if(${field.fieldComment})#set($comment=${field.fieldComment})#else #set($comment=${field.attrName})#end\n\n /**\n * $comment 查询范围\n */\n @TableField(exist = false)\n @Schema(description=\"$comment 查询范围\",hidden=true)\n private String[] ${field.attrName}Range;\n#end\n#end\n}\n','2026-04-08 17:38:24','2026-04-08 17:38:24','0',1,'admin','admin');
|
||||
INSERT INTO `gen_template` (`id`, `template_name`, `generator_path`, `template_desc`, `template_code`, `create_time`, `update_time`, `del_flag`, `tenant_id`, `create_by`, `update_by`) VALUES (37,'MapperV202611','${backendPath}/src/main/java/${packagePath}/${moduleName}/mapper/${ClassName}Mapper.java','MapperV202611','package ${package}.${moduleName}.mapper;\n\n\nimport com.baomidou.mybatisplus.core.mapper.BaseMapper;\nimport ${entityClassName};\nimport org.apache.ibatis.annotations.Mapper;\n\n@Mapper\npublic interface ${ClassName}Mapper extends BaseMapper<${ClassName}Entity> {\n\n}\n','2026-04-08 17:38:24','2026-04-08 17:38:24','0',1,'admin','admin');
|
||||
INSERT INTO `gen_template` (`id`, `template_name`, `generator_path`, `template_desc`, `template_code`, `create_time`, `update_time`, `del_flag`, `tenant_id`, `create_by`, `update_by`) VALUES (38,'Mapper.xmlV202611','${backendPath}/src/main/resources/mapper/${ClassName}Mapper.xml','Mapper.xmlV202611','<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE mapper PUBLIC \"-//mybatis.org//DTD Mapper 3.0//EN\" \"http://mybatis.org/dtd/mybatis-3-mapper.dtd\">\n\n<mapper namespace=\"${package}.${moduleName}.mapper.${ClassName}Mapper\">\n\n <resultMap id=\"${className}Map\" type=\"${entityClassName}\">\n#foreach ($field in $fieldList)\n #if($field.primaryPk == \'1\')\n <id property=\"$field.attrName\" column=\"$field.fieldName\"/>\n #else\n <result property=\"$field.attrName\" column=\"$field.fieldName\"#if($field.formType.startsWith(\'org-\')) typeHandler=\"com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler\"#end/>\n #end\n#end\n </resultMap>\n</mapper>\n','2026-04-08 17:38:24','2026-04-08 17:38:24','0',1,'admin','admin');
|
||||
INSERT INTO `gen_template` (`id`, `template_name`, `generator_path`, `template_desc`, `template_code`, `create_time`, `update_time`, `del_flag`, `tenant_id`, `create_by`, `update_by`) VALUES (39,'子实体V202611','${entityPath}/src/main/java/${entityPackagePath}/${ChildClassName}Entity.java','子实体V202611','#set($hasOrg = false)\n#foreach($field in $childFieldList)\n#if($field.formType.startsWith(\'org-\'))\n#set($hasOrg = true)\n#end\n#end\npackage ${entityPackage};\n\nimport com.baomidou.mybatisplus.annotation.*;\nimport com.baomidou.mybatisplus.spring.activerecord.Model;\nimport io.swagger.v3.oas.annotations.media.Schema;\n#if($isChildTenant)\nimport ${package}.common.core.util.TenantTable;\n#end\nimport lombok.Data;\nimport lombok.EqualsAndHashCode;\n#if($hasOrg)\nimport com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;\nimport ${package}.common.core.util.OrgRef;\nimport java.util.List;\n#end\n#set($childImports = [])\n#foreach($field in $childFieldList)\n#if($field.packageName && !$field.packageName.startsWith(\'java.lang.\') && !$childImports.contains($field.packageName))\n#set($void = $childImports.add($field.packageName))\n#end\n#end\n#foreach($import in $childImports)\nimport $import;\n#end\n\n/**\n * ${tableComment}\n *\n * @author ${author}\n * @date ${datetime}\n */\n@Data\n#if($isChildTenant)\n@TenantTable\n#end\n@TableName(value = \"${childTableName}\"#if($hasOrg), autoResultMap = true#end)\n@EqualsAndHashCode(callSuper = true)\n@Schema(description = \"${childTableName}\")\npublic class ${ChildClassName}Entity extends Model<${ChildClassName}Entity> {\n\n#foreach ($field in $childFieldList)\n#if(${field.fieldComment})#set($comment=${field.fieldComment})#else #set($comment=${field.attrName})#end\n /**\n * $comment\n */\n#if($field.primaryPk == \'1\')\n @TableId(type = IdType.ASSIGN_ID)\n#end\n#if($field.formType.startsWith(\'org-\'))\n @TableField(typeHandler = JacksonTypeHandler.class#if($field.autoFill == \'INSERT\' || $field.autoFill == \'INSERT_UPDATE\' || $field.autoFill == \'UPDATE\'), fill = FieldFill.${field.autoFill}#end)\n#elseif($field.autoFill == \'INSERT\')\n @TableField(fill = FieldFill.INSERT)\n#elseif($field.autoFill == \'INSERT_UPDATE\')\n @TableField(fill = FieldFill.INSERT_UPDATE)\n#elseif($field.autoFill == \'UPDATE\')\n @TableField(fill = FieldFill.UPDATE)\n#end\n#if($field.fieldName == \'del_flag\')\n @TableLogic\n @TableField(fill = FieldFill.INSERT)\n#end\n @Schema(description=\"$comment\"#if($field.hidden),hidden=$field.hidden#end)\n#if($field.formType.startsWith(\'org-\'))\n private List<OrgRef> $field.attrName;\n#elseif($field.formType == \'checkbox\')\n private ${field.attrType}[] $field.attrName;\n#else\n private $field.attrType $field.attrName;\n#end \n#end\n}\n','2026-04-08 17:38:24','2026-04-08 17:38:24','0',1,'admin','admin');
|
||||
INSERT INTO `gen_template` (`id`, `template_name`, `generator_path`, `template_desc`, `template_code`, `create_time`, `update_time`, `del_flag`, `tenant_id`, `create_by`, `update_by`) VALUES (40,'子MapperV202611','${backendPath}/src/main/java/${packagePath}/${moduleName}/mapper/${ChildClassName}Mapper.java','子MapperV202611','package ${package}.${moduleName}.mapper;\n\nimport ${package}.common.data.datascope.PigxBaseMapper;\nimport ${entityPackage}.${ChildClassName}Entity;\nimport org.apache.ibatis.annotations.Mapper;\n\n@Mapper\npublic interface ${ChildClassName}Mapper extends PigxBaseMapper<${ChildClassName}Entity> {\n\n}\n','2026-04-08 17:38:24','2026-04-08 17:38:24','0',1,'admin','admin');
|
||||
INSERT INTO `gen_template` (`id`, `template_name`, `generator_path`, `template_desc`, `template_code`, `create_time`, `update_time`, `del_flag`, `tenant_id`, `create_by`, `update_by`) VALUES (41,'权限菜单V202611','${backendPath}/menu/${functionName}_menu.sql','权限菜单V202611','#set($permissionPrefix = \"${moduleName}_${functionName}\")\n#set($permissionPrefix = $permissionPrefix.toLowerCase())\n-- 该脚本不要直接执行, 注意维护菜单的父节点ID 默认 父节点-1 , #if(!$opensource)默认租户 1#end\n#set($menuId=${dateTool.getSystemTime()})\n\n-- 菜单SQL\ninsert into sys_menu ( menu_id,parent_id, path, permission, menu_type, icon, del_flag, create_time, sort_order, update_time, name#if(!$opensource), tenant_id#end)\nvalues (${menuId}, \'-1\', \'/${moduleName}/${functionName}/index\', \'\', \'0\', \'icon-bangzhushouji\', \'0\', null , \'8\', null , \'${tableComment}管理\'#if(!$opensource), 1#end);\n\n-- 菜单对应按钮SQL\ninsert into sys_menu ( menu_id,parent_id, permission, menu_type, path, icon, del_flag, create_time, sort_order, update_time, name#if(!$opensource), tenant_id#end)\nvalues (${math.add($menuId,1)},${menuId}, \'${permissionPrefix}_view\', \'1\', null, \'1\', \'0\', null, \'0\', null, \'${tableComment}查看\'#if(!$opensource), 1#end);\n\ninsert into sys_menu ( menu_id,parent_id, permission, menu_type, path, icon, del_flag, create_time, sort_order, update_time, name#if(!$opensource), tenant_id#end)\nvalues (${math.add($menuId,2)},${menuId}, \'${permissionPrefix}_add\', \'1\', null, \'1\', \'0\', null, \'1\', null, \'${tableComment}新增\'#if(!$opensource), 1#end);\n\ninsert into sys_menu (menu_id, parent_id, permission, menu_type, path, icon, del_flag, create_time, sort_order, update_time, name#if(!$opensource), tenant_id#end)\nvalues (${math.add($menuId,3)},${menuId}, \'${permissionPrefix}_edit\', \'1\', null, \'1\', \'0\', null, \'2\', null, \'${tableComment}修改\'#if(!$opensource), 1#end);\n\ninsert into sys_menu (menu_id, parent_id, permission, menu_type, path, icon, del_flag, create_time, sort_order, update_time, name#if(!$opensource), tenant_id#end)\nvalues (${math.add($menuId,4)},${menuId}, \'${permissionPrefix}_del\', \'1\', null, \'1\', \'0\', null, \'3\', null, \'${tableComment}删除\'#if(!$opensource), 1#end);\n\ninsert into sys_menu ( menu_id,parent_id, permission, menu_type, path, icon, del_flag, create_time, sort_order, update_time, name#if(!$opensource), tenant_id#end)\nvalues (${math.add($menuId,5)},${menuId}, \'${permissionPrefix}_export\', \'1\', null, \'1\', \'0\', null, \'3\', null, \'导入导出\'#if(!$opensource), 1#end);\n','2026-04-08 17:38:24','2026-04-08 17:38:24','0',1,'admin','admin');
|
||||
INSERT INTO `gen_template` (`id`, `template_name`, `generator_path`, `template_desc`, `template_code`, `create_time`, `update_time`, `del_flag`, `tenant_id`, `create_by`, `update_by`) VALUES (42,'左树右表api.tsV202611','${frontendPath}/src/api/${moduleName}/${functionName}.ts','左树右表api.tsV202611','import request from \"/@/utils/request\"\n\n// ========== 基础CRUD接口 ==========\n\n/**\n * 分页查询列表数据\n * @param query - 查询参数对象\n * @returns Promise<分页数据>\n */\nexport function fetchList(query?: Object) {\n return request({\n url: \'/${moduleName}/${functionName}/page\',\n method: \'get\',\n params: query\n })\n}\n\n/**\n * 新增数据\n * @param obj - 要新增的数据对象\n * @returns Promise<boolean> - 操作结果\n */\nexport function addObj(obj?: Object) {\n return request({\n url: \'/${moduleName}/${functionName}\',\n method: \'post\',\n data: obj\n })\n}\n\n/**\n * 获取详情数据\n * @param obj - 查询参数对象(包含ID等)\n * @returns Promise<数据详情>\n */\nexport function getObj(obj?: Object) {\n return request({\n url: \'/${moduleName}/${functionName}/details\',\n method: \'get\',\n params: obj\n })\n}\n\n/**\n * 批量删除数据\n * @param ids - 要删除的ID数组\n * @returns Promise<操作结果>\n */\nexport function delObjs(ids?: Object) {\n return request({\n url: \'/${moduleName}/${functionName}\',\n method: \'delete\',\n data: ids\n })\n}\n\n/**\n * 更新数据\n * @param obj - 要更新的数据对象\n * @returns Promise<操作结果>\n */\nexport function putObj(obj?: Object) {\n return request({\n url: \'/${moduleName}/${functionName}\',\n method: \'put\',\n data: obj\n })\n}\n\n// ========== 树形CRUD接口 ==========\n\n/**\n * 获取树形列表数据\n * @param query - 查询参数对象\n * @returns Promise<树形数据>\n */\nexport function fetchTreeList(query?: Object) {\n return request({\n url: \'/${moduleName}/${functionName}/tree\',\n method: \'get\',\n params: query\n })\n}\n\n/**\n * 获取树节点详情\n * @param obj - 查询参数对象(包含ID等)\n * @returns Promise<树节点详情>\n */\nexport function getTreeObj(obj?: Object) {\n return request({\n url: \'/${moduleName}/${functionName}/tree/details\',\n method: \'get\',\n params: obj\n })\n}\n\n/**\n * 新增树节点\n * @param obj - 要新增的树节点对象\n * @returns Promise<操作结果>\n */\nexport function addTreeObj(obj?: Object) {\n return request({\n url: \'/${moduleName}/${functionName}/tree\',\n method: \'post\',\n data: obj\n })\n}\n\n/**\n * 更新树节点\n * @param obj - 要更新的树节点对象\n * @returns Promise<操作结果>\n */\nexport function putTreeObj(obj?: Object) {\n return request({\n url: \'/${moduleName}/${functionName}/tree\',\n method: \'put\',\n data: obj\n })\n}\n\n/**\n * 删除树节点\n * @param ids - 要删除的树节点ID数组\n * @returns Promise<操作结果>\n */\nexport function delTreeObjs(ids?: Object) {\n return request({\n url: \'/${moduleName}/${functionName}/tree\',\n method: \'delete\',\n data: ids\n })\n}\n\n// ========== 工具函数 ==========\n\n/**\n * 验证字段值唯一性\n * @param rule - 验证规则对象\n * @param value - 要验证的值\n * @param callback - 验证回调函数\n * @param isEdit - 是否为编辑模式\n *\n * @example\n * // 在表单验证规则中使用\n * fieldName: [\n * {\n * validator: (rule, value, callback) => {\n * validateExist(rule, value, callback, form.${pk.attrName} !== \'\');\n * },\n * trigger: \'blur\',\n * },\n * ]\n */\nexport function validateExist(rule: any, value: any, callback: any, isEdit: boolean) {\n // 编辑模式下跳过验证\n if (isEdit) {\n return callback();\n }\n\n // 查询是否存在相同值\n getObj({ [rule.field]: value }).then((response) => {\n const result = response.data;\n if (result !== null && result.length > 0) {\n callback(new Error(\'数据已经存在\'));\n } else {\n callback();\n }\n });\n}\n','2026-04-08 17:38:24','2026-04-08 17:38:24','0',1,'admin','admin');
|
||||
INSERT INTO `gen_template` (`id`, `template_name`, `generator_path`, `template_desc`, `template_code`, `create_time`, `update_time`, `del_flag`, `tenant_id`, `create_by`, `update_by`) VALUES (43,'左树右表表格V202611','${frontendPath}/src/views/${moduleName}/${functionName}/index.vue','左树右表表格V202611','## 有字典字段时才导入 useDict\n#set($hasDictField = false)\n#foreach($field in $queryList)\n#if($field.fieldDict)\n#set($hasDictField = true)\n#end\n#end\n#foreach($field in $gridList)\n#if($field.fieldDict)\n#set($hasDictField = true)\n#end\n#end\n#foreach($field in $childFieldList)\n#if($field.primaryPk == \'1\')\n#set($childPkField = $field)\n#break\n#end\n#end\n## 开关:按属性类型决定开/关的值,Boolean 用 true/false,整型用 1/0,其余用 \'1\'/\'0\'\n#macro(switchValues $f)\n#if($f.attrType == \'Boolean\')\n#set($switchOn = \'true\')\n#set($switchOff = \'false\')\n#elseif($f.attrType == \'Integer\' || $f.attrType == \'Long\' || $f.attrType == \'Short\')\n#set($switchOn = \'1\')\n#set($switchOff = \'0\')\n#else\n#set($switchOn = "\'1\'")\n#set($switchOff = "\'0\'")\n#end\n#end\n<template>\n <div class="layout-padding">\n <splitpanes>\n <pane size="15">\n <div class="layout-padding-auto layout-padding-view">\n <el-scrollbar>\n <div class="mb8" style="display: flex; align-items: center; justify-content: space-between;">\n <span style="font-weight: 500;">左侧节点</span>\n <div>\n <el-tooltip :content="currentTreeId ? \'新增子节点\' : \'新增根节点\'" placement="top">\n <el-button link type="primary" icon="FolderAdd" @click="handleAddTree" />\n </el-tooltip>\n </div>\n </div>\n <el-tree\n ref="treeRef"\n :data="treeData"\n :props="treeProps"\n node-key="${childPkField.attrName}"\n highlight-current\n default-expand-all\n :expand-on-click-node="false"\n @node-click="handleTreeNodeClick"\n >\n <template #default="{ node, data }">\n <span style="flex: 1; display: flex; align-items: center; justify-content: space-between;">\n <span>{{ node.label }}</span>\n <span v-if="currentTreeId === data.${childPkField.attrName}" style="margin-left: 8px;">\n <el-tooltip content="编辑" placement="top">\n <el-button link type="primary" icon="Edit" size="small" @click.stop="handleEditTree" />\n </el-tooltip>\n <el-tooltip content="删除" placement="top">\n <el-button link type="danger" icon="Delete" size="small" @click.stop="handleDeleteTree" />\n </el-tooltip>\n </span>\n </span>\n </template>\n </el-tree>\n </el-scrollbar>\n </div>\n </pane>\n <pane class="ml8">\n <div class="layout-padding-auto layout-padding-view">\n#if($queryList)\n <el-row v-show="showSearch">\n <el-form :model="state.queryForm" ref="queryRef" :inline="true" @keyup.enter="getDataList">\n#foreach($field in $queryList)\n#if($field.formType.startsWith(\'org-\'))#set($queryKey = "${field.attrName}Keyword")#else#set($queryKey = $field.attrName)#end\n#if($field.attrName != ${childField})\n#if($field.queryFormType == \'select\')\n <el-form-item label="#if(${field.fieldComment})${field.fieldComment}#else${field.attrName}#end" prop="${queryKey}">\n <el-select v-model="state.queryForm.${queryKey}" placeholder="请选择#if(${field.fieldComment})${field.fieldComment}#else${field.attrName}#end">\n#if($field.fieldDict)\n <el-option \n :label="item.label" \n :value="item.value" \n v-for="(item, index) in ${field.fieldDict}" \n :key="index"\n />\n#else\n <el-option label="请选择" value="0" />\n#end\n </el-select>\n </el-form-item>\n#elseif($field.queryFormType == \'date\')\n <el-form-item label="#if(${field.fieldComment})${field.fieldComment}#else${field.attrName}#end" prop="${queryKey}">\n <el-date-picker\n type="date"\n placeholder="请输入#if(${field.fieldComment})${field.fieldComment}#else${field.attrName}#end"\n v-model="state.queryForm.${queryKey}"\n :value-format="dateStr"\n />\n </el-form-item>\n#elseif($field.queryFormType == \'daterange\')\n <el-form-item label="#if(${field.fieldComment})${field.fieldComment}#else${field.attrName}#end" prop="${field.attrName}Range">\n <el-date-pickerLine truncated
|
||||
INSERT INTO `gen_template` (`id`, `template_name`, `generator_path`, `template_desc`, `template_code`, `create_time`, `update_time`, `del_flag`, `tenant_id`, `create_by`, `update_by`) VALUES (44,'左树右表树表单V202611','${frontendPath}/src/views/${moduleName}/${functionName}/tree-form.vue','左树右表树表单V202611','#foreach($field in $childFieldList)\n#if($field.primaryPk == \'1\')\n#set($childPkField = $field)\n#break\n#end\n#end\n#set($fieldDict=[])\n#foreach($field in $childFieldList)\n#if($field.fieldDict)\n#set($void=$fieldDict.add($field.fieldDict))\n#end\n#end\n## 开关:按属性类型决定开/关的值,Boolean 用 true/false,整型用 1/0,其余用 \'1\'/\'0\'\n#macro(switchValues $f)\n#if($f.attrType == \'Boolean\')\n#set($switchOn = \'true\')\n#set($switchOff = \'false\')\n#elseif($f.attrType == \'Integer\' || $f.attrType == \'Long\' || $f.attrType == \'Short\')\n#set($switchOn = \'1\')\n#set($switchOff = \'0\')\n#else\n#set($switchOn = "\'1\'")\n#set($switchOff = "\'0\'")\n#end\n#end\n#set($hasOrg = false)\n#foreach($field in $childFieldList)\n#if($field.formType.startsWith(\'org-\'))\n#set($hasOrg = true)\n#end\n#end\n<template>\n <el-dialog :title="form.${childPkField.attrName} ? \'编辑\' : \'新增\'" v-model="visible"\n :close-on-click-modal="false" draggable>\n <el-form ref="dataFormRef" :model="form" :rules="dataRules" label-width="90px" v-loading="loading">\n <el-row :gutter="24">\n#if($formLayout == 1)\n <el-col :span="24" class="mb20">\n#elseif($formLayout == 2)\n <el-col :span="12" class="mb20">\n#end\n <el-form-item label="父级节点" prop="${parentField}">\n <el-tree-select\n v-model="form.${parentField}"\n :data="parentNodes"\n :props="treeSelectProps"\n check-strictly\n :render-after-expand="false"\n placeholder="请选择父级节点"\n style="width: 100%"\n clearable\n filterable\n />\n </el-form-item>\n </el-col>\n#foreach($field in $childFieldList)\n#if($field.attrName != ${childPkField.attrName} && $field.attrName != ${parentField})\n#if($formLayout == 1)\n <el-col :span="24" class="mb20">\n#elseif($formLayout == 2)\n <el-col :span="12" class="mb20">\n#end\n#if($field.formType.startsWith(\'org-\'))\n#set($orgType = $field.formType.replace(\'org-\', \'\').replace(\'-multiple\', \'\'))\n <el-form-item label="${field.fieldComment}" prop="${field.attrName}">\n <OrgSelect v-model="form.${field.attrName}" value-type="item" type="${orgType}" :multiple="#if($field.formType.endsWith(\'-multiple\'))true#else false#end" label="${field.fieldComment}" :disabled="loading" />\n </el-form-item>\n </el-col>\n#elseif($field.formType == \'switch\')\n#switchValues($field)\n <el-form-item label="#if(${field.fieldComment})${field.fieldComment}#else${field.attrName}#end" prop="${field.attrName}">\n <el-switch :model-value="String(form.${field.attrName}) === String($switchOn)" @change="(checked) => (form.${field.attrName} = checked ? $switchOn : $switchOff)" />\n </el-form-item>\n </el-col>\n#elseif($field.formType == \'text\')\n <el-form-item label="#if(${field.fieldComment})${field.fieldComment}#else${field.attrName}#end" prop="${field.attrName}">\n <el-input v-model="form.${field.attrName}" placeholder="请输入#if(${field.fieldComment})${field.fieldComment}#else${field.attrName}#end"/>\n </el-form-item>\n </el-col>\n#elseif($field.formType == \'textarea\')\n <el-form-item label="#if(${field.fieldComment})${field.fieldComment}#else${field.attrName}#end" prop="${field.attrName}">\n <el-input type="textarea" v-model="form.${field.attrName}" placeholder="请输入#if(${field.fieldComment})${field.fieldComment}#else${field.attrName}#end"/>\n </el-form-item>\n </el-col>\n#elseif($field.formType == \'select\')\n <el-form-item label="#if(${field.fieldComment})${field.fieldComment}#else${field.attrName}#end" prop="${field.attrName}">\n <el-select v-model="form.${field.attrName}" placeholder="请选择#if(${field.fieldComment})${field.fieldComment}#else${field.attrName}#end">\n#if($field.fieldDict)\n <el-option :value="item.value" :label="item.label" v-for="(item, index) in ${field.fieldDict}" :key="index"></el-option>\n#else\n <el-option label="请选择" value="0"></el-option>\n#end\n </el-select>\n </el-form-item>\n </el-col>\n#elseif($field.formType == \'radio\')\n <el-form-item label="#if(${field.fieldComment})${field.fieldComment}#else${field.attrName}#end" prop="${field.attrName}">\n <el-radio-group v-model="form.${field.attrName}">\n#if($field.fieldDict)\n <el-radio :label="item.value" v-for="(item, index) in ${field.fieldDicLine truncated
|
||||
INSERT INTO `gen_template` (`id`, `template_name`, `generator_path`, `template_desc`, `template_code`, `create_time`, `update_time`, `del_flag`, `tenant_id`, `create_by`, `update_by`) VALUES (45,'左树右表主表单V202611','${frontendPath}/src/views/${moduleName}/${functionName}/form.vue','左树右表主表单V202611','#set($hasDuplicate = false)\n#foreach($field in $formList)\n#if($field.attrName != ${childField} && $field.formValidator == \'duplicate\')\n#set($hasDuplicate = true)\n#end\n#end\n#foreach($field in $childFieldList)\n#if($field.primaryPk == \'1\')\n#set($childPkField = $field)\n#break\n#end\n#end\n#set($relationFieldLabel = $childField)\n#foreach($field in $fieldList)\n#if($field.attrName == $childField)\n#if($field.fieldComment)\n#set($relationFieldLabel = $field.fieldComment)\n#else\n#set($relationFieldLabel = $field.attrName)\n#end\n#break\n#end\n#end\n#set($fieldDict=[])\n#foreach($field in $formList)\n#if($field.fieldDict)\n#set($void=$fieldDict.add($field.fieldDict))\n#end\n#end\n## 开关:按属性类型决定开/关的值,Boolean 用 true/false,整型用 1/0,其余用 \'1\'/\'0\'\n#macro(switchValues $f)\n#if($f.attrType == \'Boolean\')\n#set($switchOn = \'true\')\n#set($switchOff = \'false\')\n#elseif($f.attrType == \'Integer\' || $f.attrType == \'Long\' || $f.attrType == \'Short\')\n#set($switchOn = \'1\')\n#set($switchOff = \'0\')\n#else\n#set($switchOn = "\'1\'")\n#set($switchOff = "\'0\'")\n#end\n#end\n#set($hasOrg = false)\n#foreach($field in $formList)\n#if($field.formType.startsWith(\'org-\'))\n#set($hasOrg = true)\n#end\n#end\n<template>\n <el-dialog :title="form.${pk.attrName} ? \'编辑\' : \'新增\'" v-model="visible"\n :close-on-click-modal="false" draggable>\n <el-form ref="dataFormRef" :model="form" :rules="dataRules" label-width="90px" v-loading="loading">\n <el-row :gutter="24">\n#if($formLayout == 1)\n <el-col :span="24" class="mb20">\n#elseif($formLayout == 2)\n <el-col :span="12" class="mb20">\n#end\n <el-form-item label="${relationFieldLabel}" prop="${childField}">\n <el-tree-select\n v-model="form.${childField}"\n :data="treeNodes"\n :props="treeSelectProps"\n check-strictly\n :render-after-expand="false"\n placeholder="请选择${relationFieldLabel}"\n style="width: 100%"\n clearable\n filterable\n />\n </el-form-item>\n </el-col>\n#foreach($field in $formList)\n#if($field.attrName != ${pk.attrName} && $field.attrName != ${childField})\n#if($formLayout == 1)\n <el-col :span="24" class="mb20">\n#elseif($formLayout == 2)\n <el-col :span="12" class="mb20">\n#end\n#if($field.formType.startsWith(\'org-\'))\n#set($orgType = $field.formType.replace(\'org-\', \'\').replace(\'-multiple\', \'\'))\n <el-form-item label="${field.fieldComment}" prop="${field.attrName}">\n <OrgSelect v-model="form.${field.attrName}" value-type="item" type="${orgType}" :multiple="#if($field.formType.endsWith(\'-multiple\'))true#else false#end" label="${field.fieldComment}" :disabled="loading" />\n </el-form-item>\n </el-col>\n#elseif($field.formType == \'switch\')\n#switchValues($field)\n <el-form-item label="#if(${field.fieldComment})${field.fieldComment}#else${field.attrName}#end" prop="${field.attrName}">\n <el-switch :model-value="String(form.${field.attrName}) === String($switchOn)" @change="(checked) => (form.${field.attrName} = checked ? $switchOn : $switchOff)" />\n </el-form-item>\n </el-col>\n#elseif($field.formType == \'text\')\n <el-form-item label="#if(${field.fieldComment})${field.fieldComment}#else${field.attrName}#end" prop="${field.attrName}">\n <el-input v-model="form.${field.attrName}" placeholder="请输入#if(${field.fieldComment})${field.fieldComment}#else${field.attrName}#end"/>\n </el-form-item>\n </el-col>\n#elseif($field.formType == \'textarea\')\n <el-form-item label="#if(${field.fieldComment})${field.fieldComment}#else${field.attrName}#end" prop="${field.attrName}">\n <el-input type="textarea" v-model="form.${field.attrName}" placeholder="请输入#if(${field.fieldComment})${field.fieldComment}#else${field.attrName}#end"/>\n </el-form-item>\n </el-col>\n#elseif($field.formType == \'select\')\n <el-form-item label="#if(${field.fieldComment})${field.fieldComment}#else${field.attrName}#end" prop="${field.attrName}">\n <el-select v-model="form.${field.attrName}" placeholder="请选择#if(${field.fieldComment})${field.fieldComment}#else${field.attrName}#end">\n#if($field.fieldDict)\n <el-option :value="item.value" :label="item.label" v-for="(item, index) in ${field.fieldDict}" :key="index"></el-option>\n#else\n <el-option label="请选择" value="0"></el-option>\n#end\n Line truncated
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for gen_template_group
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `gen_template_group`;
|
||||
CREATE TABLE `gen_template_group` (
|
||||
`group_id` bigint NOT NULL COMMENT '分组id',
|
||||
`template_id` bigint NOT NULL COMMENT '模板id',
|
||||
PRIMARY KEY (`group_id`,`template_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='模板分组关联表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of gen_template_group
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `gen_template_group` (`group_id`, `template_id`) VALUES (1,1);
|
||||
INSERT INTO `gen_template_group` (`group_id`, `template_id`) VALUES (1,2);
|
||||
INSERT INTO `gen_template_group` (`group_id`, `template_id`) VALUES (1,3);
|
||||
INSERT INTO `gen_template_group` (`group_id`, `template_id`) VALUES (1,4);
|
||||
INSERT INTO `gen_template_group` (`group_id`, `template_id`) VALUES (1,5);
|
||||
INSERT INTO `gen_template_group` (`group_id`, `template_id`) VALUES (1,6);
|
||||
INSERT INTO `gen_template_group` (`group_id`, `template_id`) VALUES (1,7);
|
||||
INSERT INTO `gen_template_group` (`group_id`, `template_id`) VALUES (1,8);
|
||||
INSERT INTO `gen_template_group` (`group_id`, `template_id`) VALUES (1,9);
|
||||
INSERT INTO `gen_template_group` (`group_id`, `template_id`) VALUES (1,10);
|
||||
INSERT INTO `gen_template_group` (`group_id`, `template_id`) VALUES (2,11);
|
||||
INSERT INTO `gen_template_group` (`group_id`, `template_id`) VALUES (2,12);
|
||||
INSERT INTO `gen_template_group` (`group_id`, `template_id`) VALUES (2,13);
|
||||
INSERT INTO `gen_template_group` (`group_id`, `template_id`) VALUES (2,14);
|
||||
INSERT INTO `gen_template_group` (`group_id`, `template_id`) VALUES (2,15);
|
||||
INSERT INTO `gen_template_group` (`group_id`, `template_id`) VALUES (2,16);
|
||||
INSERT INTO `gen_template_group` (`group_id`, `template_id`) VALUES (2,17);
|
||||
INSERT INTO `gen_template_group` (`group_id`, `template_id`) VALUES (2,18);
|
||||
INSERT INTO `gen_template_group` (`group_id`, `template_id`) VALUES (2,19);
|
||||
INSERT INTO `gen_template_group` (`group_id`, `template_id`) VALUES (2,20);
|
||||
INSERT INTO `gen_template_group` (`group_id`, `template_id`) VALUES (2,21);
|
||||
INSERT INTO `gen_template_group` (`group_id`, `template_id`) VALUES (2,22);
|
||||
INSERT INTO `gen_template_group` (`group_id`, `template_id`) VALUES (3,23);
|
||||
INSERT INTO `gen_template_group` (`group_id`, `template_id`) VALUES (3,24);
|
||||
INSERT INTO `gen_template_group` (`group_id`, `template_id`) VALUES (3,25);
|
||||
INSERT INTO `gen_template_group` (`group_id`, `template_id`) VALUES (3,26);
|
||||
INSERT INTO `gen_template_group` (`group_id`, `template_id`) VALUES (3,27);
|
||||
INSERT INTO `gen_template_group` (`group_id`, `template_id`) VALUES (3,28);
|
||||
INSERT INTO `gen_template_group` (`group_id`, `template_id`) VALUES (3,29);
|
||||
INSERT INTO `gen_template_group` (`group_id`, `template_id`) VALUES (3,30);
|
||||
INSERT INTO `gen_template_group` (`group_id`, `template_id`) VALUES (3,31);
|
||||
INSERT INTO `gen_template_group` (`group_id`, `template_id`) VALUES (3,32);
|
||||
INSERT INTO `gen_template_group` (`group_id`, `template_id`) VALUES (4,33);
|
||||
INSERT INTO `gen_template_group` (`group_id`, `template_id`) VALUES (4,34);
|
||||
INSERT INTO `gen_template_group` (`group_id`, `template_id`) VALUES (4,35);
|
||||
INSERT INTO `gen_template_group` (`group_id`, `template_id`) VALUES (4,36);
|
||||
INSERT INTO `gen_template_group` (`group_id`, `template_id`) VALUES (4,37);
|
||||
INSERT INTO `gen_template_group` (`group_id`, `template_id`) VALUES (4,38);
|
||||
INSERT INTO `gen_template_group` (`group_id`, `template_id`) VALUES (4,39);
|
||||
INSERT INTO `gen_template_group` (`group_id`, `template_id`) VALUES (4,40);
|
||||
INSERT INTO `gen_template_group` (`group_id`, `template_id`) VALUES (4,41);
|
||||
INSERT INTO `gen_template_group` (`group_id`, `template_id`) VALUES (4,42);
|
||||
INSERT INTO `gen_template_group` (`group_id`, `template_id`) VALUES (4,43);
|
||||
INSERT INTO `gen_template_group` (`group_id`, `template_id`) VALUES (4,44);
|
||||
INSERT INTO `gen_template_group` (`group_id`, `template_id`) VALUES (4,45);
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for gen_create_table
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `gen_create_table`;
|
||||
CREATE TABLE `gen_create_table` (
|
||||
`id` bigint NOT NULL COMMENT '主键ID',
|
||||
`table_name` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '表名称',
|
||||
`ds_name` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '数据源',
|
||||
`comments` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '表注释',
|
||||
`create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '创建人',
|
||||
`update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
|
||||
`create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`update_time` datetime DEFAULT NULL,
|
||||
`column_info` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '字段信息',
|
||||
`del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '删除标记',
|
||||
`tenant_id` bigint DEFAULT NULL COMMENT '租户ID',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=DYNAMIC COMMENT='自动创建表管理';
|
||||
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
@@ -0,0 +1,185 @@
|
||||
USE pigxx_app;
|
||||
SET NAMES utf8mb4;
|
||||
SET FOREIGN_KEY_CHECKS = 0;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for app_article
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `app_article`;
|
||||
CREATE TABLE `app_article` (
|
||||
`id` bigint NOT NULL COMMENT '主键',
|
||||
`cid` bigint NOT NULL COMMENT '分类',
|
||||
`title` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '标题',
|
||||
`intro` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '简介',
|
||||
`summary` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '摘要',
|
||||
`image` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '封面',
|
||||
`content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT '内容',
|
||||
`author` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '作者',
|
||||
`visit` int unsigned NOT NULL DEFAULT '0' COMMENT '浏览',
|
||||
`sort` int unsigned NOT NULL DEFAULT '50' COMMENT '排序',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
|
||||
`create_by` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '创建人',
|
||||
`update_by` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '更新人',
|
||||
`del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '删除时间',
|
||||
`tenant_id` bigint(20) DEFAULT NULL,
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
KEY `cid_idx` (`cid`) USING BTREE COMMENT '分类索引'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='文章资讯表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of app_article
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for app_article_category
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `app_article_category`;
|
||||
CREATE TABLE `app_article_category` (
|
||||
`id` bigint unsigned NOT NULL COMMENT '主键',
|
||||
`name` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '名称',
|
||||
`sort` smallint unsigned NOT NULL DEFAULT '50' COMMENT '排序',
|
||||
`is_show` tinyint unsigned NOT NULL DEFAULT '1' COMMENT '是否显示: 0=否, 1=是',
|
||||
`del_flag` char(1) COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '是否删除: 0=否, 1=是',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
|
||||
`create_by` varchar(32) COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '创建人',
|
||||
`update_by` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '更新人',
|
||||
`tenant_id` bigint(20) DEFAULT NULL,
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='文章分类表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of app_article_category
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for app_article_collect
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `app_article_collect`;
|
||||
CREATE TABLE `app_article_collect` (
|
||||
`id` bigint unsigned NOT NULL COMMENT '主键',
|
||||
`user_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT '用户ID',
|
||||
`article_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT '文章ID',
|
||||
`create_time` datetime COMMENT '创建时间',
|
||||
`update_time` datetime COMMENT '更新时间',
|
||||
`del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '0' COMMENT '是否删除',
|
||||
`create_by` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '创建人',
|
||||
`update_by` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '更新人',
|
||||
`tenant_id` bigint(20) DEFAULT NULL,
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='文章收藏表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of app_article_collect
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for app_contacts
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `app_contacts`;
|
||||
CREATE TABLE `app_contacts` (
|
||||
`id` bigint NOT NULL COMMENT '主键',
|
||||
`contact_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '联系人',
|
||||
`contact_phone` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '手机号',
|
||||
`remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '备注',
|
||||
`create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '创建人',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
`update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '修改人',
|
||||
`update_time` datetime DEFAULT NULL COMMENT '修改时间',
|
||||
`del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '删除标记',
|
||||
`tenant_id` bigint DEFAULT NULL COMMENT '租户ID',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='通讯录表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of app_contacts
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for app_page
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `app_page`;
|
||||
CREATE TABLE `app_page` (
|
||||
`id` bigint unsigned NOT NULL COMMENT '主键',
|
||||
`page_type` tinyint unsigned NOT NULL DEFAULT '10' COMMENT '页面类型',
|
||||
`page_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '页面名称',
|
||||
`page_data` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT '页面数据',
|
||||
`create_by` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '创建人',
|
||||
`update_by` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '修改人',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
`update_time` datetime DEFAULT NULL COMMENT '修改时间',
|
||||
`del_flag` char(1) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '删除标记',
|
||||
`tenant_id` bigint(20) DEFAULT NULL,
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='页面装修表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of app_page
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `app_page` VALUES (1, 1, '首页装修', '[{\"name\":\"search\",\"title\":\"搜索\",\"styles\":{},\"content\":{},\"disabled\":1},{\"name\":\"banner\",\"title\":\"首页轮播图\",\"styles\":{},\"content\":{\"data\":[{\"link\":{\"name\":\"个人中心\",\"path\":\"/pages/user/index\",\"type\":\"shop\"},\"name\":\"商品大抽拼\",\"image\":\"https://minio.pigx.vip/oss/202605/home.jpg\"}],\"enabled\":1}},{\"name\":\"nav\",\"title\":\"导航菜单\",\"styles\":{},\"content\":{\"data\":[{\"icon\":\"star\",\"link\":{\"name\":\"我的收藏\",\"path\":\"/pages/user/collection/index\",\"type\":\"shop\"},\"name\":\"我的收藏\",\"image\":\"https://minio.pigx.top/oss/app/nav02.png\"},{\"icon\":\"calendar-line\",\"name\":\"日历\",\"link\":{\"path\":\"/pages/workbench/calendar/index\",\"name\":\"日程\",\"type\":\"shop\"}},{\"icon\":\"message\",\"name\":\"消息中心\",\"link\":{\"path\":\"/pages/user/messages/index\",\"name\":\"消息中心\",\"type\":\"shop\"}},{\"icon\":\"user-group\",\"name\":\"通讯录\",\"link\":{\"path\":\"/pages/workbench/contacts/index\",\"name\":\"通讯录\",\"type\":\"shop\"}}],\"enabled\":1}}]', NULL, 'admin', NULL, '2026-05-13 23:37:53', '0', 1);
|
||||
INSERT INTO `app_page` VALUES (2, 2, '个人中心', '[{\"name\":\"user-info\",\"title\":\"用户信息\",\"styles\":{},\"content\":{},\"disabled\":1},{\"name\":\"my-service\",\"title\":\"我的服务\",\"styles\":{},\"content\":{\"data\":[{\"icon\":\"settings\",\"link\":{\"name\":\"个人设置\",\"path\":\"/pages/user/settings/index\",\"type\":\"shop\"},\"name\":\"个人设置\",\"image\":\"https://minio.pigx.top/oss/app/user_setting.png\"},{\"icon\":\"star\",\"link\":{\"name\":\"我的收藏\",\"path\":\"/pages/user/collection/index\",\"type\":\"shop\"},\"name\":\"我的收藏\",\"image\":\"https://minio.pigx.top/oss/app/user_collect.png\"},{\"icon\":\"headset\",\"link\":{\"name\":\"联系客服\",\"path\":\"/pages/user/customer-service/index\",\"type\":\"shop\"},\"name\":\"联系客服\",\"image\":\"https://minio.pigx.top/oss/app/user_kefu.png\"},{\"icon\":\"info-circle\",\"name\":\"关于我们\",\"link\":{\"path\":\"/pages/user/about/index\",\"name\":\"关于我们\",\"type\":\"shop\"}}],\"style\":2,\"title\":\"服务中心\"}},{\"name\":\"user-banner\",\"title\":\"个人中心广告图\",\"styles\":{},\"content\":{\"data\":[{\"link\":{\"name\":\"个人中心\",\"path\":\"/pages/user/index\",\"type\":\"shop\"},\"name\":\"sdds\",\"image\":\"https://minio.pigx.vip/oss/202605/ad.jpg\"}],\"enabled\":1}}]', NULL, 'admin', NULL, '2026-05-13 23:37:53', '0', 1);
|
||||
INSERT INTO `app_page` VALUES (3, 3, '客服设置', '[{\"title\":\"客服设置\",\"name\":\"customer-service\",\"content\":{\"title\":\"添加客服二维码\",\"time\":\"早上 9:00 - 22:00\",\"mobile\":\"13800138000\",\"qrcode\":\"/admin/sys-file/oss/file?fileName=86f81144ab2a4984bbf63fe851d49faf.png\"},\"styles\":{}}]', NULL, 'admin', NULL, '2026-05-13 23:37:53', '0', 1);
|
||||
INSERT INTO `app_page` VALUES (4, 4, '工作台', '[{\"id\":\"mp47dnlr51ltq\",\"title\":\"常用功能\",\"name\":\"workbench-shortcuts\",\"content\":{\"enabled\":1,\"data\":[{\"icon\":\"send\",\"name\":\"我的\",\"link\":{\"path\":\"/pages/workbench/flow/tasks/index?type=started\",\"name\":\"我的\",\"type\":\"flow-tasks\"},\"color\":\"#2563eb\"},{\"icon\":\"clock-circle\",\"name\":\"待办\",\"link\":{\"path\":\"/pages/workbench/flow/tasks/index?type=pending\",\"name\":\"待办\",\"type\":\"flow-tasks\"},\"color\":\"#d97706\"},{\"icon\":\"email\",\"name\":\"抄送\",\"link\":{\"path\":\"/pages/workbench/flow/tasks/index?type=cc\",\"name\":\"抄送\",\"type\":\"flow-tasks\"},\"color\":\"#4f46e5\"},{\"icon\":\"check-circle\",\"name\":\"已办\",\"link\":{\"path\":\"/pages/workbench/flow/tasks/index?type=completed\",\"name\":\"已办\",\"type\":\"flow-tasks\"},\"color\":\"#15803d\"}]},\"styles\":{}}]', NULL, 'admin', NULL, '2026-05-13 23:44:57', '0', 1);
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for app_tabbar
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `app_tabbar`;
|
||||
CREATE TABLE `app_tabbar` (
|
||||
`id` bigint unsigned NOT NULL COMMENT '主键',
|
||||
`name` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '导航名称',
|
||||
`selected` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '选中图标',
|
||||
`unselected` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '未选中图标',
|
||||
`link` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '链接地址',
|
||||
`sort_order` int(11) NOT NULL DEFAULT '0' COMMENT '排序',
|
||||
`login_flag` char(1) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '1' COMMENT '是否需要登录(0-不需要,1-需要)',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
|
||||
`create_by` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '创建人',
|
||||
`update_by` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '更新人',
|
||||
`del_flag` char(1) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '删除标记',
|
||||
`tenant_id` bigint(20) DEFAULT NULL,
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='底部装修表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of app_tabbar
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `app_tabbar` VALUES (1, '首页', 'home-fill', 'home', '{\"path\":\"/pages/index/index\",\"name\":\"首页\",\"type\":\"shop\"}', 0, '0', NULL, '2026-05-13 23:37:53', NULL, 'admin', '0', 1);
|
||||
INSERT INTO `app_tabbar` VALUES (2, '工作台', 'apps', 'apps', '{\"path\":\"/pages/workbench/index\",\"name\":\"工作台\",\"type\":\"shop\"}', 1, '1', NULL, '2026-05-13 23:42:00', NULL, 'admin', '0', 1);
|
||||
INSERT INTO `app_tabbar` VALUES (3, '我的', 'user', 'user', '{\"path\":\"/pages/user/index\",\"name\":\"个人中心\",\"type\":\"shop\"}', 2, '0', NULL, '2026-05-13 23:37:53', NULL, 'admin', '0', 1);
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for app_role_tabbar
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `app_role_tabbar`;
|
||||
CREATE TABLE `app_role_tabbar` (
|
||||
`role_id` bigint(20) NOT NULL COMMENT '系统角色ID',
|
||||
`tabbar_id` bigint(20) NOT NULL COMMENT '底部导航ID',
|
||||
`tenant_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '所属租户',
|
||||
PRIMARY KEY (`role_id`,`tabbar_id`,`tenant_id`) USING BTREE,
|
||||
KEY `app_role_tabbar_role_index` (`role_id`,`tenant_id`) USING BTREE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='App角色底部导航表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of app_role_tabbar
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `app_role_tabbar` VALUES (1, 2, 1);
|
||||
INSERT INTO `app_role_tabbar` VALUES (1, 3, 1);
|
||||
COMMIT;
|
||||
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
+4266
File diff suppressed because it is too large.
Load diff
+22
-8
@@ -1,17 +1,31 @@
|
||||
FROM mysql:5.7
|
||||
FROM registry.cn-hangzhou.aliyuncs.com/dockerhub_mirror/mysql-server:8.0.32
|
||||
|
||||
MAINTAINER lengleng(wangiegie@gmail.com)
|
||||
|
||||
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
|
||||
ENV TZ=Asia/Shanghai
|
||||
ENV LANG C.UTF-8
|
||||
|
||||
COPY ./db/1schema.sql /docker-entrypoint-initdb.d
|
||||
RUN ln -sf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
||||
|
||||
COPY ./db/2pigxx.sql /docker-entrypoint-initdb.d
|
||||
COPY ./1schema.sql /docker-entrypoint-initdb.d
|
||||
|
||||
COPY ./db/3pigxx_ac.sql /docker-entrypoint-initdb.d
|
||||
COPY ./2pigxx.sql /docker-entrypoint-initdb.d
|
||||
|
||||
COPY ./db/4pigxx_job.sql /docker-entrypoint-initdb.d
|
||||
COPY ./3pigxx_flow.sql /docker-entrypoint-initdb.d
|
||||
|
||||
COPY ./db/5pigxx_mp.sql /docker-entrypoint-initdb.d
|
||||
COPY ./4pigxx_job.sql /docker-entrypoint-initdb.d
|
||||
|
||||
COPY ./db/6pigxx_config.sql /docker-entrypoint-initdb.d
|
||||
COPY ./5pigxx_mp.sql /docker-entrypoint-initdb.d
|
||||
|
||||
COPY ./6pigxx_config.sql /docker-entrypoint-initdb.d
|
||||
|
||||
COPY ./7pigxx_pay.sql /docker-entrypoint-initdb.d
|
||||
|
||||
COPY ./8pigxx_codegen.sql /docker-entrypoint-initdb.d
|
||||
|
||||
COPY ./99pigxx_bi.sql /docker-entrypoint-initdb.d
|
||||
|
||||
COPY ./999pigxx_app.sql /docker-entrypoint-initdb.d
|
||||
|
||||
# 微服务版本可以注释掉下面这行
|
||||
COPY ./0pigxx_boot.sql /docker-entrypoint-initdb.d
|
||||
@@ -0,0 +1,41 @@
|
||||
# 使用说明 V6.0 - 单体架构版本
|
||||
# 1. 先构建单体 JAR: mvn clean install -Pboot -DskipTests
|
||||
# 2. 启动服务: docker compose -f docker-compose-boot.yml up -d
|
||||
# 3. 静静等待服务启动
|
||||
services:
|
||||
pigx-mysql:
|
||||
build:
|
||||
context: ./db
|
||||
environment:
|
||||
MYSQL_ROOT_HOST: "%"
|
||||
MYSQL_ROOT_PASSWORD: root
|
||||
restart: always
|
||||
container_name: pigx-mysql
|
||||
image: pigx-mysql
|
||||
command: --lower_case_table_names=1
|
||||
networks:
|
||||
- spring_cloud_default
|
||||
|
||||
pigx-redis:
|
||||
container_name: pigx-redis
|
||||
image: registry.cn-hangzhou.aliyuncs.com/dockerhub_mirror/redis
|
||||
restart: always
|
||||
networks:
|
||||
- spring_cloud_default
|
||||
|
||||
# 单体的时候注意,服务名称命名为 pigx-gateway 对应前端nginx 配置
|
||||
pigx-gateway:
|
||||
build:
|
||||
context: ./pigx-boot
|
||||
restart: always
|
||||
container_name: pigx-boot
|
||||
image: pigx-boot
|
||||
ports:
|
||||
- 9999:9999
|
||||
networks:
|
||||
- spring_cloud_default
|
||||
|
||||
networks:
|
||||
spring_cloud_default:
|
||||
name: spring_cloud_default
|
||||
driver: bridge
|
||||
+99
-63
@@ -1,142 +1,178 @@
|
||||
# 使用说明 V3.0.0
|
||||
# 使用说明 V6.0 - 微服务架构版本
|
||||
# 1. 使用docker-compose 宿主机不需要配置host来发现
|
||||
# 2. 无需修改源码,根目录 docker-compose up 即可
|
||||
# 3. 静静等待服务启动
|
||||
|
||||
version: '2'
|
||||
services:
|
||||
pigx-mysql:
|
||||
build:
|
||||
context: ./
|
||||
dockerfile: ./db/Dockerfile
|
||||
context: ./db
|
||||
environment:
|
||||
MYSQL_ROOT_HOST: "%"
|
||||
MYSQL_ROOT_PASSWORD: root
|
||||
restart: always
|
||||
container_name: pigx-mysql
|
||||
image: pigx-mysql
|
||||
ports:
|
||||
- 3306:3306
|
||||
volumes:
|
||||
- ./pigx-mysql:/var/lib/mysql
|
||||
command: --lower_case_table_names=1
|
||||
|
||||
pigx-zookeeper:
|
||||
image: zookeeper:3.4.13
|
||||
restart: always
|
||||
networks:
|
||||
- spring_cloud_default
|
||||
|
||||
pigx-redis:
|
||||
image: redis:5.0.4
|
||||
restart: always
|
||||
container_name: pigx-redis
|
||||
ports:
|
||||
- 6379:6379
|
||||
|
||||
pigx-minio:
|
||||
image: minio/minio
|
||||
command: server /data
|
||||
ports:
|
||||
- 9000:9000
|
||||
volumes:
|
||||
- ./data:/data
|
||||
- ./config:/root/.minio
|
||||
environment:
|
||||
- MINIO_DOMAIN=pigx-minio
|
||||
- MINIO_ACCESS_KEY=lengleng
|
||||
- MINIO_SECRET_KEY=lengleng
|
||||
image: registry.cn-hangzhou.aliyuncs.com/dockerhub_mirror/redis
|
||||
restart: always
|
||||
networks:
|
||||
- spring_cloud_default
|
||||
|
||||
pigx-register:
|
||||
build:
|
||||
context: ./
|
||||
dockerfile: ./pigx-register/Dockerfile
|
||||
context: ./pigx-register
|
||||
restart: always
|
||||
container_name: pigx-register
|
||||
image: pigx-register
|
||||
ports:
|
||||
- 8848:8848
|
||||
- 9848:9848
|
||||
- 18080:18080
|
||||
networks:
|
||||
- spring_cloud_default
|
||||
|
||||
pigx-gateway:
|
||||
build:
|
||||
context: ./
|
||||
dockerfile: ./pigx-gateway/Dockerfile
|
||||
context: ./pigx-gateway
|
||||
restart: always
|
||||
container_name: pigx-gateway
|
||||
image: pigx-gateway
|
||||
ports:
|
||||
- 9999:9999
|
||||
networks:
|
||||
- spring_cloud_default
|
||||
|
||||
pigx-auth:
|
||||
build:
|
||||
context: ./
|
||||
dockerfile: ./pigx-auth/Dockerfile
|
||||
context: ./pigx-auth
|
||||
restart: always
|
||||
container_name: pigx-auth
|
||||
image: pigx-auth
|
||||
networks:
|
||||
- spring_cloud_default
|
||||
|
||||
pigx-upms:
|
||||
build:
|
||||
context: ./
|
||||
dockerfile: ./pigx-upms/pigx-upms-biz/Dockerfile
|
||||
context: ./pigx-upms/pigx-upms-biz
|
||||
restart: always
|
||||
container_name: pigx-upms
|
||||
image: pigx-upms
|
||||
networks:
|
||||
- spring_cloud_default
|
||||
|
||||
pigx-flow-biz:
|
||||
build:
|
||||
context: ./pigx-flow/pigx-flow-biz
|
||||
restart: always
|
||||
container_name: pigx-flow-biz
|
||||
image: pigx-flow-biz
|
||||
networks:
|
||||
- spring_cloud_default
|
||||
|
||||
pigx-app-server:
|
||||
build:
|
||||
context: ./pigx-app-server/pigx-app-server-biz
|
||||
restart: always
|
||||
container_name: pigx-app-server
|
||||
image: pigx-app-server
|
||||
networks:
|
||||
- spring_cloud_default
|
||||
|
||||
pigx-monitor:
|
||||
build:
|
||||
context: ./
|
||||
dockerfile: ./pigx-visual/pigx-monitor/Dockerfile
|
||||
context: ./pigx-visual/pigx-monitor
|
||||
restart: always
|
||||
image: pigx-monitor
|
||||
container_name: pigx-monitor
|
||||
ports:
|
||||
- 5001:5001
|
||||
networks:
|
||||
- spring_cloud_default
|
||||
|
||||
pigx-daemon-quartz:
|
||||
build:
|
||||
context: ./
|
||||
dockerfile: ./pigx-visual/pigx-daemon-quartz/Dockerfile
|
||||
context: ./pigx-visual/pigx-daemon-quartz
|
||||
restart: always
|
||||
image: pigx-daemon-quartz
|
||||
container_name: pigx-daemon-quartz
|
||||
networks:
|
||||
- spring_cloud_default
|
||||
|
||||
pigx-daemon-elastic-job:
|
||||
build:
|
||||
context: ./
|
||||
dockerfile: ./pigx-visual/pigx-daemon-elastic-job/Dockerfile
|
||||
context: ./pigx-visual/pigx-daemon-elastic-job
|
||||
restart: always
|
||||
image: pigx-daemon-elastic-job
|
||||
container_name: pigx-daemon-elastic-job
|
||||
networks:
|
||||
- spring_cloud_default
|
||||
|
||||
pigx-xxl-job-admin:
|
||||
build:
|
||||
context: ./pigx-visual/pigx-xxl-job-admin
|
||||
restart: always
|
||||
image: pigx-xxl-job-admin
|
||||
container_name: pigx-xxl-job-admin
|
||||
ports:
|
||||
- 9080:9080
|
||||
networks:
|
||||
- spring_cloud_default
|
||||
|
||||
pigx-codegen:
|
||||
build:
|
||||
context: ./
|
||||
dockerfile: ./pigx-visual/pigx-codegen/Dockerfile
|
||||
context: ./pigx-visual/pigx-codegen
|
||||
restart: always
|
||||
image: pigx-codegen
|
||||
container_name: pigx-codegen
|
||||
networks:
|
||||
- spring_cloud_default
|
||||
|
||||
pigx-mp-manager:
|
||||
pigx-mp-platform:
|
||||
build:
|
||||
context: ./
|
||||
dockerfile: ./pigx-visual/pigx-mp-manager/Dockerfile
|
||||
context: ./pigx-visual/pigx-mp-platform
|
||||
restart: always
|
||||
image: pigx-mp-manager
|
||||
container_name: pigx-mp-manager
|
||||
image: pigx-mp-platform
|
||||
container_name: pigx-mp-platform
|
||||
networks:
|
||||
- spring_cloud_default
|
||||
|
||||
pigx-activiti:
|
||||
pigx-pay-platform:
|
||||
build:
|
||||
context: ./
|
||||
dockerfile: ./pigx-visual/pigx-activiti/Dockerfile
|
||||
context: ./pigx-visual/pigx-pay-platform
|
||||
restart: always
|
||||
image: pigx-activiti
|
||||
container_name: pigx-activiti
|
||||
image: pigx-pay-platform
|
||||
container_name: pigx-pay-platform
|
||||
networks:
|
||||
- spring_cloud_default
|
||||
|
||||
pigx-tx-manager:
|
||||
pigx-report-platform:
|
||||
build:
|
||||
context: ./
|
||||
dockerfile: ./pigx-visual/pigx-tx-manager/Dockerfile
|
||||
context: ./pigx-visual/pigx-report-platform
|
||||
restart: always
|
||||
image: pigx-tx-manager
|
||||
container_name: pigx-tx-manager
|
||||
image: pigx-report-platform
|
||||
container_name: pigx-report-platform
|
||||
ports:
|
||||
- 5004:5004
|
||||
- 9998:9998
|
||||
- 9095:9095
|
||||
networks:
|
||||
- spring_cloud_default
|
||||
|
||||
pigx-jimu-platform:
|
||||
build:
|
||||
context: ./pigx-visual/pigx-jimu-platform
|
||||
restart: always
|
||||
image: pigx-jimu-platform
|
||||
container_name: pigx-jimu-platform
|
||||
ports:
|
||||
- 5008:5008
|
||||
networks:
|
||||
- spring_cloud_default
|
||||
|
||||
networks:
|
||||
spring_cloud_default:
|
||||
name: spring_cloud_default
|
||||
driver: bridge
|
||||
@@ -0,0 +1,5 @@
|
||||
# 此文件不得删除,构造器注入的时候自动复制字段上边的注解
|
||||
lombok.copyableAnnotations += org.springframework.beans.factory.annotation.Value
|
||||
lombok.copyableAnnotations += org.springframework.beans.factory.annotation.Qualifier
|
||||
lombok.copyableAnnotations += org.springframework.context.annotation.Lazy
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
<?xml version="1.0"?>
|
||||
<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>
|
||||
<parent>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-app-server</artifactId>
|
||||
<version>6.2.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>pigx-app-server-api</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<!--core 工具类-->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-core</artifactId>
|
||||
</dependency>
|
||||
<!--mybatis plus extension,包含了mybatis plus core-->
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-spring</artifactId>
|
||||
</dependency>
|
||||
<!--feign 工具类-->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-feign</artifactId>
|
||||
</dependency>
|
||||
<!-- excel 导入导出 -->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-excel</artifactId>
|
||||
</dependency>
|
||||
<!-- 脱敏工具类-->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-sensitive</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
package com.pig4cloud.pigx.app.api.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* App 角色底部导航配置请求体。
|
||||
* <p>
|
||||
* 后台保存某个系统角色可见的 App Tabbar 列表。公开 Tabbar 由 {@code app_tabbar.login_flag=0}
|
||||
* 控制,不依赖这里的角色授权。
|
||||
*
|
||||
* @author lengleng
|
||||
* @date 2026-05-09
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "App角色底部导航配置")
|
||||
public class AppRoleTabbarDTO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@NotNull(message = "角色ID不能为空")
|
||||
@Schema(description = "系统角色ID")
|
||||
private Long roleId;
|
||||
|
||||
/**
|
||||
* 该角色可见的登录态 Tabbar ID 列表。
|
||||
* <p>
|
||||
* 保存时采用覆盖语义,空列表表示清空该角色的 Tabbar 授权。
|
||||
*/
|
||||
@Schema(description = "底部导航ID列表")
|
||||
private List<Long> tabbarIds = new ArrayList<>();
|
||||
|
||||
}
|
||||
+86
@@ -0,0 +1,86 @@
|
||||
package com.pig4cloud.pigx.app.api.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.spring.activerecord.Model;
|
||||
import com.pig4cloud.pigx.common.core.util.TenantTable;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 文章分类表
|
||||
*
|
||||
* @author pig
|
||||
* @date 2023-06-07 16:28:03
|
||||
*/
|
||||
@Data
|
||||
@TenantTable
|
||||
@TableName("app_article_category")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "文章分类表")
|
||||
public class AppArticleCategoryEntity extends Model<AppArticleCategoryEntity> {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description = "主键")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@Schema(description = "名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
@Schema(description = "排序")
|
||||
private Integer sort;
|
||||
|
||||
/**
|
||||
* 是否显示: 0=否, 1=是
|
||||
*/
|
||||
@Schema(description = "是否显示: 0=否, 1=是")
|
||||
private Integer isShow;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description = "更新人")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description = "更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 是否删除: 0=否, 1=是
|
||||
*/
|
||||
@TableLogic
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "是否删除: 0=否, 1=是")
|
||||
private String delFlag;
|
||||
|
||||
}
|
||||
+98
@@ -0,0 +1,98 @@
|
||||
package com.pig4cloud.pigx.app.api.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.spring.activerecord.Model;
|
||||
import com.pig4cloud.pigx.common.core.util.TenantTable;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 文章收藏表
|
||||
*
|
||||
* @author pig
|
||||
* @date 2023-06-16 14:33:41
|
||||
*/
|
||||
@Data
|
||||
@TenantTable
|
||||
@TableName("app_article_collect")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "文章收藏表")
|
||||
public class AppArticleCollectEntity extends Model<AppArticleCollectEntity> {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description = "主键")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
@Schema(description = "用户ID")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 文章ID
|
||||
*/
|
||||
@Schema(description = "文章ID")
|
||||
private Long articleId;
|
||||
|
||||
/**
|
||||
* 文章标题
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description = "更新人")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description = "更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
@TableLogic
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "是否删除")
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 图片
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String image;
|
||||
|
||||
/**
|
||||
* 访问次数
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private Long visit;
|
||||
|
||||
}
|
||||
+136
@@ -0,0 +1,136 @@
|
||||
package com.pig4cloud.pigx.app.api.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.spring.activerecord.Model;
|
||||
import com.pig4cloud.pigx.common.core.util.TenantTable;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.FieldNameConstants;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 文章资讯
|
||||
*
|
||||
* @author pig
|
||||
* @date 2023-06-07 16:32:35
|
||||
*/
|
||||
@Data
|
||||
@TenantTable
|
||||
@FieldNameConstants
|
||||
@TableName("app_article")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "文章资讯")
|
||||
public class AppArticleEntity extends Model<AppArticleEntity> {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description = "主键")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 分类
|
||||
*/
|
||||
@Schema(description = "分类")
|
||||
private Long cid;
|
||||
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
@Schema(description = "标题")
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* 简介
|
||||
*/
|
||||
@Schema(description = "简介")
|
||||
private String intro;
|
||||
|
||||
/**
|
||||
* 摘要
|
||||
*/
|
||||
@Schema(description = "摘要")
|
||||
private String summary;
|
||||
|
||||
/**
|
||||
* 封面
|
||||
*/
|
||||
@Schema(description = "封面")
|
||||
private String image;
|
||||
|
||||
/**
|
||||
* 内容
|
||||
*/
|
||||
@Schema(description = "内容")
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* 作者
|
||||
*/
|
||||
@Schema(description = "作者")
|
||||
private String author;
|
||||
|
||||
/**
|
||||
* 浏览
|
||||
*/
|
||||
@Schema(description = "浏览")
|
||||
private Integer visit;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
@Schema(description = "排序")
|
||||
private Integer sort;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description = "更新人")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description = "更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 删除时间
|
||||
*/
|
||||
@TableLogic
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "删除标志")
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 当前用户是否已收藏
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private boolean collect;
|
||||
|
||||
/**
|
||||
* 分类名称
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String cname;
|
||||
|
||||
}
|
||||
+92
@@ -0,0 +1,92 @@
|
||||
package com.pig4cloud.pigx.app.api.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.spring.activerecord.Model;
|
||||
import com.pig4cloud.pigx.common.core.util.TenantTable;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 通讯录表
|
||||
*
|
||||
* @author pigx
|
||||
* @date 2025-05-29 17:30:30
|
||||
*/
|
||||
@Data
|
||||
@TenantTable
|
||||
@TableName("app_contacts")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "通讯录表")
|
||||
public class AppContactsEntity extends Model<AppContactsEntity> {
|
||||
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description = "主键")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 联系人
|
||||
*/
|
||||
@Schema(description = "联系人")
|
||||
private String contactName;
|
||||
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
@Schema(description = "手机号")
|
||||
private String contactPhone;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description = "修改人")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description = "修改时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 删除标记
|
||||
*/
|
||||
@TableLogic
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "删除标记")
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
@Schema(description = "租户ID")
|
||||
private Long tenantId;
|
||||
}
|
||||
+94
@@ -0,0 +1,94 @@
|
||||
package com.pig4cloud.pigx.app.api.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.spring.activerecord.Model;
|
||||
import com.pig4cloud.pigx.common.core.util.TenantTable;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.FieldNameConstants;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* App 装修页面实体。
|
||||
* <p>
|
||||
* 仅对应 {@code app_page} 表,保存页面类型、页面名称和页面组件 JSON。
|
||||
* 底部 Tabbar 已拆分到 {@code app_tabbar},不要再塞进 {@link #pageData}。
|
||||
*
|
||||
* @author lengleng
|
||||
* @date 2023-06-08 11:19:23
|
||||
*/
|
||||
@Data
|
||||
@TenantTable
|
||||
@TableName("app_page")
|
||||
@FieldNameConstants
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "页面")
|
||||
public class AppPageEntity extends Model<AppPageEntity> {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description = "主键")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 页面类型,对应 {@link com.pig4cloud.pigx.app.api.enums.PageTypeEnums}
|
||||
*/
|
||||
@Schema(description = "页面类型")
|
||||
private Integer pageType;
|
||||
|
||||
/**
|
||||
* 页面名称
|
||||
*/
|
||||
@Schema(description = "页面名称")
|
||||
private String pageName;
|
||||
|
||||
/**
|
||||
* 页面装修组件 JSON。
|
||||
* <p>
|
||||
* 只保存页面内部组件,例如搜索、轮播、导航块、服务块等;
|
||||
* 运行时需要 Tabbar 时由服务层聚合 {@code app_tabbar} 返回。
|
||||
*/
|
||||
@Schema(description = "页面数据")
|
||||
private String pageData;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description = "修改人")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description = "修改时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 删除标记
|
||||
*/
|
||||
@TableLogic
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "删除标记")
|
||||
private String delFlag;
|
||||
|
||||
}
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
package com.pig4cloud.pigx.app.api.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.spring.activerecord.Model;
|
||||
import com.pig4cloud.pigx.common.core.util.TenantTable;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* App 角色底部导航关联实体,以 (role_id, tabbar_id, tenant_id) 为复合主键。
|
||||
* <p>
|
||||
* 这里的 roleId 是系统角色 {@code sys_role.role_id}。运行时不会跨库查询 {@code sys_user_role},
|
||||
* 而是从登录 token 的角色权限中解析 roleId,再回到本表查询可见 Tabbar。
|
||||
*
|
||||
* @author lengleng
|
||||
* @date 2026-05-09
|
||||
*/
|
||||
@Data
|
||||
@TenantTable
|
||||
@TableName("app_role_tabbar")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "App角色底部导航")
|
||||
public class AppRoleTabbar extends Model<AppRoleTabbar> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "系统角色ID")
|
||||
private Long roleId;
|
||||
|
||||
@Schema(description = "底部导航ID")
|
||||
private Long tabbarId;
|
||||
|
||||
@Schema(description = "租户ID", hidden = true)
|
||||
private Long tenantId;
|
||||
|
||||
}
|
||||
+117
@@ -0,0 +1,117 @@
|
||||
package com.pig4cloud.pigx.app.api.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.spring.activerecord.Model;
|
||||
import com.fasterxml.jackson.annotation.JsonRawValue;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||
import com.pig4cloud.pigx.common.core.util.TenantTable;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* App 底部导航实体。
|
||||
* <p>
|
||||
* 该表是移动端底部 Tabbar 的唯一数据源。图标字段保存 Wot UI 图标名,
|
||||
* 运行时可见性由 {@link #loginFlag} 和 {@code app_role_tabbar} 共同决定。
|
||||
*
|
||||
* @author lengleng
|
||||
* @date 2023-06-08 11:18:46
|
||||
*/
|
||||
@Data
|
||||
@TenantTable
|
||||
@TableName("app_tabbar")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "导航栏")
|
||||
public class AppTabbarEntity extends Model<AppTabbarEntity> {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description = "主键")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 导航名称
|
||||
*/
|
||||
@Schema(description = "导航名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 选中态图标名。
|
||||
* <p>
|
||||
* 保存 Wot UI 内置图标名称,例如 {@code home-fill}。
|
||||
*/
|
||||
@Schema(description = "选中态图标名")
|
||||
private String selected;
|
||||
|
||||
/**
|
||||
* 未选中态图标名。
|
||||
* <p>
|
||||
* 保存 Wot UI 内置图标名称,例如 {@code home}。
|
||||
*/
|
||||
@Schema(description = "未选中态图标名")
|
||||
private String unselected;
|
||||
|
||||
/**
|
||||
* 跳转链接 JSON。
|
||||
* <p>
|
||||
* 前端按装修链接结构解析,例如 {@code {"path":"/pages/index/index","type":"shop"}}。
|
||||
*/
|
||||
@Schema(description = "链接地址")
|
||||
@JsonRawValue
|
||||
@JsonDeserialize()
|
||||
private String link;
|
||||
|
||||
/**
|
||||
* 排序顺序
|
||||
*/
|
||||
@Schema(description = "排序值")
|
||||
private Integer sortOrder;
|
||||
|
||||
/**
|
||||
* 是否需要登录,0=不需要登录也可见,1=登录后按角色授权可见。
|
||||
*/
|
||||
@Schema(description = "是否需要登录,0=不需要登录也可见,1=登录后按角色授权可见")
|
||||
private String loginFlag;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description = "更新人")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description = "更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 删除标记
|
||||
*/
|
||||
@TableLogic
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "删除标记")
|
||||
private String delFlag;
|
||||
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
package com.pig4cloud.pigx.app.api.enums;
|
||||
|
||||
/**
|
||||
* App Server 模块错误编码
|
||||
*
|
||||
* @author lengleng
|
||||
* @date 2022/3/30
|
||||
*/
|
||||
public interface AppErrorCodes {
|
||||
|
||||
// === App 用户相关 ===
|
||||
String APP_USER_USERINFO_EMPTY = "app.user.userInfo.empty";
|
||||
|
||||
String APP_USER_USERNAME_EXISTING = "app.user.username.existing";
|
||||
|
||||
String APP_USER_IMPORT_SUCCEED = "app.user.import.succeed";
|
||||
|
||||
String APP_USER_QUERY_ERROR = "app.user.query.error";
|
||||
|
||||
// === App 角色相关 ===
|
||||
String APP_ROLE_ROLENAME_INEXISTENCE = "app.role.roleName.inexistence";
|
||||
|
||||
String APP_ROLE_NAMEORCODE_EXISTING = "app.role.nameOrCode.existing";
|
||||
|
||||
// === App 短信相关 ===
|
||||
String APP_SMS_OFTEN = "app.sms.often";
|
||||
|
||||
}
|
||||
+60
@@ -0,0 +1,60 @@
|
||||
package com.pig4cloud.pigx.app.api.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
/**
|
||||
* App 装修页面类型枚举。
|
||||
* <p>
|
||||
* 页面类型会写入 {@code app_page.page_type},后台保存装修页时根据该枚举回填页面名称。
|
||||
*
|
||||
* @author lengleng
|
||||
* @date 2024/12/22
|
||||
*/
|
||||
@Getter
|
||||
@RequiredArgsConstructor
|
||||
public enum PageTypeEnums {
|
||||
/**
|
||||
* 首页
|
||||
*/
|
||||
HOME(1, "首页装修"),
|
||||
/**
|
||||
* 个人中心
|
||||
*/
|
||||
USER(2, "个人中心"),
|
||||
/**
|
||||
* 客服设置
|
||||
*/
|
||||
SERVICE(3, "客服设置"),
|
||||
|
||||
/**
|
||||
* 工作台属性
|
||||
*/
|
||||
WORKBENCH(4, "工作台");
|
||||
|
||||
/**
|
||||
* 页面类型编码,和 app_page.page_type 对应。
|
||||
*/
|
||||
private final Integer pageType;
|
||||
|
||||
/**
|
||||
* 页面类型展示名称。
|
||||
*/
|
||||
private final String name;
|
||||
|
||||
/**
|
||||
* 按类型获取名称
|
||||
*
|
||||
* @param pageType 页面类型
|
||||
* @return {@link String }
|
||||
*/
|
||||
public static String getNameByType(Integer pageType) {
|
||||
for (PageTypeEnums value : PageTypeEnums.values()) {
|
||||
if (value.pageType.equals(pageType)) {
|
||||
return value.name;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
+102
@@ -0,0 +1,102 @@
|
||||
package com.pig4cloud.pigx.app.api.vo;
|
||||
|
||||
import com.pig4cloud.pigx.app.api.entity.AppPageEntity;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppTabbarEntity;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* APP 装修页聚合数据。
|
||||
* <p>
|
||||
* 对外保持页面字段在顶层,额外追加 {@link #tabbar},避免把底部导航配置重新写回
|
||||
* {@code app_page.page_data}。
|
||||
*
|
||||
* @author lengleng
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "APP 装修页聚合数据")
|
||||
public class AppDecorateVO {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@Schema(description = "主键")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 页面类型
|
||||
*/
|
||||
@Schema(description = "页面类型")
|
||||
private Integer pageType;
|
||||
|
||||
/**
|
||||
* 页面名称
|
||||
*/
|
||||
@Schema(description = "页面名称")
|
||||
private String pageName;
|
||||
|
||||
/**
|
||||
* 页面装修组件 JSON,不包含底部 Tabbar。
|
||||
*/
|
||||
@Schema(description = "页面数据")
|
||||
private String pageData;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@Schema(description = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
@Schema(description = "修改人")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@Schema(description = "修改时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 删除标记
|
||||
*/
|
||||
@Schema(description = "删除标记")
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 当前查询场景下可用的底部导航栏。
|
||||
* <p>
|
||||
* 后台装修查询返回完整 Tabbar;App 运行时查询返回公开 Tabbar + 当前角色授权 Tabbar。
|
||||
*/
|
||||
@Schema(description = "底部导航栏")
|
||||
private List<AppTabbarEntity> tabbar;
|
||||
|
||||
/**
|
||||
* 根据页面实体和 Tabbar 列表构建装修聚合 VO。
|
||||
*
|
||||
* @param page 页面实体,可能为空
|
||||
* @param tabbar Tabbar 列表
|
||||
* @return 装修聚合数据
|
||||
*/
|
||||
public static AppDecorateVO of(AppPageEntity page, List<AppTabbarEntity> tabbar) {
|
||||
AppDecorateVO vo = new AppDecorateVO();
|
||||
if (page != null) {
|
||||
BeanUtils.copyProperties(page, vo);
|
||||
}
|
||||
vo.setTabbar(tabbar);
|
||||
return vo;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
# App Server Module i18n Messages - English
|
||||
|
||||
# App user related
|
||||
app.user.userInfo.empty=App user information is empty for {0}
|
||||
app.user.username.existing=Username {0} already exists
|
||||
app.user.import.succeed=User import succeeded; default password is the phone number
|
||||
app.user.query.error=Failed to fetch current user information
|
||||
|
||||
# App role related
|
||||
app.role.roleName.inexistence=Role name {0} does not exist
|
||||
app.role.nameOrCode.existing=Role name or code already exists ({0} {1})
|
||||
|
||||
# App SMS related
|
||||
app.sms.often=Verification code sent too frequently
|
||||
@@ -0,0 +1,14 @@
|
||||
# App Server 模块国际化消息 - 中文
|
||||
|
||||
# App 用户相关
|
||||
app.user.userInfo.empty={0} \u7528\u6237\u4FE1\u606F\u4E3A\u7A7A
|
||||
app.user.username.existing={0} \u7528\u6237\u540D\u5DF2\u5B58\u5728
|
||||
app.user.import.succeed=\u7528\u6237\u5BFC\u5165\u6210\u529F\uFF0C\u9ED8\u8BA4\u5BC6\u7801\u4E3A\u624B\u673A\u53F7
|
||||
app.user.query.error=\u83B7\u53D6\u5F53\u524D\u7528\u6237\u4FE1\u606F\u5931\u8D25
|
||||
|
||||
# App 角色相关
|
||||
app.role.roleName.inexistence={0} \u89D2\u8272\u540D\u79F0\u4E0D\u5B58\u5728
|
||||
app.role.nameOrCode.existing={0} {1} \u89D2\u8272\u540D\u6216\u89D2\u8272\u7F16\u7801\u5DF2\u7ECF\u5B58\u5728
|
||||
|
||||
# App 短信相关
|
||||
app.sms.often=\u9A8C\u8BC1\u7801\u53D1\u9001\u8FC7\u9891\u7E41
|
||||
@@ -0,0 +1,19 @@
|
||||
FROM registry.cn-hangzhou.aliyuncs.com/dockerhub_mirror/java:21-anolis
|
||||
|
||||
MAINTAINER wangiegie@gmail.com
|
||||
|
||||
ENV TZ=Asia/Shanghai
|
||||
ENV LANG C.UTF-8
|
||||
ENV JAVA_OPTS="-Xms512m -Xmx1024m -Djava.security.egd=file:/dev/./urandom"
|
||||
|
||||
RUN ln -sf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
||||
|
||||
RUN mkdir -p /pigx-app-server
|
||||
|
||||
WORKDIR /pigx-app-server
|
||||
|
||||
EXPOSE 7060
|
||||
|
||||
ADD ./target/pigx-app-server-biz.jar ./
|
||||
|
||||
CMD sleep 60;java $JAVA_OPTS -jar pigx-app-server-biz.jar
|
||||
@@ -0,0 +1,131 @@
|
||||
<?xml version="1.0"?>
|
||||
<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>
|
||||
<parent>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-app-server</artifactId>
|
||||
<version>6.2.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>pigx-app-server-biz</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<!--必备: spring boot web-->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-webmvc</artifactId>
|
||||
</dependency>
|
||||
<!--必备: 注册中心客户端-->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
</dependency>
|
||||
<!--必备: 配置中心客户端-->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||
</dependency>
|
||||
<!--必备: 操作数据源相关-->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-data</artifactId>
|
||||
</dependency>
|
||||
<!--必备:pigx安全模块-->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-security</artifactId>
|
||||
</dependency>
|
||||
<!--必备:xss 过滤模块-->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-xss</artifactId>
|
||||
</dependency>
|
||||
<!--必备: sentinel 依赖-->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-sentinel</artifactId>
|
||||
</dependency>
|
||||
<!--必备: feign 依赖-->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-feign</artifactId>
|
||||
</dependency>
|
||||
<!--必备: 依赖api模块-->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-app-server-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-upms-api</artifactId>
|
||||
</dependency>
|
||||
<!--必备: log 依赖-->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-log</artifactId>
|
||||
</dependency>
|
||||
<!--必备: API加解密 -->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-encrypt-api</artifactId>
|
||||
</dependency>
|
||||
<!--选配: mybatis 依赖 -->
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-spring-boot4-starter</artifactId>
|
||||
</dependency>
|
||||
<!--选配: druid 连接池 -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>druid-spring-boot-4-starter</artifactId>
|
||||
</dependency>
|
||||
<!--选配: mysql 数据库驱动 -->
|
||||
<dependency>
|
||||
<groupId>com.mysql</groupId>
|
||||
<artifactId>mysql-connector-j</artifactId>
|
||||
</dependency>
|
||||
<!--选配: swagger文档-->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-swagger</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>cloud</id>
|
||||
<activation>
|
||||
<activeByDefault>true</activeByDefault>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>io.fabric8</groupId>
|
||||
<artifactId>docker-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<skip>false</skip>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>boot</id>
|
||||
</profile>
|
||||
</profiles>
|
||||
</project>
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
package com.pig4cloud.pigx.app;
|
||||
|
||||
import com.pig4cloud.pigx.common.feign.annotation.EnablePigxFeignClients;
|
||||
import com.pig4cloud.pigx.common.security.annotation.EnablePigxResourceServer;
|
||||
import com.pig4cloud.pigx.common.swagger.annotation.EnableOpenApi;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
||||
|
||||
/**
|
||||
* @author pigx archetype
|
||||
* <p>
|
||||
* 项目启动类
|
||||
*/
|
||||
@EnableOpenApi("app")
|
||||
@EnablePigxFeignClients
|
||||
@EnableDiscoveryClient
|
||||
@EnablePigxResourceServer
|
||||
@SpringBootApplication
|
||||
public class PigxAppApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(PigxAppApplication.class, args);
|
||||
}
|
||||
|
||||
}
|
||||
+151
@@ -0,0 +1,151 @@
|
||||
package com.pig4cloud.pigx.app.controller;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppArticleCategoryEntity;
|
||||
import com.pig4cloud.pigx.app.service.AppArticleCategoryService;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.common.excel.annotation.ResponseExcel;
|
||||
import com.pig4cloud.pigx.common.log.annotation.SysLog;
|
||||
import com.pig4cloud.pigx.common.security.annotation.HasPermission;
|
||||
import com.pig4cloud.pigx.common.security.annotation.Inner;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springdoc.core.annotations.ParameterObject;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 文章分类表
|
||||
*
|
||||
* @author pig
|
||||
* @date 2023-06-07 16:28:03
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/appArticleCategory")
|
||||
@Tag(description = "appArticleCategory", name = "文章分类表管理")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class AppArticleCategoryController {
|
||||
|
||||
private final AppArticleCategoryService appArticleCategoryService;
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param page 分页对象
|
||||
* @param appArticleCategory 文章分类表
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "分页查询", description = "分页查询")
|
||||
@GetMapping("/page")
|
||||
@HasPermission("app_appArticleCategory_view")
|
||||
public R getAppArticleCategoryPage(@ParameterObject Page page,
|
||||
@ParameterObject AppArticleCategoryEntity appArticleCategory) {
|
||||
LambdaQueryWrapper<AppArticleCategoryEntity> wrapper = Wrappers.lambdaQuery();
|
||||
wrapper.like(StrUtil.isNotBlank(appArticleCategory.getName()), AppArticleCategoryEntity::getName,
|
||||
appArticleCategory.getName());
|
||||
wrapper.orderByAsc(AppArticleCategoryEntity::getSort, AppArticleCategoryEntity::getId);
|
||||
return R.ok(appArticleCategoryService.page(page, wrapper));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询文章分类表
|
||||
* @param id id
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "通过id查询", description = "通过id查询")
|
||||
@GetMapping("/{id}")
|
||||
@HasPermission("app_appArticleCategory_view")
|
||||
public R getById(@PathVariable("id") Long id) {
|
||||
return R.ok(appArticleCategoryService.getById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过查询文章分类
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "查询文章分类", description = "查询文章分类")
|
||||
@Inner(value = false)
|
||||
@GetMapping("/list")
|
||||
public R list() {
|
||||
return R.ok(appArticleCategoryService.list(Wrappers.<AppArticleCategoryEntity>lambdaQuery()
|
||||
.orderByAsc(AppArticleCategoryEntity::getSort, AppArticleCategoryEntity::getId)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增文章分类表
|
||||
* @param appArticleCategory 文章分类表
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "新增文章分类表", description = "新增文章分类表")
|
||||
@SysLog("新增文章分类表")
|
||||
@PostMapping
|
||||
@HasPermission("app_appArticleCategory_add")
|
||||
public R save(@RequestBody AppArticleCategoryEntity appArticleCategory) {
|
||||
return R.ok(appArticleCategoryService.save(appArticleCategory));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改文章分类表
|
||||
* @param appArticleCategory 文章分类表
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "修改文章分类表", description = "修改文章分类表")
|
||||
@SysLog("修改文章分类表")
|
||||
@PutMapping
|
||||
@HasPermission("app_appArticleCategory_edit")
|
||||
public R updateById(@RequestBody AppArticleCategoryEntity appArticleCategory) {
|
||||
return R.ok(appArticleCategoryService.updateById(appArticleCategory));
|
||||
}
|
||||
|
||||
/**
|
||||
* 按传入 ID 顺序调整文章分类,保留未选中记录在排序序列中的位置。
|
||||
* <p>
|
||||
* 以当前租户内未删除记录的排序值、主键升序为基准,仅重排选中记录占据的位置, 再将全部记录的排序值从 1 起连续重编号。
|
||||
* @param ids 按目标顺序排列的文章分类 ID;不可为 null 或空,不可包含 null、重复或不可用的 ID
|
||||
* @return 排序保存成功的响应;校验或更新失败时抛出异常,由统一异常处理器转换响应
|
||||
* @throws IllegalArgumentException ID 列表为空、包含 null 或重复值,或指定记录已删除、不属于当前租户 或不存在
|
||||
* @throws IllegalStateException 批量更新返回失败
|
||||
*/
|
||||
@Operation(summary = "拖拽排序", description = "按当前列表顺序保存排序")
|
||||
@SysLog("文章分类排序")
|
||||
@PutMapping("/sort")
|
||||
@HasPermission("app_appArticleCategory_edit")
|
||||
public R sort(@RequestBody List<Long> ids) {
|
||||
appArticleCategoryService.sort(ids);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除文章分类表
|
||||
* @param ids id列表
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "通过id删除文章分类表", description = "通过id删除文章分类表")
|
||||
@SysLog("通过id删除文章分类表")
|
||||
@DeleteMapping
|
||||
@HasPermission("app_appArticleCategory_del")
|
||||
public R removeById(@RequestBody Long[] ids) {
|
||||
return R.ok(appArticleCategoryService.removeBatchByIds(CollUtil.toList(ids)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel 表格
|
||||
* @param appArticleCategory 查询条件
|
||||
* @return excel 文件流
|
||||
*/
|
||||
@ResponseExcel
|
||||
@GetMapping("/export")
|
||||
@HasPermission("app_appArticleCategory_export")
|
||||
public List<AppArticleCategoryEntity> export(AppArticleCategoryEntity appArticleCategory) {
|
||||
return appArticleCategoryService.list(Wrappers.query(appArticleCategory));
|
||||
}
|
||||
|
||||
}
|
||||
+131
@@ -0,0 +1,131 @@
|
||||
package com.pig4cloud.pigx.app.controller;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppArticleCollectEntity;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppArticleEntity;
|
||||
import com.pig4cloud.pigx.app.service.AppArticleCollectService;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.common.excel.annotation.ResponseExcel;
|
||||
import com.pig4cloud.pigx.common.log.annotation.SysLog;
|
||||
import com.pig4cloud.pigx.common.security.annotation.HasPermission;
|
||||
import com.pig4cloud.pigx.common.security.util.SecurityUtils;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springdoc.core.annotations.ParameterObject;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 文章收藏表
|
||||
*
|
||||
* @author pig
|
||||
* @date 2023-06-16 14:33:41
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/collect")
|
||||
@Tag(description = "collect", name = "文章收藏表管理")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class AppArticleCollectController {
|
||||
|
||||
private final AppArticleCollectService appArticleCollectService;
|
||||
|
||||
/**
|
||||
* 分页查询文章收藏信息。
|
||||
*
|
||||
* @param page 分页查询参数对象
|
||||
* @return 返回分页结果对象,包含文章收藏信息列表
|
||||
*/
|
||||
@Operation(summary = "分页查询", description = "分页查询")
|
||||
@GetMapping("/page")
|
||||
public R getAppArticleCollectPage(@ParameterObject Page page) {
|
||||
MPJLambdaWrapper<AppArticleCollectEntity> wrapper = new MPJLambdaWrapper<AppArticleCollectEntity>()
|
||||
.selectAll(AppArticleCollectEntity.class)
|
||||
.select(AppArticleEntity::getTitle, AppArticleEntity::getImage, AppArticleEntity::getVisit)
|
||||
.leftJoin(AppArticleEntity.class, AppArticleEntity::getId, AppArticleCollectEntity::getArticleId)
|
||||
.eq(AppArticleCollectEntity::getUserId, SecurityUtils.getUser().getId());
|
||||
return R.ok(appArticleCollectService.selectJoinListPage(page, AppArticleCollectEntity.class, wrapper));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询文章收藏表
|
||||
*
|
||||
* @param id id
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "通过id查询", description = "通过id查询")
|
||||
@GetMapping("/{id}")
|
||||
public R getById(@PathVariable("id") Long id) {
|
||||
return R.ok(appArticleCollectService.getById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增文章收藏表
|
||||
*
|
||||
* @param appArticleCollect 文章收藏表
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "新增文章收藏表", description = "新增文章收藏表")
|
||||
@SysLog("新增文章收藏表")
|
||||
@PostMapping
|
||||
public R save(@RequestBody AppArticleCollectEntity appArticleCollect) {
|
||||
return R.ok(appArticleCollectService.saveArticleCollect(appArticleCollect));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改文章收藏表
|
||||
*
|
||||
* @param appArticleCollect 文章收藏表
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "修改文章收藏表", description = "修改文章收藏表")
|
||||
@SysLog("修改文章收藏表")
|
||||
@PutMapping
|
||||
public R updateById(@RequestBody AppArticleCollectEntity appArticleCollect) {
|
||||
return R.ok(appArticleCollectService.updateById(appArticleCollect));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除文章收藏表
|
||||
*
|
||||
* @param ids id列表
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "通过id删除文章收藏表", description = "通过id删除文章收藏表")
|
||||
@SysLog("通过id删除文章收藏表")
|
||||
@DeleteMapping
|
||||
public R removeById(@RequestBody Long[] ids) {
|
||||
return R.ok(appArticleCollectService.removeBatchByIds(CollUtil.toList(ids)));
|
||||
}
|
||||
|
||||
@Operation(summary = "通过文章id删除文章收藏表", description = "通过文章id删除文章收藏表")
|
||||
@SysLog("通过文章id删除文章收藏表")
|
||||
@DeleteMapping("/{articleId}")
|
||||
public R removeByArticleId(@PathVariable String articleId) {
|
||||
Long id = SecurityUtils.getUser().getId();
|
||||
return R.ok(appArticleCollectService.remove(Wrappers.<AppArticleCollectEntity>lambdaQuery()
|
||||
.eq(AppArticleCollectEntity::getUserId, id)
|
||||
.eq(AppArticleCollectEntity::getArticleId, articleId)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel 表格
|
||||
*
|
||||
* @param appArticleCollect 查询条件
|
||||
* @return excel 文件流
|
||||
*/
|
||||
@ResponseExcel
|
||||
@GetMapping("/export")
|
||||
@HasPermission("app_collect_export")
|
||||
public List<AppArticleCollectEntity> export(AppArticleCollectEntity appArticleCollect) {
|
||||
return appArticleCollectService.list(Wrappers.query(appArticleCollect));
|
||||
}
|
||||
|
||||
}
|
||||
+137
@@ -0,0 +1,137 @@
|
||||
package com.pig4cloud.pigx.app.controller;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppArticleEntity;
|
||||
import com.pig4cloud.pigx.app.service.AppArticleService;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.common.excel.annotation.ResponseExcel;
|
||||
import com.pig4cloud.pigx.common.log.annotation.SysLog;
|
||||
import com.pig4cloud.pigx.common.security.annotation.HasPermission;
|
||||
import com.pig4cloud.pigx.common.security.annotation.Inner;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springdoc.core.annotations.ParameterObject;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 文章资讯
|
||||
*
|
||||
* @author pig
|
||||
* @date 2023-06-07 16:32:35
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/appArticle")
|
||||
@Tag(description = "appArticle", name = "文章资讯管理")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class AppArticleController {
|
||||
|
||||
private final AppArticleService appArticleService;
|
||||
|
||||
/**
|
||||
* 分页查询文章资讯。
|
||||
* <p>
|
||||
* 返回文章列表时会关联分类名称,供 App 资讯列表和后台管理复用。
|
||||
* @param page 分页对象
|
||||
* @param appArticle 文章资讯
|
||||
* @return 文章分页结果
|
||||
*/
|
||||
@Operation(summary = "分页查询", description = "分页查询")
|
||||
@Inner(value = false)
|
||||
@GetMapping("/page")
|
||||
public R getAppArticlePage(@ParameterObject Page page, @ParameterObject AppArticleEntity appArticle) {
|
||||
return R.ok(appArticleService.pageAndCname(page, appArticle));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询文章详情。
|
||||
* <p>
|
||||
* 会递增访问次数;如果传入 userId,则额外返回该用户是否收藏当前文章。
|
||||
* @param id 文章 ID
|
||||
* @param userId 用户 ID,可为空
|
||||
* @return 文章详情
|
||||
*/
|
||||
@Inner(value = false)
|
||||
@Operation(summary = "通过id查询", description = "通过id查询")
|
||||
@GetMapping("/details/{id}/{userId}")
|
||||
public R getById(@PathVariable("id") Long id, @PathVariable(required = false) Long userId) {
|
||||
return R.ok(appArticleService.getArticleAndIncrById(id, userId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增文章资讯
|
||||
* @param appArticle 文章资讯
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "新增文章资讯", description = "新增文章资讯")
|
||||
@SysLog("新增文章资讯")
|
||||
@PostMapping
|
||||
@HasPermission("app_appArticle_add")
|
||||
public R save(@RequestBody AppArticleEntity appArticle) {
|
||||
return R.ok(appArticleService.save(appArticle));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改文章资讯
|
||||
* @param appArticle 文章资讯
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "修改文章资讯", description = "修改文章资讯")
|
||||
@SysLog("修改文章资讯")
|
||||
@PutMapping
|
||||
@HasPermission("app_appArticle_edit")
|
||||
public R updateById(@RequestBody AppArticleEntity appArticle) {
|
||||
return R.ok(appArticleService.updateById(appArticle));
|
||||
}
|
||||
|
||||
/**
|
||||
* 按传入 ID 顺序调整文章,保留未选中记录在排序序列中的位置。
|
||||
* <p>
|
||||
* 以当前租户内未删除记录的排序值、主键升序为基准,仅重排选中记录占据的位置, 再将全部记录的排序值从 1 起连续重编号。
|
||||
* @param ids 按目标顺序排列的文章 ID;不可为 null 或空,不可包含 null、重复或不可用的 ID
|
||||
* @return 排序保存成功的响应;校验或更新失败时抛出异常,由统一异常处理器转换响应
|
||||
* @throws IllegalArgumentException ID 列表为空、包含 null 或重复值,或指定记录已删除、不属于当前租户 或不存在
|
||||
* @throws IllegalStateException 批量更新返回失败
|
||||
*/
|
||||
@Operation(summary = "拖拽排序", description = "按当前列表顺序保存排序")
|
||||
@SysLog("文章资讯排序")
|
||||
@PutMapping("/sort")
|
||||
@HasPermission("app_appArticle_edit")
|
||||
public R sort(@RequestBody List<Long> ids) {
|
||||
appArticleService.sort(ids);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除文章资讯
|
||||
* @param ids id列表
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "通过id删除文章资讯", description = "通过id删除文章资讯")
|
||||
@SysLog("通过id删除文章资讯")
|
||||
@DeleteMapping
|
||||
@HasPermission("app_appArticle_del")
|
||||
public R removeById(@RequestBody Long[] ids) {
|
||||
return R.ok(appArticleService.removeBatchByIds(CollUtil.toList(ids)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel 表格
|
||||
* @param appArticle 查询条件
|
||||
* @return excel 文件流
|
||||
*/
|
||||
@ResponseExcel
|
||||
@GetMapping("/export")
|
||||
@HasPermission("app_appArticle_export")
|
||||
public List<AppArticleEntity> export(AppArticleEntity appArticle) {
|
||||
return appArticleService.list(Wrappers.query(appArticle));
|
||||
}
|
||||
|
||||
}
|
||||
+122
@@ -0,0 +1,122 @@
|
||||
package com.pig4cloud.pigx.app.controller;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppContactsEntity;
|
||||
import com.pig4cloud.pigx.app.service.AppContactsService;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.common.excel.annotation.ResponseExcel;
|
||||
import com.pig4cloud.pigx.common.log.annotation.SysLog;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springdoc.core.annotations.ParameterObject;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import com.pig4cloud.pigx.common.security.annotation.HasPermission;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 通讯录表管理控制器
|
||||
*
|
||||
* @author lengleng
|
||||
* @date 2025/05/29
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/appContacts")
|
||||
@Tag(description = "appContacts", name = "通讯录表管理")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class AppContactsController {
|
||||
|
||||
private final AppContactsService appContactsService;
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param appContacts 通讯录表
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "分页查询", description = "分页查询")
|
||||
@GetMapping("/page")
|
||||
@HasPermission("app_appContacts_view")
|
||||
public R getAppContactsPage(@ParameterObject Page page, @ParameterObject AppContactsEntity appContacts) {
|
||||
return R.ok(appContactsService.pageScope(page, appContacts));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 通过id查询通讯录表
|
||||
*
|
||||
* @param id id
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "通过id查询", description = "通过id查询")
|
||||
@GetMapping("/{id}")
|
||||
@HasPermission("app_appContacts_view")
|
||||
public R getById(@PathVariable("id") Long id) {
|
||||
return R.ok(appContactsService.getById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增通讯录表
|
||||
*
|
||||
* @param appContacts 通讯录表
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "新增通讯录表", description = "新增通讯录表")
|
||||
@SysLog("新增通讯录表")
|
||||
@PostMapping
|
||||
@HasPermission("app_appContacts_add")
|
||||
public R save(@RequestBody AppContactsEntity appContacts) {
|
||||
return R.ok(appContactsService.save(appContacts));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改通讯录表
|
||||
*
|
||||
* @param appContacts 通讯录表
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "修改通讯录表", description = "修改通讯录表")
|
||||
@SysLog("修改通讯录表")
|
||||
@PutMapping
|
||||
@HasPermission("app_appContacts_edit")
|
||||
public R updateById(@RequestBody AppContactsEntity appContacts) {
|
||||
return R.ok(appContactsService.updateById(appContacts));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除通讯录表
|
||||
*
|
||||
* @param ids id列表
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "通过id删除通讯录表", description = "通过id删除通讯录表")
|
||||
@SysLog("通过id删除通讯录表")
|
||||
@DeleteMapping
|
||||
@HasPermission("app_appContacts_del")
|
||||
public R removeById(@RequestBody Long[] ids) {
|
||||
return R.ok(appContactsService.removeBatchByIds(CollUtil.toList(ids)));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 导出excel 表格
|
||||
*
|
||||
* @param appContacts 查询条件
|
||||
* @param ids 导出指定ID
|
||||
* @return excel 文件流
|
||||
*/
|
||||
@ResponseExcel
|
||||
@GetMapping("/export")
|
||||
@HasPermission("app_appContacts_export")
|
||||
public List<AppContactsEntity> export(AppContactsEntity appContacts, Long[] ids) {
|
||||
return appContactsService.list(Wrappers.lambdaQuery(appContacts).in(ArrayUtil.isNotEmpty(ids), AppContactsEntity::getId, ids));
|
||||
}
|
||||
}
|
||||
+86
@@ -0,0 +1,86 @@
|
||||
package com.pig4cloud.pigx.app.controller;
|
||||
|
||||
import com.pig4cloud.pigx.app.service.AppIndexService;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.common.security.annotation.Inner;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* App 运行时页面接口。
|
||||
* <p>
|
||||
* 这里的接口主要给移动端调用,返回首页、装修页、底部 Tabbar 等运行时数据。
|
||||
* 部分接口允许匿名访问,具体可见方法上的 {@link Inner} 配置。
|
||||
*
|
||||
* @author lengleng
|
||||
* @date 2023/6/8
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/index")
|
||||
@Tag(description = "App 页面控制", name = "app index")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class AppIndexController {
|
||||
|
||||
private final AppIndexService indexService;
|
||||
|
||||
/**
|
||||
* 获取首页基础数据。
|
||||
* <p>
|
||||
* 当前返回首页装修页记录和资讯列表,适合旧版首页一次性拉取基础内容。
|
||||
*
|
||||
* @return 首页页面数据和资讯列表
|
||||
*/
|
||||
@Inner(value = false)
|
||||
@GetMapping("/index")
|
||||
public R index() {
|
||||
return R.ok(indexService.index());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取移动端底部导航配置。
|
||||
* <p>
|
||||
* 未登录时只返回公开 Tabbar;登录后返回公开 Tabbar + 当前用户角色授权的 Tabbar。
|
||||
*
|
||||
* @return 当前访问身份可见的 Tabbar 列表
|
||||
*/
|
||||
@Inner(value = false)
|
||||
@GetMapping("/config")
|
||||
public R config() {
|
||||
return R.ok(indexService.config());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取指定页面类型的装修数据。
|
||||
* <p>
|
||||
* 返回页面装修 JSON,同时聚合当前访问身份可见的 Tabbar,方便移动端一次请求完成页面渲染。
|
||||
*
|
||||
* @param pageType 页面类型
|
||||
* @return 装修页聚合数据
|
||||
*/
|
||||
@Inner(value = false)
|
||||
@GetMapping("/decorate")
|
||||
public R decorate(@Validated @RequestParam("id") Integer pageType) {
|
||||
return R.ok(indexService.decorate(pageType));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取工作台页面装修数据。
|
||||
* <p>
|
||||
* 工作台内部按钮权限复用 B 端权限体系,这里不再按 App 专属菜单做二次过滤。
|
||||
*
|
||||
* @return 工作台页面数据
|
||||
*/
|
||||
@GetMapping("/workbench")
|
||||
public R workbench() {
|
||||
return R.ok(indexService.workbench());
|
||||
}
|
||||
|
||||
}
|
||||
+61
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2026, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.app.controller;
|
||||
|
||||
import com.pig4cloud.pigx.app.service.AppMobileService;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.common.security.annotation.Inner;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* App 手机验证码接口。
|
||||
*
|
||||
* @author lengleng
|
||||
* @date 2018/11/14
|
||||
* <p>
|
||||
* 手机验证码
|
||||
*/
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/appmobile")
|
||||
@Tag(description = "mobile", name = "手机管理模块")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class AppMobileController {
|
||||
|
||||
private final AppMobileService appMobileService;
|
||||
|
||||
/**
|
||||
* 发送 App 手机验证码。
|
||||
*
|
||||
* @param mobile 手机号
|
||||
* @return 发送结果
|
||||
*/
|
||||
@Inner(value = false)
|
||||
@GetMapping("/{mobile}")
|
||||
public R sendSmsCode(@PathVariable String mobile) {
|
||||
return appMobileService.sendSmsCode(mobile);
|
||||
}
|
||||
|
||||
}
|
||||
+92
@@ -0,0 +1,92 @@
|
||||
package com.pig4cloud.pigx.app.controller;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppPageEntity;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppTabbarEntity;
|
||||
import com.pig4cloud.pigx.app.api.enums.PageTypeEnums;
|
||||
import com.pig4cloud.pigx.app.api.vo.AppDecorateVO;
|
||||
import com.pig4cloud.pigx.app.service.AppPageService;
|
||||
import com.pig4cloud.pigx.app.service.AppTabbarService;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* App 装修页面后台管理接口。
|
||||
* <p>
|
||||
* 页面表只保存页面装修组件 JSON,底部 Tabbar 由 {@code app_tabbar} 独立维护;
|
||||
* 查询装修页时会聚合 Tabbar,便于后台预览。
|
||||
*
|
||||
* @author pig
|
||||
* @date 2023-06-07 16:32:35
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/appPage")
|
||||
@Tag(description = "appPage", name = "页面管理")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class AppPageController {
|
||||
|
||||
private final AppPageService pageService;
|
||||
|
||||
private final AppTabbarService tabbarService;
|
||||
|
||||
/**
|
||||
* 按页面类型查询后台装修页配置。
|
||||
* <p>
|
||||
* 返回结构保持页面字段在顶层,并额外携带完整 Tabbar 列表,用于后台装修预览和 Tabbar 设置区初始化。
|
||||
*
|
||||
* @param pageType 页面类型,见 {@link PageTypeEnums}
|
||||
* @return 页面装修数据和完整 Tabbar 列表
|
||||
*/
|
||||
@Operation(summary = "通过页面类型查询", description = "通过页面类型查询")
|
||||
@GetMapping("/{pageType}")
|
||||
public R getByPageType(@PathVariable("pageType") Integer pageType) {
|
||||
AppPageEntity appPage = pageService.getOne(Wrappers.<AppPageEntity>lambdaQuery()
|
||||
.eq(AppPageEntity::getPageType, pageType)
|
||||
.orderByDesc(AppPageEntity::getCreateTime), false);
|
||||
List<AppTabbarEntity> tabbarList = tabbarService
|
||||
.list(Wrappers.<AppTabbarEntity>lambdaQuery().orderByAsc(AppTabbarEntity::getSortOrder).orderByAsc(AppTabbarEntity::getId));
|
||||
AppDecorateVO decorateVO = AppDecorateVO.of(appPage, tabbarList);
|
||||
if (appPage == null) {
|
||||
decorateVO.setPageType(pageType);
|
||||
decorateVO.setPageName(PageTypeEnums.getNameByType(pageType));
|
||||
decorateVO.setPageData("[]");
|
||||
}
|
||||
return R.ok(decorateVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存页面装修数据。
|
||||
* <p>
|
||||
* 同一页面类型只保留一份最新配置;保存时先删除旧记录,再写入新记录。
|
||||
* Tabbar 不随页面一起保存,需通过 {@link AppTabbarController} 单独维护。
|
||||
*
|
||||
* @param page 页面
|
||||
* @return 保存结果
|
||||
*/
|
||||
@Operation(summary = "更新页面", description = "更新页面")
|
||||
@PutMapping
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public R update(@RequestBody AppPageEntity page) {
|
||||
List<AppPageEntity> pageEntityList = pageService
|
||||
.list(Wrappers.<AppPageEntity>lambdaQuery().eq(AppPageEntity::getPageType, page.getPageType()));
|
||||
|
||||
if (CollUtil.isNotEmpty(pageEntityList)) {
|
||||
// app_page 按页面类型覆盖保存,避免同一页面类型存在多份装修数据。
|
||||
pageService.removeByIds(pageEntityList.stream().map(AppPageEntity::getId).toList());
|
||||
}
|
||||
|
||||
page.setPageName(PageTypeEnums.getNameByType(page.getPageType()));
|
||||
return R.ok(pageService.save(page));
|
||||
}
|
||||
|
||||
}
|
||||
+105
@@ -0,0 +1,105 @@
|
||||
package com.pig4cloud.pigx.app.controller;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysRole;
|
||||
import com.pig4cloud.pigx.admin.api.feign.RemoteRoleService;
|
||||
import com.pig4cloud.pigx.app.api.dto.AppRoleTabbarDTO;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppTabbarEntity;
|
||||
import com.pig4cloud.pigx.app.service.AppRoleTabbarService;
|
||||
import com.pig4cloud.pigx.app.service.AppTabbarService;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.common.security.annotation.HasPermission;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* App 角色底部导航授权管理接口。
|
||||
* <p>
|
||||
* 该接口只维护「系统角色 -> App Tabbar」的授权关系。角色本身仍来自 upms 的 {@code sys_role},
|
||||
* App 端运行时根据登录 token 中的角色 ID 读取 {@code app_role_tabbar},不跨库 join {@code sys_user_role}。
|
||||
*
|
||||
* @author lengleng
|
||||
* @date 2026-05-09
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/role-tabbar")
|
||||
@Tag(description = "role-tabbar", name = "App角色底部导航授权")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class AppRoleTabbarController {
|
||||
|
||||
private final RemoteRoleService remoteRoleService;
|
||||
|
||||
private final AppTabbarService appTabbarService;
|
||||
|
||||
private final AppRoleTabbarService appRoleTabbarService;
|
||||
|
||||
/**
|
||||
* 查询可授权的系统角色列表。
|
||||
* <p>
|
||||
* 角色来源于 upms 远程接口,前端可按角色名称做轻量过滤,用于角色 Tabbar 授权页面。
|
||||
*
|
||||
* @param roleName 角色名称关键字,可为空
|
||||
* @return 系统角色列表
|
||||
*/
|
||||
@GetMapping("/roles")
|
||||
@HasPermission("app_role_tabbar_view")
|
||||
public R<List<SysRole>> roles(@RequestParam(required = false) String roleName) {
|
||||
R<List<SysRole>> roles = remoteRoleService.getAllRole();
|
||||
if (!roles.isOk() || roles.getData() == null || StrUtil.isBlank(roleName)) {
|
||||
return roles;
|
||||
}
|
||||
return R.ok(roles.getData()
|
||||
.stream()
|
||||
.filter(role -> StrUtil.containsIgnoreCase(role.getRoleName(), roleName))
|
||||
.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询可授权的 App 底部导航列表。
|
||||
* <p>
|
||||
* 返回完整 Tabbar 列表,公开 Tabbar 前端可固定勾选,登录可见 Tabbar 由角色授权控制。
|
||||
*
|
||||
* @return App Tabbar 列表
|
||||
*/
|
||||
@GetMapping("/tabbar")
|
||||
@HasPermission("app_role_tabbar_view")
|
||||
public R<List<AppTabbarEntity>> tabbars() {
|
||||
return R.ok(appTabbarService.list(Wrappers.<AppTabbarEntity>lambdaQuery()
|
||||
.orderByAsc(AppTabbarEntity::getSortOrder)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询指定角色已授权的 Tabbar ID。
|
||||
*
|
||||
* @param roleId 系统角色 ID
|
||||
* @return 已授权的 Tabbar ID 列表
|
||||
*/
|
||||
@GetMapping("/{roleId}")
|
||||
@HasPermission("app_role_tabbar_view")
|
||||
public R<List<Long>> roleTabbars(@PathVariable Long roleId) {
|
||||
return R.ok(appRoleTabbarService.listTabbarIdsByRoleId(roleId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存角色 Tabbar 授权。
|
||||
* <p>
|
||||
* 保存采用覆盖语义:先清空该角色原有授权,再写入本次提交的 Tabbar ID 列表。
|
||||
*
|
||||
* @param dto 角色 Tabbar 授权请求
|
||||
* @return 保存结果
|
||||
*/
|
||||
@PutMapping
|
||||
@HasPermission("app_role_tabbar_edit")
|
||||
public R<Boolean> saveRoleTabbars(@Valid @RequestBody AppRoleTabbarDTO dto) {
|
||||
return R.ok(appRoleTabbarService.saveRoleTabbars(dto));
|
||||
}
|
||||
|
||||
}
|
||||
+87
@@ -0,0 +1,87 @@
|
||||
package com.pig4cloud.pigx.app.controller;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppRoleTabbar;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppTabbarEntity;
|
||||
import com.pig4cloud.pigx.app.service.AppRoleTabbarService;
|
||||
import com.pig4cloud.pigx.app.service.AppTabbarService;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* App 底部导航后台管理接口。
|
||||
* <p>
|
||||
* Tabbar 是移动端底部入口的数据源,图标字段保存 Wot UI 图标名;
|
||||
* 是否登录可见由 {@code loginFlag} 控制,登录后再叠加角色授权。
|
||||
*
|
||||
* @author pig
|
||||
* @date 2023-06-07 16:32:35
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/appTabbar")
|
||||
@Tag(description = "appTabbar", name = "底部导航")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class AppTabbarController {
|
||||
|
||||
private final AppTabbarService tabbarService;
|
||||
|
||||
private final AppRoleTabbarService roleTabbarService;
|
||||
|
||||
/**
|
||||
* 查询全部底部导航。
|
||||
* <p>
|
||||
* 后台维护页面使用完整列表;移动端运行时请走 {@code /app/index/config},
|
||||
* 由运行时接口按公开/角色授权规则过滤。
|
||||
*
|
||||
* @return 完整 Tabbar 列表
|
||||
*/
|
||||
@Operation(summary = "查询导航列表", description = "查询导航列表")
|
||||
@GetMapping("/list")
|
||||
public R list() {
|
||||
return R.ok(tabbarService.list(
|
||||
Wrappers.<AppTabbarEntity>lambdaQuery().orderByAsc(AppTabbarEntity::getSortOrder).orderByAsc(AppTabbarEntity::getId)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量保存底部导航。
|
||||
* <p>
|
||||
* 前端提交的是当前完整 Tabbar 列表。这里会删除数据库中已不存在的 Tabbar,
|
||||
* 并同步清理角色授权关系,避免 {@code app_role_tabbar} 残留无效 tabbar_id。
|
||||
*
|
||||
* @param tabbarEntityList 当前完整 Tabbar 配置
|
||||
* @return 保存结果
|
||||
*/
|
||||
@Operation(summary = "更新导航", description = "更新导航")
|
||||
@PutMapping
|
||||
public R update(@RequestBody List<AppTabbarEntity> tabbarEntityList) {
|
||||
tabbarEntityList.forEach(tabbar -> {
|
||||
if (tabbar.getLoginFlag() == null) {
|
||||
tabbar.setLoginFlag("1");
|
||||
}
|
||||
});
|
||||
// 删除不在新增范围的导航菜单
|
||||
List<Long> idList = tabbarService.list().stream().map(AppTabbarEntity::getId).toList();
|
||||
List<Long> newIdList = tabbarEntityList.stream().map(AppTabbarEntity::getId).toList();
|
||||
|
||||
// 计算需要删除的 ID 列表
|
||||
List<Long> idsToRemove = CollUtil.subtractToList(idList, newIdList);
|
||||
|
||||
// 如果有需要删除的菜单,则批量删除
|
||||
if (CollUtil.isNotEmpty(idsToRemove)) {
|
||||
tabbarService.removeBatchByIds(idsToRemove);
|
||||
roleTabbarService.remove(Wrappers.<AppRoleTabbar>lambdaQuery().in(AppRoleTabbar::getTabbarId, idsToRemove));
|
||||
}
|
||||
|
||||
return R.ok(tabbarService.saveOrUpdateBatch(tabbarEntityList));
|
||||
}
|
||||
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
package com.pig4cloud.pigx.app.mapper;
|
||||
|
||||
import com.pig4cloud.pigx.app.api.entity.AppArticleCategoryEntity;
|
||||
import com.pig4cloud.pigx.common.data.datascope.PigxBaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 文章分类 Mapper。
|
||||
*/
|
||||
@Mapper
|
||||
public interface AppArticleCategoryMapper extends PigxBaseMapper<AppArticleCategoryEntity> {
|
||||
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
package com.pig4cloud.pigx.app.mapper;
|
||||
|
||||
import com.pig4cloud.pigx.app.api.entity.AppArticleCollectEntity;
|
||||
import com.pig4cloud.pigx.common.data.datascope.PigxBaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 文章收藏 Mapper。
|
||||
*/
|
||||
@Mapper
|
||||
public interface AppArticleCollectMapper extends PigxBaseMapper<AppArticleCollectEntity> {
|
||||
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
package com.pig4cloud.pigx.app.mapper;
|
||||
|
||||
import com.pig4cloud.pigx.app.api.entity.AppArticleEntity;
|
||||
import com.pig4cloud.pigx.common.data.datascope.PigxBaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 文章资讯 Mapper。
|
||||
*/
|
||||
@Mapper
|
||||
public interface AppArticleMapper extends PigxBaseMapper<AppArticleEntity> {
|
||||
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package com.pig4cloud.pigx.app.mapper;
|
||||
|
||||
import com.pig4cloud.pigx.app.api.entity.AppContactsEntity;
|
||||
import com.pig4cloud.pigx.common.data.datascope.PigxBaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 通讯录 Mapper。
|
||||
* <p>
|
||||
* 继承 {@link PigxBaseMapper} 后可配合数据权限插件执行范围查询。
|
||||
*/
|
||||
@Mapper
|
||||
public interface AppContactsMapper extends PigxBaseMapper<AppContactsEntity> {
|
||||
|
||||
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
package com.pig4cloud.pigx.app.mapper;
|
||||
|
||||
import com.pig4cloud.pigx.app.api.entity.AppPageEntity;
|
||||
import com.pig4cloud.pigx.common.data.datascope.PigxBaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* App 装修页面 Mapper。
|
||||
*/
|
||||
@Mapper
|
||||
public interface AppPageMapper extends PigxBaseMapper<AppPageEntity> {
|
||||
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package com.pig4cloud.pigx.app.mapper;
|
||||
|
||||
import com.pig4cloud.pigx.app.api.entity.AppRoleTabbar;
|
||||
import com.pig4cloud.pigx.common.data.datascope.PigxBaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* App 角色底部导航 Mapper。
|
||||
*
|
||||
* @author lengleng
|
||||
* @date 2026-05-09
|
||||
*/
|
||||
@Mapper
|
||||
public interface AppRoleTabbarMapper extends PigxBaseMapper<AppRoleTabbar> {
|
||||
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
package com.pig4cloud.pigx.app.mapper;
|
||||
|
||||
import com.pig4cloud.pigx.app.api.entity.AppTabbarEntity;
|
||||
import com.pig4cloud.pigx.common.data.datascope.PigxBaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* App 底部导航 Mapper。
|
||||
*/
|
||||
@Mapper
|
||||
public interface AppTabbarMapper extends PigxBaseMapper<AppTabbarEntity> {
|
||||
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
package com.pig4cloud.pigx.app.service;
|
||||
|
||||
import com.baomidou.mybatisplus.spring.service.IService;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppArticleCategoryEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 文章分类基础服务。
|
||||
*/
|
||||
public interface AppArticleCategoryService extends IService<AppArticleCategoryEntity> {
|
||||
|
||||
/**
|
||||
* 按传入 ID 顺序调整文章分类,保留未选中记录在排序序列中的位置。
|
||||
* <p>
|
||||
* 以当前租户内未删除记录的排序值、主键升序为基准,仅重排选中记录占据的位置, 再将全部记录的排序值从 1 起连续重编号。
|
||||
* @param ids 按目标顺序排列的文章分类 ID;不可为 null 或空,不可包含 null、重复或不可用的 ID
|
||||
* @throws IllegalArgumentException ID 列表为空、包含 null 或重复值,或指定记录已删除、不属于当前租户 或不存在
|
||||
* @throws IllegalStateException 批量更新返回失败
|
||||
*/
|
||||
void sort(List<Long> ids);
|
||||
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
package com.pig4cloud.pigx.app.service;
|
||||
|
||||
import com.github.yulichang.base.MPJBaseService;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppArticleCollectEntity;
|
||||
|
||||
/**
|
||||
* 文章收藏服务。
|
||||
* <p>
|
||||
* 收藏记录以当前登录用户为维度保存,同一用户对同一文章只允许收藏一次。
|
||||
*/
|
||||
public interface AppArticleCollectService extends MPJBaseService<AppArticleCollectEntity> {
|
||||
|
||||
/**
|
||||
* 保存当前用户的文章收藏。
|
||||
*
|
||||
* @param appArticleCollect 收藏请求,需包含文章 ID
|
||||
* @return true=保存成功,false=已收藏或未保存
|
||||
*/
|
||||
Boolean saveArticleCollect(AppArticleCollectEntity appArticleCollect);
|
||||
|
||||
}
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
package com.pig4cloud.pigx.app.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.spring.service.IService;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppArticleEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 文章查询与排序服务,供管理端和 App 文章接口调用。
|
||||
*/
|
||||
public interface AppArticleService extends IService<AppArticleEntity> {
|
||||
|
||||
/**
|
||||
* 按传入 ID 顺序调整文章,保留未选中记录在排序序列中的位置。
|
||||
* <p>
|
||||
* 以当前租户内未删除记录的排序值、主键升序为基准,仅重排选中记录占据的位置, 再将全部记录的排序值从 1 起连续重编号。
|
||||
* @param ids 按目标顺序排列的文章 ID;不可为 null 或空,不可包含 null、重复或不可用的 ID
|
||||
* @throws IllegalArgumentException ID 列表为空、包含 null 或重复值,或指定记录已删除、不属于当前租户 或不存在
|
||||
* @throws IllegalStateException 批量更新返回失败
|
||||
*/
|
||||
void sort(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 获取文章并使阅读数+1
|
||||
* @param id id
|
||||
* @return
|
||||
*/
|
||||
AppArticleEntity getArticleAndIncrById(Long id, Long userId);
|
||||
|
||||
/**
|
||||
* 分页查询文章列表 包含分类名称
|
||||
* @param page 分页参数
|
||||
* @param appArticle 文章查询条件
|
||||
* @return
|
||||
*/
|
||||
Page pageAndCname(Page page, AppArticleEntity appArticle);
|
||||
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
package com.pig4cloud.pigx.app.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.spring.service.IService;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppContactsEntity;
|
||||
|
||||
/**
|
||||
* 应用联系人服务接口
|
||||
*
|
||||
* @author lengleng
|
||||
* @date 2025/05/29
|
||||
*/
|
||||
public interface AppContactsService extends IService<AppContactsEntity> {
|
||||
|
||||
/**
|
||||
* 根据应用联系人实体获取分页范围
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param contactsEntity 应用联系人实体
|
||||
* @return 分页范围对象
|
||||
*/
|
||||
Page pageScope(Page page, AppContactsEntity contactsEntity);
|
||||
}
|
||||
+49
@@ -0,0 +1,49 @@
|
||||
package com.pig4cloud.pigx.app.service;
|
||||
|
||||
import com.pig4cloud.pigx.app.api.entity.AppPageEntity;
|
||||
import com.pig4cloud.pigx.app.api.vo.AppDecorateVO;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* App 运行时页面服务。
|
||||
* <p>
|
||||
* 负责给移动端聚合首页、装修页、工作台和 Tabbar 配置;
|
||||
* 后台装修管理接口不直接走这里。
|
||||
*
|
||||
* @author lengleng
|
||||
* @date 2023/6/8
|
||||
*/
|
||||
public interface AppIndexService {
|
||||
|
||||
/**
|
||||
* 获取首页基础数据。
|
||||
*
|
||||
* @return 首页页面记录和资讯列表
|
||||
*/
|
||||
Map<String, Object> index();
|
||||
|
||||
/**
|
||||
* 获取运行时配置。
|
||||
*
|
||||
* @return 当前访问身份可见的 Tabbar 等配置
|
||||
*/
|
||||
Map<String, Object> config();
|
||||
|
||||
/**
|
||||
* 获取指定页面类型的装修页聚合数据。
|
||||
*
|
||||
* @param id 页面类型
|
||||
* @return 装修页聚合数据
|
||||
*/
|
||||
AppDecorateVO decorate(Integer id);
|
||||
|
||||
/**
|
||||
* 返回工作台页面实体对象。
|
||||
* <p>
|
||||
* 工作台按钮权限由 B 端 permission 控制,这里只返回页面装修数据。
|
||||
*
|
||||
* @return 工作台页面实体对象
|
||||
*/
|
||||
AppPageEntity workbench();
|
||||
}
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2026, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.app.service;
|
||||
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
|
||||
/**
|
||||
* @author lengleng
|
||||
* @date 2018/11/14
|
||||
*/
|
||||
public interface AppMobileService {
|
||||
|
||||
/**
|
||||
* 发送手机验证码
|
||||
* @param mobile mobile
|
||||
* @return code
|
||||
*/
|
||||
R<Boolean> sendSmsCode(String mobile);
|
||||
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package com.pig4cloud.pigx.app.service;
|
||||
|
||||
import com.baomidou.mybatisplus.spring.service.IService;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppPageEntity;
|
||||
|
||||
/**
|
||||
* App 装修页面基础服务。
|
||||
* <p>
|
||||
* 页面组件 JSON 保存在 {@link AppPageEntity#getPageData()},
|
||||
* 底部 Tabbar 不保存在页面 JSON 中。
|
||||
*/
|
||||
public interface AppPageService extends IService<AppPageEntity> {
|
||||
|
||||
}
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
package com.pig4cloud.pigx.app.service;
|
||||
|
||||
import com.baomidou.mybatisplus.spring.service.IService;
|
||||
import com.pig4cloud.pigx.app.api.dto.AppRoleTabbarDTO;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppRoleTabbar;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* App 角色底部导航服务,管理系统角色与 App 底部导航的授权关系。
|
||||
*
|
||||
* @author lengleng
|
||||
*/
|
||||
public interface AppRoleTabbarService extends IService<AppRoleTabbar> {
|
||||
|
||||
/**
|
||||
* 查询指定角色已授权的底部导航 ID 列表。
|
||||
*
|
||||
* @param roleId 系统角色 ID
|
||||
* @return 底部导航 ID 列表
|
||||
*/
|
||||
List<Long> listTabbarIdsByRoleId(Long roleId);
|
||||
|
||||
/**
|
||||
* 查询指定角色列表已授权的底部导航 ID 列表。
|
||||
*
|
||||
* @param roleIds 系统角色 ID 列表
|
||||
* @return 底部导航 ID 列表
|
||||
*/
|
||||
List<Long> listTabbarIdsByRoleIds(List<Long> roleIds);
|
||||
|
||||
/**
|
||||
* 保存角色底部导航授权。
|
||||
*
|
||||
* @param dto 角色底部导航配置
|
||||
* @return 操作结果
|
||||
*/
|
||||
Boolean saveRoleTabbars(AppRoleTabbarDTO dto);
|
||||
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
package com.pig4cloud.pigx.app.service;
|
||||
|
||||
import com.baomidou.mybatisplus.spring.service.IService;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppTabbarEntity;
|
||||
|
||||
/**
|
||||
* App 底部导航基础服务。
|
||||
*/
|
||||
public interface AppTabbarService extends IService<AppTabbarEntity> {
|
||||
|
||||
}
|
||||
+60
@@ -0,0 +1,60 @@
|
||||
package com.pig4cloud.pigx.app.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.spring.service.impl.ServiceImpl;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppArticleCategoryEntity;
|
||||
import com.pig4cloud.pigx.app.mapper.AppArticleCategoryMapper;
|
||||
import com.pig4cloud.pigx.app.service.AppArticleCategoryService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* 文章分类表
|
||||
*
|
||||
* @author pig
|
||||
* @date 2023-06-07 16:28:03
|
||||
*/
|
||||
@Service
|
||||
public class AppArticleCategoryServiceImpl extends ServiceImpl<AppArticleCategoryMapper, AppArticleCategoryEntity>
|
||||
implements AppArticleCategoryService {
|
||||
|
||||
/**
|
||||
* 按传入 ID 顺序调整文章分类,保留未选中记录在排序序列中的位置。
|
||||
* <p>
|
||||
* 以当前租户内未删除记录的排序值、主键升序为基准,仅重排选中记录占据的位置, 再将全部记录的排序值从 1 起连续重编号。
|
||||
* @param ids 按目标顺序排列的文章分类 ID;不可为 null 或空,不可包含 null、重复或不可用的 ID
|
||||
* @throws IllegalArgumentException ID 列表为空、包含 null 或重复值,或指定记录已删除、不属于当前租户 或不存在
|
||||
* @throws IllegalStateException 批量更新返回失败
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void sort(List<Long> ids) {
|
||||
Assert.notEmpty(ids, "排序记录不能为空");
|
||||
Set<Long> selected = new HashSet<>(ids);
|
||||
Assert.isTrue(!selected.contains(null) && selected.size() == ids.size(), "排序记录无效");
|
||||
// 锁定统一顺序,避免重复排序值和分页边界导致拖动后顺序丢失。
|
||||
List<AppArticleCategoryEntity> records = list(Wrappers.<AppArticleCategoryEntity>lambdaQuery()
|
||||
.orderByAsc(AppArticleCategoryEntity::getSort, AppArticleCategoryEntity::getId)
|
||||
.last("FOR UPDATE"));
|
||||
long matched = records.stream().filter(row -> selected.contains(row.getId())).count();
|
||||
Assert.isTrue(matched == ids.size(), "记录已变更,请刷新后重试");
|
||||
List<AppArticleCategoryEntity> updates = new ArrayList<>();
|
||||
int next = 0;
|
||||
for (int i = 0; i < records.size(); i++) {
|
||||
AppArticleCategoryEntity current = records.get(i);
|
||||
Long id = selected.contains(current.getId()) ? ids.get(next++) : current.getId();
|
||||
AppArticleCategoryEntity update = new AppArticleCategoryEntity();
|
||||
update.setId(id);
|
||||
update.setSort(i + 1);
|
||||
updates.add(update);
|
||||
}
|
||||
Assert.state(updateBatchById(updates), "排序保存失败");
|
||||
}
|
||||
|
||||
}
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
package com.pig4cloud.pigx.app.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.spring.service.impl.ServiceImpl;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppArticleCollectEntity;
|
||||
import com.pig4cloud.pigx.app.mapper.AppArticleCollectMapper;
|
||||
import com.pig4cloud.pigx.app.service.AppArticleCollectService;
|
||||
import com.pig4cloud.pigx.common.security.util.SecurityUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 文章收藏服务实现。
|
||||
* <p>
|
||||
* 收藏归属当前登录用户,保存前会校验同一用户是否已经收藏过同一文章。
|
||||
*
|
||||
* @author pig
|
||||
* @date 2023-06-16 14:33:41
|
||||
*/
|
||||
@Service
|
||||
public class AppArticleCollectServiceImpl extends ServiceImpl<AppArticleCollectMapper, AppArticleCollectEntity>
|
||||
implements AppArticleCollectService {
|
||||
|
||||
/**
|
||||
* 保存当前登录用户的文章收藏。
|
||||
*
|
||||
* @param appArticleCollect 收藏请求,业务上只需要文章 ID,用户 ID 由登录态写入
|
||||
* @return true=收藏成功,false=已经收藏
|
||||
*/
|
||||
@Override
|
||||
public Boolean saveArticleCollect(AppArticleCollectEntity appArticleCollect) {
|
||||
Long id = SecurityUtils.getUser().getId();
|
||||
appArticleCollect.setUserId(id);
|
||||
|
||||
if (baseMapper.exists(Wrappers.<AppArticleCollectEntity>lambdaQuery()
|
||||
.eq(AppArticleCollectEntity::getUserId, id)
|
||||
.eq(AppArticleCollectEntity::getArticleId, appArticleCollect.getArticleId()))) {
|
||||
return Boolean.FALSE;
|
||||
}
|
||||
|
||||
return this.save(appArticleCollect);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
+122
@@ -0,0 +1,122 @@
|
||||
package com.pig4cloud.pigx.app.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.spring.service.impl.ServiceImpl;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppArticleCategoryEntity;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppArticleCollectEntity;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppArticleEntity;
|
||||
import com.pig4cloud.pigx.app.mapper.AppArticleCollectMapper;
|
||||
import com.pig4cloud.pigx.app.mapper.AppArticleMapper;
|
||||
import com.pig4cloud.pigx.app.service.AppArticleService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 文章资讯服务实现。
|
||||
* <p>
|
||||
* 负责文章列表关联分类名称、文章详情访问次数递增,以及当前用户收藏状态补充。
|
||||
*
|
||||
* @author pig
|
||||
* @date 2023-06-07 16:32:35
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class AppArticleServiceImpl extends ServiceImpl<AppArticleMapper, AppArticleEntity>
|
||||
implements AppArticleService {
|
||||
|
||||
private final AppArticleCollectMapper collectMapper;
|
||||
|
||||
/**
|
||||
* 获取文章详情,并尝试将阅读数加 1。
|
||||
* <p>
|
||||
* 如果传入用户 ID,会额外查询该用户是否已收藏当前文章。 阅读数更新使用当前 visit 值作为条件,降低并发覆盖风险。
|
||||
* @param id 文章 ID
|
||||
* @param userId 当前用户 ID,可为空
|
||||
* @return 文章详情
|
||||
*/
|
||||
@Override
|
||||
public AppArticleEntity getArticleAndIncrById(Long id, Long userId) {
|
||||
AppArticleEntity appArticleEntity = baseMapper.selectById(id);
|
||||
// 登录用户访问详情时,补充当前用户是否已收藏该文章。
|
||||
if (Objects.nonNull(userId)) {
|
||||
boolean exists = collectMapper.exists(Wrappers.<AppArticleCollectEntity>lambdaQuery()//
|
||||
.eq(AppArticleCollectEntity::getArticleId, appArticleEntity.getId())//
|
||||
.eq(AppArticleCollectEntity::getUserId, userId));
|
||||
appArticleEntity.setCollect(exists);
|
||||
}
|
||||
|
||||
Integer nowVisit = appArticleEntity.getVisit();
|
||||
appArticleEntity.setVisit(nowVisit + 1);
|
||||
// 使用旧 visit 值作为更新条件,避免并发访问时直接覆盖最新阅读数。
|
||||
baseMapper.update(appArticleEntity,
|
||||
Wrappers.<AppArticleEntity>lambdaQuery()
|
||||
.eq(AppArticleEntity::getId, id)
|
||||
.eq(AppArticleEntity::getVisit, nowVisit));
|
||||
return appArticleEntity;
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询文章列表,并关联分类名称。
|
||||
* @param page 分页参数
|
||||
* @param appArticle 文章查询条件
|
||||
* @return 文章分页结果,包含分类名称 cname
|
||||
*/
|
||||
@Override
|
||||
public Page pageAndCname(Page page, AppArticleEntity appArticle) {
|
||||
MPJLambdaWrapper<AppArticleEntity> wrapper = new MPJLambdaWrapper<>();
|
||||
wrapper.selectAll(AppArticleEntity.class)
|
||||
.selectAs(AppArticleCategoryEntity::getName, AppArticleEntity.Fields.cname)
|
||||
.leftJoin(AppArticleCategoryEntity.class, AppArticleCategoryEntity::getId, AppArticleEntity::getCid)
|
||||
.like(StrUtil.isNotBlank(appArticle.getAuthor()), AppArticleEntity::getAuthor, appArticle.getAuthor())
|
||||
.like(StrUtil.isNotBlank(appArticle.getTitle()), AppArticleEntity::getTitle, appArticle.getTitle())
|
||||
.eq(Objects.nonNull(appArticle.getCid()), AppArticleEntity::getCid, appArticle.getCid())
|
||||
.orderByAsc(AppArticleEntity::getSort, AppArticleEntity::getId);
|
||||
return this.page(page, wrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 按传入 ID 顺序调整文章,保留未选中记录在排序序列中的位置。
|
||||
* <p>
|
||||
* 以当前租户内未删除记录的排序值、主键升序为基准,仅重排选中记录占据的位置, 再将全部记录的排序值从 1 起连续重编号。
|
||||
* @param ids 按目标顺序排列的文章 ID;不可为 null 或空,不可包含 null、重复或不可用的 ID
|
||||
* @throws IllegalArgumentException ID 列表为空、包含 null 或重复值,或指定记录已删除、不属于当前租户 或不存在
|
||||
* @throws IllegalStateException 批量更新返回失败
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void sort(List<Long> ids) {
|
||||
Assert.notEmpty(ids, "排序记录不能为空");
|
||||
Set<Long> selected = new HashSet<>(ids);
|
||||
Assert.isTrue(!selected.contains(null) && selected.size() == ids.size(), "排序记录无效");
|
||||
// 锁定统一顺序,避免重复排序值和分页边界导致拖动后顺序丢失。
|
||||
List<AppArticleEntity> records = list(Wrappers.<AppArticleEntity>lambdaQuery()
|
||||
.orderByAsc(AppArticleEntity::getSort, AppArticleEntity::getId)
|
||||
.last("FOR UPDATE"));
|
||||
long matched = records.stream().filter(row -> selected.contains(row.getId())).count();
|
||||
Assert.isTrue(matched == ids.size(), "记录已变更,请刷新后重试");
|
||||
List<AppArticleEntity> updates = new ArrayList<>();
|
||||
int next = 0;
|
||||
for (int i = 0; i < records.size(); i++) {
|
||||
AppArticleEntity current = records.get(i);
|
||||
Long id = selected.contains(current.getId()) ? ids.get(next++) : current.getId();
|
||||
AppArticleEntity update = new AppArticleEntity();
|
||||
update.setId(id);
|
||||
update.setSort(i + 1);
|
||||
updates.add(update);
|
||||
}
|
||||
Assert.state(updateBatchById(updates), "排序保存失败");
|
||||
}
|
||||
|
||||
}
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
package com.pig4cloud.pigx.app.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.spring.service.impl.ServiceImpl;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppContactsEntity;
|
||||
import com.pig4cloud.pigx.app.mapper.AppContactsMapper;
|
||||
import com.pig4cloud.pigx.app.service.AppContactsService;
|
||||
import com.pig4cloud.pigx.common.data.datascope.DataScope;
|
||||
import com.pig4cloud.pigx.common.security.util.SecurityUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 通讯录服务实现类
|
||||
* <p>
|
||||
* 通讯录列表会结合系统数据权限,只返回当前登录用户可见范围内的数据。
|
||||
*
|
||||
* @author lengleng
|
||||
* @date 2025/05/29
|
||||
*/
|
||||
@Service
|
||||
public class AppContactsServiceImpl extends ServiceImpl<AppContactsMapper, AppContactsEntity> implements AppContactsService {
|
||||
/**
|
||||
* 根据查询条件分页查询通讯录,并应用数据权限范围。
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param appContacts 应用联系人实体
|
||||
* @return 分页范围对象
|
||||
*/
|
||||
@Override
|
||||
public Page pageScope(Page page, AppContactsEntity appContacts) {
|
||||
LambdaQueryWrapper<AppContactsEntity> wrapper = Wrappers.lambdaQuery();
|
||||
wrapper.like(StrUtil.isNotBlank(appContacts.getContactName()), AppContactsEntity::getContactName, appContacts.getContactName());
|
||||
wrapper.like(StrUtil.isNotBlank(appContacts.getContactPhone()), AppContactsEntity::getContactPhone, appContacts.getContactPhone());
|
||||
|
||||
DataScope dataScope = new DataScope();
|
||||
dataScope.setUsername(SecurityUtils.getUser().getUsername());
|
||||
return baseMapper.selectPageByScope(page, wrapper, dataScope);
|
||||
}
|
||||
}
|
||||
+139
@@ -0,0 +1,139 @@
|
||||
package com.pig4cloud.pigx.app.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppArticleEntity;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppPageEntity;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppTabbarEntity;
|
||||
import com.pig4cloud.pigx.app.api.enums.PageTypeEnums;
|
||||
import com.pig4cloud.pigx.app.api.vo.AppDecorateVO;
|
||||
import com.pig4cloud.pigx.app.mapper.AppArticleMapper;
|
||||
import com.pig4cloud.pigx.app.mapper.AppPageMapper;
|
||||
import com.pig4cloud.pigx.app.mapper.AppTabbarMapper;
|
||||
import com.pig4cloud.pigx.app.service.AppIndexService;
|
||||
import com.pig4cloud.pigx.app.service.AppRoleTabbarService;
|
||||
import com.pig4cloud.pigx.common.core.constant.CommonConstants;
|
||||
import com.pig4cloud.pigx.common.security.util.SecurityUtils;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* App首页服务实现类
|
||||
* 实现AppIndexService接口,提供首页数据、导航栏配置以及页面配置等功能。
|
||||
* <p>
|
||||
* 该实现面向移动端运行时:Tabbar 会按公开/登录角色授权规则过滤,
|
||||
* 页面装修数据则保持原始组件 JSON,不在这里做页面组件级权限裁剪。
|
||||
*
|
||||
* @author lengleng
|
||||
* @date 2023/6/8
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class AppIndexServiceImpl implements AppIndexService {
|
||||
|
||||
private final AppTabbarMapper appTabbarMapper;
|
||||
|
||||
private final AppPageMapper appPageMapper;
|
||||
|
||||
private final AppArticleMapper appArticleMapper;
|
||||
|
||||
private final AppRoleTabbarService appRoleTabbarService;
|
||||
|
||||
/**
|
||||
* 获取商城首页基础数据。
|
||||
* <p>
|
||||
* 旧版首页接口返回首页装修页记录和资讯列表;新版装修页推荐使用 {@link #decorate(Integer)}。
|
||||
*
|
||||
* @return 首页页面数据和资讯列表
|
||||
*/
|
||||
@Override
|
||||
public Map<String, Object> index() {
|
||||
Map<String, Object> response = new LinkedHashMap<>();
|
||||
AppPageEntity appPageEntity = appPageMapper.selectOne(Wrappers.<AppPageEntity>lambdaQuery()
|
||||
.eq(AppPageEntity::getPageType, PageTypeEnums.HOME.getPageType())
|
||||
.orderByDesc(AppPageEntity::getCreateTime),
|
||||
false
|
||||
);
|
||||
|
||||
List<AppArticleEntity> articleList = appArticleMapper
|
||||
.selectList(Wrappers.<AppArticleEntity>lambdaQuery().orderByDesc(AppArticleEntity::getSort));
|
||||
response.put("pages", appPageEntity);
|
||||
response.put("article", articleList);
|
||||
return response;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取运行时配置。
|
||||
* <p>
|
||||
* 当前只包含 Tabbar,并按 {@link #listAuthorizedTabbar()} 的规则过滤。
|
||||
*
|
||||
* @return 运行时配置集合
|
||||
*/
|
||||
@Override
|
||||
public Map<String, Object> config() {
|
||||
Map<String, Object> response = new LinkedHashMap<>();
|
||||
response.put("tabbar", listAuthorizedTabbar());
|
||||
return response;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据页面类型获取最新装修页,并附加当前访问身份可见的 Tabbar。
|
||||
*
|
||||
* @param pageType 页面类型
|
||||
* @return 装修页聚合数据
|
||||
*/
|
||||
@Override
|
||||
public AppDecorateVO decorate(Integer pageType) {
|
||||
AppPageEntity appPageEntity = appPageMapper.selectOne(
|
||||
Wrappers.<AppPageEntity>lambdaQuery()
|
||||
.eq(AppPageEntity::getPageType, pageType)
|
||||
.orderByDesc(AppPageEntity::getCreateTime),
|
||||
false
|
||||
);
|
||||
return AppDecorateVO.of(appPageEntity, listAuthorizedTabbar());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取工作台页面数据。
|
||||
* <p>
|
||||
* 工作台内部按钮权限复用系统菜单 permission,这里不再读取 App 专属菜单授权。
|
||||
*
|
||||
* @return 工作台页面实体
|
||||
*/
|
||||
@Override
|
||||
public AppPageEntity workbench() {
|
||||
return appPageMapper.selectOne(
|
||||
Wrappers.<AppPageEntity>lambdaQuery()
|
||||
.eq(AppPageEntity::getPageType, PageTypeEnums.WORKBENCH.getPageType())
|
||||
.orderByDesc(AppPageEntity::getCreateTime),
|
||||
false
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询当前访问身份可见的 Tabbar。
|
||||
* <p>
|
||||
* 匿名访问只返回 {@code loginFlag=0} 的公开 Tabbar;登录访问从 token authorities
|
||||
* 解析角色 ID,再读取 {@code app_role_tabbar} 中授权的 Tabbar,避免跨库 join upms 的
|
||||
* {@code sys_user_role}。
|
||||
*
|
||||
* @return 当前可见的 Tabbar 列表
|
||||
*/
|
||||
private List<AppTabbarEntity> listAuthorizedTabbar() {
|
||||
List<Long> roleIds = SecurityUtils.getUser() == null ? List.of() : SecurityUtils.getRoleIds();
|
||||
List<Long> tabbarIds = appRoleTabbarService.listTabbarIdsByRoleIds(roleIds);
|
||||
return appTabbarMapper.selectList(Wrappers.<AppTabbarEntity>lambdaQuery()
|
||||
.and(wrapper -> {
|
||||
wrapper.eq(AppTabbarEntity::getLoginFlag, CommonConstants.STATUS_NORMAL);
|
||||
if (!tabbarIds.isEmpty()) {
|
||||
wrapper.or().in(AppTabbarEntity::getId, tabbarIds);
|
||||
}
|
||||
})
|
||||
.orderByAsc(AppTabbarEntity::getSortOrder)
|
||||
.orderByAsc(AppTabbarEntity::getId));
|
||||
}
|
||||
}
|
||||
+75
@@ -0,0 +1,75 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2026, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.app.service.impl;
|
||||
|
||||
import cn.hutool.core.util.RandomUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.toolkit.StringPool;
|
||||
import com.pig4cloud.pigx.app.api.enums.AppErrorCodes;
|
||||
import com.pig4cloud.pigx.app.service.AppMobileService;
|
||||
import com.pig4cloud.pigx.common.core.constant.CacheConstants;
|
||||
import com.pig4cloud.pigx.common.core.constant.SecurityConstants;
|
||||
import com.pig4cloud.pigx.common.core.constant.enums.LoginTypeEnum;
|
||||
import com.pig4cloud.pigx.common.core.util.MsgUtils;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.common.data.cache.RedisUtils;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* App 手机验证码服务实现。
|
||||
* <p>
|
||||
* 验证码按 {@code 验证码缓存前缀 + 登录类型 + 手机号} 写入 Redis,
|
||||
* 过期时间使用统一安全常量配置。
|
||||
*
|
||||
* @author lengleng
|
||||
* @date 2018/11/14
|
||||
* <p>
|
||||
* 手机登录相关业务实现
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class AppMobileServiceImpl implements AppMobileService {
|
||||
|
||||
/**
|
||||
* 发送手机验证码。
|
||||
* <p>
|
||||
* 如果验证码仍在有效期内,则拒绝重复发送。当前实现只生成并缓存验证码,
|
||||
* 后续接入短信网关时应在生成验证码后调用真实发送能力。
|
||||
*
|
||||
* @param mobile 手机号
|
||||
* @return true=生成成功,false=验证码未过期
|
||||
*/
|
||||
@Override
|
||||
public R<Boolean> sendSmsCode(String mobile) {
|
||||
String codeObj = RedisUtils.get(CacheConstants.SMS_CODE_KEY + LoginTypeEnum.APPSMS.getType() + StringPool.AT + mobile);
|
||||
|
||||
if (StrUtil.isNotBlank(codeObj)) {
|
||||
log.info("手机号验证码未过期:{},{}", mobile, codeObj);
|
||||
return R.ok(Boolean.FALSE, MsgUtils.getMessage(AppErrorCodes.APP_SMS_OFTEN));
|
||||
}
|
||||
|
||||
String code = RandomUtil.randomNumbers(Integer.parseInt(SecurityConstants.CODE_SIZE));
|
||||
log.debug("手机号生成验证码成功:{},{}", mobile, code);
|
||||
RedisUtils.set(CacheConstants.SMS_CODE_KEY + LoginTypeEnum.APPSMS.getType() + StringPool.AT + mobile, code, SecurityConstants.CODE_TIME);
|
||||
return R.ok(Boolean.TRUE);
|
||||
}
|
||||
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
package com.pig4cloud.pigx.app.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.spring.service.impl.ServiceImpl;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppPageEntity;
|
||||
import com.pig4cloud.pigx.app.mapper.AppPageMapper;
|
||||
import com.pig4cloud.pigx.app.service.AppPageService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 页面
|
||||
*
|
||||
* @author lengleng
|
||||
* @date 2023-06-08 11:19:23
|
||||
*/
|
||||
@Service
|
||||
public class AppPageServiceImpl extends ServiceImpl<AppPageMapper, AppPageEntity> implements AppPageService {
|
||||
|
||||
}
|
||||
+83
@@ -0,0 +1,83 @@
|
||||
package com.pig4cloud.pigx.app.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.spring.service.impl.ServiceImpl;
|
||||
import com.pig4cloud.pigx.app.api.dto.AppRoleTabbarDTO;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppRoleTabbar;
|
||||
import com.pig4cloud.pigx.app.mapper.AppRoleTabbarMapper;
|
||||
import com.pig4cloud.pigx.app.service.AppRoleTabbarService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* App 角色底部导航服务实现。
|
||||
* <p>
|
||||
* 只访问 app-server 本库的 {@code app_role_tabbar}。运行时角色来源由 Spring Security
|
||||
* token authorities 提供,避免 app-server 跨库 join upms 的用户角色表。
|
||||
*
|
||||
* @author lengleng
|
||||
* @date 2026-05-09
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class AppRoleTabbarServiceImpl extends ServiceImpl<AppRoleTabbarMapper, AppRoleTabbar>
|
||||
implements AppRoleTabbarService {
|
||||
|
||||
@Override
|
||||
public List<Long> listTabbarIdsByRoleId(Long roleId) {
|
||||
return roleId == null ? List.of() : listTabbarIdsByRoleIds(List.of(roleId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据多个角色查询可见 Tabbar。
|
||||
* <p>
|
||||
* 一个用户可能同时拥有多个角色,因此这里会先对角色 ID 去重,再对查询出的 Tabbar ID 去重。
|
||||
*
|
||||
* @param roleIds 系统角色 ID 列表
|
||||
* @return 去重后的 Tabbar ID 列表
|
||||
*/
|
||||
@Override
|
||||
public List<Long> listTabbarIdsByRoleIds(List<Long> roleIds) {
|
||||
if (CollUtil.isEmpty(roleIds)) {
|
||||
return List.of();
|
||||
}
|
||||
List<Long> distinctRoleIds = roleIds.stream().filter(Objects::nonNull).distinct().toList();
|
||||
if (CollUtil.isEmpty(distinctRoleIds)) {
|
||||
return List.of();
|
||||
}
|
||||
return this.list(Wrappers.<AppRoleTabbar>lambdaQuery().in(AppRoleTabbar::getRoleId, distinctRoleIds))
|
||||
.stream()
|
||||
.map(AppRoleTabbar::getTabbarId)
|
||||
.filter(Objects::nonNull)
|
||||
.distinct()
|
||||
.toList();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean saveRoleTabbars(AppRoleTabbarDTO dto) {
|
||||
// 覆盖保存:后台每次提交的是该角色完整授权结果,先删旧关系再写新关系。
|
||||
this.remove(Wrappers.<AppRoleTabbar>lambdaQuery().eq(AppRoleTabbar::getRoleId, dto.getRoleId()));
|
||||
if (CollUtil.isEmpty(dto.getTabbarIds())) {
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
List<AppRoleTabbar> records = dto.getTabbarIds()
|
||||
.stream()
|
||||
.filter(Objects::nonNull)
|
||||
.distinct()
|
||||
.map(tabbarId -> {
|
||||
AppRoleTabbar roleTabbar = new AppRoleTabbar();
|
||||
roleTabbar.setRoleId(dto.getRoleId());
|
||||
roleTabbar.setTabbarId(tabbarId);
|
||||
return roleTabbar;
|
||||
})
|
||||
.toList();
|
||||
return this.saveBatch(records);
|
||||
}
|
||||
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
package com.pig4cloud.pigx.app.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.spring.service.impl.ServiceImpl;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppTabbarEntity;
|
||||
import com.pig4cloud.pigx.app.mapper.AppTabbarMapper;
|
||||
import com.pig4cloud.pigx.app.service.AppTabbarService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 导航栏
|
||||
*
|
||||
* @author lengleng
|
||||
* @date 2023-06-08 11:18:46
|
||||
*/
|
||||
@Service
|
||||
public class AppTabbarServiceImpl extends ServiceImpl<AppTabbarMapper, AppTabbarEntity> implements AppTabbarService {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
server:
|
||||
port: 7060
|
||||
|
||||
spring:
|
||||
application:
|
||||
name: @artifactId@
|
||||
cloud:
|
||||
nacos:
|
||||
username: @nacos.username@
|
||||
password: @nacos.password@
|
||||
discovery:
|
||||
server-addr: ${NACOS_HOST:pigx-register}:${NACOS_PORT:8848}
|
||||
config:
|
||||
server-addr: ${spring.cloud.nacos.discovery.server-addr}
|
||||
config:
|
||||
import:
|
||||
- optional:nacos:application-@profiles.active@.yml
|
||||
- optional:nacos:${spring.application.name}-@profiles.active@.yml
|
||||
@@ -0,0 +1,70 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
小技巧: 在根pom里面设置统一存放路径,统一管理方便维护
|
||||
<properties>
|
||||
<log-path>/Users/lengleng</log-path>
|
||||
</properties>
|
||||
1. 其他模块加日志输出,直接copy本文件放在resources 目录即可
|
||||
2. 注意修改 <property name="${log-path}/log.path" value=""/> 的value模块
|
||||
-->
|
||||
<configuration debug="false" scan="false">
|
||||
<property name="log.path" value="logs/${project.artifactId}"/>
|
||||
<!-- 彩色日志格式 -->
|
||||
<property name="CONSOLE_LOG_PATTERN"
|
||||
value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/>
|
||||
<!-- 彩色日志依赖的渲染类 -->
|
||||
<conversionRule conversionWord="clr" class="org.springframework.boot.logging.logback.ColorConverter"/>
|
||||
<conversionRule conversionWord="wex"
|
||||
class="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter"/>
|
||||
<conversionRule conversionWord="wEx"
|
||||
class="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter"/>
|
||||
<!-- Console log output -->
|
||||
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>${CONSOLE_LOG_PATTERN}</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- Log file debug output -->
|
||||
<appender name="debug" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/debug.log</file>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
<fileNamePattern>${log.path}/%d{yyyy-MM, aux}/debug.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
|
||||
<maxFileSize>50MB</maxFileSize>
|
||||
<maxHistory>30</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>%date [%thread] %-5level [%logger{50}] %file:%line - %msg%n</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- Log file error output -->
|
||||
<appender name="error" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/error.log</file>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
<fileNamePattern>${log.path}/%d{yyyy-MM}/error.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
|
||||
<maxFileSize>50MB</maxFileSize>
|
||||
<maxHistory>30</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>%date [%thread] %-5level [%logger{50}] %file:%line - %msg%n</pattern>
|
||||
</encoder>
|
||||
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
|
||||
<level>ERROR</level>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<logger name="org.activiti.engine.impl.db" level="DEBUG">
|
||||
<appender-ref ref="debug"/>
|
||||
</logger>
|
||||
|
||||
<!--nacos 心跳 INFO 屏蔽-->
|
||||
<logger name="com.alibaba.nacos" level="OFF">
|
||||
<appender-ref ref="error"/>
|
||||
</logger>
|
||||
<!-- Level: FATAL 0 ERROR 3 WARN 4 INFO 6 DEBUG 7 -->
|
||||
<root level="INFO">
|
||||
<appender-ref ref="console"/>
|
||||
<appender-ref ref="debug"/>
|
||||
</root>
|
||||
</configuration>
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<mapper namespace="com.pig4cloud.pigx.app.mapper.AppArticleCategoryMapper">
|
||||
|
||||
<resultMap id="appArticleCategoryMap" type="com.pig4cloud.pigx.app.api.entity.AppArticleCategoryEntity">
|
||||
<id property="id" column="id"/>
|
||||
<result property="name" column="name"/>
|
||||
<result property="sort" column="sort"/>
|
||||
<result property="isShow" column="is_show"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
</resultMap>
|
||||
</mapper>
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<mapper namespace="com.pig4cloud.pigx.app.mapper.AppArticleCollectMapper">
|
||||
|
||||
<resultMap id="appArticleCollectMap" type="com.pig4cloud.pigx.app.api.entity.AppArticleCollectEntity">
|
||||
<id property="id" column="id"/>
|
||||
<result property="userId" column="user_id"/>
|
||||
<result property="articleId" column="article_id"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
</resultMap>
|
||||
</mapper>
|
||||
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<mapper namespace="com.pig4cloud.pigx.app.mapper.AppArticleMapper">
|
||||
|
||||
<resultMap id="appArticleMap" type="com.pig4cloud.pigx.app.api.entity.AppArticleEntity">
|
||||
<id property="id" column="id"/>
|
||||
<result property="cid" column="cid"/>
|
||||
<result property="title" column="title"/>
|
||||
<result property="intro" column="intro"/>
|
||||
<result property="summary" column="summary"/>
|
||||
<result property="image" column="image"/>
|
||||
<result property="content" column="content"/>
|
||||
<result property="author" column="author"/>
|
||||
<result property="visit" column="visit"/>
|
||||
<result property="sort" column="sort"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
</resultMap>
|
||||
</mapper>
|
||||
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<mapper namespace="com.pig4cloud.pigx.app.mapper.AppContactsMapper">
|
||||
|
||||
<resultMap id="appContactsMap" type="com.pig4cloud.pigx.app.api.entity.AppContactsEntity">
|
||||
<id property="id" column="id"/>
|
||||
<result property="contactName" column="contact_name"/>
|
||||
<result property="contactPhone" column="contact_phone"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="tenantId" column="tenant_id"/>
|
||||
</resultMap>
|
||||
</mapper>
|
||||
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<mapper namespace="com.pig4cloud.pigx.app.mapper.AppPageMapper">
|
||||
|
||||
<resultMap id="appPageMap" type="com.pig4cloud.pigx.app.api.entity.AppPageEntity">
|
||||
<id property="id" column="id"/>
|
||||
<result property="pageType" column="page_type"/>
|
||||
<result property="pageName" column="page_name"/>
|
||||
<result property="pageData" column="page_data"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
</resultMap>
|
||||
</mapper>
|
||||
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<mapper namespace="com.pig4cloud.pigx.app.mapper.AppTabbarMapper">
|
||||
|
||||
<resultMap id="appTabbarMap" type="com.pig4cloud.pigx.app.api.entity.AppTabbarEntity">
|
||||
<id property="id" column="id"/>
|
||||
<result property="name" column="name"/>
|
||||
<result property="selected" column="selected"/>
|
||||
<result property="unselected" column="unselected"/>
|
||||
<result property="link" column="link"/>
|
||||
<result property="sortOrder" column="sort_order"/>
|
||||
<result property="loginFlag" column="login_flag"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
</resultMap>
|
||||
</mapper>
|
||||
@@ -0,0 +1,21 @@
|
||||
<?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>
|
||||
|
||||
<parent>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx</artifactId>
|
||||
<version>6.2.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>pigx-app-server</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<!--项目子模块-->
|
||||
<modules>
|
||||
<module>pigx-app-server-api</module>
|
||||
<module>pigx-app-server-biz</module>
|
||||
</modules>
|
||||
</project>
|
||||
@@ -1,8 +1,12 @@
|
||||
FROM anapsix/alpine-java:8_server-jre_unlimited
|
||||
FROM registry.cn-hangzhou.aliyuncs.com/dockerhub_mirror/java:21-anolis
|
||||
|
||||
MAINTAINER wangiegie@gmail.com
|
||||
|
||||
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
|
||||
ENV TZ=Asia/Shanghai
|
||||
ENV LANG C.UTF-8
|
||||
ENV JAVA_OPTS="-Xms128m -Xmx256m -Djava.security.egd=file:/dev/./urandom"
|
||||
|
||||
RUN ln -sf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
||||
|
||||
RUN mkdir -p /pigx-auth
|
||||
|
||||
@@ -10,6 +14,6 @@ WORKDIR /pigx-auth
|
||||
|
||||
EXPOSE 3000
|
||||
|
||||
ADD ./pigx-auth/target/pigx-auth.jar ./
|
||||
ADD ./target/pigx-auth.jar ./
|
||||
|
||||
CMD sleep 30;java -Djava.security.egd=file:/dev/./urandom -jar pigx-auth.jar
|
||||
CMD sleep 120;java $JAVA_OPTS -jar pigx-auth.jar
|
||||
+115
-84
@@ -19,93 +19,124 @@
|
||||
-->
|
||||
|
||||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
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>
|
||||
<parent>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx</artifactId>
|
||||
<version>3.1.0</version>
|
||||
</parent>
|
||||
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>
|
||||
<parent>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx</artifactId>
|
||||
<version>6.2.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>pigx-auth</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<artifactId>pigx-auth</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<description>pigx 认证授权中心,基于 spring security oAuth2</description>
|
||||
<description>pigx 认证授权中心,基于 spring security oAuth2</description>
|
||||
|
||||
<dependencies>
|
||||
<!--注册中心客户端-->
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
</dependency>
|
||||
<!--配置中心客户端-->
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||
</dependency>
|
||||
<!--upms api、model 模块-->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-upms-api</artifactId>
|
||||
</dependency>
|
||||
<!--security-->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-security</artifactId>
|
||||
</dependency>
|
||||
<!--mysql 驱动-->
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
</dependency>
|
||||
<!--缓存操作-->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-data</artifactId>
|
||||
</dependency>
|
||||
<!--JDBC相关-->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-jdbc</artifactId>
|
||||
</dependency>
|
||||
<!-- druid 连接池 -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>druid-spring-boot-starter</artifactId>
|
||||
</dependency>
|
||||
<!--freemarker-->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-freemarker</artifactId>
|
||||
</dependency>
|
||||
<!--spring security 、oauth、jwt依赖-->
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-security</artifactId>
|
||||
</dependency>
|
||||
<!--web 模块-->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
<!--undertow容器-->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-undertow</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<dependencies>
|
||||
<!--注册中心客户端-->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
</dependency>
|
||||
<!--配置中心客户端-->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||
</dependency>
|
||||
<!--log-->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-log</artifactId>
|
||||
</dependency>
|
||||
<!--security-->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-security</artifactId>
|
||||
</dependency>
|
||||
<!--feign 依赖-->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-feign</artifactId>
|
||||
</dependency>
|
||||
<!--缓存操作-->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-data</artifactId>
|
||||
</dependency>
|
||||
<!--sentinel 依赖-->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-sentinel</artifactId>
|
||||
</dependency>
|
||||
<!--路由控制-->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-gray</artifactId>
|
||||
</dependency>
|
||||
<!--freemarker-->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-freemarker</artifactId>
|
||||
</dependency>
|
||||
<!-- 加签 -->
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-crypto</artifactId>
|
||||
</dependency>
|
||||
<!-- API加解密 -->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-encrypt-api</artifactId>
|
||||
</dependency>
|
||||
<!-- 验证码公共能力 -->
|
||||
<dependency>
|
||||
<groupId>io.springboot.plugin</groupId>
|
||||
<artifactId>captcha-core</artifactId>
|
||||
</dependency>
|
||||
<!-- 滑块验证码 -->
|
||||
<dependency>
|
||||
<groupId>io.github.pig-mesh.plugin</groupId>
|
||||
<artifactId>captcha-spring-boot-starter</artifactId>
|
||||
</dependency>
|
||||
<!--web 模块-->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-webmvc</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>com.spotify</groupId>
|
||||
<artifactId>docker-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>cloud</id>
|
||||
<activation>
|
||||
<activeByDefault>true</activeByDefault>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>io.fabric8</groupId>
|
||||
<artifactId>docker-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<skip>false</skip>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>boot</id>
|
||||
</profile>
|
||||
</profiles>
|
||||
|
||||
</project>
|
||||
@@ -1,39 +1,37 @@
|
||||
/*
|
||||
* Copyright (c) 2020 pig4cloud Authors. All Rights Reserved.
|
||||
*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.auth;
|
||||
|
||||
|
||||
import com.pig4cloud.pigx.common.security.annotation.EnablePigxFeignClients;
|
||||
import com.pig4cloud.pigx.common.feign.annotation.EnablePigxFeignClients;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.cloud.client.SpringCloudApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
||||
|
||||
/**
|
||||
* @author lengleng
|
||||
* @date 2018年06月21日
|
||||
* 认证授权中心
|
||||
* @date 2018年06月21日 认证授权中心
|
||||
*/
|
||||
@SpringCloudApplication
|
||||
@EnablePigxFeignClients
|
||||
@EnableDiscoveryClient
|
||||
@SpringBootApplication
|
||||
public class PigxAuthApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(PigxAuthApplication.class, args);
|
||||
}
|
||||
|
||||
}
|
||||
-132
@@ -1,132 +0,0 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.auth.config;
|
||||
|
||||
import com.pig4cloud.pigx.common.core.constant.SecurityConstants;
|
||||
import com.pig4cloud.pigx.common.data.tenant.TenantContextHolder;
|
||||
import com.pig4cloud.pigx.common.security.component.PigxWebResponseExceptionTranslator;
|
||||
import com.pig4cloud.pigx.common.security.service.PigxClientDetailsService;
|
||||
import com.pig4cloud.pigx.common.security.service.PigxUser;
|
||||
import com.pig4cloud.pigx.common.security.service.PigxUserDetailsService;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.SneakyThrows;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.data.redis.connection.RedisConnectionFactory;
|
||||
import org.springframework.http.HttpMethod;
|
||||
import org.springframework.security.authentication.AuthenticationManager;
|
||||
import org.springframework.security.oauth2.common.DefaultOAuth2AccessToken;
|
||||
import org.springframework.security.oauth2.config.annotation.configurers.ClientDetailsServiceConfigurer;
|
||||
import org.springframework.security.oauth2.config.annotation.web.configuration.AuthorizationServerConfigurerAdapter;
|
||||
import org.springframework.security.oauth2.config.annotation.web.configuration.EnableAuthorizationServer;
|
||||
import org.springframework.security.oauth2.config.annotation.web.configurers.AuthorizationServerEndpointsConfigurer;
|
||||
import org.springframework.security.oauth2.config.annotation.web.configurers.AuthorizationServerSecurityConfigurer;
|
||||
import org.springframework.security.oauth2.provider.OAuth2Authentication;
|
||||
import org.springframework.security.oauth2.provider.token.DefaultAuthenticationKeyGenerator;
|
||||
import org.springframework.security.oauth2.provider.token.TokenEnhancer;
|
||||
import org.springframework.security.oauth2.provider.token.TokenStore;
|
||||
import org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStore;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author lengleng
|
||||
* @date 2018/6/22
|
||||
* 认证服务器配置
|
||||
*/
|
||||
@Configuration
|
||||
@AllArgsConstructor
|
||||
@EnableAuthorizationServer
|
||||
public class AuthorizationServerConfig extends AuthorizationServerConfigurerAdapter {
|
||||
private final DataSource dataSource;
|
||||
private final PigxUserDetailsService pigxUserDetailsService;
|
||||
private final AuthenticationManager authenticationManagerBean;
|
||||
private final RedisConnectionFactory redisConnectionFactory;
|
||||
|
||||
@Override
|
||||
@SneakyThrows
|
||||
public void configure(ClientDetailsServiceConfigurer clients) {
|
||||
PigxClientDetailsService clientDetailsService = new PigxClientDetailsService(dataSource);
|
||||
clientDetailsService.setSelectClientDetailsSql(SecurityConstants.DEFAULT_SELECT_STATEMENT);
|
||||
clientDetailsService.setFindClientDetailsSql(SecurityConstants.DEFAULT_FIND_STATEMENT);
|
||||
clients.withClientDetails(clientDetailsService);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void configure(AuthorizationServerSecurityConfigurer oauthServer) {
|
||||
oauthServer
|
||||
.allowFormAuthenticationForClients()
|
||||
.checkTokenAccess("isAuthenticated()");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void configure(AuthorizationServerEndpointsConfigurer endpoints) {
|
||||
endpoints
|
||||
.allowedTokenEndpointRequestMethods(HttpMethod.GET, HttpMethod.POST)
|
||||
.tokenStore(tokenStore())
|
||||
.tokenEnhancer(tokenEnhancer())
|
||||
.userDetailsService(pigxUserDetailsService)
|
||||
.authenticationManager(authenticationManagerBean)
|
||||
.reuseRefreshTokens(false)
|
||||
.pathMapping("/oauth/confirm_access", "/token/confirm_access")
|
||||
.exceptionTranslator(new PigxWebResponseExceptionTranslator());
|
||||
}
|
||||
|
||||
|
||||
@Bean
|
||||
public TokenStore tokenStore() {
|
||||
RedisTokenStore tokenStore = new RedisTokenStore(redisConnectionFactory);
|
||||
tokenStore.setPrefix(SecurityConstants.PIGX_PREFIX + SecurityConstants.OAUTH_PREFIX);
|
||||
tokenStore.setAuthenticationKeyGenerator(new DefaultAuthenticationKeyGenerator() {
|
||||
@Override
|
||||
public String extractKey(OAuth2Authentication authentication) {
|
||||
return super.extractKey(authentication) + ":" + TenantContextHolder.getTenantId();
|
||||
}
|
||||
});
|
||||
return tokenStore;
|
||||
}
|
||||
|
||||
/**
|
||||
* token增强,客户端模式不增强。
|
||||
*
|
||||
* @return TokenEnhancer
|
||||
*/
|
||||
@Bean
|
||||
public TokenEnhancer tokenEnhancer() {
|
||||
return (accessToken, authentication) -> {
|
||||
if (SecurityConstants.CLIENT_CREDENTIALS
|
||||
.equals(authentication.getOAuth2Request().getGrantType())) {
|
||||
return accessToken;
|
||||
}
|
||||
|
||||
final Map<String, Object> additionalInfo = new HashMap<>(8);
|
||||
PigxUser pigxUser = (PigxUser) authentication.getUserAuthentication().getPrincipal();
|
||||
additionalInfo.put(SecurityConstants.DETAILS_USER_ID, pigxUser.getId());
|
||||
additionalInfo.put(SecurityConstants.DETAILS_USERNAME, pigxUser.getUsername());
|
||||
additionalInfo.put(SecurityConstants.DETAILS_DEPT_ID, pigxUser.getDeptId());
|
||||
additionalInfo.put(SecurityConstants.DETAILS_TENANT_ID, pigxUser.getTenantId());
|
||||
additionalInfo.put(SecurityConstants.DETAILS_LICENSE, SecurityConstants.PIGX_LICENSE);
|
||||
((DefaultOAuth2AccessToken) accessToken).setAdditionalInformation(additionalInfo);
|
||||
return accessToken;
|
||||
};
|
||||
}
|
||||
}
|
||||
+204
@@ -0,0 +1,204 @@
|
||||
/*
|
||||
* Copyright (c) 2020 pig4cloud Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.auth.config;
|
||||
|
||||
import com.pig4cloud.pigx.auth.support.CustomeOAuth2AccessTokenGenerator;
|
||||
import com.pig4cloud.pigx.auth.support.core.CustomeOAuth2TokenCustomizer;
|
||||
import com.pig4cloud.pigx.auth.support.core.FormIdentityLoginConfigurer;
|
||||
import com.pig4cloud.pigx.auth.support.core.PigxDaoAuthenticationProvider;
|
||||
import com.pig4cloud.pigx.auth.support.core.PigxOAuth2RefreshTokenAuthenticationConverter;
|
||||
import com.pig4cloud.pigx.auth.support.filter.FormLoginValidateCodeFilter;
|
||||
import com.pig4cloud.pigx.auth.support.filter.PasswordDecoderFilter;
|
||||
import com.pig4cloud.pigx.auth.support.filter.ValidateCodeFilter;
|
||||
import com.pig4cloud.pigx.auth.support.handler.PigxAuthenticationFailureEventHandler;
|
||||
import com.pig4cloud.pigx.auth.support.handler.PigxAuthenticationSuccessEventHandler;
|
||||
import com.pig4cloud.pigx.auth.support.password.OAuth2ResourceOwnerPasswordAuthenticationConverter;
|
||||
import com.pig4cloud.pigx.auth.support.password.OAuth2ResourceOwnerPasswordAuthenticationProvider;
|
||||
import com.pig4cloud.pigx.auth.support.sms.OAuth2ResourceOwnerSmsAuthenticationConverter;
|
||||
import com.pig4cloud.pigx.auth.support.sms.OAuth2ResourceOwnerSmsAuthenticationProvider;
|
||||
import com.pig4cloud.pigx.common.core.constant.SecurityConstants;
|
||||
import com.pig4cloud.pigx.common.security.component.PigxBootCorsProperties;
|
||||
import com.pig4cloud.pigx.common.security.handler.FormAuthenticationFailureHandler;
|
||||
import com.pig4cloud.pigx.common.security.handler.SsoLogoutSuccessHandler;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.core.Ordered;
|
||||
import org.springframework.core.annotation.Order;
|
||||
import org.springframework.security.authentication.AuthenticationManager;
|
||||
import org.springframework.security.config.Customizer;
|
||||
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
||||
import org.springframework.security.config.annotation.web.configurers.oauth2.server.authorization.OAuth2AuthorizationServerConfigurer;
|
||||
import org.springframework.security.oauth2.server.authorization.OAuth2AuthorizationService;
|
||||
import org.springframework.security.oauth2.server.authorization.settings.AuthorizationServerSettings;
|
||||
import org.springframework.security.oauth2.server.authorization.token.DelegatingOAuth2TokenGenerator;
|
||||
import org.springframework.security.oauth2.server.authorization.token.OAuth2RefreshTokenGenerator;
|
||||
import org.springframework.security.oauth2.server.authorization.token.OAuth2TokenGenerator;
|
||||
import org.springframework.security.oauth2.server.authorization.web.authentication.OAuth2AuthorizationCodeAuthenticationConverter;
|
||||
import org.springframework.security.oauth2.server.authorization.web.authentication.OAuth2ClientCredentialsAuthenticationConverter;
|
||||
import org.springframework.security.web.DefaultSecurityFilterChain;
|
||||
import org.springframework.security.web.SecurityFilterChain;
|
||||
import org.springframework.security.web.authentication.AuthenticationConverter;
|
||||
import org.springframework.security.web.authentication.AuthenticationFailureHandler;
|
||||
import org.springframework.security.web.authentication.DelegatingAuthenticationConverter;
|
||||
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
|
||||
import org.springframework.security.web.authentication.logout.LogoutSuccessHandler;
|
||||
import org.springframework.web.cors.CorsConfiguration;
|
||||
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @author lengleng
|
||||
* @date 2022/5/27
|
||||
* <p>
|
||||
* 认证服务器配置
|
||||
*/
|
||||
@Configuration
|
||||
@RequiredArgsConstructor
|
||||
public class AuthorizationServerConfiguration {
|
||||
|
||||
private final OAuth2AuthorizationService authorizationService;
|
||||
|
||||
private final PasswordDecoderFilter passwordDecoderFilter;
|
||||
|
||||
private final ValidateCodeFilter validateCodeFilter;
|
||||
|
||||
private final FormLoginValidateCodeFilter formLoginValidateCodeFilter;
|
||||
|
||||
private final PigxBootCorsProperties corsProperties;
|
||||
|
||||
@Bean
|
||||
@Order(Ordered.HIGHEST_PRECEDENCE)
|
||||
public SecurityFilterChain authorizationServerSecurityFilterChain(HttpSecurity http,
|
||||
PigxAuthenticationSuccessEventHandler successEventHandler,
|
||||
PigxAuthenticationFailureEventHandler failureEventHandler) throws Exception {
|
||||
// 配置授权服务器的安全策略,只有/oauth2/**的请求才会走如下的配置
|
||||
http.securityMatcher("/oauth2/**");
|
||||
OAuth2AuthorizationServerConfigurer authorizationServerConfigurer = new OAuth2AuthorizationServerConfigurer();
|
||||
|
||||
// 增加验证码过滤器
|
||||
http.addFilterBefore(validateCodeFilter, UsernamePasswordAuthenticationFilter.class);
|
||||
// 增加授权码登录表单验证码过滤器
|
||||
http.addFilterBefore(formLoginValidateCodeFilter, UsernamePasswordAuthenticationFilter.class);
|
||||
// 增加密码解密过滤器
|
||||
http.addFilterBefore(passwordDecoderFilter, UsernamePasswordAuthenticationFilter.class);
|
||||
|
||||
http.with(authorizationServerConfigurer.tokenEndpoint((tokenEndpoint) -> {// 个性化认证授权端点
|
||||
tokenEndpoint.accessTokenRequestConverter(accessTokenRequestConverter()) // 注入自定义的授权认证Converter
|
||||
.accessTokenResponseHandler(successEventHandler) // 登录成功处理器
|
||||
.errorResponseHandler(failureEventHandler);// 登录失败处理器
|
||||
}).clientAuthentication(oAuth2ClientAuthenticationConfigurer -> // 个性化客户端认证
|
||||
oAuth2ClientAuthenticationConfigurer.errorResponseHandler(failureEventHandler))// 处理客户端认证异常
|
||||
.authorizationEndpoint(authorizationEndpoint -> authorizationEndpoint// 授权码端点个性化confirm页面
|
||||
.consentPage(SecurityConstants.CUSTOM_CONSENT_PAGE_URI)), Customizer.withDefaults())
|
||||
.authorizeHttpRequests(authorizeRequests -> authorizeRequests.anyRequest().authenticated());
|
||||
|
||||
// 设置 Token 存储的策略
|
||||
http.with(authorizationServerConfigurer.authorizationService(authorizationService)// redis存储token的实现
|
||||
.authorizationServerSettings(
|
||||
AuthorizationServerSettings.builder().issuer(SecurityConstants.PIGX_LICENSE).build()),
|
||||
Customizer.withDefaults());
|
||||
|
||||
// 设置授权码模式登录页面
|
||||
http.with(new FormIdentityLoginConfigurer(), Customizer.withDefaults());
|
||||
|
||||
// 单体版本:根据配置启用CORS跨域支持(仅在security.cors.enabled=true时生效)
|
||||
if (Boolean.TRUE.equals(corsProperties.getEnabled())) {
|
||||
http.cors(cors -> cors.configurationSource(request -> {
|
||||
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
|
||||
CorsConfiguration corsConfiguration = new CorsConfiguration();
|
||||
corsProperties.getAllowedOriginPatterns().forEach(corsConfiguration::addAllowedOriginPattern);
|
||||
corsProperties.getAllowedHeaders().forEach(corsConfiguration::addAllowedHeader);
|
||||
corsProperties.getAllowedMethods().forEach(corsConfiguration::addAllowedMethod);
|
||||
corsConfiguration.setAllowCredentials(corsProperties.getAllowCredentials());
|
||||
source.registerCorsConfiguration(corsProperties.getPathPattern(), corsConfiguration);
|
||||
return corsConfiguration;
|
||||
}));
|
||||
}
|
||||
|
||||
DefaultSecurityFilterChain securityFilterChain = http.build();
|
||||
|
||||
// 注入自定义授权模式实现
|
||||
addCustomOAuth2GrantAuthenticationProvider(http);
|
||||
return securityFilterChain;
|
||||
}
|
||||
|
||||
/**
|
||||
* 令牌生成规则实现 </br>
|
||||
* client:username:uuid
|
||||
*
|
||||
* @return OAuth2TokenGenerator
|
||||
*/
|
||||
@Bean
|
||||
public OAuth2TokenGenerator oAuth2TokenGenerator() {
|
||||
CustomeOAuth2AccessTokenGenerator accessTokenGenerator = new CustomeOAuth2AccessTokenGenerator();
|
||||
// 注入Token 增加关联用户信息
|
||||
accessTokenGenerator.setAccessTokenCustomizer(new CustomeOAuth2TokenCustomizer());
|
||||
return new DelegatingOAuth2TokenGenerator(accessTokenGenerator, new OAuth2RefreshTokenGenerator());
|
||||
}
|
||||
|
||||
@Bean
|
||||
public AuthenticationFailureHandler authenticationFailureHandler() {
|
||||
return new FormAuthenticationFailureHandler();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public LogoutSuccessHandler logoutSuccessHandler() {
|
||||
return new SsoLogoutSuccessHandler();
|
||||
}
|
||||
|
||||
/**
|
||||
* request -> xToken 注入请求转换器
|
||||
*
|
||||
* @return DelegatingAuthenticationConverter
|
||||
*/
|
||||
private AuthenticationConverter accessTokenRequestConverter() {
|
||||
return new DelegatingAuthenticationConverter(
|
||||
Arrays.asList(new OAuth2ResourceOwnerPasswordAuthenticationConverter(),
|
||||
new OAuth2ResourceOwnerSmsAuthenticationConverter(),
|
||||
new PigxOAuth2RefreshTokenAuthenticationConverter(),
|
||||
new OAuth2ClientCredentialsAuthenticationConverter(),
|
||||
new OAuth2AuthorizationCodeAuthenticationConverter()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 注入授权模式实现提供方
|
||||
* <p>
|
||||
* 1. 密码模式 </br>
|
||||
* 2. 短信登录 </br>
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
private void addCustomOAuth2GrantAuthenticationProvider(HttpSecurity http) {
|
||||
AuthenticationManager authenticationManager = http.getSharedObject(AuthenticationManager.class);
|
||||
OAuth2AuthorizationService authorizationService = http.getSharedObject(OAuth2AuthorizationService.class);
|
||||
|
||||
OAuth2ResourceOwnerPasswordAuthenticationProvider resourceOwnerPasswordAuthenticationProvider = new OAuth2ResourceOwnerPasswordAuthenticationProvider(
|
||||
authenticationManager, authorizationService, oAuth2TokenGenerator());
|
||||
|
||||
OAuth2ResourceOwnerSmsAuthenticationProvider resourceOwnerSmsAuthenticationProvider = new OAuth2ResourceOwnerSmsAuthenticationProvider(
|
||||
authenticationManager, authorizationService, oAuth2TokenGenerator());
|
||||
|
||||
// 处理 UsernamePasswordAuthenticationToken
|
||||
http.authenticationProvider(new PigxDaoAuthenticationProvider());
|
||||
// 处理 OAuth2ResourceOwnerPasswordAuthenticationToken
|
||||
http.authenticationProvider(resourceOwnerPasswordAuthenticationProvider);
|
||||
// 处理 OAuth2ResourceOwnerSmsAuthenticationToken
|
||||
http.authenticationProvider(resourceOwnerSmsAuthenticationProvider);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,126 +0,0 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.auth.config;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.pig4cloud.pigx.common.security.handler.MobileLoginSuccessHandler;
|
||||
import com.pig4cloud.pigx.common.security.mobile.MobileSecurityConfigurer;
|
||||
import com.pig4cloud.pigx.common.security.service.PigxUserDetailsService;
|
||||
import lombok.SneakyThrows;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.context.annotation.Primary;
|
||||
import org.springframework.core.annotation.Order;
|
||||
import org.springframework.security.authentication.AuthenticationManager;
|
||||
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
||||
import org.springframework.security.config.annotation.web.builders.WebSecurity;
|
||||
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
|
||||
import org.springframework.security.crypto.factory.PasswordEncoderFactories;
|
||||
import org.springframework.security.crypto.password.PasswordEncoder;
|
||||
import org.springframework.security.oauth2.provider.ClientDetailsService;
|
||||
import org.springframework.security.oauth2.provider.token.AuthorizationServerTokenServices;
|
||||
import org.springframework.security.web.authentication.AuthenticationSuccessHandler;
|
||||
|
||||
/**
|
||||
* @author lengleng
|
||||
* @date 2018/6/22
|
||||
* 认证相关配置
|
||||
*/
|
||||
@Primary
|
||||
@Order(90)
|
||||
@Configuration
|
||||
public class WebSecurityConfigurer extends WebSecurityConfigurerAdapter {
|
||||
@Autowired
|
||||
private ObjectMapper objectMapper;
|
||||
@Autowired
|
||||
private ClientDetailsService clientDetailsService;
|
||||
@Autowired
|
||||
private PigxUserDetailsService userDetailsService;
|
||||
@Lazy
|
||||
@Autowired
|
||||
private AuthorizationServerTokenServices defaultAuthorizationServerTokenServices;
|
||||
|
||||
@Override
|
||||
@SneakyThrows
|
||||
protected void configure(HttpSecurity http) {
|
||||
http
|
||||
.formLogin()
|
||||
.loginPage("/token/login")
|
||||
.loginProcessingUrl("/token/form")
|
||||
.and()
|
||||
.authorizeRequests()
|
||||
.antMatchers(
|
||||
"/token/**",
|
||||
"/actuator/**",
|
||||
"/mobile/**").permitAll()
|
||||
.anyRequest().authenticated()
|
||||
.and().csrf().disable()
|
||||
.apply(mobileSecurityConfigurer());
|
||||
}
|
||||
|
||||
/**
|
||||
* 不拦截静态资源
|
||||
*
|
||||
* @param web
|
||||
*/
|
||||
@Override
|
||||
public void configure(WebSecurity web) {
|
||||
web.ignoring().antMatchers("/css/**");
|
||||
}
|
||||
|
||||
@Bean
|
||||
@Override
|
||||
@SneakyThrows
|
||||
public AuthenticationManager authenticationManagerBean() {
|
||||
return super.authenticationManagerBean();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public AuthenticationSuccessHandler mobileLoginSuccessHandler() {
|
||||
return MobileLoginSuccessHandler.builder()
|
||||
.objectMapper(objectMapper)
|
||||
.clientDetailsService(clientDetailsService)
|
||||
.passwordEncoder(passwordEncoder())
|
||||
.defaultAuthorizationServerTokenServices(defaultAuthorizationServerTokenServices).build();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public MobileSecurityConfigurer mobileSecurityConfigurer() {
|
||||
MobileSecurityConfigurer mobileSecurityConfigurer = new MobileSecurityConfigurer();
|
||||
mobileSecurityConfigurer.setMobileLoginSuccessHandler(mobileLoginSuccessHandler());
|
||||
mobileSecurityConfigurer.setUserDetailsService(userDetailsService);
|
||||
return mobileSecurityConfigurer;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* https://spring.io/blog/2017/11/01/spring-security-5-0-0-rc1-released#password-storage-updated
|
||||
* Encoded password does not look like BCrypt
|
||||
*
|
||||
* @return PasswordEncoder
|
||||
*/
|
||||
@Bean
|
||||
public PasswordEncoder passwordEncoder() {
|
||||
return PasswordEncoderFactories.createDelegatingPasswordEncoder();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
package com.pig4cloud.pigx.auth.endpoint;
|
||||
|
||||
import cn.hutool.core.lang.Validator;
|
||||
import com.anji.captcha.model.vo.CaptchaVO;
|
||||
import com.anji.captcha.service.CaptchaService;
|
||||
import com.pig4cloud.pigx.common.core.constant.CacheConstants;
|
||||
import com.pig4cloud.pigx.common.core.constant.SecurityConstants;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.common.core.util.SpringContextHolder;
|
||||
import com.pig4cloud.pigx.common.data.cache.RedisUtils;
|
||||
import io.springboot.captcha.ArithmeticCaptcha;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.SneakyThrows;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.awt.Color;
|
||||
|
||||
/**
|
||||
* 验证码相关的接口
|
||||
*
|
||||
* @author lengleng
|
||||
* @date 2022/6/27
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/code")
|
||||
@RequiredArgsConstructor
|
||||
public class ImageCodeEndpoint {
|
||||
|
||||
private static final Integer DEFAULT_IMAGE_WIDTH = 100;
|
||||
|
||||
private static final Integer DEFAULT_IMAGE_HEIGHT = 40;
|
||||
|
||||
/**
|
||||
* 创建图形验证码
|
||||
*/
|
||||
@SneakyThrows
|
||||
@GetMapping("/image")
|
||||
public void image(String randomStr, HttpServletResponse response) {
|
||||
ArithmeticCaptcha captcha = createCaptcha();
|
||||
|
||||
String result = captcha.text();
|
||||
|
||||
// 如果是手机号码,不存储下发验证码
|
||||
if (Validator.isMobile(randomStr)) {
|
||||
return;
|
||||
}
|
||||
|
||||
RedisUtils.set(CacheConstants.IMAGE_CODE_KEY + randomStr, result, SecurityConstants.CODE_TIME);
|
||||
// 转换流信息写出
|
||||
captcha.out(response.getOutputStream());
|
||||
}
|
||||
|
||||
static ArithmeticCaptcha createCaptcha() {
|
||||
return new ArithmeticCaptcha(DEFAULT_IMAGE_WIDTH, DEFAULT_IMAGE_HEIGHT) {
|
||||
@Override
|
||||
protected Color color() {
|
||||
return Color.BLACK;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* 行为 创建滑块图形验证码
|
||||
*/
|
||||
@SneakyThrows
|
||||
@GetMapping("/create")
|
||||
public R behavior(String captchaType) {
|
||||
CaptchaVO vo = new CaptchaVO();
|
||||
vo.setCaptchaType(captchaType);
|
||||
CaptchaService captchaService = SpringContextHolder.getBean(CaptchaService.class);
|
||||
return R.ok(captchaService.get(vo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 行为 创建滑块图形验证码
|
||||
*/
|
||||
@SneakyThrows
|
||||
@PostMapping("/check")
|
||||
public R check(HttpServletRequest request) {
|
||||
CaptchaVO vo = new CaptchaVO();
|
||||
vo.setPointJson(request.getParameter("pointJson"));
|
||||
vo.setToken(request.getParameter("token"));
|
||||
vo.setCaptchaType(request.getParameter("captchaType"));
|
||||
|
||||
CaptchaService captchaService = SpringContextHolder.getBean(CaptchaService.class);
|
||||
return R.ok(captchaService.check(vo));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,203 +1,306 @@
|
||||
/*
|
||||
* Copyright (c) 2020 pig4cloud Authors. All Rights Reserved.
|
||||
*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.auth.endpoint;
|
||||
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import cn.hutool.core.date.TemporalAccessorUtil;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysOauthClientDetails;
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysTenant;
|
||||
import com.pig4cloud.pigx.admin.api.feign.RemoteClientDetailsService;
|
||||
import com.pig4cloud.pigx.admin.api.feign.RemoteTenantService;
|
||||
import com.pig4cloud.pigx.admin.api.vo.TokenVO;
|
||||
import com.pig4cloud.pigx.auth.support.core.AuthCaptchaSupport;
|
||||
import com.pig4cloud.pigx.auth.support.core.AuthErrorCodes;
|
||||
import com.pig4cloud.pigx.common.core.constant.CacheConstants;
|
||||
import com.pig4cloud.pigx.common.core.constant.PaginationConstants;
|
||||
import com.pig4cloud.pigx.common.core.constant.CommonConstants;
|
||||
import com.pig4cloud.pigx.common.core.constant.SecurityConstants;
|
||||
import com.pig4cloud.pigx.common.core.util.MsgUtils;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.common.core.util.RetOps;
|
||||
import com.pig4cloud.pigx.common.core.util.SpringContextHolder;
|
||||
import com.pig4cloud.pigx.common.data.cache.RedisUtils;
|
||||
import com.pig4cloud.pigx.common.data.tenant.TenantContextHolder;
|
||||
import com.pig4cloud.pigx.common.security.annotation.Inner;
|
||||
import com.pig4cloud.pigx.common.security.util.SecurityUtils;
|
||||
import lombok.AllArgsConstructor;
|
||||
import com.pig4cloud.pigx.common.security.util.OAuth2ErrorCodesExpand;
|
||||
import com.pig4cloud.pigx.common.security.util.OAuthClientException;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.cache.CacheManager;
|
||||
import org.springframework.data.redis.core.ConvertingCursor;
|
||||
import org.springframework.data.redis.core.Cursor;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.data.redis.core.ScanOptions;
|
||||
import org.springframework.data.redis.serializer.JdkSerializationRedisSerializer;
|
||||
import org.springframework.data.redis.serializer.RedisSerializer;
|
||||
import org.springframework.data.redis.serializer.StringRedisSerializer;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.security.oauth2.common.OAuth2AccessToken;
|
||||
import org.springframework.security.oauth2.common.OAuth2RefreshToken;
|
||||
import org.springframework.security.oauth2.provider.AuthorizationRequest;
|
||||
import org.springframework.security.oauth2.provider.ClientDetails;
|
||||
import org.springframework.security.oauth2.provider.ClientDetailsService;
|
||||
import org.springframework.security.oauth2.provider.OAuth2Authentication;
|
||||
import org.springframework.security.oauth2.provider.token.TokenStore;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.server.ServletServerHttpResponse;
|
||||
import org.springframework.security.authentication.event.LogoutSuccessEvent;
|
||||
import org.springframework.security.oauth2.core.OAuth2AccessToken;
|
||||
import org.springframework.security.oauth2.core.OAuth2ErrorCodes;
|
||||
import org.springframework.security.oauth2.core.endpoint.OAuth2ParameterNames;
|
||||
import org.springframework.security.oauth2.server.authorization.OAuth2Authorization;
|
||||
import org.springframework.security.oauth2.server.authorization.OAuth2AuthorizationService;
|
||||
import org.springframework.security.oauth2.server.authorization.OAuth2TokenType;
|
||||
import org.springframework.security.web.authentication.preauth.PreAuthenticatedAuthenticationToken;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpSession;
|
||||
import java.util.ArrayList;
|
||||
import java.security.Principal;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author lengleng
|
||||
* @date 2018/6/24
|
||||
* 删除token端点
|
||||
* @date 2019/2/1 删除token端点
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/token")
|
||||
@RequestMapping
|
||||
@RequiredArgsConstructor
|
||||
public class PigxTokenEndpoint {
|
||||
private static final String PIGX_OAUTH_ACCESS = SecurityConstants.PIGX_PREFIX + SecurityConstants.OAUTH_PREFIX + "auth_to_access:";
|
||||
private final ClientDetailsService clientDetailsService;
|
||||
private final RedisTemplate pigxRedisTemplate;
|
||||
private final TokenStore tokenStore;
|
||||
private final CacheManager cacheManager;
|
||||
|
||||
/**
|
||||
* 认证页面
|
||||
*
|
||||
* @param modelAndView
|
||||
* @return ModelAndView
|
||||
*/
|
||||
@GetMapping("/login")
|
||||
public ModelAndView require(ModelAndView modelAndView) {
|
||||
modelAndView.setViewName("ftl/login");
|
||||
return modelAndView;
|
||||
}
|
||||
private static final String DEFAULT_FORM_CLIENT_ID = "pig";
|
||||
|
||||
/**
|
||||
* 确认授权页面
|
||||
*
|
||||
* @param request
|
||||
* @param session
|
||||
* @param modelAndView
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/confirm_access")
|
||||
public ModelAndView confirm(HttpServletRequest request, HttpSession session, ModelAndView modelAndView) {
|
||||
Map<String, Object> scopeList = (Map<String, Object>) request.getAttribute("scopes");
|
||||
modelAndView.addObject("scopeList", scopeList.keySet());
|
||||
private final OAuth2AuthorizationService authorizationService;
|
||||
|
||||
Object auth = session.getAttribute("authorizationRequest");
|
||||
if (auth != null) {
|
||||
AuthorizationRequest authorizationRequest = (AuthorizationRequest) auth;
|
||||
ClientDetails clientDetails = clientDetailsService.loadClientByClientId(authorizationRequest.getClientId());
|
||||
modelAndView.addObject("app", clientDetails.getAdditionalInformation());
|
||||
modelAndView.addObject("user", SecurityUtils.getUser());
|
||||
}
|
||||
private final RemoteClientDetailsService clientDetailsService;
|
||||
|
||||
modelAndView.setViewName("ftl/confirm");
|
||||
return modelAndView;
|
||||
}
|
||||
private final RemoteTenantService tenantService;
|
||||
|
||||
/**
|
||||
* 退出token
|
||||
*
|
||||
* @param authHeader Authorization
|
||||
*/
|
||||
@DeleteMapping("/logout")
|
||||
public R logout(@RequestHeader(value = HttpHeaders.AUTHORIZATION, required = false) String authHeader) {
|
||||
if (StrUtil.isBlank(authHeader)) {
|
||||
return R.ok(Boolean.FALSE, "退出失败,token 为空");
|
||||
}
|
||||
private final CacheManager cacheManager;
|
||||
|
||||
String tokenValue = authHeader.replace(OAuth2AccessToken.BEARER_TYPE, StrUtil.EMPTY).trim();
|
||||
OAuth2AccessToken accessToken = tokenStore.readAccessToken(tokenValue);
|
||||
if (accessToken == null || StrUtil.isBlank(accessToken.getValue())) {
|
||||
return R.ok(Boolean.TRUE, "退出失败,token 无效");
|
||||
}
|
||||
private final AuthCaptchaSupport authCaptchaSupport;
|
||||
|
||||
OAuth2Authentication auth2Authentication = tokenStore.readAuthentication(accessToken);
|
||||
// 清空用户信息
|
||||
cacheManager.getCache(CacheConstants.USER_DETAILS)
|
||||
.evict(auth2Authentication.getName());
|
||||
/**
|
||||
* 认证页面
|
||||
*
|
||||
* @param modelAndView
|
||||
* @param error 表单登录失败处理回调的错误信息
|
||||
* @return ModelAndView
|
||||
*/
|
||||
@GetMapping("/token/login")
|
||||
public ModelAndView require(ModelAndView modelAndView, @RequestParam(required = false) String error,
|
||||
HttpServletRequest request, HttpServletResponse response) {
|
||||
modelAndView.setViewName("ftl/login");
|
||||
// Note: XSS prevention is handled by FreeMarker template using ?html directive
|
||||
modelAndView.addObject("error", error);
|
||||
|
||||
// 清空access token
|
||||
tokenStore.removeAccessToken(accessToken);
|
||||
List<SysTenant> tenantList = Objects.requireNonNullElse(tenantService.list().getData(), List.of());
|
||||
String authClientId = StrUtil.blankToDefault(
|
||||
authCaptchaSupport.resolveAuthorizationClientId(request, response, true), DEFAULT_FORM_CLIENT_ID);
|
||||
Long selectedTenantId = resolveSelectedTenantId(request, response, tenantList);
|
||||
Map<String, Boolean> tenantCaptchaEnabledMap = buildTenantCaptchaEnabledMap(tenantList, authClientId);
|
||||
|
||||
// 清空 refresh token
|
||||
OAuth2RefreshToken refreshToken = accessToken.getRefreshToken();
|
||||
tokenStore.removeRefreshToken(refreshToken);
|
||||
return R.ok(Boolean.TRUE);
|
||||
}
|
||||
modelAndView.addObject("tenantList", tenantList);
|
||||
modelAndView.addObject("authClientId", authClientId);
|
||||
modelAndView.addObject("selectedTenantId", selectedTenantId);
|
||||
modelAndView.addObject("showCaptcha",
|
||||
Boolean.TRUE.equals(tenantCaptchaEnabledMap.get(String.valueOf(selectedTenantId))));
|
||||
modelAndView.addObject("tenantCaptchaEnabledJson", JSONUtil.toJsonStr(tenantCaptchaEnabledMap));
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
/**
|
||||
* 令牌管理调用
|
||||
*
|
||||
* @param token token
|
||||
* @return
|
||||
*/
|
||||
@Inner
|
||||
@DeleteMapping("/{token}")
|
||||
public R<Boolean> delToken(@PathVariable("token") String token) {
|
||||
OAuth2AccessToken oAuth2AccessToken = tokenStore.readAccessToken(token);
|
||||
tokenStore.removeAccessToken(oAuth2AccessToken);
|
||||
return new R<>();
|
||||
}
|
||||
/**
|
||||
* 授权码模式:确认页面
|
||||
*
|
||||
* @return {@link ModelAndView }
|
||||
*/
|
||||
@GetMapping("/oauth2/confirm_access")
|
||||
public ModelAndView confirm(Principal principal, ModelAndView modelAndView,
|
||||
@RequestParam(OAuth2ParameterNames.CLIENT_ID) String clientId,
|
||||
@RequestParam(OAuth2ParameterNames.SCOPE) String scope,
|
||||
@RequestParam(OAuth2ParameterNames.STATE) String state) {
|
||||
SysOauthClientDetails clientDetails = RetOps.of(clientDetailsService.getClientDetailsById(clientId))
|
||||
.getData()
|
||||
.orElseThrow(() -> new OAuthClientException(OAuth2ErrorCodes.INVALID_CLIENT,
|
||||
MsgUtils.getMessage(AuthErrorCodes.AUTH_CLIENT_INVALID)));
|
||||
|
||||
Set<String> authorizedScopes = StringUtils.commaDelimitedListToSet(clientDetails.getScope());
|
||||
// Note: XSS prevention is handled by FreeMarker template using ?html directive
|
||||
modelAndView.addObject("clientId", clientId);
|
||||
modelAndView.addObject("state", state);
|
||||
modelAndView.addObject("scopeList", authorizedScopes);
|
||||
modelAndView.addObject("principalName", principal.getName());
|
||||
modelAndView.setViewName("ftl/confirm");
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询token
|
||||
*
|
||||
* @param params 分页参数
|
||||
* @return
|
||||
*/
|
||||
@Inner
|
||||
@PostMapping("/page")
|
||||
public R<Page> tokenList(@RequestBody Map<String, Object> params) {
|
||||
//根据分页参数获取对应数据
|
||||
String key = String.format("%s*:%s", PIGX_OAUTH_ACCESS, TenantContextHolder.getTenantId());
|
||||
List<String> pages = findKeysForPage(key, MapUtil.getInt(params, PaginationConstants.CURRENT)
|
||||
, MapUtil.getInt(params, PaginationConstants.SIZE));
|
||||
/**
|
||||
* 注销并删除令牌
|
||||
*
|
||||
* @param authHeader auth 标头
|
||||
* @return {@link R }<{@link Boolean }>
|
||||
*/
|
||||
@DeleteMapping("/token/logout")
|
||||
public R<Boolean> logout(@RequestHeader(value = HttpHeaders.AUTHORIZATION, required = false) String authHeader) {
|
||||
if (StrUtil.isBlank(authHeader)) {
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
pigxRedisTemplate.setKeySerializer(new StringRedisSerializer());
|
||||
pigxRedisTemplate.setValueSerializer(new JdkSerializationRedisSerializer());
|
||||
Page result = new Page(MapUtil.getInt(params, PaginationConstants.CURRENT), MapUtil.getInt(params, PaginationConstants.SIZE));
|
||||
result.setRecords(pigxRedisTemplate.opsForValue().multiGet(pages));
|
||||
result.setTotal(Long.valueOf(pigxRedisTemplate.keys(key).size()));
|
||||
return R.ok(result);
|
||||
}
|
||||
String tokenValue = authHeader.replace(OAuth2AccessToken.TokenType.BEARER.getValue(), StrUtil.EMPTY).trim();
|
||||
return removeToken(tokenValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验token
|
||||
*
|
||||
* @param token 令牌
|
||||
* @return
|
||||
*/
|
||||
@SneakyThrows
|
||||
@GetMapping("/token/check_token")
|
||||
public R<OAuth2AccessToken> checkToken(String token, HttpServletResponse response, HttpServletRequest request) {
|
||||
ServletServerHttpResponse httpResponse = new ServletServerHttpResponse(response);
|
||||
|
||||
private List<String> findKeysForPage(String patternKey, int pageNum, int pageSize) {
|
||||
ScanOptions options = ScanOptions.scanOptions().match(patternKey).build();
|
||||
RedisSerializer<String> redisSerializer = (RedisSerializer<String>) pigxRedisTemplate.getKeySerializer();
|
||||
Cursor cursor = (Cursor) pigxRedisTemplate.executeWithStickyConnection(redisConnection -> new ConvertingCursor<>(redisConnection.scan(options), redisSerializer::deserialize));
|
||||
List<String> result = new ArrayList<>();
|
||||
int tmpIndex = 0;
|
||||
int startIndex = (pageNum - 1) * pageSize;
|
||||
int end = pageNum * pageSize;
|
||||
if (StrUtil.isBlank(token)) {
|
||||
httpResponse.setStatusCode(HttpStatus.UNAUTHORIZED);
|
||||
return R.failed(OAuth2ErrorCodesExpand.TOKEN_MISSING);
|
||||
}
|
||||
OAuth2Authorization authorization = authorizationService.findByToken(token, OAuth2TokenType.ACCESS_TOKEN);
|
||||
|
||||
// 如果令牌不存在 返回401
|
||||
if (authorization == null || authorization.getAccessToken() == null) {
|
||||
httpResponse.setStatusCode(HttpStatus.UNAUTHORIZED);
|
||||
return R.failed(OAuth2ErrorCodesExpand.INVALID_BEARER_TOKEN);
|
||||
}
|
||||
|
||||
// 获取令牌
|
||||
return R.ok(Objects.requireNonNull(authorization).getAccessToken().getToken());
|
||||
}
|
||||
|
||||
/**
|
||||
* 移除指定令牌
|
||||
*
|
||||
* @param token 需要移除的令牌
|
||||
* @return 操作结果,成功返回true
|
||||
*/
|
||||
@Inner
|
||||
@DeleteMapping("/token/remove/{token}")
|
||||
public R<Boolean> removeToken(@PathVariable("token") String token) {
|
||||
OAuth2Authorization authorization = authorizationService.findByToken(token, OAuth2TokenType.ACCESS_TOKEN);
|
||||
if (authorization == null) {
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
OAuth2Authorization.Token<OAuth2AccessToken> accessToken = authorization.getAccessToken();
|
||||
if (accessToken == null || StrUtil.isBlank(accessToken.getToken().getTokenValue())) {
|
||||
return R.ok();
|
||||
}
|
||||
// 清空用户信息
|
||||
cacheManager.getCache(CacheConstants.USER_DETAILS).evict(authorization.getPrincipalName());
|
||||
// 清空access token
|
||||
authorizationService.remove(authorization);
|
||||
// 处理自定义退出事件,保存相关日志
|
||||
SpringContextHolder.publishEvent(new LogoutSuccessEvent(new PreAuthenticatedAuthenticationToken(
|
||||
authorization.getPrincipalName(), authorization.getRegisteredClientId())));
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询token列表
|
||||
*
|
||||
* @param params 查询参数,包含分页参数(current,size)和可选用户名过滤条件(username)
|
||||
* @return 分页结果,包含token列表和总数
|
||||
*/
|
||||
@Inner
|
||||
@PostMapping("/token/page")
|
||||
public R<Page<TokenVO>> tokenList(@RequestBody Map<String, Object> params) {
|
||||
// 根据username参数获取对应数据
|
||||
String username = MapUtil.getStr(params, SecurityConstants.DETAILS_USERNAME);
|
||||
String usernameKey = String.format("token::username::%s*::*::%s::*", username,
|
||||
TenantContextHolder.getTenantId());
|
||||
String key = String.format("token::username::*::*::%s::*", TenantContextHolder.getTenantId());
|
||||
int current = MapUtil.getInt(params, CommonConstants.CURRENT);
|
||||
int size = MapUtil.getInt(params, CommonConstants.SIZE);
|
||||
|
||||
// 根据是否有username参数选择不同的查询key
|
||||
String searchKey = StrUtil.isNotBlank(username) ? usernameKey : key;
|
||||
Set<String> keys = RedisUtils.keys(searchKey);
|
||||
|
||||
// 分页处理
|
||||
List<String> pages = keys.stream().skip((current - 1) * size).limit(size).toList();
|
||||
Page<TokenVO> result = new Page(current, size);
|
||||
|
||||
List<TokenVO> tokenVoList = pages.stream().map(keyName -> {
|
||||
// 从key名称解析信息: token::username::{username}::{tenantId}::{tokenId}
|
||||
String[] keyParts = keyName.split("::");
|
||||
if (keyParts.length < 6) {
|
||||
return null;
|
||||
}
|
||||
|
||||
TokenVO tokenVo = new TokenVO();
|
||||
// 从key解析username
|
||||
String keyUsername = keyParts[2];
|
||||
tokenVo.setUsername(keyUsername);
|
||||
tokenVo.setClientId(keyParts[3]);
|
||||
tokenVo.setId(keyParts[5]);
|
||||
tokenVo.setAccessToken(keyParts[5]);
|
||||
// 获取TTL作为过期时间
|
||||
Long ttl = RedisUtils.getExpire(keyName);
|
||||
// TTL是秒数,转换为过期时间
|
||||
long expiresAtMillis = System.currentTimeMillis() + (ttl * 1000);
|
||||
String expiresAt = TemporalAccessorUtil.format(java.time.Instant.ofEpochMilli(expiresAtMillis),
|
||||
DatePattern.NORM_DATETIME_PATTERN);
|
||||
tokenVo.setExpiresAt(expiresAt);
|
||||
return tokenVo;
|
||||
}).filter(Objects::nonNull).toList();
|
||||
|
||||
result.setRecords(tokenVoList);
|
||||
result.setTotal(keys.size());
|
||||
return R.ok(result);
|
||||
}
|
||||
|
||||
@Inner
|
||||
@GetMapping("/token/query-token")
|
||||
public R queryToken(String token) {
|
||||
OAuth2Authorization authorization = authorizationService.findByToken(token, OAuth2TokenType.ACCESS_TOKEN);
|
||||
return R.ok(authorization);
|
||||
}
|
||||
|
||||
private Long resolveSelectedTenantId(HttpServletRequest request, HttpServletResponse response, List<SysTenant> tenantList) {
|
||||
String tenantId = authCaptchaSupport.resolveAuthorizationTenantId(request, response, true);
|
||||
if (StrUtil.isNotBlank(tenantId)) {
|
||||
try {
|
||||
return Long.parseLong(tenantId);
|
||||
} catch (NumberFormatException ignored) {
|
||||
// ignore invalid tenant id and fall back to the default selection below
|
||||
}
|
||||
}
|
||||
|
||||
if (!tenantList.isEmpty()) {
|
||||
return tenantList.get(0).getId();
|
||||
}
|
||||
|
||||
return CommonConstants.TENANT_ID_1;
|
||||
}
|
||||
|
||||
private Map<String, Boolean> buildTenantCaptchaEnabledMap(List<SysTenant> tenantList, String authClientId) {
|
||||
Map<String, Boolean> result = new LinkedHashMap<>(tenantList.size());
|
||||
for (SysTenant tenant : tenantList) {
|
||||
String tenantId = String.valueOf(tenant.getId());
|
||||
result.put(tenantId, authCaptchaSupport.isCaptchaEnabled(tenantId, authClientId));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
assert cursor != null;
|
||||
while (cursor.hasNext()) {
|
||||
if (tmpIndex >= startIndex && tmpIndex < end) {
|
||||
result.add(cursor.next().toString());
|
||||
tmpIndex++;
|
||||
continue;
|
||||
}
|
||||
if (tmpIndex >= end) {
|
||||
break;
|
||||
}
|
||||
tmpIndex++;
|
||||
cursor.next();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
-45
@@ -1,45 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.auth.handler;
|
||||
|
||||
import com.pig4cloud.pigx.common.security.handler.AbstractAuthenticationFailureEvenHandler;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.security.core.AuthenticationException;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @author lengleng
|
||||
* @date 2018/10/8
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class PigxAuthenticationFailureEvenHandler extends AbstractAuthenticationFailureEvenHandler {
|
||||
|
||||
/**
|
||||
* 处理登录失败方法
|
||||
* <p>
|
||||
*
|
||||
* @param authenticationException 登录的authentication 对象
|
||||
* @param authentication 登录的authenticationException 对象
|
||||
*/
|
||||
@Override
|
||||
public void handle(AuthenticationException authenticationException, Authentication authentication) {
|
||||
log.info("用户:{} 登录失败,异常:{}", authentication.getPrincipal(), authenticationException.getLocalizedMessage());
|
||||
}
|
||||
}
|
||||
-44
@@ -1,44 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.auth.handler;
|
||||
|
||||
import com.pig4cloud.pigx.common.security.handler.AbstractAuthenticationSuccessEventHandler;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @author lengleng
|
||||
* @date 2018/10/8
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class PigxAuthenticationSuccessEventHandler extends AbstractAuthenticationSuccessEventHandler {
|
||||
|
||||
/**
|
||||
* 处理登录成功方法
|
||||
* <p>
|
||||
* 获取到登录的authentication 对象
|
||||
*
|
||||
* @param authentication 登录对象
|
||||
*/
|
||||
@Override
|
||||
public void handle(Authentication authentication) {
|
||||
log.info("用户:{} 登录成功", authentication.getPrincipal());
|
||||
}
|
||||
}
|
||||
+119
@@ -0,0 +1,119 @@
|
||||
package com.pig4cloud.pigx.auth.support;
|
||||
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.security.oauth2.core.ClaimAccessor;
|
||||
import org.springframework.security.oauth2.core.OAuth2AccessToken;
|
||||
import org.springframework.security.oauth2.core.endpoint.OAuth2ParameterNames;
|
||||
import org.springframework.security.oauth2.server.authorization.OAuth2TokenType;
|
||||
import org.springframework.security.oauth2.server.authorization.client.RegisteredClient;
|
||||
import org.springframework.security.oauth2.server.authorization.settings.OAuth2TokenFormat;
|
||||
import org.springframework.security.oauth2.server.authorization.token.*;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.util.Collections;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author lengleng
|
||||
* @date 2022/5/29
|
||||
*/
|
||||
public class CustomeOAuth2AccessTokenGenerator implements OAuth2TokenGenerator<OAuth2AccessToken> {
|
||||
|
||||
private OAuth2TokenCustomizer<OAuth2TokenClaimsContext> accessTokenCustomizer;
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public OAuth2AccessToken generate(OAuth2TokenContext context) {
|
||||
if (!OAuth2TokenType.ACCESS_TOKEN.equals(context.getTokenType()) || !OAuth2TokenFormat.REFERENCE
|
||||
.equals(context.getRegisteredClient().getTokenSettings().getAccessTokenFormat())) {
|
||||
return null;
|
||||
}
|
||||
|
||||
String issuer = null;
|
||||
if (context.getAuthorizationServerContext() != null) {
|
||||
issuer = context.getAuthorizationServerContext().getIssuer();
|
||||
}
|
||||
RegisteredClient registeredClient = context.getRegisteredClient();
|
||||
|
||||
Instant issuedAt = Instant.now();
|
||||
Instant expiresAt = issuedAt.plus(registeredClient.getTokenSettings().getAccessTokenTimeToLive());
|
||||
|
||||
// @formatter:off
|
||||
OAuth2TokenClaimsSet.Builder claimsBuilder = OAuth2TokenClaimsSet.builder();
|
||||
if (StringUtils.hasText(issuer)) {
|
||||
claimsBuilder.issuer(issuer);
|
||||
}
|
||||
claimsBuilder
|
||||
.subject(context.getPrincipal().getName())
|
||||
.audience(Collections.singletonList(registeredClient.getClientId()))
|
||||
.issuedAt(issuedAt)
|
||||
.expiresAt(expiresAt)
|
||||
.notBefore(issuedAt)
|
||||
.id(UUID.randomUUID().toString());
|
||||
if (!CollectionUtils.isEmpty(context.getAuthorizedScopes())) {
|
||||
claimsBuilder.claim(OAuth2ParameterNames.SCOPE, context.getAuthorizedScopes());
|
||||
}
|
||||
// @formatter:on
|
||||
|
||||
if (this.accessTokenCustomizer != null) {
|
||||
// @formatter:off
|
||||
OAuth2TokenClaimsContext.Builder accessTokenContextBuilder = OAuth2TokenClaimsContext.with(claimsBuilder)
|
||||
.registeredClient(context.getRegisteredClient())
|
||||
.principal(context.getPrincipal())
|
||||
.authorizationServerContext(context.getAuthorizationServerContext())
|
||||
.authorizedScopes(context.getAuthorizedScopes())
|
||||
.tokenType(context.getTokenType())
|
||||
.authorizationGrantType(context.getAuthorizationGrantType());
|
||||
if (context.getAuthorization() != null) {
|
||||
accessTokenContextBuilder.authorization(context.getAuthorization());
|
||||
}
|
||||
if (context.getAuthorizationGrant() != null) {
|
||||
accessTokenContextBuilder.authorizationGrant(context.getAuthorizationGrant());
|
||||
}
|
||||
// @formatter:on
|
||||
|
||||
OAuth2TokenClaimsContext accessTokenContext = accessTokenContextBuilder.build();
|
||||
this.accessTokenCustomizer.customize(accessTokenContext);
|
||||
}
|
||||
|
||||
OAuth2TokenClaimsSet accessTokenClaimsSet = claimsBuilder.build();
|
||||
return new OAuth2AccessTokenClaims(OAuth2AccessToken.TokenType.BEARER, UUID.randomUUID().toString(),
|
||||
accessTokenClaimsSet.getIssuedAt(), accessTokenClaimsSet.getExpiresAt(), context.getAuthorizedScopes(),
|
||||
accessTokenClaimsSet.getClaims());
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the {@link OAuth2TokenCustomizer} that customizes the
|
||||
* {@link OAuth2TokenClaimsContext#getClaims() claims} for the
|
||||
* {@link OAuth2AccessToken}.
|
||||
* @param accessTokenCustomizer the {@link OAuth2TokenCustomizer} that customizes the
|
||||
* claims for the {@code OAuth2AccessToken}
|
||||
*/
|
||||
public void setAccessTokenCustomizer(OAuth2TokenCustomizer<OAuth2TokenClaimsContext> accessTokenCustomizer) {
|
||||
Assert.notNull(accessTokenCustomizer, "accessTokenCustomizer cannot be null");
|
||||
this.accessTokenCustomizer = accessTokenCustomizer;
|
||||
}
|
||||
|
||||
private static final class OAuth2AccessTokenClaims extends OAuth2AccessToken implements ClaimAccessor {
|
||||
|
||||
private final Map<String, Object> claims;
|
||||
|
||||
private OAuth2AccessTokenClaims(TokenType tokenType, String tokenValue, Instant issuedAt, Instant expiresAt,
|
||||
Set<String> scopes, Map<String, Object> claims) {
|
||||
super(tokenType, tokenValue, issuedAt, expiresAt, scopes);
|
||||
this.claims = claims;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getClaims() {
|
||||
return this.claims;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
+97
@@ -0,0 +1,97 @@
|
||||
package com.pig4cloud.pigx.auth.support.base;
|
||||
|
||||
import com.pig4cloud.pigx.common.security.util.OAuth2EndpointUtils;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.security.core.context.SecurityContextHolder;
|
||||
import org.springframework.security.oauth2.core.OAuth2ErrorCodes;
|
||||
import org.springframework.security.oauth2.core.endpoint.OAuth2ParameterNames;
|
||||
import org.springframework.security.web.authentication.AuthenticationConverter;
|
||||
import org.springframework.util.MultiValueMap;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author jumuning
|
||||
* @date 2022-06-02
|
||||
*
|
||||
* 自定义模式认证转换器
|
||||
*/
|
||||
public abstract class OAuth2ResourceOwnerBaseAuthenticationConverter<T extends OAuth2ResourceOwnerBaseAuthenticationToken>
|
||||
implements AuthenticationConverter {
|
||||
|
||||
/**
|
||||
* 是否支持此convert
|
||||
* @param grantType 授权类型
|
||||
* @return
|
||||
*/
|
||||
public abstract boolean support(String grantType);
|
||||
|
||||
/**
|
||||
* 校验参数
|
||||
* @param request 请求
|
||||
*/
|
||||
public void checkParams(HttpServletRequest request) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建具体类型的token
|
||||
* @param clientPrincipal
|
||||
* @param requestedScopes
|
||||
* @param additionalParameters
|
||||
* @return
|
||||
*/
|
||||
public abstract T buildToken(Authentication clientPrincipal, Set<String> requestedScopes,
|
||||
Map<String, Object> additionalParameters);
|
||||
|
||||
@Override
|
||||
public Authentication convert(HttpServletRequest request) {
|
||||
|
||||
// grant_type (REQUIRED)
|
||||
String grantType = request.getParameter(OAuth2ParameterNames.GRANT_TYPE);
|
||||
if (!support(grantType)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
MultiValueMap<String, String> parameters = OAuth2EndpointUtils.getParameters(request);
|
||||
// scope (OPTIONAL)
|
||||
String scope = parameters.getFirst(OAuth2ParameterNames.SCOPE);
|
||||
if (StringUtils.hasText(scope) && parameters.get(OAuth2ParameterNames.SCOPE).size() != 1) {
|
||||
OAuth2EndpointUtils.throwError(OAuth2ErrorCodes.INVALID_REQUEST, OAuth2ParameterNames.SCOPE,
|
||||
OAuth2EndpointUtils.ACCESS_TOKEN_REQUEST_ERROR_URI);
|
||||
}
|
||||
|
||||
Set<String> requestedScopes = null;
|
||||
if (StringUtils.hasText(scope)) {
|
||||
requestedScopes = new HashSet<>(Arrays.asList(StringUtils.delimitedListToStringArray(scope, " ")));
|
||||
}
|
||||
|
||||
// 校验个性化参数
|
||||
checkParams(request);
|
||||
|
||||
// 获取当前已经认证的客户端信息
|
||||
Authentication clientPrincipal = SecurityContextHolder.getContext().getAuthentication();
|
||||
if (clientPrincipal == null) {
|
||||
OAuth2EndpointUtils.throwError(OAuth2ErrorCodes.INVALID_REQUEST, OAuth2ErrorCodes.INVALID_CLIENT,
|
||||
OAuth2EndpointUtils.ACCESS_TOKEN_REQUEST_ERROR_URI);
|
||||
}
|
||||
|
||||
// 扩展信息
|
||||
Map<String, Object> additionalParameters = parameters.entrySet()
|
||||
.stream()
|
||||
.filter(e -> !e.getKey().equals(OAuth2ParameterNames.GRANT_TYPE)
|
||||
&& !e.getKey().equals(OAuth2ParameterNames.SCOPE))
|
||||
.collect(Collectors.toMap(Map.Entry::getKey, e -> e.getValue().get(0)));
|
||||
|
||||
// 创建token
|
||||
return buildToken(clientPrincipal, requestedScopes, additionalParameters);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
+328
@@ -0,0 +1,328 @@
|
||||
package com.pig4cloud.pigx.auth.support.base;
|
||||
|
||||
import cn.hutool.core.util.BooleanUtil;
|
||||
import cn.hutool.extra.spring.SpringUtil;
|
||||
import com.pig4cloud.pigx.common.core.constant.CommonConstants;
|
||||
import com.pig4cloud.pigx.common.security.service.PigxRedisOAuth2AuthorizationService;
|
||||
import com.pig4cloud.pigx.common.security.util.OAuth2ErrorCodesExpand;
|
||||
import com.pig4cloud.pigx.common.security.util.ScopeException;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.springframework.context.support.MessageSourceAccessor;
|
||||
import org.springframework.security.authentication.*;
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.security.core.AuthenticationException;
|
||||
import org.springframework.security.core.userdetails.UsernameNotFoundException;
|
||||
import org.springframework.security.oauth2.core.*;
|
||||
import org.springframework.security.oauth2.server.authorization.OAuth2Authorization;
|
||||
import org.springframework.security.oauth2.server.authorization.OAuth2AuthorizationService;
|
||||
import org.springframework.security.oauth2.server.authorization.OAuth2TokenType;
|
||||
import org.springframework.security.oauth2.server.authorization.authentication.OAuth2AccessTokenAuthenticationToken;
|
||||
import org.springframework.security.oauth2.server.authorization.authentication.OAuth2ClientAuthenticationToken;
|
||||
import org.springframework.security.oauth2.server.authorization.client.RegisteredClient;
|
||||
import org.springframework.security.oauth2.server.authorization.context.AuthorizationServerContextHolder;
|
||||
import org.springframework.security.oauth2.server.authorization.token.DefaultOAuth2TokenContext;
|
||||
import org.springframework.security.oauth2.server.authorization.token.OAuth2TokenContext;
|
||||
import org.springframework.security.oauth2.server.authorization.token.OAuth2TokenGenerator;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.security.Principal;
|
||||
import java.time.Instant;
|
||||
import java.util.*;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
/**
|
||||
* @author jumuning
|
||||
* @description 处理自定义授权
|
||||
*/
|
||||
@Slf4j
|
||||
public abstract class OAuth2ResourceOwnerBaseAuthenticationProvider<T extends OAuth2ResourceOwnerBaseAuthenticationToken>
|
||||
implements AuthenticationProvider {
|
||||
|
||||
private static final Logger LOGGER = LogManager.getLogger(OAuth2ResourceOwnerBaseAuthenticationProvider.class);
|
||||
|
||||
private static final String ERROR_URI = "https://datatracker.ietf.org/doc/html/rfc6749#section-4.1.2.1";
|
||||
|
||||
private final OAuth2AuthorizationService authorizationService;
|
||||
|
||||
private final OAuth2TokenGenerator<? extends OAuth2Token> tokenGenerator;
|
||||
|
||||
private final AuthenticationManager authenticationManager;
|
||||
|
||||
private final MessageSourceAccessor messages;
|
||||
|
||||
@Deprecated
|
||||
private Supplier<String> refreshTokenGenerator;
|
||||
|
||||
/**
|
||||
* 构造一个基于资源所有者密码模式的OAuth2认证提供者
|
||||
*
|
||||
* @param authenticationManager 认证管理器
|
||||
* @param authorizationService 授权服务
|
||||
* @param tokenGenerator 令牌生成器
|
||||
* @since 0.2.3
|
||||
*/
|
||||
public OAuth2ResourceOwnerBaseAuthenticationProvider(AuthenticationManager authenticationManager,
|
||||
OAuth2AuthorizationService authorizationService,
|
||||
OAuth2TokenGenerator<? extends OAuth2Token> tokenGenerator) {
|
||||
Assert.notNull(authorizationService, "authorizationService cannot be null");
|
||||
Assert.notNull(tokenGenerator, "tokenGenerator cannot be null");
|
||||
this.authenticationManager = authenticationManager;
|
||||
this.authorizationService = authorizationService;
|
||||
this.tokenGenerator = tokenGenerator;
|
||||
|
||||
// 国际化配置
|
||||
this.messages = new MessageSourceAccessor(SpringUtil.getBean("securityMessageSource"), Locale.CHINA);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public void setRefreshTokenGenerator(Supplier<String> refreshTokenGenerator) {
|
||||
Assert.notNull(refreshTokenGenerator, "refreshTokenGenerator cannot be null");
|
||||
this.refreshTokenGenerator = refreshTokenGenerator;
|
||||
}
|
||||
|
||||
public abstract UsernamePasswordAuthenticationToken buildToken(Map<String, Object> reqParameters);
|
||||
|
||||
/**
|
||||
* 判断当前provider是否支持指定的令牌类型
|
||||
*
|
||||
* @param authentication 要检查的令牌类型
|
||||
* @return 如果支持则返回true,否则返回false
|
||||
*/
|
||||
@Override
|
||||
public abstract boolean supports(Class<?> authentication);
|
||||
|
||||
/**
|
||||
* 检查当前请求客户端是否支持此模式
|
||||
*
|
||||
* @param registeredClient 已注册的客户端
|
||||
*/
|
||||
public abstract void checkClient(RegisteredClient registeredClient);
|
||||
|
||||
/**
|
||||
* 执行身份验证,与{@link AuthenticationManager#authenticate(Authentication)}具有相同契约
|
||||
*
|
||||
* @param authentication 身份验证请求对象
|
||||
* @return 包含凭据的完全认证对象,如果无法支持传入的认证对象则可能返回null
|
||||
* @throws AuthenticationException 身份验证失败时抛出
|
||||
* @throws OAuth2AuthenticationException 当scope无效或服务器错误时抛出
|
||||
*/
|
||||
@Override
|
||||
public Authentication authenticate(Authentication authentication) throws AuthenticationException {
|
||||
|
||||
T resouceOwnerBaseAuthentication = (T) authentication;
|
||||
|
||||
OAuth2ClientAuthenticationToken clientPrincipal = getAuthenticatedClientElseThrowInvalidClient(
|
||||
resouceOwnerBaseAuthentication);
|
||||
|
||||
RegisteredClient registeredClient = clientPrincipal.getRegisteredClient();
|
||||
checkClient(registeredClient);
|
||||
|
||||
Set<String> authorizedScopes;
|
||||
// Default to configured scopes
|
||||
if (!CollectionUtils.isEmpty(resouceOwnerBaseAuthentication.getScopes())) {
|
||||
for (String requestedScope : resouceOwnerBaseAuthentication.getScopes()) {
|
||||
if (!registeredClient.getScopes().contains(requestedScope)) {
|
||||
throw new OAuth2AuthenticationException(OAuth2ErrorCodes.INVALID_SCOPE);
|
||||
}
|
||||
}
|
||||
authorizedScopes = new LinkedHashSet<>(resouceOwnerBaseAuthentication.getScopes());
|
||||
} else {
|
||||
authorizedScopes = new LinkedHashSet<>();
|
||||
}
|
||||
|
||||
Map<String, Object> reqParameters = resouceOwnerBaseAuthentication.getAdditionalParameters();
|
||||
try {
|
||||
|
||||
UsernamePasswordAuthenticationToken usernamePasswordAuthenticationToken = buildToken(reqParameters);
|
||||
|
||||
LOGGER.debug("got usernamePasswordAuthenticationToken=" + usernamePasswordAuthenticationToken);
|
||||
|
||||
Authentication usernamePasswordAuthentication = authenticationManager
|
||||
.authenticate(usernamePasswordAuthenticationToken);
|
||||
|
||||
Object onlineQuantity = registeredClient.getClientSettings()
|
||||
.getSettings()
|
||||
.get(CommonConstants.ONLINE_QUANTITY);
|
||||
// 没有设置并发控制走原有逻辑生成 || 设置同时在线为 true
|
||||
if (Objects.isNull(onlineQuantity) || BooleanUtil.toBooleanObject((String) onlineQuantity)) {
|
||||
return generatAuthenticationToken(resouceOwnerBaseAuthentication, clientPrincipal, registeredClient,
|
||||
authorizedScopes, usernamePasswordAuthentication);
|
||||
}
|
||||
|
||||
// 不允许同时在线,删除原有username 关联的所有token
|
||||
PigxRedisOAuth2AuthorizationService redisOAuth2AuthorizationService = (PigxRedisOAuth2AuthorizationService) this.authorizationService;
|
||||
redisOAuth2AuthorizationService.removeByUsername(usernamePasswordAuthentication);
|
||||
|
||||
return generatAuthenticationToken(resouceOwnerBaseAuthentication, clientPrincipal, registeredClient,
|
||||
authorizedScopes, usernamePasswordAuthentication);
|
||||
|
||||
} catch (AuthenticationException ex) {
|
||||
throw oAuth2AuthenticationException(authentication, ex);
|
||||
} catch (Exception e) {
|
||||
log.error("登录异常:", e);
|
||||
throw new OAuth2AuthenticationException(new OAuth2Error(OAuth2ErrorCodes.SERVER_ERROR));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成OAuth2访问令牌认证令牌
|
||||
*
|
||||
* @param resouceOwnerBaseAuthentication 资源所有者基础认证信息
|
||||
* @param clientPrincipal 客户端认证主体
|
||||
* @param registeredClient 已注册的客户端信息
|
||||
* @param authorizedScopes 授权范围集合
|
||||
* @param usernamePasswordAuthentication 用户名密码认证信息
|
||||
* @return OAuth2访问令牌认证令牌
|
||||
* @throws OAuth2AuthenticationException 令牌生成失败时抛出异常
|
||||
*/
|
||||
@NotNull
|
||||
private OAuth2AccessTokenAuthenticationToken generatAuthenticationToken(T resouceOwnerBaseAuthentication,
|
||||
OAuth2ClientAuthenticationToken clientPrincipal, RegisteredClient registeredClient,
|
||||
Set<String> authorizedScopes, Authentication usernamePasswordAuthentication) {
|
||||
// @formatter:off
|
||||
DefaultOAuth2TokenContext.Builder tokenContextBuilder = DefaultOAuth2TokenContext.builder()
|
||||
.registeredClient(registeredClient)
|
||||
.principal(usernamePasswordAuthentication)
|
||||
.authorizationServerContext(AuthorizationServerContextHolder.getContext())
|
||||
.authorizedScopes(authorizedScopes)
|
||||
.authorizationGrantType(resouceOwnerBaseAuthentication.getAuthorizationGrantType())
|
||||
.authorizationGrant(resouceOwnerBaseAuthentication);
|
||||
// @formatter:on
|
||||
|
||||
OAuth2Authorization.Builder authorizationBuilder = OAuth2Authorization.withRegisteredClient(registeredClient)
|
||||
.principalName(usernamePasswordAuthentication.getName())
|
||||
.authorizationGrantType(resouceOwnerBaseAuthentication.getAuthorizationGrantType())
|
||||
// 0.4.0 新增的方法
|
||||
.authorizedScopes(authorizedScopes);
|
||||
|
||||
// ----- Access token -----
|
||||
OAuth2TokenContext tokenContext = tokenContextBuilder.tokenType(OAuth2TokenType.ACCESS_TOKEN).build();
|
||||
OAuth2Token generatedAccessToken = this.tokenGenerator.generate(tokenContext);
|
||||
if (generatedAccessToken == null) {
|
||||
OAuth2Error error = new OAuth2Error(OAuth2ErrorCodes.SERVER_ERROR,
|
||||
"The token generator failed to generate the access token.", ERROR_URI);
|
||||
throw new OAuth2AuthenticationException(error);
|
||||
}
|
||||
OAuth2AccessToken accessToken = new OAuth2AccessToken(OAuth2AccessToken.TokenType.BEARER,
|
||||
generatedAccessToken.getTokenValue(), generatedAccessToken.getIssuedAt(),
|
||||
generatedAccessToken.getExpiresAt(), tokenContext.getAuthorizedScopes());
|
||||
if (generatedAccessToken instanceof ClaimAccessor) {
|
||||
authorizationBuilder.id(accessToken.getTokenValue())
|
||||
.token(accessToken,
|
||||
(metadata) -> metadata.put(OAuth2Authorization.Token.CLAIMS_METADATA_NAME,
|
||||
((ClaimAccessor) generatedAccessToken).getClaims()))
|
||||
// 0.4.0 新增的方法
|
||||
.authorizedScopes(authorizedScopes)
|
||||
.attribute(Principal.class.getName(), usernamePasswordAuthentication);
|
||||
} else {
|
||||
authorizationBuilder.id(accessToken.getTokenValue()).accessToken(accessToken);
|
||||
}
|
||||
|
||||
// ----- Refresh token -----
|
||||
OAuth2RefreshToken refreshToken = null;
|
||||
if (registeredClient.getAuthorizationGrantTypes().contains(AuthorizationGrantType.REFRESH_TOKEN) &&
|
||||
// Do not issue refresh token to public client
|
||||
!clientPrincipal.getClientAuthenticationMethod().equals(ClientAuthenticationMethod.NONE)) {
|
||||
|
||||
if (this.refreshTokenGenerator != null) {
|
||||
Instant issuedAt = Instant.now();
|
||||
Instant expiresAt = issuedAt.plus(registeredClient.getTokenSettings().getRefreshTokenTimeToLive());
|
||||
refreshToken = new OAuth2RefreshToken(this.refreshTokenGenerator.get(), issuedAt, expiresAt);
|
||||
} else {
|
||||
tokenContext = tokenContextBuilder.tokenType(OAuth2TokenType.REFRESH_TOKEN).build();
|
||||
OAuth2Token generatedRefreshToken = this.tokenGenerator.generate(tokenContext);
|
||||
if (!(generatedRefreshToken instanceof OAuth2RefreshToken)) {
|
||||
OAuth2Error error = new OAuth2Error(OAuth2ErrorCodes.SERVER_ERROR,
|
||||
"The token generator failed to generate the refresh token.", ERROR_URI);
|
||||
throw new OAuth2AuthenticationException(error);
|
||||
}
|
||||
refreshToken = (OAuth2RefreshToken) generatedRefreshToken;
|
||||
}
|
||||
authorizationBuilder.refreshToken(refreshToken);
|
||||
}
|
||||
|
||||
OAuth2Authorization authorization = authorizationBuilder.build();
|
||||
|
||||
this.authorizationService.save(authorization);
|
||||
|
||||
LOGGER.debug("returning OAuth2AccessTokenAuthenticationToken");
|
||||
|
||||
return new OAuth2AccessTokenAuthenticationToken(registeredClient, clientPrincipal, accessToken, refreshToken,
|
||||
Objects.requireNonNull(authorization.getAccessToken().getClaims()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 登录异常转换为oauth2异常
|
||||
* @param authentication 身份验证
|
||||
* @param authenticationException 身份验证异常
|
||||
* @return {@link OAuth2AuthenticationException}
|
||||
*/
|
||||
private OAuth2AuthenticationException oAuth2AuthenticationException(Authentication authentication,
|
||||
AuthenticationException authenticationException) {
|
||||
|
||||
// OAuth2AuthenticationException 直接返回
|
||||
if (authenticationException instanceof OAuth2AuthenticationException) {
|
||||
return (OAuth2AuthenticationException) authenticationException;
|
||||
}
|
||||
|
||||
if (authenticationException instanceof UsernameNotFoundException) {
|
||||
return new OAuth2AuthenticationException(new OAuth2Error(OAuth2ErrorCodesExpand.USERNAME_NOT_FOUND,
|
||||
this.messages.getMessage("JdbcDaoImpl.notFound", new Object[]{authentication.getName()},
|
||||
"Username {0} not found"),
|
||||
""));
|
||||
}
|
||||
if (authenticationException instanceof BadCredentialsException) {
|
||||
return new OAuth2AuthenticationException(
|
||||
new OAuth2Error(OAuth2ErrorCodesExpand.BAD_CREDENTIALS, this.messages.getMessage(
|
||||
"AbstractUserDetailsAuthenticationProvider.badCredentials", "Bad credentials"), ""));
|
||||
}
|
||||
if (authenticationException instanceof LockedException) {
|
||||
return new OAuth2AuthenticationException(new OAuth2Error(OAuth2ErrorCodesExpand.USER_LOCKED, this.messages
|
||||
.getMessage("AbstractUserDetailsAuthenticationProvider.locked", "User account is locked"), ""));
|
||||
}
|
||||
if (authenticationException instanceof DisabledException) {
|
||||
return new OAuth2AuthenticationException(new OAuth2Error(OAuth2ErrorCodesExpand.USER_DISABLE,
|
||||
this.messages.getMessage("AbstractUserDetailsAuthenticationProvider.disabled", "User is disabled"),
|
||||
""));
|
||||
}
|
||||
if (authenticationException instanceof AccountExpiredException) {
|
||||
return new OAuth2AuthenticationException(new OAuth2Error(OAuth2ErrorCodesExpand.USER_EXPIRED, this.messages
|
||||
.getMessage("AbstractUserDetailsAuthenticationProvider.expired", "User account has expired"), ""));
|
||||
}
|
||||
if (authenticationException instanceof CredentialsExpiredException) {
|
||||
return new OAuth2AuthenticationException(new OAuth2Error(OAuth2ErrorCodesExpand.CREDENTIALS_EXPIRED,
|
||||
this.messages.getMessage("AbstractUserDetailsAuthenticationProvider.credentialsExpired",
|
||||
"User credentials have expired"),
|
||||
""));
|
||||
}
|
||||
if (authenticationException instanceof ScopeException) {
|
||||
return new OAuth2AuthenticationException(new OAuth2Error(OAuth2ErrorCodes.INVALID_SCOPE,
|
||||
this.messages.getMessage("AbstractAccessDecisionManager.accessDenied", "invalid_scope"), ""));
|
||||
}
|
||||
|
||||
log.error(authenticationException.getLocalizedMessage());
|
||||
return new OAuth2AuthenticationException(new OAuth2Error(OAuth2ErrorCodes.SERVER_ERROR),
|
||||
authenticationException.getLocalizedMessage(), authenticationException);
|
||||
}
|
||||
|
||||
private OAuth2ClientAuthenticationToken getAuthenticatedClientElseThrowInvalidClient(
|
||||
Authentication authentication) {
|
||||
|
||||
OAuth2ClientAuthenticationToken clientPrincipal = null;
|
||||
|
||||
if (OAuth2ClientAuthenticationToken.class.isAssignableFrom(authentication.getPrincipal().getClass())) {
|
||||
clientPrincipal = (OAuth2ClientAuthenticationToken) authentication.getPrincipal();
|
||||
}
|
||||
|
||||
if (clientPrincipal != null && clientPrincipal.isAuthenticated()) {
|
||||
return clientPrincipal;
|
||||
}
|
||||
|
||||
throw new OAuth2AuthenticationException(OAuth2ErrorCodes.INVALID_CLIENT);
|
||||
}
|
||||
|
||||
}
|
||||
+61
@@ -0,0 +1,61 @@
|
||||
package com.pig4cloud.pigx.auth.support.base;
|
||||
|
||||
import lombok.Getter;
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.security.authentication.AbstractAuthenticationToken;
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.security.oauth2.core.AuthorizationGrantType;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @author lengleng
|
||||
* @date 2022/6/2
|
||||
*
|
||||
* 自定义授权模式抽象
|
||||
*/
|
||||
public abstract class OAuth2ResourceOwnerBaseAuthenticationToken extends AbstractAuthenticationToken {
|
||||
|
||||
@Getter
|
||||
private final AuthorizationGrantType authorizationGrantType;
|
||||
|
||||
@Getter
|
||||
private final Authentication clientPrincipal;
|
||||
|
||||
@Getter
|
||||
private final Set<String> scopes;
|
||||
|
||||
@Getter
|
||||
private final Map<String, Object> additionalParameters;
|
||||
|
||||
public OAuth2ResourceOwnerBaseAuthenticationToken(AuthorizationGrantType authorizationGrantType,
|
||||
Authentication clientPrincipal, @Nullable Set<String> scopes,
|
||||
@Nullable Map<String, Object> additionalParameters) {
|
||||
super(Collections.emptyList());
|
||||
Assert.notNull(authorizationGrantType, "authorizationGrantType cannot be null");
|
||||
Assert.notNull(clientPrincipal, "clientPrincipal cannot be null");
|
||||
this.authorizationGrantType = authorizationGrantType;
|
||||
this.clientPrincipal = clientPrincipal;
|
||||
this.scopes = Collections.unmodifiableSet(scopes != null ? new HashSet<>(scopes) : Collections.emptySet());
|
||||
this.additionalParameters = Collections.unmodifiableMap(
|
||||
additionalParameters != null ? new HashMap<>(additionalParameters) : Collections.emptyMap());
|
||||
}
|
||||
|
||||
/**
|
||||
* 扩展模式一般不需要密码
|
||||
*/
|
||||
@Override
|
||||
public Object getCredentials() {
|
||||
return "";
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户名
|
||||
*/
|
||||
@Override
|
||||
public Object getPrincipal() {
|
||||
return this.clientPrincipal;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
/**
|
||||
* 自定义认证模式接入的抽象实现
|
||||
*/
|
||||
package com.pig4cloud.pigx.auth.support.base;
|
||||
@@ -0,0 +1,172 @@
|
||||
package com.pig4cloud.pigx.auth.support.core;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.pig4cloud.pigx.common.core.constant.CacheConstants;
|
||||
import com.pig4cloud.pigx.common.core.constant.CommonConstants;
|
||||
import com.pig4cloud.pigx.common.core.constant.enums.CaptchaFlagTypeEnum;
|
||||
import com.pig4cloud.pigx.common.core.constant.enums.LoginTypeEnum;
|
||||
import com.pig4cloud.pigx.common.core.exception.ValidateCodeException;
|
||||
import com.pig4cloud.pigx.common.core.util.MsgUtils;
|
||||
import com.pig4cloud.pigx.common.data.cache.RedisUtils;
|
||||
import com.pig4cloud.pigx.common.security.captcha.CaptchaResult;
|
||||
import com.pig4cloud.pigx.common.security.captcha.CaptchaValidator;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.security.oauth2.core.endpoint.OAuth2ParameterNames;
|
||||
import org.springframework.security.web.savedrequest.HttpSessionRequestCache;
|
||||
import org.springframework.security.web.savedrequest.RequestCache;
|
||||
import org.springframework.security.web.savedrequest.SavedRequest;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 授权登录验证码支持组件
|
||||
*
|
||||
* <p>
|
||||
* 统一处理验证码开关判断、授权客户端解析和验证码校验,避免在多个过滤器和控制器中重复实现。
|
||||
* </p>
|
||||
*
|
||||
* @author pig
|
||||
* @date 2026-03-20
|
||||
*/
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class AuthCaptchaSupport {
|
||||
|
||||
private final RequestCache requestCache = new HttpSessionRequestCache();
|
||||
|
||||
private final CaptchaValidator captchaValidator;
|
||||
|
||||
/**
|
||||
* 解析当前授权流程中的真实客户端ID
|
||||
*
|
||||
* @param request 当前请求
|
||||
* @param response 当前响应
|
||||
* @param includeCurrentRequestId 是否优先读取当前请求参数中的 client_id
|
||||
* @return 授权客户端ID
|
||||
*/
|
||||
public String resolveAuthorizationClientId(HttpServletRequest request, HttpServletResponse response,
|
||||
boolean includeCurrentRequestId) {
|
||||
return resolveAuthorizationParameter(request, response, OAuth2ParameterNames.CLIENT_ID, includeCurrentRequestId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 解析当前授权流程中的租户ID
|
||||
*
|
||||
* @param request 当前请求
|
||||
* @param response 当前响应
|
||||
* @param includeCurrentRequestId 是否优先读取当前请求参数中的租户ID
|
||||
* @return 租户ID
|
||||
*/
|
||||
public String resolveAuthorizationTenantId(HttpServletRequest request, HttpServletResponse response,
|
||||
boolean includeCurrentRequestId) {
|
||||
return resolveAuthorizationParameter(request, response, CommonConstants.TENANT_ID, includeCurrentRequestId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断客户端是否开启验证码
|
||||
*
|
||||
* @param tenantId 租户ID
|
||||
* @param clientId 客户端ID
|
||||
* @return true 开启验证码
|
||||
*/
|
||||
public boolean isCaptchaEnabled(String tenantId, String clientId) {
|
||||
if (StrUtil.isBlank(clientId)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
String finalTenantId = StrUtil.isBlank(tenantId) ? CommonConstants.TENANT_ID_1.toString() : tenantId;
|
||||
String key = String.format("%s:%s:%s", finalTenantId, CacheConstants.CLIENT_FLAG, clientId);
|
||||
String val = RedisUtils.get(key);
|
||||
|
||||
if (val == null) {
|
||||
return true;
|
||||
}
|
||||
|
||||
JSONObject information = JSONUtil.parseObj(val);
|
||||
return !StrUtil.equals(CaptchaFlagTypeEnum.OFF.getType(), information.getStr(CommonConstants.CAPTCHA_FLAG));
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验请求中的验证码
|
||||
*
|
||||
* @param request 当前请求
|
||||
* @throws ValidateCodeException 验证码校验失败
|
||||
*/
|
||||
public void validateCode(HttpServletRequest request) throws ValidateCodeException {
|
||||
String code = request.getParameter("code");
|
||||
if (StrUtil.isBlank(code)) {
|
||||
throw new ValidateCodeException(MsgUtils.getMessage(AuthErrorCodes.AUTH_CAPTCHA_EMPTY));
|
||||
}
|
||||
|
||||
String randomStr = request.getParameter("randomStr");
|
||||
boolean isBehavior = StrUtil.equalsAnyIgnoreCase(randomStr, CommonConstants.IMAGE_CODE_BLOCK_PUZZLE,
|
||||
CommonConstants.IMAGE_CODE_CLICK_WORD);
|
||||
String captchaType = isBehavior ? randomStr : CommonConstants.IMAGE_CODE_MATH;
|
||||
String captchaVerification = isBehavior ? code
|
||||
: randomStr + CommonConstants.CAPTCHA_VERIFICATION_SEPARATOR + code;
|
||||
|
||||
CaptchaResult result = captchaValidator.validate(captchaType, captchaVerification);
|
||||
if (!result.isOk()) {
|
||||
String errorCode = isBehavior ? AuthErrorCodes.AUTH_CAPTCHA_EMPTY : AuthErrorCodes.AUTH_CAPTCHA_INVALID;
|
||||
throw new ValidateCodeException(MsgUtils.getMessage(errorCode));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 按完整类型前缀判断是否使用短信登录,不校验手机号格式或验证码。
|
||||
*
|
||||
* @param mobile 登录标识,格式为 {@code SMS@手机号} 或 {@code APP-SMS@手机号};允许为 null
|
||||
* @return 匹配短信类型前缀时为 true;null、空串或其他类型返回 false
|
||||
*/
|
||||
public boolean isSmsLogin(String mobile) {
|
||||
return StrUtil.startWith(mobile, LoginTypeEnum.SMS.getType() + StrUtil.AT)
|
||||
|| StrUtil.startWith(mobile, LoginTypeEnum.APPSMS.getType() + StrUtil.AT);
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验请求中的短信身份凭据,不接受图形或行为验证码作为替代。
|
||||
* 类型合法且验证码非空时委托缓存校验;读取缓存后无论匹配与否均消费该验证码。
|
||||
*
|
||||
* @param request 非 null 请求,mobile 参数为 {@code SMS@手机号} 或
|
||||
* {@code APP-SMS@手机号},code 参数为短信验证码
|
||||
* @throws ValidateCodeException 验证码为空、登录类型不合法,或验证码不存在、过期、不匹配
|
||||
*/
|
||||
public void validateSmsCode(HttpServletRequest request) {
|
||||
String mobile = request.getParameter("mobile");
|
||||
String code = request.getParameter("code");
|
||||
if (StrUtil.isBlank(code)) {
|
||||
throw new ValidateCodeException(MsgUtils.getMessage(AuthErrorCodes.AUTH_CAPTCHA_EMPTY));
|
||||
}
|
||||
if (!isSmsLogin(mobile) || !captchaValidator.validateSms(mobile, code).isOk()) {
|
||||
throw new ValidateCodeException(MsgUtils.getMessage(AuthErrorCodes.AUTH_CAPTCHA_INVALID));
|
||||
}
|
||||
}
|
||||
|
||||
private String resolveAuthorizationParameter(HttpServletRequest request, HttpServletResponse response,
|
||||
String parameterName, boolean includeCurrentRequestId) {
|
||||
if (includeCurrentRequestId) {
|
||||
String parameterValue = request.getParameter(parameterName);
|
||||
if (StrUtil.isNotBlank(parameterValue)) {
|
||||
return parameterValue;
|
||||
}
|
||||
}
|
||||
|
||||
SavedRequest savedRequest = requestCache.getRequest(request, response);
|
||||
if (Objects.isNull(savedRequest)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
String[] parameterValues = savedRequest.getParameterValues(parameterName);
|
||||
if (Objects.isNull(parameterValues) || parameterValues.length == 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return parameterValues[0];
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.pig4cloud.pigx.auth.support.core;
|
||||
|
||||
/**
|
||||
* Auth 模块错误编码
|
||||
*
|
||||
* @author lengleng
|
||||
* @date 2022/3/30
|
||||
*/
|
||||
public interface AuthErrorCodes {
|
||||
|
||||
// === 验证码相关 ===
|
||||
String AUTH_CAPTCHA_EMPTY = "auth.captcha.empty";
|
||||
|
||||
String AUTH_CAPTCHA_INVALID = "auth.captcha.invalid";
|
||||
|
||||
// === 客户端相关 ===
|
||||
String AUTH_CLIENT_INVALID = "auth.client.invalid";
|
||||
}
|
||||
Loaded 100 of 2629 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user