mirror of
http://git.pig4cloud.com/pig/pigx.git
synced 2026-11-15 06:29:01 +08:00
Compare commits
673
Commits
v5.5
...
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 |
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
|
||||
@@ -58,6 +58,15 @@ Servers
|
||||
.metadata
|
||||
upload
|
||||
gen_code
|
||||
application-preview.yml
|
||||
|
||||
### node ###
|
||||
node_modules
|
||||
|
||||
### claude code ###
|
||||
.claude
|
||||
docs
|
||||
|
||||
### test
|
||||
aitest
|
||||
.vectorex
|
||||
@@ -1,5 +0,0 @@
|
||||
# 构造器注入的时候自动复制字段上边的注解
|
||||
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,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并非一个开源软件,作者保留全部的权利。
|
||||
|
||||
@@ -5,7 +5,7 @@ pigX 并非一个开源软件,作者保留全部的权利。
|
||||
|
||||
## 商业使用
|
||||
- [商用请购买商业授权](https://pig4cloud.com)
|
||||
- [使用对应的专属版本](https://pigx.vip/#/buy/form3)
|
||||
- [使用对应的专属版本](https://pig4cloud.com/data/other/form3.html)
|
||||
|
||||
### 🚫禁止
|
||||
|
||||
|
||||
+1316
-827
File diff suppressed because it is too large.
Load diff
+700
-467
File diff suppressed because it is too large.
Load diff
+158
-22
@@ -1,8 +1,28 @@
|
||||
-- 本文件仅用于初始化,不用于升级已有数据库。
|
||||
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
|
||||
-- ----------------------------
|
||||
@@ -17,20 +37,22 @@ CREATE TABLE `process` (
|
||||
`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` tinyint(1) NOT NULL COMMENT '0 正常 1=隐藏',
|
||||
`is_stop` tinyint(1) NOT NULL COMMENT '0 正常 1=停用 ',
|
||||
`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 `idx_id` (`id`) USING BTREE
|
||||
KEY `process_idx_id` (`id`) USING BTREE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=182 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='流程定义数据';
|
||||
|
||||
|
||||
@@ -41,8 +63,8 @@ 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 NOT NULL COMMENT '创建时间',
|
||||
`update_time` datetime NOT NULL 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 '发起人',
|
||||
@@ -57,7 +79,7 @@ CREATE TABLE `process_copy` (
|
||||
`user_id` bigint NOT NULL COMMENT '抄送人id',
|
||||
`tenant_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '所属租户id',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
KEY `idx_id` (`id`) USING BTREE
|
||||
KEY `copy_idx_id` (`id`) USING BTREE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=74 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='流程抄送数据';
|
||||
|
||||
|
||||
@@ -74,7 +96,7 @@ CREATE TABLE `process_group` (
|
||||
`sort` int NOT NULL DEFAULT '0' COMMENT '排序',
|
||||
`tenant_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '所属租户id',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
KEY `idx_id` (`id`) USING BTREE
|
||||
KEY `group_idx_id` (`id`) USING BTREE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='流程分组';
|
||||
|
||||
|
||||
@@ -97,12 +119,13 @@ CREATE TABLE `process_instance_record` (
|
||||
`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 `idx_id` (`id`) USING BTREE,
|
||||
KEY `idx_dep_id` (`user_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='流程记录';
|
||||
|
||||
|
||||
@@ -113,14 +136,16 @@ 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 NOT NULL COMMENT '创建时间',
|
||||
`update_time` datetime NOT NULL 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,
|
||||
KEY `idx_id` (`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='流程节点数据';
|
||||
|
||||
|
||||
@@ -131,8 +156,8 @@ 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 NOT NULL COMMENT '创建时间',
|
||||
`update_time` datetime NOT NULL 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 '表单数据',
|
||||
@@ -145,7 +170,7 @@ CREATE TABLE `process_node_record` (
|
||||
`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 `idx_id` (`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='流程节点记录';
|
||||
|
||||
|
||||
@@ -156,13 +181,13 @@ 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 NOT NULL COMMENT '创建时间',
|
||||
`update_time` datetime NOT NULL 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` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT ' 用户id',
|
||||
`user_id` bigint NOT NULL COMMENT ' 用户id',
|
||||
`status` int NOT NULL COMMENT '节点状态',
|
||||
`start_time` datetime NOT NULL COMMENT '开始时间',
|
||||
`end_time` datetime DEFAULT NULL COMMENT '结束时间',
|
||||
@@ -172,11 +197,55 @@ CREATE TABLE `process_node_record_assign_user` (
|
||||
`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,
|
||||
KEY `idx_id` (`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
|
||||
@@ -185,14 +254,81 @@ 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 NOT NULL COMMENT '创建时间',
|
||||
`update_time` datetime NOT NULL 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 `idx_id` (`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;
|
||||
+136
-113
@@ -8,9 +8,9 @@ SET FOREIGN_KEY_CHECKS = 0;
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `qrtz_blob_triggers`;
|
||||
CREATE TABLE `qrtz_blob_triggers` (
|
||||
`sched_name` varchar(120) CHARACTER SET utf8 NOT NULL,
|
||||
`trigger_name` varchar(200) CHARACTER SET utf8 NOT NULL,
|
||||
`trigger_group` varchar(200) CHARACTER SET utf8 NOT NULL,
|
||||
`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
|
||||
@@ -27,8 +27,8 @@ COMMIT;
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `qrtz_calendars`;
|
||||
CREATE TABLE `qrtz_calendars` (
|
||||
`sched_name` varchar(120) CHARACTER SET utf8 NOT NULL,
|
||||
`calendar_name` varchar(200) CHARACTER SET utf8 NOT NULL,
|
||||
`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;
|
||||
@@ -44,11 +44,11 @@ COMMIT;
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `qrtz_cron_triggers`;
|
||||
CREATE TABLE `qrtz_cron_triggers` (
|
||||
`sched_name` varchar(120) CHARACTER SET utf8 NOT NULL,
|
||||
`trigger_name` varchar(200) CHARACTER SET utf8 NOT NULL,
|
||||
`trigger_group` varchar(200) CHARACTER SET utf8 NOT NULL,
|
||||
`cron_expression` varchar(200) CHARACTER SET utf8 NOT NULL,
|
||||
`time_zone_id` varchar(80) CHARACTER SET utf8 DEFAULT NULL,
|
||||
`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;
|
||||
@@ -64,19 +64,19 @@ COMMIT;
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `qrtz_fired_triggers`;
|
||||
CREATE TABLE `qrtz_fired_triggers` (
|
||||
`sched_name` varchar(120) CHARACTER SET utf8 NOT NULL,
|
||||
`entry_id` varchar(95) CHARACTER SET utf8 NOT NULL,
|
||||
`trigger_name` varchar(200) CHARACTER SET utf8 NOT NULL,
|
||||
`trigger_group` varchar(200) CHARACTER SET utf8 NOT NULL,
|
||||
`instance_name` varchar(200) CHARACTER SET utf8 NOT NULL,
|
||||
`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 utf8 NOT NULL,
|
||||
`job_name` varchar(200) CHARACTER SET utf8 DEFAULT NULL,
|
||||
`job_group` varchar(200) CHARACTER SET utf8 DEFAULT NULL,
|
||||
`is_nonconcurrent` varchar(1) CHARACTER SET utf8 DEFAULT NULL,
|
||||
`requests_recovery` varchar(1) CHARACTER SET utf8 DEFAULT 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;
|
||||
|
||||
@@ -91,15 +91,15 @@ COMMIT;
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `qrtz_job_details`;
|
||||
CREATE TABLE `qrtz_job_details` (
|
||||
`sched_name` varchar(120) CHARACTER SET utf8 NOT NULL,
|
||||
`job_name` varchar(200) CHARACTER SET utf8 NOT NULL,
|
||||
`job_group` varchar(200) CHARACTER SET utf8 NOT NULL,
|
||||
`description` varchar(250) CHARACTER SET utf8 DEFAULT NULL,
|
||||
`job_class_name` varchar(250) CHARACTER SET utf8 NOT NULL,
|
||||
`is_durable` varchar(1) CHARACTER SET utf8 NOT NULL,
|
||||
`is_nonconcurrent` varchar(1) CHARACTER SET utf8 NOT NULL,
|
||||
`is_update_data` varchar(1) CHARACTER SET utf8 NOT NULL,
|
||||
`requests_recovery` varchar(1) CHARACTER SET utf8 NOT NULL,
|
||||
`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;
|
||||
@@ -115,8 +115,8 @@ COMMIT;
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `qrtz_locks`;
|
||||
CREATE TABLE `qrtz_locks` (
|
||||
`sched_name` varchar(120) CHARACTER SET utf8 NOT NULL,
|
||||
`lock_name` varchar(40) CHARACTER SET utf8 NOT NULL,
|
||||
`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;
|
||||
|
||||
@@ -131,8 +131,8 @@ COMMIT;
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `qrtz_paused_trigger_grps`;
|
||||
CREATE TABLE `qrtz_paused_trigger_grps` (
|
||||
`sched_name` varchar(120) CHARACTER SET utf8 NOT NULL,
|
||||
`trigger_group` varchar(200) CHARACTER SET utf8 NOT NULL,
|
||||
`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;
|
||||
|
||||
@@ -147,8 +147,8 @@ COMMIT;
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `qrtz_scheduler_state`;
|
||||
CREATE TABLE `qrtz_scheduler_state` (
|
||||
`sched_name` varchar(120) CHARACTER SET utf8 NOT NULL,
|
||||
`instance_name` varchar(200) CHARACTER SET utf8 NOT NULL,
|
||||
`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
|
||||
@@ -165,9 +165,9 @@ COMMIT;
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `qrtz_simple_triggers`;
|
||||
CREATE TABLE `qrtz_simple_triggers` (
|
||||
`sched_name` varchar(120) CHARACTER SET utf8 NOT NULL,
|
||||
`trigger_name` varchar(200) CHARACTER SET utf8 NOT NULL,
|
||||
`trigger_group` varchar(200) CHARACTER SET utf8 NOT NULL,
|
||||
`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,
|
||||
@@ -186,20 +186,20 @@ COMMIT;
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `qrtz_simprop_triggers`;
|
||||
CREATE TABLE `qrtz_simprop_triggers` (
|
||||
`sched_name` varchar(120) CHARACTER SET utf8 NOT NULL,
|
||||
`trigger_name` varchar(200) CHARACTER SET utf8 NOT NULL,
|
||||
`trigger_group` varchar(200) CHARACTER SET utf8 NOT NULL,
|
||||
`str_prop_1` varchar(512) CHARACTER SET utf8 DEFAULT NULL,
|
||||
`str_prop_2` varchar(512) CHARACTER SET utf8 DEFAULT NULL,
|
||||
`str_prop_3` varchar(512) CHARACTER SET utf8 DEFAULT NULL,
|
||||
`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 utf8 DEFAULT NULL,
|
||||
`bool_prop_2` varchar(1) CHARACTER SET utf8 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;
|
||||
@@ -215,20 +215,20 @@ COMMIT;
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `qrtz_triggers`;
|
||||
CREATE TABLE `qrtz_triggers` (
|
||||
`sched_name` varchar(120) CHARACTER SET utf8 NOT NULL,
|
||||
`trigger_name` varchar(200) CHARACTER SET utf8 NOT NULL,
|
||||
`trigger_group` varchar(200) CHARACTER SET utf8 NOT NULL,
|
||||
`job_name` varchar(200) CHARACTER SET utf8 NOT NULL,
|
||||
`job_group` varchar(200) CHARACTER SET utf8 NOT NULL,
|
||||
`description` varchar(250) CHARACTER SET utf8 DEFAULT NULL,
|
||||
`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 utf8 NOT NULL,
|
||||
`trigger_type` varchar(8) CHARACTER SET utf8 NOT 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 utf8 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,
|
||||
@@ -262,9 +262,9 @@ CREATE TABLE `sys_job` (
|
||||
`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 NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`update_by` varchar(64) CHARACTER SET utf8mb4 DEFAULT '' COMMENT '更新者',
|
||||
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP 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 '下次执行时间',
|
||||
@@ -286,24 +286,47 @@ DROP TABLE IF EXISTS `sys_job_log`;
|
||||
CREATE TABLE `sys_job_log` (
|
||||
`job_log_id` bigint NOT NULL COMMENT '任务日志ID',
|
||||
`job_id` bigint NOT NULL COMMENT '任务id',
|
||||
`job_name` varchar(64) CHARACTER SET utf8 DEFAULT NULL COMMENT '任务名称',
|
||||
`job_group` varchar(64) CHARACTER SET utf8 DEFAULT NULL COMMENT '任务组名',
|
||||
`job_order` char(1) CHARACTER SET utf8 DEFAULT NULL COMMENT '组内执行顺利,值越大执行优先级越高,最大值9,最小值1',
|
||||
`job_type` char(1) CHARACTER SET utf8 NOT NULL DEFAULT '1' COMMENT '1、java类;2、spring bean名称;3、rest调用;4、jar调用;9其他',
|
||||
`execute_path` varchar(500) CHARACTER SET utf8 DEFAULT NULL COMMENT 'job_type=3时,rest调用地址,仅支持post协议;job_type=4时,jar路径;其它值为空',
|
||||
`class_name` varchar(500) CHARACTER SET utf8 DEFAULT NULL COMMENT 'job_type=1时,类完整路径;job_type=2时,spring bean名称;其它值为空',
|
||||
`method_name` varchar(500) CHARACTER SET utf8 DEFAULT NULL COMMENT '任务方法',
|
||||
`method_params_value` varchar(2000) CHARACTER SET utf8 DEFAULT NULL COMMENT '参数值',
|
||||
`cron_expression` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT 'cron执行表达式',
|
||||
`job_message` varchar(500) CHARACTER SET utf8 DEFAULT NULL COMMENT '日志信息',
|
||||
`job_log_status` char(1) CHARACTER SET utf8 DEFAULT '0' COMMENT '执行状态(0正常 1失败)',
|
||||
`execute_time` varchar(30) CHARACTER SET utf8 DEFAULT NULL COMMENT '执行时间',
|
||||
`exception_info` varchar(2000) CHARACTER SET utf8 DEFAULT '' COMMENT '异常信息',
|
||||
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`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',
|
||||
@@ -316,8 +339,8 @@ CREATE TABLE `xxl_job_info` (
|
||||
`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` varchar(512) 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 '失败重试次数',
|
||||
@@ -332,14 +355,25 @@ CREATE TABLE `xxl_job_info` (
|
||||
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` varchar(512) DEFAULT NULL COMMENT '执行器任务参数',
|
||||
`executor_sharding_param` varchar(20) DEFAULT NULL COMMENT '执行器任务分片参数,格式如 1/2',
|
||||
`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 '调度-结果',
|
||||
@@ -350,7 +384,9 @@ CREATE TABLE `xxl_job_log` (
|
||||
`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_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` (
|
||||
@@ -364,53 +400,40 @@ CREATE TABLE `xxl_job_log_report` (
|
||||
UNIQUE KEY `i_trigger_day` (`trigger_day`) USING BTREE
|
||||
) 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_registry` (
|
||||
`id` int(11) 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`),
|
||||
KEY `i_g_k_v` (`registry_group`,`registry_key`,`registry_value`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
CREATE TABLE `xxl_job_group` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`app_name` varchar(64) NOT NULL COMMENT '执行器AppName',
|
||||
`title` varchar(12) 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`)
|
||||
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(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;
|
||||
|
||||
CREATE TABLE `xxl_job_lock` (
|
||||
`lock_name` varchar(50) NOT NULL COMMENT '锁名称',
|
||||
PRIMARY KEY (`lock_name`)
|
||||
) 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_user`(`id`, `username`, `password`, `role`, `permission`) VALUES (1, 'admin', 'e10adc3949ba59abbe56e057f20f883e', 1, NULL);
|
||||
INSERT INTO `xxl_job_lock` ( `lock_name`) VALUES ( 'schedule_lock');
|
||||
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;
|
||||
+10
-10
@@ -73,10 +73,10 @@ 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 NOT NULL COMMENT '创建人',
|
||||
`update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '修改人',
|
||||
`create_time` datetime NOT NULL COMMENT '创建时间',
|
||||
`update_time` datetime 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',
|
||||
@@ -113,8 +113,8 @@ CREATE TABLE `wx_auto_reply` (
|
||||
`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 utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '备注',
|
||||
`del_flag` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '0' COMMENT '逻辑删除标记(0:显示;1:隐藏)',
|
||||
`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',
|
||||
@@ -159,7 +159,7 @@ 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 utf8 COLLATE utf8_general_ci NOT NULL COMMENT '微信用户ID',
|
||||
`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、公众号发给用户;)',
|
||||
@@ -177,11 +177,11 @@ CREATE TABLE `wx_msg` (
|
||||
`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 utf8 COLLATE utf8_general_ci DEFAULT '1' COMMENT '已读标记(1:是;0:否)',
|
||||
`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 utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '备注',
|
||||
`del_flag` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '0' COMMENT '逻辑删除标记(0:显示;1:隐藏)',
|
||||
`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',
|
||||
|
||||
+275
-169
@@ -6,280 +6,386 @@ SET FOREIGN_KEY_CHECKS = 0;
|
||||
-- Table structure for config_info
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `config_info`;
|
||||
CREATE TABLE `config_info` (
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT 'id',
|
||||
`data_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT 'data_id',
|
||||
`group_id` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
|
||||
`content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT 'content',
|
||||
`md5` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL 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 CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT 'source user',
|
||||
`src_ip` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT 'source ip',
|
||||
`app_name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
|
||||
`tenant_id` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '' COMMENT '租户字段',
|
||||
`c_desc` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
|
||||
`c_use` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
|
||||
`effect` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
|
||||
`type` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
|
||||
`c_schema` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL,
|
||||
`encrypted_data_key` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '秘钥',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
UNIQUE INDEX `uk_configinfo_datagrouptenant`(`data_id` ASC, `group_id` ASC, `tenant_id` ASC) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 21 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = 'config_info' ROW_FORMAT = Dynamic;
|
||||
CREATE TABLE `config_info` (
|
||||
`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 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 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',
|
||||
`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 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=8 DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='config_info';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of config_info
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
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\n\nspring:\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 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 enabled: true\n response:\n enabled: true\n\n# 端点对外暴露\nmanagement:\n endpoints:\n web:\n exposure:\n include: \'*\' \n endpoint:\n restart:\n enabled: true\n health:\n show-details: ALWAYS\n\n#开启灰度\ngray:\n rule:\n enabled: true\n\n# mybatis-plus 配置\nmybatis-plus:\n tenant-enable: ture\n mapper-locations: classpath:/mapper/*Mapper.xml\n global-config:\n capitalMode: true\n banner: false\n db-config:\n id-type: auto\n select-strategy: not_empty\n insert-strategy: not_empty\n update-strategy: not_null\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', '90942d7d4856ccba068fe5847643737d', '2022-12-16 10:44:25', '2023-08-14 11:44:19', 'nacos', '127.0.0.1', '', '', '', '', '', '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', '0:0:0:0:0:0:0:1', '', '', '', '', '', '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 resources:\n static-locations: classpath:/static/,classpath:/views/\n', 'ed6de06e34e2634c28a24e8a1db99b06', '2022-12-16 10:44:25', '2024-02-22 15:08:09', 'nacos', '0:0:0:0:0:0:0:1', '', '', '', '', '', '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', '09996f46e0b80d7b2aa320ef4cb31c82', '2022-12-16 10:44:25', '2023-04-07 14:14:50', 'nacos', '127.0.0.1', '', '', '', '', '', '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 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 enabled: true\n', 'd9454d877ff3d8bd3fd0d5be99810195', '2022-12-16 10:44:25', '2024-04-20 22:47:02', 'nacos', '0:0:0:0:0:0:0:1', '', '', '', '', '', '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', '', '', '', '', '', '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 autoconfigure:\n exclude: org.springframework.cloud.gateway.config.GatewayAutoConfiguration,org.springframework.cloud.gateway.config.GatewayClassPathWarningAutoConfiguration\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 local:\n enable: true\n basePath: /Users/lengleng/Downloads/files', '28f2305c1cfb413dcc45a3d432ef7098', '2022-12-16 10:44:25', '2024-02-22 15:08:36', 'nacos', '0:0:0:0:0:0:0:1', '', '', '', '', '', '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 resources:\n static-locations: classpath:/static/,classpath:/views/', '79619124a30cdb6e8bc1046aaa18d91c', '2022-12-16 10:44:25', '2024-04-19 21:49:00', 'nacos', '0:0:0:0:0:0:0:1', '', '', '', '', '', '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', '0:0:0:0:0:0:0:1', '', '', '', '', '', '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 resources:\n static-locations: classpath:/static/,classpath:/views/', 'd5936e0c352fb1fbe1d05f054f14c98a', '2022-12-16 10:44:25', '2024-02-22 15:09:20', 'nacos', '0:0:0:0:0:0:0:1', '', '', '', '', '', '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\nxxl:\n job:\n i18n: zh_CN\n logretentiondays: 30\n triggerpool:\n fast.max: 200\n slow.max: 200\n\n# mybatis\nmybatis:\n mapper-locations: classpath:/mybatis-mapper/*Mapper.xml\n\n# spring\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 mvc:\n static-path-pattern: /static/**\n freemarker:\n suffix: .ftl\n request-context-attribute: request\n settings:\n number_format: 0.##########\n mail:\n host: smtp.mxhichina.com\n port: 465\n from: xxxx@gitee.wang\n username: xxxx@gitee.wang\n password: xxxx\n properties:\n mail:\n smtp:\n auth: true\n ssl.enable: true\n starttls.enable: false\n required: false\n\nmanagement:\n health:\n mail:\n enabled: false\n endpoints:\n web:\n exposure:\n include: \'*\'\n endpoint:\n health:\n show-details: ALWAYS', '6d70dce1f3ee48f261dce29bcfa99cbb', '2022-12-16 10:44:25', '2023-01-04 18:22:48', 'nacos', '127.0.0.1', '', '', '', '', '', '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.MySQL8Dialect\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', '', '', '', '', '', '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 resource:\n static-locations: classpath:/static/\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.desreport.dao*\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', '66319da04963c4c7217f807bf1bd5f2d', '2022-12-16 10:44:25', '2024-01-30 20:44:36', 'nacos', '0:0:0:0:0:0:0:1', '', '', '', '', '', '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', '0:0:0:0:0:0:0:1', '', '', '', '', '', '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-engine-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', '233121e20445609e1ba378c3686ea7d5', '2023-07-28 13:41:32', '2023-07-28 13:43:36', 'nacos', '0:0:0:0:0:0:0:1', '', '', 'flowable 工作引擎', '', '', '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 (17, 'pigx-flow-task-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', '233121e20445609e1ba378c3686ea7d5', '2023-07-28 13:44:25', '2024-02-22 15:09:34', 'nacos', '0:0:0:0:0:0:0:1', '', '', 'flowable 业务', '', '', '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 (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 NOT NULL AUTO_INCREMENT COMMENT 'id',
|
||||
`data_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT 'data_id',
|
||||
`group_id` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT 'group_id',
|
||||
`datum_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT 'datum_id',
|
||||
`content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '内容',
|
||||
`gmt_modified` datetime NOT NULL COMMENT '修改时间',
|
||||
`app_name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
|
||||
`tenant_id` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '' COMMENT '租户字段',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
UNIQUE INDEX `uk_configinfoaggr_datagrouptenantdatum`(`data_id` ASC, `group_id` ASC, `tenant_id` ASC, `datum_id` ASC) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '增加租户字段' ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of config_info_aggr
|
||||
-- ----------------------------
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for config_info_beta
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `config_info_beta`;
|
||||
CREATE TABLE `config_info_beta` (
|
||||
CREATE TABLE `config_info_beta` (
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT 'id',
|
||||
`data_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT 'data_id',
|
||||
`group_id` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT 'group_id',
|
||||
`app_name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT 'app_name',
|
||||
`content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT 'content',
|
||||
`beta_ips` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT 'betaIps',
|
||||
`md5` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT 'md5',
|
||||
`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 CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间',
|
||||
`src_user` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT 'source user',
|
||||
`src_ip` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT 'source ip',
|
||||
`tenant_id` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '' COMMENT '租户字段',
|
||||
`encrypted_data_key` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '秘钥',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
UNIQUE INDEX `uk_configinfobeta_datagrouptenant`(`data_id` ASC, `group_id` ASC, `tenant_id` ASC) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = 'config_info_beta' ROW_FORMAT = Dynamic;
|
||||
`src_user` text COLLATE utf8_bin COMMENT 'source user',
|
||||
`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';
|
||||
|
||||
-- ----------------------------
|
||||
-- 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` (
|
||||
CREATE TABLE `config_info_tag` (
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT 'id',
|
||||
`data_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT 'data_id',
|
||||
`group_id` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT 'group_id',
|
||||
`tenant_id` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '' COMMENT 'tenant_id',
|
||||
`tag_id` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT 'tag_id',
|
||||
`app_name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT 'app_name',
|
||||
`content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT 'content',
|
||||
`md5` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT 'md5',
|
||||
`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',
|
||||
`tag_id` varchar(128) COLLATE utf8_bin NOT NULL COMMENT 'tag_id',
|
||||
`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 CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间',
|
||||
`src_user` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT 'source user',
|
||||
`src_ip` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT 'source ip',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
UNIQUE INDEX `uk_configinfotag_datagrouptenanttag`(`data_id` ASC, `group_id` ASC, `tenant_id` ASC, `tag_id` ASC) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = 'config_info_tag' ROW_FORMAT = Dynamic;
|
||||
`src_user` text COLLATE utf8_bin COMMENT 'source user',
|
||||
`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';
|
||||
|
||||
-- ----------------------------
|
||||
-- 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` (
|
||||
CREATE TABLE `config_tags_relation` (
|
||||
`id` bigint NOT NULL COMMENT 'id',
|
||||
`tag_name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT 'tag_name',
|
||||
`tag_type` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT 'tag_type',
|
||||
`data_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT 'data_id',
|
||||
`group_id` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT 'group_id',
|
||||
`tenant_id` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '' COMMENT 'tenant_id',
|
||||
`nid` bigint NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (`nid`) USING BTREE,
|
||||
UNIQUE INDEX `uk_configtagrelation_configidtag`(`id` ASC, `tag_name` ASC, `tag_type` ASC) USING BTREE,
|
||||
INDEX `idx_tenant_id`(`tenant_id` ASC) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = 'config_tag_relation' ROW_FORMAT = Dynamic;
|
||||
`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 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';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of config_tags_relation
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for group_capacity
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `group_capacity`;
|
||||
CREATE TABLE `group_capacity` (
|
||||
`id` bigint UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
|
||||
`group_id` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT 'Group ID,空字符表示整个集群',
|
||||
`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 '最大变更历史数量',
|
||||
CREATE TABLE `group_capacity` (
|
||||
`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
|
||||
`group_id` varchar(128) COLLATE utf8_bin NOT NULL DEFAULT '' COMMENT 'Group ID,空字符表示整个集群',
|
||||
`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`) USING BTREE,
|
||||
UNIQUE INDEX `uk_group_id`(`group_id` ASC) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '集群、各Group容量信息表' ROW_FORMAT = Dynamic;
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `uk_group_id` (`group_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='集群、各Group容量信息表';
|
||||
|
||||
-- ----------------------------
|
||||
-- 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 UNSIGNED NOT NULL,
|
||||
`nid` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`data_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
|
||||
`group_id` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
|
||||
`app_name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT 'app_name',
|
||||
`content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
|
||||
`md5` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
|
||||
`gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
`gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
`src_user` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL,
|
||||
`src_ip` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
|
||||
`op_type` char(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
|
||||
`tenant_id` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '' COMMENT '租户字段',
|
||||
`encrypted_data_key` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '秘钥',
|
||||
PRIMARY KEY (`nid`) USING BTREE,
|
||||
INDEX `idx_gmt_create`(`gmt_create` ASC) USING BTREE,
|
||||
INDEX `idx_gmt_modified`(`gmt_modified` ASC) USING BTREE,
|
||||
INDEX `idx_did`(`data_id` ASC) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 23 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '多租户改造' ROW_FORMAT = Dynamic;
|
||||
CREATE TABLE `his_config_info` (
|
||||
`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 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 AUTO_INCREMENT=8 DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='多租户改造';
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for permissions
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `permissions`;
|
||||
CREATE TABLE `permissions` (
|
||||
`role` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||
`resource` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||
`action` varchar(8) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||
UNIQUE INDEX `uk_role_permission`(`role` ASC, `resource` ASC, `action` ASC) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
|
||||
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) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||
`role` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||
UNIQUE INDEX `idx_user_role`(`username` ASC, `role` ASC) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
|
||||
CREATE TABLE `roles` (
|
||||
`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;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of roles
|
||||
-- ----------------------------
|
||||
INSERT INTO `roles` VALUES ('nacos', 'ROLE_ADMIN');
|
||||
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 UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
|
||||
`tenant_id` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT 'Tenant ID',
|
||||
`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 '最大变更历史数量',
|
||||
CREATE TABLE `tenant_capacity` (
|
||||
`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
|
||||
`tenant_id` varchar(128) COLLATE utf8_bin NOT NULL DEFAULT '' COMMENT 'Tenant ID',
|
||||
`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`) USING BTREE,
|
||||
UNIQUE INDEX `uk_tenant_id`(`tenant_id` ASC) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '租户容量信息表' ROW_FORMAT = Dynamic;
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `uk_tenant_id` (`tenant_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='租户容量信息表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of tenant_capacity
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for tenant_info
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `tenant_info`;
|
||||
CREATE TABLE `tenant_info` (
|
||||
CREATE TABLE `tenant_info` (
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT 'id',
|
||||
`kp` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT 'kp',
|
||||
`tenant_id` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '' COMMENT 'tenant_id',
|
||||
`tenant_name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '' COMMENT 'tenant_name',
|
||||
`tenant_desc` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT 'tenant_desc',
|
||||
`create_source` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT 'create_source',
|
||||
`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 NOT NULL COMMENT '创建时间',
|
||||
`gmt_modified` bigint NOT NULL COMMENT '修改时间',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
UNIQUE INDEX `uk_tenant_info_kptenantid`(`kp` ASC, `tenant_id` ASC) USING BTREE,
|
||||
INDEX `idx_tenant_id`(`tenant_id` ASC) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = 'tenant_info' ROW_FORMAT = Dynamic;
|
||||
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';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of tenant_info
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for users
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `users`;
|
||||
CREATE TABLE `users` (
|
||||
`username` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||
`password` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||
`enabled` tinyint(1) NOT NULL,
|
||||
PRIMARY KEY (`username`) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
|
||||
CREATE TABLE `users` (
|
||||
`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=utf8;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of users
|
||||
-- ----------------------------
|
||||
INSERT INTO `users` VALUES ('nacos', '$2a$10$EuWPZHzz32dJN7jexM34MOeYirDdFAZm2kuWj7VEOJhhZkDrxfvUu', 1);
|
||||
BEGIN;
|
||||
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;
|
||||
+9
-9
@@ -19,8 +19,8 @@ CREATE TABLE `pay_channel` (
|
||||
`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 NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP 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
|
||||
@@ -45,8 +45,8 @@ CREATE TABLE `pay_goods_order` (
|
||||
`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 NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP 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
|
||||
@@ -70,7 +70,7 @@ CREATE TABLE `pay_notify_record` (
|
||||
`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 NOT NULL DEFAULT CURRENT_TIMESTAMP 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
|
||||
@@ -114,8 +114,8 @@ CREATE TABLE `pay_refund_order` (
|
||||
`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 NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP 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
|
||||
@@ -153,8 +153,8 @@ CREATE TABLE `pay_trade_order` (
|
||||
`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 NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP 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
|
||||
|
||||
+159
-108
@@ -10,7 +10,7 @@ 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` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'jdbcurl',
|
||||
`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 '创建时间',
|
||||
@@ -41,6 +41,8 @@ CREATE TABLE `gen_field_type` (
|
||||
`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 '修改时间',
|
||||
@@ -54,61 +56,55 @@ CREATE TABLE `gen_field_type` (
|
||||
-- Records of gen_field_type
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `gen_field_type` VALUES (1, 'datetime', 'LocalDateTime', 'java.time.LocalDateTime', '2023-02-06 08:45:10', NULL, NULL, NULL, '0');
|
||||
INSERT INTO `gen_field_type` VALUES (2, 'date', 'LocalDate', 'java.time.LocalDate', '2023-02-06 08:45:10', NULL, NULL, NULL, '0');
|
||||
INSERT INTO `gen_field_type` VALUES (3, 'tinyint', 'Integer', NULL, '2023-02-06 08:45:11', NULL, NULL, NULL, '0');
|
||||
INSERT INTO `gen_field_type` VALUES (4, 'smallint', 'Integer', NULL, '2023-02-06 08:45:11', NULL, NULL, NULL, '0');
|
||||
INSERT INTO `gen_field_type` VALUES (5, 'mediumint', 'Integer', NULL, '2023-02-06 08:45:11', NULL, NULL, NULL, '0');
|
||||
INSERT INTO `gen_field_type` VALUES (6, 'int', 'Integer', NULL, '2023-02-06 08:45:11', NULL, NULL, NULL, '0');
|
||||
INSERT INTO `gen_field_type` VALUES (7, 'integer', 'Integer', NULL, '2023-02-06 08:45:11', NULL, NULL, NULL, '0');
|
||||
INSERT INTO `gen_field_type` VALUES (8, 'bigint', 'Long', NULL, '2023-02-06 08:45:11', NULL, NULL, NULL, '0');
|
||||
INSERT INTO `gen_field_type` VALUES (9, 'float', 'Float', NULL, '2023-02-06 08:45:11', NULL, NULL, NULL, '0');
|
||||
INSERT INTO `gen_field_type` VALUES (10, 'double', 'Double', NULL, '2023-02-06 08:45:11', NULL, NULL, NULL, '0');
|
||||
INSERT INTO `gen_field_type` VALUES (11, 'decimal', 'BigDecimal', 'java.math.BigDecimal', '2023-02-06 08:45:11', NULL, NULL, NULL, '0');
|
||||
INSERT INTO `gen_field_type` VALUES (12, 'bit', 'Boolean', NULL, '2023-02-06 08:45:11', NULL, NULL, NULL, '0');
|
||||
INSERT INTO `gen_field_type` VALUES (13, 'char', 'String', NULL, '2023-02-06 08:45:11', NULL, NULL, NULL, '0');
|
||||
INSERT INTO `gen_field_type` VALUES (14, 'varchar', 'String', NULL, '2023-02-06 08:45:11', NULL, NULL, NULL, '0');
|
||||
INSERT INTO `gen_field_type` VALUES (15, 'tinytext', 'String', NULL, '2023-02-06 08:45:11', NULL, NULL, NULL, '0');
|
||||
INSERT INTO `gen_field_type` VALUES (16, 'text', 'String', NULL, '2023-02-06 08:45:11', NULL, NULL, NULL, '0');
|
||||
INSERT INTO `gen_field_type` VALUES (17, 'mediumtext', 'String', NULL, '2023-02-06 08:45:11', NULL, NULL, NULL, '0');
|
||||
INSERT INTO `gen_field_type` VALUES (18, 'longtext', 'String', NULL, '2023-02-06 08:45:11', NULL, NULL, NULL, '0');
|
||||
INSERT INTO `gen_field_type` VALUES (19, 'timestamp', 'LocalDateTime', 'java.time.LocalDateTime', '2023-02-06 08:45:11', NULL, NULL, NULL, '0');
|
||||
INSERT INTO `gen_field_type` VALUES (20, 'NUMBER', 'Integer', NULL, '2023-02-06 08:45:11', NULL, NULL, NULL, '0');
|
||||
INSERT INTO `gen_field_type` VALUES (21, 'BINARY_INTEGER', 'Integer', NULL, '2023-02-06 08:45:12', NULL, NULL, NULL, '0');
|
||||
INSERT INTO `gen_field_type` VALUES (22, 'BINARY_FLOAT', 'Float', NULL, '2023-02-06 08:45:12', NULL, NULL, NULL, '0');
|
||||
INSERT INTO `gen_field_type` VALUES (23, 'BINARY_DOUBLE', 'Double', NULL, '2023-02-06 08:45:12', NULL, NULL, NULL, '0');
|
||||
INSERT INTO `gen_field_type` VALUES (24, 'VARCHAR2', 'String', NULL, '2023-02-06 08:45:12', NULL, NULL, NULL, '0');
|
||||
INSERT INTO `gen_field_type` VALUES (25, 'NVARCHAR', 'String', NULL, '2023-02-06 08:45:12', NULL, NULL, NULL, '0');
|
||||
INSERT INTO `gen_field_type` VALUES (26, 'NVARCHAR2', 'String', NULL, '2023-02-06 08:45:12', NULL, NULL, NULL, '0');
|
||||
INSERT INTO `gen_field_type` VALUES (27, 'CLOB', 'String', NULL, '2023-02-06 08:45:12', NULL, NULL, NULL, '0');
|
||||
INSERT INTO `gen_field_type` VALUES (28, 'int8', 'Long', NULL, '2023-02-06 08:45:12', NULL, NULL, NULL, '0');
|
||||
INSERT INTO `gen_field_type` VALUES (29, 'int4', 'Integer', NULL, '2023-02-06 08:45:12', NULL, NULL, NULL, '0');
|
||||
INSERT INTO `gen_field_type` VALUES (30, 'int2', 'Integer', NULL, '2023-02-06 08:45:12', NULL, NULL, NULL, '0');
|
||||
INSERT INTO `gen_field_type` VALUES (31, 'numeric', 'BigDecimal', 'java.math.BigDecimal', '2023-02-06 08:45:12', NULL, NULL, NULL, '0');
|
||||
INSERT INTO `gen_field_type` VALUES (32, 'json', 'String', NULL, '2023-02-06 08:45:12', NULL, NULL, NULL, '0');
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for gen_form_conf
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `gen_form_conf`;
|
||||
CREATE TABLE `gen_form_conf` (
|
||||
`id` bigint NOT NULL COMMENT 'ID',
|
||||
`ds_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '数据库名称',
|
||||
`table_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '表名称',
|
||||
`form_info` 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 DEFAULT '0',
|
||||
`tenant_id` bigint DEFAULT NULL COMMENT '所属租户',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
KEY `table_name` (`table_name`) USING BTREE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='表单配置';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of gen_form_conf
|
||||
-- ----------------------------
|
||||
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;
|
||||
|
||||
-- ----------------------------
|
||||
@@ -120,8 +116,8 @@ CREATE TABLE `gen_group` (
|
||||
`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 utf8 COLLATE utf8_general_ci NOT NULL DEFAULT ' ' COMMENT '创建人',
|
||||
`update_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT ' ' COMMENT '修改人',
|
||||
`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 '删除标记',
|
||||
@@ -132,8 +128,10 @@ CREATE TABLE `gen_group` (
|
||||
-- Records of gen_group
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `gen_group` VALUES (1, '单表增删改查', '单表增删改查', 1, ' ', ' ', NULL, NULL, '0');
|
||||
INSERT INTO `gen_group` VALUES (2, '主子表表增删改查', '主子表表增删改查', 1, ' ', ' ', NULL, NULL, '0');
|
||||
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;
|
||||
|
||||
-- ----------------------------
|
||||
@@ -151,10 +149,14 @@ CREATE TABLE `gen_table` (
|
||||
`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 '1' COMMENT '代码风格',
|
||||
`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 '前端生成路径',
|
||||
@@ -165,7 +167,7 @@ CREATE TABLE `gen_table` (
|
||||
`baseclass_id` bigint DEFAULT NULL COMMENT '基类ID',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `table_name` (`table_name`,`ds_name`) USING BTREE
|
||||
UNIQUE KEY `table_name_idx` (`table_name`,`ds_name`) USING BTREE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='代码生成表';
|
||||
|
||||
-- ----------------------------
|
||||
@@ -225,8 +227,8 @@ CREATE TABLE `gen_template` (
|
||||
`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 utf8 COLLATE utf8_general_ci NOT NULL DEFAULT ' ' COMMENT '创建人',
|
||||
`update_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT ' ' COMMENT '修改人',
|
||||
`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='模板';
|
||||
|
||||
@@ -234,25 +236,51 @@ CREATE TABLE `gen_template` (
|
||||
-- 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, 'vform.json', '/', '表单设计器初始化json模板', '#set($key=${dateTool.getSystemTime()})\n{\n \"widgetList\": [\n {\n \"key\": $key,\n \"type\": \"grid\",\n \"category\": \"container\",\n \"icon\": \"grid\",\n \"cols\": [\n#foreach($field in $formList)\n#if($field.attrName != ${pk.attrName})\n {\n \"type\": \"grid-col\",\n \"category\": \"container\",\n \"icon\": \"grid-col\",\n \"internal\": true,\n \"widgetList\": [\n {\n \"key\": ${math.add($key,${foreach.index})},\n #if($field.formType == \'text\')\n \"type\": \"input\",\n \"icon\": \"text-field\",\n #elseif($field.formType == \'number\')\n \"type\": \"number\",\n \"icon\": \"number-field\",\n #elseif($field.formType == \'textarea\')\n \"type\": \"textarea\",\n \"icon\": \"textarea-field\",\n #elseif($field.formType == \'select\' && ${field.fieldDict})\n \"type\": \"select\",\n \"icon\": \"select-field\",\n #elseif($field.formType == \'radio\' && ${field.fieldDict})\n \"type\": \"radio\",\n \"icon\": \"radio-field\",\n #elseif($field.formType == \'checkbox\' && ${field.fieldDict} )\n \"type\": \"checkbox\",\n \"icon\": \"checkbox-field\",\n #elseif($field.formType == \'date\')\n \"type\": \"date\",\n \"icon\": \"date-field\",\n #elseif($field.formType == \'datetime\')\n \"type\": \"time\",\n \"icon\": \"time-field\",\n #elseif($field.formType == \'upload-file\')\n \"type\": \"file-upload\",\n \"icon\": \"file-upload-field\",\n #elseif($field.formType == \'upload-img\')\n \"type\": \"picture-upload\",\n \"icon\": \"picture-upload-field\",\n #elseif($field.formType == \'editor\')\n \"type\": \"rich-editor\",\n \"icon\": \"rich-editor-field\",\n #else\n \"type\": \"input\",\n \"icon\": \"text-field\",\n #end\n \"formItemFlag\": true,\n \"options\": {\n \"name\": \"${field.attrName}\",\n \"label\": \"#if(${field.fieldComment})${field.fieldComment}#else ${field.attrName}#end\",\n #if(($field.formType == \'select\' || $field.formType == \'radio\' || $field.formType == \'checkbox\') && ${field.fieldDict})\n \"optionItemsDictType\": \"${field.fieldDict}\",\n #end\n \"placeholder\": \"请输入#if(${field.fieldComment})${field.fieldComment}#else ${field.attrName}#end\"\n },\n #if($field.formRequired)\n \"required\": true,\n #end\n \"id\": \"input${math.add($key,${foreach.index})}\"\n }\n ],\n \"options\": {\n \"name\": \"gridCol${math.add($key,${foreach.index})}\",\n \"hidden\": false,\n \"offset\": 0,\n \"push\": 0,\n \"pull\": 0,\n #if($formLayout == 1)\n \"span\": 24,\n #elseif($formLayout == 2)\n \"span\": 12,\n #end\n \"responsive\": false\n },\n \"id\": \"grid-col-${math.add($key,${foreach.index})}\"\n }#if($foreach.hasNext),#end\n#end\n#end\n ],\n \"options\": {\n \"name\": \"grid${functionName}\",\n \"hidden\": false,\n \"gutter\": 12\n },\n \"id\": \"grid${functionName}\"\n }\n ],\n \"formConfig\": {\n \"modelName\": \"form\",\n \"refName\": \"form\",\n \"rulesName\": \"rules\",\n \"labelWidth\": 80,\n \"labelPosition\": \"left\",\n \"labelAlign\": \"label-left-align\",\n \"layoutType\": \"PC\",\n \"jsonVersion\": 3\n }\n}', '2023-02-23 04:33:16', '2023-06-04 10:35:51', '0', 1, ' ', ' ');
|
||||
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, 'vform.vue', '/', '表单设计器生成sfc模板', '<template>\n <el-dialog :title=\"form.${pk.attrName} ? \'编辑\' : \'新增\'\" v-model=\"visible\" :close-on-click-modal=\"false\" draggable>\n <el-form ref=\"dataFormRef\" :model=\"form\" :rules=\"dataRules\" formDialogRef label-width=\"90px\">\n#foreach($key in $resultMap.keySet())\n#set($itemList = $resultMap.get($key))\n<el-row :gutter=\"24\">\n#foreach($field in $itemList)\n <el-col :span=\"$field.span\">\n#if($field.type == \'input\')\n <el-form-item label=\"${field.options.label}\" prop=\"${field.options.name}\">\n <el-input v-model=\"form.${field.options.name}\" placeholder=\"${field.options.placeholder}\"/>\n </el-form-item>\n#elseif($field.type == \'number\')\n <el-form-item label=\"${field.options.label}\" prop=\"${field.options.name}\">\n <el-input-number :min=\"${field.options.min}\" :max=\"${field.options.max}\" v-model=\"form.${field.options.name}\" placeholder=\"${field.options.placeholder}\"></el-input-number>\n </el-form-item>\n#elseif($field.type == \'textarea\')\n <el-form-item label=\"${field.options.label}\" prop=\"${field.options.name}\">\n <el-input type=\"textarea\" :rows=\"${field.options.rows}\" v-model=\"form.${field.options.name}\" placeholder=\"${field.options.placeholder}\"/>\n </el-form-item>\n#elseif($field.type == \'select\')\n <el-form-item label=\"${field.options.label}\" prop=\"${field.options.name}\">\n <el-select v-model=\"form.${field.options.name}\" placeholder=\"${field.options.placeholder}\">\n #if($field.options.optionItemsDictType)\n <el-option :value=\"item.value\" :label=\"item.label\" v-for=\"(item, index) in ${field.options.optionItemsDictType}\" :key=\"index\"></el-option>\n #else\n <el-option label=\"请选择\">0</el-option>\n #end\n </el-select>\n </el-form-item>\n#elseif($field.type == \'radio\')\n <el-form-item label=\"${field.options.label}\" prop=\"${field.options.name}\">\n <el-radio-group v-model=\"form.${field.options.name}\">\n #if($field.options.optionItemsDictType)\n <el-radio :label=\"item.value\" v-for=\"(item, index) in ${field.options.optionItemsDictType}\" border :key=\"index\">{{ item.label }}\n </el-radio>\n #end\n </el-radio-group>\n </el-form-item>\n#elseif($field.type == \'checkbox\')\n <el-form-item label=\"${field.options.label}\" prop=\"${field.options.name}\">\n <el-checkbox-group v-model=\"form.${field.options.name}\">\n #if($field.options.optionItemsDictType)\n <el-checkbox :label=\"item.value\" :name=\"item.label\" v-for=\"(item, index) in ${field.options.optionItemsDictType}\" :key=\"index\"></el-checkbox>\n #else\n <el-checkbox label=\"启用\" name=\"type\"></el-checkbox>\n <el-checkbox label=\"禁用\" name=\"type\"></el-checkbox>\n #end\n </<el-checkbox-group>\n </el-form-item>\n#elseif($field.type == \'date\')\n <el-form-item label=\"${field.options.label}\" prop=\"${field.options.name}\">\n <el-date-picker type=\"date\" placeholder=\"${field.options.placeholder}\" v-model=\"form.${field.options.name}\" :value-format=\"dateStr\"></el-date-picker>\n </el-form-item>\n#elseif($field.type == \'time\')\n <el-form-item label=\"${field.options.label}\" prop=\"${field.options.name}\">\n <el-time-picker placeholder=\"${field.options.placeholder}\" v-model=\"form.${field.options.name}\" :value-format=\"dateTimeStr\"></el-date-picker>\n </el-form-item>\n#elseif($field.type == \'file-upload\')\n <el-form-item label=\"${field.options.label}\" prop=\"${field.options.name}\">\n <upload-file v-model=\"form.${field.attrName}\" limit=\"${field.options.limit}\" fileMaxSize=\"${field.options.fileMaxSize}\"></upload-file>\n </el-form-item>\n#elseif($field.type == \'picture-upload\')\n <el-form-item label=\"${field.options.label}\" prop=\"${field.options.name}\">\n <upload-img v-model:imageUrl=\"form.${field.options.name}\" limit=\"${field.options.limit}\" fileMaxSize=\"${field.options.fileMaxSize}\"></upload-img>\n </el-form-item>\n#elseif($field.type == \'rich-editor\')\n <el-form-item label=\"${field.options.label}\" prop=\"${field.options.name}\">\n <editor v-model:get-html=\"form.${field.options.name}\" placeholder=\"${field.options.placeholder}\"></editor>\n </el-form-item>\n#elseif($field.type == \'switch\')\n <el-form-item label=\"${field.options.label}\" prop=\"${field.options.name}\">\n <el-switch v-model=\"form.${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 (3, 'Controller', '${backendPath}/src/main/java/${packagePath}/${moduleName}/controller/${ClassName}Controller.java', '后台Controller', 'package ${package}.${moduleName}.controller;\n\n#if($queryList)\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 com.pig4cloud.pigx.common.core.util.R;\nimport com.pig4cloud.pigx.common.log.annotation.SysLog;\nimport ${package}.${moduleName}.entity.${ClassName}Entity;\nimport ${package}.${moduleName}.service.${ClassName}Service;\nimport org.springframework.security.access.prepost.PreAuthorize;\nimport com.pig4cloud.pigx.common.excel.annotation.ResponseExcel;\nimport io.swagger.v3.oas.annotations.security.SecurityRequirement;\n#if($isSpringBoot3)\nimport org.springdoc.core.annotations.ParameterObject;\n#else\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.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@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 @PreAuthorize(\"@pms.hasPermission(\'${moduleName}_${functionName}_view\')\" )\n public R get${ClassName}Page(@ParameterObject Page page, @ParameterObject ${ClassName}Entity ${className}) {\n LambdaQueryWrapper<${ClassName}Entity> wrapper = Wrappers.lambdaQuery();\n#foreach ($field in $queryList)\n#set($getAttrName=$str.getProperty($field.attrName))\n#set($var=\"${className}.$getAttrName()\")\n#if($field.attrType == \'String\')\n#set($expression=\"StrUtil.isNotBlank\")\n#else\n#set($expression=\"Objects.nonNull\")\n#end\n#if($field.queryType == \'=\')\n wrapper.eq($expression($var),${ClassName}Entity::$getAttrName,$var);\n#elseif( $field.queryType == \'like\' )\n wrapper.like($expression($var),${ClassName}Entity::$getAttrName,$var);\n#elseif( $field.queryType == \'!-\' )\n wrapper.ne($expression($var),${ClassName}Entity::$getAttrName,$var);\n#elseif( $field.queryType == \'>\' )\n wrapper.gt($expression($var),${ClassName}Entity::$getAttrName,$var);\n#elseif( $field.queryType == \'<\' )\n wrapper.lt($expression($var),${ClassName}Entity::$getAttrName,$var);\n#elseif( $field.queryType == \'>=\' )\n wrapper.ge($expression($var),${ClassName}Entity::$getAttrName,$var);\n#elseif( $field.queryType == \'<=\' )\n wrapper.le($expression($var),${ClassName}Entity::$getAttrName,$var);\n#elseif( $field.queryType == \'left like\' )\n wrapper.likeLeft($expression($var),${ClassName}Entity::$getAttrName,$var);\n#elseif( $field.queryType == \'right like\' )\n wrapper.likeRight($expression($var),${ClassName}Entity::$getAttrName,$var);\n#end\n#end\n return R.ok(${className}Service.page(page, wrapper));\n }\n\n\n /**\n * 通过id查询${tableComment}\n * @param ${pk.attrName} id\n * @return R\n */\n @Operation(summary = \"通过id查询\" , description = \"通过id查询\" )\n @GetMapping(\"/{${pk.attrName}}\" )\n @PreAuthorize(\"@pms.hasPermission(\'${moduleName}_${functionName}_view\')\" )\n public R getById(@PathVariable(\"${pk.attrName}\" ) ${pk.attrType} ${pk.attrName}) {\n return R.ok(${className}Service.getById(${pk.attrName}));\n }\n\n /**\n * 新增${tableComment}\n * @param ${className} ${tableComment}\n * @return R\n */\n @Operation(summary = \"新增${tableComment}\" , description = \"新增${tableComment}\" )\n @SysLog(\"新增${tableComment}\" )\n @PostMapping\n @PreAuthorize(\"@pms.hasPermission(\'${moduleName}_${functionName}_add\')\" )\n public R save(@RequestBody ${ClassName}Entity ${className}) {\n return R.ok(${className}Service.save(${className}));\n }\n\n /**\n * 修改${tableComment}\n * @param ${className} ${tableComment}\n * @return R\n */\n @Operation(summary = \"修改${tableComment}\" , descLine 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 (4, 'Service', '${backendPath}/src/main/java/${packagePath}/${moduleName}/service/${ClassName}Service.java', 'Service', 'package ${package}.${moduleName}.service;\n\n#if($ChildClassName)\nimport com.github.yulichang.extension.mapping.base.MPJDeepService;\nimport ${package}.${moduleName}.entity.${ChildClassName}Entity;\n#else\nimport com.baomidou.mybatisplus.extension.service.IService;\n#end\nimport ${package}.${moduleName}.entity.${ClassName}Entity;\n\n#if($ChildClassName)\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(Long[] ids);\n\n Boolean removeChild(Long[] ids);\n#else\npublic interface ${ClassName}Service extends IService<${ClassName}Entity> {\n#end\n\n}', '2023-02-23 01:16:53', '2023-06-04 10:35:25', '0', 1, ' ', ' ');
|
||||
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, 'ServiceImpl', '${backendPath}/src/main/java/${packagePath}/${moduleName}/service/impl/${ClassName}ServiceImpl.java', 'ServiceImpl', 'package ${package}.${moduleName}.service.impl;\n\nimport com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;\nimport ${package}.${moduleName}.entity.${ClassName}Entity;\nimport ${package}.${moduleName}.mapper.${ClassName}Mapper;\nimport ${package}.${moduleName}.service.${ClassName}Service;\nimport org.springframework.stereotype.Service;\n#if($ChildClassName)\nimport cn.hutool.core.collection.CollUtil;\nimport com.baomidou.mybatisplus.core.toolkit.Wrappers;\nimport ${package}.${moduleName}.entity.${ChildClassName}Entity;\nimport ${package}.${moduleName}.mapper.${ChildClassName}Mapper;\nimport org.springframework.transaction.annotation.Transactional;\nimport lombok.RequiredArgsConstructor;\nimport java.util.Objects;\n#end\n/**\n * ${tableComment}\n *\n * @author ${author}\n * @date ${datetime}\n */\n@Service\n#if($ChildClassName)\n@RequiredArgsConstructor\n#end\npublic class ${ClassName}ServiceImpl extends ServiceImpl<${ClassName}Mapper, ${ClassName}Entity> implements ${ClassName}Service {\n#if($ChildClassName)\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(${pk.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(Long[] ids) {\n baseMapper.deleteBatchIds(CollUtil.toList(ids));\n ${childClassName}Mapper.delete(Wrappers.<${ChildClassName}Entity>lambdaQuery().in(${ChildClassName}Entity::$str.getProperty($childField), ids));\n return Boolean.TRUE;\n }\n\n @Override\n @Transactional(rollbackFor = Exception.class)\n public Boolean removeChild(Long[] ids) {\n ${childClassName}Mapper.deleteBatchIds(CollUtil.toList(ids));\n return Boolean.TRUE;\n }\n#end\n}', '2023-02-23 01:17:36', '2023-08-27 23:29:58', '0', 1, ' ', ' ');
|
||||
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, '实体', '${backendPath}/src/main/java/${packagePath}/${moduleName}/entity/${ClassName}Entity.java', 'Entity', 'package ${package}.${moduleName}.entity;\n\nimport com.baomidou.mybatisplus.annotation.*;\nimport com.baomidou.mybatisplus.extension.activerecord.Model;\nimport io.swagger.v3.oas.annotations.media.Schema;\nimport lombok.Data;\nimport lombok.EqualsAndHashCode;\n#if($isTenant)\nimport com.pig4cloud.pigx.common.core.util.TenantTable;\n#end\n#foreach($import in $importList)\nimport $import;\n#end\n#if($ChildClassName)\nimport com.alibaba.excel.annotation.ExcelIgnore;\nimport com.github.yulichang.annotation.EntityMapping;\nimport java.util.List;\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(\"${tableName}\")\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.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 == \'checkbox\')\n private ${field.attrType}[] $field.attrName;\n#else\n private $field.attrType $field.attrName;\n#end \n#end\n#if($ChildClassName)\n @ExcelIgnore\n @TableField(exist = false)\n @EntityMapping(thisField = \"$mainField\", joinField = \"$childField\")\n private List<${ChildClassName}Entity> ${childClassName}List;\n#end\n}', '2023-02-23 01:17:53', '2024-05-12 15:15:47', '0', 1, '', '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, 'Mapper', '${backendPath}/src/main/java/${packagePath}/${moduleName}/mapper/${ClassName}Mapper.java', 'Mapper', 'package ${package}.${moduleName}.mapper;\n\nimport com.pig4cloud.pigx.common.data.datascope.PigxBaseMapper;\nimport ${package}.${moduleName}.entity.${ClassName}Entity;\nimport org.apache.ibatis.annotations.Mapper;\n\n@Mapper\npublic interface ${ClassName}Mapper extends PigxBaseMapper<${ClassName}Entity> {\n\n\n}', '2023-02-23 01:18:18', '2023-08-13 13:52:50', '0', 1, ' ', ' ');
|
||||
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, 'Mapper.xml', '${backendPath}/src/main/resources/mapper/${ClassName}Mapper.xml', 'Mapper.xml', '<?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=\"${package}.${moduleName}.entity.${ClassName}Entity\">\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\"/>\n #end\n#end\n </resultMap>\n</mapper>', '2023-02-23 01:18:35', '2023-09-23 21:36:09', '0', 1, ' ', ' ');
|
||||
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, '权限菜单', '${backendPath}/menu/${functionName}_menu.sql', 'menu.sql', '-- 该脚本不要直接执行, 注意维护菜单的父节点ID 默认 父节点-1 , 默认租户 1\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, tenant_id)\nvalues (${menuId}, \'-1\', \'/${moduleName}/${functionName}/index\', \'\', \'0\', \'icon-bangzhushouji\', \'0\', null , \'8\', null , \'${tableComment}管理\', 1);\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, tenant_id)\nvalues (${math.add($menuId,1)},${menuId}, \'${moduleName}_${functionName}_view\', \'1\', null, \'1\', \'0\', null, \'0\', null, \'${tableComment}查看\', 1);\n\ninsert into sys_menu ( menu_id,parent_id, permission, menu_type, path, icon, del_flag, create_time, sort_order, update_time, name, tenant_id)\nvalues (${math.add($menuId,2)},${menuId}, \'${moduleName}_${functionName}_add\', \'1\', null, \'1\', \'0\', null, \'1\', null, \'${tableComment}新增\', 1);\n\ninsert into sys_menu (menu_id, parent_id, permission, menu_type, path, icon, del_flag, create_time, sort_order, update_time, name, tenant_id)\nvalues (${math.add($menuId,3)},${menuId}, \'${moduleName}_${functionName}_edit\', \'1\', null, \'1\', \'0\', null, \'2\', null, \'${tableComment}修改\', 1);\n\ninsert into sys_menu (menu_id, parent_id, permission, menu_type, path, icon, del_flag, create_time, sort_order, update_time, name, tenant_id)\nvalues (${math.add($menuId,4)},${menuId}, \'${moduleName}_${functionName}_del\', \'1\', null, \'1\', \'0\', null, \'3\', null, \'${tableComment}删除\', 1);\n\ninsert into sys_menu ( menu_id,parent_id, permission, menu_type, path, icon, del_flag, create_time, sort_order, update_time, name, tenant_id)\nvalues (${math.add($menuId,5)},${menuId}, \'${moduleName}_${functionName}_export\', \'1\', null, \'1\', \'0\', null, \'3\', null, \'导入导出\', 1);', '2023-02-23 01:19:08', '2023-08-27 23:16:31', '0', 1, ' ', ' ');
|
||||
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, 'api.ts', '${frontendPath}/src/api/${moduleName}/${functionName}.ts', 'api.ts', 'import request from \"/@/utils/request\"\n\nexport function fetchList(query?: Object) {\n return request({\n url: \'/${moduleName}/${functionName}/page\',\n method: \'get\',\n params: query\n })\n}\n\nexport function addObj(obj?: Object) {\n return request({\n url: \'/${moduleName}/${functionName}\',\n method: \'post\',\n data: obj\n })\n}\n\nexport function getObj(id?: string) {\n return request({\n url: \'/${moduleName}/${functionName}/\' + id,\n method: \'get\'\n })\n}\n\nexport function delObjs(ids?: Object) {\n return request({\n url: \'/${moduleName}/${functionName}\',\n method: \'delete\',\n data: ids\n })\n}\n\nexport function putObj(obj?: Object) {\n return request({\n url: \'/${moduleName}/${functionName}\',\n method: \'put\',\n data: obj\n })\n}\n\n#if($ChildClassName)\nexport function delChildObj(ids?: Object) {\n return request({\n url: \'/${moduleName}/${functionName}/child\',\n method: \'delete\',\n data: ids\n })\n}\n#end', '2023-02-23 01:19:23', '2023-06-04 10:34:17', '0', 1, ' ', ' ');
|
||||
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, '表格', '${frontendPath}/src/views/${moduleName}/${functionName}/index.vue', '表格不含i18n', '<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.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 :label=\"item.label\" :value=\"item.value\" v-for=\"(item, index) in ${field.fieldDict}\" :key=\"index\"></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 type=\"date\" placeholder=\"请输入#if(${field.fieldComment})${field.fieldComment}#else ${field.attrName}#end\" v-model=\"state.queryForm.${field.attrName}\"></el-date-picker>\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 type=\"datetime\" placeholder=\"请输入#if(${field.fieldComment})${field.fieldComment}#else ${field.attrName}#end\" v-model=\"state.queryForm.${field.attrName}\"></el-date-picker>\n </el-form-item>\n </el-col>\n#else\n <el-form-item label=\"#if(${field.fieldComment})${field.fieldComment}#else ${field.attrName}#end\" prop=\"${field.attrName}\" >\n <el-input placeholder=\"请输入#if(${field.fieldComment})${field.fieldComment}#else ${field.attrName}#end\" v-model=\"state.queryForm.${field.attrName}\" />\n </el-form-item>\n#end\n#end\n <el-form-item>\n <el-button icon=\"search\" type=\"primary\" @click=\"getDataList\">\n 查询\n </el-button>\n <el-button icon=\"Refresh\" @click=\"resetQuery\">重置</el-button>\n </el-form-item>\n </el-form>\n </el-row>\n#end\n <el-row>\n <div class=\"mb8\" style=\"width: 100%\">\n <el-button icon=\"folder-add\" type=\"primary\" class=\"ml10\" @click=\"formDialogRef.openDialog()\"\n v-auth=\"\'${moduleName}_${functionName}_add\'\">\n 新 增\n </el-button>\n <el-button plain :disabled=\"multiple\" icon=\"Delete\" type=\"primary\"\n v-auth=\"\'${moduleName}_${functionName}_del\'\" @click=\"handleDelete(selectObjs)\">\n 删除\n </el-button>\n <right-toolbar v-model:showSearch=\"showSearch\" :export=\"\'${moduleName}_${functionName}_export\'\"\n @exportExcel=\"exportExcel\" class=\"ml10 mr20\" style=\"float: right;\"\n @queryTable=\"getDataList\"></right-toolbar>\n </div>\n </el-row>\n <el-table :data=\"state.dataList\" v-loading=\"state.loading\" border \n :cell-style=\"tableStyle.cellStyle\" :header-cell-style=\"tableStyle.headerCellStyle\"\n @selection-change=\"selectionChangHandle\"\n @sort-change=\"sortChangeHandle\">\n <el-table-column type=\"selection\" width=\"40\" align=\"center\" />\n <el-table-column type=\"index\" label=\"#\" width=\"40\" />\n #foreach($field in $gridList)\n #if($field.fieldDict)\n <el-table-column prop=\"${field.attrName}\" label=\"#if(${field.fieldComment})${field.fieldComment}#else ${field.attrName}#end\" show-overflow-tooltip>\n <template #default=\"scope\">\n <dict-tag :options=\"$field.fieldDict\" :value=\"scope.row.${field.attrName}\"></dict-tag>\n </template>\n </el-table-column>\n #else\n <el-table-column prop=\"${field.attrName}\" label=\"#if(${field.fieldComment})${field.fieldComment}#else ${field.attrName}#end\" #if(${field.gridSort} == \'1\')sortable=\"custom\"#end show-overflow-tooltip/>\n #end\n #end\n <el-table-column label=\"操作\" width=\"150\">\n <template #default=\"scope\">\n <el-button icon=\"edit-pen\" text type=\"primary\" v-auth=\"\'${moduleName}_${functionName}_edit\'\"\n @click=\"formDialogRef.openDialog(scope.row.${pk.attrName})\">编辑</el-button>\n <el-button icon=\"deleLine 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 (12, '表单', '${frontendPath}/src/views/${moduleName}/${functionName}/form.vue', '表单不含i18n', '<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#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 == \'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 #end\n #if(!$field.fieldDict)\n <el-option label=\"请选择\">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 }}\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 </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 #end\n #if(!$field.fieldDict)\n <el-checkbox label=\"启用\" name=\"type\"></el-checkbox>\n <el-checkbox label=\"禁用\" name=\"type\"></el-checkbox>\n #end\n </el-checkbox-group>\n </el-form-item>\n </el-col>\n#elseif($field.formType == \'date\')\n <el-form-item label=\"#if(${field.fieldComment})${field.fieldComment}#else ${field.attrName}#end\" prop=\"${field.attrName}\">\n <el-date-picker type=\"date\" placeholder=\"请选择#if(${field.fieldComment})${field.fieldComment}#else ${field.attrName}#end\" v-model=\"form.${field.attrName}\" :value-format=\"dateStr\"></el-date-picker>\n </el-form-item>\n </el-col>\n#elseif($field.formType == \'datetime\')\n <el-form-item label=\"#if(${field.fieldComment})${field.fieldComment}#else ${field.attrName}#end\" prop=\"${field.attrName}\">\n <el-date-picker type=\"datetime\" placeholder=\"请选择#if(${field.fieldComment})${field.fieldComment}#else ${field.attrName}#end\" v-model=\"form.${field.attrName}\" :value-format=\"dateTimeStr\"></el-date-picker>\n </el-form-item>\n </el-col>\n\n#elseif($field.formType == \'number\')\n <el-form-item label=\"#if(${field.fieldComment})${field.fieldComment}#else ${field.attrName}#end\" prop=\"${field.attrName}\">\n <el-input-number :min=\"1\" :max=\"1000\" v-model=\"form.${field.attrName}\" placeholder=\"请输入#if(${field.fieldComment})${field.fieldComment}#else ${field.attrName}#end\"></el-input-number>\n </el-form-item>\n </el-col>\n#elseif($field.formType == \'upload-file\')\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 (13, 'i18n英文模板', '${frontendPath}/src/views/${moduleName}/${functionName}/i18n/en.ts', 'i18n英文模板', 'export default {\n ${functionName}: {\n index: \'#\',\n import${className}Tip: \'import ${ClassName}\',\n#foreach($field in $fieldList)\n ${field.attrName}: \'${field.attrName}\',\n#end\n#foreach($field in $fieldList)\n input$str.pascalCase(${field.attrName})Tip: \'input ${field.attrName}\',\n#end\n }\n}', '2023-02-23 01:20:25', '2023-06-04 10:49:25', '0', 1, '', '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, 'i18n中文模板', '${frontendPath}/src/views/${moduleName}/${functionName}/i18n/zh-cn.ts', 'i18n中文模板', 'export default {\n ${functionName}: {\n index: \'#\',\n import${className}Tip: \'导入${tableComment}\',\n#foreach($field in $fieldList)\n ${field.attrName}: \'#if(${field.fieldComment})${field.fieldComment}#else ${field.attrName}#end\',\n#end\n#foreach($field in $fieldList)\n input$str.pascalCase(${field.attrName})Tip: \'请输入#if(${field.fieldComment})${field.fieldComment}#else ${field.attrName}#end\',\n#end\n }\n}', '2023-02-23 01:20:40', '2023-06-04 10:49:28', '0', 1, '', '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, '子实体', '${backendPath}/src/main/java/${packagePath}/${moduleName}/entity/${ChildClassName}Entity.java', '子表实体对象', 'package ${package}.${moduleName}.entity;\n\nimport com.baomidou.mybatisplus.annotation.*;\nimport com.baomidou.mybatisplus.extension.activerecord.Model;\nimport io.swagger.v3.oas.annotations.media.Schema;\n#if($isChildTenant)\nimport com.pig4cloud.pigx.common.core.util.TenantTable;\n#end\nimport lombok.Data;\nimport lombok.EqualsAndHashCode;\n#foreach($import in $importList)\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(\"${childTableName}\")\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.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 == \'checkbox\')\n private ${field.attrType}[] $field.attrName;\n#else\n private $field.attrType $field.attrName;\n#end \n#end\n}', '2023-06-01 11:07:14', '2024-05-12 15:07:04', '0', 1, '', '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, '主子Contoller', '${backendPath}/src/main/java/${packagePath}/${moduleName}/controller/${ClassName}Controller.java', '子表Controller对象', 'package ${package}.${moduleName}.controller;\n\n#if($queryList)\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 com.pig4cloud.pigx.common.core.util.R;\nimport com.pig4cloud.pigx.common.log.annotation.SysLog;\nimport ${package}.${moduleName}.entity.${ClassName}Entity;\nimport ${package}.${moduleName}.entity.${ChildClassName}Entity;\nimport ${package}.${moduleName}.service.${ClassName}Service;\nimport org.springframework.security.access.prepost.PreAuthorize;\nimport com.pig4cloud.pigx.common.excel.annotation.ResponseExcel;\nimport io.swagger.v3.oas.annotations.security.SecurityRequirement;\n#if($isSpringBoot3)\nimport org.springdoc.core.annotations.ParameterObject;\n#else\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.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@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 @PreAuthorize(\"@pms.hasPermission(\'${moduleName}_${functionName}_view\')\" )\n public R get${ClassName}Page(@ParameterObject Page page, @ParameterObject ${ClassName}Entity ${className}) {\n LambdaQueryWrapper<${ClassName}Entity> wrapper = Wrappers.lambdaQuery();\n#foreach ($field in $queryList)\n#set($getAttrName=$str.getProperty($field.attrName))\n#set($var=\"${className}.$getAttrName()\")\n#if($field.attrType == \'String\')\n#set($expression=\"StrUtil.isNotBlank\")\n#else\n#set($expression=\"Objects.nonNull\")\n#end\n#if($field.queryType == \'=\')\n wrapper.eq($expression($var),${ClassName}Entity::$getAttrName,$var);\n#elseif( $field.queryType == \'like\' )\n wrapper.like($expression($var),${ClassName}Entity::$getAttrName,$var);\n#elseif( $field.queryType == \'!-\' )\n wrapper.ne($expression($var),${ClassName}Entity::$getAttrName,$var);\n#elseif( $field.queryType == \'>\' )\n wrapper.gt($expression($var),${ClassName}Entity::$getAttrName,$var);\n#elseif( $field.queryType == \'<\' )\n wrapper.lt($expression($var),${ClassName}Entity::$getAttrName,$var);\n#elseif( $field.queryType == \'>=\' )\n wrapper.ge($expression($var),${ClassName}Entity::$getAttrName,$var);\n#elseif( $field.queryType == \'<=\' )\n wrapper.le($expression($var),${ClassName}Entity::$getAttrName,$var);\n#elseif( $field.queryType == \'left like\' )\n wrapper.likeLeft($expression($var),${ClassName}Entity::$getAttrName,$var);\n#elseif( $field.queryType == \'right like\' )\n wrapper.likeRight($expression($var),${ClassName}Entity::$getAttrName,$var);\n#end\n#end\n return R.ok(${className}Service.page(page, wrapper));\n }\n\n /**\n * 通过id查询${tableComment}\n * @param ${pk.attrName} id\n * @return R\n */\n @Operation(summary = \"通过id查询\" , description = \"通过id查询\" )\n @GetMapping(\"/{${pk.attrName}}\" )\n @PreAuthorize(\"@pms.hasPermission(\'${moduleName}_${functionName}_view\')\" )\n public R getById(@PathVariable(\"${pk.attrName}\" ) ${pk.attrType} ${pk.attrName}) {\n return R.ok(${className}Service.getByIdDeep(${pk.attrName}));\n }\n\n /**\n * 新增${tableComment}\n * @param ${className} ${tableComment}\n * @return R\n */\n @Operation(summary = \"新增${tableComment}\" , description = \"新增${tableComment}\" )\n @SysLog(\"新增${tableComment}\" )\n @PostMapping\n @PreAuthorize(\"@pms.hasPermission(\'${moduleName}_${functionName}_add\')\" )\n public R save(@RequestBody ${ClassName}Entity ${className}) {\n return R.ok(${className}Service.saveDeep(${className}));\n }\n\n /**\n * 修改${tableComment}\n * @param ${className} ${tableComment}\n * @return R\n */\n @Operation(sumLine 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 (17, '主子表单', '${frontendPath}/src/views/${moduleName}/${functionName}/form.vue', '子表表单', '<template>\n <el-drawer :title=\"form.${pk.attrName} ? (detail ? \'详情\' : \'编辑\') : \'添加\'\" v-model=\"visible\" size=\"50%\">\n <el-form ref=\"dataFormRef\" :model=\"form\" :rules=\"dataRules\" label-width=\"90px\" :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 == \'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 #end\n #if(!$field.fieldDict)\n <el-option label=\"请选择\">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 }}\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 </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 #end\n #if(!$field.fieldDict)\n <el-checkbox label=\"启用\" name=\"type\"></el-checkbox>\n <el-checkbox label=\"禁用\" name=\"type\"></el-checkbox>\n #end\n </el-checkbox-group>\n </el-form-item>\n </el-col>\n#elseif($field.formType == \'date\')\n <el-form-item label=\"#if(${field.fieldComment})${field.fieldComment}#else ${field.attrName}#end\" prop=\"${field.attrName}\">\n <el-date-picker type=\"date\" placeholder=\"请选择#if(${field.fieldComment})${field.fieldComment}#else ${field.attrName}#end\" v-model=\"form.${field.attrName}\" :value-format=\"dateStr\"></el-date-picker>\n </el-form-item>\n </el-col>\n#elseif($field.formType == \'datetime\')\n <el-form-item label=\"#if(${field.fieldComment})${field.fieldComment}#else ${field.attrName}#end\" prop=\"${field.attrName}\">\n <el-date-picker type=\"datetime\" placeholder=\"请选择#if(${field.fieldComment})${field.fieldComment}#else ${field.attrName}#end\" v-model=\"form.${field.attrName}\" :value-format=\"dateTimeStr\"></el-date-picker>\n </el-form-item>\n </el-col>\n#elseif($field.formType == \'number\')\n <el-form-item label=\"#if(${field.fieldComment})${field.fieldComment}#else ${field.attrName}#end\" prop=\"${field.attrName}\">\n <el-input-number :min=\"1\" :max=\"1000\" v-model=\"form.${field.attrName}\" placeholder=\"请输入#if(${field.fieldComment})${field.fieldComment}#else ${field.attrName}#end\"></el-input-number>\n </el-form-item>\n </el-col>\n#elseif($field.formType == \'upload-file\')\n <el-form-item label=\"#if(${field.fieldComment})${field.fieldComment}#else ${field.attrNameLine 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 (18, '主子表格', '${frontendPath}/src/views/${moduleName}/${functionName}/index.vue', '子表单表格', '<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.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 :label=\"item.label\" :value=\"item.value\" v-for=\"(item, index) in ${field.fieldDict}\" :key=\"index\"></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 type=\"date\" placeholder=\"请输入#if(${field.fieldComment})${field.fieldComment}#else ${field.attrName}#end\" v-model=\"state.queryForm.${field.attrName}\"></el-date-picker>\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 type=\"datetime\" placeholder=\"请输入#if(${field.fieldComment})${field.fieldComment}#else ${field.attrName}#end\" v-model=\"state.queryForm.${field.attrName}\"></el-date-picker>\n </el-form-item>\n </el-col>\n#else\n <el-form-item label=\"#if(${field.fieldComment})${field.fieldComment}#else ${field.attrName}#end\" prop=\"${field.attrName}\" >\n <el-input placeholder=\"请输入#if(${field.fieldComment})${field.fieldComment}#else ${field.attrName}#end\" v-model=\"state.queryForm.${field.attrName}\"\n style=\"max-width: 180px\" />\n </el-form-item>\n#end\n#end\n <el-form-item>\n <el-button icon=\"search\" type=\"primary\" @click=\"getDataList\">\n 查询\n </el-button>\n <el-button icon=\"Refresh\" @click=\"resetQuery\">重置</el-button>\n </el-form-item>\n </el-form>\n </el-row>\n#end\n <el-row>\n <div class=\"mb8\" style=\"width: 100%\">\n <el-button icon=\"folder-add\" type=\"primary\" class=\"ml10\" @click=\"formDialogRef.openDialog()\"\n v-auth=\"\'${moduleName}_${functionName}_add\'\">\n 新 增\n </el-button>\n <el-button plain :disabled=\"multiple\" icon=\"Delete\" type=\"primary\"\n v-auth=\"\'${moduleName}_${functionName}_del\'\" @click=\"handleDelete(selectObjs)\">\n 删除\n </el-button>\n <right-toolbar v-model:showSearch=\"showSearch\" :export=\"\'${moduleName}_${functionName}_export\'\"\n @exportExcel=\"exportExcel\" class=\"ml10 mr20\" style=\"float: right;\"\n @queryTable=\"getDataList\"></right-toolbar>\n </div>\n </el-row>\n <el-table :data=\"state.dataList\" v-loading=\"state.loading\" border \n :cell-style=\"tableStyle.cellStyle\" :header-cell-style=\"tableStyle.headerCellStyle\"\n @selection-change=\"selectionChangeHandle\" @sort-change=\"sortChangeHandle\">\n <el-table-column type=\"selection\" width=\"40\" align=\"center\" />\n <el-table-column type=\"index\" label=\"#\" width=\"40\" />\n #foreach($field in $gridList)\n #if($field.fieldDict)\n <el-table-column prop=\"${field.attrName}\" label=\"#if(${field.fieldComment})${field.fieldComment}#else ${field.attrName}#end\" show-overflow-tooltip>\n <template #default=\"scope\">\n <dict-tag :options=\"$field.fieldDict\" :value=\"scope.row.${field.attrName}\"></dict-tag>\n </template>\n </el-table-column>\n #else\n <el-table-column prop=\"${field.attrName}\" label=\"#if(${field.fieldComment})${field.fieldComment}#else ${field.attrName}#end\" #if(${field.gridSort} == \'1\')sortable=\"custom\"#end show-overflow-tooltip/>\n #end\n #end\n <el-table-column label=\"操作\" width=\"200\">\n <template #default=\"scope\">\n #if($ChildClassName)\n <el-button text type=\"primary\" icon=\"view\" v-auth=\"\'sys_role_edit\'\" @click=\"formDialogRef.openDialog(scope.row.${pk.attrName}, true)\">\n 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 (19, '子Mapper', '${backendPath}/src/main/java/${packagePath}/${moduleName}/mapper/${ChildClassName}Mapper.java', '子Mapper', 'package ${package}.${moduleName}.mapper;\n\nimport com.pig4cloud.pigx.common.data.datascope.PigxBaseMapper;\n#if($ChildClassName)\nimport ${package}.${moduleName}.entity.${ChildClassName}Entity;\n#else\nimport ${package}.${moduleName}.entity.${ClassName}Entity;\n#end\nimport org.apache.ibatis.annotations.Mapper;\n\n@Mapper\n#if($ChildClassName)\npublic interface ${ChildClassName}Mapper extends PigxBaseMapper<${ChildClassName}Entity> {\n#else\npublic interface ${ClassName}Mapper extends PigxBaseMapper<${ClassName}Entity> {\n#end\n\n}', '2023-02-23 01:18:18', '2023-08-07 09:54:36', '0', 1, ' ', ' ');
|
||||
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;
|
||||
|
||||
-- ----------------------------
|
||||
@@ -269,28 +297,51 @@ CREATE TABLE `gen_template_group` (
|
||||
-- Records of gen_template_group
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `gen_template_group` VALUES (1, 3);
|
||||
INSERT INTO `gen_template_group` VALUES (1, 4);
|
||||
INSERT INTO `gen_template_group` VALUES (1, 5);
|
||||
INSERT INTO `gen_template_group` VALUES (1, 6);
|
||||
INSERT INTO `gen_template_group` VALUES (1, 7);
|
||||
INSERT INTO `gen_template_group` VALUES (1, 8);
|
||||
INSERT INTO `gen_template_group` VALUES (1, 9);
|
||||
INSERT INTO `gen_template_group` VALUES (1, 10);
|
||||
INSERT INTO `gen_template_group` VALUES (1, 11);
|
||||
INSERT INTO `gen_template_group` VALUES (1, 12);
|
||||
INSERT INTO `gen_template_group` VALUES (2, 4);
|
||||
INSERT INTO `gen_template_group` VALUES (2, 5);
|
||||
INSERT INTO `gen_template_group` VALUES (2, 6);
|
||||
INSERT INTO `gen_template_group` VALUES (2, 7);
|
||||
INSERT INTO `gen_template_group` VALUES (2, 8);
|
||||
INSERT INTO `gen_template_group` VALUES (2, 9);
|
||||
INSERT INTO `gen_template_group` VALUES (2, 10);
|
||||
INSERT INTO `gen_template_group` VALUES (2, 15);
|
||||
INSERT INTO `gen_template_group` VALUES (2, 16);
|
||||
INSERT INTO `gen_template_group` VALUES (2, 17);
|
||||
INSERT INTO `gen_template_group` VALUES (2, 18);
|
||||
INSERT INTO `gen_template_group` VALUES (2, 19);
|
||||
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;
|
||||
|
||||
-- ----------------------------
|
||||
@@ -299,14 +350,14 @@ COMMIT;
|
||||
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_0900_ai_ci NOT NULL COMMENT '表名称',
|
||||
`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_0900_ai_ci 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_0900_ai_ci NOT NULL COMMENT '字段信息',
|
||||
`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
|
||||
|
||||
+54
-111
@@ -19,10 +19,10 @@ CREATE TABLE `app_article` (
|
||||
`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 NOT 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,
|
||||
`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='文章资讯表';
|
||||
@@ -47,7 +47,7 @@ CREATE TABLE `app_article_category` (
|
||||
`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,
|
||||
`tenant_id` bigint(20) DEFAULT NULL,
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='文章分类表';
|
||||
|
||||
@@ -65,12 +65,12 @@ 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 NOT NULL COMMENT '创建时间',
|
||||
`update_time` datetime NOT NULL 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 '是否删除',
|
||||
`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,
|
||||
`tenant_id` bigint(20) DEFAULT NULL,
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='文章收藏表';
|
||||
|
||||
@@ -80,6 +80,30 @@ CREATE TABLE `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
|
||||
-- ----------------------------
|
||||
@@ -94,7 +118,7 @@ CREATE TABLE `app_page` (
|
||||
`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,
|
||||
`tenant_id` bigint(20) DEFAULT NULL,
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='页面装修表';
|
||||
|
||||
@@ -102,9 +126,10 @@ CREATE TABLE `app_page` (
|
||||
-- Records of app_page
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `app_page` VALUES (1, 1, '商城首页', '[{\"title\":\"搜索\",\"name\":\"search\",\"disabled\":1,\"content\":{},\"styles\":{}},{\"title\":\"首页轮播图\",\"name\":\"banner\",\"content\":{\"enabled\":1,\"data\":[{\"image\":\"/api/static/banner01.png\",\"name\":\"\",\"link\":{\"path\":\"/pages/index/index\",\"name\":\"商城首页\",\"type\":\"shop\"}}]},\"styles\":{}},{\"title\":\"导航菜单\",\"name\":\"nav\",\"content\":{\"enabled\":1,\"data\":[{\"image\":\"https://minio.pigx.top/oss/app/nav01.png\",\"name\":\"资讯中心\",\"link\":{\"path\":\"/pages/news/news\",\"name\":\"文章资讯\",\"type\":\"shop\"}},{\"image\":\"https://minio.pigx.top/oss/app/nav02.png\",\"name\":\"我的收藏\",\"link\":{\"path\":\"/pages/collection/collection\",\"name\":\"我的收藏\",\"type\":\"shop\"}},{\"image\":\"https://minio.pigx.top/oss/app/nav03.png\",\"name\":\"个人设置\",\"link\":{\"path\":\"/pages/user_set/user_set\",\"name\":\"个人设置\",\"type\":\"shop\"}},{\"image\":\"https://minio.pigx.top/oss/app/nav04.png\",\"name\":\"联系客服\",\"link\":{\"path\":\"/pages/customer_service/customer_service\",\"name\":\"联系客服\",\"type\":\"shop\"}},{\"image\":\"https://minio.pigx.top/oss/app/nav05.png\",\"name\":\"关于我们\",\"link\":{\"path\":\"/pages/as_us/as_us\",\"name\":\"关于我们\",\"type\":\"shop\"}}]},\"styles\":{}},{\"id\":\"l84almsk2uhyf\",\"title\":\"资讯\",\"name\":\"news\",\"disabled\":1,\"content\":{},\"styles\":{}}]', NULL, 'admin', NULL, '2023-06-15 09:18:02', '0',1);
|
||||
INSERT INTO `app_page` VALUES (2, 2, '个人中心', '[{\"title\":\"用户信息\",\"name\":\"user-info\",\"disabled\":1,\"content\":{},\"styles\":{}},{\"title\":\"我的服务\",\"name\":\"my-service\",\"content\":{\"style\":2,\"title\":\"服务中心\",\"data\":[{\"image\":\"https://minio.pigx.top/oss/app/user_collect.png\",\"name\":\"我的收藏\",\"link\":{\"path\":\"/pages/collection/collection\",\"name\":\"我的收藏\",\"type\":\"shop\"}},{\"image\":\"https://minio.pigx.top/oss/app/user_setting.png\",\"name\":\"个人设置\",\"link\":{\"path\":\"/pages/user_set/user_set\",\"name\":\"个人设置\",\"type\":\"shop\"}},{\"image\":\"https://minio.pigx.top/oss/app/user_kefu.png\",\"name\":\"联系客服\",\"link\":{\"path\":\"/pages/customer_service/customer_service\",\"name\":\"联系客服\",\"type\":\"shop\"}}]},\"styles\":{}},{\"title\":\"个人中心广告图\",\"name\":\"user-banner\",\"content\":{\"enabled\":1,\"data\":[{\"image\":\"\",\"name\":\"sdds\",\"link\":{\"path\":\"/pages/user/user\",\"name\":\"个人中心\",\"type\":\"shop\"}}]},\"styles\":{}}]', NULL, 'admin', NULL, '2023-06-18 17:00:05', '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/local/adc5061f99e9440abcd9b22572909c88.jpg\"},\"styles\":{}}]', NULL, 'admin', NULL, '2023-06-14 13:12:19', '0',1);
|
||||
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;
|
||||
|
||||
-- ----------------------------
|
||||
@@ -114,9 +139,11 @@ 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 '已选图标',
|
||||
`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 '创建人',
|
||||
@@ -130,113 +157,29 @@ CREATE TABLE `app_tabbar` (
|
||||
-- Records of app_tabbar
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `app_tabbar` VALUES (1, '首页', 'https://minio.pigx.top/oss/app/tabbar0.png', 'https://minio.pigx.top/oss/app/tabbar0_0.png', '{\"path\":\"/pages/index/index\",\"name\":\"商城首页\",\"type\":\"shop\"}', NULL, '2023-06-15 09:16:25', NULL, 'admin', '0',1);
|
||||
INSERT INTO `app_tabbar` VALUES (2, '资讯', 'https://minio.pigx.top/oss/app/tabbar1.png', 'https://minio.pigx.top/oss/app/tabbar1_1.png', '{\"path\":\"/pages/news/news\",\"name\":\"文章资讯\",\"type\":\"shop\"}', NULL, '2023-06-15 09:16:25', NULL, 'admin', '0',1);
|
||||
INSERT INTO `app_tabbar` VALUES (3, '我的', 'https://minio.pigx.top/oss/app/tabbar3.png', 'https://minio.pigx.top/oss/app/tabbar3_3.png', '{\"path\":\"/pages/user/user\",\"name\":\"个人中心\",\"type\":\"shop\"}', NULL, '2023-06-15 09:16:25', NULL, 'admin', '0',1);
|
||||
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
|
||||
-- Table structure for app_role_tabbar
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `app_role`;
|
||||
CREATE TABLE `app_role` (
|
||||
`role_id` bigint(20) NOT NULL,
|
||||
`role_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||
`role_code` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||
`role_desc` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||
`create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT ' ' COMMENT '创建人',
|
||||
`update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT ' ' COMMENT '修改人',
|
||||
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
`update_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
|
||||
`del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '0',
|
||||
`tenant_id` bigint(20) DEFAULT NULL,
|
||||
PRIMARY KEY (`role_id`) USING BTREE,
|
||||
KEY `role_idx1_role_code` (`role_code`) USING BTREE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='app角色表';
|
||||
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
|
||||
-- Records of app_role_tabbar
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `app_role` VALUES (1, 'app用户', 'APP_USER', 'app用户角色', '', '', '2022-12-07 06:34:18', '2023-03-09 06:34:42', '0', 1);
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for app_social_details
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `app_social_details`;
|
||||
CREATE TABLE `app_social_details` (
|
||||
`id` bigint(20) NOT NULL COMMENT '主键', -- 主键
|
||||
`type` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '社交类型', -- 社交类型
|
||||
`remark` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '备注', -- 备注
|
||||
`app_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '应用ID', -- 应用ID
|
||||
`app_secret` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '应用密钥', -- 应用密钥
|
||||
`redirect_url` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '重定向URL', -- 重定向URL
|
||||
`ext` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '拓展字段', -- 拓展字段
|
||||
`create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT ' ' COMMENT '创建人', -- 创建人
|
||||
`update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT ' ' 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 '删除标志', -- 删除标志
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC
|
||||
COMMENT='系统社交登录账号表'; -- 系统社交登录账号表
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of app_social_details
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `app_social_details` VALUES (1, 'MINI', '小程序登录', 'app_id', 'app_secret', 'http://www.baidu.com123', NULL, '', 'admin', '2022-12-09 01:44:42', '2023-04-03 06:12:30', '0');
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for app_user
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `app_user`;
|
||||
CREATE TABLE `app_user` (
|
||||
`user_id` bigint(20) NOT NULL COMMENT '用户id',
|
||||
`username` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '用户名',
|
||||
`password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '密码',
|
||||
`salt` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '盐值',
|
||||
`phone` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '手机号码',
|
||||
`avatar` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '头像图片链接',
|
||||
`nickname` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '拓展字段:昵称',
|
||||
`name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '拓展字段:姓名',
|
||||
`email` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '拓展字段:邮箱',
|
||||
`create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '创建人',
|
||||
`update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT ' ' COMMENT '修改人',
|
||||
`create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`update_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
|
||||
`del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '删除标志',
|
||||
`tenant_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '所属租户id',
|
||||
`last_modified_time` datetime DEFAULT NULL COMMENT '最后一次密码修改时间',
|
||||
`lock_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '锁定状态',
|
||||
`wx_openid` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '微信登录openId',
|
||||
PRIMARY KEY (`user_id`) USING BTREE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='app用户表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of app_user
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `app_user` VALUES (1, 'appuser', '$2a$10$XQu3TmORLqDWayFspQN.U.LigJ5TWPTdXPIn/6SxGHKED3PVpuMH6', NULL, '13054729089', NULL, 'aeizzz', '刘洪磊', 'aeizzz@foxmail.com', '', 'appuser', '2022-12-07 02:59:38', '2023-03-09 15:14:44', '0', 1, NULL, '0', 'oBxPy5EnbDiN-gGEaovCpp_IkrkQ');
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for app_user_role
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `app_user_role`;
|
||||
CREATE TABLE `app_user_role` (
|
||||
`user_id` bigint(20) NOT NULL COMMENT '用户ID',
|
||||
`role_id` bigint(20) NOT NULL COMMENT '角色ID',
|
||||
PRIMARY KEY (`user_id`,`role_id`) USING BTREE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='用户角色表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of app_user_role
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `app_user_role` VALUES (1, 1);
|
||||
INSERT INTO `app_role_tabbar` VALUES (1, 2, 1);
|
||||
INSERT INTO `app_role_tabbar` VALUES (1, 3, 1);
|
||||
COMMIT;
|
||||
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
+3624
-978
File diff suppressed because it is too large.
Load diff
+4
-1
@@ -1,4 +1,4 @@
|
||||
FROM mysql/mysql-server:8.0.32
|
||||
FROM registry.cn-hangzhou.aliyuncs.com/dockerhub_mirror/mysql-server:8.0.32
|
||||
|
||||
MAINTAINER lengleng(wangiegie@gmail.com)
|
||||
|
||||
@@ -26,3 +26,6 @@ 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
|
||||
+20
-18
@@ -1,9 +1,7 @@
|
||||
# 使用说明 V5.2
|
||||
# 使用说明 V6.0 - 微服务架构版本
|
||||
# 1. 使用docker-compose 宿主机不需要配置host来发现
|
||||
# 2. 无需修改源码,根目录 docker-compose up 即可
|
||||
# 3. 静静等待服务启动
|
||||
|
||||
version: '3'
|
||||
services:
|
||||
pigx-mysql:
|
||||
build:
|
||||
@@ -20,7 +18,7 @@ services:
|
||||
|
||||
pigx-redis:
|
||||
container_name: pigx-redis
|
||||
image: redis:6.2.6
|
||||
image: registry.cn-hangzhou.aliyuncs.com/dockerhub_mirror/redis
|
||||
restart: always
|
||||
networks:
|
||||
- spring_cloud_default
|
||||
@@ -33,6 +31,8 @@ services:
|
||||
image: pigx-register
|
||||
ports:
|
||||
- 8848:8848
|
||||
- 9848:9848
|
||||
- 18080:18080
|
||||
networks:
|
||||
- spring_cloud_default
|
||||
|
||||
@@ -65,21 +65,12 @@ services:
|
||||
networks:
|
||||
- spring_cloud_default
|
||||
|
||||
pigx-flow-task:
|
||||
pigx-flow-biz:
|
||||
build:
|
||||
context: ./pigx-flow/pigx-flow-task/pigx-flow-task-biz
|
||||
context: ./pigx-flow/pigx-flow-biz
|
||||
restart: always
|
||||
container_name: pigx-flow-task
|
||||
image: pigx-flow-task
|
||||
networks:
|
||||
- spring_cloud_default
|
||||
|
||||
pigx-flow-engine:
|
||||
build:
|
||||
context: ./pigx-flow/pigx-flow-engine/pigx-flow-engine-biz
|
||||
restart: always
|
||||
container_name: pigx-flow-engine
|
||||
image: pigx-flow-engine
|
||||
container_name: pigx-flow-biz
|
||||
image: pigx-flow-biz
|
||||
networks:
|
||||
- spring_cloud_default
|
||||
|
||||
@@ -121,6 +112,17 @@ services:
|
||||
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: ./pigx-visual/pigx-codegen
|
||||
@@ -172,5 +174,5 @@ services:
|
||||
|
||||
networks:
|
||||
spring_cloud_default:
|
||||
name: 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
|
||||
|
||||
@@ -1,37 +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
|
||||
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>5.5.0</version>
|
||||
</parent>
|
||||
<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>
|
||||
<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-extension</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>
|
||||
</dependencies>
|
||||
<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<>();
|
||||
|
||||
}
|
||||
-30
@@ -1,30 +0,0 @@
|
||||
package com.pig4cloud.pigx.app.api.dto;
|
||||
|
||||
import com.pig4cloud.pigx.app.api.entity.AppUser;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Schema(description = "APP用户传输对象")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class AppUserDTO extends AppUser {
|
||||
|
||||
/**
|
||||
* 角色ID
|
||||
*/
|
||||
@Schema(description = "角色id集合")
|
||||
private List<Long> role;
|
||||
|
||||
/**
|
||||
* 新密码
|
||||
*/
|
||||
@Schema(description = "新密码")
|
||||
private String newpassword1;
|
||||
|
||||
@Schema(description = "验证码")
|
||||
private String mobileCode;
|
||||
|
||||
}
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
package com.pig4cloud.pigx.app.api.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
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;
|
||||
|
||||
+65
-53
@@ -1,7 +1,7 @@
|
||||
package com.pig4cloud.pigx.app.api.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
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;
|
||||
@@ -22,65 +22,77 @@ import java.time.LocalDateTime;
|
||||
@Schema(description = "文章收藏表")
|
||||
public class AppArticleCollectEntity extends Model<AppArticleCollectEntity> {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description = "主键")
|
||||
private Long id;
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description = "主键")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
@Schema(description = "用户ID")
|
||||
private Long userId;
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
@Schema(description = "用户ID")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 文章ID
|
||||
*/
|
||||
@Schema(description = "文章ID")
|
||||
private Long articleId;
|
||||
/**
|
||||
* 文章ID
|
||||
*/
|
||||
@Schema(description = "文章ID")
|
||||
private Long articleId;
|
||||
|
||||
/**
|
||||
* 文章标题
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String title;
|
||||
/**
|
||||
* 文章标题
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建人")
|
||||
private String createBy;
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@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 String updateBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description = "更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description = "更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
@TableLogic
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "是否删除")
|
||||
private String delFlag;
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
@TableLogic
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "是否删除")
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 图片
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String image;
|
||||
|
||||
/**
|
||||
* 访问次数
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private Long visit;
|
||||
|
||||
}
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
package com.pig4cloud.pigx.app.api.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
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;
|
||||
|
||||
+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;
|
||||
}
|
||||
+13
-4
@@ -1,15 +1,20 @@
|
||||
package com.pig4cloud.pigx.app.api.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
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
|
||||
@@ -17,6 +22,7 @@ import java.time.LocalDateTime;
|
||||
@Data
|
||||
@TenantTable
|
||||
@TableName("app_page")
|
||||
@FieldNameConstants
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "页面")
|
||||
public class AppPageEntity extends Model<AppPageEntity> {
|
||||
@@ -29,7 +35,7 @@ public class AppPageEntity extends Model<AppPageEntity> {
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 页面类型
|
||||
* 页面类型,对应 {@link com.pig4cloud.pigx.app.api.enums.PageTypeEnums}
|
||||
*/
|
||||
@Schema(description = "页面类型")
|
||||
private Integer pageType;
|
||||
@@ -41,7 +47,10 @@ public class AppPageEntity extends Model<AppPageEntity> {
|
||||
private String pageName;
|
||||
|
||||
/**
|
||||
* 页面数据
|
||||
* 页面装修组件 JSON。
|
||||
* <p>
|
||||
* 只保存页面内部组件,例如搜索、轮播、导航块、服务块等;
|
||||
* 运行时需要 Tabbar 时由服务层聚合 {@code app_tabbar} 返回。
|
||||
*/
|
||||
@Schema(description = "页面数据")
|
||||
private String pageData;
|
||||
|
||||
-107
@@ -1,107 +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.app.api.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.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;
|
||||
|
||||
/**
|
||||
* app角色表
|
||||
*
|
||||
* @author aeizzz
|
||||
* @date 2022-12-07 09:52:03
|
||||
*/
|
||||
@Data
|
||||
@TenantTable
|
||||
@TableName("app_role")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "app角色表")
|
||||
public class AppRole extends Model<AppRole> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* roleId
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description = "roleId")
|
||||
private Long roleId;
|
||||
|
||||
/**
|
||||
* roleName
|
||||
*/
|
||||
@Schema(description = "roleName")
|
||||
private String roleName;
|
||||
|
||||
/**
|
||||
* roleCode
|
||||
*/
|
||||
@Schema(description = "roleCode")
|
||||
private String roleCode;
|
||||
|
||||
/**
|
||||
* roleDesc
|
||||
*/
|
||||
@Schema(description = "roleDesc")
|
||||
private String roleDesc;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@Schema(description = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
@Schema(description = "修改人")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* createTime
|
||||
*/
|
||||
@Schema(description = "createTime")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* updateTime
|
||||
*/
|
||||
@Schema(description = "updateTime")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* delFlag
|
||||
*/
|
||||
@Schema(description = "delFlag")
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* tenantId
|
||||
*/
|
||||
@Schema(description = "tenantId", hidden = true)
|
||||
private Long tenantId;
|
||||
|
||||
}
|
||||
+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;
|
||||
|
||||
}
|
||||
-125
@@ -1,125 +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.app.api.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import com.pig4cloud.pigx.common.core.sensitive.Sensitive;
|
||||
import com.pig4cloud.pigx.common.core.util.ValidGroup;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* app 社交账号登录
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "第三方账号信息")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class AppSocialDetails extends Model<AppSocialDetails> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主鍵
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description = "主键")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
@NotBlank(message = "类型不能为空")
|
||||
@Schema(description = "账号类型")
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
@Schema(description = "描述")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* appid
|
||||
*/
|
||||
@Sensitive(prefixNoMaskLen = 4, suffixNoMaskLen = 4)
|
||||
@NotBlank(message = "账号不能为空")
|
||||
@Schema(description = "appId")
|
||||
private String appId;
|
||||
|
||||
/**
|
||||
* app_secret
|
||||
*/
|
||||
@Sensitive(prefixNoMaskLen = 4, suffixNoMaskLen = 4)
|
||||
@NotBlank(message = "密钥不能为空", groups = { ValidGroup.Insert.class })
|
||||
@Schema(description = "app secret")
|
||||
private String appSecret;
|
||||
|
||||
/**
|
||||
* 回调地址
|
||||
*/
|
||||
@Schema(description = "回调地址")
|
||||
private String redirectUrl;
|
||||
|
||||
/**
|
||||
* 拓展字段
|
||||
*/
|
||||
@Schema(description = "拓展字段")
|
||||
private String ext;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
@Schema(description = "修改人")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Schema(description = "创建时间")
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@Schema(description = "更新时间")
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 删除标记
|
||||
*/
|
||||
@TableLogic
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "删除标记,1:已删除,0:正常")
|
||||
private String delFlag;
|
||||
|
||||
}
|
||||
+28
-7
@@ -1,7 +1,7 @@
|
||||
package com.pig4cloud.pigx.app.api.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
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;
|
||||
@@ -12,7 +12,10 @@ 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
|
||||
@@ -38,25 +41,43 @@ public class AppTabbarEntity extends Model<AppTabbarEntity> {
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 未选图标
|
||||
* 选中态图标名。
|
||||
* <p>
|
||||
* 保存 Wot UI 内置图标名称,例如 {@code home-fill}。
|
||||
*/
|
||||
@Schema(description = "未选图标")
|
||||
@Schema(description = "选中态图标名")
|
||||
private String selected;
|
||||
|
||||
/**
|
||||
* 已选图标
|
||||
* 未选中态图标名。
|
||||
* <p>
|
||||
* 保存 Wot UI 内置图标名称,例如 {@code home}。
|
||||
*/
|
||||
@Schema(description = "已选图标")
|
||||
@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;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
|
||||
-161
@@ -1,161 +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.app.api.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
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用户表
|
||||
*
|
||||
* @author aeizzz
|
||||
* @date 2022-12-07 09:52:03
|
||||
*/
|
||||
@Data
|
||||
@TenantTable
|
||||
@TableName("app_user")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "app用户表")
|
||||
public class AppUser extends Model<AppUser> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* userId
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description = "userId")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
@Schema(description = "用户名")
|
||||
private String username;
|
||||
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
@Schema(description = "密码")
|
||||
private String password;
|
||||
|
||||
/**
|
||||
* 随机盐
|
||||
*/
|
||||
@JsonIgnore
|
||||
@Schema(description = "随机盐")
|
||||
private String salt;
|
||||
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
@Schema(description = "手机号")
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 头像
|
||||
*/
|
||||
@Schema(description = "头像")
|
||||
private String avatar;
|
||||
|
||||
/**
|
||||
* 昵称
|
||||
*/
|
||||
@Schema(description = "拓展字段:昵称")
|
||||
private String nickname;
|
||||
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
@Schema(description = "拓展字段:姓名")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 邮箱
|
||||
*/
|
||||
@Schema(description = "拓展字段:邮箱")
|
||||
private String email;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@Schema(description = "创建人")
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
@Schema(description = "修改人")
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Schema(description = "创建时间")
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@Schema(description = "修改时间")
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 删除标记
|
||||
*/
|
||||
@Schema(description = "删除标记,1:已删除,0:正常")
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@TableLogic
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 所属租户
|
||||
*/
|
||||
@Schema(description = "所属租户", hidden = true)
|
||||
private Long tenantId;
|
||||
|
||||
/**
|
||||
* 最后一次密码修改时间
|
||||
*/
|
||||
@Schema(description = "最后一次密码修改时间")
|
||||
private LocalDateTime lastModifiedTime;
|
||||
|
||||
/**
|
||||
* 锁定标记
|
||||
*/
|
||||
@Schema(description = "锁定标记")
|
||||
private String lockFlag;
|
||||
|
||||
/**
|
||||
* 微信小程序登录openId
|
||||
*/
|
||||
@Schema(description = "微信小程序登录openId")
|
||||
private String wxOpenid;
|
||||
|
||||
}
|
||||
+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;
|
||||
}
|
||||
|
||||
}
|
||||
-83
@@ -1,83 +0,0 @@
|
||||
package com.pig4cloud.pigx.app.api.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnore;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.alibaba.excel.annotation.write.style.ColumnWidth;
|
||||
import com.pig4cloud.pigx.common.excel.annotation.ExcelLine;
|
||||
import lombok.Data;
|
||||
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
@ColumnWidth(30)
|
||||
public class AppUserExcelVO {
|
||||
|
||||
/**
|
||||
* 导入时候回显行号
|
||||
*/
|
||||
@ExcelLine
|
||||
@ExcelIgnore
|
||||
private Long lineNum;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@ExcelProperty("用户编号")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
@NotBlank(message = "用户名不能为空")
|
||||
@ExcelProperty("用户名")
|
||||
private String username;
|
||||
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
@NotBlank(message = "手机号不能为空")
|
||||
@ExcelProperty("手机号")
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
@NotBlank(message = "昵称不能为空")
|
||||
@ExcelProperty("昵称")
|
||||
private String nickname;
|
||||
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
@NotBlank(message = "姓名不能为空")
|
||||
@ExcelProperty("姓名")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
@NotBlank(message = "邮箱不能为空")
|
||||
@ExcelProperty("邮箱")
|
||||
private String email;
|
||||
|
||||
/**
|
||||
* 角色列表
|
||||
*/
|
||||
@NotBlank(message = "角色不能为空")
|
||||
@ExcelProperty("角色")
|
||||
private String roleNameList;
|
||||
|
||||
/**
|
||||
* 锁定标记
|
||||
*/
|
||||
@ExcelProperty("锁定标记,0:正常,9:已锁定")
|
||||
private String lockFlag;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ExcelProperty(value = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
-101
@@ -1,101 +0,0 @@
|
||||
package com.pig4cloud.pigx.app.api.vo;
|
||||
|
||||
import com.pig4cloud.pigx.app.api.entity.AppRole;
|
||||
import com.pig4cloud.pigx.common.core.sensitive.Sensitive;
|
||||
import com.pig4cloud.pigx.common.core.sensitive.SensitiveTypeEnum;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class AppUserVO implements Serializable {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@Schema(description = "主键")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
@Schema(description = "用户名")
|
||||
private String username;
|
||||
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
@Schema(description = "密码")
|
||||
private String password;
|
||||
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
@Schema(description = "手机号")
|
||||
@Sensitive(type = SensitiveTypeEnum.MOBILE_PHONE)
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 头像
|
||||
*/
|
||||
@Schema(description = "头像")
|
||||
private String avatar;
|
||||
|
||||
/**
|
||||
* 昵称
|
||||
*/
|
||||
@Schema(description = "拓展字段:昵称")
|
||||
private String nickname;
|
||||
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
@Schema(description = "拓展字段:姓名")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 邮箱
|
||||
*/
|
||||
@Schema(description = "拓展字段:邮箱")
|
||||
private String email;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 删除标记
|
||||
*/
|
||||
@Schema(description = "删除标记,1:已删除,0:正常")
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 所属租户
|
||||
*/
|
||||
@Schema(description = "所属租户")
|
||||
private Long tenantId;
|
||||
|
||||
/**
|
||||
* 最后一次密码修改时间
|
||||
*/
|
||||
@Schema(description = "最后一次密码修改时间")
|
||||
private LocalDateTime lastModifiedTime;
|
||||
|
||||
/**
|
||||
* 锁定标记
|
||||
*/
|
||||
@Schema(description = "锁定标记")
|
||||
private String lockFlag;
|
||||
|
||||
/**
|
||||
* 角色列表
|
||||
*/
|
||||
@Schema(description = "拥有的角色列表")
|
||||
private List<AppRole> roleList;
|
||||
|
||||
}
|
||||
-1
@@ -1 +0,0 @@
|
||||
com.pig4cloud.pigx.app.api.feign.RemoteAppUserService
|
||||
@@ -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
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM alibabadragonwell/dragonwell:17-anolis
|
||||
FROM registry.cn-hangzhou.aliyuncs.com/dockerhub_mirror/java:21-anolis
|
||||
|
||||
MAINTAINER wangiegie@gmail.com
|
||||
|
||||
|
||||
@@ -7,21 +7,16 @@
|
||||
<parent>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-app-server</artifactId>
|
||||
<version>5.5.0</version>
|
||||
<version>6.2.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>pigx-app-server-biz</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<!--必备: undertow容器-->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-undertow</artifactId>
|
||||
</dependency>
|
||||
<!--必备: spring boot web-->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
<artifactId>spring-boot-starter-webmvc</artifactId>
|
||||
</dependency>
|
||||
<!--必备: 注册中心客户端-->
|
||||
<dependency>
|
||||
@@ -62,22 +57,31 @@
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-app-server-api</artifactId>
|
||||
<version>5.5.0</version>
|
||||
<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-boot3-starter</artifactId>
|
||||
<artifactId>mybatis-plus-spring-boot4-starter</artifactId>
|
||||
</dependency>
|
||||
<!--选配: druid 连接池 -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>druid-spring-boot-3-starter</artifactId>
|
||||
<artifactId>druid-spring-boot-4-starter</artifactId>
|
||||
</dependency>
|
||||
<!--选配: mysql 数据库驱动 -->
|
||||
<dependency>
|
||||
@@ -94,6 +98,9 @@
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>cloud</id>
|
||||
<activation>
|
||||
<activeByDefault>true</activeByDefault>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
@@ -104,9 +111,6 @@
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<loaderImplementation>CLASSIC</loaderImplementation>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
+28
-8
@@ -10,6 +10,7 @@ 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;
|
||||
@@ -17,7 +18,6 @@ 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.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
@@ -45,12 +45,13 @@ public class AppArticleCategoryController {
|
||||
*/
|
||||
@Operation(summary = "分页查询", description = "分页查询")
|
||||
@GetMapping("/page")
|
||||
@PreAuthorize("@pms.hasPermission('app_appArticleCategory_view')")
|
||||
@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));
|
||||
}
|
||||
|
||||
@@ -61,7 +62,7 @@ public class AppArticleCategoryController {
|
||||
*/
|
||||
@Operation(summary = "通过id查询", description = "通过id查询")
|
||||
@GetMapping("/{id}")
|
||||
@PreAuthorize("@pms.hasPermission('app_appArticleCategory_view')")
|
||||
@HasPermission("app_appArticleCategory_view")
|
||||
public R getById(@PathVariable("id") Long id) {
|
||||
return R.ok(appArticleCategoryService.getById(id));
|
||||
}
|
||||
@@ -74,7 +75,8 @@ public class AppArticleCategoryController {
|
||||
@Inner(value = false)
|
||||
@GetMapping("/list")
|
||||
public R list() {
|
||||
return R.ok(appArticleCategoryService.list());
|
||||
return R.ok(appArticleCategoryService.list(Wrappers.<AppArticleCategoryEntity>lambdaQuery()
|
||||
.orderByAsc(AppArticleCategoryEntity::getSort, AppArticleCategoryEntity::getId)));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -85,7 +87,7 @@ public class AppArticleCategoryController {
|
||||
@Operation(summary = "新增文章分类表", description = "新增文章分类表")
|
||||
@SysLog("新增文章分类表")
|
||||
@PostMapping
|
||||
@PreAuthorize("@pms.hasPermission('app_appArticleCategory_add')")
|
||||
@HasPermission("app_appArticleCategory_add")
|
||||
public R save(@RequestBody AppArticleCategoryEntity appArticleCategory) {
|
||||
return R.ok(appArticleCategoryService.save(appArticleCategory));
|
||||
}
|
||||
@@ -98,11 +100,29 @@ public class AppArticleCategoryController {
|
||||
@Operation(summary = "修改文章分类表", description = "修改文章分类表")
|
||||
@SysLog("修改文章分类表")
|
||||
@PutMapping
|
||||
@PreAuthorize("@pms.hasPermission('app_appArticleCategory_edit')")
|
||||
@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列表
|
||||
@@ -111,7 +131,7 @@ public class AppArticleCategoryController {
|
||||
@Operation(summary = "通过id删除文章分类表", description = "通过id删除文章分类表")
|
||||
@SysLog("通过id删除文章分类表")
|
||||
@DeleteMapping
|
||||
@PreAuthorize("@pms.hasPermission('app_appArticleCategory_del')")
|
||||
@HasPermission("app_appArticleCategory_del")
|
||||
public R removeById(@RequestBody Long[] ids) {
|
||||
return R.ok(appArticleCategoryService.removeBatchByIds(CollUtil.toList(ids)));
|
||||
}
|
||||
@@ -123,7 +143,7 @@ public class AppArticleCategoryController {
|
||||
*/
|
||||
@ResponseExcel
|
||||
@GetMapping("/export")
|
||||
@PreAuthorize("@pms.hasPermission('app_appArticleCategory_export')")
|
||||
@HasPermission("app_appArticleCategory_export")
|
||||
public List<AppArticleCategoryEntity> export(AppArticleCategoryEntity appArticleCategory) {
|
||||
return appArticleCategoryService.list(Wrappers.query(appArticleCategory));
|
||||
}
|
||||
|
||||
+86
-81
@@ -10,6 +10,7 @@ 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;
|
||||
@@ -17,7 +18,6 @@ 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.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
@@ -35,92 +35,97 @@ import java.util.List;
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class AppArticleCollectController {
|
||||
|
||||
private final AppArticleCollectService appArticleCollectService;
|
||||
private final AppArticleCollectService appArticleCollectService;
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param page 分页对象
|
||||
* @param appArticleCollect 文章收藏表
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "分页查询", description = "分页查询")
|
||||
@GetMapping("/page")
|
||||
public R getAppArticleCollectPage(@ParameterObject Page page) {
|
||||
MPJLambdaWrapper<AppArticleCollectEntity> wrapper = new MPJLambdaWrapper<AppArticleCollectEntity>()
|
||||
.selectAll(AppArticleCollectEntity.class)
|
||||
.select(AppArticleEntity::getTitle)
|
||||
.leftJoin(AppArticleEntity.class, AppArticleEntity::getId, AppArticleCollectEntity::getArticleId)
|
||||
.eq(AppArticleCollectEntity::getUserId, SecurityUtils.getUser().getId());
|
||||
return R.ok(appArticleCollectService.selectJoinListPage(page, AppArticleCollectEntity.class, wrapper));
|
||||
}
|
||||
/**
|
||||
* 分页查询文章收藏信息。
|
||||
*
|
||||
* @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));
|
||||
}
|
||||
/**
|
||||
* 通过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("新增文章收藏表")
|
||||
@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));
|
||||
}
|
||||
/**
|
||||
* 修改文章收藏表
|
||||
*
|
||||
* @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)));
|
||||
}
|
||||
/**
|
||||
* 通过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)));
|
||||
}
|
||||
@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")
|
||||
@PreAuthorize("@pms.hasPermission('app_collect_export')")
|
||||
public List<AppArticleCollectEntity> export(AppArticleCollectEntity appArticleCollect) {
|
||||
return appArticleCollectService.list(Wrappers.query(appArticleCollect));
|
||||
}
|
||||
/**
|
||||
* 导出excel 表格
|
||||
*
|
||||
* @param appArticleCollect 查询条件
|
||||
* @return excel 文件流
|
||||
*/
|
||||
@ResponseExcel
|
||||
@GetMapping("/export")
|
||||
@HasPermission("app_collect_export")
|
||||
public List<AppArticleCollectEntity> export(AppArticleCollectEntity appArticleCollect) {
|
||||
return appArticleCollectService.list(Wrappers.query(appArticleCollect));
|
||||
}
|
||||
|
||||
}
|
||||
+33
-10
@@ -8,6 +8,7 @@ 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;
|
||||
@@ -15,7 +16,6 @@ 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.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
@@ -36,10 +36,12 @@ public class AppArticleController {
|
||||
private final AppArticleService appArticleService;
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* 分页查询文章资讯。
|
||||
* <p>
|
||||
* 返回文章列表时会关联分类名称,供 App 资讯列表和后台管理复用。
|
||||
* @param page 分页对象
|
||||
* @param appArticle 文章资讯
|
||||
* @return
|
||||
* @return 文章分页结果
|
||||
*/
|
||||
@Operation(summary = "分页查询", description = "分页查询")
|
||||
@Inner(value = false)
|
||||
@@ -49,9 +51,12 @@ public class AppArticleController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询文章资讯
|
||||
* @param id id
|
||||
* @return R
|
||||
* 查询文章详情。
|
||||
* <p>
|
||||
* 会递增访问次数;如果传入 userId,则额外返回该用户是否收藏当前文章。
|
||||
* @param id 文章 ID
|
||||
* @param userId 用户 ID,可为空
|
||||
* @return 文章详情
|
||||
*/
|
||||
@Inner(value = false)
|
||||
@Operation(summary = "通过id查询", description = "通过id查询")
|
||||
@@ -68,7 +73,7 @@ public class AppArticleController {
|
||||
@Operation(summary = "新增文章资讯", description = "新增文章资讯")
|
||||
@SysLog("新增文章资讯")
|
||||
@PostMapping
|
||||
@PreAuthorize("@pms.hasPermission('app_appArticle_add')")
|
||||
@HasPermission("app_appArticle_add")
|
||||
public R save(@RequestBody AppArticleEntity appArticle) {
|
||||
return R.ok(appArticleService.save(appArticle));
|
||||
}
|
||||
@@ -81,11 +86,29 @@ public class AppArticleController {
|
||||
@Operation(summary = "修改文章资讯", description = "修改文章资讯")
|
||||
@SysLog("修改文章资讯")
|
||||
@PutMapping
|
||||
@PreAuthorize("@pms.hasPermission('app_appArticle_edit')")
|
||||
@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列表
|
||||
@@ -94,7 +117,7 @@ public class AppArticleController {
|
||||
@Operation(summary = "通过id删除文章资讯", description = "通过id删除文章资讯")
|
||||
@SysLog("通过id删除文章资讯")
|
||||
@DeleteMapping
|
||||
@PreAuthorize("@pms.hasPermission('app_appArticle_del')")
|
||||
@HasPermission("app_appArticle_del")
|
||||
public R removeById(@RequestBody Long[] ids) {
|
||||
return R.ok(appArticleService.removeBatchByIds(CollUtil.toList(ids)));
|
||||
}
|
||||
@@ -106,7 +129,7 @@ public class AppArticleController {
|
||||
*/
|
||||
@ResponseExcel
|
||||
@GetMapping("/export")
|
||||
@PreAuthorize("@pms.hasPermission('app_appArticle_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));
|
||||
}
|
||||
}
|
||||
+54
-27
@@ -1,6 +1,5 @@
|
||||
package com.pig4cloud.pigx.app.controller;
|
||||
|
||||
import com.pig4cloud.pigx.app.api.entity.AppPageEntity;
|
||||
import com.pig4cloud.pigx.app.service.AppIndexService;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.common.security.annotation.Inner;
|
||||
@@ -14,10 +13,11 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* app 首页控制
|
||||
* App 运行时页面接口。
|
||||
* <p>
|
||||
* 这里的接口主要给移动端调用,返回首页、装修页、底部 Tabbar 等运行时数据。
|
||||
* 部分接口允许匿名访问,具体可见方法上的 {@link Inner} 配置。
|
||||
*
|
||||
* @author lengleng
|
||||
* @date 2023/6/8
|
||||
@@ -29,31 +29,58 @@ import java.util.Map;
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class AppIndexController {
|
||||
|
||||
private final AppIndexService indexService;
|
||||
private final AppIndexService indexService;
|
||||
|
||||
/**
|
||||
* 首页
|
||||
* @return Object
|
||||
*/
|
||||
@Inner(value = false)
|
||||
@GetMapping("/index")
|
||||
public R index() {
|
||||
Map<String, Object> detail = indexService.index();
|
||||
return R.ok(detail);
|
||||
}
|
||||
/**
|
||||
* 获取首页基础数据。
|
||||
* <p>
|
||||
* 当前返回首页装修页记录和资讯列表,适合旧版首页一次性拉取基础内容。
|
||||
*
|
||||
* @return 首页页面数据和资讯列表
|
||||
*/
|
||||
@Inner(value = false)
|
||||
@GetMapping("/index")
|
||||
public R index() {
|
||||
return R.ok(indexService.index());
|
||||
}
|
||||
|
||||
@Inner(value = false)
|
||||
@GetMapping("/config")
|
||||
public R config() {
|
||||
Map<String, Object> map = indexService.config();
|
||||
return R.ok(map);
|
||||
}
|
||||
/**
|
||||
* 获取移动端底部导航配置。
|
||||
* <p>
|
||||
* 未登录时只返回公开 Tabbar;登录后返回公开 Tabbar + 当前用户角色授权的 Tabbar。
|
||||
*
|
||||
* @return 当前访问身份可见的 Tabbar 列表
|
||||
*/
|
||||
@Inner(value = false)
|
||||
@GetMapping("/config")
|
||||
public R config() {
|
||||
return R.ok(indexService.config());
|
||||
}
|
||||
|
||||
@Inner(value = false)
|
||||
@GetMapping("/decorate")
|
||||
public R decorate(@Validated @RequestParam("id") Integer id) {
|
||||
AppPageEntity detail = indexService.decorate(id);
|
||||
return R.ok(detail);
|
||||
}
|
||||
/**
|
||||
* 获取指定页面类型的装修数据。
|
||||
* <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());
|
||||
}
|
||||
|
||||
}
|
||||
+9
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
* 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:
|
||||
@@ -30,6 +30,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* App 手机验证码接口。
|
||||
*
|
||||
* @author lengleng
|
||||
* @date 2018/11/14
|
||||
* <p>
|
||||
@@ -44,6 +46,12 @@ public class AppMobileController {
|
||||
|
||||
private final AppMobileService appMobileService;
|
||||
|
||||
/**
|
||||
* 发送 App 手机验证码。
|
||||
*
|
||||
* @param mobile 手机号
|
||||
* @return 发送结果
|
||||
*/
|
||||
@Inner(value = false)
|
||||
@GetMapping("/{mobile}")
|
||||
public R sendSmsCode(@PathVariable String mobile) {
|
||||
|
||||
+64
-17
@@ -1,17 +1,29 @@
|
||||
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
|
||||
@@ -23,23 +35,58 @@ import org.springframework.web.bind.annotation.*;
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class AppPageController {
|
||||
|
||||
private final AppPageService pageService;
|
||||
private final AppPageService pageService;
|
||||
|
||||
/**
|
||||
* 通过id查询文章资讯
|
||||
* @param id id
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "通过id查询", description = "通过id查询")
|
||||
@GetMapping("/{id}")
|
||||
public R getById(@PathVariable("id") Long id) {
|
||||
return R.ok(pageService.getById(id));
|
||||
}
|
||||
private final AppTabbarService tabbarService;
|
||||
|
||||
@Operation(summary = "更新页面", description = "更新页面")
|
||||
@PutMapping
|
||||
public R update(@RequestBody AppPageEntity page) {
|
||||
return R.ok(pageService.updateById(page));
|
||||
}
|
||||
/**
|
||||
* 按页面类型查询后台装修页配置。
|
||||
* <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));
|
||||
}
|
||||
|
||||
}
|
||||
-175
@@ -1,175 +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.app.controller;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppRole;
|
||||
import com.pig4cloud.pigx.app.api.vo.AppRoleExcelVO;
|
||||
import com.pig4cloud.pigx.app.service.AppRoleService;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.common.excel.annotation.RequestExcel;
|
||||
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.springframework.http.HttpHeaders;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* app角色表
|
||||
*
|
||||
* @author aeizzz
|
||||
* @date 2022-12-07 09:52:03
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/approle")
|
||||
@Tag(description = "approle", name = "app角色表管理")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class AppRoleController {
|
||||
|
||||
private final AppRoleService appRoleService;
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param page 分页对象
|
||||
* @param appRole app角色表
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "分页查询", description = "分页查询")
|
||||
@GetMapping("/page")
|
||||
public R getAppRolePage(Page page, AppRole appRole) {
|
||||
return R.ok(appRoleService.page(page, Wrappers.<AppRole>lambdaQuery()
|
||||
.like(StrUtil.isNotBlank(appRole.getRoleName()), AppRole::getRoleName, appRole.getRoleName())));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询全部角色
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "查询全部", description = "查询全部")
|
||||
@GetMapping("/list")
|
||||
public R list() {
|
||||
return R.ok(appRoleService.list(Wrappers.emptyWrapper()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询app角色表
|
||||
* @param roleId id
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "通过id查询", description = "通过id查询")
|
||||
@GetMapping("/{roleId}")
|
||||
public R getById(@PathVariable("roleId") Long roleId) {
|
||||
return R.ok(appRoleService.getById(roleId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过roleName查询app角色表
|
||||
* @param roleName roleName
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "通过id查询", description = "通过id查询")
|
||||
@GetMapping("/details/{roleName}")
|
||||
public R getByUserName(@PathVariable("roleName") String roleName) {
|
||||
return R.ok(appRoleService.getOne(Wrappers.<AppRole>lambdaQuery().eq(AppRole::getRoleName, roleName)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过roleCode查询app角色表
|
||||
* @param roleCode roleCode
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "通过roleCode查询", description = "通过roleCode查询")
|
||||
@GetMapping("/detailsByCode/{roleCode}")
|
||||
public R getByPhone(@PathVariable("roleCode") String roleCode) {
|
||||
return R.ok(appRoleService.getOne(Wrappers.<AppRole>lambdaQuery().eq(AppRole::getRoleCode, roleCode)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增app角色表
|
||||
* @param appRole app角色表
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "新增app角色表", description = "新增app角色表")
|
||||
@SysLog("新增app角色表")
|
||||
@PostMapping
|
||||
@PreAuthorize("@pms.hasPermission('app_approle_add')")
|
||||
public R save(@RequestBody AppRole appRole) {
|
||||
return R.ok(appRoleService.save(appRole));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改app角色表
|
||||
* @param appRole app角色表
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "修改app角色表", description = "修改app角色表")
|
||||
@SysLog("修改app角色表")
|
||||
@PutMapping
|
||||
@PreAuthorize("@pms.hasPermission('app_approle_edit')")
|
||||
public R updateById(@RequestBody AppRole appRole) {
|
||||
return R.ok(appRoleService.updateById(appRole));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过ids批量删除app角色表
|
||||
* @param ids roleIds
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "通过ids批量删除app角色表", description = "通过ids批量删除app角色表")
|
||||
@SysLog("通过ids批量删除app角色表")
|
||||
@DeleteMapping
|
||||
@PreAuthorize("@pms.hasPermission('app_approle_del')")
|
||||
public R removeById(@RequestBody Long[] ids) {
|
||||
return R.ok(appRoleService.deleteRoleByIds(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel 表格
|
||||
* @param appRole 查询条件
|
||||
* @return excel 文件流
|
||||
*/
|
||||
@ResponseExcel
|
||||
@GetMapping("/export")
|
||||
@PreAuthorize("@pms.hasPermission('app_approle_export')")
|
||||
public List<AppRole> export(AppRole appRole) {
|
||||
return appRoleService.list(Wrappers.query(appRole));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入角色
|
||||
* @param excelVOList 角色列表
|
||||
* @param bindingResult 错误信息列表
|
||||
* @return ok fail
|
||||
*/
|
||||
@PostMapping("/import")
|
||||
@PreAuthorize("@pms.hasPermission('app_approle_export')")
|
||||
public R importRole(@RequestExcel List<AppRoleExcelVO> excelVOList, BindingResult bindingResult) {
|
||||
return appRoleService.importRole(excelVOList, bindingResult);
|
||||
}
|
||||
|
||||
}
|
||||
+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));
|
||||
}
|
||||
|
||||
}
|
||||
-139
@@ -1,139 +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.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.AppSocialDetails;
|
||||
import com.pig4cloud.pigx.app.service.AppSocialDetailsService;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.common.core.util.ValidGroup;
|
||||
import com.pig4cloud.pigx.common.excel.annotation.ResponseExcel;
|
||||
import com.pig4cloud.pigx.common.log.annotation.SysLog;
|
||||
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.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import jakarta.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/appsocial")
|
||||
@AllArgsConstructor
|
||||
@Tag(description = "social", name = "三方账号管理模块")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class AppSocialDetailsController {
|
||||
|
||||
private final AppSocialDetailsService appSocialDetailsService;
|
||||
|
||||
/**
|
||||
* 社交登录账户简单分页查询
|
||||
* @param page 分页对象
|
||||
* @param appSocialDetails 社交登录
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
public R getSocialDetailsPage(Page page, AppSocialDetails appSocialDetails) {
|
||||
return R.ok(appSocialDetailsService.page(page, Wrappers.query(appSocialDetails)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 信息
|
||||
* @param id id
|
||||
* @return R
|
||||
*/
|
||||
@GetMapping("/{id}")
|
||||
public R getinfo(@PathVariable("id") Long id) {
|
||||
return R.ok(appSocialDetailsService.getById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存
|
||||
* @param appSocialDetails
|
||||
* @return R
|
||||
*/
|
||||
@SysLog("保存三方信息")
|
||||
@PostMapping
|
||||
@PreAuthorize("@pms.hasPermission('app_social_details_add')")
|
||||
public R save(@Valid @RequestBody AppSocialDetails appSocialDetails) {
|
||||
return R.ok(appSocialDetailsService.save(appSocialDetails));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
* @param appSocialDetails
|
||||
* @return R
|
||||
*/
|
||||
@SysLog("修改三方信息")
|
||||
@PutMapping
|
||||
@PreAuthorize("@pms.hasPermission('app_social_details_edit')")
|
||||
public R updateById(@Validated({ ValidGroup.Update.class }) @RequestBody AppSocialDetails appSocialDetails) {
|
||||
appSocialDetailsService.updateById(appSocialDetails);
|
||||
return R.ok(Boolean.TRUE);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* @param ids
|
||||
* @return R
|
||||
*/
|
||||
@SysLog("删除三方信息")
|
||||
@DeleteMapping
|
||||
@PreAuthorize("@pms.hasPermission('app_social_details_del')")
|
||||
public R removeById(@RequestBody Long[] ids) {
|
||||
return R.ok(appSocialDetailsService.removeBatchByIds(CollUtil.toList(ids)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过社交账号、手机号查询用户、角色信息
|
||||
* @param inStr appid@code
|
||||
* @return
|
||||
*/
|
||||
@Inner
|
||||
@GetMapping("/info/{inStr}")
|
||||
public R getUserInfo(@PathVariable String inStr) {
|
||||
return R.ok(appSocialDetailsService.getUserInfo(inStr));
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定社交账号
|
||||
* @param state 类型
|
||||
* @param code code
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/bind")
|
||||
public R bindSocial(String state, String code) {
|
||||
return R.ok(appSocialDetailsService.bindSocial(state, code));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出
|
||||
*/
|
||||
@GetMapping("/export")
|
||||
@ResponseExcel
|
||||
public List<AppSocialDetails> export(AppSocialDetails appSocialDetails) {
|
||||
return appSocialDetailsService.list(Wrappers.query(appSocialDetails));
|
||||
}
|
||||
|
||||
}
|
||||
+55
-20
@@ -1,7 +1,10 @@
|
||||
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;
|
||||
@@ -12,10 +15,12 @@ import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 底部导航
|
||||
* App 底部导航后台管理接口。
|
||||
* <p>
|
||||
* Tabbar 是移动端底部入口的数据源,图标字段保存 Wot UI 图标名;
|
||||
* 是否登录可见由 {@code loginFlag} 控制,登录后再叠加角色授权。
|
||||
*
|
||||
* @author pig
|
||||
* @date 2023-06-07 16:32:35
|
||||
@@ -27,26 +32,56 @@ import java.util.stream.Collectors;
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class AppTabbarController {
|
||||
|
||||
private final AppTabbarService tabbarService;
|
||||
private final AppTabbarService tabbarService;
|
||||
|
||||
/**
|
||||
* 查询导航列表
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "查询导航列表", description = "查询导航列表")
|
||||
@GetMapping("/list")
|
||||
public R list() {
|
||||
return R.ok(tabbarService.list());
|
||||
}
|
||||
private final AppRoleTabbarService roleTabbarService;
|
||||
|
||||
@Operation(summary = "更新导航", description = "更新导航")
|
||||
@PutMapping
|
||||
public R update(@RequestBody List<AppTabbarEntity> tabbarEntityList) {
|
||||
// 删除不在新增范围的导航菜单
|
||||
List<Long> idList = tabbarService.list().stream().map(AppTabbarEntity::getId).collect(Collectors.toList());
|
||||
List<Long> newIdList = tabbarEntityList.stream().map(AppTabbarEntity::getId).collect(Collectors.toList());
|
||||
tabbarService.removeBatchByIds(CollUtil.subtractToList(idList, newIdList));
|
||||
return R.ok(tabbarService.saveOrUpdateBatch(tabbarEntityList));
|
||||
/**
|
||||
* 查询全部底部导航。
|
||||
* <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));
|
||||
}
|
||||
|
||||
}
|
||||
-207
@@ -1,207 +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.app.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.pig4cloud.pigx.app.api.dto.AppUserDTO;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppUser;
|
||||
import com.pig4cloud.pigx.app.api.vo.AppUserExcelVO;
|
||||
import com.pig4cloud.pigx.app.service.AppUserService;
|
||||
import com.pig4cloud.pigx.common.core.constant.CommonConstants;
|
||||
import com.pig4cloud.pigx.common.core.constant.enums.UserTypeEnum;
|
||||
import com.pig4cloud.pigx.common.core.exception.ErrorCodes;
|
||||
import com.pig4cloud.pigx.common.core.util.MsgUtils;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.common.excel.annotation.RequestExcel;
|
||||
import com.pig4cloud.pigx.common.excel.annotation.ResponseExcel;
|
||||
import com.pig4cloud.pigx.common.log.annotation.SysLog;
|
||||
import com.pig4cloud.pigx.common.security.annotation.Inner;
|
||||
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.springframework.http.HttpHeaders;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import jakarta.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* app用户表
|
||||
*
|
||||
* @author aeizzz
|
||||
* @date 2022-12-07 09:52:03
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/appuser")
|
||||
@Tag(description = "appuser", name = "app用户表管理")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class AppUserController {
|
||||
|
||||
private final AppUserService appUserService;
|
||||
|
||||
@Inner
|
||||
@GetMapping("/info/{username}")
|
||||
public R info(@PathVariable String username) {
|
||||
AppUser user = appUserService.getOne(Wrappers.<AppUser>query()
|
||||
.lambda()
|
||||
.eq(AppUser::getUsername, username)
|
||||
.or()
|
||||
.eq(AppUser::getPhone, username));
|
||||
if (user == null) {
|
||||
return R.failed(MsgUtils.getMessage(ErrorCodes.APP_USER_USERINFO_EMPTY, username));
|
||||
}
|
||||
return R.ok(appUserService.findUserInfo(user));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前用户全部信息
|
||||
* @return 用户信息
|
||||
*/
|
||||
@GetMapping(value = { "/info" })
|
||||
public R info() {
|
||||
String username = SecurityUtils.getUser().getUsername();
|
||||
AppUser user = appUserService.getOne(Wrappers.<AppUser>query().lambda().eq(AppUser::getUsername, username));
|
||||
if (user == null) {
|
||||
return R.failed(MsgUtils.getMessage(ErrorCodes.SYS_USER_QUERY_ERROR));
|
||||
}
|
||||
return R.ok(appUserService.findUserInfo(user));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param page 分页对象
|
||||
* @param appUserDTO app用户表
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "分页查询", description = "分页查询")
|
||||
@GetMapping("/page")
|
||||
public R getAppUserPage(Page page, AppUserDTO appUserDTO) {
|
||||
return R.ok(appUserService.getUsersWithRolePage(page, appUserDTO));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询app用户表
|
||||
* @param userId id
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "通过id查询", description = "通过id查询")
|
||||
@GetMapping("/details/{userId}")
|
||||
public R getById(@PathVariable("userId") Long userId) {
|
||||
return R.ok(appUserService.selectUserVoById(userId));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "通过userName查询", description = "通过userName查询")
|
||||
@GetMapping("/details")
|
||||
public R getByUserName(AppUser user) {
|
||||
AppUser one = appUserService.getOne(Wrappers.query(user), false);
|
||||
return R.ok(one == null ? null : CommonConstants.SUCCESS);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增app用户表
|
||||
* @param appUser app用户表
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "新增app用户表", description = "新增app用户表")
|
||||
@SysLog("新增app用户表")
|
||||
@PostMapping
|
||||
@PreAuthorize("@pms.hasPermission('app_appuser_add')")
|
||||
public R save(@RequestBody AppUserDTO appUser) {
|
||||
appUserService.saveUser(appUser);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改app用户表
|
||||
* @param appUser app用户表
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "修改app用户表", description = "修改app用户表")
|
||||
@SysLog("修改app用户表")
|
||||
@PutMapping
|
||||
@PreAuthorize("@pms.hasPermission('app_appuser_edit')")
|
||||
public R updateById(@RequestBody AppUserDTO appUser) {
|
||||
return R.ok(appUserService.updateUser(appUser));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除app用户表
|
||||
* @param ids userIds
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "通过ids删除app用户表", description = "通过ids删除app用户表")
|
||||
@SysLog("通过id删除app用户表")
|
||||
@DeleteMapping
|
||||
@PreAuthorize("@pms.hasPermission('app_appuser_del')")
|
||||
public R removeById(@RequestBody Long[] ids) {
|
||||
return R.ok(appUserService.deleteAppUserByIds(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel 表格
|
||||
* @param appUser 查询条件
|
||||
* @return excel 文件流
|
||||
*/
|
||||
@ResponseExcel
|
||||
@GetMapping("/export")
|
||||
@PreAuthorize("@pms.hasPermission('app_appuser_export')")
|
||||
public List<AppUserExcelVO> export(AppUserDTO appUser) {
|
||||
return appUserService.listUser(appUser);
|
||||
}
|
||||
|
||||
@SysLog("修改个人信息")
|
||||
@PutMapping("/edit")
|
||||
public R updateUserInfo(@Valid @RequestBody AppUserDTO userDto) {
|
||||
if (UserTypeEnum.TOC.getStatus().equals(SecurityUtils.getUser().getUserType())) {
|
||||
userDto.setUserId(SecurityUtils.getUser().getId());
|
||||
// TOC 以手机号为key
|
||||
userDto.setUsername(SecurityUtils.getUser().getUsername());
|
||||
}
|
||||
return appUserService.updateUserInfo(userDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入用户
|
||||
* @param excelVOList 用户列表
|
||||
* @param bindingResult 错误信息列表
|
||||
* @return R
|
||||
*/
|
||||
@PostMapping("/import")
|
||||
@PreAuthorize("@pms.hasPermission('app_appuser_export')")
|
||||
public R importUser(@RequestExcel List<AppUserExcelVO> excelVOList, BindingResult bindingResult) {
|
||||
return appUserService.importUser(excelVOList, bindingResult);
|
||||
}
|
||||
|
||||
@Operation(summary = "注册app用户表", description = "注册app用户表")
|
||||
@SysLog("注册app用户表")
|
||||
@Inner(value = false)
|
||||
@PostMapping("/register")
|
||||
public R register(@RequestBody AppUserDTO appUser) {
|
||||
return appUserService.registerAppUser(appUser);
|
||||
}
|
||||
|
||||
}
|
||||
-128
@@ -1,128 +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.app.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppUserRole;
|
||||
import com.pig4cloud.pigx.app.service.AppUserRoleService;
|
||||
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.springframework.http.HttpHeaders;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户角色表
|
||||
*
|
||||
* @author aeizzz
|
||||
* @date 2022-12-07 09:52:03
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/appuserrole")
|
||||
@Tag(description = "appuserrole", name = "用户角色表管理")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class AppUserRoleController {
|
||||
|
||||
private final AppUserRoleService appUserRoleService;
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param page 分页对象
|
||||
* @param appUserRole 用户角色表
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "分页查询", description = "分页查询")
|
||||
@GetMapping("/page")
|
||||
@PreAuthorize("@pms.hasPermission('app_appuserrole_view')")
|
||||
public R getAppUserRolePage(Page page, AppUserRole appUserRole) {
|
||||
return R.ok(appUserRoleService.page(page, Wrappers.query(appUserRole)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询用户角色表
|
||||
* @param userId id
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "通过id查询", description = "通过id查询")
|
||||
@GetMapping("/{userId}")
|
||||
@PreAuthorize("@pms.hasPermission('app_appuserrole_view')")
|
||||
public R getById(@PathVariable("userId") Long userId) {
|
||||
return R.ok(appUserRoleService.getById(userId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增用户角色表
|
||||
* @param appUserRole 用户角色表
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "新增用户角色表", description = "新增用户角色表")
|
||||
@SysLog("新增用户角色表")
|
||||
@PostMapping
|
||||
@PreAuthorize("@pms.hasPermission('app_appuserrole_add')")
|
||||
public R save(@RequestBody AppUserRole appUserRole) {
|
||||
return R.ok(appUserRoleService.save(appUserRole));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户角色表
|
||||
* @param appUserRole 用户角色表
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "修改用户角色表", description = "修改用户角色表")
|
||||
@SysLog("修改用户角色表")
|
||||
@PutMapping
|
||||
@PreAuthorize("@pms.hasPermission('app_appuserrole_edit')")
|
||||
public R updateById(@RequestBody AppUserRole appUserRole) {
|
||||
return R.ok(appUserRoleService.updateById(appUserRole));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除用户角色表
|
||||
* @param userId id
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "通过id删除用户角色表", description = "通过id删除用户角色表")
|
||||
@SysLog("通过id删除用户角色表")
|
||||
@DeleteMapping("/{userId}")
|
||||
@PreAuthorize("@pms.hasPermission('app_appuserrole_del')")
|
||||
public R removeById(@PathVariable Long userId) {
|
||||
return R.ok(appUserRoleService.removeById(userId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel 表格
|
||||
* @param appUserRole 查询条件
|
||||
* @return excel 文件流
|
||||
*/
|
||||
@ResponseExcel
|
||||
@GetMapping("/export")
|
||||
@PreAuthorize("@pms.hasPermission('app_appuserrole_export')")
|
||||
public List<AppUserRole> export(AppUserRole appUserRole) {
|
||||
return appUserRoleService.list(Wrappers.query(appUserRole));
|
||||
}
|
||||
|
||||
}
|
||||
-69
@@ -1,69 +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.app.handler;
|
||||
|
||||
import com.pig4cloud.pigx.app.api.dto.AppUserInfo;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppUser;
|
||||
|
||||
/**
|
||||
* @author lengleng
|
||||
* @date 2018/11/18
|
||||
* <p>
|
||||
* 登录处理器
|
||||
*/
|
||||
public interface LoginHandler {
|
||||
|
||||
/***
|
||||
* 数据合法性校验
|
||||
* @param loginStr 通过用户传入获取唯一标识
|
||||
* @return
|
||||
*/
|
||||
Boolean check(String loginStr);
|
||||
|
||||
/**
|
||||
* 通过用户传入获取唯一标识
|
||||
* @param loginStr
|
||||
* @return
|
||||
*/
|
||||
String identify(String loginStr);
|
||||
|
||||
/**
|
||||
* 通过openId 获取用户信息
|
||||
* @param identify
|
||||
* @return
|
||||
*/
|
||||
AppUserInfo info(String identify);
|
||||
|
||||
/**
|
||||
* 处理方法
|
||||
* @param loginStr 登录参数
|
||||
* @return
|
||||
*/
|
||||
AppUserInfo handle(String loginStr);
|
||||
|
||||
/**
|
||||
* 绑定逻辑
|
||||
* @param user 用户实体
|
||||
* @param identify 渠道返回唯一标识
|
||||
* @return
|
||||
*/
|
||||
default Boolean bind(AppUser user, String identify) {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
-122
@@ -1,122 +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.app.handler;
|
||||
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.pig4cloud.pigx.app.api.dto.AppUserInfo;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppSocialDetails;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppUser;
|
||||
import com.pig4cloud.pigx.app.mapper.AppSocialDetailsMapper;
|
||||
import com.pig4cloud.pigx.app.service.AppUserService;
|
||||
import com.pig4cloud.pigx.common.core.constant.SecurityConstants;
|
||||
import com.pig4cloud.pigx.common.core.constant.enums.LoginTypeEnum;
|
||||
import com.pig4cloud.pigx.common.core.exception.CheckedException;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @author lengleng
|
||||
* @date 2019年11月02日
|
||||
* <p>
|
||||
* 微信小程序
|
||||
*/
|
||||
@Slf4j
|
||||
@Component("APP-MINI")
|
||||
@AllArgsConstructor
|
||||
public class MiniAppLoginHandler extends AbstractLoginHandler {
|
||||
|
||||
private final AppUserService appUserService;
|
||||
|
||||
private final AppSocialDetailsMapper appSocialDetailsMapper;
|
||||
|
||||
/**
|
||||
* 小程序登录传入code
|
||||
* <p>
|
||||
* 通过code 调用qq 获取唯一标识
|
||||
*
|
||||
* @param code
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public String identify(String code) {
|
||||
AppSocialDetails condition = new AppSocialDetails();
|
||||
condition.setType(LoginTypeEnum.MINI_APP.getType());
|
||||
AppSocialDetails socialDetails = appSocialDetailsMapper.selectOne(new QueryWrapper<>(condition));
|
||||
|
||||
String url = String.format(SecurityConstants.MINI_APP_AUTHORIZATION_CODE_URL, socialDetails.getAppId(),
|
||||
socialDetails.getAppSecret(), code);
|
||||
String result = HttpUtil.get(url);
|
||||
log.debug("微信小程序响应报文:{}", result);
|
||||
|
||||
if (JSONUtil.parseObj(result).containsKey("openid")) {
|
||||
return JSONUtil.parseObj(result).get("openid").toString();
|
||||
} else {
|
||||
log.error("微信小程序登录失败:{}", result);
|
||||
throw new CheckedException("微信小程序登录失败");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* openId 获取用户信息
|
||||
*
|
||||
* @param openId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AppUserInfo info(String openId) {
|
||||
AppUser user = appUserService.getOne(Wrappers.<AppUser>query().lambda().eq(AppUser::getWxOpenid, openId));
|
||||
|
||||
if (user == null) {
|
||||
log.info("微信小程序未绑定:{},创建新的用户", openId);
|
||||
return createAndSaveAppUserInfo(openId);
|
||||
}
|
||||
return appUserService.findUserInfo(user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定逻辑
|
||||
*
|
||||
* @param user 用户实体
|
||||
* @param identify 渠道返回唯一标识
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Boolean bind(AppUser user, String identify) {
|
||||
user.setWxOpenid(identify);
|
||||
appUserService.updateById(user);
|
||||
return true;
|
||||
}
|
||||
|
||||
private AppUserInfo createAndSaveAppUserInfo(String openId) {
|
||||
AppUser appUser = new AppUser();
|
||||
appUser.setWxOpenid(openId);
|
||||
appUser.setUsername(openId);
|
||||
appUser.setCreateBy(openId);
|
||||
appUser.setUpdateBy(openId);
|
||||
appUserService.saveOrUpdate(appUser, Wrappers.<AppUser>lambdaQuery().eq(AppUser::getUsername, openId));
|
||||
|
||||
AppUserInfo appUserDTO = new AppUserInfo();
|
||||
appUserDTO.setAppUser(appUser);
|
||||
return appUserDTO;
|
||||
}
|
||||
|
||||
}
|
||||
-96
@@ -1,96 +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.app.handler;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.pig4cloud.pigx.app.api.dto.AppUserInfo;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppUser;
|
||||
import com.pig4cloud.pigx.app.service.AppUserService;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @author lengleng
|
||||
* @date 2018/11/18
|
||||
*/
|
||||
@Slf4j
|
||||
@Component("APP-SMS")
|
||||
@AllArgsConstructor
|
||||
public class SmsLoginHandler extends AbstractLoginHandler {
|
||||
|
||||
private final AppUserService appUserService;
|
||||
|
||||
/**
|
||||
* 验证码登录传入为手机号 不用不处理
|
||||
* @param mobile
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public String identify(String mobile) {
|
||||
return mobile;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过mobile 获取用户信息
|
||||
* @param identify
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AppUserInfo info(String identify) {
|
||||
AppUser user = appUserService.getOne(Wrappers.<AppUser>query().lambda().eq(AppUser::getPhone, identify));
|
||||
|
||||
if (user == null) {
|
||||
log.info("手机号未注册:{}", identify);
|
||||
return createAndSaveAppUserInfo(identify);
|
||||
}
|
||||
return appUserService.findUserInfo(user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建并插入用户
|
||||
* @param identify
|
||||
* @return
|
||||
*/
|
||||
private AppUserInfo createAndSaveAppUserInfo(String phone) {
|
||||
AppUser appUser = new AppUser();
|
||||
appUser.setUsername(phone);
|
||||
appUser.setPhone(phone);
|
||||
appUser.setCreateBy(phone);
|
||||
appUser.setUpdateBy(phone);
|
||||
appUserService.saveOrUpdate(appUser, Wrappers.<AppUser>lambdaQuery().eq(AppUser::getPhone, phone));
|
||||
|
||||
AppUserInfo appUserDTO = new AppUserInfo();
|
||||
appUserDTO.setAppUser(appUser);
|
||||
return appUserDTO;
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定逻辑
|
||||
* @param user 用户实体
|
||||
* @param identify 渠道返回唯一标识
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Boolean bind(AppUser user, String identify) {
|
||||
user.setPhone(identify);
|
||||
appUserService.updateById(user);
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
+3
@@ -4,6 +4,9 @@ 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> {
|
||||
|
||||
|
||||
+3
@@ -4,6 +4,9 @@ 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> {
|
||||
|
||||
|
||||
+3
@@ -4,6 +4,9 @@ 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> {
|
||||
|
||||
|
||||
}
|
||||
+3
@@ -4,6 +4,9 @@ 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> {
|
||||
|
||||
}
|
||||
-33
@@ -1,33 +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.app.mapper;
|
||||
|
||||
import com.pig4cloud.pigx.app.api.entity.AppSocialDetails;
|
||||
import com.pig4cloud.pigx.common.data.datascope.PigxBaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 系统社交登录账号表
|
||||
*
|
||||
* @author lengleng
|
||||
* @date 2018-08-16 21:30:41
|
||||
*/
|
||||
@Mapper
|
||||
public interface AppSocialDetailsMapper extends PigxBaseMapper<AppSocialDetails> {
|
||||
|
||||
}
|
||||
+3
@@ -4,6 +4,9 @@ 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> {
|
||||
|
||||
|
||||
-42
@@ -1,42 +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.app.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.pig4cloud.pigx.app.api.dto.AppUserDTO;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppUser;
|
||||
import com.pig4cloud.pigx.app.api.vo.AppUserVO;
|
||||
import com.pig4cloud.pigx.common.data.datascope.PigxBaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* app用户表
|
||||
*
|
||||
* @author aeizzz
|
||||
* @date 2022-12-07 09:52:03
|
||||
*/
|
||||
@Mapper
|
||||
public interface AppUserMapper extends PigxBaseMapper<AppUser> {
|
||||
|
||||
IPage<AppUserVO> getUserVosPage(Page page, @Param("query") AppUserDTO appUserDTO);
|
||||
|
||||
AppUserVO getUserVoById(Long userId);
|
||||
|
||||
}
|
||||
-33
@@ -1,33 +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.app.mapper;
|
||||
|
||||
import com.pig4cloud.pigx.app.api.entity.AppUserRole;
|
||||
import com.pig4cloud.pigx.common.data.datascope.PigxBaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 用户角色表
|
||||
*
|
||||
* @author aeizzz
|
||||
* @date 2022-12-07 09:52:03
|
||||
*/
|
||||
@Mapper
|
||||
public interface AppUserRoleMapper extends PigxBaseMapper<AppUserRole> {
|
||||
|
||||
}
|
||||
+16
-1
@@ -1,8 +1,23 @@
|
||||
package com.pig4cloud.pigx.app.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
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);
|
||||
|
||||
}
|
||||
+11
@@ -3,8 +3,19 @@ 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);
|
||||
|
||||
}
|
||||
+16
-1
@@ -1,11 +1,26 @@
|
||||
package com.pig4cloud.pigx.app.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
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
|
||||
|
||||
+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);
|
||||
}
|
||||
+24
-8
@@ -1,11 +1,15 @@
|
||||
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 页面控制
|
||||
* App 运行时页面服务。
|
||||
* <p>
|
||||
* 负责给移动端聚合首页、装修页、工作台和 Tabbar 配置;
|
||||
* 后台装修管理接口不直接走这里。
|
||||
*
|
||||
* @author lengleng
|
||||
* @date 2023/6/8
|
||||
@@ -13,21 +17,33 @@ import java.util.Map;
|
||||
public interface AppIndexService {
|
||||
|
||||
/**
|
||||
* 首页
|
||||
* 获取首页基础数据。
|
||||
*
|
||||
* @return 首页页面记录和资讯列表
|
||||
*/
|
||||
Map<String, Object> index();
|
||||
|
||||
/**
|
||||
* 配置
|
||||
* @return Map<String, Object>
|
||||
* 获取运行时配置。
|
||||
*
|
||||
* @return 当前访问身份可见的 Tabbar 等配置
|
||||
*/
|
||||
Map<String, Object> config();
|
||||
|
||||
/**
|
||||
* 装修
|
||||
* @param id 装修ID
|
||||
* @return Map<String, Object>
|
||||
* 获取指定页面类型的装修页聚合数据。
|
||||
*
|
||||
* @param id 页面类型
|
||||
* @return 装修页聚合数据
|
||||
*/
|
||||
AppPageEntity decorate(Integer id);
|
||||
AppDecorateVO decorate(Integer id);
|
||||
|
||||
/**
|
||||
* 返回工作台页面实体对象。
|
||||
* <p>
|
||||
* 工作台按钮权限由 B 端 permission 控制,这里只返回页面装修数据。
|
||||
*
|
||||
* @return 工作台页面实体对象
|
||||
*/
|
||||
AppPageEntity workbench();
|
||||
}
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
* 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:
|
||||
|
||||
+7
-1
@@ -1,8 +1,14 @@
|
||||
package com.pig4cloud.pigx.app.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
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);
|
||||
|
||||
}
|
||||
-47
@@ -1,47 +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.app.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.pig4cloud.pigx.app.api.dto.AppUserInfo;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppSocialDetails;
|
||||
|
||||
/**
|
||||
* 系统社交登录账号表
|
||||
*
|
||||
* @author lengleng
|
||||
* @date 2018-08-16 21:30:41
|
||||
*/
|
||||
public interface AppSocialDetailsService extends IService<AppSocialDetails> {
|
||||
|
||||
/**
|
||||
* 绑定社交账号
|
||||
* @param state 类型
|
||||
* @param code code
|
||||
* @return
|
||||
*/
|
||||
Boolean bindSocial(String state, String code);
|
||||
|
||||
/**
|
||||
* 根据入参查询用户信息
|
||||
* @param inStr
|
||||
* @return
|
||||
*/
|
||||
AppUserInfo getUserInfo(String inStr);
|
||||
|
||||
}
|
||||
+4
-1
@@ -1,8 +1,11 @@
|
||||
package com.pig4cloud.pigx.app.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.baomidou.mybatisplus.spring.service.IService;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppTabbarEntity;
|
||||
|
||||
/**
|
||||
* App 底部导航基础服务。
|
||||
*/
|
||||
public interface AppTabbarService extends IService<AppTabbarEntity> {
|
||||
|
||||
}
|
||||
-31
@@ -1,31 +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.app.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppUserRole;
|
||||
|
||||
/**
|
||||
* 用户角色表
|
||||
*
|
||||
* @author aeizzz
|
||||
* @date 2022-12-07 09:52:03
|
||||
*/
|
||||
public interface AppUserRoleService extends IService<AppUserRole> {
|
||||
|
||||
}
|
||||
-61
@@ -1,61 +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.app.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.pig4cloud.pigx.app.api.dto.AppUserDTO;
|
||||
import com.pig4cloud.pigx.app.api.dto.AppUserInfo;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppUser;
|
||||
import com.pig4cloud.pigx.app.api.vo.AppUserExcelVO;
|
||||
import com.pig4cloud.pigx.app.api.vo.AppUserVO;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import org.springframework.validation.BindingResult;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* app用户表
|
||||
*
|
||||
* @author aeizzz
|
||||
* @date 2022-12-07 09:52:03
|
||||
*/
|
||||
public interface AppUserService extends IService<AppUser> {
|
||||
|
||||
Boolean updateUser(AppUserDTO appUser);
|
||||
|
||||
Boolean saveUser(AppUserDTO appUser);
|
||||
|
||||
List<AppUserExcelVO> listUser(AppUserDTO appUser);
|
||||
|
||||
IPage getUsersWithRolePage(Page page, AppUserDTO appUserDTO);
|
||||
|
||||
AppUserInfo findUserInfo(AppUser user);
|
||||
|
||||
R updateUserInfo(AppUserDTO userDto);
|
||||
|
||||
AppUserVO selectUserVoById(Long userId);
|
||||
|
||||
Boolean deleteAppUserByIds(Long[] ids);
|
||||
|
||||
R importUser(List<AppUserExcelVO> excelVOList, BindingResult bindingResult);
|
||||
|
||||
R registerAppUser(AppUserDTO appUser);
|
||||
|
||||
}
|
||||
+42
-1
@@ -1,10 +1,18 @@
|
||||
package com.pig4cloud.pigx.app.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
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;
|
||||
|
||||
/**
|
||||
* 文章分类表
|
||||
@@ -16,4 +24,37 @@ import org.springframework.stereotype.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), "排序保存失败");
|
||||
}
|
||||
|
||||
}
|
||||
+23
-13
@@ -1,7 +1,7 @@
|
||||
package com.pig4cloud.pigx.app.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
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;
|
||||
@@ -9,26 +9,36 @@ 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 {
|
||||
implements AppArticleCollectService {
|
||||
|
||||
@Override
|
||||
public Boolean saveArticleCollect(AppArticleCollectEntity appArticleCollect) {
|
||||
Long id = SecurityUtils.getUser().getId();
|
||||
appArticleCollect.setUserId(id);
|
||||
/**
|
||||
* 保存当前登录用户的文章收藏。
|
||||
*
|
||||
* @param appArticleCollect 收藏请求,业务上只需要文章 ID,用户 ID 由登录态写入
|
||||
* @return true=收藏成功,false=已经收藏
|
||||
*/
|
||||
@Override
|
||||
public Boolean saveArticleCollect(AppArticleCollectEntity appArticleCollect) {
|
||||
Long id = SecurityUtils.getUser().getId();
|
||||
appArticleCollect.setUserId(id);
|
||||
|
||||
this.saveOrUpdate(appArticleCollect,
|
||||
Wrappers.<AppArticleCollectEntity>lambdaQuery()
|
||||
.eq(AppArticleCollectEntity::getUserId, id)
|
||||
.eq(AppArticleCollectEntity::getArticleId, appArticleCollect.getArticleId()));
|
||||
if (baseMapper.exists(Wrappers.<AppArticleCollectEntity>lambdaQuery()
|
||||
.eq(AppArticleCollectEntity::getUserId, id)
|
||||
.eq(AppArticleCollectEntity::getArticleId, appArticleCollect.getArticleId()))) {
|
||||
return Boolean.FALSE;
|
||||
}
|
||||
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
return this.save(appArticleCollect);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
+56
-11
@@ -3,7 +3,7 @@ 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.extension.service.impl.ServiceImpl;
|
||||
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;
|
||||
@@ -13,11 +13,20 @@ 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
|
||||
@@ -30,14 +39,17 @@ public class AppArticleServiceImpl extends ServiceImpl<AppArticleMapper, AppArti
|
||||
private final AppArticleCollectMapper collectMapper;
|
||||
|
||||
/**
|
||||
* 获取文章并使阅读数+1
|
||||
* @param id id
|
||||
* @return
|
||||
* 获取文章详情,并尝试将阅读数加 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())//
|
||||
@@ -45,10 +57,9 @@ public class AppArticleServiceImpl extends ServiceImpl<AppArticleMapper, AppArti
|
||||
appArticleEntity.setCollect(exists);
|
||||
}
|
||||
|
||||
// TODO 更新条件需要根据其他指数限制
|
||||
Integer nowVisit = appArticleEntity.getVisit();
|
||||
appArticleEntity.setVisit(nowVisit + 1);
|
||||
// 乐观锁
|
||||
// 使用旧 visit 值作为更新条件,避免并发访问时直接覆盖最新阅读数。
|
||||
baseMapper.update(appArticleEntity,
|
||||
Wrappers.<AppArticleEntity>lambdaQuery()
|
||||
.eq(AppArticleEntity::getId, id)
|
||||
@@ -57,10 +68,10 @@ public class AppArticleServiceImpl extends ServiceImpl<AppArticleMapper, AppArti
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询文章列表 包含分类名称
|
||||
* 分页查询文章列表,并关联分类名称。
|
||||
* @param page 分页参数
|
||||
* @param appArticle 文章查询条件
|
||||
* @return
|
||||
* @return 文章分页结果,包含分类名称 cname
|
||||
*/
|
||||
@Override
|
||||
public Page pageAndCname(Page page, AppArticleEntity appArticle) {
|
||||
@@ -70,8 +81,42 @@ public class AppArticleServiceImpl extends ServiceImpl<AppArticleMapper, AppArti
|
||||
.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());
|
||||
.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);
|
||||
}
|
||||
}
|
||||
+108
-42
@@ -4,10 +4,15 @@ 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;
|
||||
|
||||
@@ -16,58 +21,119 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* app 页面控制
|
||||
* App首页服务实现类
|
||||
* 实现AppIndexService接口,提供首页数据、导航栏配置以及页面配置等功能。
|
||||
* <p>
|
||||
* 该实现面向移动端运行时:Tabbar 会按公开/登录角色授权规则过滤,
|
||||
* 页面装修数据则保持原始组件 JSON,不在这里做页面组件级权限裁剪。
|
||||
*
|
||||
* @author lengleng
|
||||
* @date 2023/6/8
|
||||
*/
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class AppIndexServiceImpl implements AppIndexService {
|
||||
|
||||
private final AppArticleMapper appArticleMapper;
|
||||
private final AppTabbarMapper appTabbarMapper;
|
||||
|
||||
private final AppTabbarMapper appTabbarMapper;
|
||||
private final AppPageMapper appPageMapper;
|
||||
|
||||
private final AppPageMapper appPageMapper;
|
||||
private final AppArticleMapper appArticleMapper;
|
||||
|
||||
/**
|
||||
* 商城首页 首页数据
|
||||
*/
|
||||
@Override
|
||||
public Map<String, Object> index() {
|
||||
Map<String, Object> response = new LinkedHashMap<>();
|
||||
AppPageEntity appPageEntity = appPageMapper.selectById(1);
|
||||
List<AppArticleEntity> articleList = appArticleMapper
|
||||
.selectList(Wrappers.<AppArticleEntity>lambdaQuery().orderByDesc(AppArticleEntity::getSort));
|
||||
response.put("pages", appPageEntity);
|
||||
response.put("article", articleList);
|
||||
return response;
|
||||
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));
|
||||
}
|
||||
|
||||
/**
|
||||
* 配置
|
||||
* @return Map<String, Object>
|
||||
*/
|
||||
@Override
|
||||
public Map<String, Object> config() {
|
||||
Map<String, Object> response = new LinkedHashMap<>();
|
||||
List<AppTabbarEntity> tabbarEntityList = appTabbarMapper.selectList(Wrappers.emptyWrapper());
|
||||
response.put("tabbar", tabbarEntityList);
|
||||
return response;
|
||||
}
|
||||
|
||||
/**
|
||||
* 装修
|
||||
*
|
||||
* @author fzr
|
||||
* @param id 主键
|
||||
* @return Map<String, Object>
|
||||
*/
|
||||
@Override
|
||||
public AppPageEntity decorate(Integer id) {
|
||||
return appPageMapper.selectById(id);
|
||||
}
|
||||
|
||||
}
|
||||
+29
-27
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
* 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:
|
||||
@@ -20,21 +20,24 @@ 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.exception.ErrorCodes;
|
||||
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.data.redis.core.StringRedisTemplate;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* App 手机验证码服务实现。
|
||||
* <p>
|
||||
* 验证码按 {@code 验证码缓存前缀 + 登录类型 + 手机号} 写入 Redis,
|
||||
* 过期时间使用统一安全常量配置。
|
||||
*
|
||||
* @author lengleng
|
||||
* @date 2018/11/14
|
||||
* <p>
|
||||
@@ -45,29 +48,28 @@ import java.util.concurrent.TimeUnit;
|
||||
@AllArgsConstructor
|
||||
public class AppMobileServiceImpl implements AppMobileService {
|
||||
|
||||
private final StringRedisTemplate redisTemplate;
|
||||
/**
|
||||
* 发送手机验证码。
|
||||
* <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);
|
||||
|
||||
/**
|
||||
* 发送手机验证码 TODO: 调用短信网关发送验证码,测试返回前端
|
||||
* @param mobile mobile
|
||||
* @return code
|
||||
*/
|
||||
@Override
|
||||
public R<Boolean> sendSmsCode(String mobile) {
|
||||
String codeObj = redisTemplate.opsForValue()
|
||||
.get(CacheConstants.DEFAULT_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));
|
||||
}
|
||||
|
||||
if (StrUtil.isNotBlank(codeObj)) {
|
||||
log.info("手机号验证码未过期:{},{}", mobile, codeObj);
|
||||
return R.ok(Boolean.FALSE, MsgUtils.getMessage(ErrorCodes.SYS_APP_SMS_OFTEN));
|
||||
}
|
||||
|
||||
String code = RandomUtil.randomNumbers(Integer.parseInt(SecurityConstants.CODE_SIZE));
|
||||
log.debug("手机号生成验证码成功:{},{}", mobile, code);
|
||||
redisTemplate.opsForValue()
|
||||
.set(CacheConstants.DEFAULT_CODE_KEY + LoginTypeEnum.APPSMS.getType() + StringPool.AT + mobile, code,
|
||||
SecurityConstants.CODE_TIME, TimeUnit.SECONDS);
|
||||
return R.ok(Boolean.TRUE, code);
|
||||
}
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
package com.pig4cloud.pigx.app.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
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;
|
||||
|
||||
-113
@@ -1,113 +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.app.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppRole;
|
||||
import com.pig4cloud.pigx.app.api.vo.AppRoleExcelVO;
|
||||
import com.pig4cloud.pigx.app.mapper.AppRoleMapper;
|
||||
import com.pig4cloud.pigx.app.service.AppRoleService;
|
||||
import com.pig4cloud.pigx.common.core.exception.ErrorCodes;
|
||||
import com.pig4cloud.pigx.common.core.util.MsgUtils;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.common.excel.vo.ErrorMessage;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.BindingResult;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* app角色表
|
||||
*
|
||||
* @author aeizzz
|
||||
* @date 2022-12-07 09:52:03
|
||||
*/
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class AppRoleServiceImpl extends ServiceImpl<AppRoleMapper, AppRole> implements AppRoleService {
|
||||
|
||||
@Override
|
||||
public List<AppRole> findRolesByUserId(Long userId) {
|
||||
return baseMapper.listRolesByUserId(userId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除用户的同时,把role_menu关系删除
|
||||
* @param ids roleIds
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteRoleByIds(Long[] ids) {
|
||||
this.removeBatchByIds(CollUtil.toList(ids));
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入角色
|
||||
* @param excelVOList
|
||||
* @param bindingResult
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public R importRole(List<AppRoleExcelVO> excelVOList, BindingResult bindingResult) {
|
||||
// 通用校验获取失败的数据
|
||||
List<ErrorMessage> errorMessageList = (List<ErrorMessage>) bindingResult.getTarget();
|
||||
|
||||
// 个性化校验逻辑
|
||||
List<AppRole> roleList = this.list();
|
||||
|
||||
// 执行数据插入操作 组装 RoleDto
|
||||
for (AppRoleExcelVO excel : excelVOList) {
|
||||
Set<String> errorMsg = new HashSet<>();
|
||||
// 检验角色名称或者角色编码是否存在
|
||||
boolean existRole = roleList.stream()
|
||||
.anyMatch(appRole -> excel.getRoleName().equals(appRole.getRoleName())
|
||||
|| excel.getRoleCode().equals(appRole.getRoleCode()));
|
||||
|
||||
if (existRole) {
|
||||
errorMsg.add(MsgUtils.getMessage(ErrorCodes.SYS_ROLE_NAMEORCODE_EXISTING, excel.getRoleName(),
|
||||
excel.getRoleCode()));
|
||||
}
|
||||
|
||||
// 数据合法情况
|
||||
if (CollUtil.isEmpty(errorMsg)) {
|
||||
insertExcelRole(excel);
|
||||
}
|
||||
else {
|
||||
// 数据不合法情况
|
||||
errorMessageList.add(new ErrorMessage(excel.getLineNum(), errorMsg));
|
||||
}
|
||||
}
|
||||
if (CollUtil.isNotEmpty(errorMessageList)) {
|
||||
return R.failed(errorMessageList);
|
||||
}
|
||||
return R.ok();
|
||||
|
||||
}
|
||||
|
||||
private void insertExcelRole(AppRoleExcelVO excel) {
|
||||
AppRole appRole = new AppRole();
|
||||
appRole.setRoleName(excel.getRoleName());
|
||||
appRole.setRoleDesc(excel.getRoleDesc());
|
||||
appRole.setRoleCode(excel.getRoleCode());
|
||||
this.save(appRole);
|
||||
}
|
||||
|
||||
}
|
||||
+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);
|
||||
}
|
||||
|
||||
}
|
||||
-86
@@ -1,86 +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.app.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.StringPool;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.pig4cloud.pigx.app.api.dto.AppUserInfo;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppSocialDetails;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppUser;
|
||||
import com.pig4cloud.pigx.app.handler.LoginHandler;
|
||||
import com.pig4cloud.pigx.app.mapper.AppSocialDetailsMapper;
|
||||
import com.pig4cloud.pigx.app.mapper.AppUserMapper;
|
||||
import com.pig4cloud.pigx.app.service.AppSocialDetailsService;
|
||||
import com.pig4cloud.pigx.common.core.constant.CacheConstants;
|
||||
import com.pig4cloud.pigx.common.security.util.SecurityUtils;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.cache.CacheManager;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author lengleng
|
||||
* @date 2018年08月16日
|
||||
*/
|
||||
@Slf4j
|
||||
@AllArgsConstructor
|
||||
@Service("appSocialDetailsService")
|
||||
public class AppSocialDetailsServiceImpl extends ServiceImpl<AppSocialDetailsMapper, AppSocialDetails>
|
||||
implements AppSocialDetailsService {
|
||||
|
||||
private final Map<String, LoginHandler> loginHandlerMap;
|
||||
|
||||
private final CacheManager cacheManager;
|
||||
|
||||
private final AppUserMapper appUserMapper;
|
||||
|
||||
/**
|
||||
* 绑定社交账号
|
||||
* @param type type
|
||||
* @param code code
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Boolean bindSocial(String type, String code) {
|
||||
LoginHandler loginHandler = loginHandlerMap.get(type);
|
||||
// 绑定逻辑
|
||||
String identify = loginHandler.identify(code);
|
||||
AppUser user = appUserMapper.selectById(SecurityUtils.getUser().getId());
|
||||
loginHandler.bind(user, identify);
|
||||
|
||||
// 更新緩存
|
||||
cacheManager.getCache(CacheConstants.USER_DETAILS_MINI).evict(user.getUsername());
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据入参查询用户信息
|
||||
* @param inStr TYPE@code
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AppUserInfo getUserInfo(String inStr) {
|
||||
String[] inStrs = inStr.split(StringPool.AT);
|
||||
String type = inStrs[0];
|
||||
String loginStr = inStr.substring(type.length() + 1);
|
||||
return loginHandlerMap.get(type).handle(loginStr);
|
||||
}
|
||||
|
||||
}
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
package com.pig4cloud.pigx.app.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
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;
|
||||
|
||||
-34
@@ -1,34 +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.app.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppUserRole;
|
||||
import com.pig4cloud.pigx.app.mapper.AppUserRoleMapper;
|
||||
import com.pig4cloud.pigx.app.service.AppUserRoleService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 用户角色表
|
||||
*
|
||||
* @author aeizzz
|
||||
* @date 2022-12-07 09:52:03
|
||||
*/
|
||||
@Service
|
||||
public class AppUserRoleServiceImpl extends ServiceImpl<AppUserRoleMapper, AppUserRole> implements AppUserRoleService {
|
||||
|
||||
}
|
||||
-318
@@ -1,318 +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.app.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.StringPool;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.pig4cloud.pigx.app.api.dto.AppUserDTO;
|
||||
import com.pig4cloud.pigx.app.api.dto.AppUserInfo;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppRole;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppUser;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppUserRole;
|
||||
import com.pig4cloud.pigx.app.api.vo.AppUserExcelVO;
|
||||
import com.pig4cloud.pigx.app.api.vo.AppUserVO;
|
||||
import com.pig4cloud.pigx.app.mapper.AppUserMapper;
|
||||
import com.pig4cloud.pigx.app.service.AppRoleService;
|
||||
import com.pig4cloud.pigx.app.service.AppUserRoleService;
|
||||
import com.pig4cloud.pigx.app.service.AppUserService;
|
||||
import com.pig4cloud.pigx.common.core.constant.CacheConstants;
|
||||
import com.pig4cloud.pigx.common.core.constant.CommonConstants;
|
||||
import com.pig4cloud.pigx.common.core.constant.enums.LoginTypeEnum;
|
||||
import com.pig4cloud.pigx.common.core.constant.enums.UserTypeEnum;
|
||||
import com.pig4cloud.pigx.common.core.exception.ErrorCodes;
|
||||
import com.pig4cloud.pigx.common.core.util.MsgUtils;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.common.excel.vo.ErrorMessage;
|
||||
import com.pig4cloud.pigx.common.security.service.PigxUser;
|
||||
import com.pig4cloud.pigx.common.security.util.SecurityUtils;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.cache.Cache;
|
||||
import org.springframework.cache.CacheManager;
|
||||
import org.springframework.cache.annotation.CacheEvict;
|
||||
import org.springframework.data.redis.core.StringRedisTemplate;
|
||||
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
||||
import org.springframework.security.crypto.password.PasswordEncoder;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.BindingResult;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* app用户表
|
||||
*
|
||||
* @author aeizzz
|
||||
* @date 2022-12-07 09:52:03
|
||||
*/
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
@Slf4j
|
||||
public class AppUserServiceImpl extends ServiceImpl<AppUserMapper, AppUser> implements AppUserService {
|
||||
|
||||
private static final PasswordEncoder ENCODER = new BCryptPasswordEncoder();
|
||||
|
||||
private final AppUserRoleService appUserRoleService;
|
||||
|
||||
private final StringRedisTemplate redisTemplate;
|
||||
|
||||
private final AppRoleService appRoleService;
|
||||
|
||||
private final CacheManager cacheManager;
|
||||
|
||||
/**
|
||||
* 更新用户
|
||||
* @param userDTO
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@CacheEvict(value = CacheConstants.USER_DETAILS_MINI, key = "#userDTO.username")
|
||||
public Boolean updateUser(AppUserDTO userDTO) {
|
||||
AppUser appUser = new AppUser();
|
||||
BeanUtils.copyProperties(userDTO, appUser);
|
||||
if (StrUtil.isNotBlank(userDTO.getPassword())) {
|
||||
appUser.setPassword(ENCODER.encode(userDTO.getPassword()));
|
||||
}
|
||||
this.updateById(appUser);
|
||||
|
||||
appUserRoleService.remove(Wrappers.<AppUserRole>lambdaQuery().eq(AppUserRole::getUserId, appUser.getUserId()));
|
||||
userDTO.getRole().forEach(roleId -> {
|
||||
AppUserRole appUserRole = new AppUserRole();
|
||||
appUserRole.setRoleId(roleId);
|
||||
appUserRole.setUserId(userDTO.getUserId());
|
||||
appUserRole.insert();
|
||||
});
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增用户
|
||||
* @param userDTO
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Boolean saveUser(AppUserDTO userDTO) {
|
||||
AppUser appUser = new AppUser();
|
||||
BeanUtils.copyProperties(userDTO, appUser);
|
||||
appUser.setDelFlag(CommonConstants.STATUS_NORMAL);
|
||||
appUser.setPassword(ENCODER.encode(userDTO.getPassword()));
|
||||
baseMapper.insert(appUser);
|
||||
// 如果角色为空,赋默认角色
|
||||
if (CollUtil.isNotEmpty(userDTO.getRole())) {
|
||||
List<AppUserRole> userRoleList = userDTO.getRole().stream().map(roleId -> {
|
||||
AppUserRole userRole = new AppUserRole();
|
||||
userRole.setUserId(appUser.getUserId());
|
||||
userRole.setRoleId(roleId);
|
||||
return userRole;
|
||||
}).collect(Collectors.toList());
|
||||
appUserRoleService.saveBatch(userRoleList);
|
||||
}
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询全部的用户
|
||||
* @param appUser
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<AppUserExcelVO> listUser(AppUserDTO appUser) {
|
||||
List<AppUser> appUsers = baseMapper.selectList(null);
|
||||
List<AppUserExcelVO> appUserExcelVOS = appUsers.stream().map(item -> {
|
||||
AppUserExcelVO appUserExcelVO = new AppUserExcelVO();
|
||||
BeanUtils.copyProperties(item, appUserExcelVO);
|
||||
return appUserExcelVO;
|
||||
}).collect(Collectors.toList());
|
||||
return appUserExcelVOS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage getUsersWithRolePage(Page page, AppUserDTO appUserDTO) {
|
||||
return baseMapper.getUserVosPage(page, appUserDTO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AppUserInfo findUserInfo(AppUser user) {
|
||||
AppUserInfo info = new AppUserInfo();
|
||||
info.setAppUser(user);
|
||||
// 设置角色列表 (ID)
|
||||
List<Long> roleIds = appRoleService.findRolesByUserId(user.getUserId())
|
||||
.stream()
|
||||
.map(AppRole::getRoleId)
|
||||
.collect(Collectors.toList());
|
||||
info.setRoles(ArrayUtil.toArray(roleIds, Long.class));
|
||||
|
||||
// 设置权限列表(menu.permission)
|
||||
Set<String> permissions = new HashSet<>();
|
||||
info.setPermissions(ArrayUtil.toArray(permissions, String.class));
|
||||
return info;
|
||||
}
|
||||
|
||||
@Override
|
||||
@CacheEvict(value = CacheConstants.USER_DETAILS_MINI, key = "#userDto.username")
|
||||
public R updateUserInfo(AppUserDTO userDto) {
|
||||
// C端客户修改手机号需要判断验证码是否正确
|
||||
PigxUser user = SecurityUtils.getUser();
|
||||
if (UserTypeEnum.TOC.getStatus().equals(user.getUserType()) && StrUtil.isNotBlank(userDto.getPhone())) {
|
||||
String key = CacheConstants.DEFAULT_CODE_KEY + LoginTypeEnum.APPSMS.getType() + StringPool.AT
|
||||
+ userDto.getPhone();
|
||||
String codeObj = redisTemplate.opsForValue().get(key);
|
||||
|
||||
if (!userDto.getMobileCode().equals(codeObj)) {
|
||||
return R.failed("验证码错误");
|
||||
}
|
||||
}
|
||||
|
||||
// 更新密码
|
||||
if (StrUtil.isNotBlank(userDto.getPassword())) {
|
||||
userDto.setPassword(ENCODER.encode(userDto.getPassword()));
|
||||
}
|
||||
|
||||
AppUser appUser = baseMapper.selectById(userDto.getUserId());
|
||||
BeanUtils.copyProperties(userDto, appUser);
|
||||
return R.ok(this.updateById(appUser));
|
||||
}
|
||||
|
||||
@Override
|
||||
public AppUserVO selectUserVoById(Long userId) {
|
||||
return baseMapper.getUserVoById(userId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除user用户同时删除user-role关系表
|
||||
* @param ids userIds
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteAppUserByIds(Long[] ids) {
|
||||
Cache cache = cacheManager.getCache(CacheConstants.USER_DETAILS_MINI);
|
||||
for (AppUser appUser : baseMapper.selectBatchIds(CollUtil.toList(ids))) {
|
||||
cache.evict(appUser.getUsername());
|
||||
}
|
||||
// 删除用户关联表
|
||||
this.appUserRoleService
|
||||
.remove(Wrappers.<AppUserRole>lambdaQuery().in(AppUserRole::getUserId, CollUtil.toList(ids)));
|
||||
|
||||
this.removeBatchByIds(CollUtil.toList(ids));
|
||||
|
||||
return Boolean.TRUE;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public R registerAppUser(AppUserDTO appUser) {
|
||||
List<AppUser> appUserList = baseMapper
|
||||
.selectList(Wrappers.<AppUser>lambdaQuery().eq(AppUser::getPhone, appUser.getPhone()));
|
||||
|
||||
if (CollUtil.isNotEmpty(appUserList)) {
|
||||
return R.failed("手机号已注册,请使用验证码直接登录");
|
||||
}
|
||||
|
||||
String key = CacheConstants.DEFAULT_CODE_KEY + LoginTypeEnum.APPSMS.getType() + StringPool.AT
|
||||
+ appUser.getPhone();
|
||||
String codeObj = redisTemplate.opsForValue().get(key);
|
||||
|
||||
if (!appUser.getMobileCode().equals(codeObj)) {
|
||||
return R.failed("验证码错误");
|
||||
}
|
||||
|
||||
AppUser app = new AppUser();
|
||||
BeanUtils.copyProperties(appUser, app);
|
||||
appUser.setUsername(app.getPhone());
|
||||
appUser.setDelFlag(CommonConstants.STATUS_NORMAL);
|
||||
appUser.setPassword(ENCODER.encode(appUser.getPassword()));
|
||||
baseMapper.insert(appUser);
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param excelVOList
|
||||
* @param bindingResult
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public R importUser(List<AppUserExcelVO> excelVOList, BindingResult bindingResult) {
|
||||
// 通用校验获取失败的数据
|
||||
List<ErrorMessage> errorMessageList = (List<ErrorMessage>) bindingResult.getTarget();
|
||||
|
||||
// 执行数据插入操作 组装 UserDto
|
||||
for (AppUserExcelVO excel : excelVOList) {
|
||||
// 个性化校验逻辑
|
||||
List<AppUser> userList = this.list();
|
||||
List<AppRole> roleList = appRoleService.list();
|
||||
|
||||
Set<String> errorMsg = new HashSet<>();
|
||||
// 校验用户名是否存在
|
||||
boolean exsitUserName = userList.stream()
|
||||
.anyMatch(sysUser -> excel.getUsername().equals(sysUser.getUsername()));
|
||||
|
||||
if (exsitUserName) {
|
||||
errorMsg.add(MsgUtils.getMessage(ErrorCodes.SYS_USER_USERNAME_EXISTING, excel.getUsername()));
|
||||
}
|
||||
|
||||
// 判断输入的角色名称列表是否合法
|
||||
List<String> roleNameList = StrUtil.split(excel.getRoleNameList(), StrUtil.COMMA);
|
||||
List<AppRole> roleCollList = roleList.stream()
|
||||
.filter(role -> roleNameList.stream().anyMatch(name -> role.getRoleName().equals(name)))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
if (roleCollList.size() != roleNameList.size()) {
|
||||
errorMsg.add(MsgUtils.getMessage(ErrorCodes.SYS_ROLE_ROLENAME_INEXISTENCE, excel.getRoleNameList()));
|
||||
}
|
||||
// 数据合法情况
|
||||
if (CollUtil.isEmpty(errorMsg)) {
|
||||
insertExcelUser(excel, roleCollList);
|
||||
}
|
||||
else {
|
||||
// 数据不合法情况
|
||||
errorMessageList.add(new ErrorMessage(excel.getLineNum(), errorMsg));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (CollUtil.isNotEmpty(errorMessageList)) {
|
||||
return R.failed(errorMessageList);
|
||||
}
|
||||
return R.ok(null, MsgUtils.getMessage(ErrorCodes.SYS_USER_IMPORT_SUCCEED));
|
||||
|
||||
}
|
||||
|
||||
private void insertExcelUser(AppUserExcelVO excel, List<AppRole> roleCollList) {
|
||||
AppUserDTO userDTO = new AppUserDTO();
|
||||
userDTO.setUsername(excel.getUsername());
|
||||
userDTO.setPhone(excel.getPhone());
|
||||
userDTO.setNickname(excel.getNickname());
|
||||
userDTO.setName(excel.getName());
|
||||
userDTO.setEmail(excel.getEmail());
|
||||
// 批量导入初始密码为手机号
|
||||
userDTO.setPassword(userDTO.getPhone());
|
||||
// 根据角色名称查询角色ID
|
||||
List<Long> roleIdList = roleCollList.stream().map(AppRole::getRoleId).collect(Collectors.toList());
|
||||
userDTO.setRole(roleIdList);
|
||||
// 插入用户
|
||||
this.saveUser(userDTO);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -13,11 +13,11 @@
|
||||
<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" converterClass="org.springframework.boot.logging.logback.ColorConverter"/>
|
||||
<conversionRule conversionWord="clr" class="org.springframework.boot.logging.logback.ColorConverter"/>
|
||||
<conversionRule conversionWord="wex"
|
||||
converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter"/>
|
||||
class="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter"/>
|
||||
<conversionRule conversionWord="wEx"
|
||||
converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter"/>
|
||||
class="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter"/>
|
||||
<!-- Console log output -->
|
||||
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
|
||||
@@ -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>
|
||||
@@ -1,52 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<!--
|
||||
~
|
||||
~ 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)
|
||||
~
|
||||
-->
|
||||
|
||||
<!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.AppRoleMapper">
|
||||
|
||||
<resultMap id="appRoleMap" type="com.pig4cloud.pigx.app.api.entity.AppRole">
|
||||
<id property="roleId" column="role_id"/>
|
||||
<result property="roleName" column="role_name"/>
|
||||
<result property="roleCode" column="role_code"/>
|
||||
<result property="roleDesc" column="role_desc"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="tenantId" column="tenant_id"/>
|
||||
</resultMap>
|
||||
<select id="listRolesByUserId" resultType="com.pig4cloud.pigx.app.api.entity.AppRole">
|
||||
SELECT app_role.role_id,
|
||||
app_role.role_name,
|
||||
app_role.role_code,
|
||||
app_role.role_desc,
|
||||
app_role.create_time,
|
||||
app_role.update_time,
|
||||
app_role.del_flag
|
||||
FROM app_role,
|
||||
app_user_role
|
||||
WHERE app_role.role_id = app_user_role.role_id
|
||||
AND app_role.del_flag = '0'
|
||||
and app_user_role.user_id = #{userId}
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -9,6 +9,8 @@
|
||||
<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"/>
|
||||
|
||||
@@ -1,97 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<!--
|
||||
~
|
||||
~ 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)
|
||||
~
|
||||
-->
|
||||
|
||||
<!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.AppUserMapper">
|
||||
|
||||
<resultMap id="appUserMap" type="com.pig4cloud.pigx.app.api.vo.AppUserVO">
|
||||
<id property="userId" column="user_id"/>
|
||||
<result property="username" column="username"/>
|
||||
<result property="password" column="password"/>
|
||||
<result property="phone" column="phone"/>
|
||||
<result property="avatar" column="avatar"/>
|
||||
<result property="nickname" column="nickname"/>
|
||||
<result property="name" column="name"/>
|
||||
<result property="email" column="email"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="tenantId" column="tenant_id"/>
|
||||
<result property="lastModifiedTime" column="last_modified_time"/>
|
||||
<collection property="roleList" ofType="com.pig4cloud.pigx.app.api.entity.AppRole"
|
||||
select="com.pig4cloud.pigx.app.mapper.AppRoleMapper.listRolesByUserId" column="user_id">
|
||||
</collection>
|
||||
</resultMap>
|
||||
<select id="getUserVosPage" resultMap="appUserMap">
|
||||
select
|
||||
u.user_id,
|
||||
u.username,
|
||||
u.password,
|
||||
u.phone,
|
||||
u.avatar,
|
||||
u.create_time,
|
||||
u.del_flag,
|
||||
u.lock_flag,
|
||||
u.tenant_id,
|
||||
u.nickname,
|
||||
u.name,
|
||||
u.email
|
||||
from app_user u
|
||||
<where>
|
||||
u.del_flag = '0'
|
||||
<if test="query.username != null and query.username != ''">
|
||||
<bind name="usernameLike" value="'%'+query.username+'%'"/>
|
||||
AND u.username LIKE #{usernameLike}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<sql id="userRoleDeptSql">
|
||||
u.user_id,
|
||||
u.username,
|
||||
u.password,
|
||||
u.salt,
|
||||
u.phone,
|
||||
u.avatar,
|
||||
u.wx_openid,
|
||||
u.del_flag,
|
||||
u.lock_flag,
|
||||
u.tenant_id,
|
||||
u.nickname,
|
||||
u.name,
|
||||
u.email,
|
||||
u.create_by,
|
||||
u.create_time ucreate_time,
|
||||
u.update_time uupdate_time,
|
||||
r.role_id
|
||||
</sql>
|
||||
|
||||
<select id="getUserVoById" resultMap="appUserMap">
|
||||
SELECT
|
||||
<include refid="userRoleDeptSql"/>
|
||||
FROM
|
||||
app_user u
|
||||
LEFT JOIN app_user_role urole ON urole.user_id = u.user_id
|
||||
LEFT JOIN app_role r ON r.role_id = urole.role_id
|
||||
WHERE
|
||||
u.user_id = #{id}
|
||||
</select>
|
||||
</mapper>
|
||||
Loaded 100 of 1720 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user