Compare commits
815 Commits
3d67fbbb62
...
55e079b0e6
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
55e079b0e6 | ||
|
|
dfbc125e69 | ||
|
|
cc4a840732 | ||
|
|
c1c5bbe0e2 | ||
|
|
25c7c0a414 | ||
|
|
3052c5192b | ||
|
|
b842216033 | ||
|
|
273ba1f53f | ||
|
|
3f06fb0e09 | ||
|
|
245b12d69d | ||
|
|
663b831ec1 | ||
|
|
e4ee77abe9 | ||
|
|
6fdcd68726 | ||
|
|
b91ea42ab6 | ||
|
|
8e80bf7d4d | ||
|
|
c66f7435e3 | ||
|
|
c8cf9650a0 | ||
|
|
a2e25fa92d | ||
|
|
0a7d83a7a4 | ||
|
|
3965512ef2 | ||
|
|
4bc3f4db53 | ||
|
|
602e77aef9 | ||
|
|
3212aef056 | ||
|
|
53b38964cc | ||
|
|
db656bae90 | ||
|
|
8d2867be57 | ||
|
|
af60136caf | ||
|
|
4ddce1401a | ||
|
|
299031ac3f | ||
|
|
7a4c94af58 | ||
|
|
d65a73a151 | ||
|
|
fdde41fa4f | ||
|
|
29ddc7cff8 | ||
|
|
0a6cf855c3 | ||
|
|
779c555aa5 | ||
|
|
be8254584e | ||
|
|
6d515d303b | ||
|
|
03da869c44 | ||
|
|
94862aafbc | ||
|
|
a4aa2c5f07 | ||
|
|
7cd73a8c96 | ||
|
|
6db48bd2b5 | ||
|
|
22228b5bb2 | ||
|
|
7337cdf152 | ||
|
|
ab86be2ea0 | ||
|
|
9c13e34d99 | ||
|
|
3c8cb1b5f4 | ||
|
|
80d04d9ae1 | ||
|
|
8531bb1489 | ||
|
|
9cb514ca75 | ||
|
|
4889590b35 | ||
|
|
fdb8082095 | ||
|
|
42e2001160 | ||
|
|
f0bb6d4fe2 | ||
|
|
6585fecc6a | ||
|
|
20a84e4899 | ||
|
|
4eb435e1d1 | ||
|
|
6f1ced3bf8 | ||
|
|
209073d08a | ||
|
|
cbe4e8503d | ||
|
|
49a915a7a2 | ||
|
|
1bb2e190a2 | ||
|
|
205767efd5 | ||
|
|
fde34cd9b1 | ||
|
|
56c3ab71bc | ||
|
|
916c852a71 | ||
|
|
093864943e | ||
|
|
aa3aa3ce62 | ||
|
|
6092a1c3be | ||
|
|
9f4745b740 | ||
|
|
b72d1675e4 | ||
|
|
bf46f423c1 | ||
|
|
ab72563523 | ||
|
|
5d05c936c7 | ||
|
|
d21e004be7 | ||
|
|
afc26eb0a1 | ||
|
|
4cacf2c16d | ||
|
|
21f587ed55 | ||
|
|
e8a2778db0 | ||
|
|
01b16bba68 | ||
|
|
e21b0b337f | ||
|
|
43b45a5461 | ||
|
|
a179924253 | ||
|
|
48ac52037d | ||
|
|
2fd6c1459f | ||
|
|
d9bd54a002 | ||
|
|
2f631b9a9f | ||
|
|
689433001f | ||
|
|
eebdc0f384 | ||
|
|
5005bac4a5 | ||
|
|
747adc64ca | ||
|
|
eb06aca1ae | ||
|
|
c1fb491dea | ||
|
|
b9c611f235 | ||
|
|
b86b968e36 | ||
|
|
de89d8442c | ||
|
|
c9d0ab7e9a | ||
|
|
95b19c4522 | ||
|
|
ca91a6f3ce | ||
|
|
681ec8269c | ||
|
|
dbf39e3057 | ||
|
|
8c45de4d25 | ||
|
|
963940c367 | ||
|
|
fb2bcd87eb | ||
|
|
e164ced733 | ||
|
|
4c8955168f | ||
|
|
ce006803c1 | ||
|
|
c65b8f54a5 | ||
|
|
18d0c3d55c | ||
|
|
95d9c628d7 | ||
|
|
82db686b05 | ||
|
|
9ffd7226f9 | ||
|
|
47aefb5e00 | ||
|
|
f97d4d9c6d | ||
|
|
0e4fe65d27 | ||
|
|
9c97414597 | ||
|
|
b9b0ab98ee | ||
|
|
1a44a41c22 | ||
|
|
6a6871af49 | ||
|
|
d2560df18a | ||
|
|
ffc062ce6e | ||
|
|
39e56533ae | ||
|
|
c53b5e8f7b | ||
|
|
f9380df215 | ||
|
|
788822db37 | ||
|
|
24df252924 | ||
|
|
cfc1468307 | ||
|
|
eba030508f | ||
|
|
d986228964 | ||
|
|
34d6b01ce6 | ||
|
|
d3cb276293 | ||
|
|
22b8340a0d | ||
|
|
9e9d161137 | ||
|
|
7c8a8044c9 | ||
|
|
d0db3f4ef0 | ||
|
|
9b60897a2a | ||
|
|
f18e1760a2 | ||
|
|
ab472a32f6 | ||
|
|
982f5e1df9 | ||
|
|
f86c687bd8 | ||
|
|
53f63d8207 | ||
|
|
e813ec5575 | ||
|
|
57416fffea | ||
|
|
680201e43e | ||
|
|
53e20dfd63 | ||
|
|
0cca95db04 | ||
|
|
c123240588 | ||
|
|
dbcd2f4559 | ||
|
|
060c134679 | ||
|
|
42f31ed4cc | ||
|
|
38800470f2 | ||
|
|
f80cb3cc64 | ||
|
|
baba117865 | ||
|
|
2039414e2a | ||
|
|
64f3547858 | ||
|
|
9c0e2223d4 | ||
|
|
50b0938dd8 | ||
|
|
de05d258ef | ||
|
|
c6ad2dbe8e | ||
|
|
7b476f3e92 | ||
|
|
dd71063cdb | ||
|
|
4f814d7361 | ||
|
|
9f412fe108 | ||
|
|
a8d1f8e831 | ||
|
|
efe7e00821 | ||
|
|
24afaa8a91 | ||
|
|
86bf47ce61 | ||
|
|
ab153ea15b | ||
|
|
79faa6a377 | ||
|
|
e5a73420b6 | ||
|
|
67ac4b37a2 | ||
|
|
233987634c | ||
|
|
b46b707586 | ||
|
|
9cb54041cd | ||
|
|
ead94222b6 | ||
|
|
6ed88bb607 | ||
|
|
760d9928dc | ||
|
|
50e8a42e34 | ||
|
|
62e0c55939 | ||
|
|
1a9d4eca2e | ||
|
|
53a99c36b1 | ||
|
|
040016d88f | ||
|
|
3c6aadb253 | ||
|
|
67035477c1 | ||
|
|
4c919de552 | ||
|
|
d2619efa56 | ||
|
|
86114360bb | ||
|
|
d2ed9e9eeb | ||
|
|
be076197d2 | ||
|
|
ca1c10382a | ||
|
|
7ef4139f4e | ||
|
|
c1a164da7a | ||
|
|
5e1ba64e87 | ||
|
|
d074a56b83 | ||
|
|
787f33f555 | ||
|
|
ceefccb3b2 | ||
|
|
cbbc5e0ff1 | ||
|
|
3749f04e6a | ||
|
|
6d748f3dda | ||
|
|
7bdb1f3385 | ||
|
|
297dffcbc0 | ||
|
|
06b826769b | ||
|
|
f946f2926a | ||
|
|
f4cbb23aa0 | ||
|
|
ce1ea141d2 | ||
|
|
9ca89cf975 | ||
|
|
80a4e40748 | ||
|
|
a410a8f758 | ||
|
|
f9f5275694 | ||
|
|
e2552f50be | ||
|
|
111e450096 | ||
|
|
fea04f12d7 | ||
|
|
138b0d0c4e | ||
|
|
e806342959 | ||
|
|
7e522785ff | ||
|
|
7febe9dddc | ||
|
|
ca5f1c4040 | ||
|
|
be0a5a8e98 | ||
|
|
e7eeb9114c | ||
|
|
833f0ffcf5 | ||
|
|
2a5c6a4d9e | ||
|
|
5db55ed7af | ||
|
|
b3c4bedf4b | ||
|
|
a359975d51 | ||
|
|
65105982b2 | ||
|
|
8f6b9207d2 | ||
|
|
57fc586eb8 | ||
|
|
28f5fa1019 | ||
|
|
f7fd8dc29e | ||
|
|
959ec41656 | ||
|
|
ffa9b9d703 | ||
|
|
254b32eec4 | ||
|
|
0862a8e652 | ||
|
|
3996b3e1cb | ||
|
|
5b7aa513a2 | ||
|
|
3a51cc35ca | ||
|
|
4097d00f80 | ||
|
|
ceece7c8f6 | ||
|
|
4ae0a9d659 | ||
|
|
440f939725 | ||
|
|
4cda7f0d3c | ||
|
|
ee2b0b5b81 | ||
|
|
3900dffdbe | ||
|
|
648e200d87 | ||
|
|
86216a6456 | ||
|
|
71850d505e | ||
|
|
c232e52047 | ||
|
|
6f14668342 | ||
|
|
93924f1f3d | ||
|
|
ba551fb724 | ||
|
|
6e71132721 | ||
|
|
27d4166fae | ||
|
|
73ee2281b9 | ||
|
|
5f2f0c6eb7 | ||
|
|
58c21b1804 | ||
|
|
3cc3751d09 | ||
|
|
18b27b61ac | ||
|
|
6a7b9d295e | ||
|
|
3f2c872463 | ||
|
|
904de02083 | ||
|
|
a53242b8d3 | ||
|
|
0c4f7847fc | ||
|
|
a340da2359 | ||
|
|
0bec257730 | ||
|
|
62222bb781 | ||
|
|
cc1b2a657b | ||
|
|
4d7a2edeea | ||
|
|
e305da3feb | ||
|
|
e5c2813cc1 | ||
|
|
1a6386f7df | ||
|
|
b21a2beff8 | ||
|
|
48f63db5eb | ||
|
|
32152074a1 | ||
|
|
b0750bdafc | ||
|
|
804a7f656e | ||
|
|
a8cddf020f | ||
|
|
7d9f271b7c | ||
|
|
f8b8d98723 | ||
|
|
b045d44d14 | ||
|
|
2aae36dfca | ||
|
|
97d94919e4 | ||
|
|
aec7ea5c08 | ||
|
|
67ef0ae547 | ||
|
|
8ce1f61611 | ||
|
|
c7ca444fe7 | ||
|
|
6fb16aa12c | ||
|
|
def6990eba | ||
|
|
0ae230ddba | ||
|
|
7860b94a55 | ||
|
|
d4c7aad3ab | ||
|
|
d362c1d496 | ||
|
|
41e446e3a5 | ||
|
|
0fee793931 | ||
|
|
b4b9557fe9 | ||
|
|
607398f7ec | ||
|
|
51fd9a634e | ||
|
|
e28b32c76d | ||
|
|
29a45315a2 | ||
|
|
3919dae9fe | ||
|
|
e6b8124a72 | ||
|
|
c94f4d0ee7 | ||
|
|
4e53d11cbd | ||
|
|
33c5cc6b0b | ||
|
|
b9399f887b | ||
|
|
68e8a9a988 | ||
|
|
4a4df586c6 | ||
|
|
9fddc59c56 | ||
|
|
0d66003dee | ||
|
|
0aa7baee1e | ||
|
|
1a2c9a8f49 | ||
|
|
6d7a88ef29 | ||
|
|
d457c5391f | ||
|
|
da2cbb5c4a | ||
|
|
2fa8955aa4 | ||
|
|
01b6046d5a | ||
|
|
dd4c9ca1e0 | ||
|
|
1041caad23 | ||
|
|
6822c3d94c | ||
|
|
84f8323832 | ||
|
|
d89f2f38d3 | ||
|
|
4018826abe | ||
|
|
00be6206a9 | ||
|
|
99e7ce25de | ||
|
|
3ef91f9b93 | ||
|
|
1cc0cc8d72 | ||
|
|
4aef652b20 | ||
|
|
d64429f0bb | ||
|
|
65a055fcf9 | ||
|
|
9563cbab8d | ||
|
|
d471c1b43e | ||
|
|
79a6c3fa24 | ||
|
|
420829cec3 | ||
|
|
1cfc190b73 | ||
|
|
76e534ef0b | ||
|
|
cf06e4fc6a | ||
|
|
c19dbc1a41 | ||
|
|
8542091977 | ||
|
|
15671c02c3 | ||
|
|
561ce385a1 | ||
|
|
0f72151aa7 | ||
|
|
e4c8d033dc | ||
|
|
3bde233e8a | ||
|
|
b7e67a9000 | ||
|
|
f279c4edc9 | ||
|
|
eec742d48a | ||
|
|
c9385ab091 | ||
|
|
b45645edc3 | ||
|
|
14b70c809c | ||
|
|
8c09cf7635 | ||
|
|
7004812acf | ||
|
|
27c571e4a6 | ||
|
|
234f8399ab | ||
|
|
9a82b28377 | ||
|
|
b683cbea4f | ||
|
|
c29964a05b | ||
|
|
9c5f1848a6 | ||
|
|
36aa17bd1a | ||
|
|
c1d8d78a2e | ||
|
|
7c76066d04 | ||
|
|
9d2d569107 | ||
|
|
14ebccce5f | ||
|
|
41e650488d | ||
|
|
ad9d89a1bb | ||
|
|
e2f5fd359f | ||
|
|
81f3eb6675 | ||
|
|
ca6f0c51e5 | ||
|
|
e999672037 | ||
|
|
d6a25673bc | ||
|
|
360c19a8f5 | ||
|
|
5c1f33a8a8 | ||
|
|
286616c13a | ||
|
|
591278273f | ||
|
|
a405a89567 | ||
|
|
abb19cc493 | ||
|
|
892509b5db | ||
|
|
6b44eb780d | ||
|
|
90846eb673 | ||
|
|
5b8e5d41fe | ||
|
|
947f4c3f17 | ||
|
|
2578d6e4da | ||
|
|
daeea52d64 | ||
|
|
f5ab99ae25 | ||
|
|
d040adc9e8 | ||
|
|
1b77cb2ec2 | ||
|
|
3641a40a69 | ||
|
|
b11b78deab | ||
|
|
11096ad67f | ||
|
|
d42437d63b | ||
|
|
a59557bc85 | ||
|
|
cc2f1489f3 | ||
|
|
071526f7a7 | ||
|
|
c61043ad65 | ||
|
|
3429f61ebc | ||
|
|
39283bf55f | ||
|
|
05df11bd7f | ||
|
|
1c3db93ffd | ||
|
|
f36d490776 | ||
|
|
f6527e8c7d | ||
|
|
e101afccc6 | ||
|
|
6bfcc53073 | ||
|
|
241bed34c3 | ||
|
|
a875e13e55 | ||
|
|
e5480583d9 | ||
|
|
2e47d654be | ||
|
|
e791002e2e | ||
|
|
2b52fb23a2 | ||
|
|
83c92deda4 | ||
|
|
1ef3b816a7 | ||
|
|
e90af652ca | ||
|
|
139c289f1d | ||
|
|
4b8af75652 | ||
|
|
108167430d | ||
|
|
96d3a9111d | ||
|
|
25b774c905 | ||
|
|
07fcd4b7b7 | ||
|
|
2243208ae9 | ||
|
|
975469e190 | ||
|
|
be7823cfba | ||
|
|
b1cd37497c | ||
|
|
03af6aa70e | ||
|
|
71f7be0149 | ||
|
|
e5fbfd1a93 | ||
|
|
c3b75656a4 | ||
|
|
64ec884b88 | ||
|
|
92423be010 | ||
|
|
71c87b2993 | ||
|
|
83885990c0 | ||
|
|
21f62035cf | ||
|
|
ee06eef1d3 | ||
|
|
1965692f0f | ||
|
|
deed8bb14c | ||
|
|
8c175ad9cc | ||
|
|
fd86cccdf2 | ||
|
|
09fcd6c7ab | ||
|
|
1a9381a9a8 | ||
|
|
0bcebe80a0 | ||
|
|
ebb7354d23 | ||
|
|
005589007e | ||
|
|
961183d17b | ||
|
|
5a56ce7918 | ||
|
|
eca69bb085 | ||
|
|
f15f8a32be | ||
|
|
2971e34325 | ||
|
|
af9bf73313 | ||
|
|
9573286e7f | ||
|
|
859a835d5b | ||
|
|
c02ab392c4 | ||
|
|
0a45391f7c | ||
|
|
8b651e526f | ||
|
|
43e51b076f | ||
|
|
8759180068 | ||
|
|
911ca91800 | ||
|
|
e0169d98b7 | ||
|
|
11be388dcc | ||
|
|
5d343ad006 | ||
|
|
e434d11bd0 | ||
|
|
17d35418da | ||
|
|
b73ba40b8e | ||
|
|
6c00dca9ec | ||
|
|
9403b72ad6 | ||
|
|
3cd976976a | ||
|
|
d9e854ca45 | ||
|
|
6cea240822 | ||
|
|
5721bb31c8 | ||
|
|
e916b572c5 | ||
|
|
3366ed74f4 | ||
|
|
416b9d22d7 | ||
|
|
6da4856538 | ||
|
|
47bc4200a7 | ||
|
|
2e08e3db7b | ||
|
|
d15b483062 | ||
|
|
3af8cf9481 | ||
|
|
f167aad093 | ||
|
|
cf2a352f1e | ||
|
|
6dfdd667ad | ||
|
|
2d0ea47c7c | ||
|
|
ea859786da | ||
|
|
c8ff395fe4 | ||
|
|
8d49d4f164 | ||
|
|
855189b565 | ||
|
|
c8e63f4a57 | ||
|
|
5efe255a77 | ||
|
|
bc7037f1fa | ||
|
|
ba9cb470a6 | ||
|
|
ca24f9db30 | ||
|
|
afbf183b97 | ||
|
|
cd75ee795f | ||
|
|
7342c0d72a | ||
|
|
265489956c | ||
|
|
1bd606a89c | ||
|
|
496a56be5d | ||
|
|
24e4d0adf4 | ||
|
|
417126484b | ||
|
|
7417095e10 | ||
|
|
b868ef19ae | ||
|
|
f6f305f0f3 | ||
|
|
58423feac4 | ||
|
|
31ddad6dc1 | ||
|
|
08f222d777 | ||
|
|
b09925dd09 | ||
|
|
77066ec392 | ||
|
|
537de58afc | ||
|
|
1948a60c29 | ||
|
|
12795e2115 | ||
|
|
37055bbf0f | ||
|
|
60f6f58e69 | ||
|
|
347cfdeaef | ||
|
|
91b45e3595 | ||
|
|
a6a01dae3d | ||
|
|
b12a61b2f6 | ||
|
|
c387f5d17b | ||
|
|
042b23c647 | ||
|
|
42fae2b6fc | ||
|
|
8434bd1d95 | ||
|
|
21f06c6e39 | ||
|
|
528af06922 | ||
|
|
ac07b86971 | ||
|
|
ef53f59551 | ||
|
|
8c026be22d | ||
|
|
485319d4f8 | ||
|
|
4c4e1c1cc6 | ||
|
|
33f8742ad1 | ||
|
|
51f8b68b5b | ||
|
|
10497080c1 | ||
|
|
7f85a0adeb | ||
|
|
a347d89bfd | ||
|
|
fb16483c40 | ||
|
|
12b0be2f6d | ||
|
|
361a8eb580 | ||
|
|
bc87a3a114 | ||
|
|
9c027b59db | ||
|
|
5273ea7183 | ||
|
|
9fdba9c9cc | ||
|
|
0db8e026a3 | ||
|
|
aa4acd1bd2 | ||
|
|
2970f368bc | ||
|
|
fd53f078ae | ||
|
|
cd449c1c6e | ||
|
|
a9ba1e1e38 | ||
|
|
e34331817b | ||
|
|
2cedc71241 | ||
|
|
4fe9ee2d8d | ||
|
|
b3c1e21ccf | ||
|
|
8dcd2b531a | ||
|
|
6251fea936 | ||
|
|
6adbfef8e8 | ||
|
|
55f1be350b | ||
|
|
0c3e93bba6 | ||
|
|
a9bec4c4fd | ||
|
|
b4827419d0 | ||
|
|
2af7e4c4d4 | ||
|
|
6d0c17557b | ||
|
|
f02cf6fca2 | ||
|
|
9d8ae61a56 | ||
|
|
b4ffd1527a | ||
|
|
ce12e09972 | ||
|
|
729b83f195 | ||
|
|
ae6b4aa0d3 | ||
|
|
4bedece94e | ||
|
|
b1673687a8 | ||
|
|
f5779ba6c1 | ||
|
|
a0267481df | ||
|
|
619f0fde1a | ||
|
|
0895df9d5d | ||
|
|
6688e5f830 | ||
|
|
c51a034a9f | ||
|
|
50fd645a1f | ||
|
|
5773f159d2 | ||
|
|
4a3d12c926 | ||
|
|
cdbc82f689 | ||
|
|
459e2759b3 | ||
|
|
2594714709 | ||
|
|
a216dd11e3 | ||
|
|
4bb86f4790 | ||
|
|
c7ab3419b4 | ||
|
|
cd5990ca62 | ||
|
|
edd19afcf3 | ||
|
|
28076f2441 | ||
|
|
8d60b893c7 | ||
|
|
905300ec47 | ||
|
|
7530b6dfdc | ||
|
|
9bdaa75514 | ||
|
|
ed910df0b8 | ||
|
|
e9523e29e7 | ||
|
|
813e315ae3 | ||
|
|
ee9b3f3a22 | ||
|
|
b65618bd0c | ||
|
|
a1f87d86e3 | ||
|
|
c4e8c1d492 | ||
|
|
67165dcb47 | ||
|
|
344eeebecb | ||
|
|
5b4ea9995b | ||
|
|
ebd7c05523 | ||
|
|
058c6d6391 | ||
|
|
ba0d6b2525 | ||
|
|
d69f0e4d72 | ||
|
|
6e71fde6f5 | ||
|
|
3e018487c6 | ||
|
|
1f4efbb72b | ||
|
|
c26c3ea192 | ||
|
|
53675d2d60 | ||
|
|
ace57c52f4 | ||
|
|
6d8401d3e0 | ||
|
|
5f1fbe977d | ||
|
|
1a034d7e9b | ||
|
|
4bf7ac23db | ||
|
|
17c00236cf | ||
|
|
1e2ce0a18f | ||
|
|
850c8f0d39 | ||
|
|
c8f2f1346d | ||
|
|
e892768dc3 | ||
|
|
094423042e | ||
|
|
7cc39dfd3b | ||
|
|
c9b0abb525 | ||
|
|
893e21fd4d | ||
|
|
639e9f8d4a | ||
|
|
a6cdd880c8 | ||
|
|
f9ae25ace5 | ||
|
|
aef2ee18dd | ||
|
|
21196c62ee | ||
|
|
c272a9de77 | ||
|
|
78ce8c41bd | ||
|
|
43d5fe6692 | ||
|
|
898ead74d1 | ||
|
|
bb5fa34611 | ||
|
|
a240d9a3e3 | ||
|
|
bd07bf3264 | ||
|
|
ebd4d88f31 | ||
|
|
832b68752b | ||
|
|
99aa49ece5 | ||
|
|
e56588125b | ||
|
|
b9e35bba6c | ||
|
|
ffd3c95ade | ||
|
|
eaf5f86a19 | ||
|
|
87d3985a60 | ||
|
|
bd8615e9f2 | ||
|
|
425e53e445 | ||
|
|
76412c96ce | ||
|
|
aef76fb689 | ||
|
|
2c9609d0c3 | ||
|
|
075f89df49 | ||
|
|
62dd14a627 | ||
|
|
735098b2c7 | ||
|
|
6430c18d2a | ||
|
|
6b4617b6e7 | ||
|
|
9cb979d830 | ||
|
|
8dc98d4aca | ||
|
|
91f6970eb0 | ||
|
|
afc6088f70 | ||
|
|
16fc420030 | ||
|
|
90275a865c | ||
|
|
fb89b488d2 | ||
|
|
6901177f05 | ||
|
|
5855ba8dde | ||
|
|
12c9732fa8 | ||
|
|
5bf706e528 | ||
|
|
fe5ec165f2 | ||
|
|
a3197b7d55 | ||
|
|
ef06ecd774 | ||
|
|
56f4460995 | ||
|
|
e35ba06a97 | ||
|
|
ffd371d54c | ||
|
|
9f12f7035c | ||
|
|
5b92c3833b | ||
|
|
125ef2b179 | ||
|
|
c596831b0c | ||
|
|
1859a028aa | ||
|
|
a72c033e5b | ||
|
|
34cabe5f70 | ||
|
|
39d311c858 | ||
|
|
956cbde1bc | ||
|
|
28ad9528d2 | ||
|
|
d197771eb3 | ||
|
|
65f7e1bee4 | ||
|
|
6c341590ee | ||
|
|
6a9bfa0ef0 | ||
|
|
7e55d52874 | ||
|
|
615032a0a8 | ||
|
|
147298188b | ||
|
|
be16fdbfc2 | ||
|
|
396e2cc16f | ||
|
|
95fc072b0b | ||
|
|
73dec168ca | ||
|
|
aac869e435 | ||
|
|
396ef61206 | ||
|
|
215dc8d254 | ||
|
|
132312ea06 | ||
|
|
d34c5ed03b | ||
|
|
3795421f08 | ||
|
|
ea59eda5b1 | ||
|
|
441faaa104 | ||
|
|
1b7bad9479 | ||
|
|
5cddfc8a97 | ||
|
|
754db92a9a | ||
|
|
a56eed8563 | ||
|
|
723b50da53 | ||
|
|
8b21e567f2 | ||
|
|
962948afdb | ||
|
|
4c50131761 | ||
|
|
c523a5a7c6 | ||
|
|
a58cccfff6 | ||
|
|
ee33f2ba74 | ||
|
|
998c9d2645 | ||
|
|
c136231742 | ||
|
|
3b8773f4de | ||
|
|
db3f6d9774 | ||
|
|
d9d16753c0 | ||
|
|
48a63dad45 | ||
|
|
94a503f95d | ||
|
|
9b1db4740d | ||
|
|
24dd57d57d | ||
|
|
4973687e07 | ||
|
|
0b274c4755 | ||
|
|
82f1e3984f | ||
|
|
cd4ca1c1e0 | ||
|
|
4f07c86e7e | ||
|
|
6253acf53c | ||
|
|
4aaf1a1587 | ||
|
|
0c3fe73ce2 | ||
|
|
1a9f117530 | ||
|
|
f739f7bc0e | ||
|
|
ff1698a49c | ||
|
|
45682bbf99 | ||
|
|
fe01a42f82 | ||
|
|
f119bc44d9 | ||
|
|
dc959ec49b | ||
|
|
b81a3682c2 | ||
|
|
6c7ef6e92e | ||
|
|
ee37c10399 | ||
|
|
05ec312127 | ||
|
|
bbf5cb03ad | ||
|
|
cfd5dcd423 | ||
|
|
934071801d | ||
|
|
e809ed3423 | ||
|
|
ae4d8b7fb2 | ||
|
|
646a42150f | ||
|
|
ecd06fc837 | ||
|
|
bef22ffbcc | ||
|
|
30bedd0877 | ||
|
|
5a521c8a5f | ||
|
|
44bcaf131e | ||
|
|
6060ae264b | ||
|
|
292f2f1ca3 | ||
|
|
b26e79eb1b | ||
|
|
82ff819cf8 | ||
|
|
bf0f8b9a5d | ||
|
|
984134aaec | ||
|
|
6c94bc29c9 | ||
|
|
8da41cee3b | ||
|
|
22f9bf7165 | ||
|
|
6de13a61f7 | ||
|
|
379230dd39 | ||
|
|
79ce15a92a | ||
|
|
fbbf6b984f | ||
|
|
57e6b0227f | ||
|
|
4b7f920b5a | ||
|
|
90e0169eb7 | ||
|
|
a5b0cc0a65 | ||
|
|
e94917a9d2 | ||
|
|
4064cc8c2b | ||
|
|
56f17f1bd8 | ||
|
|
f0e50d3cd2 | ||
|
|
2ab8a4b213 | ||
|
|
5a173a491c | ||
|
|
bbf7c06bd4 | ||
|
|
616fc938cb | ||
|
|
86547b9267 | ||
|
|
c237fe6adc | ||
|
|
e14fd8b286 | ||
|
|
a0692df845 | ||
|
|
95df7ccd04 | ||
|
|
87d49e2c18 | ||
|
|
9b74c5e703 | ||
|
|
a8aeacfd96 | ||
|
|
732479d97b | ||
|
|
958624afde | ||
|
|
8d7ee20a28 | ||
|
|
571e9e6fac | ||
|
|
6a982689ef | ||
|
|
c35e1402c3 | ||
|
|
b53313811b | ||
|
|
5d05e68bbb | ||
|
|
bcf9dd8ab9 | ||
|
|
6ae2cce870 | ||
|
|
7a560eee63 | ||
|
|
ff810b8405 | ||
|
|
aa1ab9937a | ||
|
|
b90f56502d | ||
|
|
e00dc9f3cf | ||
|
|
68cf3a10d6 | ||
|
|
bfe0ee0652 | ||
|
|
c79a1aab49 | ||
|
|
0c5a5a466f | ||
|
|
e9255389e2 | ||
|
|
68a31236b3 | ||
|
|
ea1335607a | ||
|
|
a1e0c7c5f5 | ||
|
|
77caf2e631 | ||
|
|
0310a6bd21 | ||
|
|
333db69e4a | ||
|
|
65acd1ff86 | ||
|
|
b8f1997ed7 | ||
|
|
ab312efbb5 | ||
|
|
2780e311e1 | ||
|
|
35293e8404 | ||
|
|
49872fd620 | ||
|
|
d97fbfdebf | ||
|
|
7495d458e6 | ||
|
|
a0d619692f | ||
|
|
06303361e0 | ||
|
|
2aeff09639 | ||
|
|
58978104bf | ||
|
|
95b7f1f859 | ||
|
|
f1afffd198 | ||
|
|
a1e6be40db |
@ -1,7 +1,6 @@
|
|||||||
package constants
|
package constants
|
||||||
|
|
||||||
// 发票主体页面
|
const INVOICE_TEMPLATE_01 = `
|
||||||
const MAIN_INVOICE_HTML = `
|
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
|
|
||||||
@ -11,17 +10,38 @@ const MAIN_INVOICE_HTML = `
|
|||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>Invoice</title>
|
<title>Invoice</title>
|
||||||
<style>
|
<style>
|
||||||
|
@font-face {
|
||||||
|
font-family: "Montserrat-SemiBold";
|
||||||
|
src: url("https://s3.us-west-1.amazonaws.com/storage.fusenpack.com/b808164b4f7ecc19f560d235db5b1f5b99fe8ab218b606f15debab2b9c4230e2");
|
||||||
|
}
|
||||||
|
|
||||||
|
@font-face {
|
||||||
|
font-family: "Montserrat-Medium";
|
||||||
|
src: url("https://s3.us-west-1.amazonaws.com/storage.fusenpack.com/3d91bbd91ba6fac26b8460a078742b61bfd1e2976311c065f8ac9c5270be6901");
|
||||||
|
}
|
||||||
|
|
||||||
|
@font-face {
|
||||||
|
font-family: "Montserrat-Light";
|
||||||
|
src: url("https://s3.us-west-1.amazonaws.com/storage.fusenpack.com/24e580a4a5afebf94596ec7b6c8d9c8d57f75a5429ee757217da552d5f03e5d1");
|
||||||
|
}
|
||||||
|
|
||||||
|
@font-face {
|
||||||
|
font-family: "Montserrat-Regular";
|
||||||
|
src: url("https://s3.us-west-1.amazonaws.com/storage.fusenpack.com/78072d2cbce0a3f88c01ab2830ba3a453f0968b516388e45e9a6fb5e970450b8");
|
||||||
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.header_warp {
|
.header_warp {
|
||||||
background-color: #F8F8FA;
|
background-color: #F8F8FA;
|
||||||
padding: 20px 5% 20px 6%;
|
padding: 40px 5% 40px 6%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.header_td {
|
.header_td {
|
||||||
width: 50%;
|
width: 50%;
|
||||||
|
font-family: Montserrat-SemiBold;
|
||||||
}
|
}
|
||||||
|
|
||||||
.header_td.logo {
|
.header_td.logo {
|
||||||
@ -29,31 +49,33 @@ const MAIN_INVOICE_HTML = `
|
|||||||
}
|
}
|
||||||
|
|
||||||
.header_logo {
|
.header_logo {
|
||||||
max-height: 15px;
|
max-height: 30px;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
margin-top: 5px;
|
margin-top: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.header_td.title {
|
.header_td.title {
|
||||||
color: #212121;
|
color: #212121;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
font-size: 36px;
|
font-size: 72px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.information_warp {
|
.information_warp {
|
||||||
padding: 30px 5% 30px 6%;
|
padding: 60px 5% 60px 6%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.information_td {
|
.information_td {
|
||||||
width: 50%;
|
width: 50%;
|
||||||
font-size: 13px;
|
font-size: 26px;
|
||||||
line-height: 20px;
|
line-height: 39px;
|
||||||
font-weight: 300;
|
font-weight: 300;
|
||||||
|
font-family: Montserrat-Light;
|
||||||
}
|
}
|
||||||
|
|
||||||
.information_td.bill {
|
.information_td.bill {
|
||||||
color: #212121;
|
color: #212121;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
|
font-family: Montserrat-Medium;
|
||||||
}
|
}
|
||||||
|
|
||||||
.information_td.right {
|
.information_td.right {
|
||||||
@ -62,7 +84,7 @@ const MAIN_INVOICE_HTML = `
|
|||||||
|
|
||||||
.information_td.info {
|
.information_td.info {
|
||||||
color: #666666;
|
color: #666666;
|
||||||
line-height: 17px;
|
line-height: 34px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.bill_warp {
|
.bill_warp {
|
||||||
@ -70,7 +92,7 @@ const MAIN_INVOICE_HTML = `
|
|||||||
}
|
}
|
||||||
|
|
||||||
.bill_td {
|
.bill_td {
|
||||||
font-size: 13px;
|
font-size: 26px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.bill_td:first-child {
|
.bill_td:first-child {
|
||||||
@ -78,17 +100,23 @@ const MAIN_INVOICE_HTML = `
|
|||||||
}
|
}
|
||||||
|
|
||||||
.bill_td.title {
|
.bill_td.title {
|
||||||
border-top: 2px solid #333;
|
border-top: 4px solid #333;
|
||||||
padding: 13px 0 7px;
|
padding: 26px 0 14px;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
color: #212121;
|
color: #212121;
|
||||||
|
font-family: Montserrat-Medium;
|
||||||
}
|
}
|
||||||
|
|
||||||
.bill_td.info {
|
.bill_td.info {
|
||||||
color: #666;
|
color: #666;
|
||||||
border-bottom: 1px solid #ccc;
|
border-bottom: 2px solid #ccc;
|
||||||
padding: 8px 0;
|
padding: 16px 0;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
|
font-family: Montserrat-Light;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bill_td.info:first-child {
|
||||||
|
font-family: Montserrat-Regular;
|
||||||
}
|
}
|
||||||
|
|
||||||
.bill_warp tr:last-child .bill_td.info {
|
.bill_warp tr:last-child .bill_td.info {
|
||||||
@ -96,34 +124,37 @@ const MAIN_INVOICE_HTML = `
|
|||||||
}
|
}
|
||||||
|
|
||||||
.total_warp {
|
.total_warp {
|
||||||
padding: 14px 5% 24px 0;
|
padding: 28px 5% 48px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.total_td {
|
.total_td {
|
||||||
color: #212121;
|
color: #212121;
|
||||||
padding: 8px 0 7px;
|
padding: 16px 0 14px;
|
||||||
font-size: 12px;
|
font-size: 24px;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
|
font-family: Montserrat-Medium;
|
||||||
}
|
}
|
||||||
|
|
||||||
.total_td.info {
|
.total_td.info {
|
||||||
color: #666;
|
color: #666;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
|
font-family: Montserrat-Regular;
|
||||||
}
|
}
|
||||||
|
|
||||||
.total_td.border-dashed {
|
.total_td.border-dashed {
|
||||||
border-bottom: 1px dashed #ccc;
|
border-bottom: 2px dashed #ccc;
|
||||||
}
|
}
|
||||||
|
|
||||||
.total_td.border-solid {
|
.total_td.border-solid {
|
||||||
border-bottom: 2px solid #333;
|
border-bottom: 4px solid #333;
|
||||||
padding-bottom: 12px;
|
padding-bottom: 24px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.total_td.total {
|
.total_td.total {
|
||||||
padding-top: 12px;
|
padding-top: 24px;
|
||||||
font-size: 13px;
|
font-size: 26px;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
|
font-family: Montserrat-SemiBold;
|
||||||
}
|
}
|
||||||
|
|
||||||
.notes_warp {
|
.notes_warp {
|
||||||
@ -131,16 +162,18 @@ const MAIN_INVOICE_HTML = `
|
|||||||
}
|
}
|
||||||
|
|
||||||
.notes_td {
|
.notes_td {
|
||||||
font-size: 13px;
|
font-size: 26px;
|
||||||
color: #666;
|
color: #666;
|
||||||
font-weight: 300;
|
font-weight: 300;
|
||||||
width: 50%;
|
width: 50%;
|
||||||
line-height: 21px;
|
line-height: 42px;
|
||||||
|
font-family: Montserrat-Light;
|
||||||
}
|
}
|
||||||
|
|
||||||
.notes_td.title {
|
.notes_td.title {
|
||||||
color: #212121;
|
color: #212121;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
|
font-family: Montserrat-Medium;
|
||||||
}
|
}
|
||||||
|
|
||||||
.notes_td.notes {
|
.notes_td.notes {
|
||||||
@ -159,40 +192,60 @@ const MAIN_INVOICE_HTML = `
|
|||||||
<td class="header_td title" align="right">Invoice</td>
|
<td class="header_td title" align="right">Invoice</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
`
|
||||||
|
|
||||||
|
const INVOICE_TEMPLATE_02 = `
|
||||||
<!-- information -->
|
<!-- information -->
|
||||||
<table class="information_warp" border="0" align="center" cellpadding="0" cellspacing="0" width="100%">
|
<table class="information_warp width100" border="0" align="center" cellpadding="0" cellspacing="0">
|
||||||
<tr>
|
<tr>
|
||||||
<td class="information_td bill" align="left">Bill To:</td>
|
<td class="information_td bill" align="left">Bill To:</td>
|
||||||
<td class="information_td right" align="right">Invoice No. {{invoice_number}}</td>
|
<td class="information_td right" align="right">Invoice No. #%v</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="information_td info" align="left">{{buyer_name}}</td>
|
<td class="information_td info" align="left">%v</td>
|
||||||
<td class="information_td right" align="right">Date: {{buy_date}}</td>
|
<td class="information_td right" align="right">Date: %v</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="information_td info" align="left">{{street}}</td>
|
<td class="information_td info" align="left">%v</td>
|
||||||
<td class="information_td" align="right"></td>
|
<td class="information_td" align="right"></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="information_td info" align="left">{{city}}</td>
|
<td class="information_td info" align="left">%v</td>
|
||||||
<td class="information_td" align="right"></td>
|
<td class="information_td" align="right"></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="information_td info" align="left">{{country}}</td>
|
<td class="information_td info" align="left">%v</td>
|
||||||
<td class="information_td" align="right"></td>
|
<td class="information_td" align="right"></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
`
|
||||||
|
const INVOICE_TEMPLATE_03 = `
|
||||||
<!-- bill -->
|
<!-- bill -->
|
||||||
<table class="bill_warp" border="0" align="center" cellpadding="0" cellspacing="0" width="100%">
|
<table class="bill_warp width100" border="0" align="center" cellpadding="0" cellspacing="0">
|
||||||
<!--循环部分-->
|
<tr>
|
||||||
{{product_loop_html}}
|
<td class="bill_td title" align="left">Product Name</td>
|
||||||
<!--循环部分-->
|
<td class="bill_td title" align="right">Price</td>
|
||||||
|
<td class="bill_td title" align="right">Quantity</td>
|
||||||
|
<td class="bill_td title" align="right">Total</td>
|
||||||
|
</tr>
|
||||||
|
%v
|
||||||
</table>
|
</table>
|
||||||
|
`
|
||||||
|
|
||||||
|
const INVOICE_TEMPLATE_0301 = `
|
||||||
|
<tr>
|
||||||
|
<td class="bill_td info" align="left">%v</td>
|
||||||
|
<td class="bill_td info" align="right">%v</td>
|
||||||
|
<td class="bill_td info" align="right">%v %v</td>
|
||||||
|
<td class="bill_td info" align="right">%v</td>
|
||||||
|
</tr>
|
||||||
|
`
|
||||||
|
const INVOICE_TEMPLATE_04 = `
|
||||||
<!-- total -->
|
<!-- total -->
|
||||||
<table class="total_warp" border="0" align="right" cellpadding="0" cellspacing="0" width="50%">
|
<table class="total_warp width50" border="0" align="right" cellpadding="0" cellspacing="0">
|
||||||
<tr>
|
<tr>
|
||||||
<td class="total_td" align="right">Subtotal</td>
|
<td class="total_td" align="right">Subtotal</td>
|
||||||
<td class="total_td info" align="right">${{subtotal_price}}</td>
|
<td class="total_td info" align="right">%v</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="total_td" align="right">Shipping Fee</td>
|
<td class="total_td" align="right">Shipping Fee</td>
|
||||||
@ -200,45 +253,49 @@ const MAIN_INVOICE_HTML = `
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="total_td border-dashed" align="right">Tax</td>
|
<td class="total_td border-dashed" align="right">Tax</td>
|
||||||
<td class="total_td info border-dashed" align="right">${{tax}}</td>
|
<td class="total_td info border-dashed" align="right">%v</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="total_td" align="right">Total</td>
|
<td class="total_td" align="right">Total</td>
|
||||||
<td class="total_td info" align="right">${{total_price}}</td>
|
<td class="total_td info" align="right">%v</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="total_td border-solid" align="right">Deposit Requested</td>
|
<td class="total_td border-solid" align="right">%v</td>
|
||||||
<td class="total_td info border-solid" align="right">${{deposit_price}}</td>
|
<td class="total_td info border-solid" align="right">%v</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="total_td total" align="right">Deposit Due</td>
|
<td class="total_td total" align="right">%v</td>
|
||||||
<td class="total_td total" align="right">${{deposit_price}}</td>
|
<td class="total_td total" align="right">%v</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
`
|
||||||
|
const INVOICE_TEMPLATE_05 = `
|
||||||
<!-- notes -->
|
<!-- notes -->
|
||||||
<table class="notes_warp" border="0" align="center" cellpadding="0" cellspacing="0" width="100%">
|
<table class="notes_warp width100" border="0" align="center" cellpadding="0" cellspacing="0">
|
||||||
<tr>
|
<tr>
|
||||||
<td class="notes_td title" align="left">Payment Method:</td>
|
<td class="notes_td title" align="left">Payment Method:</td>
|
||||||
<td class="notes_td title" align="left">Notes:</td>
|
<td class="notes_td title" align="left">Notes:</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="notes_td" align="left">{{payment_method}}</td>
|
<td class="notes_td" align="left">%v</td>
|
||||||
<td class="notes_td notes" align="left" rowspan="2">{{notes}}</td>
|
<td class="notes_td notes" align="left" rowspan="2">Thank you for your business !</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="notes_td" align="left">Account No. {{account_number}}</td>
|
<td class="notes_td" align="left">Account No. :%v</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
`
|
||||||
|
const INVOICE_TEMPLATE_06 = `
|
||||||
</body>
|
</body>
|
||||||
|
<style>
|
||||||
|
.width50 {
|
||||||
|
width: 50%;
|
||||||
|
}
|
||||||
|
.width100 {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
</html>
|
</html>
|
||||||
|
|
||||||
`
|
|
||||||
|
|
||||||
// 产品循环部分{{product_loop_html}}
|
`
|
||||||
const PRODUCT_LOOP_HTML_CONTENT = ` <tr>
|
|
||||||
<td class="bill_td title" align="left">{{product_name}}</td>
|
|
||||||
<td class="bill_td title" align="right">${{product_item_price}}</td>
|
|
||||||
<td class="bill_td title" align="right">{{purchase_quantity}}</td>
|
|
||||||
<td class="bill_td title" align="right">${{product_total_price}}</td>
|
|
||||||
</tr>`
|
|
||||||
|
|||||||
@ -10,7 +10,7 @@ const (
|
|||||||
type Currency string
|
type Currency string
|
||||||
|
|
||||||
const (
|
const (
|
||||||
CURRENCYUSD Currency = "usd"
|
CURRENCYUSD Currency = "usd" // 美金
|
||||||
)
|
)
|
||||||
|
|
||||||
// 金额单位
|
// 金额单位
|
||||||
@ -23,8 +23,8 @@ type ExchangeRateUnit interface{}
|
|||||||
type PayMethods string
|
type PayMethods string
|
||||||
|
|
||||||
const (
|
const (
|
||||||
PAY_METHOD_CARD PayMethods = "CARD"
|
PAY_METHOD_CARD PayMethods = "CARD" //card
|
||||||
PAY_METHOD_VISA PayMethods = "VISA"
|
PAY_METHOD_VISA PayMethods = "VISA" //visa
|
||||||
)
|
)
|
||||||
|
|
||||||
// 支付状态
|
// 支付状态
|
||||||
@ -45,11 +45,11 @@ type OrderPayStatusCode int64
|
|||||||
// 30,已付尾款
|
// 30,已付尾款
|
||||||
// 40,已退尾款
|
// 40,已退尾款
|
||||||
const (
|
const (
|
||||||
ORDER_PAY_STATUS_UNPAIDDEPOSIT OrderPayStatusCode = 0
|
ORDER_PAY_STATUS_UNPAIDDEPOSIT OrderPayStatusCode = 0 // 0,未付首款
|
||||||
ORDER_PAY_STATUS_PAIDDEPOSIT OrderPayStatusCode = 10
|
ORDER_PAY_STATUS_PAIDDEPOSIT OrderPayStatusCode = 10 // 10,已付首款
|
||||||
ORDER_PAY_STATUS_REFUNDEDDEPOSIT OrderPayStatusCode = 20
|
ORDER_PAY_STATUS_REFUNDEDDEPOSIT OrderPayStatusCode = 20 // 20,已退首款
|
||||||
ORDER_PAY_STATUS_PAIDDREMAINING OrderPayStatusCode = 30
|
ORDER_PAY_STATUS_PAIDDREMAINING OrderPayStatusCode = 30 // 30,已付尾款
|
||||||
ORDER_PAY_STATUS_REFUNDEDREMAINING OrderPayStatusCode = 40
|
ORDER_PAY_STATUS_REFUNDEDREMAINING OrderPayStatusCode = 40 // 40,已退尾款
|
||||||
)
|
)
|
||||||
|
|
||||||
// 订单状态
|
// 订单状态
|
||||||
@ -92,20 +92,27 @@ var OrderStatusUserDIRECTMAIL []OrderStatusCode
|
|||||||
// 订单状态--用户可见--云仓
|
// 订单状态--用户可见--云仓
|
||||||
var OrderStatusUserCLOUDSTORE []OrderStatusCode
|
var OrderStatusUserCLOUDSTORE []OrderStatusCode
|
||||||
|
|
||||||
|
// 订单货币
|
||||||
|
var OrderCurrencyMessage map[Currency]string
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
// 订单货币
|
||||||
|
OrderCurrencyMessage = make(map[Currency]string, 1)
|
||||||
|
OrderCurrencyMessage[CURRENCYUSD] = "$"
|
||||||
|
|
||||||
// 订单状态名称
|
// 订单状态名称
|
||||||
OrderPayStatusMessage = make(map[OrderPayStatusCode]string)
|
OrderPayStatusMessage = make(map[OrderPayStatusCode]string)
|
||||||
OrderPayStatusMessage[ORDER_PAY_STATUS_UNPAIDDEPOSIT] = "Deposit Payment Unpaid"
|
OrderPayStatusMessage[ORDER_PAY_STATUS_UNPAIDDEPOSIT] = "Deposit Payment Unpaid" // 未支付首款
|
||||||
OrderPayStatusMessage[ORDER_PAY_STATUS_PAIDDEPOSIT] = "Deposit Payment Paid"
|
OrderPayStatusMessage[ORDER_PAY_STATUS_PAIDDEPOSIT] = "Deposit Payment Paid" // 已支付首款
|
||||||
OrderPayStatusMessage[ORDER_PAY_STATUS_REFUNDEDDEPOSIT] = "Deposit Payment Refunded"
|
OrderPayStatusMessage[ORDER_PAY_STATUS_REFUNDEDDEPOSIT] = "Deposit Payment Refunded" // 首款已回退
|
||||||
OrderPayStatusMessage[ORDER_PAY_STATUS_PAIDDREMAINING] = "Final Payment Paid"
|
OrderPayStatusMessage[ORDER_PAY_STATUS_PAIDDREMAINING] = "Final Payment Paid" // 尾款未支付
|
||||||
OrderPayStatusMessage[ORDER_PAY_STATUS_REFUNDEDREMAINING] = "Final Payment Refunded"
|
OrderPayStatusMessage[ORDER_PAY_STATUS_REFUNDEDREMAINING] = "Final Payment Refunded" // 已退款
|
||||||
|
|
||||||
// 订单状态名称
|
// 订单状态名称
|
||||||
PayStatusMessage = make(map[PayStatusCode]string)
|
PayStatusMessage = make(map[PayStatusCode]string)
|
||||||
PayStatusMessage[PAY_STATUS_UNPAID] = "Unpaid"
|
PayStatusMessage[PAY_STATUS_UNPAID] = "Unpaid" // 未支付
|
||||||
PayStatusMessage[PAY_STATUS_PAID] = "Paid"
|
PayStatusMessage[PAY_STATUS_PAID] = "Paid" // 已支付
|
||||||
PayStatusMessage[PAY_STATUS_REFUNDED] = "Refunded"
|
PayStatusMessage[PAY_STATUS_REFUNDED] = "Refunded" // 已退款
|
||||||
|
|
||||||
// 订单状态名称
|
// 订单状态名称
|
||||||
OrderStatusMessage = make(map[OrderStatusCode]string)
|
OrderStatusMessage = make(map[OrderStatusCode]string)
|
||||||
@ -114,14 +121,14 @@ func init() {
|
|||||||
OrderStatusMessage[ORDER_STATUS_COMPLETE] = "Completed" // 已完成
|
OrderStatusMessage[ORDER_STATUS_COMPLETE] = "Completed" // 已完成
|
||||||
OrderStatusMessage[ORDER_STATUS_DELETE] = "Deleted" // 已删除
|
OrderStatusMessage[ORDER_STATUS_DELETE] = "Deleted" // 已删除
|
||||||
|
|
||||||
OrderStatusMessage[ORDER_STATUS_DIRECTMAIL_ORDERED] = "Order" // 直邮单--已下单
|
OrderStatusMessage[ORDER_STATUS_DIRECTMAIL_ORDERED] = "Ordered" // 直邮单--已下单
|
||||||
OrderStatusMessage[ORDER_STATUS_DIRECTMAIL_ORDEREDMAINING] = "Final Payment Paid" // 直邮单--已下单--尾款
|
OrderStatusMessage[ORDER_STATUS_DIRECTMAIL_ORDEREDMAINING] = "Final Payment Paid" // 直邮单--已下单--尾款
|
||||||
OrderStatusMessage[ORDER_STATUS_DIRECTMAIL_STARTPRODUCTION] = "Start Production" // 直邮单--开始生产
|
OrderStatusMessage[ORDER_STATUS_DIRECTMAIL_STARTPRODUCTION] = "Start Production" // 直邮单--开始生产
|
||||||
OrderStatusMessage[ORDER_STATUS_DIRECTMAIL_COMPLETEPRODUCTION] = "Production Complete" // 直邮单--生产完成
|
OrderStatusMessage[ORDER_STATUS_DIRECTMAIL_COMPLETEPRODUCTION] = "Production Complete" // 直邮单--生产完成
|
||||||
OrderStatusMessage[ORDER_STATUS_DIRECTMAIL_SHIPPED] = "Shipped" // 直邮单--已发货
|
OrderStatusMessage[ORDER_STATUS_DIRECTMAIL_SHIPPED] = "Shipped" // 直邮单--已发货
|
||||||
OrderStatusMessage[ORDER_STATUS_DIRECTMAIL_ARRIVED] = "Delivered" // 直邮单--已到达
|
OrderStatusMessage[ORDER_STATUS_DIRECTMAIL_ARRIVED] = "Delivered" // 直邮单--已到达
|
||||||
|
|
||||||
OrderStatusMessage[ORDER_STATUS_CLOUDSTORE_ORDERED] = "Order" // 云仓单--已下单
|
OrderStatusMessage[ORDER_STATUS_CLOUDSTORE_ORDERED] = "Ordered" // 云仓单--已下单
|
||||||
OrderStatusMessage[ORDER_STATUS_CLOUDSTORE_ORDEREDMAINING] = "Final Payment Paid" // 云仓单--已下单-尾款
|
OrderStatusMessage[ORDER_STATUS_CLOUDSTORE_ORDEREDMAINING] = "Final Payment Paid" // 云仓单--已下单-尾款
|
||||||
OrderStatusMessage[ORDER_STATUS_CLOUDSTORE_STARTPRODUCTION] = "Start Production" // 云仓单--开始生产
|
OrderStatusMessage[ORDER_STATUS_CLOUDSTORE_STARTPRODUCTION] = "Start Production" // 云仓单--开始生产
|
||||||
OrderStatusMessage[ORDER_STATUS_CLOUDSTORE_COMPLETEPRODUCTION] = "Production Complete" // 云仓单--生产完成
|
OrderStatusMessage[ORDER_STATUS_CLOUDSTORE_COMPLETEPRODUCTION] = "Production Complete" // 云仓单--生产完成
|
||||||
|
|||||||
@ -26,6 +26,7 @@ const (
|
|||||||
WEBSOCKET_COMBINE_IMAGE Websocket = "WEBSOCKET_COMBINE_IMAGE" //反回合成刀版图消息(2级消息,单向通信,属于 WEBSOCKET_RENDER_IMAGE 消息的子流程)
|
WEBSOCKET_COMBINE_IMAGE Websocket = "WEBSOCKET_COMBINE_IMAGE" //反回合成刀版图消息(2级消息,单向通信,属于 WEBSOCKET_RENDER_IMAGE 消息的子流程)
|
||||||
WEBSOCKET_ASSEMBLE_RENDER_DATA Websocket = "WEBSOCKET_ASSEMBLE_RENDER_DATA" //组装unity需要的数据 (2级消息,单向通信,属于 WEBSOCKET_RENDER_IMAGE 消息的子流程)
|
WEBSOCKET_ASSEMBLE_RENDER_DATA Websocket = "WEBSOCKET_ASSEMBLE_RENDER_DATA" //组装unity需要的数据 (2级消息,单向通信,属于 WEBSOCKET_RENDER_IMAGE 消息的子流程)
|
||||||
WEBSOCKET_SEND_DATA_TO_UNITY Websocket = "WEBSOCKET_SEND_DATA_TO_UNITY" //发送到unity进行渲染 (2级消息,单向通信,属于 WEBSOCKET_RENDER_IMAGE 消息的子流程)
|
WEBSOCKET_SEND_DATA_TO_UNITY Websocket = "WEBSOCKET_SEND_DATA_TO_UNITY" //发送到unity进行渲染 (2级消息,单向通信,属于 WEBSOCKET_RENDER_IMAGE 消息的子流程)
|
||||||
|
WEBSOCKET_REQUIRE_BROWSER_RESEND_RENDER Websocket = "WEBSOCKET_REQUIRE_BROWSER_RESEND_RENDER" //后端请求前端去重发渲染任务事件(2级消息,单向通信,属于 WEBSOCKET_RENDER_IMAGE 消息的子流程)
|
||||||
)
|
)
|
||||||
|
|
||||||
// websocket消息类型(系统数据变更通知)
|
// websocket消息类型(系统数据变更通知)
|
||||||
|
|||||||
116
fs_template/test.tpl
Normal file
116
fs_template/test.tpl
Normal file
@ -0,0 +1,116 @@
|
|||||||
|
Subject: Please confirm your {{ .CompanyName }} account;
|
||||||
|
MIME-version: 1.0;
|
||||||
|
Content-Type: text/html; charset="UTF-8";
|
||||||
|
From: "Fusen Support";
|
||||||
|
|
||||||
|
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>订单状态流转</title>
|
||||||
|
</head>
|
||||||
|
<style>
|
||||||
|
* {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<body>
|
||||||
|
<div style="
|
||||||
|
width: 50%;
|
||||||
|
max-width: 600px;
|
||||||
|
min-width: 350px;
|
||||||
|
margin: 0 auto;
|
||||||
|
background-color: #FFFFFF;">
|
||||||
|
<div>
|
||||||
|
<h1><img style="
|
||||||
|
width: 22%;
|
||||||
|
height: 6%;
|
||||||
|
padding: 50px 0 30px 8%;" src="https://fusenstorage.s3.us-east-2.amazonaws.com/2c3938702c52d46550fffae344f1619dd71c447f3b19882045205fcd8adbd6bf" alt=""></h1>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<h2 style="
|
||||||
|
width: 84%;
|
||||||
|
font-size: 47px;
|
||||||
|
font-family: Gotham-Bold, Gotham;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #212121;
|
||||||
|
line-height: 58px;
|
||||||
|
padding-bottom: 24px;
|
||||||
|
padding-left: 8%;">The status of your order has changed!</h2>
|
||||||
|
<p style="
|
||||||
|
width: 84%;
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: normal;
|
||||||
|
color: #212121;
|
||||||
|
line-height: 21px;
|
||||||
|
padding-bottom: 40px;
|
||||||
|
padding-left: 8%;">
|
||||||
|
Your order has been changed from "原状态" to "现状态".</p>
|
||||||
|
<a href="" style="
|
||||||
|
display: block;
|
||||||
|
text-align: center;
|
||||||
|
width: 80%;
|
||||||
|
height: 24px;
|
||||||
|
font-size: 16px;
|
||||||
|
font-family: Gotham-Bold, Gotham;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #FFFFFF;
|
||||||
|
line-height: 24px;
|
||||||
|
margin: 0 auto;
|
||||||
|
background-color: #FF7F00;
|
||||||
|
padding: 15px 12px;
|
||||||
|
margin-bottom: 60px;
|
||||||
|
border-radius: 200px;
|
||||||
|
text-decoration: none;">Check Your Order</a>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<div style="
|
||||||
|
width: 80%;
|
||||||
|
background-color: #F8F8F8;
|
||||||
|
padding: 20px 30px;
|
||||||
|
margin: 0 auto;">
|
||||||
|
<h3 style="
|
||||||
|
height: 28px;
|
||||||
|
font-size: 16px;
|
||||||
|
font-family: Gotham-Bold, Gotham;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #212121;
|
||||||
|
line-height: 28px;">Search Logo, Get Design</h3>
|
||||||
|
<p style=" height: 21px;
|
||||||
|
font-size: 12px;
|
||||||
|
font-family: Gotham-Medium, Gotham;
|
||||||
|
font-weight: 500;
|
||||||
|
color: #212121;
|
||||||
|
line-height: 21px;">Our products</p>
|
||||||
|
<p style=" height: 21px;
|
||||||
|
font-size: 12px;
|
||||||
|
font-family: Gotham-Medium, Gotham;
|
||||||
|
font-weight: 500;
|
||||||
|
color: #212121;
|
||||||
|
line-height: 21px;">Try it out</p>
|
||||||
|
<div style="
|
||||||
|
width: 100%;
|
||||||
|
padding: 17px 0 10px 0 ;
|
||||||
|
border-bottom: 1px solid #CCCCCC;
|
||||||
|
margin-bottom: 10px;">
|
||||||
|
<img style="width: 14px;height: 14px;" src="https://fusenstorage.s3.us-east-2.amazonaws.com/7d6e04f8a90762210f8b8fc307198776b8dc42998adc90bab41e178053552b2c" alt="">
|
||||||
|
<span> support@fusenpack.com</span>
|
||||||
|
</div>
|
||||||
|
<span style="
|
||||||
|
width: 74px;
|
||||||
|
height: 21px;
|
||||||
|
font-size: 12px;
|
||||||
|
font-weight: normal;
|
||||||
|
color: #999999;
|
||||||
|
line-height: 21px;
|
||||||
|
display: block;
|
||||||
|
cursor: pointer;
|
||||||
|
text-decoration: none;">Unsubscribe</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
23
go.mod
23
go.mod
@ -5,17 +5,21 @@ go 1.20
|
|||||||
require (
|
require (
|
||||||
github.com/474420502/passer v0.0.1
|
github.com/474420502/passer v0.0.1
|
||||||
github.com/SebastiaanKlippert/go-wkhtmltopdf v1.9.0
|
github.com/SebastiaanKlippert/go-wkhtmltopdf v1.9.0
|
||||||
|
github.com/aliyun/aliyun-oss-go-sdk v3.0.1+incompatible
|
||||||
github.com/aws/aws-sdk-go v1.44.295
|
github.com/aws/aws-sdk-go v1.44.295
|
||||||
github.com/bwmarrin/snowflake v0.3.0
|
github.com/bwmarrin/snowflake v0.3.0
|
||||||
github.com/disintegration/imaging v1.6.2
|
github.com/disintegration/imaging v1.6.2
|
||||||
|
github.com/go-ldap/ldap/v3 v3.4.6
|
||||||
github.com/go-resty/resty/v2 v2.7.0
|
github.com/go-resty/resty/v2 v2.7.0
|
||||||
github.com/golang-jwt/jwt v3.2.2+incompatible
|
github.com/golang-jwt/jwt v3.2.2+incompatible
|
||||||
github.com/google/uuid v1.3.0
|
github.com/google/uuid v1.3.1
|
||||||
github.com/gorilla/websocket v1.5.0
|
github.com/gorilla/websocket v1.5.0
|
||||||
github.com/hashicorp/raft v1.5.0
|
github.com/hashicorp/raft v1.5.0
|
||||||
github.com/lni/dragonboat/v4 v4.0.0-20230709075559-54497b9553be
|
github.com/lni/dragonboat/v4 v4.0.0-20230709075559-54497b9553be
|
||||||
|
github.com/mozillazg/go-pinyin v0.19.0
|
||||||
github.com/nacos-group/nacos-sdk-go/v2 v2.2.3
|
github.com/nacos-group/nacos-sdk-go/v2 v2.2.3
|
||||||
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646
|
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646
|
||||||
|
github.com/patrickmn/go-cache v2.1.0+incompatible
|
||||||
github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e
|
github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e
|
||||||
github.com/streadway/amqp v1.1.0
|
github.com/streadway/amqp v1.1.0
|
||||||
github.com/stripe/stripe-go/v75 v75.7.0
|
github.com/stripe/stripe-go/v75 v75.7.0
|
||||||
@ -29,6 +33,8 @@ require (
|
|||||||
require (
|
require (
|
||||||
cloud.google.com/go/compute v1.20.1 // indirect
|
cloud.google.com/go/compute v1.20.1 // indirect
|
||||||
cloud.google.com/go/compute/metadata v0.2.3 // indirect
|
cloud.google.com/go/compute/metadata v0.2.3 // indirect
|
||||||
|
github.com/Azure/go-ntlmssp v0.0.0-20221128193559-754e69321358 // indirect
|
||||||
|
github.com/BurntSushi/toml v1.1.0 // indirect
|
||||||
github.com/DataDog/zstd v1.4.5 // indirect
|
github.com/DataDog/zstd v1.4.5 // indirect
|
||||||
github.com/HdrHistogram/hdrhistogram-go v1.1.2 // indirect
|
github.com/HdrHistogram/hdrhistogram-go v1.1.2 // indirect
|
||||||
github.com/VictoriaMetrics/metrics v1.18.1 // indirect
|
github.com/VictoriaMetrics/metrics v1.18.1 // indirect
|
||||||
@ -41,17 +47,18 @@ require (
|
|||||||
github.com/cockroachdb/pebble v0.0.0-20221207173255-0f086d933dac // indirect
|
github.com/cockroachdb/pebble v0.0.0-20221207173255-0f086d933dac // indirect
|
||||||
github.com/cockroachdb/redact v1.1.3 // indirect
|
github.com/cockroachdb/redact v1.1.3 // indirect
|
||||||
github.com/getsentry/sentry-go v0.12.0 // indirect
|
github.com/getsentry/sentry-go v0.12.0 // indirect
|
||||||
|
github.com/go-asn1-ber/asn1-ber v1.5.5 // indirect
|
||||||
github.com/gogo/protobuf v1.3.2 // indirect
|
github.com/gogo/protobuf v1.3.2 // indirect
|
||||||
github.com/golang/mock v1.6.0 // indirect
|
github.com/golang/mock v1.6.0 // indirect
|
||||||
github.com/golang/snappy v0.0.4 // indirect
|
github.com/golang/snappy v0.0.4 // indirect
|
||||||
github.com/google/btree v1.0.0 // indirect
|
github.com/google/btree v1.0.0 // indirect
|
||||||
github.com/hashicorp/errwrap v1.1.0 // indirect
|
github.com/hashicorp/errwrap v1.1.0 // indirect
|
||||||
github.com/hashicorp/go-hclog v1.5.0 // indirect
|
github.com/hashicorp/go-hclog v1.5.0 // indirect
|
||||||
github.com/hashicorp/go-immutable-radix v1.0.0 // indirect
|
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
|
||||||
github.com/hashicorp/go-msgpack v0.5.5 // indirect
|
github.com/hashicorp/go-msgpack v0.5.5 // indirect
|
||||||
github.com/hashicorp/go-multierror v1.1.1 // indirect
|
github.com/hashicorp/go-multierror v1.1.1 // indirect
|
||||||
github.com/hashicorp/go-sockaddr v1.0.0 // indirect
|
github.com/hashicorp/go-sockaddr v1.0.0 // indirect
|
||||||
github.com/hashicorp/golang-lru v0.5.1 // indirect
|
github.com/hashicorp/golang-lru v0.5.4 // indirect
|
||||||
github.com/hashicorp/memberlist v0.3.1 // indirect
|
github.com/hashicorp/memberlist v0.3.1 // indirect
|
||||||
github.com/jmespath/go-jmespath v0.4.0 // indirect
|
github.com/jmespath/go-jmespath v0.4.0 // indirect
|
||||||
github.com/json-iterator/go v1.1.12 // indirect
|
github.com/json-iterator/go v1.1.12 // indirect
|
||||||
@ -74,14 +81,14 @@ require (
|
|||||||
go.uber.org/atomic v1.10.0 // indirect
|
go.uber.org/atomic v1.10.0 // indirect
|
||||||
go.uber.org/multierr v1.9.0 // indirect
|
go.uber.org/multierr v1.9.0 // indirect
|
||||||
go.uber.org/zap v1.24.0 // indirect
|
go.uber.org/zap v1.24.0 // indirect
|
||||||
golang.org/x/crypto v0.11.0 // indirect
|
golang.org/x/crypto v0.13.0 // indirect
|
||||||
golang.org/x/exp v0.0.0-20230728194245-b0cb94b80691 // indirect
|
golang.org/x/exp v0.0.0-20230728194245-b0cb94b80691 // indirect
|
||||||
golang.org/x/sync v0.2.0 // indirect
|
golang.org/x/sync v0.2.0 // indirect
|
||||||
golang.org/x/time v0.3.0 // indirect
|
golang.org/x/time v0.3.0 // indirect
|
||||||
google.golang.org/appengine v1.6.7 // indirect
|
google.golang.org/appengine v1.6.7 // indirect
|
||||||
google.golang.org/genproto/googleapis/api v0.0.0-20230530153820-e85fd2cbaebc // indirect
|
google.golang.org/genproto/googleapis/api v0.0.0-20230530153820-e85fd2cbaebc // indirect
|
||||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc // indirect
|
google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc // indirect
|
||||||
gopkg.in/ini.v1 v1.66.2 // indirect
|
gopkg.in/ini.v1 v1.66.4 // indirect
|
||||||
gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect
|
gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -89,7 +96,7 @@ require (
|
|||||||
github.com/474420502/requests v1.42.0
|
github.com/474420502/requests v1.42.0
|
||||||
github.com/jinzhu/inflection v1.0.0 // indirect
|
github.com/jinzhu/inflection v1.0.0 // indirect
|
||||||
github.com/jinzhu/now v1.1.5 // indirect
|
github.com/jinzhu/now v1.1.5 // indirect
|
||||||
github.com/tidwall/gjson v1.12.0
|
github.com/tidwall/gjson v1.13.0
|
||||||
github.com/tidwall/match v1.1.1 // indirect
|
github.com/tidwall/match v1.1.1 // indirect
|
||||||
github.com/tidwall/pretty v1.2.0 // indirect
|
github.com/tidwall/pretty v1.2.0 // indirect
|
||||||
)
|
)
|
||||||
@ -129,8 +136,8 @@ require (
|
|||||||
go.opentelemetry.io/proto/otlp v0.19.0 // indirect
|
go.opentelemetry.io/proto/otlp v0.19.0 // indirect
|
||||||
go.uber.org/automaxprocs v1.5.2 // indirect
|
go.uber.org/automaxprocs v1.5.2 // indirect
|
||||||
golang.org/x/net v0.12.0 // indirect
|
golang.org/x/net v0.12.0 // indirect
|
||||||
golang.org/x/sys v0.10.0 // indirect
|
golang.org/x/sys v0.12.0 // indirect
|
||||||
golang.org/x/text v0.11.0
|
golang.org/x/text v0.13.0
|
||||||
google.golang.org/genproto v0.0.0-20230530153820-e85fd2cbaebc // indirect
|
google.golang.org/genproto v0.0.0-20230530153820-e85fd2cbaebc // indirect
|
||||||
google.golang.org/grpc v1.56.2 // indirect
|
google.golang.org/grpc v1.56.2 // indirect
|
||||||
google.golang.org/protobuf v1.31.0 // indirect
|
google.golang.org/protobuf v1.31.0 // indirect
|
||||||
|
|||||||
58
go.sum
58
go.sum
@ -41,8 +41,11 @@ github.com/474420502/random v0.4.1 h1:HUUyLXRWMijVb7CJoEC16f0aFQOW25Lkr80Mut6PoK
|
|||||||
github.com/474420502/requests v1.42.0 h1:aUj0rWhfldbOOlGHDIcqT9zgXEoSlK4IBmRF3LxI1+Y=
|
github.com/474420502/requests v1.42.0 h1:aUj0rWhfldbOOlGHDIcqT9zgXEoSlK4IBmRF3LxI1+Y=
|
||||||
github.com/474420502/requests v1.42.0/go.mod h1:2SCVzim0ONFYG09g/GrM7RTeJIC6qTyZfnohsjnG5C8=
|
github.com/474420502/requests v1.42.0/go.mod h1:2SCVzim0ONFYG09g/GrM7RTeJIC6qTyZfnohsjnG5C8=
|
||||||
github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8=
|
github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8=
|
||||||
github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
|
github.com/Azure/go-ntlmssp v0.0.0-20221128193559-754e69321358 h1:mFRzDkZVAjdal+s7s0MwaRv9igoPqLRdzOLzw/8Xvq8=
|
||||||
|
github.com/Azure/go-ntlmssp v0.0.0-20221128193559-754e69321358/go.mod h1:chxPXzSsl7ZWRAuOIE23GDNzjWuZquvFlgA8xmpunjU=
|
||||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||||
|
github.com/BurntSushi/toml v1.1.0 h1:ksErzDEI1khOiGPgpwuI7x2ebx/uXQNw7xJpn9Eq1+I=
|
||||||
|
github.com/BurntSushi/toml v1.1.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
|
||||||
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
|
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
|
||||||
github.com/CloudyKit/fastprinter v0.0.0-20170127035650-74b38d55f37a/go.mod h1:EFZQ978U7x8IRnstaskI3IysnWY5Ao3QgZUKOXlsAdw=
|
github.com/CloudyKit/fastprinter v0.0.0-20170127035650-74b38d55f37a/go.mod h1:EFZQ978U7x8IRnstaskI3IysnWY5Ao3QgZUKOXlsAdw=
|
||||||
github.com/CloudyKit/fastprinter v0.0.0-20200109182630-33d98a066a53/go.mod h1:+3IMCy2vIlbG1XG/0ggNQv0SvxCAIpPM5b1nCz56Xno=
|
github.com/CloudyKit/fastprinter v0.0.0-20200109182630-33d98a066a53/go.mod h1:+3IMCy2vIlbG1XG/0ggNQv0SvxCAIpPM5b1nCz56Xno=
|
||||||
@ -67,8 +70,12 @@ github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuy
|
|||||||
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
|
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
|
||||||
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
|
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
|
||||||
github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
|
github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
|
||||||
|
github.com/alexbrainman/sspi v0.0.0-20210105120005-909beea2cc74 h1:Kk6a4nehpJ3UuJRqlA3JxYxBZEqCeOmATOvrbT4p9RA=
|
||||||
|
github.com/alexbrainman/sspi v0.0.0-20210105120005-909beea2cc74/go.mod h1:cEWa1LVoE5KvSD9ONXsZrj0z6KqySlCCNKHlLzbqAt4=
|
||||||
github.com/aliyun/alibaba-cloud-sdk-go v1.61.1704 h1:PpfENOj/vPfhhy9N2OFRjpue0hjM5XqAp2thFmkXXIk=
|
github.com/aliyun/alibaba-cloud-sdk-go v1.61.1704 h1:PpfENOj/vPfhhy9N2OFRjpue0hjM5XqAp2thFmkXXIk=
|
||||||
github.com/aliyun/alibaba-cloud-sdk-go v1.61.1704/go.mod h1:RcDobYh8k5VP6TNybz9m++gL3ijVI5wueVr0EM10VsU=
|
github.com/aliyun/alibaba-cloud-sdk-go v1.61.1704/go.mod h1:RcDobYh8k5VP6TNybz9m++gL3ijVI5wueVr0EM10VsU=
|
||||||
|
github.com/aliyun/aliyun-oss-go-sdk v3.0.1+incompatible h1:so4m5rRA32Tc5GgKg/5gKUu0CRsYmVO3ThMP6T3CwLc=
|
||||||
|
github.com/aliyun/aliyun-oss-go-sdk v3.0.1+incompatible/go.mod h1:T/Aws4fEfogEE9v+HPhhw+CntffsBHJ8nXQCwKr0/g8=
|
||||||
github.com/andybalholm/brotli v1.0.5 h1:8uQZIdzKmjc/iuPu7O2ioW48L81FgatrcpfFmiq/cCs=
|
github.com/andybalholm/brotli v1.0.5 h1:8uQZIdzKmjc/iuPu7O2ioW48L81FgatrcpfFmiq/cCs=
|
||||||
github.com/andybalholm/brotli v1.0.5/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig=
|
github.com/andybalholm/brotli v1.0.5/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig=
|
||||||
github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
|
github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
|
||||||
@ -167,6 +174,8 @@ github.com/ghemawat/stream v0.0.0-20171120220530-696b145b53b9/go.mod h1:106OIgoo
|
|||||||
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
|
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
|
||||||
github.com/gin-contrib/sse v0.0.0-20190301062529-5545eab6dad3/go.mod h1:VJ0WA2NBN22VlZ2dKZQPAPnyWw5XTlK1KymzLKsr59s=
|
github.com/gin-contrib/sse v0.0.0-20190301062529-5545eab6dad3/go.mod h1:VJ0WA2NBN22VlZ2dKZQPAPnyWw5XTlK1KymzLKsr59s=
|
||||||
github.com/gin-gonic/gin v1.4.0/go.mod h1:OW2EZn3DO8Ln9oIKOvM++LBO+5UPHJJDH72/q/3rZdM=
|
github.com/gin-gonic/gin v1.4.0/go.mod h1:OW2EZn3DO8Ln9oIKOvM++LBO+5UPHJJDH72/q/3rZdM=
|
||||||
|
github.com/go-asn1-ber/asn1-ber v1.5.5 h1:MNHlNMBDgEKD4TcKr36vQN68BA00aDfjIt3/bD50WnA=
|
||||||
|
github.com/go-asn1-ber/asn1-ber v1.5.5/go.mod h1:hEBeB/ic+5LoWskz+yKT7vGhhPYkProFKoKdwZRWMe0=
|
||||||
github.com/go-check/check v0.0.0-20180628173108-788fd7840127/go.mod h1:9ES+weclKsC9YodN5RgxqK/VD9HM9JsCSh7rNhMZE98=
|
github.com/go-check/check v0.0.0-20180628173108-788fd7840127/go.mod h1:9ES+weclKsC9YodN5RgxqK/VD9HM9JsCSh7rNhMZE98=
|
||||||
github.com/go-errors/errors v1.0.1 h1:LUHzmkK3GUKUrL/1gfBUxAHzcev3apQlezX/+O7ma6w=
|
github.com/go-errors/errors v1.0.1 h1:LUHzmkK3GUKUrL/1gfBUxAHzcev3apQlezX/+O7ma6w=
|
||||||
github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q=
|
github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q=
|
||||||
@ -175,6 +184,8 @@ github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2
|
|||||||
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
|
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
|
||||||
github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
|
github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
|
||||||
github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
|
github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
|
||||||
|
github.com/go-ldap/ldap/v3 v3.4.6 h1:ert95MdbiG7aWo/oPYp9btL3KJlMPKnP58r09rI8T+A=
|
||||||
|
github.com/go-ldap/ldap/v3 v3.4.6/go.mod h1:IGMQANNtxpsOzj7uUAMjpGBaOVTC4DYyIy8VsTdxmtc=
|
||||||
github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
|
github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
|
||||||
github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
|
github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
|
||||||
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
|
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
|
||||||
@ -270,8 +281,8 @@ github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hf
|
|||||||
github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
|
github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
|
||||||
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
|
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
|
||||||
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||||
github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
|
github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4=
|
||||||
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||||
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
|
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
|
||||||
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
|
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
|
||||||
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
|
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
|
||||||
@ -292,8 +303,9 @@ github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brv
|
|||||||
github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80=
|
github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80=
|
||||||
github.com/hashicorp/go-hclog v1.5.0 h1:bI2ocEMgcVlz55Oj1xZNBsVi900c7II+fWDyV9o+13c=
|
github.com/hashicorp/go-hclog v1.5.0 h1:bI2ocEMgcVlz55Oj1xZNBsVi900c7II+fWDyV9o+13c=
|
||||||
github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M=
|
github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M=
|
||||||
github.com/hashicorp/go-immutable-radix v1.0.0 h1:AKDB1HM5PWEA7i4nhcpwOrO2byshxBjXVn/J/3+z5/0=
|
|
||||||
github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60=
|
github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60=
|
||||||
|
github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc=
|
||||||
|
github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60=
|
||||||
github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM=
|
github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM=
|
||||||
github.com/hashicorp/go-msgpack v0.5.5 h1:i9R9JSrqIz0QVLz3sz+i3YJdT7TTSLcfLLzJi9aZTuI=
|
github.com/hashicorp/go-msgpack v0.5.5 h1:i9R9JSrqIz0QVLz3sz+i3YJdT7TTSLcfLLzJi9aZTuI=
|
||||||
github.com/hashicorp/go-msgpack v0.5.5/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM=
|
github.com/hashicorp/go-msgpack v0.5.5/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM=
|
||||||
@ -308,8 +320,9 @@ github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/C
|
|||||||
github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
|
github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
|
||||||
github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
|
github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
|
||||||
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
|
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
|
||||||
github.com/hashicorp/golang-lru v0.5.1 h1:0hERBMJE1eitiLkihrMvRVBYAkpHzc/J3QdDN+dAcgU=
|
|
||||||
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
|
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
|
||||||
|
github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc=
|
||||||
|
github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4=
|
||||||
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
|
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
|
||||||
github.com/hashicorp/memberlist v0.3.1 h1:MXgUXLqva1QvpVEDQW1IQLG0wivQAtmFlHRQ+1vWZfM=
|
github.com/hashicorp/memberlist v0.3.1 h1:MXgUXLqva1QvpVEDQW1IQLG0wivQAtmFlHRQ+1vWZfM=
|
||||||
github.com/hashicorp/memberlist v0.3.1/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE=
|
github.com/hashicorp/memberlist v0.3.1/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE=
|
||||||
@ -425,6 +438,8 @@ github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3Rllmb
|
|||||||
github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
|
github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
|
||||||
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
|
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
|
||||||
github.com/moul/http2curl v1.0.0/go.mod h1:8UbvGypXm98wA/IqH45anm5Y2Z6ep6O31QGOAZ3H0fQ=
|
github.com/moul/http2curl v1.0.0/go.mod h1:8UbvGypXm98wA/IqH45anm5Y2Z6ep6O31QGOAZ3H0fQ=
|
||||||
|
github.com/mozillazg/go-pinyin v0.19.0 h1:p+J8/kjJ558KPvVGYLvqBhxf8jbZA2exSLCs2uUVN8c=
|
||||||
|
github.com/mozillazg/go-pinyin v0.19.0/go.mod h1:iR4EnMMRXkfpFVV5FMi4FNB6wGq9NV6uDWbUuPhP4Yc=
|
||||||
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
|
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
|
||||||
github.com/nacos-group/nacos-sdk-go/v2 v2.2.3 h1:sUQx4f1bXDeeOOEQZjGAitzxYApbYY9fVDbxVCaBW+I=
|
github.com/nacos-group/nacos-sdk-go/v2 v2.2.3 h1:sUQx4f1bXDeeOOEQZjGAitzxYApbYY9fVDbxVCaBW+I=
|
||||||
github.com/nacos-group/nacos-sdk-go/v2 v2.2.3/go.mod h1:UL4U89WYdnyajgKJUMpuT1Rr6iNmbjrxOO40JRgtA00=
|
github.com/nacos-group/nacos-sdk-go/v2 v2.2.3/go.mod h1:UL4U89WYdnyajgKJUMpuT1Rr6iNmbjrxOO40JRgtA00=
|
||||||
@ -449,6 +464,8 @@ github.com/openzipkin/zipkin-go v0.4.1/go.mod h1:qY0VqDSN1pOBN94dBc6w2GJlWLiovAy
|
|||||||
github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
|
github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
|
||||||
github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY=
|
github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY=
|
||||||
github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
|
github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
|
||||||
|
github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc=
|
||||||
|
github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ=
|
||||||
github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
|
github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
|
||||||
github.com/pelletier/go-toml/v2 v2.0.9 h1:uH2qQXheeefCCkuBBSLi7jCiSmj3VRh2+Goq2N7Xxu0=
|
github.com/pelletier/go-toml/v2 v2.0.9 h1:uH2qQXheeefCCkuBBSLi7jCiSmj3VRh2+Goq2N7Xxu0=
|
||||||
github.com/pelletier/go-toml/v2 v2.0.9/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc=
|
github.com/pelletier/go-toml/v2 v2.0.9/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc=
|
||||||
@ -539,8 +556,8 @@ github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcU
|
|||||||
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
|
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
|
||||||
github.com/stripe/stripe-go/v75 v75.7.0 h1:Zk7trlj0kClZOwnpjGz7FgVQRBI0Koi28/eaNATgAs0=
|
github.com/stripe/stripe-go/v75 v75.7.0 h1:Zk7trlj0kClZOwnpjGz7FgVQRBI0Koi28/eaNATgAs0=
|
||||||
github.com/stripe/stripe-go/v75 v75.7.0/go.mod h1:wT44gah+eCY8Z0aSpY/vQlYYbicU9uUAbAqdaUxxDqE=
|
github.com/stripe/stripe-go/v75 v75.7.0/go.mod h1:wT44gah+eCY8Z0aSpY/vQlYYbicU9uUAbAqdaUxxDqE=
|
||||||
github.com/tidwall/gjson v1.12.0 h1:61wEp/qfvFnqKH/WCI3M8HuRut+mHT6Mr82QrFmM2SY=
|
github.com/tidwall/gjson v1.13.0 h1:3TFY9yxOQShrvmjdM76K+jc66zJeT6D3/VFFYCGQf7M=
|
||||||
github.com/tidwall/gjson v1.12.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
|
github.com/tidwall/gjson v1.13.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
|
||||||
github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA=
|
github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA=
|
||||||
github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM=
|
github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM=
|
||||||
github.com/tidwall/pretty v1.2.0 h1:RWIZEg2iJ8/g6fDDYzMpobmaoGh5OLl4AXtGUGPcqCs=
|
github.com/tidwall/pretty v1.2.0 h1:RWIZEg2iJ8/g6fDDYzMpobmaoGh5OLl4AXtGUGPcqCs=
|
||||||
@ -625,8 +642,8 @@ golang.org/x/crypto v0.0.0-20191227163750-53104e6ec876/go.mod h1:LzIPMQfyMNhhGPh
|
|||||||
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||||
golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
|
golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
|
||||||
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
||||||
golang.org/x/crypto v0.11.0 h1:6Ewdq3tDic1mg5xRO4milcWCfMVQhI4NkqWWvqejpuA=
|
golang.org/x/crypto v0.13.0 h1:mvySKfSWJ+UKUii46M40LOvyWfN0s2U+46/jDd0e6Ck=
|
||||||
golang.org/x/crypto v0.11.0/go.mod h1:xgJhtzW8F9jGdVFWZESrid1U1bjeNy4zgy5cRr/CIio=
|
golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc=
|
||||||
golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||||
golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||||
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||||
@ -669,6 +686,7 @@ golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
|||||||
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||||
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||||
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
|
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
|
||||||
|
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
|
||||||
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||||
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||||
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||||
@ -711,6 +729,8 @@ golang.org/x/net v0.0.0-20211008194852-3b03d305991f/go.mod h1:9nx3DQGgdP8bBQD5qx
|
|||||||
golang.org/x/net v0.0.0-20211029224645-99673261e6eb/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
golang.org/x/net v0.0.0-20211029224645-99673261e6eb/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||||
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
|
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
|
||||||
golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco=
|
golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco=
|
||||||
|
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
|
||||||
|
golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
|
||||||
golang.org/x/net v0.12.0 h1:cfawfvKITfUsFCeJIHJrbSxpeu/E81khclypR0GVT50=
|
golang.org/x/net v0.12.0 h1:cfawfvKITfUsFCeJIHJrbSxpeu/E81khclypR0GVT50=
|
||||||
golang.org/x/net v0.12.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA=
|
golang.org/x/net v0.12.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA=
|
||||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||||
@ -732,6 +752,7 @@ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJ
|
|||||||
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
|
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
golang.org/x/sync v0.2.0 h1:PUR+T4wwASmuSTYdKjYHI5TD22Wy5ogLU5qZCOLxBrI=
|
golang.org/x/sync v0.2.0 h1:PUR+T4wwASmuSTYdKjYHI5TD22Wy5ogLU5qZCOLxBrI=
|
||||||
golang.org/x/sync v0.2.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/sync v0.2.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
@ -791,11 +812,16 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc
|
|||||||
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.10.0 h1:SqMFp9UcQJZa+pmYuAKjd9xq1f0j5rLcDIk0mj4qAsA=
|
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
|
golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o=
|
||||||
|
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||||
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||||
golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||||
|
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
|
||||||
|
golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo=
|
||||||
|
golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU=
|
||||||
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||||
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||||
@ -805,8 +831,10 @@ golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
|||||||
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||||
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
||||||
golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
||||||
golang.org/x/text v0.11.0 h1:LAntKIrcmeSKERyiOh0XMV39LXS8IE9UL2yP7+f5ij4=
|
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
||||||
golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
|
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
|
||||||
|
golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k=
|
||||||
|
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
|
||||||
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||||
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||||
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||||
@ -865,6 +893,7 @@ golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4f
|
|||||||
golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
|
golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
|
||||||
golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
|
golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
|
||||||
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
|
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
|
||||||
|
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
|
||||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||||
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||||
@ -985,8 +1014,9 @@ gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8
|
|||||||
gopkg.in/go-playground/validator.v8 v8.18.2/go.mod h1:RX2a/7Ha8BgOhfk7j780h4/u/RRjR0eouCJSH80/M2Y=
|
gopkg.in/go-playground/validator.v8 v8.18.2/go.mod h1:RX2a/7Ha8BgOhfk7j780h4/u/RRjR0eouCJSH80/M2Y=
|
||||||
gopkg.in/h2non/gock.v1 v1.1.2 h1:jBbHXgGBK/AoPVfJh5x4r/WxIrElvbLel8TCZkkZJoY=
|
gopkg.in/h2non/gock.v1 v1.1.2 h1:jBbHXgGBK/AoPVfJh5x4r/WxIrElvbLel8TCZkkZJoY=
|
||||||
gopkg.in/ini.v1 v1.51.1/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
|
gopkg.in/ini.v1 v1.51.1/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
|
||||||
gopkg.in/ini.v1 v1.66.2 h1:XfR1dOYubytKy4Shzc2LHrrGhU0lDCfDGG1yLPmpgsI=
|
|
||||||
gopkg.in/ini.v1 v1.66.2/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
|
gopkg.in/ini.v1 v1.66.2/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
|
||||||
|
gopkg.in/ini.v1 v1.66.4 h1:SsAcf+mM7mRZo2nJNGt8mZCjG8ZRaNGMURJw7BsIST4=
|
||||||
|
gopkg.in/ini.v1 v1.66.4/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
|
||||||
gopkg.in/mgo.v2 v2.0.0-20180705113604-9856a29383ce/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA=
|
gopkg.in/mgo.v2 v2.0.0-20180705113604-9856a29383ce/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA=
|
||||||
gopkg.in/natefinch/lumberjack.v2 v2.0.0 h1:1Lc07Kr7qY4U2YPouBjpCLxpiyxIVoxqXgkXLknAOE8=
|
gopkg.in/natefinch/lumberjack.v2 v2.0.0 h1:1Lc07Kr7qY4U2YPouBjpCLxpiyxIVoxqXgkXLknAOE8=
|
||||||
gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k=
|
gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k=
|
||||||
|
|||||||
34
initalize/ldap.go
Normal file
34
initalize/ldap.go
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
package initalize
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/go-ldap/ldap/v3"
|
||||||
|
"log"
|
||||||
|
)
|
||||||
|
|
||||||
|
func InitLdap(host, bindDN, password string) *ldap.Conn {
|
||||||
|
// LDAP服务器配置
|
||||||
|
/*certFile := "/path/to/certificate.crt"
|
||||||
|
keyFile := "/path/to/certificate.crt"
|
||||||
|
// 加载证书文件
|
||||||
|
cert, err := tls.LoadX509KeyPair(certFile, keyFile)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
}
|
||||||
|
// 配置TLS
|
||||||
|
tlsConfig := &tls.Config{
|
||||||
|
InsecureSkipVerify: true, // 忽略证书验证(请谨慎使用)
|
||||||
|
Certificates: []tls.Certificate{cert},
|
||||||
|
}*/
|
||||||
|
// 连接到LDAP服务器
|
||||||
|
l, err := ldap.DialURL(host /*, ldap.DialWithTLSConfig(tlsConfig)*/)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
}
|
||||||
|
// 进行身份认证
|
||||||
|
err = l.Bind(bindDN, password)
|
||||||
|
if err != nil {
|
||||||
|
l.Close()
|
||||||
|
log.Fatal(err)
|
||||||
|
}
|
||||||
|
return l
|
||||||
|
}
|
||||||
23
model/gmodel/a_test.go
Normal file
23
model/gmodel/a_test.go
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
package gmodel
|
||||||
|
|
||||||
|
import (
|
||||||
|
"log"
|
||||||
|
"testing"
|
||||||
|
|
||||||
|
"github.com/tidwall/gjson"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestCase1(t *testing.T) {
|
||||||
|
v := `{"base": {"mobile": "18588505404", "company": "fusen", "last_name": "sm", "first_name": "h", "resetaurant": "boy"}, "sub_status": {"notification_email": {"newseleter": false, "order_update": false}, "notification_phone": {"newseleter": true, "order_update": false}}, "logo_selected": {"logo_url": "https://fusenstorage.s3.us-east-2.amazonaws.com/d163cba052dc03e7684a4fa8574a17c629e08b6cd0f47f9c239866949365f807", "logo_selected_id": 5018, "merchant_category": 10, "template_tag_selected": {"color": [["#25211F"], ["#1E1916"]], "version": "2", "template_tag": "C6", "selected_index": 0}}}`
|
||||||
|
|
||||||
|
// log.Println(userId, guestId, v)
|
||||||
|
if logoSelected := gjson.Get(v, "logo_selected"); logoSelected.Exists() {
|
||||||
|
log.Println(logoSelected)
|
||||||
|
log.Println(logoSelected.Get("version"))
|
||||||
|
if ver := logoSelected.Get("version"); ver.Exists() && ver.String() == versionML {
|
||||||
|
log.Println(ver)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// gjson.Get(content, "logo_selected")
|
||||||
|
}
|
||||||
@ -4,9 +4,8 @@ import (
|
|||||||
"gorm.io/gorm"
|
"gorm.io/gorm"
|
||||||
)
|
)
|
||||||
|
|
||||||
// casbin_rule 后台--权限规则表
|
// casbin_rule
|
||||||
type CasbinRule struct {
|
type CasbinRule struct {
|
||||||
Id int64 `gorm:"primary_key;default:0;auto_increment;" json:"id"` // 序号
|
|
||||||
PType *string `gorm:"default:'';" json:"p_type"` //
|
PType *string `gorm:"default:'';" json:"p_type"` //
|
||||||
V0 *string `gorm:"default:'';" json:"v0"` //
|
V0 *string `gorm:"default:'';" json:"v0"` //
|
||||||
V1 *string `gorm:"default:'';" json:"v1"` //
|
V1 *string `gorm:"default:'';" json:"v1"` //
|
||||||
|
|||||||
@ -1,32 +0,0 @@
|
|||||||
package gmodel
|
|
||||||
|
|
||||||
import (
|
|
||||||
"gorm.io/gorm"
|
|
||||||
"time"
|
|
||||||
)
|
|
||||||
|
|
||||||
// fs_admin_api 后台--接口表
|
|
||||||
type FsAdminApi struct {
|
|
||||||
Id int64 `gorm:"primary_key;default:0;auto_increment;" json:"id"` // 序号
|
|
||||||
Name *string `gorm:"default:'';" json:"name"` //
|
|
||||||
Path *string `gorm:"default:'';" json:"path"` //
|
|
||||||
Status *int64 `gorm:"default:2;" json:"status"` // 状态:1=启用,2=停用
|
|
||||||
Remark *string `gorm:"default:'';" json:"remark"` //
|
|
||||||
Sort *int64 `gorm:"default:0;" json:"sort"` // 排序权重
|
|
||||||
CreateTime *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"create_time"` //
|
|
||||||
UpdateTime *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"update_time"` //
|
|
||||||
DeleteTime *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"delete_time"` //
|
|
||||||
CreateUid *int64 `gorm:"default:0;" json:"create_uid"` // 创建人
|
|
||||||
UpdateUid *int64 `gorm:"default:0;" json:"update_uid"` // 更新人
|
|
||||||
DeleteUid *int64 `gorm:"default:0;" json:"delete_uid"` // 删除人
|
|
||||||
IsDel *int64 `gorm:"default:0;" json:"is_del"` // 是否删除:1=是 0=否
|
|
||||||
Method *int64 `gorm:"default:0;" json:"method"` // 接口方法
|
|
||||||
}
|
|
||||||
type FsAdminApiModel struct {
|
|
||||||
db *gorm.DB
|
|
||||||
name string
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewFsAdminApiModel(db *gorm.DB) *FsAdminApiModel {
|
|
||||||
return &FsAdminApiModel{db: db, name: "fs_admin_api"}
|
|
||||||
}
|
|
||||||
@ -1,33 +0,0 @@
|
|||||||
package gmodel
|
|
||||||
|
|
||||||
import (
|
|
||||||
"gorm.io/gorm"
|
|
||||||
"time"
|
|
||||||
)
|
|
||||||
|
|
||||||
// fs_admin_auth_role 后台--角色表
|
|
||||||
type FsAdminAuthRole struct {
|
|
||||||
Id int64 `gorm:"primary_key;default:0;" json:"id"` // 序号
|
|
||||||
RolePid *int64 `gorm:"default:0;" json:"role_pid"` // 上级角色
|
|
||||||
RoleName *string `gorm:"default:'';" json:"role_name"` //
|
|
||||||
DataAuthType *int64 `gorm:"default:1;" json:"data_auth_type"` // 数据权限类型
|
|
||||||
DataAuth *string `gorm:"default:'';" json:"data_auth"` //
|
|
||||||
Status *int64 `gorm:"default:2;" json:"status"` // 状态:1=启用,2=停用
|
|
||||||
Remark *string `gorm:"default:'';" json:"remark"` //
|
|
||||||
Sort *int64 `gorm:"default:0;" json:"sort"` // 排序权重
|
|
||||||
CreateTime *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"create_time"` //
|
|
||||||
UpdateTime *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"update_time"` //
|
|
||||||
DeleteTime *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"delete_time"` //
|
|
||||||
CreateUid *int64 `gorm:"default:0;" json:"create_uid"` // 创建人
|
|
||||||
UpdateUid *int64 `gorm:"default:0;" json:"update_uid"` // 更新人
|
|
||||||
DeleteUid *int64 `gorm:"default:0;" json:"delete_uid"` // 删除人
|
|
||||||
IsDel *int64 `gorm:"default:0;" json:"is_del"` // 是否删除:1=是 0=否
|
|
||||||
}
|
|
||||||
type FsAdminAuthRoleModel struct {
|
|
||||||
db *gorm.DB
|
|
||||||
name string
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewFsAdminAuthRoleModel(db *gorm.DB) *FsAdminAuthRoleModel {
|
|
||||||
return &FsAdminAuthRoleModel{db: db, name: "fs_admin_auth_role"}
|
|
||||||
}
|
|
||||||
@ -1,35 +0,0 @@
|
|||||||
package gmodel
|
|
||||||
|
|
||||||
import (
|
|
||||||
"gorm.io/gorm"
|
|
||||||
"time"
|
|
||||||
)
|
|
||||||
|
|
||||||
// fs_admin_department 后台--部门表
|
|
||||||
type FsAdminDepartment struct {
|
|
||||||
Id int64 `gorm:"primary_key;default:0;auto_increment;" json:"id"` // 序号
|
|
||||||
DeptPid *int64 `gorm:"default:0;" json:"dept_pid"` // 上级部门
|
|
||||||
DeptNo *string `gorm:"default:'';" json:"dept_no"` //
|
|
||||||
DeptName *string `gorm:"unique_key;default:'';" json:"dept_name"` //
|
|
||||||
ShortName *string `gorm:"default:'';" json:"short_name"` //
|
|
||||||
UserId *int64 `gorm:"default:0;" json:"user_id"` // 部门负责人
|
|
||||||
Phone *string `gorm:"default:'';" json:"phone"` //
|
|
||||||
Status *int64 `gorm:"default:2;" json:"status"` // 状态:1=启用,2=停用
|
|
||||||
Remark *string `gorm:"default:'';" json:"remark"` //
|
|
||||||
Sort *int64 `gorm:"default:0;" json:"sort"` // 排序权重
|
|
||||||
CreateTime *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"create_time"` //
|
|
||||||
UpdateTime *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"update_time"` //
|
|
||||||
DeleteTime *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"delete_time"` //
|
|
||||||
CreateUid *int64 `gorm:"default:0;" json:"create_uid"` // 创建人
|
|
||||||
UpdateUid *int64 `gorm:"default:0;" json:"update_uid"` // 更新人
|
|
||||||
DeleteUid *int64 `gorm:"default:0;" json:"delete_uid"` // 删除人
|
|
||||||
IsDel *int64 `gorm:"default:0;" json:"is_del"` // 是否删除:1=是 0=否
|
|
||||||
}
|
|
||||||
type FsAdminDepartmentModel struct {
|
|
||||||
db *gorm.DB
|
|
||||||
name string
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewFsAdminDepartmentModel(db *gorm.DB) *FsAdminDepartmentModel {
|
|
||||||
return &FsAdminDepartmentModel{db: db, name: "fs_admin_department"}
|
|
||||||
}
|
|
||||||
@ -1,44 +0,0 @@
|
|||||||
package gmodel
|
|
||||||
|
|
||||||
import (
|
|
||||||
"gorm.io/gorm"
|
|
||||||
"time"
|
|
||||||
)
|
|
||||||
|
|
||||||
// fs_admin_menu 后台--菜单表
|
|
||||||
type FsAdminMenu struct {
|
|
||||||
Id int64 `gorm:"primary_key;default:0;auto_increment;" json:"id"` // 序号
|
|
||||||
Pid *int64 `gorm:"default:0;" json:"pid"` // 上级菜单
|
|
||||||
Name *string `gorm:"unique_key;default:'';" json:"name"` //
|
|
||||||
Path *string `gorm:"default:'';" json:"path"` //
|
|
||||||
Hide *string `gorm:"default:'';" json:"hide"` //
|
|
||||||
Type *int64 `gorm:"default:0;" json:"type"` // 类型:1=菜单,2=iframe,3=外链,4=按钮
|
|
||||||
Alias *string `gorm:"default:'';" json:"alias"` //
|
|
||||||
Icon *string `gorm:"default:'';" json:"icon"` //
|
|
||||||
Redirect *string `gorm:"default:'';" json:"redirect"` //
|
|
||||||
Highlight *string `gorm:"default:'';" json:"highlight"` //
|
|
||||||
View *string `gorm:"default:'';" json:"view"` //
|
|
||||||
Colour *string `gorm:"default:'';" json:"colour"` //
|
|
||||||
FullPageRout *int64 `gorm:"default:0;" json:"full_page_rout"` // 整页路由:1=是,0=否
|
|
||||||
Label *string `gorm:"default:'';" json:"label"` //
|
|
||||||
Metadata *[]byte `gorm:"default:'';" json:"metadata"` // 元数据,json格式
|
|
||||||
Status *int64 `gorm:"default:2;" json:"status"` // 状态:1=启用,2=停用
|
|
||||||
Remark *string `gorm:"default:'';" json:"remark"` //
|
|
||||||
Sort *int64 `gorm:"default:0;" json:"sort"` // 排序权重
|
|
||||||
CreateTime *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"create_time"` //
|
|
||||||
UpdateTime *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"update_time"` //
|
|
||||||
DeleteTime *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"delete_time"` //
|
|
||||||
CreateUid *int64 `gorm:"default:0;" json:"create_uid"` // 创建人
|
|
||||||
UpdateUid *int64 `gorm:"default:0;" json:"update_uid"` // 更新人
|
|
||||||
DeleteUid *int64 `gorm:"default:0;" json:"delete_uid"` // 删除人
|
|
||||||
IsDel *int64 `gorm:"default:0;" json:"is_del"` // 是否删除:1=是 0=否
|
|
||||||
ApiAuth *[]byte `gorm:"default:'';" json:"api_auth"` //
|
|
||||||
}
|
|
||||||
type FsAdminMenuModel struct {
|
|
||||||
db *gorm.DB
|
|
||||||
name string
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewFsAdminMenuModel(db *gorm.DB) *FsAdminMenuModel {
|
|
||||||
return &FsAdminMenuModel{db: db, name: "fs_admin_menu"}
|
|
||||||
}
|
|
||||||
@ -1,23 +0,0 @@
|
|||||||
package gmodel
|
|
||||||
|
|
||||||
import (
|
|
||||||
"gorm.io/gorm"
|
|
||||||
)
|
|
||||||
|
|
||||||
// fs_admin_role_api 后台--角色接口表
|
|
||||||
type FsAdminRoleApi struct {
|
|
||||||
Id int64 `gorm:"primary_key;default:0;auto_increment;" json:"id"` // 序号
|
|
||||||
RoleId *int64 `gorm:"index;default:0;" json:"role_id"` // 角色ID
|
|
||||||
MenuId *int64 `gorm:"index;default:0;" json:"menu_id"` // 菜单ID
|
|
||||||
ApiId *int64 `gorm:"index;default:0;" json:"api_id"` // 接口ID
|
|
||||||
ApiPath *string `gorm:"default:'';" json:"api_path"` //
|
|
||||||
ApiMethod *int64 `gorm:"default:0;" json:"api_method"` // 接口方法
|
|
||||||
}
|
|
||||||
type FsAdminRoleApiModel struct {
|
|
||||||
db *gorm.DB
|
|
||||||
name string
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewFsAdminRoleApiModel(db *gorm.DB) *FsAdminRoleApiModel {
|
|
||||||
return &FsAdminRoleApiModel{db: db, name: "fs_admin_role_api"}
|
|
||||||
}
|
|
||||||
@ -1,34 +0,0 @@
|
|||||||
package gmodel
|
|
||||||
|
|
||||||
import (
|
|
||||||
"gorm.io/gorm"
|
|
||||||
"time"
|
|
||||||
)
|
|
||||||
|
|
||||||
// fs_admin_role 后台--角色表
|
|
||||||
type FsAdminRole struct {
|
|
||||||
Id int64 `gorm:"primary_key;default:0;auto_increment;" json:"id"` // 序号
|
|
||||||
RolePid *int64 `gorm:"default:0;" json:"role_pid"` // 上级角色
|
|
||||||
RoleName *string `gorm:"unique_key;default:'';" json:"role_name"` //
|
|
||||||
DataAuthType *int64 `gorm:"default:1;" json:"data_auth_type"` // 数据权限类型
|
|
||||||
DataAuth *string `gorm:"default:'';" json:"data_auth"` //
|
|
||||||
Status *int64 `gorm:"default:2;" json:"status"` // 状态:1=启用,2=停用
|
|
||||||
Remark *string `gorm:"default:'';" json:"remark"` //
|
|
||||||
Sort *int64 `gorm:"default:0;" json:"sort"` // 排序权重
|
|
||||||
CreateTime *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"create_time"` //
|
|
||||||
UpdateTime *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"update_time"` //
|
|
||||||
DeleteTime *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"delete_time"` //
|
|
||||||
CreateUid *int64 `gorm:"default:0;" json:"create_uid"` // 创建人
|
|
||||||
UpdateUid *int64 `gorm:"default:0;" json:"update_uid"` // 更新人
|
|
||||||
DeleteUid *int64 `gorm:"default:0;" json:"delete_uid"` // 删除人
|
|
||||||
IsDel *int64 `gorm:"default:0;" json:"is_del"` // 是否删除:1=是 0=否
|
|
||||||
MenuAuth *[]byte `gorm:"default:'';" json:"menu_auth"` //
|
|
||||||
}
|
|
||||||
type FsAdminRoleModel struct {
|
|
||||||
db *gorm.DB
|
|
||||||
name string
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewFsAdminRoleModel(db *gorm.DB) *FsAdminRoleModel {
|
|
||||||
return &FsAdminRoleModel{db: db, name: "fs_admin_role"}
|
|
||||||
}
|
|
||||||
@ -1,44 +0,0 @@
|
|||||||
package gmodel
|
|
||||||
|
|
||||||
import (
|
|
||||||
"gorm.io/gorm"
|
|
||||||
"time"
|
|
||||||
)
|
|
||||||
|
|
||||||
// fs_admin_user 后台--管理员表
|
|
||||||
type FsAdminUser struct {
|
|
||||||
Id int64 `gorm:"primary_key;default:0;auto_increment;" json:"id"` // 序号
|
|
||||||
DepartmentId *int64 `gorm:"default:0;" json:"department_id"` // 部门
|
|
||||||
RoleId *int64 `gorm:"default:0;" json:"role_id"` // 角色
|
|
||||||
EmployeeId *int64 `gorm:"default:0;" json:"employee_id"` // 员工
|
|
||||||
Type *int64 `gorm:"default:0;" json:"type"` // 类型:1=超级管理员,2=普通管理员
|
|
||||||
Account *string `gorm:"unique_key;default:'';" json:"account"` //
|
|
||||||
Password *string `gorm:"default:'';" json:"password"` //
|
|
||||||
Nickname *string `gorm:"default:'';" json:"nickname"` //
|
|
||||||
Mobile *string `gorm:"default:'';" json:"mobile"` //
|
|
||||||
Email *string `gorm:"default:'';" json:"email"` //
|
|
||||||
Salt *string `gorm:"default:'';" json:"salt"` //
|
|
||||||
LoginInitPassword *string `gorm:"default:'';" json:"login_init_password"` //
|
|
||||||
LoginLastTime *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"login_last_time"` //
|
|
||||||
LoginLastIp *string `gorm:"default:'';" json:"login_last_ip"` //
|
|
||||||
LoginNum *int64 `gorm:"default:0;" json:"login_num"` // 登录次数
|
|
||||||
Status *int64 `gorm:"default:2;" json:"status"` // 状态:1=启用,2=停用
|
|
||||||
Remark *string `gorm:"default:'';" json:"remark"` //
|
|
||||||
Sort *int64 `gorm:"default:0;" json:"sort"` // 排序权重
|
|
||||||
CreateTime *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"create_time"` //
|
|
||||||
UpdateTime *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"update_time"` //
|
|
||||||
DeleteTime *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"delete_time"` //
|
|
||||||
CreateUid *int64 `gorm:"default:0;" json:"create_uid"` // 创建人
|
|
||||||
UpdateUid *int64 `gorm:"default:0;" json:"update_uid"` // 更新人
|
|
||||||
DeleteUid *int64 `gorm:"default:0;" json:"delete_uid"` // 删除人
|
|
||||||
IsDel *int64 `gorm:"default:0;" json:"is_del"` // 是否删除:1=是 0=否
|
|
||||||
RoleIds *string `gorm:"default:'';" json:"role_ids"` //
|
|
||||||
}
|
|
||||||
type FsAdminUserModel struct {
|
|
||||||
db *gorm.DB
|
|
||||||
name string
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewFsAdminUserModel(db *gorm.DB) *FsAdminUserModel {
|
|
||||||
return &FsAdminUserModel{db: db, name: "fs_admin_user"}
|
|
||||||
}
|
|
||||||
@ -1,2 +0,0 @@
|
|||||||
package gmodel
|
|
||||||
// TODO: 使用model的属性做你想做的
|
|
||||||
@ -8,12 +8,8 @@ import (
|
|||||||
type FsCloudRenderLog struct {
|
type FsCloudRenderLog struct {
|
||||||
Id int64 `gorm:"primary_key;default:0;auto_increment;" json:"id"` // ID
|
Id int64 `gorm:"primary_key;default:0;auto_increment;" json:"id"` // ID
|
||||||
UserId *int64 `gorm:"default:0;" json:"user_id"` // 用户id
|
UserId *int64 `gorm:"default:0;" json:"user_id"` // 用户id
|
||||||
|
GuestId *int64 `gorm:"default:0;" json:"guest_id"` // 游客id
|
||||||
PostData *string `gorm:"default:'';" json:"post_data"` //
|
PostData *string `gorm:"default:'';" json:"post_data"` //
|
||||||
PostUrl *string `gorm:"default:'';" json:"post_url"` //
|
|
||||||
Title *string `gorm:"index;default:'';" json:"title"` //
|
|
||||||
Time *int64 `gorm:"default:0;" json:"time"` // 所用时间
|
|
||||||
Result *string `gorm:"default:'';" json:"result"` //
|
|
||||||
Tag *string `gorm:"index;default:'';" json:"tag"` // 标识
|
|
||||||
Ctime *int64 `gorm:"default:0;" json:"ctime"` // 添加时间
|
Ctime *int64 `gorm:"default:0;" json:"ctime"` // 添加时间
|
||||||
}
|
}
|
||||||
type FsCloudRenderLogModel struct {
|
type FsCloudRenderLogModel struct {
|
||||||
|
|||||||
@ -11,6 +11,7 @@ type FsDepartment struct {
|
|||||||
Status *int64 `gorm:"default:0;" json:"status"` // 状态 1正常0停用
|
Status *int64 `gorm:"default:0;" json:"status"` // 状态 1正常0停用
|
||||||
Ctime *int64 `gorm:"default:0;" json:"ctime"` // 添加时间
|
Ctime *int64 `gorm:"default:0;" json:"ctime"` // 添加时间
|
||||||
ParentId *int64 `gorm:"default:0;" json:"parent_id"` // 父级id
|
ParentId *int64 `gorm:"default:0;" json:"parent_id"` // 父级id
|
||||||
|
Manager *int64 `gorm:"default:0;" json:"manager"` // 负责人
|
||||||
}
|
}
|
||||||
type FsDepartmentModel struct {
|
type FsDepartmentModel struct {
|
||||||
db *gorm.DB
|
db *gorm.DB
|
||||||
|
|||||||
27
model/gmodel/fs_feishu_webhook_log_gen.go
Normal file
27
model/gmodel/fs_feishu_webhook_log_gen.go
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
package gmodel
|
||||||
|
|
||||||
|
import (
|
||||||
|
"gorm.io/gorm"
|
||||||
|
"time"
|
||||||
|
)
|
||||||
|
|
||||||
|
// fs_feishu_webhook_log 飞书webhook记录表
|
||||||
|
type FsFeishuWebhookLog struct {
|
||||||
|
Id int64 `gorm:"primary_key;default:0;auto_increment;" json:"id"` // ID
|
||||||
|
AppId *string `gorm:"default:'';" json:"app_id"` // app_id
|
||||||
|
EventId *string `gorm:"index;default:'';" json:"event_id"` // 事件唯一id
|
||||||
|
EventType *string `gorm:"default:'';" json:"event_type"` // 事件名
|
||||||
|
HttpHeader *string `gorm:"default:'';" json:"http_header"` // http响应头信息
|
||||||
|
Data *string `gorm:"default:'';" json:"data"` //
|
||||||
|
DecryptData *string `gorm:"default:'';" json:"decrypt_data"` //
|
||||||
|
MsgCtime *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"msg_ctime"` //
|
||||||
|
Ctime *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"ctime"` //
|
||||||
|
}
|
||||||
|
type FsFeishuWebhookLogModel struct {
|
||||||
|
db *gorm.DB
|
||||||
|
name string
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewFsFeishuWebhookLogModel(db *gorm.DB) *FsFeishuWebhookLogModel {
|
||||||
|
return &FsFeishuWebhookLogModel{db: db, name: "fs_feishu_webhook_log"}
|
||||||
|
}
|
||||||
9
model/gmodel/fs_feishu_webhook_log_logic.go
Normal file
9
model/gmodel/fs_feishu_webhook_log_logic.go
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
package gmodel
|
||||||
|
|
||||||
|
import "context"
|
||||||
|
|
||||||
|
// TODO: 使用model的属性做你想做的
|
||||||
|
|
||||||
|
func (w *FsFeishuWebhookLogModel) Create(ctx context.Context, data *FsFeishuWebhookLog) error {
|
||||||
|
return w.db.WithContext(ctx).Model(&FsFeishuWebhookLog{}).Create(&data).Error
|
||||||
|
}
|
||||||
@ -7,9 +7,9 @@ import (
|
|||||||
// fs_font 字体配置
|
// fs_font 字体配置
|
||||||
type FsFont struct {
|
type FsFont struct {
|
||||||
Id int64 `gorm:"primary_key;default:0;auto_increment;" json:"id"` // id
|
Id int64 `gorm:"primary_key;default:0;auto_increment;" json:"id"` // id
|
||||||
Title *string `gorm:"default:'';" json:"title"` // 字体名字
|
Title *string `gorm:"default:'';" json:"title"` //
|
||||||
LinuxFontname *string `gorm:"default:'';" json:"linux_fontname"` // linux对应字体名
|
LinuxFontname *string `gorm:"default:'';" json:"linux_fontname"` // linux对应字体名
|
||||||
FilePath *string `gorm:"default:'';" json:"file_path"` // 字体文件路径
|
FilePath *string `gorm:"default:'';" json:"file_path"` //
|
||||||
Sort *int64 `gorm:"default:0;" json:"sort"` // 排序
|
Sort *int64 `gorm:"default:0;" json:"sort"` // 排序
|
||||||
}
|
}
|
||||||
type FsFontModel struct {
|
type FsFontModel struct {
|
||||||
|
|||||||
@ -41,7 +41,7 @@ func (m *FsGuestModel) GenerateGuestID(ctx context.Context, AccessSecret uint64)
|
|||||||
Ctime: &now,
|
Ctime: &now,
|
||||||
Utime: &now,
|
Utime: &now,
|
||||||
}
|
}
|
||||||
return tx.Model(FsUserInfo{}).Create(uinfo).Error
|
return tx.Model(&FsUserInfo{}).Create(uinfo).Error
|
||||||
})
|
})
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
18
model/gmodel/fs_logo_preprocess_gen.go
Normal file
18
model/gmodel/fs_logo_preprocess_gen.go
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
package gmodel
|
||||||
|
|
||||||
|
import (
|
||||||
|
"gorm.io/gorm"
|
||||||
|
)
|
||||||
|
|
||||||
|
// fs_logo_preprocess
|
||||||
|
type FsLogoPreprocess struct {
|
||||||
|
RestaurantName *string `gorm:"index;default:'';" json:"restaurant_name"` // 餐厅名字
|
||||||
|
}
|
||||||
|
type FsLogoPreprocessModel struct {
|
||||||
|
db *gorm.DB
|
||||||
|
name string
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewFsLogoPreprocessModel(db *gorm.DB) *FsLogoPreprocessModel {
|
||||||
|
return &FsLogoPreprocessModel{db: db, name: "fs_logo_preprocess"}
|
||||||
|
}
|
||||||
33
model/gmodel/fs_message_log_gen.go
Normal file
33
model/gmodel/fs_message_log_gen.go
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
package gmodel
|
||||||
|
|
||||||
|
import (
|
||||||
|
"gorm.io/gorm"
|
||||||
|
"time"
|
||||||
|
)
|
||||||
|
|
||||||
|
// fs_message_log 消息记录表
|
||||||
|
type FsMessageLog struct {
|
||||||
|
Id int64 `gorm:"primary_key;default:0;auto_increment;" json:"id"` // ID
|
||||||
|
Type *string `gorm:"default:'';" json:"type"` //
|
||||||
|
Channel *string `gorm:"default:'';" json:"channel"` // 发送途径:sm=短信 email=邮件 feishu=飞书
|
||||||
|
Module *string `gorm:"default:'';" json:"module"` //
|
||||||
|
Source *string `gorm:"default:'';" json:"source"` //
|
||||||
|
Sender *string `gorm:"default:'';" json:"sender"` //
|
||||||
|
Receiver *string `gorm:"default:'';" json:"receiver"` //
|
||||||
|
TemplateSn *string `gorm:"default:'';" json:"template_sn"` //
|
||||||
|
Title *string `gorm:"default:'';" json:"title"` //
|
||||||
|
Content *[]byte `gorm:"default:'';" json:"content"` //
|
||||||
|
Status *int64 `gorm:"default:0;" json:"status"` // 状态:0=未发送 1=已发送
|
||||||
|
Metadata *[]byte `gorm:"default:'';" json:"metadata"` //
|
||||||
|
IsDel *int64 `gorm:"default:0;" json:"is_del"` // 是否删除
|
||||||
|
Ctime *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"ctime"` //
|
||||||
|
Utime *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"utime"` //
|
||||||
|
}
|
||||||
|
type FsMessageLogModel struct {
|
||||||
|
db *gorm.DB
|
||||||
|
name string
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewFsMessageLogModel(db *gorm.DB) *FsMessageLogModel {
|
||||||
|
return &FsMessageLogModel{db: db, name: "fs_message_log"}
|
||||||
|
}
|
||||||
25
model/gmodel/fs_order_combine_image_record_gen.go
Normal file
25
model/gmodel/fs_order_combine_image_record_gen.go
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
package gmodel
|
||||||
|
|
||||||
|
import (
|
||||||
|
"gorm.io/gorm"
|
||||||
|
"time"
|
||||||
|
)
|
||||||
|
|
||||||
|
// fs_order_combine_image_record 刀版图记录表
|
||||||
|
type FsOrderCombineImageRecord struct {
|
||||||
|
Id int64 `gorm:"primary_key;default:0;auto_increment;" json:"id"` // Id
|
||||||
|
OrderId *int64 `gorm:"default:0;" json:"order_id"` // 订单id
|
||||||
|
CartId *int64 `gorm:"default:0;" json:"cart_id"` // 购物车id
|
||||||
|
ProductId *int64 `gorm:"default:0;" json:"product_id"` // 产品id
|
||||||
|
CombineImage *string `gorm:"default:'';" json:"combine_image"` //
|
||||||
|
GerentId *int64 `gorm:"default:0;" json:"gerent_id"` // 操作人
|
||||||
|
Ctime *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"ctime"` //
|
||||||
|
}
|
||||||
|
type FsOrderCombineImageRecordModel struct {
|
||||||
|
db *gorm.DB
|
||||||
|
name string
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewFsOrderCombineImageRecordModel(db *gorm.DB) *FsOrderCombineImageRecordModel {
|
||||||
|
return &FsOrderCombineImageRecordModel{db: db, name: "fs_order_combine_image_record"}
|
||||||
|
}
|
||||||
@ -25,6 +25,9 @@ type FsOrder struct {
|
|||||||
PayStatusLink *[]byte `gorm:"default:'';" json:"pay_status_link"` //
|
PayStatusLink *[]byte `gorm:"default:'';" json:"pay_status_link"` //
|
||||||
ShoppingCartSnapshot *[]byte `gorm:"default:'';" json:"shopping_cart_snapshot"` //
|
ShoppingCartSnapshot *[]byte `gorm:"default:'';" json:"shopping_cart_snapshot"` //
|
||||||
ShoppingProductSnapshot *[]byte `gorm:"default:'';" json:"shopping_product_snapshot"` //
|
ShoppingProductSnapshot *[]byte `gorm:"default:'';" json:"shopping_product_snapshot"` //
|
||||||
|
SaleGerentId *int64 `gorm:"default:0;" json:"sale_gerent_id"` // 销售负责人
|
||||||
|
DesignGerentId *int64 `gorm:"default:0;" json:"design_gerent_id"` // 设计负责人
|
||||||
|
Scm *[]byte `gorm:"default:'';" json:"scm"` //
|
||||||
}
|
}
|
||||||
type FsOrderModel struct {
|
type FsOrderModel struct {
|
||||||
db *gorm.DB
|
db *gorm.DB
|
||||||
|
|||||||
@ -19,9 +19,14 @@ type OrderDetail struct {
|
|||||||
|
|
||||||
// 收货地址
|
// 收货地址
|
||||||
type OrderAddress struct {
|
type OrderAddress struct {
|
||||||
Address string `json:"address"` // 详细地址
|
Street string `json:"street"` // 详细地址
|
||||||
|
City string `json:"city"` // 城市
|
||||||
|
FirstName string `json:"first_name"` // 姓
|
||||||
|
LastName string `json:"last_name"` // 名
|
||||||
Mobile string `json:"mobile"` // 手机
|
Mobile string `json:"mobile"` // 手机
|
||||||
Name string `json:"name"` // 姓名
|
State string `json:"state"` // 州
|
||||||
|
Suite string `json:"suite"` // 房号
|
||||||
|
ZipCode string `json:"zip_code"` // 邮编号码
|
||||||
}
|
}
|
||||||
|
|
||||||
// 订单金额
|
// 订单金额
|
||||||
@ -48,11 +53,12 @@ type PayInfo struct {
|
|||||||
|
|
||||||
// 金额明细
|
// 金额明细
|
||||||
type AmountInfo struct {
|
type AmountInfo struct {
|
||||||
Change AmountCurrency `json:"change,omitempty"` // 变动金额
|
Change AmountCurrency `json:"change"` // 变动金额
|
||||||
ChangeRemark string `json:"change_remark,omitempty"` // 变动备注
|
ChangeRemark string `json:"change_remark"` // 变动备注
|
||||||
Current AmountCurrency `json:"current"` // 当前金额
|
Current AmountCurrency `json:"current"` // 当前金额
|
||||||
Initiate AmountCurrency `json:"initiate"` // 初始金额
|
Initiate AmountCurrency `json:"initiate"` // 初始金额
|
||||||
Metadata map[string]interface{} `json:"metadata"` // 额外明细
|
Metadata map[string]interface{} `json:"metadata"` // 额外明细
|
||||||
|
IsUpdate int64 `json:"is_update"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// 金额货币
|
// 金额货币
|
||||||
@ -62,6 +68,7 @@ type AmountCurrency struct {
|
|||||||
CurrentAmount constants.AmountUnit `json:"current_amount"` // 当前金额
|
CurrentAmount constants.AmountUnit `json:"current_amount"` // 当前金额
|
||||||
OriginalCurrency string `json:"original_currency"` // 原始货币
|
OriginalCurrency string `json:"original_currency"` // 原始货币
|
||||||
OriginalAmount constants.AmountUnit `json:"original_amount"` // 原始金额
|
OriginalAmount constants.AmountUnit `json:"original_amount"` // 原始金额
|
||||||
|
IsUpdate int64 `json:"is_update"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// 支付状态
|
// 支付状态
|
||||||
@ -102,6 +109,7 @@ type OrderProduct struct {
|
|||||||
PurchaseQuantity PurchaseQuantity `json:"purchase_quantity"` // 购买数量
|
PurchaseQuantity PurchaseQuantity `json:"purchase_quantity"` // 购买数量
|
||||||
ProductId int64 `json:"product_id"` // 商品ID
|
ProductId int64 `json:"product_id"` // 商品ID
|
||||||
ProductSn string `json:"product_sn"` // 商品编码
|
ProductSn string `json:"product_sn"` // 商品编码
|
||||||
|
ProductWebsiteUnit *ProductWebsiteUnit `json:"product_website_unit"` //产品前台网站单位
|
||||||
ProductName string `json:"product_name"` // 商品名称
|
ProductName string `json:"product_name"` // 商品名称
|
||||||
ProductCover string `json:"product_cover"` // 商品封面
|
ProductCover string `json:"product_cover"` // 商品封面
|
||||||
ProductCoverMetadata map[string]interface{} `json:"product_cover_metadata"` // 商品封面
|
ProductCoverMetadata map[string]interface{} `json:"product_cover_metadata"` // 商品封面
|
||||||
@ -118,6 +126,7 @@ type OrderProduct struct {
|
|||||||
type PurchaseQuantity struct {
|
type PurchaseQuantity struct {
|
||||||
Current interface{} `json:"current"`
|
Current interface{} `json:"current"`
|
||||||
Initiate interface{} `json:"initiate"`
|
Initiate interface{} `json:"initiate"`
|
||||||
|
IsUpdate int64 `json:"is_update"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type OrderProductSizeInfo struct {
|
type OrderProductSizeInfo struct {
|
||||||
@ -139,6 +148,7 @@ type OrderProductFittingInfo struct {
|
|||||||
type ExpectedDelivery struct {
|
type ExpectedDelivery struct {
|
||||||
Current time.Time `json:"current"`
|
Current time.Time `json:"current"`
|
||||||
Initiate time.Time `json:"initiate"`
|
Initiate time.Time `json:"initiate"`
|
||||||
|
IsUpdate int64 `json:"is_update"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type OrderProductInter struct {
|
type OrderProductInter struct {
|
||||||
@ -151,6 +161,7 @@ type OrderProductInter struct {
|
|||||||
ProductCover string `json:"product_cover"` // 商品封面
|
ProductCover string `json:"product_cover"` // 商品封面
|
||||||
ProductCoverMetadata map[string]interface{} `json:"product_cover_metadata"` // 商品封面
|
ProductCoverMetadata map[string]interface{} `json:"product_cover_metadata"` // 商品封面
|
||||||
ProductSn string `json:"product_sn"` // 商品编码
|
ProductSn string `json:"product_sn"` // 商品编码
|
||||||
|
ProductWebsiteUnit *ProductWebsiteUnit `json:"product_website_unit"` //产品前台网站单位
|
||||||
DiyInformation *UserDiyInformation `json:"diy_information"`
|
DiyInformation *UserDiyInformation `json:"diy_information"`
|
||||||
SizeInfo *OrderProductSizeInfo `json:"size_info"`
|
SizeInfo *OrderProductSizeInfo `json:"size_info"`
|
||||||
FittingInfo *OrderProductFittingInfo `json:"fitting_info"`
|
FittingInfo *OrderProductFittingInfo `json:"fitting_info"`
|
||||||
|
|||||||
@ -25,6 +25,7 @@ type FsOrderTrade struct {
|
|||||||
Ctime *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"ctime"` //
|
Ctime *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"ctime"` //
|
||||||
Utime *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"utime"` //
|
Utime *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"utime"` //
|
||||||
PayTitle *string `gorm:"default:'';" json:"pay_title"` //
|
PayTitle *string `gorm:"default:'';" json:"pay_title"` //
|
||||||
|
ReceiptSn *string `gorm:"default:'';" json:"receipt_sn"` //
|
||||||
}
|
}
|
||||||
type FsOrderTradeModel struct {
|
type FsOrderTradeModel struct {
|
||||||
db *gorm.DB
|
db *gorm.DB
|
||||||
|
|||||||
35
model/gmodel/fs_preprocess_logo_gen.go
Normal file
35
model/gmodel/fs_preprocess_logo_gen.go
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
package gmodel
|
||||||
|
|
||||||
|
import (
|
||||||
|
"gorm.io/gorm"
|
||||||
|
"time"
|
||||||
|
)
|
||||||
|
|
||||||
|
// fs_preprocess_logo logo数据表
|
||||||
|
type FsPreprocessLogo struct {
|
||||||
|
Id int64 `gorm:"primary_key;default:0;auto_increment;" json:"id"` // 自增的唯一id
|
||||||
|
LocationCode *string `gorm:"index;default:'';" json:"location_code"` //
|
||||||
|
RestaurantName *string `gorm:"index;default:'';" json:"restaurant_name"` //
|
||||||
|
ResourceUrl *string `gorm:"default:'';" json:"resource_url"` //
|
||||||
|
ResourceVectorUrl *string `gorm:"default:'';" json:"resource_vector_url"` //
|
||||||
|
OriginFileName *string `gorm:"default:'';" json:"origin_file_name"` //
|
||||||
|
RestaurantType *string `gorm:"default:'';" json:"restaurant_type"` //
|
||||||
|
Address *string `gorm:"default:'';" json:"address"` //
|
||||||
|
ZipCode *string `gorm:"default:'';" json:"zip_code"` //
|
||||||
|
Phone *string `gorm:"default:'';" json:"phone"` //
|
||||||
|
Website *string `gorm:"default:'';" json:"website"` //
|
||||||
|
IsBranch *int64 `gorm:"default:0;" json:"is_branch"` // 是否分店
|
||||||
|
Metadata *[]byte `gorm:"default:'';" json:"metadata"` //
|
||||||
|
Source *string `gorm:"index;default:'';" json:"source"` //
|
||||||
|
IsDel *int64 `gorm:"index;default:0;" json:"is_del"` // 是否删除
|
||||||
|
Ctime *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"ctime"` //
|
||||||
|
Utime *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"utime"` //
|
||||||
|
}
|
||||||
|
type FsPreprocessLogoModel struct {
|
||||||
|
db *gorm.DB
|
||||||
|
name string
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewFsPreprocessLogoModel(db *gorm.DB) *FsPreprocessLogoModel {
|
||||||
|
return &FsPreprocessLogoModel{db: db, name: "fs_preprocess_logo"}
|
||||||
|
}
|
||||||
102
model/gmodel/fs_preprocess_logo_logic.go
Normal file
102
model/gmodel/fs_preprocess_logo_logic.go
Normal file
@ -0,0 +1,102 @@
|
|||||||
|
package gmodel
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
|
||||||
|
"fmt"
|
||||||
|
"regexp"
|
||||||
|
"strings"
|
||||||
|
|
||||||
|
"github.com/zeromicro/go-zero/core/logx"
|
||||||
|
)
|
||||||
|
|
||||||
|
type PreLogoSearchResult struct {
|
||||||
|
Id int64 `gorm:"primary_key;default:0;auto_increment;" json:"id"` // 自增的唯一id
|
||||||
|
RestaurantName *string `gorm:"index;default:'';" json:"restaurant_name"` //
|
||||||
|
ResourceUrl *string `gorm:"default:'';" json:"resource_url"` //
|
||||||
|
RestaurantType *string `gorm:"default:'';" json:"restaurant_type"` //
|
||||||
|
Address *string `gorm:"default:'';" json:"address"` //
|
||||||
|
ZipCode *string `gorm:"default:'';" json:"zip_code"` //
|
||||||
|
Phone *string `gorm:"default:'';" json:"phone"` //
|
||||||
|
Website *string `gorm:"default:'';" json:"website"` //
|
||||||
|
IsBranch *int64 `gorm:"default:0;" json:"is_branch"` // 是否分店
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO: 使用model的属性做你想做的
|
||||||
|
|
||||||
|
// 搜索
|
||||||
|
func (p *FsPreprocessLogoModel) PreLogoSearch(ctx context.Context, zipcode string, keywordsStr string, count int) (resp []PreLogoSearchResult, err error) {
|
||||||
|
keywordsList := SplitSearchKeywords(keywordsStr)
|
||||||
|
var keywords []string
|
||||||
|
for _, v := range keywordsList {
|
||||||
|
if len(v) > 1 {
|
||||||
|
keywords = append(keywords, "+"+v+"*")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(keywords) != 0 {
|
||||||
|
|
||||||
|
sqlstr := fmt.Sprintf("SELECT id,restaurant_name,resource_url,address,zip_code,phone,website,is_branch FROM fs_preprocess_logo WHERE MATCH(restaurant_name) AGAINST(? IN BOOLEAN MODE) AND `is_del` = 0 AND `zip_code` = ? limit %d;", count)
|
||||||
|
|
||||||
|
tx := p.db.WithContext(ctx).Model(&FsPreprocessLogo{}).Raw(sqlstr, strings.Join(keywords, " "), zipcode)
|
||||||
|
err = tx.Scan(&resp).Error
|
||||||
|
if err != nil {
|
||||||
|
logx.Error(err)
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
for i := range resp {
|
||||||
|
if resp[i].RestaurantType == nil {
|
||||||
|
resp[i].RestaurantType = FsString("")
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if resp == nil {
|
||||||
|
resp = make([]PreLogoSearchResult, 0)
|
||||||
|
}
|
||||||
|
|
||||||
|
return resp, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func SplitSearchKeywords(keywordsStr string) []string {
|
||||||
|
return regexp.MustCompile(`\s+|\++`).Split(keywordsStr, -1)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 搜索建议
|
||||||
|
func (p *FsPreprocessLogoModel) PreLogoSearchSuggestions(ctx context.Context, keywordsStr string, count int) (resp []PreLogoSearchResult, err error) {
|
||||||
|
// keywordsList := regexp.MustCompile(`\s+|\++`).Split(keywordsStr, -1)
|
||||||
|
keywordsList := SplitSearchKeywords(keywordsStr)
|
||||||
|
var keywords []string
|
||||||
|
for _, v := range keywordsList {
|
||||||
|
if len(v) > 1 {
|
||||||
|
keywords = append(keywords, "+"+v+"*")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(keywords) != 0 {
|
||||||
|
sqlstr := fmt.Sprintf("SELECT id,restaurant_name,resource_url,address,zip_code,phone,website,is_branch FROM fs_preprocess_logo WHERE MATCH(restaurant_name) AGAINST(? IN BOOLEAN MODE) AND `is_del` = 0 limit %d;", count)
|
||||||
|
|
||||||
|
tx := p.db.WithContext(ctx).Model(&FsPreprocessLogo{}).Raw(sqlstr, strings.Join(keywords, " "))
|
||||||
|
err = tx.Scan(&resp).Error
|
||||||
|
if err != nil {
|
||||||
|
logx.Error(err)
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
for i := range resp {
|
||||||
|
if resp[i].RestaurantType == nil {
|
||||||
|
resp[i].RestaurantType = FsString("")
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if resp == nil {
|
||||||
|
resp = make([]PreLogoSearchResult, 0)
|
||||||
|
}
|
||||||
|
|
||||||
|
return resp, nil
|
||||||
|
}
|
||||||
@ -36,7 +36,9 @@ type FsProduct struct {
|
|||||||
RecommendProductSort *string `gorm:"default:'';" json:"recommend_product_sort"` //
|
RecommendProductSort *string `gorm:"default:'';" json:"recommend_product_sort"` //
|
||||||
SceneIds *string `gorm:"default:'';" json:"scene_ids"` //
|
SceneIds *string `gorm:"default:'';" json:"scene_ids"` //
|
||||||
IsCustomization *int64 `gorm:"default:0;" json:"is_customization"` // 是否可定制
|
IsCustomization *int64 `gorm:"default:0;" json:"is_customization"` // 是否可定制
|
||||||
|
WebsiteUnit *string `gorm:"default:'';" json:"website_unit"` //
|
||||||
Unit *string `gorm:"default:'';" json:"unit"` //
|
Unit *string `gorm:"default:'';" json:"unit"` //
|
||||||
|
SupplyChainManager *int64 `gorm:"default:0;" json:"supply_chain_manager"` // 供应链负责人
|
||||||
}
|
}
|
||||||
type FsProductModel struct {
|
type FsProductModel struct {
|
||||||
db *gorm.DB
|
db *gorm.DB
|
||||||
|
|||||||
23
model/gmodel/fs_product_history_template_gen.go
Normal file
23
model/gmodel/fs_product_history_template_gen.go
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
package gmodel
|
||||||
|
|
||||||
|
import (
|
||||||
|
"gorm.io/gorm"
|
||||||
|
"time"
|
||||||
|
)
|
||||||
|
|
||||||
|
// fs_product_history_template 模板历史表
|
||||||
|
type FsProductHistoryTemplate struct {
|
||||||
|
Id int64 `gorm:"primary_key;default:0;auto_increment;" json:"id"` //
|
||||||
|
TemplateId *int64 `gorm:"index;default:0;" json:"template_id"` // 模板id
|
||||||
|
TemplateInfo *string `gorm:"default:'';" json:"template_info"` //
|
||||||
|
RelativePublicTemplateId *int64 `gorm:"default:0;" json:"relative_public_template_id"` // 变更之前关联的公共模板id(仅供查看)
|
||||||
|
Ctime *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"ctime"` //
|
||||||
|
}
|
||||||
|
type FsProductHistoryTemplateModel struct {
|
||||||
|
db *gorm.DB
|
||||||
|
name string
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewFsProductHistoryTemplateModel(db *gorm.DB) *FsProductHistoryTemplateModel {
|
||||||
|
return &FsProductHistoryTemplateModel{db: db, name: "fs_product_history_template"}
|
||||||
|
}
|
||||||
@ -11,6 +11,11 @@ func (m *FsProductModel) TableName() string {
|
|||||||
return m.name
|
return m.name
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (t *FsProductModel) FindAll(ctx context.Context) (resp []FsProduct, err error) {
|
||||||
|
err = t.db.WithContext(ctx).Model(&FsProduct{}).Find(&resp).Error
|
||||||
|
return resp, err
|
||||||
|
}
|
||||||
|
|
||||||
func (p *FsProductModel) FindOne(ctx context.Context, id int64, fields ...string) (resp *FsProduct, err error) {
|
func (p *FsProductModel) FindOne(ctx context.Context, id int64, fields ...string) (resp *FsProduct, err error) {
|
||||||
db := p.db.WithContext(ctx).Model(&FsProduct{}).Where("`id` = ? ", id)
|
db := p.db.WithContext(ctx).Model(&FsProduct{}).Where("`id` = ? ", id)
|
||||||
if len(fields) != 0 {
|
if len(fields) != 0 {
|
||||||
@ -88,9 +93,14 @@ func (p *FsProductModel) GetRandomProductList(ctx context.Context, limit int) (r
|
|||||||
Where("`is_del` =? and `is_shelf` = ?", 0, 1).Order("RAND()").Limit(limit).Find(&resp).Error
|
Where("`is_del` =? and `is_shelf` = ?", 0, 1).Order("RAND()").Limit(limit).Find(&resp).Error
|
||||||
return resp, err
|
return resp, err
|
||||||
}
|
}
|
||||||
func (p *FsProductModel) GetIgnoreRandomProductList(ctx context.Context, limit int, notInProductIds []int64) (resp []FsProduct, err error) {
|
func (p *FsProductModel) GetIgnoreRandomProductList(ctx context.Context, notEqType int64, limit int, notInProductIds []int64) (resp []FsProduct, err error) {
|
||||||
err = p.db.WithContext(ctx).Model(&FsProduct{}).
|
db := p.db.WithContext(ctx).Model(&FsProduct{}).
|
||||||
Where("`is_del` =? and `is_shelf` = ? and `id` not in(?)", 0, 1, notInProductIds).Order("RAND()").Limit(limit).Find(&resp).Error
|
//过滤报价单产品
|
||||||
|
Where("`is_del` =? and `is_shelf` = ? and `type` != ?", 0, 1, notEqType)
|
||||||
|
if len(notInProductIds) > 0 {
|
||||||
|
db = db.Where("`id` not in(?)", notInProductIds)
|
||||||
|
}
|
||||||
|
err = db.Order("RAND()").Limit(limit).Find(&resp).Error
|
||||||
return resp, err
|
return resp, err
|
||||||
}
|
}
|
||||||
func (p *FsProductModel) FindAllOnlyByIds(ctx context.Context, ids []int64) (resp []FsProduct, err error) {
|
func (p *FsProductModel) FindAllOnlyByIds(ctx context.Context, ids []int64) (resp []FsProduct, err error) {
|
||||||
|
|||||||
@ -29,7 +29,7 @@ type FsProductModel3d struct {
|
|||||||
IsCloudRender *int64 `gorm:"default:0;" json:"is_cloud_render"` // 是否设置为云渲染模型
|
IsCloudRender *int64 `gorm:"default:0;" json:"is_cloud_render"` // 是否设置为云渲染模型
|
||||||
Utime *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"utime"` //
|
Utime *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"utime"` //
|
||||||
StepPrice *[]byte `gorm:"default:'';" json:"step_price"` //
|
StepPrice *[]byte `gorm:"default:'';" json:"step_price"` //
|
||||||
PackedUnit *int64 `gorm:"default:0;" json:"packed_unit"` // 被打包的数量单位
|
PackedUnit *int64 `gorm:"default:1;" json:"packed_unit"` // 被打包的数量单位
|
||||||
}
|
}
|
||||||
type FsProductModel3dModel struct {
|
type FsProductModel3dModel struct {
|
||||||
db *gorm.DB
|
db *gorm.DB
|
||||||
|
|||||||
@ -2,6 +2,10 @@ package gmodel
|
|||||||
|
|
||||||
import "context"
|
import "context"
|
||||||
|
|
||||||
|
func (t *FsProductModel3dLightModel) FindAll(ctx context.Context) (resp []FsProductModel3dLight, err error) {
|
||||||
|
err = t.db.WithContext(ctx).Model(&FsProductModel3dLight{}).Find(&resp).Error
|
||||||
|
return resp, err
|
||||||
|
}
|
||||||
func (l *FsProductModel3dLightModel) FindOne(ctx context.Context, id int64) (resp *FsProductModel3dLight, err error) {
|
func (l *FsProductModel3dLightModel) FindOne(ctx context.Context, id int64) (resp *FsProductModel3dLight, err error) {
|
||||||
err = l.db.WithContext(ctx).Model(&FsProductModel3dLight{}).Where("`id` = ? and `status` = ?", id, 1).Take(&resp).Error
|
err = l.db.WithContext(ctx).Model(&FsProductModel3dLight{}).Where("`id` = ? and `status` = ?", id, 1).Take(&resp).Error
|
||||||
return resp, err
|
return resp, err
|
||||||
|
|||||||
@ -3,7 +3,6 @@ package gmodel
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"fusenapi/constants"
|
"fusenapi/constants"
|
||||||
"sort"
|
"sort"
|
||||||
@ -20,6 +19,11 @@ type StepPriceJsonStruct struct {
|
|||||||
MinBuyUnitsNum int64 `json:"min_buy_units_num"`
|
MinBuyUnitsNum int64 `json:"min_buy_units_num"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (t *FsProductModel3dModel) FindAll(ctx context.Context) (resp []FsProductModel3d, err error) {
|
||||||
|
err = t.db.WithContext(ctx).Model(&FsProductModel3d{}).Find(&resp).Error
|
||||||
|
return resp, err
|
||||||
|
}
|
||||||
|
|
||||||
func (d *FsProductModel3dModel) FindOne(ctx context.Context, id int64, fields ...string) (resp *FsProductModel3d, err error) {
|
func (d *FsProductModel3dModel) FindOne(ctx context.Context, id int64, fields ...string) (resp *FsProductModel3d, err error) {
|
||||||
db := d.db.WithContext(ctx).Model(&FsProductModel3d{}).Where("`id` = ? and `status` =? ", id, 1)
|
db := d.db.WithContext(ctx).Model(&FsProductModel3d{}).Where("`id` = ? and `status` =? ", id, 1)
|
||||||
if len(fields) > 0 {
|
if len(fields) > 0 {
|
||||||
@ -172,13 +176,8 @@ func (d *FsProductModel3dModel) GetAllByProductIdsTags(ctx context.Context, prod
|
|||||||
return resp, err
|
return resp, err
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取每个产品最低价格
|
// 获取尺寸最低价格
|
||||||
func (d *FsProductModel3dModel) GetProductMinPrice(ctx context.Context, productIds []int64, mapProductMinPrice map[int64]int64) error {
|
func (d *FsProductModel3dModel) GetProductSizeMinPrice(modelList []FsProductModel3d, mapProductSizeMinPrice map[string]int64) error {
|
||||||
//获取产品模型价格列表
|
|
||||||
modelList, err := d.GetAllByProductIdsTags(ctx, productIds, []int{constants.TAG_MODEL, constants.TAG_PARTS}, "id,product_id,price,tag,part_id,step_price")
|
|
||||||
if err != nil {
|
|
||||||
return errors.New("failed to get model list")
|
|
||||||
}
|
|
||||||
mapModelMinPrice := make(map[int64]int64)
|
mapModelMinPrice := make(map[int64]int64)
|
||||||
//每个模型/配件存储最小价格
|
//每个模型/配件存储最小价格
|
||||||
for _, modelInfo := range modelList {
|
for _, modelInfo := range modelList {
|
||||||
@ -189,8 +188,59 @@ func (d *FsProductModel3dModel) GetProductMinPrice(ctx context.Context, productI
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
var stepPrice StepPriceJsonStruct
|
var stepPrice StepPriceJsonStruct
|
||||||
if err = json.Unmarshal(*modelInfo.StepPrice, &stepPrice); err != nil {
|
if err := json.Unmarshal(*modelInfo.StepPrice, &stepPrice); err != nil {
|
||||||
return errors.New(fmt.Sprintf("failed to parse model step price:%d", modelInfo.Id))
|
return fmt.Errorf("failed to parse model step price:%d", modelInfo.Id)
|
||||||
|
}
|
||||||
|
lenRange := len(stepPrice.PriceRange)
|
||||||
|
if lenRange == 0 {
|
||||||
|
mapModelMinPrice[modelInfo.Id] = 0
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
sort.SliceStable(stepPrice.PriceRange, func(i, j int) bool {
|
||||||
|
return stepPrice.PriceRange[i].Price > stepPrice.PriceRange[j].Price
|
||||||
|
})
|
||||||
|
mapModelMinPrice[modelInfo.Id] = stepPrice.PriceRange[lenRange-1].Price
|
||||||
|
case constants.TAG_PARTS: //配件
|
||||||
|
mapModelMinPrice[modelInfo.Id] = *modelInfo.Price
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//给产品存储最小价格
|
||||||
|
for _, v := range modelList {
|
||||||
|
if *v.Tag != constants.TAG_MODEL {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
itemPrice := mapModelMinPrice[v.Id]
|
||||||
|
if *v.PartId > 0 {
|
||||||
|
if fittingPrice, ok := mapModelMinPrice[*v.PartId]; ok {
|
||||||
|
itemPrice += fittingPrice
|
||||||
|
}
|
||||||
|
}
|
||||||
|
key := fmt.Sprintf("%d_%d", *v.ProductId, *v.SizeId)
|
||||||
|
if minPrice, ok := mapProductSizeMinPrice[key]; ok {
|
||||||
|
if itemPrice < minPrice {
|
||||||
|
mapProductSizeMinPrice[key] = itemPrice
|
||||||
|
}
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
mapProductSizeMinPrice[key] = itemPrice
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取每个产品最低价格
|
||||||
|
func (d *FsProductModel3dModel) GetProductMinPrice(modelList []FsProductModel3d, mapProductMinPrice map[int64]int64) error {
|
||||||
|
mapModelMinPrice := make(map[int64]int64)
|
||||||
|
//每个模型/配件存储最小价格
|
||||||
|
for _, modelInfo := range modelList {
|
||||||
|
switch *modelInfo.Tag {
|
||||||
|
case constants.TAG_MODEL: //模型
|
||||||
|
if modelInfo.StepPrice == nil || len(*modelInfo.StepPrice) == 0 {
|
||||||
|
mapModelMinPrice[modelInfo.Id] = 0
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
var stepPrice StepPriceJsonStruct
|
||||||
|
if err := json.Unmarshal(*modelInfo.StepPrice, &stepPrice); err != nil {
|
||||||
|
return fmt.Errorf("failed to parse model step price:%d", modelInfo.Id)
|
||||||
}
|
}
|
||||||
lenRange := len(stepPrice.PriceRange)
|
lenRange := len(stepPrice.PriceRange)
|
||||||
if lenRange == 0 {
|
if lenRange == 0 {
|
||||||
@ -226,3 +276,11 @@ func (d *FsProductModel3dModel) GetProductMinPrice(ctx context.Context, productI
|
|||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
func (d *FsProductModel3dModel) GetAllByProductIdTags(ctx context.Context, productId int64, tags []int64, fields ...string) (resp []FsProductModel3d, err error) {
|
||||||
|
db := d.db.WithContext(ctx).Model(&FsProductModel3d{}).Where("`product_id`= ? and `tag` in(?) and `status` = ?", productId, tags, 1)
|
||||||
|
if len(fields) != 0 {
|
||||||
|
db = db.Select(fields[0])
|
||||||
|
}
|
||||||
|
err = db.Find(&resp).Error
|
||||||
|
return resp, err
|
||||||
|
}
|
||||||
|
|||||||
@ -4,6 +4,11 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func (t *FsProductTemplateTagsModel) FindAll(ctx context.Context) (resp []FsProductTemplateTags, err error) {
|
||||||
|
err = t.db.WithContext(ctx).Model(&FsProductTemplateTags{}).Find(&resp).Error
|
||||||
|
return resp, err
|
||||||
|
}
|
||||||
|
|
||||||
func (pt *FsProductTemplateTagsModel) GetListByIds(ctx context.Context, ids []int64) (resp []FsProductTemplateTags, err error) {
|
func (pt *FsProductTemplateTagsModel) GetListByIds(ctx context.Context, ids []int64) (resp []FsProductTemplateTags, err error) {
|
||||||
if len(ids) == 0 {
|
if len(ids) == 0 {
|
||||||
return
|
return
|
||||||
|
|||||||
@ -11,20 +11,22 @@ type FsProductTemplateV2 struct {
|
|||||||
ModelId *int64 `gorm:"default:0;" json:"model_id"` // 模型ID
|
ModelId *int64 `gorm:"default:0;" json:"model_id"` // 模型ID
|
||||||
Title *string `gorm:"default:'';" json:"title"` // 模板(sku),预留字段
|
Title *string `gorm:"default:'';" json:"title"` // 模板(sku),预留字段
|
||||||
Name *string `gorm:"default:'';" json:"name"` // 名称
|
Name *string `gorm:"default:'';" json:"name"` // 名称
|
||||||
CoverImg *string `gorm:"default:'';" json:"cover_img"` // 模板背景图
|
CoverImg *string `gorm:"default:'';" json:"cover_img"` //
|
||||||
TemplateInfo *string `gorm:"default:'';" json:"template_info"` // 模板详情
|
TemplateInfo *string `gorm:"default:'';" json:"template_info"` // 模板详情
|
||||||
MaterialImg *string `gorm:"default:'';" json:"material_img"` // 合成好的贴图
|
MaterialImg *string `gorm:"default:'';" json:"material_img"` //
|
||||||
Sort *int64 `gorm:"default:0;" json:"sort"` // 排序
|
Sort *int64 `gorm:"default:0;" json:"sort"` // 排序
|
||||||
LogoWidth *int64 `gorm:"default:0;" json:"logo_width"` // logo图最大宽度
|
LogoWidth *int64 `gorm:"default:0;" json:"logo_width"` // logo图最大宽度
|
||||||
LogoHeight *int64 `gorm:"default:0;" json:"logo_height"` // logo图最大高度
|
LogoHeight *int64 `gorm:"default:0;" json:"logo_height"` // logo图最大高度
|
||||||
IsPublic *int64 `gorm:"default:0;" json:"is_public"` // 是否可公用(1:可以,0:不可以)
|
IsPublic *int64 `gorm:"default:0;" json:"is_public"` // 是否可公用(1:可以,0:不可以,仅供模型关联)
|
||||||
|
IsPublicTemplate *int64 `gorm:"default:0;" json:"is_public_template"` // 是否是公共模板0非1是(仅针对模板之间)
|
||||||
|
RelativePublicTemplateId *int64 `gorm:"default:0;" json:"relative_public_template_id"` // 模板间关联的公共模板id
|
||||||
Status *int64 `gorm:"default:0;" json:"status"` // 状态1正常 2异常
|
Status *int64 `gorm:"default:0;" json:"status"` // 状态1正常 2异常
|
||||||
Ctime *int64 `gorm:"default:0;" json:"ctime"` // 添加时间
|
|
||||||
TemplateTag *string `gorm:"default:'';" json:"template_tag"` //
|
TemplateTag *string `gorm:"default:'';" json:"template_tag"` //
|
||||||
IsDel *int64 `gorm:"default:0;" json:"is_del"` // 是否删除 1删除
|
IsDel *int64 `gorm:"default:0;" json:"is_del"` // 是否删除 1删除
|
||||||
SwitchInfo *string `gorm:"default:'';" json:"switch_info"` // 开关信息
|
SwitchInfo *string `gorm:"default:'';" json:"switch_info"` // 开关信息
|
||||||
Version *int64 `gorm:"default:0;" json:"version"` // 默认1
|
Version *int64 `gorm:"default:0;" json:"version"` // 默认1
|
||||||
ElementModelId *int64 `gorm:"default:0;" json:"element_model_id"` // 云渲染对应模型id
|
ElementModelId *int64 `gorm:"default:0;" json:"element_model_id"` // 云渲染对应模型id
|
||||||
|
Ctime *int64 `gorm:"default:0;" json:"ctime"` // 添加时间
|
||||||
}
|
}
|
||||||
type FsProductTemplateV2Model struct {
|
type FsProductTemplateV2Model struct {
|
||||||
db *gorm.DB
|
db *gorm.DB
|
||||||
|
|||||||
@ -4,6 +4,11 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func (t *FsProductTemplateV2Model) FindAll(ctx context.Context) (resp []FsProductTemplateV2, err error) {
|
||||||
|
err = t.db.WithContext(ctx).Model(&FsProductTemplateV2{}).Find(&resp).Error
|
||||||
|
return resp, err
|
||||||
|
}
|
||||||
|
|
||||||
func (t *FsProductTemplateV2Model) FindAllByProductIds(ctx context.Context, productIds []int64, sort string, fields ...string) (resp []FsProductTemplateV2, err error) {
|
func (t *FsProductTemplateV2Model) FindAllByProductIds(ctx context.Context, productIds []int64, sort string, fields ...string) (resp []FsProductTemplateV2, err error) {
|
||||||
if len(productIds) == 0 {
|
if len(productIds) == 0 {
|
||||||
return
|
return
|
||||||
@ -18,15 +23,16 @@ func (t *FsProductTemplateV2Model) FindAllByProductIds(ctx context.Context, prod
|
|||||||
err = db.Find(&resp).Error
|
err = db.Find(&resp).Error
|
||||||
return resp, err
|
return resp, err
|
||||||
}
|
}
|
||||||
func (t *FsProductTemplateV2Model) FindAllByIds(ctx context.Context, ids []int64) (resp []FsProductTemplateV2, err error) {
|
func (t *FsProductTemplateV2Model) FindAllByIds(ctx context.Context, ids []int64, fields ...string) (resp []FsProductTemplateV2, err error) {
|
||||||
if len(ids) == 0 {
|
if len(ids) == 0 {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
err = t.db.WithContext(ctx).Model(&FsProductTemplateV2{}).Where("`id` in (?) and `is_del` = ? and `status` = ?", ids, 0, 1).Find(&resp).Error
|
db := t.db.WithContext(ctx).Model(&FsProductTemplateV2{}).Where("`id` in (?) and `is_del` = ? and `status` = ?", ids, 0, 1)
|
||||||
if err != nil {
|
if len(fields) != 0 {
|
||||||
return nil, err
|
db = db.Select(fields[0])
|
||||||
}
|
}
|
||||||
return
|
err = db.Find(&resp).Error
|
||||||
|
return resp, err
|
||||||
}
|
}
|
||||||
func (t *FsProductTemplateV2Model) FindAllByIdsWithoutStatus(ctx context.Context, ids []int64, fields ...string) (resp []FsProductTemplateV2, err error) {
|
func (t *FsProductTemplateV2Model) FindAllByIdsWithoutStatus(ctx context.Context, ids []int64, fields ...string) (resp []FsProductTemplateV2, err error) {
|
||||||
if len(ids) == 0 {
|
if len(ids) == 0 {
|
||||||
@ -179,3 +185,27 @@ func (t *FsProductTemplateV2Model) FindAllByProductIdsTemplateTag(ctx context.Co
|
|||||||
err = db.Find(&resp).Error
|
err = db.Find(&resp).Error
|
||||||
return resp, err
|
return resp, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取开启云渲染的模板列表
|
||||||
|
func (t *FsProductTemplateV2Model) FindAllCloudRenderTemplateByProductIdsTemplateTag(ctx context.Context, productIds []int64, templateTag string, sort string, fields ...string) (resp []FsProductTemplateV2, err error) {
|
||||||
|
if len(productIds) == 0 {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
db := t.db.WithContext(ctx).Model(&FsProductTemplateV2{}).Where("`product_id` in (?) and `template_tag` = ? and `is_del` = ? and `status` = ? and `element_model_id` > ? ", productIds, templateTag, 0, 1, 0)
|
||||||
|
if sort != "" {
|
||||||
|
db = db.Order(sort)
|
||||||
|
}
|
||||||
|
if len(fields) != 0 {
|
||||||
|
db = db.Select(fields[0])
|
||||||
|
}
|
||||||
|
err = db.Find(&resp).Error
|
||||||
|
return resp, err
|
||||||
|
}
|
||||||
|
func (t *FsProductTemplateV2Model) FindAllByFittingIds(ctx context.Context, fittingIds []int64, fields ...string) (resp []FsProductTemplateV2, err error) {
|
||||||
|
db := t.db.WithContext(ctx).Model(&FsProductTemplateV2{}).Where("`model_id` in(?) and `status` = ? and `is_del` = ? ", fittingIds, 1, 0)
|
||||||
|
if len(fields) != 0 {
|
||||||
|
db = db.Select(fields[0])
|
||||||
|
}
|
||||||
|
err = db.Find(&resp).Error
|
||||||
|
return resp, err
|
||||||
|
}
|
||||||
|
|||||||
@ -11,7 +11,7 @@ type FsQrcode struct {
|
|||||||
TagId *int64 `gorm:"index;default:0;" json:"tag_id"` // 用户id
|
TagId *int64 `gorm:"index;default:0;" json:"tag_id"` // 用户id
|
||||||
ScanTimes *int64 `gorm:"default:0;" json:"scan_times"` // 扫码次数
|
ScanTimes *int64 `gorm:"default:0;" json:"scan_times"` // 扫码次数
|
||||||
CreateAt *int64 `gorm:"default:0;" json:"create_at"` // 添加时间
|
CreateAt *int64 `gorm:"default:0;" json:"create_at"` // 添加时间
|
||||||
Link *string `gorm:"index;default:'';" json:"link"` // 跳转链接
|
Link *string `gorm:"default:'';" json:"link"` //
|
||||||
SvgPath *string `gorm:"default:'';" json:"svg_path"` // svg地址
|
SvgPath *string `gorm:"default:'';" json:"svg_path"` // svg地址
|
||||||
Status *int64 `gorm:"default:1;" json:"status"` // 状态:1:正常 0:下架
|
Status *int64 `gorm:"default:1;" json:"status"` // 状态:1:正常 0:下架
|
||||||
ProductId *int64 `gorm:"default:0;" json:"product_id"` // 0
|
ProductId *int64 `gorm:"default:0;" json:"product_id"` // 0
|
||||||
|
|||||||
@ -36,6 +36,7 @@ type FsShoppingCartData struct {
|
|||||||
// 购物车快照数据结构
|
// 购物车快照数据结构
|
||||||
type CartSnapshot struct {
|
type CartSnapshot struct {
|
||||||
Logo string `json:"logo"` //logo地址
|
Logo string `json:"logo"` //logo地址
|
||||||
|
LogoMaterialMetadata interface{} `json:"logo_material_metadata"` //logo素材信息
|
||||||
CombineImage string `json:"combine_image"` //刀版图地址
|
CombineImage string `json:"combine_image"` //刀版图地址
|
||||||
RenderImage string `json:"render_image"` //渲染结果图
|
RenderImage string `json:"render_image"` //渲染结果图
|
||||||
TemplateInfo TemplateInfo `json:"template_info"` //模板数据
|
TemplateInfo TemplateInfo `json:"template_info"` //模板数据
|
||||||
@ -47,8 +48,13 @@ type CartSnapshot struct {
|
|||||||
LightInfo LightInfo `json:"light_info"` //灯光数据
|
LightInfo LightInfo `json:"light_info"` //灯光数据
|
||||||
}
|
}
|
||||||
type ProductInfo struct {
|
type ProductInfo struct {
|
||||||
ProductName string `json:"product_name"`
|
ProductName string `json:"product_name"` //产品名
|
||||||
ProductSn string `json:"product_sn"`
|
ProductSn string `json:"product_sn"` //产品sn
|
||||||
|
ProductWebsiteUnit ProductWebsiteUnit `json:"product_website_unit"` //产品前台网站单位
|
||||||
|
}
|
||||||
|
type ProductWebsiteUnit struct {
|
||||||
|
Singular string `json:"singular"`
|
||||||
|
Complex string `json:"complex"`
|
||||||
}
|
}
|
||||||
type ModelInfo struct {
|
type ModelInfo struct {
|
||||||
ModelJson interface{} `json:"model_json"` //模型设计json数据
|
ModelJson interface{} `json:"model_json"` //模型设计json数据
|
||||||
@ -59,6 +65,7 @@ type FittingInfo struct {
|
|||||||
|
|
||||||
}
|
}
|
||||||
type TemplateInfo struct {
|
type TemplateInfo struct {
|
||||||
|
SwitchInfo interface{} `json:"switch_info"`
|
||||||
TemplateJson interface{} `json:"template_json"` //模板设计json数据
|
TemplateJson interface{} `json:"template_json"` //模板设计json数据
|
||||||
TemplateTag string `json:"template_tag"` //模板标签
|
TemplateTag string `json:"template_tag"` //模板标签
|
||||||
SelectColorIndex int64 `json:"select_color_index"` //颜色选择索引
|
SelectColorIndex int64 `json:"select_color_index"` //颜色选择索引
|
||||||
@ -106,8 +113,11 @@ func (s *FsShoppingCartModel) Create(ctx context.Context, data *FsShoppingCart)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 删除
|
// 删除
|
||||||
func (s *FsShoppingCartModel) Delete(ctx context.Context, userId, id int64) error {
|
func (s *FsShoppingCartModel) Delete(ctx context.Context, userId int64, ids []int64) error {
|
||||||
return s.db.WithContext(ctx).Model(&FsShoppingCart{}).Where("user_id = ? and id = ?", userId, id).Delete(&FsShoppingCart{}).Error
|
if len(ids) == 0 {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
return s.db.WithContext(ctx).Model(&FsShoppingCart{}).Where("user_id = ? and id in (?)", userId, ids).Delete(&FsShoppingCart{}).Error
|
||||||
}
|
}
|
||||||
|
|
||||||
// 更新
|
// 更新
|
||||||
|
|||||||
@ -11,6 +11,7 @@ type FsStandardLogo struct {
|
|||||||
Image *string `gorm:"default:'';" json:"image"` //
|
Image *string `gorm:"default:'';" json:"image"` //
|
||||||
Ctime *int64 `gorm:"default:0;" json:"ctime"` // 添加时间
|
Ctime *int64 `gorm:"default:0;" json:"ctime"` // 添加时间
|
||||||
Status *int64 `gorm:"default:1;" json:"status"` // 状态 1正常 0删除
|
Status *int64 `gorm:"default:1;" json:"status"` // 状态 1正常 0删除
|
||||||
|
Metadata *[]byte `gorm:"default:'';" json:"metadata"` //
|
||||||
}
|
}
|
||||||
type FsStandardLogoModel struct {
|
type FsStandardLogoModel struct {
|
||||||
db *gorm.DB
|
db *gorm.DB
|
||||||
|
|||||||
@ -1,3 +1,9 @@
|
|||||||
package gmodel
|
package gmodel
|
||||||
|
|
||||||
|
import "context"
|
||||||
|
|
||||||
// TODO: 使用model的属性做你想做的
|
// TODO: 使用model的属性做你想做的
|
||||||
|
func (t *FsToolLogsModel) FindAll(ctx context.Context) (resp []FsToolLogs, err error) {
|
||||||
|
err = t.db.WithContext(ctx).Model(&FsToolLogs{}).Find(&resp).Error
|
||||||
|
return resp, err
|
||||||
|
}
|
||||||
|
|||||||
22
model/gmodel/fs_user_debug_gen.go
Normal file
22
model/gmodel/fs_user_debug_gen.go
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
package gmodel
|
||||||
|
|
||||||
|
import (
|
||||||
|
"gorm.io/gorm"
|
||||||
|
"time"
|
||||||
|
)
|
||||||
|
|
||||||
|
// fs_user_debug 用户debug
|
||||||
|
type FsUserDebug struct {
|
||||||
|
Id int64 `gorm:"primary_key;default:0;auto_increment;" json:"id"` // 用户 ID
|
||||||
|
Metadata *[]byte `gorm:"default:'';" json:"metadata"` //
|
||||||
|
Ctime *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"ctime"` // 时间
|
||||||
|
GuestId *int64 `gorm:"default:0;" json:"guest_id"` //
|
||||||
|
}
|
||||||
|
type FsUserDebugModel struct {
|
||||||
|
db *gorm.DB
|
||||||
|
name string
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewFsUserDebugModel(db *gorm.DB) *FsUserDebugModel {
|
||||||
|
return &FsUserDebugModel{db: db, name: "fs_user_debug"}
|
||||||
|
}
|
||||||
@ -8,7 +8,9 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"fusenapi/utils/fssql"
|
"fusenapi/utils/fssql"
|
||||||
"fusenapi/utils/handlers"
|
"fusenapi/utils/handlers"
|
||||||
|
"log"
|
||||||
|
|
||||||
|
"github.com/tidwall/gjson"
|
||||||
"gorm.io/gorm"
|
"gorm.io/gorm"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -50,7 +52,31 @@ func (m *FsUserInfoModel) MergeMetadata(userId int64, meta any) error {
|
|||||||
return fssql.MetadataModulePATCH(m.db, "profile", FsUserInfo{}, meta, "user_id = ?", userId)
|
return fssql.MetadataModulePATCH(m.db, "profile", FsUserInfo{}, meta, "user_id = ?", userId)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *FsUserInfoModel) GetProfile(ctx context.Context, pkey string, userId int64) (map[string]any, error) {
|
func (m *FsUserInfoModel) getDefaultProfile(ctx context.Context, tname string) (map[string]any, error) {
|
||||||
|
var baseinfo map[string]any
|
||||||
|
condUser := "user_id = 0 and guest_id = 0"
|
||||||
|
rawsql := fmt.Sprintf("select JSON_EXTRACT(metadata,'$') as query from %s where %s and module = 'profile' order by ctime DESC limit 1", tname, condUser)
|
||||||
|
err := m.db.WithContext(ctx).Raw(rawsql).Take(&baseinfo).Error
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
v, ok := baseinfo["query"].(string)
|
||||||
|
if !ok {
|
||||||
|
return nil, fmt.Errorf("default userinfo profile is not exists")
|
||||||
|
}
|
||||||
|
|
||||||
|
var info map[string]any
|
||||||
|
err = json.Unmarshal([]byte(v), &info)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return info, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
var versionML = "2"
|
||||||
|
|
||||||
|
func (m *FsUserInfoModel) GetProfile(ctx context.Context, pkey string, userId int64, guestId int64) (map[string]any, error) {
|
||||||
|
|
||||||
var baseinfo map[string]any
|
var baseinfo map[string]any
|
||||||
tname := fssql.GetGormTableName(m.db, FsUserInfo{})
|
tname := fssql.GetGormTableName(m.db, FsUserInfo{})
|
||||||
@ -61,15 +87,22 @@ func (m *FsUserInfoModel) GetProfile(ctx context.Context, pkey string, userId in
|
|||||||
pkey = "." + pkey
|
pkey = "." + pkey
|
||||||
}
|
}
|
||||||
|
|
||||||
rawsql := fmt.Sprintf("select JSON_EXTRACT(metadata,'$%s') as query from %s where user_id = ? and module = 'profile' order by ctime DESC limit 1", pkey, tname)
|
var condUser string
|
||||||
err := m.db.Raw(rawsql, userId).Take(&baseinfo).Error
|
if userId == 0 {
|
||||||
|
condUser = fmt.Sprintf("user_id = 0 and guest_id = %d", guestId)
|
||||||
|
} else {
|
||||||
|
condUser = fmt.Sprintf("user_id = %d", userId)
|
||||||
|
}
|
||||||
|
|
||||||
|
rawsql := fmt.Sprintf("select JSON_EXTRACT(metadata,'$%s') as query from %s where %s and module = 'profile' order by ctime DESC limit 1", pkey, tname, condUser)
|
||||||
|
err := m.db.WithContext(ctx).Raw(rawsql).Take(&baseinfo).Error
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
v, ok := baseinfo["query"].(string)
|
v, ok := baseinfo["query"].(string)
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, nil
|
return m.getDefaultProfile(ctx, tname)
|
||||||
}
|
}
|
||||||
|
|
||||||
var info map[string]any
|
var info map[string]any
|
||||||
@ -77,11 +110,35 @@ func (m *FsUserInfoModel) GetProfile(ctx context.Context, pkey string, userId in
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(info) == 0 {
|
||||||
|
return m.getDefaultProfile(ctx, tname)
|
||||||
|
}
|
||||||
|
|
||||||
|
if logoSelected := gjson.Get(v, "logo_selected"); logoSelected.Exists() {
|
||||||
|
if ver := logoSelected.Get("template_tag_selected.version"); ver.Exists() && ver.String() == versionML {
|
||||||
|
log.Println(ver)
|
||||||
return info, nil
|
return info, nil
|
||||||
}
|
}
|
||||||
func (m *FsUserInfoModel) FindOneByUser(ctx context.Context, userId, guestId int64) (resp *FsUserInfo, err error) {
|
}
|
||||||
|
|
||||||
|
defaultUserInfo, err := m.getDefaultProfile(ctx, tname)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
info["logo_selected"] = defaultUserInfo["logo_selected"]
|
||||||
|
|
||||||
|
return info, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *FsUserInfoModel) GetDefaultProfile(ctx context.Context) (map[string]any, error) {
|
||||||
|
tname := fssql.GetGormTableName(m.db, FsUserInfo{})
|
||||||
|
return m.getDefaultProfile(ctx, tname)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *FsUserInfoModel) FindOneByUser(ctx context.Context, userId, guestId int64, module string) (resp *FsUserInfo, err error) {
|
||||||
if userId > 0 {
|
if userId > 0 {
|
||||||
err = m.db.WithContext(ctx).Model(&FsUserInfo{}).Where("user_id = ?", userId).Take(&resp).Error
|
err = m.db.WithContext(ctx).Model(&FsUserInfo{}).Where("user_id = ? and module = ?", userId, module).Take(&resp).Error
|
||||||
} else {
|
} else {
|
||||||
err = m.db.WithContext(ctx).Model(&FsUserInfo{}).Where("user_id = ? and guest_id = ?", userId, guestId).Take(&resp).Error
|
err = m.db.WithContext(ctx).Model(&FsUserInfo{}).Where("user_id = ? and guest_id = ?", userId, guestId).Take(&resp).Error
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,6 +15,7 @@ type FsUserMaterial struct {
|
|||||||
ResourceUrl *string `gorm:"default:'';" json:"resource_url"` //
|
ResourceUrl *string `gorm:"default:'';" json:"resource_url"` //
|
||||||
Metadata *[]byte `gorm:"default:'';" json:"metadata"` //
|
Metadata *[]byte `gorm:"default:'';" json:"metadata"` //
|
||||||
Ctime *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"ctime"` // 上传时间
|
Ctime *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"ctime"` // 上传时间
|
||||||
|
LogoId *int64 `gorm:"index;default:0;" json:"logo_id"` // logo库ID
|
||||||
}
|
}
|
||||||
type FsUserMaterialModel struct {
|
type FsUserMaterialModel struct {
|
||||||
db *gorm.DB
|
db *gorm.DB
|
||||||
|
|||||||
24
model/gmodel/fs_zip_code_gen.go
Normal file
24
model/gmodel/fs_zip_code_gen.go
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
package gmodel
|
||||||
|
|
||||||
|
import (
|
||||||
|
"gorm.io/gorm"
|
||||||
|
"time"
|
||||||
|
)
|
||||||
|
|
||||||
|
// fs_zip_code 邮编表
|
||||||
|
type FsZipCode struct {
|
||||||
|
Id int64 `gorm:"primary_key;default:0;auto_increment;" json:"id"` // ID
|
||||||
|
ZipCode *string `gorm:"default:'';" json:"zip_code"` // 邮编
|
||||||
|
Manager *int64 `gorm:"default:0;" json:"manager"` // 负责人
|
||||||
|
Status *int64 `gorm:"default:0;" json:"status"` // 状态 1正常0关闭
|
||||||
|
Ctime *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"ctime"` //
|
||||||
|
Utime *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"utime"` //
|
||||||
|
}
|
||||||
|
type FsZipCodeModel struct {
|
||||||
|
db *gorm.DB
|
||||||
|
name string
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewFsZipCodeModel(db *gorm.DB) *FsZipCodeModel {
|
||||||
|
return &FsZipCodeModel{db: db, name: "fs_zip_code"}
|
||||||
|
}
|
||||||
24
model/gmodel/ldap_apis_gen.go
Normal file
24
model/gmodel/ldap_apis_gen.go
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
package gmodel
|
||||||
|
|
||||||
|
import (
|
||||||
|
"gorm.io/gorm"
|
||||||
|
"time"
|
||||||
|
)
|
||||||
|
|
||||||
|
// ldap_apis api表
|
||||||
|
type LdapApis struct {
|
||||||
|
Id int64 `gorm:"primary_key;default:0;auto_increment;" json:"id"` //
|
||||||
|
Name *string `gorm:"default:'';" json:"name"` //
|
||||||
|
Method *string `gorm:"default:'';" json:"method"` //
|
||||||
|
Path *string `gorm:"default:'';" json:"path"` //
|
||||||
|
Category *string `gorm:"default:'';" json:"category"` //
|
||||||
|
Remark *string `gorm:"default:'';" json:"remark"` //
|
||||||
|
Ctime *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"ctime"` //
|
||||||
|
Utime *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"utime"` //
|
||||||
|
}
|
||||||
|
type LdapApisModel struct {
|
||||||
|
db *gorm.DB
|
||||||
|
name string
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewLdapApisModel(db *gorm.DB) *LdapApisModel { return &LdapApisModel{db: db, name: "ldap_apis"} }
|
||||||
72
model/gmodel/ldap_apis_logic.go
Normal file
72
model/gmodel/ldap_apis_logic.go
Normal file
@ -0,0 +1,72 @@
|
|||||||
|
package gmodel
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"gorm.io/gorm"
|
||||||
|
)
|
||||||
|
|
||||||
|
// TODO: 使用model的属性做你想做的
|
||||||
|
|
||||||
|
type FindPageReq struct {
|
||||||
|
Fields string //筛选的字段
|
||||||
|
Sort string //排序
|
||||||
|
Page int //当前页
|
||||||
|
Limit int //每页数量
|
||||||
|
}
|
||||||
|
|
||||||
|
// FindAll 全部查询
|
||||||
|
func (s *LdapApisModel) FindAll(ctx context.Context, gorm *gorm.DB) (resp []LdapApis, err error) {
|
||||||
|
var db = gorm
|
||||||
|
if gorm == nil {
|
||||||
|
db = s.db.WithContext(ctx).Model(&LdapApis{})
|
||||||
|
} else {
|
||||||
|
db = db.WithContext(ctx).Model(&LdapApis{})
|
||||||
|
}
|
||||||
|
err = db.Find(&resp).Error
|
||||||
|
return resp, err
|
||||||
|
}
|
||||||
|
|
||||||
|
// FindPage 分页查询
|
||||||
|
func (s *LdapApisModel) FindPage(ctx context.Context, req FindPageReq) (resp []LdapApis, total int64, err error) {
|
||||||
|
db := s.db.WithContext(ctx).Model(&LdapApis{})
|
||||||
|
if req.Fields != "" {
|
||||||
|
db = db.Select(req.Fields)
|
||||||
|
}
|
||||||
|
if req.Sort != "" {
|
||||||
|
db = db.Order(req.Sort)
|
||||||
|
}
|
||||||
|
//查询数量
|
||||||
|
if err = db.Limit(1).Count(&total).Error; err != nil {
|
||||||
|
return nil, 0, err
|
||||||
|
}
|
||||||
|
offset := (req.Page - 1) * req.Limit
|
||||||
|
err = db.Offset(offset).Limit(req.Limit).Find(&resp).Error
|
||||||
|
return resp, total, err
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *LdapApisModel) FindOneById(ctx context.Context, id int64) (resp LdapApis, err error) {
|
||||||
|
db := s.db.WithContext(ctx).Model(&LdapApis{}).Where("id = ?", id)
|
||||||
|
|
||||||
|
err = db.Take(&resp).Error
|
||||||
|
return resp, err
|
||||||
|
}
|
||||||
|
|
||||||
|
// InsertOne 单个插入
|
||||||
|
func (s *LdapApisModel) InsertOne(ctx context.Context, insertData LdapApis) error {
|
||||||
|
db := s.db.WithContext(ctx).Model(&LdapApis{})
|
||||||
|
var nowTime = time.Now().UTC()
|
||||||
|
insertData.Ctime = &nowTime
|
||||||
|
insertData.Utime = &nowTime
|
||||||
|
result := db.Create(&insertData)
|
||||||
|
return result.Error
|
||||||
|
}
|
||||||
|
|
||||||
|
// UpdateOne 单个更新
|
||||||
|
func (s *LdapApisModel) UpdateOne(ctx context.Context, model LdapApis, updateData map[string]interface{}) error {
|
||||||
|
db := s.db.WithContext(ctx).Model(&model)
|
||||||
|
updateData["utime"] = time.Now().UTC()
|
||||||
|
result := db.Updates(updateData)
|
||||||
|
return result.Error
|
||||||
|
}
|
||||||
28
model/gmodel/ldap_group_gen.go
Normal file
28
model/gmodel/ldap_group_gen.go
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
package gmodel
|
||||||
|
|
||||||
|
import (
|
||||||
|
"gorm.io/gorm"
|
||||||
|
"time"
|
||||||
|
)
|
||||||
|
|
||||||
|
// ldap_group 权限组表
|
||||||
|
type LdapGroup struct {
|
||||||
|
Id int64 `gorm:"primary_key;default:0;auto_increment;" json:"id"` //
|
||||||
|
Type *string `gorm:"default:'';" json:"type"` //
|
||||||
|
Name *string `gorm:"default:'';" json:"name"` //
|
||||||
|
Keyword *string `gorm:"default:'';" json:"keyword"` //
|
||||||
|
Remark *string `gorm:"default:'';" json:"remark"` //
|
||||||
|
Status *int64 `gorm:"default:1;" json:"status"` // 1正常, 2禁用
|
||||||
|
Sort *int64 `gorm:"default:999;" json:"sort"` // 分组排序(排序越大权限越低, 不能查看比自己序号小的角色, 不能编辑同序号用户权限, 排序为1表示超级管理员)
|
||||||
|
Metadata *[]byte `gorm:"default:'';" json:"metadata"` //
|
||||||
|
Ctime *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"ctime"` //
|
||||||
|
Utime *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"utime"` //
|
||||||
|
}
|
||||||
|
type LdapGroupModel struct {
|
||||||
|
db *gorm.DB
|
||||||
|
name string
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewLdapGroupModel(db *gorm.DB) *LdapGroupModel {
|
||||||
|
return &LdapGroupModel{db: db, name: "ldap_group"}
|
||||||
|
}
|
||||||
65
model/gmodel/ldap_group_logic.go
Normal file
65
model/gmodel/ldap_group_logic.go
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
package gmodel
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"gorm.io/gorm"
|
||||||
|
)
|
||||||
|
|
||||||
|
// TODO: 使用model的属性做你想做的
|
||||||
|
|
||||||
|
// FindAll 全部查询
|
||||||
|
func (s *LdapGroupModel) FindAll(ctx context.Context, gorm *gorm.DB) (resp []LdapGroup, err error) {
|
||||||
|
var db = gorm
|
||||||
|
if gorm == nil {
|
||||||
|
db = s.db.WithContext(ctx).Model(&LdapGroup{})
|
||||||
|
} else {
|
||||||
|
db = db.WithContext(ctx).Model(&LdapGroup{})
|
||||||
|
}
|
||||||
|
err = db.Find(&resp).Error
|
||||||
|
return resp, err
|
||||||
|
}
|
||||||
|
|
||||||
|
// FindPage 分页查询
|
||||||
|
func (s *LdapGroupModel) FindPage(ctx context.Context, req FindPageReq) (resp []LdapGroup, total int64, err error) {
|
||||||
|
db := s.db.WithContext(ctx).Model(&LdapGroup{}).Where("type != ?", "people")
|
||||||
|
if req.Fields != "" {
|
||||||
|
db = db.Select(req.Fields)
|
||||||
|
}
|
||||||
|
if req.Sort != "" {
|
||||||
|
db = db.Order(req.Sort)
|
||||||
|
}
|
||||||
|
//查询数量
|
||||||
|
if err = db.Limit(1).Count(&total).Error; err != nil {
|
||||||
|
return nil, 0, err
|
||||||
|
}
|
||||||
|
offset := (req.Page - 1) * req.Limit
|
||||||
|
err = db.Offset(offset).Limit(req.Limit).Find(&resp).Error
|
||||||
|
return resp, total, err
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *LdapGroupModel) FindOneById(ctx context.Context, id int64) (resp LdapGroup, err error) {
|
||||||
|
db := s.db.WithContext(ctx).Model(&LdapGroup{}).Where("id = ?", id)
|
||||||
|
|
||||||
|
err = db.Take(&resp).Error
|
||||||
|
return resp, err
|
||||||
|
}
|
||||||
|
|
||||||
|
// InsertOne 单个插入
|
||||||
|
func (s *LdapGroupModel) InsertOne(ctx context.Context, insertData LdapGroup) error {
|
||||||
|
db := s.db.WithContext(ctx).Model(&LdapGroup{})
|
||||||
|
var nowTime = time.Now().UTC()
|
||||||
|
insertData.Ctime = &nowTime
|
||||||
|
insertData.Utime = &nowTime
|
||||||
|
result := db.Create(&insertData)
|
||||||
|
return result.Error
|
||||||
|
}
|
||||||
|
|
||||||
|
// UpdateOne 单个更新
|
||||||
|
func (s *LdapGroupModel) UpdateOne(ctx context.Context, model LdapGroup, updateData map[string]interface{}) error {
|
||||||
|
db := s.db.WithContext(ctx).Model(&model)
|
||||||
|
updateData["utime"] = time.Now().UTC()
|
||||||
|
result := db.Updates(updateData)
|
||||||
|
return result.Error
|
||||||
|
}
|
||||||
28
model/gmodel/ldap_menus_gen.go
Normal file
28
model/gmodel/ldap_menus_gen.go
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
package gmodel
|
||||||
|
|
||||||
|
import (
|
||||||
|
"gorm.io/gorm"
|
||||||
|
"time"
|
||||||
|
)
|
||||||
|
|
||||||
|
// ldap_menus 菜单表
|
||||||
|
type LdapMenus struct {
|
||||||
|
Id int64 `gorm:"primary_key;default:0;auto_increment;" json:"id"` //
|
||||||
|
Name *string `gorm:"default:'';" json:"name"` //
|
||||||
|
Title *string `gorm:"default:'';" json:"title"` //
|
||||||
|
Icon *string `gorm:"default:'';" json:"icon"` //
|
||||||
|
Path *string `gorm:"default:'';" json:"path"` //
|
||||||
|
Sort *int64 `gorm:"default:999;" json:"sort"` // 菜单顺序(1-999)
|
||||||
|
Status *int64 `gorm:"default:1;" json:"status"` // 菜单状态(正常/禁用, 默认正常)
|
||||||
|
ParentId *int64 `gorm:"default:0;" json:"parent_id"` // 父菜单编号(编号为0时表示根菜单)
|
||||||
|
Ctime *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"ctime"` //
|
||||||
|
Utime *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"utime"` //
|
||||||
|
}
|
||||||
|
type LdapMenusModel struct {
|
||||||
|
db *gorm.DB
|
||||||
|
name string
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewLdapMenusModel(db *gorm.DB) *LdapMenusModel {
|
||||||
|
return &LdapMenusModel{db: db, name: "ldap_menus"}
|
||||||
|
}
|
||||||
63
model/gmodel/ldap_menus_logic.go
Normal file
63
model/gmodel/ldap_menus_logic.go
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
package gmodel
|
||||||
|
|
||||||
|
import "context"
|
||||||
|
|
||||||
|
// TODO: 使用model的属性做你想做的
|
||||||
|
func (m *LdapMenusModel) Create(ctx context.Context, data *LdapMenus) error {
|
||||||
|
return m.db.WithContext(ctx).Model(&LdapMenus{}).Create(&data).Error
|
||||||
|
}
|
||||||
|
func (m *LdapMenusModel) FindOne(ctx context.Context, id int64) (resp *LdapMenus, err error) {
|
||||||
|
err = m.db.WithContext(ctx).Model(&LdapMenus{}).Where("id= ? and status = ?", id, 1).Take(&resp).Error
|
||||||
|
return resp, err
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *LdapMenusModel) FindByPath(ctx context.Context, path string) (resp *LdapMenus, err error) {
|
||||||
|
err = m.db.WithContext(ctx).Model(&LdapMenus{}).Where("path= ? and status = ?", path, 1).Take(&resp).Error
|
||||||
|
return resp, err
|
||||||
|
}
|
||||||
|
func (m *LdapMenusModel) Update(ctx context.Context, id int64, data *LdapMenus) error {
|
||||||
|
return m.db.WithContext(ctx).Model(&LdapMenus{}).Where("id = ?", id).Updates(&data).Error
|
||||||
|
}
|
||||||
|
|
||||||
|
type GetMenuListByParamReq struct {
|
||||||
|
Ids []int64
|
||||||
|
Name string
|
||||||
|
Title string
|
||||||
|
Path string
|
||||||
|
Status *int64
|
||||||
|
ParentId *int64
|
||||||
|
Sort string
|
||||||
|
Page int
|
||||||
|
Limit int
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *LdapMenusModel) GetMenuListByParam(ctx context.Context, req GetMenuListByParamReq) (resp []LdapMenus, total int64, err error) {
|
||||||
|
db := m.db.WithContext(ctx).Model(&LdapMenus{})
|
||||||
|
if len(req.Ids) > 0 {
|
||||||
|
db = db.Where("id in(?)", req.Ids)
|
||||||
|
}
|
||||||
|
if req.Name != "" {
|
||||||
|
db = db.Where("name like ?", "%"+req.Name+"%")
|
||||||
|
}
|
||||||
|
if req.Title != "" {
|
||||||
|
db = db.Where("title like ?", "%"+req.Title+"%")
|
||||||
|
}
|
||||||
|
if req.Name != "" {
|
||||||
|
db = db.Where("path like ?", "%"+req.Path+"%")
|
||||||
|
}
|
||||||
|
if req.Status != nil {
|
||||||
|
db = db.Where("status = ?", req.Status)
|
||||||
|
}
|
||||||
|
if req.ParentId != nil {
|
||||||
|
db = db.Where("parent_id = ?", req.ParentId)
|
||||||
|
}
|
||||||
|
if req.Sort != "" {
|
||||||
|
db = db.Order(req.Sort)
|
||||||
|
}
|
||||||
|
if err = db.Count(&total).Error; err != nil {
|
||||||
|
return nil, 0, err
|
||||||
|
}
|
||||||
|
offset := (req.Page - 1) * req.Limit
|
||||||
|
err = db.Offset(offset).Limit(req.Limit).Find(&resp).Error
|
||||||
|
return resp, total, err
|
||||||
|
}
|
||||||
20
model/gmodel/ldap_user_gen.go
Normal file
20
model/gmodel/ldap_user_gen.go
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
package gmodel
|
||||||
|
|
||||||
|
import (
|
||||||
|
"gorm.io/gorm"
|
||||||
|
"time"
|
||||||
|
)
|
||||||
|
|
||||||
|
// ldap_user ldap_用户id递增表
|
||||||
|
type LdapUser struct {
|
||||||
|
Id int64 `gorm:"primary_key;default:0;auto_increment;" json:"id"` //
|
||||||
|
UserDn *string `gorm:"index;default:'';" json:"user_dn"` //
|
||||||
|
Ctime *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"ctime"` //
|
||||||
|
Utime *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"utime"` //
|
||||||
|
}
|
||||||
|
type LdapUserModel struct {
|
||||||
|
db *gorm.DB
|
||||||
|
name string
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewLdapUserModel(db *gorm.DB) *LdapUserModel { return &LdapUserModel{db: db, name: "ldap_user"} }
|
||||||
27
model/gmodel/ldap_user_logic.go
Normal file
27
model/gmodel/ldap_user_logic.go
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
package gmodel
|
||||||
|
|
||||||
|
import "context"
|
||||||
|
|
||||||
|
// TODO: 使用model的属性做你想做的
|
||||||
|
func (u *LdapUserModel) Create(ctx context.Context, data *LdapUser) error {
|
||||||
|
return u.db.WithContext(ctx).Model(&LdapUser{}).Create(&data).Error
|
||||||
|
}
|
||||||
|
func (u *LdapUserModel) Update(ctx context.Context, userDN string, data *LdapUser) error {
|
||||||
|
return u.db.WithContext(ctx).Model(&LdapUser{}).Where("user_dn = ?", userDN).Updates(&data).Error
|
||||||
|
}
|
||||||
|
|
||||||
|
func (u *LdapUserModel) UpdateById(ctx context.Context, id int64, data *LdapUser) error {
|
||||||
|
return u.db.WithContext(ctx).Model(&LdapUser{}).Where("id = ?", id).Updates(&data).Error
|
||||||
|
}
|
||||||
|
|
||||||
|
func (u *LdapUserModel) Delete(ctx context.Context, id int64) error {
|
||||||
|
return u.db.WithContext(ctx).Model(&LdapUser{}).Where("id = ?", id).Delete(&LdapUser{}).Error
|
||||||
|
}
|
||||||
|
|
||||||
|
func (u *LdapUserModel) GetAllByIds(ctx context.Context, ids []int64) (resp []LdapUser, err error) {
|
||||||
|
if len(ids) == 0 {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err = u.db.WithContext(ctx).Model(&LdapUser{}).Where("id in (?)", ids).Find(&resp).Error
|
||||||
|
return resp, err
|
||||||
|
}
|
||||||
@ -4,14 +4,8 @@ import "gorm.io/gorm"
|
|||||||
|
|
||||||
// AllModelsGen 所有Model集合,修改单行,只要不改字段名,不会根据新的内容修改,需要修改的话手动删除
|
// AllModelsGen 所有Model集合,修改单行,只要不改字段名,不会根据新的内容修改,需要修改的话手动删除
|
||||||
type AllModelsGen struct {
|
type AllModelsGen struct {
|
||||||
CasbinRule *CasbinRuleModel // casbin_rule 后台--权限规则表
|
CasbinRule *CasbinRuleModel // casbin_rule
|
||||||
FsAddress *FsAddressModel // fs_address 用户地址表
|
FsAddress *FsAddressModel // fs_address 用户地址表
|
||||||
FsAdminApi *FsAdminApiModel // fs_admin_api 后台--接口表
|
|
||||||
FsAdminDepartment *FsAdminDepartmentModel // fs_admin_department 后台--部门表
|
|
||||||
FsAdminMenu *FsAdminMenuModel // fs_admin_menu 后台--菜单表
|
|
||||||
FsAdminRole *FsAdminRoleModel // fs_admin_role 后台--角色表
|
|
||||||
FsAdminRoleApi *FsAdminRoleApiModel // fs_admin_role_api 后台--角色接口表
|
|
||||||
FsAdminUser *FsAdminUserModel // fs_admin_user 后台--管理员表
|
|
||||||
FsAuthAssignment *FsAuthAssignmentModel // fs_auth_assignment 用户角色和权限信息
|
FsAuthAssignment *FsAuthAssignmentModel // fs_auth_assignment 用户角色和权限信息
|
||||||
FsAuthItem *FsAuthItemModel // fs_auth_item 用户角色和权限信息
|
FsAuthItem *FsAuthItemModel // fs_auth_item 用户角色和权限信息
|
||||||
FsAuthItemChild *FsAuthItemChildModel // fs_auth_item_child 角色和权限关系表
|
FsAuthItemChild *FsAuthItemChildModel // fs_auth_item_child 角色和权限关系表
|
||||||
@ -30,7 +24,7 @@ type AllModelsGen struct {
|
|||||||
FsCloudPickUpOld *FsCloudPickUpOldModel // fs_cloud_pick_up_old 云仓提货单
|
FsCloudPickUpOld *FsCloudPickUpOldModel // fs_cloud_pick_up_old 云仓提货单
|
||||||
FsCloudReceiveEveryOld *FsCloudReceiveEveryOldModel // fs_cloud_receive_every_old
|
FsCloudReceiveEveryOld *FsCloudReceiveEveryOldModel // fs_cloud_receive_every_old
|
||||||
FsCloudReceiveOld *FsCloudReceiveOldModel // fs_cloud_receive_old 云仓接收工厂总单
|
FsCloudReceiveOld *FsCloudReceiveOldModel // fs_cloud_receive_old 云仓接收工厂总单
|
||||||
FsCloudRenderLogOld *FsCloudRenderLogOldModel // fs_cloud_render_log_old 云渲染日志表
|
FsCloudRenderLog *FsCloudRenderLogModel // fs_cloud_render_log 云渲染日志表
|
||||||
FsCloudStorage *FsCloudStorageModel // fs_cloud_storage 仓库的基本信息, 只做映射
|
FsCloudStorage *FsCloudStorageModel // fs_cloud_storage 仓库的基本信息, 只做映射
|
||||||
FsCloudStorageStock *FsCloudStorageStockModel // fs_cloud_storage_stock
|
FsCloudStorageStock *FsCloudStorageStockModel // fs_cloud_storage_stock
|
||||||
FsCloudUserApplyBackOld *FsCloudUserApplyBackOldModel // fs_cloud_user_apply_back_old 该表废弃
|
FsCloudUserApplyBackOld *FsCloudUserApplyBackOldModel // fs_cloud_user_apply_back_old 该表废弃
|
||||||
@ -48,6 +42,7 @@ type AllModelsGen struct {
|
|||||||
FsFactoryProduct *FsFactoryProductModel // fs_factory_product 工厂生产表(废弃)
|
FsFactoryProduct *FsFactoryProductModel // fs_factory_product 工厂生产表(废弃)
|
||||||
FsFactoryShipTmp *FsFactoryShipTmpModel // fs_factory_ship_tmp
|
FsFactoryShipTmp *FsFactoryShipTmpModel // fs_factory_ship_tmp
|
||||||
FsFaq *FsFaqModel // fs_faq 常见问题
|
FsFaq *FsFaqModel // fs_faq 常见问题
|
||||||
|
FsFeishuWebhookLog *FsFeishuWebhookLogModel // fs_feishu_webhook_log 飞书webhook记录表
|
||||||
FsFont *FsFontModel // fs_font 字体配置
|
FsFont *FsFontModel // fs_font 字体配置
|
||||||
FsGerent *FsGerentModel // fs_gerent 管理员表
|
FsGerent *FsGerentModel // fs_gerent 管理员表
|
||||||
FsGuest *FsGuestModel // fs_guest 游客表
|
FsGuest *FsGuestModel // fs_guest 游客表
|
||||||
@ -56,22 +51,24 @@ type AllModelsGen struct {
|
|||||||
FsMapLibrary *FsMapLibraryModel // fs_map_library 贴图库
|
FsMapLibrary *FsMapLibraryModel // fs_map_library 贴图库
|
||||||
FsMenu *FsMenuModel // fs_menu 后台菜单
|
FsMenu *FsMenuModel // fs_menu 后台菜单
|
||||||
FsMerchantCategory *FsMerchantCategoryModel // fs_merchant_category 商户类型表
|
FsMerchantCategory *FsMerchantCategoryModel // fs_merchant_category 商户类型表
|
||||||
|
FsMessageLog *FsMessageLogModel // fs_message_log 消息记录表
|
||||||
FsMigration *FsMigrationModel // fs_migration 版本库
|
FsMigration *FsMigrationModel // fs_migration 版本库
|
||||||
FsOrder *FsOrderModel // fs_order 订单表
|
FsOrder *FsOrderModel // fs_order 订单表
|
||||||
FsOrderAffiliateOld *FsOrderAffiliateOldModel // fs_order_affiliate_old 订单附属表-流程控制时间等
|
FsOrderAffiliateOld *FsOrderAffiliateOldModel // fs_order_affiliate_old 订单附属表-流程控制时间等
|
||||||
|
FsOrderCombineImageRecord *FsOrderCombineImageRecordModel // fs_order_combine_image_record 刀版图记录表
|
||||||
FsOrderDetailOld *FsOrderDetailOldModel // fs_order_detail_old 订单详细表
|
FsOrderDetailOld *FsOrderDetailOldModel // fs_order_detail_old 订单详细表
|
||||||
FsOrderDetailTemplateOld *FsOrderDetailTemplateOldModel // fs_order_detail_template_old 订单模板详细表
|
FsOrderDetailTemplateOld *FsOrderDetailTemplateOldModel // fs_order_detail_template_old 订单模板详细表
|
||||||
FsOrderOld *FsOrderOldModel // fs_order_old
|
FsOrderOld *FsOrderOldModel // fs_order_old
|
||||||
FsOrderRemarkOld *FsOrderRemarkOldModel // fs_order_remark_old 订单备注表
|
FsOrderRemarkOld *FsOrderRemarkOldModel // fs_order_remark_old 订单备注表
|
||||||
FsOrderTrade *FsOrderTradeModel // fs_order_trade 订单交易表
|
FsOrderTrade *FsOrderTradeModel // fs_order_trade 订单交易表
|
||||||
FsOrderTradeEvent *FsOrderTradeEventModel // fs_order_trade_event 订单交易事件表
|
FsOrderTradeEvent *FsOrderTradeEventModel // fs_order_trade_event 订单交易事件表
|
||||||
FsPay *FsPayModel // fs_pay 支付记录
|
FsPreprocessLogo *FsPreprocessLogoModel // fs_preprocess_logo logo数据表
|
||||||
FsPayEvent *FsPayEventModel // fs_pay_event 支付回调事件日志
|
|
||||||
FsProduct *FsProductModel // fs_product 产品表
|
FsProduct *FsProductModel // fs_product 产品表
|
||||||
FsProductCollection *FsProductCollectionModel // fs_product_collection 产品收藏表
|
FsProductCollection *FsProductCollectionModel // fs_product_collection 产品收藏表
|
||||||
FsProductCopy1 *FsProductCopy1Model // fs_product_copy1 产品表
|
FsProductCopy1 *FsProductCopy1Model // fs_product_copy1 产品表
|
||||||
FsProductDesign *FsProductDesignModel // fs_product_design 产品设计表
|
FsProductDesign *FsProductDesignModel // fs_product_design 产品设计表
|
||||||
FsProductDesignGather *FsProductDesignGatherModel // fs_product_design_gather
|
FsProductDesignGather *FsProductDesignGatherModel // fs_product_design_gather
|
||||||
|
FsProductHistoryTemplate *FsProductHistoryTemplateModel // fs_product_history_template 模板历史表
|
||||||
FsProductModel3d *FsProductModel3dModel // fs_product_model3d 产品模型表
|
FsProductModel3d *FsProductModel3dModel // fs_product_model3d 产品模型表
|
||||||
FsProductModel3dLight *FsProductModel3dLightModel // fs_product_model3d_light 模型-灯光组表
|
FsProductModel3dLight *FsProductModel3dLightModel // fs_product_model3d_light 模型-灯光组表
|
||||||
FsProductOption *FsProductOptionModel // fs_product_option 产品选项表(已废弃)
|
FsProductOption *FsProductOptionModel // fs_product_option 产品选项表(已废弃)
|
||||||
@ -83,7 +80,6 @@ type AllModelsGen struct {
|
|||||||
FsProductTemplate *FsProductTemplateModel // fs_product_template 产品模板表(已废弃)
|
FsProductTemplate *FsProductTemplateModel // fs_product_template 产品模板表(已废弃)
|
||||||
FsProductTemplateBasemap *FsProductTemplateBasemapModel // fs_product_template_basemap 模板底图表
|
FsProductTemplateBasemap *FsProductTemplateBasemapModel // fs_product_template_basemap 模板底图表
|
||||||
FsProductTemplateElement *FsProductTemplateElementModel // fs_product_template_element 云渲染配置表
|
FsProductTemplateElement *FsProductTemplateElementModel // fs_product_template_element 云渲染配置表
|
||||||
FsProductTemplateElement22 *FsProductTemplateElement22Model // fs_product_template_element_22
|
|
||||||
FsProductTemplateTags *FsProductTemplateTagsModel // fs_product_template_tags 模板标签表
|
FsProductTemplateTags *FsProductTemplateTagsModel // fs_product_template_tags 模板标签表
|
||||||
FsProductTemplateV2 *FsProductTemplateV2Model // fs_product_template_v2 产品-模型- 模板表
|
FsProductTemplateV2 *FsProductTemplateV2Model // fs_product_template_v2 产品-模型- 模板表
|
||||||
FsProductV2Tmp *FsProductV2TmpModel // fs_product_v2_tmp 产品表
|
FsProductV2Tmp *FsProductV2TmpModel // fs_product_v2_tmp 产品表
|
||||||
@ -107,11 +103,16 @@ type AllModelsGen struct {
|
|||||||
FsToolUser *FsToolUserModel // fs_tool_user 3d设计工具用户表
|
FsToolUser *FsToolUserModel // fs_tool_user 3d设计工具用户表
|
||||||
FsTrade *FsTradeModel // fs_trade
|
FsTrade *FsTradeModel // fs_trade
|
||||||
FsUser *FsUserModel // fs_user 用户表
|
FsUser *FsUserModel // fs_user 用户表
|
||||||
FsUserDesign *FsUserDesignModel // fs_user_design 废弃表
|
FsUserDebug *FsUserDebugModel // fs_user_debug 用户debug
|
||||||
FsUserInfo *FsUserInfoModel // fs_user_info 用户信息表
|
FsUserInfo *FsUserInfoModel // fs_user_info 用户信息表
|
||||||
FsUserMaterial *FsUserMaterialModel // fs_user_material 用户素材表
|
FsUserMaterial *FsUserMaterialModel // fs_user_material 用户素材表
|
||||||
FsUserStock *FsUserStockModel // fs_user_stock 用户云仓库存
|
FsUserStock *FsUserStockModel // fs_user_stock 用户云仓库存
|
||||||
FsWebSet *FsWebSetModel // fs_web_set 网站配置表
|
FsWebSet *FsWebSetModel // fs_web_set 网站配置表
|
||||||
|
FsZipCode *FsZipCodeModel // fs_zip_code 邮编表
|
||||||
|
LdapApis *LdapApisModel // ldap_apis api表
|
||||||
|
LdapGroup *LdapGroupModel // ldap_group 权限组表
|
||||||
|
LdapMenus *LdapMenusModel // ldap_menus 菜单表
|
||||||
|
LdapUser *LdapUserModel // ldap_user ldap_用户id递增表
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -119,12 +120,6 @@ func NewAllModels(gdb *gorm.DB) *AllModelsGen {
|
|||||||
models := &AllModelsGen{
|
models := &AllModelsGen{
|
||||||
CasbinRule: NewCasbinRuleModel(gdb),
|
CasbinRule: NewCasbinRuleModel(gdb),
|
||||||
FsAddress: NewFsAddressModel(gdb),
|
FsAddress: NewFsAddressModel(gdb),
|
||||||
FsAdminApi: NewFsAdminApiModel(gdb),
|
|
||||||
FsAdminDepartment: NewFsAdminDepartmentModel(gdb),
|
|
||||||
FsAdminMenu: NewFsAdminMenuModel(gdb),
|
|
||||||
FsAdminRole: NewFsAdminRoleModel(gdb),
|
|
||||||
FsAdminRoleApi: NewFsAdminRoleApiModel(gdb),
|
|
||||||
FsAdminUser: NewFsAdminUserModel(gdb),
|
|
||||||
FsAuthAssignment: NewFsAuthAssignmentModel(gdb),
|
FsAuthAssignment: NewFsAuthAssignmentModel(gdb),
|
||||||
FsAuthItem: NewFsAuthItemModel(gdb),
|
FsAuthItem: NewFsAuthItemModel(gdb),
|
||||||
FsAuthItemChild: NewFsAuthItemChildModel(gdb),
|
FsAuthItemChild: NewFsAuthItemChildModel(gdb),
|
||||||
@ -143,7 +138,7 @@ func NewAllModels(gdb *gorm.DB) *AllModelsGen {
|
|||||||
FsCloudPickUpOld: NewFsCloudPickUpOldModel(gdb),
|
FsCloudPickUpOld: NewFsCloudPickUpOldModel(gdb),
|
||||||
FsCloudReceiveEveryOld: NewFsCloudReceiveEveryOldModel(gdb),
|
FsCloudReceiveEveryOld: NewFsCloudReceiveEveryOldModel(gdb),
|
||||||
FsCloudReceiveOld: NewFsCloudReceiveOldModel(gdb),
|
FsCloudReceiveOld: NewFsCloudReceiveOldModel(gdb),
|
||||||
FsCloudRenderLogOld: NewFsCloudRenderLogOldModel(gdb),
|
FsCloudRenderLog: NewFsCloudRenderLogModel(gdb),
|
||||||
FsCloudStorage: NewFsCloudStorageModel(gdb),
|
FsCloudStorage: NewFsCloudStorageModel(gdb),
|
||||||
FsCloudStorageStock: NewFsCloudStorageStockModel(gdb),
|
FsCloudStorageStock: NewFsCloudStorageStockModel(gdb),
|
||||||
FsCloudUserApplyBackOld: NewFsCloudUserApplyBackOldModel(gdb),
|
FsCloudUserApplyBackOld: NewFsCloudUserApplyBackOldModel(gdb),
|
||||||
@ -161,6 +156,7 @@ func NewAllModels(gdb *gorm.DB) *AllModelsGen {
|
|||||||
FsFactoryProduct: NewFsFactoryProductModel(gdb),
|
FsFactoryProduct: NewFsFactoryProductModel(gdb),
|
||||||
FsFactoryShipTmp: NewFsFactoryShipTmpModel(gdb),
|
FsFactoryShipTmp: NewFsFactoryShipTmpModel(gdb),
|
||||||
FsFaq: NewFsFaqModel(gdb),
|
FsFaq: NewFsFaqModel(gdb),
|
||||||
|
FsFeishuWebhookLog: NewFsFeishuWebhookLogModel(gdb),
|
||||||
FsFont: NewFsFontModel(gdb),
|
FsFont: NewFsFontModel(gdb),
|
||||||
FsGerent: NewFsGerentModel(gdb),
|
FsGerent: NewFsGerentModel(gdb),
|
||||||
FsGuest: NewFsGuestModel(gdb),
|
FsGuest: NewFsGuestModel(gdb),
|
||||||
@ -169,22 +165,24 @@ func NewAllModels(gdb *gorm.DB) *AllModelsGen {
|
|||||||
FsMapLibrary: NewFsMapLibraryModel(gdb),
|
FsMapLibrary: NewFsMapLibraryModel(gdb),
|
||||||
FsMenu: NewFsMenuModel(gdb),
|
FsMenu: NewFsMenuModel(gdb),
|
||||||
FsMerchantCategory: NewFsMerchantCategoryModel(gdb),
|
FsMerchantCategory: NewFsMerchantCategoryModel(gdb),
|
||||||
|
FsMessageLog: NewFsMessageLogModel(gdb),
|
||||||
FsMigration: NewFsMigrationModel(gdb),
|
FsMigration: NewFsMigrationModel(gdb),
|
||||||
FsOrder: NewFsOrderModel(gdb),
|
FsOrder: NewFsOrderModel(gdb),
|
||||||
FsOrderAffiliateOld: NewFsOrderAffiliateOldModel(gdb),
|
FsOrderAffiliateOld: NewFsOrderAffiliateOldModel(gdb),
|
||||||
|
FsOrderCombineImageRecord: NewFsOrderCombineImageRecordModel(gdb),
|
||||||
FsOrderDetailOld: NewFsOrderDetailOldModel(gdb),
|
FsOrderDetailOld: NewFsOrderDetailOldModel(gdb),
|
||||||
FsOrderDetailTemplateOld: NewFsOrderDetailTemplateOldModel(gdb),
|
FsOrderDetailTemplateOld: NewFsOrderDetailTemplateOldModel(gdb),
|
||||||
FsOrderOld: NewFsOrderOldModel(gdb),
|
FsOrderOld: NewFsOrderOldModel(gdb),
|
||||||
FsOrderRemarkOld: NewFsOrderRemarkOldModel(gdb),
|
FsOrderRemarkOld: NewFsOrderRemarkOldModel(gdb),
|
||||||
FsOrderTrade: NewFsOrderTradeModel(gdb),
|
FsOrderTrade: NewFsOrderTradeModel(gdb),
|
||||||
FsOrderTradeEvent: NewFsOrderTradeEventModel(gdb),
|
FsOrderTradeEvent: NewFsOrderTradeEventModel(gdb),
|
||||||
FsPay: NewFsPayModel(gdb),
|
FsPreprocessLogo: NewFsPreprocessLogoModel(gdb),
|
||||||
FsPayEvent: NewFsPayEventModel(gdb),
|
|
||||||
FsProduct: NewFsProductModel(gdb),
|
FsProduct: NewFsProductModel(gdb),
|
||||||
FsProductCollection: NewFsProductCollectionModel(gdb),
|
FsProductCollection: NewFsProductCollectionModel(gdb),
|
||||||
FsProductCopy1: NewFsProductCopy1Model(gdb),
|
FsProductCopy1: NewFsProductCopy1Model(gdb),
|
||||||
FsProductDesign: NewFsProductDesignModel(gdb),
|
FsProductDesign: NewFsProductDesignModel(gdb),
|
||||||
FsProductDesignGather: NewFsProductDesignGatherModel(gdb),
|
FsProductDesignGather: NewFsProductDesignGatherModel(gdb),
|
||||||
|
FsProductHistoryTemplate: NewFsProductHistoryTemplateModel(gdb),
|
||||||
FsProductModel3d: NewFsProductModel3dModel(gdb),
|
FsProductModel3d: NewFsProductModel3dModel(gdb),
|
||||||
FsProductModel3dLight: NewFsProductModel3dLightModel(gdb),
|
FsProductModel3dLight: NewFsProductModel3dLightModel(gdb),
|
||||||
FsProductOption: NewFsProductOptionModel(gdb),
|
FsProductOption: NewFsProductOptionModel(gdb),
|
||||||
@ -196,7 +194,6 @@ func NewAllModels(gdb *gorm.DB) *AllModelsGen {
|
|||||||
FsProductTemplate: NewFsProductTemplateModel(gdb),
|
FsProductTemplate: NewFsProductTemplateModel(gdb),
|
||||||
FsProductTemplateBasemap: NewFsProductTemplateBasemapModel(gdb),
|
FsProductTemplateBasemap: NewFsProductTemplateBasemapModel(gdb),
|
||||||
FsProductTemplateElement: NewFsProductTemplateElementModel(gdb),
|
FsProductTemplateElement: NewFsProductTemplateElementModel(gdb),
|
||||||
FsProductTemplateElement22: NewFsProductTemplateElement22Model(gdb),
|
|
||||||
FsProductTemplateTags: NewFsProductTemplateTagsModel(gdb),
|
FsProductTemplateTags: NewFsProductTemplateTagsModel(gdb),
|
||||||
FsProductTemplateV2: NewFsProductTemplateV2Model(gdb),
|
FsProductTemplateV2: NewFsProductTemplateV2Model(gdb),
|
||||||
FsProductV2Tmp: NewFsProductV2TmpModel(gdb),
|
FsProductV2Tmp: NewFsProductV2TmpModel(gdb),
|
||||||
@ -220,11 +217,16 @@ func NewAllModels(gdb *gorm.DB) *AllModelsGen {
|
|||||||
FsToolUser: NewFsToolUserModel(gdb),
|
FsToolUser: NewFsToolUserModel(gdb),
|
||||||
FsTrade: NewFsTradeModel(gdb),
|
FsTrade: NewFsTradeModel(gdb),
|
||||||
FsUser: NewFsUserModel(gdb),
|
FsUser: NewFsUserModel(gdb),
|
||||||
FsUserDesign: NewFsUserDesignModel(gdb),
|
FsUserDebug: NewFsUserDebugModel(gdb),
|
||||||
FsUserInfo: NewFsUserInfoModel(gdb),
|
FsUserInfo: NewFsUserInfoModel(gdb),
|
||||||
FsUserMaterial: NewFsUserMaterialModel(gdb),
|
FsUserMaterial: NewFsUserMaterialModel(gdb),
|
||||||
FsUserStock: NewFsUserStockModel(gdb),
|
FsUserStock: NewFsUserStockModel(gdb),
|
||||||
FsWebSet: NewFsWebSetModel(gdb),
|
FsWebSet: NewFsWebSetModel(gdb),
|
||||||
|
FsZipCode: NewFsZipCodeModel(gdb),
|
||||||
|
LdapApis: NewLdapApisModel(gdb),
|
||||||
|
LdapGroup: NewLdapGroupModel(gdb),
|
||||||
|
LdapMenus: NewLdapMenusModel(gdb),
|
||||||
|
LdapUser: NewLdapUserModel(gdb),
|
||||||
}
|
}
|
||||||
return models
|
return models
|
||||||
}
|
}
|
||||||
|
|||||||
@ -100,7 +100,7 @@ func main() {
|
|||||||
indexHtmlPath := vueBuild + "/index.html"
|
indexHtmlPath := vueBuild + "/index.html"
|
||||||
mux.Handle("/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
mux.Handle("/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||||
if strings.HasPrefix(r.URL.Path, "/api/") {
|
if strings.HasPrefix(r.URL.Path, "/api/") {
|
||||||
r.ParseMultipartForm(100 << 20)
|
r.ParseMultipartForm(500 << 20)
|
||||||
// 对/api开头的请求进行反向代理
|
// 对/api开头的请求进行反向代理
|
||||||
proxy := httputil.NewSingleHostReverseProxy(apiURL)
|
proxy := httputil.NewSingleHostReverseProxy(apiURL)
|
||||||
proxy.ServeHTTP(w, r)
|
proxy.ServeHTTP(w, r)
|
||||||
@ -179,14 +179,14 @@ func NewBackend(mux *http.ServeMux, httpAddress string, muxPaths ...string) *Bac
|
|||||||
client := &http.Client{
|
client := &http.Client{
|
||||||
Transport: &http.Transport{
|
Transport: &http.Transport{
|
||||||
DialContext: (&net.Dialer{
|
DialContext: (&net.Dialer{
|
||||||
Timeout: 300 * time.Second,
|
Timeout: 1500 * time.Second,
|
||||||
KeepAlive: 60 * time.Second,
|
KeepAlive: 120 * time.Second,
|
||||||
}).DialContext,
|
}).DialContext,
|
||||||
ForceAttemptHTTP2: true,
|
ForceAttemptHTTP2: true,
|
||||||
MaxIdleConns: 100,
|
MaxIdleConns: 200,
|
||||||
MaxIdleConnsPerHost: 100,
|
MaxIdleConnsPerHost: 200,
|
||||||
IdleConnTimeout: 300 * time.Second,
|
IdleConnTimeout: 600 * time.Second,
|
||||||
TLSHandshakeTimeout: 300 * time.Second,
|
TLSHandshakeTimeout: 600 * time.Second,
|
||||||
ExpectContinueTimeout: 1 * time.Second,
|
ExpectContinueTimeout: 1 * time.Second,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@ -13,6 +13,9 @@ Auth:
|
|||||||
AccessExpire: 2592000
|
AccessExpire: 2592000
|
||||||
RefreshAfter: 1592000
|
RefreshAfter: 1592000
|
||||||
|
|
||||||
|
Debug:
|
||||||
|
Password: "fusen-test-pwd"
|
||||||
|
|
||||||
OAuth:
|
OAuth:
|
||||||
google:
|
google:
|
||||||
appid: "1064842923358-e94msq2glj6qr4lrva9ts3hqjjt53q8h.apps.googleusercontent.com"
|
appid: "1064842923358-e94msq2glj6qr4lrva9ts3hqjjt53q8h.apps.googleusercontent.com"
|
||||||
|
|||||||
@ -16,6 +16,11 @@ type Config struct {
|
|||||||
MainAddress string
|
MainAddress string
|
||||||
WebsocketAddr string
|
WebsocketAddr string
|
||||||
|
|
||||||
|
Debug struct {
|
||||||
|
Password string
|
||||||
|
}
|
||||||
|
// Password: "fusen-test-pwd"
|
||||||
|
|
||||||
OAuth struct {
|
OAuth struct {
|
||||||
Google struct {
|
Google struct {
|
||||||
Appid string
|
Appid string
|
||||||
|
|||||||
@ -27,6 +27,11 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
|
|||||||
Path: "/api/auth/accept-cookie",
|
Path: "/api/auth/accept-cookie",
|
||||||
Handler: AcceptCookieHandler(serverCtx),
|
Handler: AcceptCookieHandler(serverCtx),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
Method: http.MethodPost,
|
||||||
|
Path: "/api/auth/debug/token/create",
|
||||||
|
Handler: UserDebugTokenHandler(serverCtx),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
Method: http.MethodGet,
|
Method: http.MethodGet,
|
||||||
Path: "/api/auth/oauth2/login/google",
|
Path: "/api/auth/oauth2/login/google",
|
||||||
|
|||||||
35
server/auth/internal/handler/userdebugtokenhandler.go
Normal file
35
server/auth/internal/handler/userdebugtokenhandler.go
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
package handler
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net/http"
|
||||||
|
"reflect"
|
||||||
|
|
||||||
|
"fusenapi/utils/basic"
|
||||||
|
|
||||||
|
"fusenapi/server/auth/internal/logic"
|
||||||
|
"fusenapi/server/auth/internal/svc"
|
||||||
|
"fusenapi/server/auth/internal/types"
|
||||||
|
)
|
||||||
|
|
||||||
|
func UserDebugTokenHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||||
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
|
var req types.RequestUserDebug
|
||||||
|
userinfo, err := basic.RequestParse(w, r, svcCtx, &req)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 创建一个业务逻辑层实例
|
||||||
|
l := logic.NewUserDebugTokenLogic(r.Context(), svcCtx)
|
||||||
|
|
||||||
|
rl := reflect.ValueOf(l)
|
||||||
|
basic.BeforeLogic(w, r, rl)
|
||||||
|
|
||||||
|
resp := l.UserDebugToken(&req, userinfo)
|
||||||
|
|
||||||
|
if !basic.AfterLogic(w, r, rl, resp) {
|
||||||
|
basic.NormalAfterLogic(w, r, resp)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -36,7 +36,7 @@ func (l *DebugAuthDeleteLogic) DebugAuthDelete(req *types.RequestAuthDelete, use
|
|||||||
|
|
||||||
err := l.svcCtx.AllModels.FsUser.DebugAuthDelete(l.ctx, req.Email)
|
err := l.svcCtx.AllModels.FsUser.DebugAuthDelete(l.ctx, req.Email)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return resp.SetStatus(basic.CodeDbSqlErr, err.Error())
|
return resp.SetStatus(basic.CodeDbSqlErr, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
return resp.SetStatus(basic.CodeOK)
|
return resp.SetStatus(basic.CodeOK)
|
||||||
|
|||||||
63
server/auth/internal/logic/userdebugtokenlogic.go
Normal file
63
server/auth/internal/logic/userdebugtokenlogic.go
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
package logic
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fusenapi/utils/auth"
|
||||||
|
"fusenapi/utils/basic"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"context"
|
||||||
|
|
||||||
|
"fusenapi/server/auth/internal/svc"
|
||||||
|
"fusenapi/server/auth/internal/types"
|
||||||
|
|
||||||
|
"github.com/zeromicro/go-zero/core/logx"
|
||||||
|
)
|
||||||
|
|
||||||
|
type UserDebugTokenLogic struct {
|
||||||
|
logx.Logger
|
||||||
|
ctx context.Context
|
||||||
|
svcCtx *svc.ServiceContext
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewUserDebugTokenLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UserDebugTokenLogic {
|
||||||
|
return &UserDebugTokenLogic{
|
||||||
|
Logger: logx.WithContext(ctx),
|
||||||
|
ctx: ctx,
|
||||||
|
svcCtx: svcCtx,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 处理进入前逻辑w,r
|
||||||
|
// func (l *UserDebugTokenLogic) BeforeLogic(w http.ResponseWriter, r *http.Request) {
|
||||||
|
// }
|
||||||
|
|
||||||
|
func (l *UserDebugTokenLogic) UserDebugToken(req *types.RequestUserDebug, userinfo *auth.UserInfo) (resp *basic.Response) {
|
||||||
|
// 返回值必须调用Set重新返回, resp可以空指针调用 resp.SetStatus(basic.CodeOK, data)
|
||||||
|
// userinfo 传入值时, 一定不为null
|
||||||
|
if req.Password != l.svcCtx.Config.Debug.Password {
|
||||||
|
return resp.SetStatusAddMessage(basic.CodeApiErr, "密码错误")
|
||||||
|
}
|
||||||
|
var accessExpire int64 = 3600
|
||||||
|
if req.Exp != nil {
|
||||||
|
accessExpire = *req.Exp
|
||||||
|
}
|
||||||
|
|
||||||
|
debug := &auth.Debug{
|
||||||
|
IsCache: req.IsCache,
|
||||||
|
IsAllTemplateTag: req.IsAllTemplateTag,
|
||||||
|
}
|
||||||
|
|
||||||
|
dtoken, err := auth.GenerateBaseJwtTokenUint64(auth.DefaultDebugJwtSecret, accessExpire, time.Now().UTC().Unix(), debug)
|
||||||
|
if err != nil {
|
||||||
|
return resp.SetStatusWithMessage(basic.CodeApiErr, "GenerateBaseJwtTokenUint64错误")
|
||||||
|
}
|
||||||
|
|
||||||
|
return resp.SetStatus(basic.CodeOK, map[string]any{
|
||||||
|
"debug_token": dtoken,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 处理逻辑后 w,r 如:重定向, resp 必须重新处理
|
||||||
|
// func (l *UserDebugTokenLogic) AfterLogic(w http.ResponseWriter, r *http.Request, resp *basic.Response) {
|
||||||
|
// // httpx.OkJsonCtx(r.Context(), w, resp)
|
||||||
|
// }
|
||||||
@ -88,7 +88,7 @@ func (l *UserEmailConfirmationLogic) UserEmailConfirmation(req *types.RequestEma
|
|||||||
user, err := l.svcCtx.AllModels.FsUser.RegisterByGoogleOAuth(l.ctx, token)
|
user, err := l.svcCtx.AllModels.FsUser.RegisterByGoogleOAuth(l.ctx, token)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logx.Error(err, token.TraceId)
|
logx.Error(err, token.TraceId)
|
||||||
return resp.SetStatus(basic.CodeDbSqlErr, err.Error())
|
return resp.SetStatus(basic.CodeDbSqlErr, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
err = FinishRegister(l.svcCtx, user, token)
|
err = FinishRegister(l.svcCtx, user, token)
|
||||||
@ -117,7 +117,7 @@ func (l *UserEmailConfirmationLogic) UserEmailConfirmation(req *types.RequestEma
|
|||||||
rt, err := l.svcCtx.ResetTokenManger.Decrypt(req.Token) // ResetToken
|
rt, err := l.svcCtx.ResetTokenManger.Decrypt(req.Token) // ResetToken
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logx.Error(err)
|
logx.Error(err)
|
||||||
return resp.SetStatus(basic.CodeOAuthResetTokenDecryptErr, err.Error())
|
return resp.SetStatus(basic.CodeOAuthResetTokenDecryptErr, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if time.Since(rt.CreateAt) > 30*time.Minute {
|
if time.Since(rt.CreateAt) > 30*time.Minute {
|
||||||
@ -126,7 +126,7 @@ func (l *UserEmailConfirmationLogic) UserEmailConfirmation(req *types.RequestEma
|
|||||||
|
|
||||||
// TODO: 存储
|
// TODO: 存储
|
||||||
if rt.OperateType != auth.OpTypeResetToken {
|
if rt.OperateType != auth.OpTypeResetToken {
|
||||||
return resp.SetStatus(basic.CodeOAuthTypeErr, "error OperateType: rt.OperateType != auth.OpTypeResetToken")
|
return resp.SetStatus(basic.CodeOAuthTypeErr, fmt.Errorf("error OperateType: rt.OperateType != auth.OpTypeResetToken"))
|
||||||
}
|
}
|
||||||
|
|
||||||
err = l.svcCtx.AllModels.FsUser.Transaction(l.ctx, func(tx *gorm.DB) error {
|
err = l.svcCtx.AllModels.FsUser.Transaction(l.ctx, func(tx *gorm.DB) error {
|
||||||
@ -142,14 +142,14 @@ func (l *UserEmailConfirmationLogic) UserEmailConfirmation(req *types.RequestEma
|
|||||||
})
|
})
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return resp.SetStatus(basic.CodeDbSqlErr, err.Error())
|
return resp.SetStatus(basic.CodeDbSqlErr, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
event := wevent.NewWebsocketEventSuccess(wevent.UserResetToken, rt.TraceId)
|
event := wevent.NewWebsocketEventSuccess(wevent.UserResetToken, rt.TraceId)
|
||||||
err = wevent.CommonNotify(l.svcCtx.Config.MainAddress, rt.Wid, event)
|
err = wevent.CommonNotify(l.svcCtx.Config.MainAddress, rt.Wid, event)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logx.Error(err, rt.TraceId)
|
logx.Error(err, rt.TraceId)
|
||||||
return resp.SetStatus(basic.CodeResetPasswordErr, err.Error())
|
return resp.SetStatus(basic.CodeResetPasswordErr, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
return resp.SetStatus(basic.CodeOK)
|
return resp.SetStatus(basic.CodeOK)
|
||||||
|
|||||||
@ -64,13 +64,13 @@ func (l *UserGoogleLoginLogic) UserGoogleLogin(req *types.RequestGoogleLogin, us
|
|||||||
token, err := googleOauthConfig.Exchange(l.ctx, req.Code)
|
token, err := googleOauthConfig.Exchange(l.ctx, req.Code)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logx.Error(err)
|
logx.Error(err)
|
||||||
return resp.SetStatus(basic.CodeApiErr, err.Error())
|
return resp.SetStatus(basic.CodeApiErr, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
r, err := requests.Get("https://www.googleapis.com/oauth2/v2/userinfo?access_token=" + token.AccessToken).Execute()
|
r, err := requests.Get("https://www.googleapis.com/oauth2/v2/userinfo?access_token=" + token.AccessToken).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logx.Error(err)
|
logx.Error(err)
|
||||||
return resp.SetStatus(basic.CodeOAuthGoogleApiErr, err.Error())
|
return resp.SetStatus(basic.CodeOAuthGoogleApiErr, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
gresult := r.Json()
|
gresult := r.Json()
|
||||||
|
|||||||
@ -45,10 +45,10 @@ func (l *UserRegisterLogic) UserRegister(req *types.RequestUserRegister, userinf
|
|||||||
return resp.SetStatusWithMessage(basic.CodeOAuthEmailErr, "email len must < 50")
|
return resp.SetStatusWithMessage(basic.CodeOAuthEmailErr, "email len must < 50")
|
||||||
}
|
}
|
||||||
|
|
||||||
// _, err := l.svcCtx.AllModels.FsUser.FindUserByEmail(l.ctx, req.Email)
|
_, err := l.svcCtx.AllModels.FsUser.FindUserByEmail(l.ctx, req.Email)
|
||||||
// if err == nil {
|
if err == nil {
|
||||||
// return resp.SetStatus(basic.CodeEmailExistsErr)
|
return resp.SetStatus(basic.CodeEmailExistsErr)
|
||||||
// }
|
}
|
||||||
|
|
||||||
if !TimeLimit.Is(req.Email) {
|
if !TimeLimit.Is(req.Email) {
|
||||||
return resp.SetStatus(basic.CodeEmailTimeShortErr)
|
return resp.SetStatus(basic.CodeEmailTimeShortErr)
|
||||||
|
|||||||
@ -39,19 +39,19 @@ func (l *UserResetPasswordLogic) UserResetPassword(req *types.RequestUserResetPa
|
|||||||
// 返回值必须调用Set重新返回, resp可以空指针调用 resp.SetStatus(basic.CodeOK, data)
|
// 返回值必须调用Set重新返回, resp可以空指针调用 resp.SetStatus(basic.CodeOK, data)
|
||||||
// userinfo 传入值时, 一定不为null
|
// userinfo 传入值时, 一定不为null
|
||||||
|
|
||||||
if len(req.NewPassword) > 30 {
|
if len(req.NewPassword) > 64 {
|
||||||
return resp.SetStatusWithMessage(basic.CodePasswordErr, "password len must < 30")
|
return resp.SetStatusWithMessage(basic.CodePasswordErr, "password len must < 64")
|
||||||
}
|
}
|
||||||
|
|
||||||
rt, err := l.svcCtx.ResetTokenManger.Decrypt(req.ResetToken) // ResetToken
|
rt, err := l.svcCtx.ResetTokenManger.Decrypt(req.ResetToken) // ResetToken
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logx.Error(err)
|
logx.Error(err)
|
||||||
return resp.SetStatus(basic.CodeOAuthResetTokenDecryptErr, err.Error())
|
return resp.SetStatus(basic.CodeOAuthResetTokenDecryptErr, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: 存储
|
// TODO: 存储
|
||||||
if rt.OperateType != auth.OpTypeResetToken {
|
if rt.OperateType != auth.OpTypeResetToken {
|
||||||
return resp.SetStatus(basic.CodeOAuthTypeErr, "error OperateType: rt.OperateType != auth.OpTypeResetToken")
|
return resp.SetStatus(basic.CodeOAuthTypeErr, fmt.Errorf("error OperateType: rt.OperateType != auth.OpTypeResetToken"))
|
||||||
}
|
}
|
||||||
|
|
||||||
if time.Since(rt.CreateAt) > 30*time.Minute {
|
if time.Since(rt.CreateAt) > 30*time.Minute {
|
||||||
|
|||||||
@ -56,7 +56,7 @@ func (l *UserResetTokenLogic) UserResetToken(req *types.RequestUserResetToken, u
|
|||||||
resetToken, err := l.svcCtx.ResetTokenManger.Encrypt(token)
|
resetToken, err := l.svcCtx.ResetTokenManger.Encrypt(token)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logx.Error(err)
|
logx.Error(err)
|
||||||
return resp.SetStatus(basic.CodeOAuthResetTokenEncryptErr, err.Error())
|
return resp.SetStatus(basic.CodeOAuthResetTokenEncryptErr, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
userName := *user.FirstName + " " + *user.LastName
|
userName := *user.FirstName + " " + *user.LastName
|
||||||
|
|||||||
@ -26,48 +26,55 @@ func TestEmailSend(t *testing.T) {
|
|||||||
// 设置发件人和收件人信息
|
// 设置发件人和收件人信息
|
||||||
from := "support@fusenpack.com"
|
from := "support@fusenpack.com"
|
||||||
to := []string{"474420502@qq.com"}
|
to := []string{"474420502@qq.com"}
|
||||||
|
// to := []string{"qq474420502@gmail.com"}
|
||||||
|
// to := []string{"outlook_7D27A8300A1B3F01@outlook.com"}
|
||||||
|
|
||||||
// 设置smtp服务器地址,端口和认证信息
|
// 设置smtp服务器地址,端口和认证信息
|
||||||
smtpServer := "smtp.gmail.com"
|
smtpServer := "smtp.gmail.com"
|
||||||
|
|
||||||
auth := smtp.PlainAuth("", "support@fusenpack.com", "wfbjpdgvaozjvwah", smtpServer)
|
auth := smtp.PlainAuth("", "support@fusenpack.com", "wfbjpdgvaozjvwah", smtpServer)
|
||||||
|
|
||||||
msg := []byte(`Subject: Password Reset Request for Your Account;
|
var buf bytes.Buffer
|
||||||
MIME-version: 1.0;
|
tpls.ExecuteTemplate(&buf, "test.tpl", map[string]any{
|
||||||
Content-Type: text/html; charset="UTF-8";
|
"CompanyName": "FusenPack",
|
||||||
From: "Fusen";
|
})
|
||||||
|
|
||||||
|
// msg := []byte(`Subject: Password Reset Request for Your Account;
|
||||||
|
// MIME-version: 1.0;
|
||||||
|
// Content-Type: text/html; charset="UTF-8";
|
||||||
|
// From: "Fusen";
|
||||||
|
|
||||||
<html>
|
// <html>
|
||||||
<head>
|
// <head>
|
||||||
<title>Password Reset for Your {{.CompanyName}} Account</title>
|
// <title>Password Reset for Your {{.CompanyName}} Account</title>
|
||||||
</head>
|
// </head>
|
||||||
<body>
|
// <body>
|
||||||
|
|
||||||
<p>Dear {{.UserName}},</p>
|
// <p>Dear {{.UserName}},</p>
|
||||||
|
|
||||||
<p>We have received your request to reset the password for your {{.CompanyName}} account.</p>
|
// <p>We have received your request to reset the password for your {{.CompanyName}} account.</p>
|
||||||
|
|
||||||
<p>To proceed with the password reset, please click the button below to open the Reset Password page:</p>
|
// <p>To proceed with the password reset, please click the button below to open the Reset Password page:</p>
|
||||||
|
|
||||||
<div style="margin: 1em 0;">
|
// <div style="margin: 1em 0;">
|
||||||
<a href="{{.ConfirmationLink}}" target="_blank"
|
// <a href="{{.ConfirmationLink}}" target="_blank"
|
||||||
style="background-color: #008CBA; color: #FFFFFF; text-decoration: none; padding: 10px 15px; border-radius: 3px; display:inline-block;">
|
// style="background-color: #008CBA; color: #FFFFFF; text-decoration: none; padding: 10px 15px; border-radius: 3px; display:inline-block;">
|
||||||
Reset Password
|
// Reset Password
|
||||||
</a>
|
// </a>
|
||||||
</div>
|
// </div>
|
||||||
|
|
||||||
<p>Please note that this password reset confirmation link will expire in 60 minutes. If you have any further questions, feel free to reach out to us.</p>
|
// <p>Please note that this password reset confirmation link will expire in 60 minutes. If you have any further questions, feel free to reach out to us.</p>
|
||||||
|
|
||||||
<p>Regards,</p>
|
// <p>Regards,</p>
|
||||||
|
|
||||||
<p>{{.SenderName}}<br>
|
// <p>{{.SenderName}}<br>
|
||||||
{{.SenderTitle}}<br>
|
// {{.SenderTitle}}<br>
|
||||||
{{.CompanyName}}</p>
|
// {{.CompanyName}}</p>
|
||||||
|
|
||||||
</body>
|
// </body>
|
||||||
</html>`)
|
// </html>`)
|
||||||
|
|
||||||
|
msg := buf.Bytes()
|
||||||
// 发送邮件
|
// 发送邮件
|
||||||
err := smtp.SendMail(smtpServer+":587", auth, from, to, msg)
|
err := smtp.SendMail(smtpServer+":587", auth, from, to, msg)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@ -5,6 +5,13 @@ import (
|
|||||||
"fusenapi/utils/basic"
|
"fusenapi/utils/basic"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type RequestUserDebug struct {
|
||||||
|
Password string `json:"password"` // 密码,内部使用都是明文
|
||||||
|
Exp *int64 `json:"exp"` // 过期时间, 不发默认一天
|
||||||
|
IsCache int64 `json:"is_cache"` // 是否缓存
|
||||||
|
IsAllTemplateTag int64 `json:"is_all_template_tag"` // 是开启全部模板
|
||||||
|
}
|
||||||
|
|
||||||
type RequestAuthDelete struct {
|
type RequestAuthDelete struct {
|
||||||
Email string `json:"email"`
|
Email string `json:"email"`
|
||||||
}
|
}
|
||||||
@ -90,10 +97,10 @@ type File struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type Meta struct {
|
type Meta struct {
|
||||||
TotalCount int64 `json:"totalCount"`
|
TotalCount int64 `json:"total_count"`
|
||||||
PageCount int64 `json:"pageCount"`
|
PageCount int64 `json:"page_count"`
|
||||||
CurrentPage int `json:"currentPage"`
|
CurrentPage int `json:"current_page"`
|
||||||
PerPage int `json:"perPage"`
|
PerPage int `json:"per_page"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set 设置Response的Code和Message值
|
// Set 设置Response的Code和Message值
|
||||||
|
|||||||
@ -61,7 +61,6 @@ func (l *SaveCanteenTypeProductLogic) SaveCanteenTypeProduct(req *types.SaveCant
|
|||||||
now := time.Now().UTC().Unix()
|
now := time.Now().UTC().Unix()
|
||||||
//开启事务
|
//开启事务
|
||||||
err = l.svcCtx.MysqlConn.Transaction(func(tx *gorm.DB) error {
|
err = l.svcCtx.MysqlConn.Transaction(func(tx *gorm.DB) error {
|
||||||
canteenProductModel = gmodel.NewFsCanteenProductModel(tx)
|
|
||||||
sort := int64(0)
|
sort := int64(0)
|
||||||
//新的变更记录
|
//新的变更记录
|
||||||
mapUpdateCanteenPid := make(map[int64]struct{})
|
mapUpdateCanteenPid := make(map[int64]struct{})
|
||||||
@ -73,12 +72,12 @@ func (l *SaveCanteenTypeProductLogic) SaveCanteenTypeProduct(req *types.SaveCant
|
|||||||
}
|
}
|
||||||
if v.Id > 0 { //更新
|
if v.Id > 0 { //更新
|
||||||
mapUpdateCanteenPid[v.Id] = struct{}{}
|
mapUpdateCanteenPid[v.Id] = struct{}{}
|
||||||
err = canteenProductModel.UpdateById(l.ctx, v.Id, &gmodel.FsCanteenProduct{
|
err = tx.WithContext(l.ctx).Model(&gmodel.FsCanteenProduct{}).Where("id = ?", v.Id).Updates(&gmodel.FsCanteenProduct{
|
||||||
SizeId: &v.SizeId,
|
SizeId: &v.SizeId,
|
||||||
Sid: &v.SId,
|
Sid: &v.SId,
|
||||||
Sort: &sort,
|
Sort: &sort,
|
||||||
ProductId: sizeInfo.ProductId,
|
ProductId: sizeInfo.ProductId,
|
||||||
})
|
}).Error
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@ -86,7 +85,7 @@ func (l *SaveCanteenTypeProductLogic) SaveCanteenTypeProduct(req *types.SaveCant
|
|||||||
}
|
}
|
||||||
//新增
|
//新增
|
||||||
addStatus := int64(1)
|
addStatus := int64(1)
|
||||||
err = canteenProductModel.Create(l.ctx, &gmodel.FsCanteenProduct{
|
err = tx.WithContext(l.ctx).Model(&gmodel.FsCanteenProduct{}).Create(&gmodel.FsCanteenProduct{
|
||||||
SizeId: &v.SizeId,
|
SizeId: &v.SizeId,
|
||||||
Sid: &v.SId,
|
Sid: &v.SId,
|
||||||
Sort: &sort,
|
Sort: &sort,
|
||||||
@ -94,7 +93,7 @@ func (l *SaveCanteenTypeProductLogic) SaveCanteenTypeProduct(req *types.SaveCant
|
|||||||
Ctime: &now,
|
Ctime: &now,
|
||||||
CanteenType: &req.Id,
|
CanteenType: &req.Id,
|
||||||
ProductId: sizeInfo.ProductId,
|
ProductId: sizeInfo.ProductId,
|
||||||
})
|
}).Error
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@ -110,9 +109,9 @@ func (l *SaveCanteenTypeProductLogic) SaveCanteenTypeProduct(req *types.SaveCant
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
delStatus := int64(0)
|
delStatus := int64(0)
|
||||||
if err = canteenProductModel.UpdateByIdArr(l.ctx, diffCanteenProductId, &gmodel.FsCanteenProduct{
|
if err = tx.WithContext(l.ctx).Model(&gmodel.FsCanteenProduct{}).Where("id in (?)", diffCanteenProductId).Updates(&gmodel.FsCanteenProduct{
|
||||||
Status: &delStatus,
|
Status: &delStatus,
|
||||||
}); err != nil {
|
}).Error; err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
@ -27,16 +27,6 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
|
|||||||
Path: "/api/collection/get_collect_product_list",
|
Path: "/api/collection/get_collect_product_list",
|
||||||
Handler: GetCollectProductListHandler(serverCtx),
|
Handler: GetCollectProductListHandler(serverCtx),
|
||||||
},
|
},
|
||||||
{
|
|
||||||
Method: http.MethodGet,
|
|
||||||
Path: "/api/collection/test_ai",
|
|
||||||
Handler: TestAiHandler(serverCtx),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
Method: http.MethodPost,
|
|
||||||
Path: "/api/collection/test_pdf",
|
|
||||||
Handler: TestPdfHandler(serverCtx),
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@ -1,50 +0,0 @@
|
|||||||
package logic
|
|
||||||
|
|
||||||
import (
|
|
||||||
"context"
|
|
||||||
"fusenapi/server/collection/internal/svc"
|
|
||||||
"fusenapi/server/collection/internal/types"
|
|
||||||
"fusenapi/utils/auth"
|
|
||||||
"fusenapi/utils/basic"
|
|
||||||
"fusenapi/utils/pdf"
|
|
||||||
|
|
||||||
"github.com/zeromicro/go-zero/core/logx"
|
|
||||||
)
|
|
||||||
|
|
||||||
type TestPdfLogic struct {
|
|
||||||
logx.Logger
|
|
||||||
ctx context.Context
|
|
||||||
svcCtx *svc.ServiceContext
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewTestPdfLogic(ctx context.Context, svcCtx *svc.ServiceContext) *TestPdfLogic {
|
|
||||||
return &TestPdfLogic{
|
|
||||||
Logger: logx.WithContext(ctx),
|
|
||||||
ctx: ctx,
|
|
||||||
svcCtx: svcCtx,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 处理进入前逻辑w,r
|
|
||||||
// func (l *TestPdfLogic) BeforeLogic(w http.ResponseWriter, r *http.Request) {
|
|
||||||
// }
|
|
||||||
|
|
||||||
func (l *TestPdfLogic) TestPdf(req *types.TestPdfReq, userinfo *auth.UserInfo) (resp *basic.Response) {
|
|
||||||
return resp.SetStatusWithMessage(basic.CodeOK, "你干嘛,哎哟")
|
|
||||||
switch req.Type {
|
|
||||||
case "url":
|
|
||||||
case "html":
|
|
||||||
default:
|
|
||||||
return resp.SetStatusWithMessage(basic.CodeRequestParamsErr, "invalid type")
|
|
||||||
}
|
|
||||||
res, err := pdf.HtmlToPdfBase64(req.Content, req.Type)
|
|
||||||
if err != nil {
|
|
||||||
return resp.SetStatusWithMessage(basic.CodeServiceErr, err.Error())
|
|
||||||
}
|
|
||||||
return resp.SetStatus(basic.CodeOK, res)
|
|
||||||
}
|
|
||||||
|
|
||||||
// 处理逻辑后 w,r 如:重定向, resp 必须重新处理
|
|
||||||
// func (l *TestPdfLogic) AfterLogic(w http.ResponseWriter, r *http.Request, resp *basic.Response) {
|
|
||||||
// // httpx.OkJsonCtx(r.Context(), w, resp)
|
|
||||||
// }
|
|
||||||
@ -40,15 +40,6 @@ type GetCollectProductListRspItem struct {
|
|||||||
IsDeleted int64 `json:"is_deleted"`
|
IsDeleted int64 `json:"is_deleted"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type TestAiReq struct {
|
|
||||||
Num int `form:"num"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type TestPdfReq struct {
|
|
||||||
Content string `json:"content"`
|
|
||||||
Type string `json:"type"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type Request struct {
|
type Request struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -72,6 +72,11 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
|
|||||||
Path: "/api/user/logo-templatetag-set",
|
Path: "/api/user/logo-templatetag-set",
|
||||||
Handler: UserLogoTemplateTagSetHandler(serverCtx),
|
Handler: UserLogoTemplateTagSetHandler(serverCtx),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
Method: http.MethodPost,
|
||||||
|
Path: "/api/user/logo-data-set",
|
||||||
|
Handler: UserLogoDataSetHandler(serverCtx),
|
||||||
|
},
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,35 @@
|
|||||||
|
package handler
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net/http"
|
||||||
|
"reflect"
|
||||||
|
|
||||||
|
"fusenapi/utils/basic"
|
||||||
|
|
||||||
|
"fusenapi/server/home-user-auth/internal/logic"
|
||||||
|
"fusenapi/server/home-user-auth/internal/svc"
|
||||||
|
"fusenapi/server/home-user-auth/internal/types"
|
||||||
|
)
|
||||||
|
|
||||||
|
func UserLogoDataSetHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||||
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
|
var req types.UserLogoDataSetReq
|
||||||
|
userinfo, err := basic.RequestParse(w, r, svcCtx, &req)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 创建一个业务逻辑层实例
|
||||||
|
l := logic.NewUserLogoDataSetLogic(r.Context(), svcCtx)
|
||||||
|
|
||||||
|
rl := reflect.ValueOf(l)
|
||||||
|
basic.BeforeLogic(w, r, rl)
|
||||||
|
|
||||||
|
resp := l.UserLogoDataSet(&req, userinfo)
|
||||||
|
|
||||||
|
if !basic.AfterLogic(w, r, rl, resp) {
|
||||||
|
basic.NormalAfterLogic(w, r, resp)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -75,15 +75,15 @@ func (l *UserInfoSetLogic) UserInfoSet(req *types.UserInfoSetReq, userinfo *auth
|
|||||||
BuilderDB := fsUserInfoModel.BuilderDB(l.ctx, nil).Model(&gmodel.FsUserInfo{})
|
BuilderDB := fsUserInfoModel.BuilderDB(l.ctx, nil).Model(&gmodel.FsUserInfo{})
|
||||||
BuilderDB1 := fsUserInfoModel.BuilderDB(l.ctx, nil).Model(&gmodel.FsUserInfo{})
|
BuilderDB1 := fsUserInfoModel.BuilderDB(l.ctx, nil).Model(&gmodel.FsUserInfo{})
|
||||||
if req.Module == "merchant_category" {
|
if req.Module == "merchant_category" {
|
||||||
BuilderDB1.Where("module = ?", "profile")
|
BuilderDB1 = BuilderDB1.Where("module = ?", "profile")
|
||||||
} else {
|
} else {
|
||||||
BuilderDB1.Where("module = ?", req.Module)
|
BuilderDB1 = BuilderDB1.Where("module = ?", req.Module)
|
||||||
}
|
}
|
||||||
//.Where("user_id=?", userId).Where("guest_id=?", guestId)
|
//.Where("user_id=?", userId).Where("guest_id=?", guestId)
|
||||||
if userId > 0 {
|
if userId > 0 {
|
||||||
BuilderDB1.Where("user_id=?", userId)
|
BuilderDB1 = BuilderDB1.Where("user_id=?", userId)
|
||||||
} else {
|
} else {
|
||||||
BuilderDB1.Where("guest_id=?", guestId)
|
BuilderDB1 = BuilderDB1.Where("guest_id=?", guestId)
|
||||||
}
|
}
|
||||||
userInfo, err = fsUserInfoModel.FindOne(BuilderDB1, nil)
|
userInfo, err = fsUserInfoModel.FindOne(BuilderDB1, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
165
server/home-user-auth/internal/logic/userlogodatasetlogic.go
Normal file
165
server/home-user-auth/internal/logic/userlogodatasetlogic.go
Normal file
@ -0,0 +1,165 @@
|
|||||||
|
package logic
|
||||||
|
|
||||||
|
import (
|
||||||
|
"errors"
|
||||||
|
"fmt"
|
||||||
|
"fusenapi/model/gmodel"
|
||||||
|
"fusenapi/service/repositories"
|
||||||
|
"fusenapi/utils/auth"
|
||||||
|
"fusenapi/utils/basic"
|
||||||
|
"fusenapi/utils/s3url_to_s3id"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"context"
|
||||||
|
|
||||||
|
"fusenapi/server/home-user-auth/internal/svc"
|
||||||
|
"fusenapi/server/home-user-auth/internal/types"
|
||||||
|
|
||||||
|
"github.com/zeromicro/go-zero/core/logc"
|
||||||
|
"github.com/zeromicro/go-zero/core/logx"
|
||||||
|
"gorm.io/gorm"
|
||||||
|
)
|
||||||
|
|
||||||
|
type UserLogoDataSetLogic struct {
|
||||||
|
logx.Logger
|
||||||
|
ctx context.Context
|
||||||
|
svcCtx *svc.ServiceContext
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewUserLogoDataSetLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UserLogoDataSetLogic {
|
||||||
|
return &UserLogoDataSetLogic{
|
||||||
|
Logger: logx.WithContext(ctx),
|
||||||
|
ctx: ctx,
|
||||||
|
svcCtx: svcCtx,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 处理进入前逻辑w,r
|
||||||
|
// func (l *UserLogoDataSetLogic) BeforeLogic(w http.ResponseWriter, r *http.Request) {
|
||||||
|
// }
|
||||||
|
|
||||||
|
func (l *UserLogoDataSetLogic) UserLogoDataSet(req *types.UserLogoDataSetReq, userinfo *auth.UserInfo) (resp *basic.Response) {
|
||||||
|
// 返回值必须调用Set重新返回, resp可以空指针调用 resp.SetStatus(basic.CodeOK, data)
|
||||||
|
// userinfo 传入值时, 一定不为null
|
||||||
|
if userinfo.IsOnlooker() {
|
||||||
|
// 如果是,返回未授权的错误码
|
||||||
|
return resp.SetStatus(basic.CodeUnAuth)
|
||||||
|
}
|
||||||
|
var userId int64
|
||||||
|
var guestId int64
|
||||||
|
|
||||||
|
// 检查用户是否是游客
|
||||||
|
if userinfo.IsGuest() {
|
||||||
|
// 如果是,使用游客ID和游客键名格式
|
||||||
|
guestId = userinfo.GuestId
|
||||||
|
} else {
|
||||||
|
// 否则,使用用户ID和用户键名格式
|
||||||
|
userId = userinfo.UserId
|
||||||
|
}
|
||||||
|
var logoData = gmodel.FsPreprocessLogo{}
|
||||||
|
result := l.svcCtx.MysqlConn.Model(&gmodel.FsPreprocessLogo{}).Where("id = ?", req.LogoDataId).Take(&logoData)
|
||||||
|
err := result.Error
|
||||||
|
if err != nil {
|
||||||
|
if errors.Is(err, gorm.ErrRecordNotFound) {
|
||||||
|
logc.Errorf(l.ctx, "UserLogoDataSet logoData find err:%+v", err)
|
||||||
|
basic.CodeApiErr.Message = "logo data not find"
|
||||||
|
return resp.SetStatus(basic.CodeApiErr)
|
||||||
|
}
|
||||||
|
return resp.SetStatus(basic.CodeApiErr)
|
||||||
|
}
|
||||||
|
|
||||||
|
var materialInfoOld gmodel.FsUserMaterial
|
||||||
|
var FsUserMaterialModel = l.svcCtx.MysqlConn.Model(&gmodel.FsUserMaterial{})
|
||||||
|
if userinfo.IsGuest() {
|
||||||
|
// 如果是,使用游客ID和游客键名格式
|
||||||
|
guestId = userinfo.GuestId
|
||||||
|
FsUserMaterialModel = FsUserMaterialModel.Where("guest_id = ?", guestId)
|
||||||
|
} else {
|
||||||
|
// 否则,使用用户ID和用户键名格式
|
||||||
|
userId = userinfo.UserId
|
||||||
|
FsUserMaterialModel = FsUserMaterialModel.Where("user_id = ?", userId)
|
||||||
|
}
|
||||||
|
|
||||||
|
result1 := FsUserMaterialModel.Where("logo_id = ?", req.LogoDataId).Take(&materialInfoOld)
|
||||||
|
err = result1.Error
|
||||||
|
if err != nil {
|
||||||
|
if !errors.Is(err, gorm.ErrRecordNotFound) {
|
||||||
|
logc.Errorf(l.ctx, "FsUserMaterial logoData find err:%+v", err)
|
||||||
|
return resp.SetStatus(basic.CodeApiErr)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 返回成功的响应和上传URL
|
||||||
|
return resp.SetStatus(basic.CodeOK, map[string]interface{}{
|
||||||
|
"id": materialInfoOld.Id,
|
||||||
|
"module": materialInfoOld.Module,
|
||||||
|
"user_id": materialInfoOld.UserId,
|
||||||
|
"guest_id": materialInfoOld.GuestId,
|
||||||
|
"resource_id": materialInfoOld.ResourceId,
|
||||||
|
"resource_url": materialInfoOld.ResourceUrl,
|
||||||
|
"ctime": materialInfoOld.Ctime,
|
||||||
|
"resource_info": nil,
|
||||||
|
"metadata": nil,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
var userMaterialMetadata []byte
|
||||||
|
if logoData.Metadata == nil {
|
||||||
|
var resultStr string
|
||||||
|
resLogoStandard, err := l.svcCtx.Repositories.ImageHandle.LogoInfoSet(l.ctx, &repositories.LogoInfoSetReq{
|
||||||
|
LogoUrl: *logoData.ResourceUrl,
|
||||||
|
Version: l.svcCtx.Config.BLMService.Version,
|
||||||
|
Debug: userinfo.Debug,
|
||||||
|
})
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
logx.Error(err)
|
||||||
|
basic.CodeServiceErr.Message = fmt.Sprintf("算法请求--LOGO信息--错误:%+v", err)
|
||||||
|
return resp.SetStatus(basic.CodeServiceErr, fmt.Sprintf("算法请求--LOGO信息--错误:%+v", err))
|
||||||
|
}
|
||||||
|
resultStr = resLogoStandard.Res
|
||||||
|
userMaterialMetadata = []byte(resultStr)
|
||||||
|
} else {
|
||||||
|
userMaterialMetadata = *logoData.Metadata
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增素材--预备logo
|
||||||
|
var module = "logo-prepare"
|
||||||
|
var nowTime = time.Now().UTC()
|
||||||
|
var resourceId = s3url_to_s3id.GetS3ResourceIdFormUrl(*logoData.ResourceUrl)
|
||||||
|
// 新增素材记录
|
||||||
|
materialInfo := gmodel.FsUserMaterial{
|
||||||
|
Module: &module,
|
||||||
|
UserId: &userId,
|
||||||
|
GuestId: &guestId,
|
||||||
|
ResourceId: &resourceId,
|
||||||
|
ResourceUrl: logoData.ResourceUrl,
|
||||||
|
Metadata: &userMaterialMetadata,
|
||||||
|
Ctime: &nowTime,
|
||||||
|
LogoId: &req.LogoDataId,
|
||||||
|
}
|
||||||
|
resCreate := l.svcCtx.MysqlConn.Create(&materialInfo)
|
||||||
|
err = resCreate.Error
|
||||||
|
if err != nil {
|
||||||
|
logc.Errorf(l.ctx, "UserLogoDataSet logoData find err:%+v", err)
|
||||||
|
return resp.SetStatus(basic.CodeApiErr)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 返回成功的响应和上传URL
|
||||||
|
return resp.SetStatus(basic.CodeOK, map[string]interface{}{
|
||||||
|
"id": materialInfo.Id,
|
||||||
|
"module": materialInfo.Module,
|
||||||
|
"user_id": materialInfo.UserId,
|
||||||
|
"guest_id": materialInfo.GuestId,
|
||||||
|
"resource_id": materialInfo.ResourceId,
|
||||||
|
"resource_url": materialInfo.ResourceUrl,
|
||||||
|
"metadata": materialInfo.Metadata,
|
||||||
|
"ctime": materialInfo.Ctime,
|
||||||
|
"resource_info": nil,
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// 处理逻辑后 w,r 如:重定向, resp 必须重新处理
|
||||||
|
// func (l *UserLogoDataSetLogic) AfterLogic(w http.ResponseWriter, r *http.Request, resp *basic.Response) {
|
||||||
|
// // httpx.OkJsonCtx(r.Context(), w, resp)
|
||||||
|
// }
|
||||||
@ -144,6 +144,7 @@ func (l *UserLogoListLogic) UserLogoList(req *types.UserLogoListReq, userinfo *a
|
|||||||
metadataMap["merchant_category_info"] = nil
|
metadataMap["merchant_category_info"] = nil
|
||||||
v.MetaDataMap = metadataMap
|
v.MetaDataMap = metadataMap
|
||||||
}
|
}
|
||||||
|
v.Metadata = nil
|
||||||
|
|
||||||
if v.ResourceInfo != nil {
|
if v.ResourceInfo != nil {
|
||||||
if v.ResourceInfo.Metadata != nil {
|
if v.ResourceInfo.Metadata != nil {
|
||||||
|
|||||||
@ -96,6 +96,10 @@ func (l *UserLogoSetLogic) UserLogoSet(req *types.UserLogoSetReq, userinfo *auth
|
|||||||
logc.Errorf(l.ctx, "FsUserMaterial FindOne err:%+v", err)
|
logc.Errorf(l.ctx, "FsUserMaterial FindOne err:%+v", err)
|
||||||
return resp.SetStatus(basic.CodeLogoSetCategory, "logo not find")
|
return resp.SetStatus(basic.CodeLogoSetCategory, "logo not find")
|
||||||
}
|
}
|
||||||
|
var materialModule string
|
||||||
|
if *userMaterialInfo.Module == "logo-prepare" {
|
||||||
|
materialModule = "logo"
|
||||||
|
}
|
||||||
|
|
||||||
err = l.svcCtx.MysqlConn.WithContext(l.ctx).Transaction(func(tx *gorm.DB) error {
|
err = l.svcCtx.MysqlConn.WithContext(l.ctx).Transaction(func(tx *gorm.DB) error {
|
||||||
var metadataMapOldUserMaterial map[string]interface{}
|
var metadataMapOldUserMaterial map[string]interface{}
|
||||||
@ -106,7 +110,11 @@ func (l *UserLogoSetLogic) UserLogoSet(req *types.UserLogoSetReq, userinfo *auth
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
var logoCategoryId int64
|
||||||
// 更新merchant_category
|
// 更新merchant_category
|
||||||
|
if req.SetLogoCategory == 1 || materialModule != "" {
|
||||||
|
var updateSelect []string
|
||||||
|
updateSelect = append(updateSelect, "utime")
|
||||||
if req.SetLogoCategory == 1 {
|
if req.SetLogoCategory == 1 {
|
||||||
var metadataChildUserMaterial = make(map[string]interface{}, 1)
|
var metadataChildUserMaterial = make(map[string]interface{}, 1)
|
||||||
metadataChildUserMaterial["merchant_category"] = req.CategoryId
|
metadataChildUserMaterial["merchant_category"] = req.CategoryId
|
||||||
@ -121,7 +129,15 @@ func (l *UserLogoSetLogic) UserLogoSet(req *types.UserLogoSetReq, userinfo *auth
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
userMaterialInfo.Metadata = &metadataBUserMaterial
|
userMaterialInfo.Metadata = &metadataBUserMaterial
|
||||||
resUpdates := tx.Select("metadata").Where("id = ?", req.LogoSelectedId).Updates(&userMaterialInfo)
|
updateSelect = append(updateSelect, "metadata")
|
||||||
|
}
|
||||||
|
|
||||||
|
if materialModule != "" {
|
||||||
|
userMaterialInfo.Module = &materialModule
|
||||||
|
updateSelect = append(updateSelect, "module")
|
||||||
|
}
|
||||||
|
|
||||||
|
resUpdates := tx.Model(&gmodel.FsUserMaterial{}).Select(updateSelect).Where("id = ?", req.LogoSelectedId).Updates(&userMaterialInfo)
|
||||||
err = resUpdates.Error
|
err = resUpdates.Error
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if err != gorm.ErrRecordNotFound {
|
if err != gorm.ErrRecordNotFound {
|
||||||
@ -129,7 +145,7 @@ func (l *UserLogoSetLogic) UserLogoSet(req *types.UserLogoSetReq, userinfo *auth
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
logoCategoryId = req.CategoryId
|
||||||
}
|
}
|
||||||
var module = "profile"
|
var module = "profile"
|
||||||
if req.SetLogoSelected == 1 {
|
if req.SetLogoSelected == 1 {
|
||||||
@ -170,6 +186,13 @@ func (l *UserLogoSetLogic) UserLogoSet(req *types.UserLogoSetReq, userinfo *auth
|
|||||||
logc.Errorf(l.ctx, "userMaterialInfo Metadata template_tag_id err:%+v", err)
|
logc.Errorf(l.ctx, "userMaterialInfo Metadata template_tag_id err:%+v", err)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var userMaterialTemplateTagSelectedVersion string
|
||||||
|
userMaterialVersionData, userMaterialVersionEx := metadataMapOldUserMaterial["version"]
|
||||||
|
if userMaterialVersionEx {
|
||||||
|
userMaterialTemplateTagSelectedVersion = userMaterialVersionData.(string)
|
||||||
|
}
|
||||||
|
|
||||||
userMaterialTemplateIdTagIds := userMaterialTemplateIdTagIdData.([]interface{})
|
userMaterialTemplateIdTagIds := userMaterialTemplateIdTagIdData.([]interface{})
|
||||||
|
|
||||||
userMaterialTemplateIdTagId := userMaterialTemplateIdTagIds[0].(string)
|
userMaterialTemplateIdTagId := userMaterialTemplateIdTagIds[0].(string)
|
||||||
@ -177,16 +200,22 @@ func (l *UserLogoSetLogic) UserLogoSet(req *types.UserLogoSetReq, userinfo *auth
|
|||||||
userMaterialTemplateTag := userMaterialTemplateTagData.(map[string]interface{})
|
userMaterialTemplateTag := userMaterialTemplateTagData.(map[string]interface{})
|
||||||
userMaterialTemplateTagIndex := userMaterialTemplateTag[userMaterialTemplateIdTagId]
|
userMaterialTemplateTagIndex := userMaterialTemplateTag[userMaterialTemplateIdTagId]
|
||||||
|
|
||||||
templateTagSelected := make(map[string]interface{}, 3)
|
templateTagSelected := make(map[string]interface{}, 4)
|
||||||
|
templateTagSelected["version"] = userMaterialTemplateTagSelectedVersion
|
||||||
templateTagSelected["color"] = userMaterialTemplateTagIndex
|
templateTagSelected["color"] = userMaterialTemplateTagIndex
|
||||||
templateTagSelected["template_tag"] = userMaterialTemplateIdTagId
|
templateTagSelected["template_tag"] = userMaterialTemplateIdTagId
|
||||||
templateTagSelected["selected_index"] = 0
|
templateTagSelected["selected_index"] = 0
|
||||||
|
|
||||||
metadataChildUserInfo["logo_selected"] = map[string]interface{}{
|
var logoSelectedMap = map[string]interface{}{
|
||||||
"logo_selected_id": req.LogoSelectedId,
|
"logo_selected_id": req.LogoSelectedId,
|
||||||
"logo_url": userMaterialInfo.ResourceUrl,
|
"logo_url": userMaterialInfo.ResourceUrl,
|
||||||
"template_tag_selected": templateTagSelected,
|
"template_tag_selected": templateTagSelected,
|
||||||
}
|
}
|
||||||
|
if logoCategoryId != 0 {
|
||||||
|
logoSelectedMap["merchant_category"] = logoCategoryId
|
||||||
|
}
|
||||||
|
|
||||||
|
metadataChildUserInfo["logo_selected"] = logoSelectedMap
|
||||||
|
|
||||||
metadataMapUserInfo, err := metadata.SetMetadata(metadataChildUserInfo, metadataMapOldUserInfo)
|
metadataMapUserInfo, err := metadata.SetMetadata(metadataChildUserInfo, metadataMapOldUserInfo)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -212,7 +241,7 @@ func (l *UserLogoSetLogic) UserLogoSet(req *types.UserLogoSetReq, userinfo *auth
|
|||||||
} else {
|
} else {
|
||||||
// 更新
|
// 更新
|
||||||
userInfo.Utime = &nowTime
|
userInfo.Utime = &nowTime
|
||||||
resUpdates := tx.Model(&userInfo).Select("metadata").Where("id = ?", userInfo.Id).Updates(&userInfo)
|
resUpdates := tx.Model(&gmodel.FsUserInfo{}).Select("metadata", "utime").Where("id = ?", userInfo.Id).Updates(&userInfo)
|
||||||
err = resUpdates.Error
|
err = resUpdates.Error
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -64,9 +64,9 @@ func (l *UserLogoTemplateTagSetLogic) UserLogoTemplateTagSet(req *types.UserLogo
|
|||||||
var userInfo = &gmodel.FsUserInfo{}
|
var userInfo = &gmodel.FsUserInfo{}
|
||||||
BuilderDB := tx.Model(&gmodel.FsUserInfo{}).Where("module = ?", module)
|
BuilderDB := tx.Model(&gmodel.FsUserInfo{}).Where("module = ?", module)
|
||||||
if userId > 0 {
|
if userId > 0 {
|
||||||
BuilderDB.Where("user_id=?", userId)
|
BuilderDB = BuilderDB.Where("user_id=?", userId)
|
||||||
} else {
|
} else {
|
||||||
BuilderDB.Where("guest_id=?", guestId)
|
BuilderDB = BuilderDB.Where("guest_id=?", guestId)
|
||||||
}
|
}
|
||||||
userInfoFirstRes := BuilderDB.First(userInfo)
|
userInfoFirstRes := BuilderDB.First(userInfo)
|
||||||
err := userInfoFirstRes.Error
|
err := userInfoFirstRes.Error
|
||||||
@ -112,6 +112,12 @@ func (l *UserLogoTemplateTagSetLogic) UserLogoTemplateTagSet(req *types.UserLogo
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var userMaterialTemplateTagSelectedVersion string
|
||||||
|
userMaterialVersionData, userMaterialVersionEx := metadataMapOldUserMaterial["version"]
|
||||||
|
if userMaterialVersionEx {
|
||||||
|
userMaterialTemplateTagSelectedVersion = userMaterialVersionData.(string)
|
||||||
|
}
|
||||||
|
|
||||||
userMaterialTemplateTag := userMaterialTemplateTagData.(map[string]interface{})
|
userMaterialTemplateTag := userMaterialTemplateTagData.(map[string]interface{})
|
||||||
userMaterialTemplateTagIndex := userMaterialTemplateTag[req.TemplateTag]
|
userMaterialTemplateTagIndex := userMaterialTemplateTag[req.TemplateTag]
|
||||||
|
|
||||||
@ -121,7 +127,8 @@ func (l *UserLogoTemplateTagSetLogic) UserLogoTemplateTagSet(req *types.UserLogo
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
templateTagSelected := make(map[string]interface{}, 3)
|
templateTagSelected := make(map[string]interface{}, 4)
|
||||||
|
templateTagSelected["version"] = userMaterialTemplateTagSelectedVersion
|
||||||
templateTagSelected["color"] = userMaterialTemplateTagIndex
|
templateTagSelected["color"] = userMaterialTemplateTagIndex
|
||||||
templateTagSelected["template_tag"] = req.TemplateTag
|
templateTagSelected["template_tag"] = req.TemplateTag
|
||||||
templateTagSelected["selected_index"] = req.TemplateTagColorIndex
|
templateTagSelected["selected_index"] = req.TemplateTagColorIndex
|
||||||
|
|||||||
@ -5,6 +5,10 @@ import (
|
|||||||
"fusenapi/utils/basic"
|
"fusenapi/utils/basic"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type UserLogoDataSetReq struct {
|
||||||
|
LogoDataId int64 `form:"logo_data_id"`
|
||||||
|
}
|
||||||
|
|
||||||
type UserLogoTemplateTagSetReq struct {
|
type UserLogoTemplateTagSetReq struct {
|
||||||
TemplateTag string `form:"template_tag"`
|
TemplateTag string `form:"template_tag"`
|
||||||
TemplateTagColorIndex int64 `form:"template_tag_color_index"`
|
TemplateTagColorIndex int64 `form:"template_tag_color_index"`
|
||||||
|
|||||||
@ -6,27 +6,27 @@ import (
|
|||||||
|
|
||||||
"fusenapi/utils/basic"
|
"fusenapi/utils/basic"
|
||||||
|
|
||||||
"fusenapi/server/product/internal/logic"
|
"fusenapi/server/info/internal/logic"
|
||||||
"fusenapi/server/product/internal/svc"
|
"fusenapi/server/info/internal/svc"
|
||||||
"fusenapi/server/product/internal/types"
|
"fusenapi/server/info/internal/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
func GetModelByPidHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
func PreLogoSearchHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||||
return func(w http.ResponseWriter, r *http.Request) {
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
var req types.GetModelByPidReq
|
var req types.PreLogoSearchRequest
|
||||||
userinfo, err := basic.RequestParse(w, r, svcCtx, &req)
|
userinfo, err := basic.RequestParse(w, r, svcCtx, &req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// 创建一个业务逻辑层实例
|
// 创建一个业务逻辑层实例
|
||||||
l := logic.NewGetModelByPidLogic(r.Context(), svcCtx)
|
l := logic.NewPreLogoSearchLogic(r.Context(), svcCtx)
|
||||||
|
|
||||||
rl := reflect.ValueOf(l)
|
rl := reflect.ValueOf(l)
|
||||||
basic.BeforeLogic(w, r, rl)
|
basic.BeforeLogic(w, r, rl)
|
||||||
|
|
||||||
resp := l.GetModelByPid(&req, userinfo)
|
resp := l.PreLogoSearch(&req, userinfo)
|
||||||
|
|
||||||
if !basic.AfterLogic(w, r, rl, resp) {
|
if !basic.AfterLogic(w, r, rl, resp) {
|
||||||
basic.NormalAfterLogic(w, r, resp)
|
basic.NormalAfterLogic(w, r, resp)
|
||||||
@ -0,0 +1,35 @@
|
|||||||
|
package handler
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net/http"
|
||||||
|
"reflect"
|
||||||
|
|
||||||
|
"fusenapi/utils/basic"
|
||||||
|
|
||||||
|
"fusenapi/server/info/internal/logic"
|
||||||
|
"fusenapi/server/info/internal/svc"
|
||||||
|
"fusenapi/server/info/internal/types"
|
||||||
|
)
|
||||||
|
|
||||||
|
func PreLogoSearchSuggestionsHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||||
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
|
var req types.PreLogoSearchSuggestionsRequest
|
||||||
|
userinfo, err := basic.RequestParse(w, r, svcCtx, &req)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 创建一个业务逻辑层实例
|
||||||
|
l := logic.NewPreLogoSearchSuggestionsLogic(r.Context(), svcCtx)
|
||||||
|
|
||||||
|
rl := reflect.ValueOf(l)
|
||||||
|
basic.BeforeLogic(w, r, rl)
|
||||||
|
|
||||||
|
resp := l.PreLogoSearchSuggestions(&req, userinfo)
|
||||||
|
|
||||||
|
if !basic.AfterLogic(w, r, rl, resp) {
|
||||||
|
basic.NormalAfterLogic(w, r, resp)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -22,6 +22,11 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
|
|||||||
Path: "/api/info/user/profile",
|
Path: "/api/info/user/profile",
|
||||||
Handler: UserGetProfileHandler(serverCtx),
|
Handler: UserGetProfileHandler(serverCtx),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
Method: http.MethodGet,
|
||||||
|
Path: "/api/info/user/profile/default",
|
||||||
|
Handler: UserGetDefaultProfileHandler(serverCtx),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
Method: http.MethodPost,
|
Method: http.MethodPost,
|
||||||
Path: "/api/info/user/profile/base/update",
|
Path: "/api/info/user/profile/base/update",
|
||||||
@ -62,6 +67,16 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
|
|||||||
Path: "/api/info/restaurant/list",
|
Path: "/api/info/restaurant/list",
|
||||||
Handler: RestaurantListHandler(serverCtx),
|
Handler: RestaurantListHandler(serverCtx),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
Method: http.MethodPost,
|
||||||
|
Path: "/api/info/prelogo/search/suggestions",
|
||||||
|
Handler: PreLogoSearchSuggestionsHandler(serverCtx),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
Method: http.MethodPost,
|
||||||
|
Path: "/api/info/prelogo/search",
|
||||||
|
Handler: PreLogoSearchHandler(serverCtx),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
Method: http.MethodPost,
|
Method: http.MethodPost,
|
||||||
Path: "/api/info/contact/us",
|
Path: "/api/info/contact/us",
|
||||||
|
|||||||
@ -6,12 +6,12 @@ import (
|
|||||||
|
|
||||||
"fusenapi/utils/basic"
|
"fusenapi/utils/basic"
|
||||||
|
|
||||||
"fusenapi/server/map-library/internal/logic"
|
"fusenapi/server/info/internal/logic"
|
||||||
"fusenapi/server/map-library/internal/svc"
|
"fusenapi/server/info/internal/svc"
|
||||||
"fusenapi/server/map-library/internal/types"
|
"fusenapi/server/info/internal/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
func SaveMapLibraryHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
func UserGetDefaultProfileHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||||
return func(w http.ResponseWriter, r *http.Request) {
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
var req types.Request
|
var req types.Request
|
||||||
@ -21,12 +21,12 @@ func SaveMapLibraryHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 创建一个业务逻辑层实例
|
// 创建一个业务逻辑层实例
|
||||||
l := logic.NewSaveMapLibraryLogic(r.Context(), svcCtx)
|
l := logic.NewUserGetDefaultProfileLogic(r.Context(), svcCtx)
|
||||||
|
|
||||||
rl := reflect.ValueOf(l)
|
rl := reflect.ValueOf(l)
|
||||||
basic.BeforeLogic(w, r, rl)
|
basic.BeforeLogic(w, r, rl)
|
||||||
|
|
||||||
resp := l.SaveMapLibrary(&req, userinfo)
|
resp := l.UserGetDefaultProfile(&req, userinfo)
|
||||||
|
|
||||||
if !basic.AfterLogic(w, r, rl, resp) {
|
if !basic.AfterLogic(w, r, rl, resp) {
|
||||||
basic.NormalAfterLogic(w, r, resp)
|
basic.NormalAfterLogic(w, r, resp)
|
||||||
57
server/info/internal/logic/prelogosearchlogic.go
Normal file
57
server/info/internal/logic/prelogosearchlogic.go
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
package logic
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fusenapi/utils/auth"
|
||||||
|
"fusenapi/utils/basic"
|
||||||
|
|
||||||
|
"context"
|
||||||
|
|
||||||
|
"fusenapi/server/info/internal/svc"
|
||||||
|
"fusenapi/server/info/internal/types"
|
||||||
|
|
||||||
|
"github.com/zeromicro/go-zero/core/logx"
|
||||||
|
)
|
||||||
|
|
||||||
|
type PreLogoSearchLogic struct {
|
||||||
|
logx.Logger
|
||||||
|
ctx context.Context
|
||||||
|
svcCtx *svc.ServiceContext
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewPreLogoSearchLogic(ctx context.Context, svcCtx *svc.ServiceContext) *PreLogoSearchLogic {
|
||||||
|
return &PreLogoSearchLogic{
|
||||||
|
Logger: logx.WithContext(ctx),
|
||||||
|
ctx: ctx,
|
||||||
|
svcCtx: svcCtx,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 处理进入前逻辑w,r
|
||||||
|
// func (l *PreLogoSearchLogic) BeforeLogic(w http.ResponseWriter, r *http.Request) {
|
||||||
|
// }
|
||||||
|
|
||||||
|
func (l *PreLogoSearchLogic) PreLogoSearch(req *types.PreLogoSearchRequest, userinfo *auth.UserInfo) (resp *basic.Response) {
|
||||||
|
// 返回值必须调用Set重新返回, resp可以空指针调用 resp.SetStatus(basic.CodeOK, data)
|
||||||
|
// userinfo 传入值时, 一定不为null
|
||||||
|
if userinfo.IsOnlooker() {
|
||||||
|
return resp.SetStatus(basic.CodeSearchAuthErr)
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(req.ZipCode) < 4 {
|
||||||
|
return resp.SetStatus(basic.CodeSearchZipCodeErr)
|
||||||
|
}
|
||||||
|
|
||||||
|
result, err := l.svcCtx.AllModels.FsPreprocessLogo.PreLogoSearch(l.ctx, req.ZipCode, req.Keywords, 1)
|
||||||
|
if err != nil {
|
||||||
|
return resp.SetStatus(basic.CodeApiErr, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
return resp.SetStatus(basic.CodeOK, map[string]any{
|
||||||
|
"result": result,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 处理逻辑后 w,r 如:重定向, resp 必须重新处理
|
||||||
|
// func (l *PreLogoSearchLogic) AfterLogic(w http.ResponseWriter, r *http.Request, resp *basic.Response) {
|
||||||
|
// // httpx.OkJsonCtx(r.Context(), w, resp)
|
||||||
|
// }
|
||||||
53
server/info/internal/logic/prelogosearchsuggestionslogic.go
Normal file
53
server/info/internal/logic/prelogosearchsuggestionslogic.go
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
package logic
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fusenapi/utils/auth"
|
||||||
|
"fusenapi/utils/basic"
|
||||||
|
|
||||||
|
"context"
|
||||||
|
|
||||||
|
"fusenapi/server/info/internal/svc"
|
||||||
|
"fusenapi/server/info/internal/types"
|
||||||
|
|
||||||
|
"github.com/zeromicro/go-zero/core/logx"
|
||||||
|
)
|
||||||
|
|
||||||
|
type PreLogoSearchSuggestionsLogic struct {
|
||||||
|
logx.Logger
|
||||||
|
ctx context.Context
|
||||||
|
svcCtx *svc.ServiceContext
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewPreLogoSearchSuggestionsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *PreLogoSearchSuggestionsLogic {
|
||||||
|
return &PreLogoSearchSuggestionsLogic{
|
||||||
|
Logger: logx.WithContext(ctx),
|
||||||
|
ctx: ctx,
|
||||||
|
svcCtx: svcCtx,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 处理进入前逻辑w,r
|
||||||
|
// func (l *PreLogoSearchSuggestionsLogic) BeforeLogic(w http.ResponseWriter, r *http.Request) {
|
||||||
|
// }
|
||||||
|
|
||||||
|
func (l *PreLogoSearchSuggestionsLogic) PreLogoSearchSuggestions(req *types.PreLogoSearchSuggestionsRequest, userinfo *auth.UserInfo) (resp *basic.Response) {
|
||||||
|
// 返回值必须调用Set重新返回, resp可以空指针调用 resp.SetStatus(basic.CodeOK, data)
|
||||||
|
// userinfo 传入值时, 一定不为null
|
||||||
|
if userinfo.IsOnlooker() {
|
||||||
|
return resp.SetStatus(basic.CodeSearchAuthErr)
|
||||||
|
}
|
||||||
|
|
||||||
|
result, err := l.svcCtx.AllModels.FsPreprocessLogo.PreLogoSearchSuggestions(l.ctx, req.Keywords, 5)
|
||||||
|
if err != nil {
|
||||||
|
return resp.SetStatus(basic.CodeApiErr, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
return resp.SetStatus(basic.CodeOK, map[string]any{
|
||||||
|
"result": result,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 处理逻辑后 w,r 如:重定向, resp 必须重新处理
|
||||||
|
// func (l *PreLogoSearchSuggestionsLogic) AfterLogic(w http.ResponseWriter, r *http.Request, resp *basic.Response) {
|
||||||
|
// // httpx.OkJsonCtx(r.Context(), w, resp)
|
||||||
|
// }
|
||||||
@ -42,7 +42,7 @@ func (l *UpdateProfileBaseLogic) UpdateProfileBase(req *types.ProfileRequest, us
|
|||||||
err := l.svcCtx.AllModels.FsUserInfo.MergeMetadata(userinfo.UserId, req)
|
err := l.svcCtx.AllModels.FsUserInfo.MergeMetadata(userinfo.UserId, req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logx.Error(err) // 日志记录错误
|
logx.Error(err) // 日志记录错误
|
||||||
return resp.SetStatus(basic.CodeDbSqlErr, err.Error()) // 返回数据库创建错误
|
return resp.SetStatus(basic.CodeDbSqlErr, err) // 返回数据库创建错误
|
||||||
}
|
}
|
||||||
|
|
||||||
return resp.SetStatus(basic.CodeOK)
|
return resp.SetStatus(basic.CodeOK)
|
||||||
|
|||||||
47
server/info/internal/logic/usergetdefaultprofilelogic.go
Normal file
47
server/info/internal/logic/usergetdefaultprofilelogic.go
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
package logic
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fusenapi/utils/auth"
|
||||||
|
"fusenapi/utils/basic"
|
||||||
|
|
||||||
|
"context"
|
||||||
|
|
||||||
|
"fusenapi/server/info/internal/svc"
|
||||||
|
"fusenapi/server/info/internal/types"
|
||||||
|
|
||||||
|
"github.com/zeromicro/go-zero/core/logx"
|
||||||
|
)
|
||||||
|
|
||||||
|
type UserGetDefaultProfileLogic struct {
|
||||||
|
logx.Logger
|
||||||
|
ctx context.Context
|
||||||
|
svcCtx *svc.ServiceContext
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewUserGetDefaultProfileLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UserGetDefaultProfileLogic {
|
||||||
|
return &UserGetDefaultProfileLogic{
|
||||||
|
Logger: logx.WithContext(ctx),
|
||||||
|
ctx: ctx,
|
||||||
|
svcCtx: svcCtx,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 处理进入前逻辑w,r
|
||||||
|
// func (l *UserGetDefaultProfileLogic) BeforeLogic(w http.ResponseWriter, r *http.Request) {
|
||||||
|
// }
|
||||||
|
|
||||||
|
func (l *UserGetDefaultProfileLogic) UserGetDefaultProfile(req *types.Request, userinfo *auth.UserInfo) (resp *basic.Response) {
|
||||||
|
// 返回值必须调用Set重新返回, resp可以空指针调用 resp.SetStatus(basic.CodeOK, data)
|
||||||
|
// userinfo 传入值时, 一定不为null
|
||||||
|
defaultProfile, err := l.svcCtx.AllModels.FsUserInfo.GetDefaultProfile(l.ctx)
|
||||||
|
if err != nil {
|
||||||
|
return resp.SetStatusWithMessage(basic.CodeApiErr, err.Error())
|
||||||
|
}
|
||||||
|
|
||||||
|
return resp.SetStatus(basic.CodeOK, defaultProfile)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 处理逻辑后 w,r 如:重定向, resp 必须重新处理
|
||||||
|
// func (l *UserGetDefaultProfileLogic) AfterLogic(w http.ResponseWriter, r *http.Request, resp *basic.Response) {
|
||||||
|
// // httpx.OkJsonCtx(r.Context(), w, resp)
|
||||||
|
// }
|
||||||
@ -34,15 +34,26 @@ func (l *UserGetProfileLogic) UserGetProfile(req *types.QueryProfileRequest, use
|
|||||||
// 返回值必须调用Set重新返回, resp可以空指针调用 resp.SetStatus(basic.CodeOK, data)
|
// 返回值必须调用Set重新返回, resp可以空指针调用 resp.SetStatus(basic.CodeOK, data)
|
||||||
// userinfo 传入值时, 一定不为null
|
// userinfo 传入值时, 一定不为null
|
||||||
|
|
||||||
if !userinfo.IsUser() {
|
profileBase, err := l.svcCtx.AllModels.FsUserInfo.GetProfile(l.ctx, req.TopKey, userinfo.UserId, userinfo.GuestId)
|
||||||
return resp.SetStatus(basic.CodeUnAuth)
|
|
||||||
}
|
|
||||||
|
|
||||||
profileBase, err := l.svcCtx.AllModels.FsUserInfo.GetProfile(l.ctx, req.TopKey, userinfo.UserId)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return resp.SetStatusWithMessage(basic.CodeApiErr, err.Error())
|
return resp.SetStatusWithMessage(basic.CodeApiErr, err.Error())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if userinfo.UserId != 0 {
|
||||||
|
user, err := l.svcCtx.AllModels.FsUser.FindUserById(context.TODO(), userinfo.UserId)
|
||||||
|
if err != nil {
|
||||||
|
logx.Error(err) // 日志记录错误
|
||||||
|
return resp.SetStatus(basic.CodeDbSqlErr, err) // 返回数据库创建错误
|
||||||
|
}
|
||||||
|
if bmap, ok := profileBase["base"].(map[string]any); ok {
|
||||||
|
bmap["email"] = *user.Email
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if bmap, ok := profileBase["base"].(map[string]any); ok {
|
||||||
|
bmap["email"] = ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return resp.SetStatus(basic.CodeOK, profileBase)
|
return resp.SetStatus(basic.CodeOK, profileBase)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -12,6 +12,15 @@ type ContactUsRequest struct {
|
|||||||
Message string `json:"message"`
|
Message string `json:"message"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type PreLogoSearchSuggestionsRequest struct {
|
||||||
|
Keywords string `json:"keywords"` // 关键字
|
||||||
|
}
|
||||||
|
|
||||||
|
type PreLogoSearchRequest struct {
|
||||||
|
ZipCode string `json:"zip_code"` // 邮编
|
||||||
|
Keywords string `json:"keywords"` // 关键字
|
||||||
|
}
|
||||||
|
|
||||||
type UserInfoRequest struct {
|
type UserInfoRequest struct {
|
||||||
Module []string `json:"module"`
|
Module []string `json:"module"`
|
||||||
}
|
}
|
||||||
@ -44,32 +53,32 @@ type AddressRequest struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type ProfileRequest struct {
|
type ProfileRequest struct {
|
||||||
ProfileBase *ProfileBase `json:"base,optional,omitempty"` // 基础的个人消息, 姓名 公司等
|
ProfileBase *ProfileBase `json:"base,optional"` // 基础的个人消息, 姓名 公司等
|
||||||
SubscriptionStatus *SubscriptionStatus `json:"sub_status,optional,omitempty"` // 订阅的通知状态
|
SubscriptionStatus *SubscriptionStatus `json:"sub_status,optional"` // 订阅的通知状态
|
||||||
}
|
}
|
||||||
|
|
||||||
type ProfileBase struct {
|
type ProfileBase struct {
|
||||||
FirstName *string `json:"first_name,optional,omitempty"` // 首名
|
FirstName *string `json:"first_name,optional"` // 首名
|
||||||
LastName *string `json:"last_name,optional,omitempty"` // 后名
|
LastName *string `json:"last_name,optional"` // 后名
|
||||||
Email *string `json:"email,optional,omitempty"` // email
|
Email *string `json:"email,optional"` // email
|
||||||
Mobile *string `json:"mobile,optional,omitempty"` // 电话
|
Mobile *string `json:"mobile,optional"` // 电话
|
||||||
Resetaurant *string `json:"resetaurant,optional,omitempty"` // 不知道干什么
|
Resetaurant *string `json:"resetaurant,optional"` // 不知道干什么
|
||||||
Company *string `json:"company,optional,omitempty"` // 公司
|
Company *string `json:"company,optional"` // 公司
|
||||||
}
|
}
|
||||||
|
|
||||||
type SubscriptionStatus struct {
|
type SubscriptionStatus struct {
|
||||||
NotificationEmail NotificationEmail `json:"notification_email,optional,omitempty"`
|
NotificationEmail NotificationEmail `json:"notification_email,optional"`
|
||||||
NotificationPhone NotificationPhone `json:"notification_phone,optional,omitempty"`
|
NotificationPhone NotificationPhone `json:"notification_phone,optional"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type NotificationEmail struct {
|
type NotificationEmail struct {
|
||||||
OrderUpdate bool `json:"order_update,optional,omitempty"`
|
OrderUpdate bool `json:"order_update,optional"`
|
||||||
Newseleter bool `json:"newseleter,optional,omitempty"`
|
Newseleter bool `json:"newseleter,optional"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type NotificationPhone struct {
|
type NotificationPhone struct {
|
||||||
OrderUpdate bool `json:"order_update,optional,omitempty"`
|
OrderUpdate bool `json:"order_update,optional"`
|
||||||
Newseleter bool `json:"newseleter,optional,omitempty"`
|
Newseleter bool `json:"newseleter,optional"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type QueryProfileRequest struct {
|
type QueryProfileRequest struct {
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user