Compare commits
457 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e8e2e8e315 | ||
|
|
5a1c6b9e7f | ||
|
|
1d98d8eecb | ||
|
|
fa2806e3aa | ||
|
|
761d9f45da | ||
|
|
07d9cfe5bc | ||
|
|
b9d7e0787c | ||
|
|
4ea6660402 | ||
|
|
8391596e2a | ||
|
|
0f1cfc129c | ||
|
|
3e33f9b363 | ||
|
|
a76cc4693f | ||
|
|
d75bb7b7cf | ||
|
|
6c87de7a97 | ||
|
|
0ba493d71d | ||
|
|
bd0f1f0b23 | ||
|
|
d45a96a919 | ||
|
|
55e02dde5e | ||
|
|
cb7814cbd6 | ||
|
|
2b1abc8aeb | ||
|
|
3376ce54cc | ||
|
|
d35b4d1ad6 | ||
|
|
7a2c45ddb5 | ||
|
|
d3648a7e89 | ||
|
|
c794bb6a26 | ||
|
|
3f8b2f7a30 | ||
|
|
2bc6d1bc9a | ||
|
|
ee53ddd097 | ||
|
|
1705817128 | ||
|
|
0f8936e9a9 | ||
|
|
e3792cde12 | ||
|
|
4792d83119 | ||
|
|
27888f503a | ||
|
|
8b0823f504 | ||
|
|
12476fc173 | ||
|
|
56cc0a92f6 | ||
|
|
88db57c64b | ||
|
|
cd1f465a81 | ||
|
|
a80b5ed961 | ||
|
|
7f54cb0de8 | ||
|
|
3549b216b0 | ||
|
|
3786c53cad | ||
|
|
178e0d18cd | ||
|
|
cbdcb6f1ce | ||
|
|
74cc5af5c9 | ||
|
|
392d90db57 | ||
|
|
c87081f673 | ||
|
|
f375432e7d | ||
|
|
3011645c44 | ||
|
|
322256cc5a | ||
|
|
02d017eb9e | ||
|
|
2f13bce20d | ||
|
|
e2bf90e340 | ||
|
|
9bc1247544 | ||
|
|
90a2ec9719 | ||
|
|
b61cfe8b6b | ||
|
|
28d57dff72 | ||
|
|
55270548c7 | ||
|
|
a45f9e7843 | ||
|
|
37cfcde476 | ||
|
|
9517f0eedf | ||
|
|
a9da0cdcc8 | ||
|
|
b3c537d034 | ||
|
|
2d4cf29da8 | ||
|
|
eea47aea55 | ||
|
|
2648a0b57e | ||
|
|
46dfe4650e | ||
|
|
7eca11d51b | ||
|
|
43022a9838 | ||
|
|
b873ec2095 | ||
|
|
18f8718de2 | ||
|
|
c6c0801d14 | ||
|
|
196d27b7c5 | ||
|
|
daed961a99 | ||
|
|
8387e03254 | ||
|
|
b6d43a069f | ||
|
|
558eea94e2 | ||
|
|
f5f99efff6 | ||
|
|
cc95fa92e7 | ||
|
|
9eba3287b2 | ||
|
|
46845dd4b9 | ||
|
|
c3be2cdfe5 | ||
|
|
443cf1829e | ||
|
|
ae833b245e | ||
|
|
88338877b0 | ||
|
|
0d74a4aecc | ||
|
|
1cf0496cd1 | ||
|
|
050b026166 | ||
|
|
8d95319e39 | ||
|
|
fe12b0a665 | ||
|
|
93dd2e06d8 | ||
|
|
05f29a264e | ||
|
|
26dd8ed13a | ||
|
|
72c58059bd | ||
|
|
7e596d47a6 | ||
|
|
c38a8c0475 | ||
|
|
15adbf489e | ||
|
|
98b863be6f | ||
|
|
ecd40523d4 | ||
|
|
7f6de6e64e | ||
|
|
002163fbdc | ||
|
|
da9ea504fb | ||
|
|
bb171f6e23 | ||
|
|
b860c2eed0 | ||
|
|
fdf81d1b39 | ||
|
|
40bf6d3010 | ||
|
|
2d63d36f51 | ||
|
|
ed976e90dc | ||
|
|
6f4994b5da | ||
|
|
a2a923809e | ||
|
|
8d06ccace9 | ||
|
|
99479e722a | ||
|
|
70890cdc19 | ||
|
|
0eebc544a6 | ||
|
|
12280e5769 | ||
|
|
4ec2c1b943 | ||
|
|
d6edb93403 | ||
|
|
3236a05ae9 | ||
|
|
5576ae7305 | ||
|
|
d5aadf6926 | ||
|
|
2eb469b228 | ||
|
|
088c6faae1 | ||
|
|
04f7d22e3f | ||
|
|
950274f6be | ||
|
|
c6596fff1a | ||
|
|
7cbbc57514 | ||
|
|
8041a4a4fc | ||
|
|
1fa247aa35 | ||
|
|
7de49dcfb8 | ||
|
|
b21e307640 | ||
|
|
aae7eedd49 | ||
|
|
bce60310c5 | ||
|
|
d17cb4ce96 | ||
|
|
4b25a03b1d | ||
|
|
682433efe4 | ||
|
|
a6f28d67eb | ||
|
|
c663aa2799 | ||
|
|
2c02b816b5 | ||
|
|
d14b87729a | ||
|
|
70b41ab8a8 | ||
|
|
d185b548f7 | ||
|
|
4b5dcec08b | ||
|
|
13a7a875a4 | ||
|
|
8743bf4b93 | ||
|
|
d8792e9e27 | ||
|
|
82a0cd0336 | ||
|
|
60ae5b8965 | ||
|
|
4d4b54ec36 | ||
|
|
53f6910a34 | ||
|
|
826c3a8f8f | ||
|
|
727ddd3198 | ||
|
|
7b535434ae | ||
|
|
da8ed53c60 | ||
|
|
40e9d6f392 | ||
|
|
d189f55de1 | ||
|
|
893f4a0388 | ||
|
|
a28547c581 | ||
|
|
a8079e0d35 | ||
|
|
60a210a45f | ||
|
|
170aa01946 | ||
|
|
f4c8e5d493 | ||
|
|
b3a0a402d7 | ||
|
|
b6c70d1530 | ||
|
|
8fbc7b9f5c | ||
|
|
3c2e73b5f5 | ||
|
|
1a221eefe3 | ||
|
|
5912428c00 | ||
|
|
f01236cc96 | ||
|
|
ad1f5a297e | ||
|
|
96697e11fd | ||
|
|
25e8b9b578 | ||
|
|
49603e29bd | ||
|
|
6a18489c15 | ||
|
|
cb52fca2a4 | ||
|
|
00964e6bbf | ||
|
|
ea1b91af2a | ||
|
|
8894e5482f | ||
|
|
e17e3474ca | ||
|
|
6d09bd4987 | ||
|
|
84f3907140 | ||
|
|
d704e2eb55 | ||
|
|
2e4c6f4284 | ||
|
|
61c77e0047 | ||
|
|
cf1e6fc283 | ||
|
|
b361e46fb7 | ||
|
|
7bb06e7fdc | ||
|
|
9f83b40be4 | ||
|
|
1edd3441bc | ||
|
|
079a4a2cf6 | ||
|
|
049a759cda | ||
|
|
a6ff38159f | ||
|
|
056f040317 | ||
|
|
c161206832 | ||
|
|
e9a0c293f8 | ||
|
|
24de62f5f4 | ||
|
|
b7b278f296 | ||
|
|
712941038b | ||
|
|
4316fa8953 | ||
|
|
d14763d52c | ||
|
|
79e1f34890 | ||
|
|
3cb8e066b3 | ||
|
|
5e6a56e193 | ||
|
|
478ba2048a | ||
|
|
8426294a0f | ||
|
|
178954c8b2 | ||
|
|
6ce2b65d89 | ||
|
|
fb45fee426 | ||
|
|
ffca49f469 | ||
|
|
f32c7a7253 | ||
|
|
a64ccdba78 | ||
|
|
5f6bae6fa9 | ||
|
|
fd503b4071 | ||
|
|
9ece357e39 | ||
|
|
d53c8362a2 | ||
|
|
8f3ca8c28d | ||
|
|
7f5675ae3c | ||
|
|
7b9f4be98c | ||
|
|
ca352ca341 | ||
|
|
a22ccbdda5 | ||
|
|
e6b50248de | ||
|
|
ee3f8a9261 | ||
|
|
922d7222cd | ||
|
|
4a8900105b | ||
|
|
65a4bb7778 | ||
|
|
3944551c06 | ||
|
|
66d7ffbb17 | ||
|
|
c4d879a0ad | ||
|
|
b97f77c740 | ||
|
|
27ad9b0599 | ||
|
|
234b8ab31c | ||
|
|
519a608316 | ||
|
|
d4a13c8a82 | ||
|
|
ccb57411a2 | ||
|
|
486bebe6d2 | ||
|
|
5b3129bf01 | ||
|
|
23c742c4c6 | ||
|
|
90d3bbd79e | ||
|
|
400a06d2ac | ||
|
|
594d2f620c | ||
|
|
1a6ec578de | ||
|
|
e009604595 | ||
|
|
8b23c623d1 | ||
|
|
a3c4e72902 | ||
|
|
7e54412fc3 | ||
|
|
564970a324 | ||
|
|
1ecd32027e | ||
|
|
ceb5727337 | ||
|
|
17c7552f7f | ||
|
|
8fbcad8856 | ||
|
|
a61fd454b4 | ||
|
|
c0337afbaa | ||
|
|
acb9e78a36 | ||
|
|
431ff04644 | ||
|
|
201fb0a136 | ||
|
|
90671729ea | ||
|
|
8596175f8e | ||
|
|
e9fdec6bb0 | ||
|
|
026b6aca07 | ||
|
|
fafe3c0c55 | ||
|
|
f2b327c811 | ||
|
|
7fccbc2aa2 | ||
|
|
7c40f5988b | ||
|
|
b19e4043cd | ||
|
|
db75aa1cab | ||
|
|
f5718b4062 | ||
|
|
d25f17782b | ||
|
|
e3626a094d | ||
|
|
fc7b17fe40 | ||
|
|
87e13b3677 | ||
|
|
a540e42460 | ||
|
|
c4e24fb0a3 | ||
|
|
31fb55635e | ||
|
|
3dcff0b682 | ||
|
|
81f48d9c92 | ||
|
|
6331b0d587 | ||
|
|
57cf3b94e0 | ||
|
|
b683eac996 | ||
|
|
ccdcb1d0f6 | ||
|
|
4f5f02f030 | ||
|
|
0629ce51af | ||
|
|
46f1fcc269 | ||
|
|
b49b0290f8 | ||
|
|
7ca351f7cd | ||
|
|
850b124da3 | ||
|
|
49a2d3cab3 | ||
|
|
038eda1562 | ||
|
|
b91c8e34c2 | ||
|
|
0a631a7c93 | ||
|
|
4705c2595a | ||
|
|
0ff6809d63 | ||
|
|
a375feabfc | ||
|
|
5b9fd139a3 | ||
|
|
fd92d93289 | ||
|
|
840637c0d0 | ||
|
|
f41f5386cc | ||
|
|
f4a7d8ea92 | ||
|
|
26c9160c75 | ||
|
|
4c1955da75 | ||
|
|
66e6272571 | ||
|
|
e9d5e705ed | ||
|
|
16fdb28141 | ||
|
|
e289cf29fe | ||
|
|
1cd74cc26a | ||
|
|
27112e35b3 | ||
|
|
b2a8578f43 | ||
|
|
0e0a8b039d | ||
|
|
cbd201c43b | ||
|
|
a6d734bacf | ||
|
|
8dc86e0482 | ||
|
|
d0226611d7 | ||
|
|
2b21c3cd09 | ||
|
|
b1bdd9b8a5 | ||
|
|
bb50510ecb | ||
|
|
aa185c8bd2 | ||
|
|
99e3b234c9 | ||
|
|
5168d8d08d | ||
|
|
230a8810ef | ||
|
|
e8e8c1abcc | ||
|
|
0354d6dc3e | ||
|
|
47ad388f7d | ||
|
|
2d57483805 | ||
|
|
363dbd3a7f | ||
|
|
5b5863c899 | ||
|
|
4c1ae8c3cc | ||
|
|
29ed211519 | ||
|
|
9f965c4e56 | ||
|
|
0148868129 | ||
|
|
d46863b5b5 | ||
|
|
1917aa13d5 | ||
|
|
2994131048 | ||
|
|
f0d6938127 | ||
|
|
0203630d6a | ||
|
|
89c5c2dd83 | ||
|
|
ce1954e7d3 | ||
|
|
947a82eac5 | ||
|
|
9dc01f6057 | ||
|
|
37c5ce541b | ||
|
|
726eb06714 | ||
|
|
df505e0e17 | ||
|
|
06fffac835 | ||
|
|
264a423444 | ||
|
|
6ae9692358 | ||
|
|
7270564b10 | ||
|
|
a485a29868 | ||
|
|
ec04c3221f | ||
|
|
761982474c | ||
|
|
d13b0404fb | ||
|
|
6966376f91 | ||
|
|
2720f5c0bb | ||
|
|
881f039e44 | ||
|
|
81c7a72b9c | ||
|
|
c0391e3fc1 | ||
|
|
7e542750f6 | ||
|
|
7cbf638822 | ||
|
|
4cdb461c22 | ||
|
|
ba57f19ee7 | ||
|
|
9ba2693698 | ||
|
|
3439b7aee5 | ||
|
|
63b23fbe76 | ||
|
|
63fff2398e | ||
|
|
db8796df99 | ||
|
|
4095481411 | ||
|
|
8e30defa0e | ||
|
|
06ee6d6359 | ||
|
|
a988dedfbf | ||
|
|
f90c6fb27d | ||
|
|
5292d6ef90 | ||
|
|
e760af7216 | ||
|
|
e4889d82f2 | ||
|
|
9d170ecc30 | ||
|
|
cf01011504 | ||
|
|
b1291d3c43 | ||
|
|
82546eed06 | ||
|
|
bf667e2aa6 | ||
|
|
5b6f208f53 | ||
|
|
210d56447c | ||
|
|
c093261369 | ||
|
|
ee4f87d12d | ||
|
|
74b0a5b081 | ||
|
|
f51774c077 | ||
|
|
bd9f7b8b9f | ||
|
|
dc55bd63f5 | ||
|
|
07ce947f78 | ||
|
|
0f6cc70f66 | ||
|
|
6d014a01bc | ||
|
|
de5e97ac3a | ||
|
|
40e866aadd | ||
|
|
36ce7593a9 | ||
|
|
a2a28af41d | ||
|
|
203a30a236 | ||
|
|
b7d418b5b7 | ||
|
|
1625f7ca76 | ||
|
|
8a67b905fc | ||
|
|
9ee76b5328 | ||
|
|
df9dd7f435 | ||
|
|
9d0d318d66 | ||
|
|
ee1723a76b | ||
|
|
c715422814 | ||
|
|
72e7941230 | ||
|
|
ac475ca456 | ||
|
|
ee5355668d | ||
|
|
1b30f0ad31 | ||
|
|
348f362b30 | ||
|
|
6bef12b91b | ||
|
|
5b4113be4d | ||
|
|
a82d3fe57c | ||
|
|
4d551366ed | ||
|
|
441cb6ddcb | ||
|
|
f14efa2612 | ||
|
|
f4d7c07f57 | ||
|
|
66b2f1f55d | ||
|
|
b9b2c10ca0 | ||
|
|
0d5f871da7 | ||
|
|
1688a7ba15 | ||
|
|
3506e1c738 | ||
|
|
ae0c4aea12 | ||
|
|
a52b672e9b | ||
|
|
c4307aa821 | ||
|
|
a2c32009f5 | ||
|
|
e27185d424 | ||
|
|
0714480e01 | ||
|
|
504ee766f8 | ||
|
|
7358fd0c23 | ||
|
|
25be7094a2 | ||
|
|
627a1d7d5a | ||
|
|
63b84ee69d | ||
|
|
5eb76176ab | ||
|
|
6115ecf673 | ||
|
|
d1a112d3a3 | ||
|
|
7d67e6a007 | ||
|
|
b824ee625e | ||
|
|
961ac20213 | ||
|
|
f213b6f53f | ||
|
|
631600ab3f | ||
|
|
d95fce2efb | ||
|
|
1c6c009f14 | ||
|
|
f555f6423a | ||
|
|
cd374f2d98 | ||
|
|
c62f31c387 | ||
|
|
87ccad6ec7 | ||
|
|
1600f7cdab | ||
|
|
dc3256566b | ||
|
|
b0858429fb | ||
|
|
2f3e2a5ae8 | ||
|
|
f280ab88ec | ||
|
|
5b1b75cbbe | ||
|
|
b5e709f5e5 | ||
|
|
65bd2ff35f | ||
|
|
4468657030 | ||
|
|
4ad95a65cf | ||
|
|
31f6c19e87 | ||
|
|
612d1d1646 | ||
|
|
eddf3ecdeb | ||
|
|
bf8f8d9382 | ||
|
|
d5091bf659 | ||
|
|
fd003eff8b | ||
|
|
4d1dfebacd |
@@ -7,6 +7,7 @@
|
|||||||
Source Host : 192.168.0.116:3306
|
Source Host : 192.168.0.116:3306
|
||||||
Source Schema : lilishop
|
Source Schema : lilishop
|
||||||
|
|
||||||
|
|
||||||
Target Server Type : MySQL
|
Target Server Type : MySQL
|
||||||
Target Server Version : 80023
|
Target Server Version : 80023
|
||||||
File Encoding : 65001
|
File Encoding : 65001
|
||||||
|
|||||||
189783
DB/lilishop.sql
Normal file
189783
DB/lilishop.sql
Normal file
File diff suppressed because one or more lines are too long
2
DB/update.sql
Normal file
2
DB/update.sql
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
/** 店铺--默认页面是否开启**/
|
||||||
|
ALTER TABLE li_store ADD page_show bit(1) DEFAULT NULL COMMENT '默认页面是否开启';
|
||||||
@@ -6,7 +6,7 @@ ALTER TABLE li_distribution ADD settlement_bank_branch_name varchar ( 200 );
|
|||||||
/** 文章分类添加默认值**/
|
/** 文章分类添加默认值**/
|
||||||
ALTER TABLE li_article_category alter column sort set default 0;
|
ALTER TABLE li_article_category alter column sort set default 0;
|
||||||
/** 添加分销提现菜单**/
|
/** 添加分销提现菜单**/
|
||||||
INSERT INTO `lilishop`.`li_menu`(`id`, `create_by`, `create_time`, `delete_flag`, `update_by`, `update_time`, `description`, `front_route`, `icon`, `level`, `name`, `parent_id`, `path`, `sort_order`, `title`, `front_component`) VALUES (1410862675914764290, 'admin', '2021-07-02 15:27:29', b'0', 'admin', '2021-07-02 15:27:45', 'null', 'distribution/distributionCash', '', 2, 'distributionCash', '1374173575405109248', 'distributionCash', 5.00, '分销提现', 'null');
|
INSERT INTO `rxshop`.`li_menu`(`id`, `create_by`, `create_time`, `delete_flag`, `update_by`, `update_time`, `description`, `front_route`, `icon`, `level`, `name`, `parent_id`, `path`, `sort_order`, `title`, `front_component`) VALUES (1410862675914764290, 'admin', '2021-07-02 15:27:29', b'0', 'admin', '2021-07-02 15:27:45', 'null', 'distribution/distributionCash', '', 2, 'distributionCash', '1374173575405109248', 'distributionCash', 5.00, '分销提现', 'null');
|
||||||
|
|
||||||
/** 促销商品添加商品类型**/
|
/** 促销商品添加商品类型**/
|
||||||
ALTER TABLE li_promotion_goods ADD goods_type varchar (200);
|
ALTER TABLE li_promotion_goods ADD goods_type varchar (200);
|
||||||
@@ -16,7 +16,7 @@ update li_member_points_history set point_type = 'INCREASE' where point_type=1;
|
|||||||
update li_member_points_history set point_type = 'REDUCE' where point_type=0;
|
update li_member_points_history set point_type = 'REDUCE' where point_type=0;
|
||||||
|
|
||||||
/** 添加分词管理菜单*/
|
/** 添加分词管理菜单*/
|
||||||
INSERT INTO `lilishop`.`li_menu` (`id`, `create_by`, `create_time`, `delete_flag`, `update_by`, `update_time`, `description`, `front_route`, `icon`, `level`, `name`, `parent_id`, `path`, `sort_order`, `title`, `front_component`) VALUES (1349247640584085511, 'admin', '2021-01-13 14:51:20', b'0', 'admin', '2021-02-25 09:02:59', 'null', 'customWords/index', 'ios-american-football', 2, 'customWords', '1349237129847005184', 'customWords', 8.00, '分词管理', 'null');
|
INSERT INTO `rxshop`.`li_menu` (`id`, `create_by`, `create_time`, `delete_flag`, `update_by`, `update_time`, `description`, `front_route`, `icon`, `level`, `name`, `parent_id`, `path`, `sort_order`, `title`, `front_component`) VALUES (1349247640584085511, 'admin', '2021-01-13 14:51:20', b'0', 'admin', '2021-02-25 09:02:59', 'null', 'customWords/index', 'ios-american-football', 2, 'customWords', '1349237129847005184', 'customWords', 8.00, '分词管理', 'null');
|
||||||
|
|
||||||
/** 修改会员评价店铺图片字段类型 **/
|
/** 修改会员评价店铺图片字段类型 **/
|
||||||
alter table li_member_evaluation modify column reply_image text;
|
alter table li_member_evaluation modify column reply_image text;
|
||||||
@@ -25,4 +25,4 @@ alter table li_member_evaluation modify column reply_image text;
|
|||||||
alter table li_after_sale modify column after_sale_image text;
|
alter table li_after_sale modify column after_sale_image text;
|
||||||
|
|
||||||
/** 提现申请审核sql **/
|
/** 提现申请审核sql **/
|
||||||
INSERT INTO `lilishop`.`li_menu`(`id`, `create_by`, `create_time`, `delete_flag`, `update_by`, `update_time`, `description`, `front_route`, `icon`, `level`, `name`, `parent_id`, `path`, `sort_order`, `title`, `front_component`) VALUES (1367042804944994305, 'admin', '2021-03-03 09:22:58', b'0', NULL, NULL, NULL, 'member/advance/withdrawApply', 'ios-alert', 2, 'withdrawApply', '1367042490443497472', 'withdrawApply', 1.00, '提现申请', NULL);
|
INSERT INTO `rxshop`.`li_menu`(`id`, `create_by`, `create_time`, `delete_flag`, `update_by`, `update_time`, `description`, `front_route`, `icon`, `level`, `name`, `parent_id`, `path`, `sort_order`, `title`, `front_component`) VALUES (1367042804944994305, 'admin', '2021-03-03 09:22:58', b'0', NULL, NULL, NULL, 'member/advance/withdrawApply', 'ios-alert', 2, 'withdrawApply', '1367042490443497472', 'withdrawApply', 1.00, '提现申请', NULL);
|
||||||
|
|||||||
@@ -1,2 +1,64 @@
|
|||||||
/** 新增已退货数量 **/
|
/** 新增已退货数量 **/
|
||||||
ALTER TABLE li_order_item ADD return_goods_number int DEFAULT 0 COMMENT '退货数量 ';
|
ALTER TABLE li_order_item ADD return_goods_number int DEFAULT 0 COMMENT '退货数量 ';
|
||||||
|
|
||||||
|
|
||||||
|
-- 促销重构sql
|
||||||
|
ALTER TABLE li_coupon DROP COLUMN promotion_status;
|
||||||
|
|
||||||
|
ALTER TABLE li_coupon_activity DROP COLUMN promotion_status;
|
||||||
|
ALTER TABLE li_coupon_activity ADD `scope_id` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '范围关联的ID';
|
||||||
|
ALTER TABLE li_coupon_activity ADD `scope_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT 'PORTION_GOODS' COMMENT '关联范围类型';
|
||||||
|
|
||||||
|
ALTER TABLE li_full_discount DROP COLUMN promotion_status;
|
||||||
|
ALTER TABLE li_full_discount ADD `scope_id` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT '范围关联的ID';
|
||||||
|
ALTER TABLE li_full_discount ADD `scope_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT 'PORTION_GOODS' COMMENT '关联范围类型';
|
||||||
|
|
||||||
|
ALTER TABLE li_kanjia_activity_goods DROP COLUMN promotion_status;
|
||||||
|
ALTER TABLE li_kanjia_activity_goods ADD `scope_id` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT '范围关联的ID';
|
||||||
|
ALTER TABLE li_kanjia_activity_goods ADD `scope_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT 'PORTION_GOODS' COMMENT '关联范围类型';
|
||||||
|
ALTER TABLE li_kanjia_activity_goods ADD `goods_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL;
|
||||||
|
|
||||||
|
ALTER TABLE li_pintuan DROP COLUMN promotion_status;
|
||||||
|
ALTER TABLE li_pintuan ADD `scope_id` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT '范围关联的ID';
|
||||||
|
ALTER TABLE li_pintuan ADD `scope_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT 'PORTION_GOODS' COMMENT '关联范围类型';
|
||||||
|
|
||||||
|
ALTER TABLE li_points_goods DROP COLUMN promotion_status;
|
||||||
|
ALTER TABLE li_points_goods ADD `scope_id` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT '范围关联的ID';
|
||||||
|
ALTER TABLE li_points_goods ADD `scope_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT 'PORTION_GOODS' COMMENT '关联范围类型';
|
||||||
|
ALTER TABLE li_points_goods ADD `original_price` double(10,2) DEFAULT NULL COMMENT '原价';
|
||||||
|
ALTER TABLE li_points_goods ADD `thumbnail` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '缩略图';
|
||||||
|
ALTER TABLE li_points_goods ADD `goods_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '商品编号';
|
||||||
|
ALTER TABLE li_points_goods ADD `goods_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '货品名称';
|
||||||
|
|
||||||
|
ALTER TABLE li_promotion_goods DROP COLUMN promotion_status;
|
||||||
|
ALTER TABLE li_promotion_goods ADD `scope_id` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT '范围关联的ID';
|
||||||
|
ALTER TABLE li_promotion_goods ADD `scope_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT 'PORTION_GOODS' COMMENT '关联范围类型';
|
||||||
|
ALTER TABLE li_promotion_goods ADD `original_price` double(10,2) DEFAULT NULL COMMENT '原价';
|
||||||
|
ALTER TABLE li_promotion_goods ADD `points` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '兑换积分';
|
||||||
|
ALTER TABLE li_promotion_goods ADD `goods_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '商品编号';
|
||||||
|
|
||||||
|
ALTER TABLE li_seckill DROP COLUMN promotion_status;
|
||||||
|
ALTER TABLE li_seckill ADD `scope_id` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT '范围关联的ID';
|
||||||
|
ALTER TABLE li_seckill ADD `scope_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT 'PORTION_GOODS' COMMENT '关联范围类型';
|
||||||
|
|
||||||
|
ALTER TABLE li_full_discount RENAME COLUMN is_coupon TO coupon_flag;
|
||||||
|
ALTER TABLE li_full_discount RENAME COLUMN is_free_freight TO free_freight_flag;
|
||||||
|
ALTER TABLE li_full_discount RENAME COLUMN is_full_minus TO full_minus_flag;
|
||||||
|
ALTER TABLE li_full_discount RENAME COLUMN is_full_rate TO full_rate_flag;
|
||||||
|
ALTER TABLE li_full_discount RENAME COLUMN is_gift TO gift_flag;
|
||||||
|
ALTER TABLE li_full_discount RENAME COLUMN is_point TO point_flag;
|
||||||
|
|
||||||
|
ALTER TABLE li_member_coupon RENAME COLUMN is_platform TO platform_flag;
|
||||||
|
|
||||||
|
ALTER TABLE li_goods RENAME COLUMN is_auth TO auth_flag;
|
||||||
|
|
||||||
|
ALTER TABLE li_goods_sku RENAME COLUMN is_promotion TO promotion_flag;
|
||||||
|
ALTER TABLE li_goods_sku RENAME COLUMN is_auth TO auth_flag;
|
||||||
|
|
||||||
|
|
||||||
|
-- 增加会员表索引
|
||||||
|
ALTER TABLE li_member ADD INDEX query_mobile (`mobile`) COMMENT 'query_member';
|
||||||
|
-- 会员签到唯一索引 惠券查询索引
|
||||||
|
ALTER TABLE li_member_sign ADD INDEX query_create_time (`create_time`) COMMENT 'query_create_time';
|
||||||
|
ALTER TABLE li_member_sign ADD INDEX query_member_id (`member_id`) COMMENT 'query_member_id';
|
||||||
|
ALTER TABLE li_member_sign add unique uk_member_day (member_id, create_time) COMMENT 'uk_member_day';
|
||||||
@@ -1,64 +0,0 @@
|
|||||||
/** 新增已退货数量 **/
|
|
||||||
ALTER TABLE li_order_item ADD return_goods_number int DEFAULT 0 COMMENT '退货数量 ';
|
|
||||||
|
|
||||||
|
|
||||||
-- 促销重构sql
|
|
||||||
ALTER TABLE li_coupon DROP COLUMN promotion_status;
|
|
||||||
|
|
||||||
ALTER TABLE li_coupon_activity DROP COLUMN promotion_status;
|
|
||||||
ALTER TABLE li_coupon_activity ADD `scope_id` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '范围关联的ID';
|
|
||||||
ALTER TABLE li_coupon_activity ADD `scope_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT 'PORTION_GOODS' COMMENT '关联范围类型';
|
|
||||||
|
|
||||||
ALTER TABLE li_full_discount DROP COLUMN promotion_status;
|
|
||||||
ALTER TABLE li_full_discount ADD `scope_id` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT '范围关联的ID';
|
|
||||||
ALTER TABLE li_full_discount ADD `scope_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT 'PORTION_GOODS' COMMENT '关联范围类型';
|
|
||||||
|
|
||||||
ALTER TABLE li_kanjia_activity_goods DROP COLUMN promotion_status;
|
|
||||||
ALTER TABLE li_kanjia_activity_goods ADD `scope_id` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT '范围关联的ID';
|
|
||||||
ALTER TABLE li_kanjia_activity_goods ADD `scope_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT 'PORTION_GOODS' COMMENT '关联范围类型';
|
|
||||||
ALTER TABLE li_kanjia_activity_goods ADD `goods_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL;
|
|
||||||
|
|
||||||
ALTER TABLE li_pintuan DROP COLUMN promotion_status;
|
|
||||||
ALTER TABLE li_pintuan ADD `scope_id` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT '范围关联的ID';
|
|
||||||
ALTER TABLE li_pintuan ADD `scope_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT 'PORTION_GOODS' COMMENT '关联范围类型';
|
|
||||||
|
|
||||||
ALTER TABLE li_points_goods DROP COLUMN promotion_status;
|
|
||||||
ALTER TABLE li_points_goods ADD `scope_id` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT '范围关联的ID';
|
|
||||||
ALTER TABLE li_points_goods ADD `scope_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT 'PORTION_GOODS' COMMENT '关联范围类型';
|
|
||||||
ALTER TABLE li_points_goods ADD `original_price` double(10,2) DEFAULT NULL COMMENT '原价';
|
|
||||||
ALTER TABLE li_points_goods ADD `thumbnail` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '缩略图';
|
|
||||||
ALTER TABLE li_points_goods ADD `goods_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '商品编号';
|
|
||||||
ALTER TABLE li_points_goods ADD `goods_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '货品名称';
|
|
||||||
|
|
||||||
ALTER TABLE li_promotion_goods DROP COLUMN promotion_status;
|
|
||||||
ALTER TABLE li_promotion_goods ADD `scope_id` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT '范围关联的ID';
|
|
||||||
ALTER TABLE li_promotion_goods ADD `scope_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT 'PORTION_GOODS' COMMENT '关联范围类型';
|
|
||||||
ALTER TABLE li_promotion_goods ADD `original_price` double(10,2) DEFAULT NULL COMMENT '原价';
|
|
||||||
ALTER TABLE li_promotion_goods ADD `points` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '兑换积分';
|
|
||||||
ALTER TABLE li_promotion_goods ADD `goods_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '商品编号';
|
|
||||||
|
|
||||||
ALTER TABLE li_seckill DROP COLUMN promotion_status;
|
|
||||||
ALTER TABLE li_seckill ADD `scope_id` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT '范围关联的ID';
|
|
||||||
ALTER TABLE li_seckill ADD `scope_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT 'PORTION_GOODS' COMMENT '关联范围类型';
|
|
||||||
|
|
||||||
ALTER TABLE li_full_discount RENAME COLUMN is_coupon TO coupon_flag;
|
|
||||||
ALTER TABLE li_full_discount RENAME COLUMN is_free_freight TO free_freight_flag;
|
|
||||||
ALTER TABLE li_full_discount RENAME COLUMN is_full_minus TO full_minus_flag;
|
|
||||||
ALTER TABLE li_full_discount RENAME COLUMN is_full_rate TO full_rate_flag;
|
|
||||||
ALTER TABLE li_full_discount RENAME COLUMN is_gift TO gift_flag;
|
|
||||||
ALTER TABLE li_full_discount RENAME COLUMN is_point TO point_flag;
|
|
||||||
|
|
||||||
ALTER TABLE li_member_coupon RENAME COLUMN is_platform TO platform_flag;
|
|
||||||
|
|
||||||
ALTER TABLE li_goods RENAME COLUMN is_auth TO auth_flag;
|
|
||||||
|
|
||||||
ALTER TABLE li_goods_sku RENAME COLUMN is_promotion TO promotion_flag;
|
|
||||||
ALTER TABLE li_goods_sku RENAME COLUMN is_auth TO auth_flag;
|
|
||||||
|
|
||||||
|
|
||||||
-- 增加会员表索引
|
|
||||||
ALTER TABLE li_member ADD INDEX query_mobile (`mobile`) COMMENT 'query_member';
|
|
||||||
-- 会员签到唯一索引 惠券查询索引
|
|
||||||
ALTER TABLE li_member_sign ADD INDEX query_create_time (`create_time`) COMMENT 'query_create_time';
|
|
||||||
ALTER TABLE li_member_sign ADD INDEX query_member_id (`member_id`) COMMENT 'query_member_id';
|
|
||||||
ALTER TABLE li_member_sign add unique uk_member_day (member_id, create_time) COMMENT 'uk_member_day';
|
|
||||||
521
DB/version4.2.4to4.2.5.sql
Normal file
521
DB/version4.2.4to4.2.5.sql
Normal file
@@ -0,0 +1,521 @@
|
|||||||
|
/**增加店铺发货信息**/
|
||||||
|
ALTER TABLE li_store_detail ADD `sales_consignor_address_id` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '发货地址id';
|
||||||
|
ALTER TABLE li_store_detail ADD `sales_consignor_address_path` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '发货地址名称';
|
||||||
|
ALTER TABLE li_store_detail ADD `sales_consignor_detail` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '发货详细地址';
|
||||||
|
ALTER TABLE li_store_detail ADD `sales_consignor_mobile` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '发货人手机';
|
||||||
|
ALTER TABLE li_store_detail ADD `sales_consignor_name` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '发货人姓名';
|
||||||
|
|
||||||
|
/**增加电子面单店铺信息**/
|
||||||
|
ALTER TABLE `li_store_logistics` ADD `customer_name` varchar(255) DEFAULT NULL COMMENT '客户代码';
|
||||||
|
ALTER TABLE `li_store_logistics` ADD `customer_pwd` varchar(255) DEFAULT NULL COMMENT '客户密码';
|
||||||
|
ALTER TABLE `li_store_logistics` ADD `month_code` varchar(255) DEFAULT NULL COMMENT '月结号/密钥';
|
||||||
|
ALTER TABLE `li_store_logistics` ADD `send_site` varchar(255) DEFAULT NULL COMMENT '归属网点';
|
||||||
|
ALTER TABLE `li_store_logistics` ADD `send_staff` varchar(255) DEFAULT NULL COMMENT '收件快递员';
|
||||||
|
ALTER TABLE `li_store_logistics` ADD `face_sheet_flag` bit(1) DEFAULT NULL COMMENT '是否使用电子面单';
|
||||||
|
ALTER TABLE `li_store_logistics` ADD `pay_type` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '支付方式';
|
||||||
|
ALTER TABLE `li_store_logistics` ADD `exp_type` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '快递类型';
|
||||||
|
|
||||||
|
/** 店铺--默认页面是否开启**/
|
||||||
|
ALTER TABLE li_store ADD page_show bit(1) DEFAULT NULL COMMENT '默认页面是否开启';
|
||||||
|
|
||||||
|
/** 创建店员表 **/
|
||||||
|
/*
|
||||||
|
Navicat Premium Data Transfer
|
||||||
|
|
||||||
|
Source Server : lilishop
|
||||||
|
Source Server Type : MySQL
|
||||||
|
Source Server Version : 80025
|
||||||
|
Source Host : 192.168.0.116:3306
|
||||||
|
Source Schema : zhimai1
|
||||||
|
|
||||||
|
Target Server Type : MySQL
|
||||||
|
Target Server Version : 80025
|
||||||
|
File Encoding : 65001
|
||||||
|
|
||||||
|
Date: 03/03/2022 19:30:20
|
||||||
|
*/
|
||||||
|
|
||||||
|
SET NAMES utf8mb4;
|
||||||
|
SET FOREIGN_KEY_CHECKS = 0;
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- Table structure for li_clerk
|
||||||
|
-- ----------------------------
|
||||||
|
DROP TABLE IF EXISTS `li_clerk`;
|
||||||
|
CREATE TABLE `li_clerk` (
|
||||||
|
`id` bigint NOT NULL COMMENT 'ID',
|
||||||
|
`create_by` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '创建者',
|
||||||
|
`create_time` datetime(6) NULL DEFAULT NULL COMMENT '创建时间',
|
||||||
|
`delete_flag` bit(1) NULL DEFAULT NULL COMMENT '删除标志 true/false 删除/未删除',
|
||||||
|
`update_by` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '更新者',
|
||||||
|
`update_time` datetime(6) NULL DEFAULT NULL COMMENT '更新时间',
|
||||||
|
`clerk_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '店员名称',
|
||||||
|
`member_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '会员id',
|
||||||
|
`store_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '店铺id',
|
||||||
|
`department_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '部门id',
|
||||||
|
`role_ids` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '角色',
|
||||||
|
`shopkeeper` bit(1) NULL DEFAULT NULL COMMENT '是否是店主',
|
||||||
|
`is_super` bit(1) NULL DEFAULT NULL COMMENT '是否是超级管理员 超级管理员/普通管理员',
|
||||||
|
`status` bit(1) NULL DEFAULT NULL COMMENT '状态',
|
||||||
|
PRIMARY KEY (`id`) USING BTREE
|
||||||
|
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
|
||||||
|
|
||||||
|
SET FOREIGN_KEY_CHECKS = 1;
|
||||||
|
|
||||||
|
|
||||||
|
/** 店员角色**/
|
||||||
|
/*
|
||||||
|
Navicat Premium Data Transfer
|
||||||
|
|
||||||
|
Source Server : lilishop
|
||||||
|
Source Server Type : MySQL
|
||||||
|
Source Server Version : 80025
|
||||||
|
Source Host : 192.168.0.116:3306
|
||||||
|
Source Schema : zhimai1
|
||||||
|
|
||||||
|
Target Server Type : MySQL
|
||||||
|
Target Server Version : 80025
|
||||||
|
File Encoding : 65001
|
||||||
|
|
||||||
|
Date: 03/03/2022 19:30:39
|
||||||
|
*/
|
||||||
|
|
||||||
|
SET NAMES utf8mb4;
|
||||||
|
SET FOREIGN_KEY_CHECKS = 0;
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- Table structure for li_clerk_role
|
||||||
|
-- ----------------------------
|
||||||
|
DROP TABLE IF EXISTS `li_clerk_role`;
|
||||||
|
CREATE TABLE `li_clerk_role` (
|
||||||
|
`id` bigint NOT NULL COMMENT 'ID',
|
||||||
|
`clerk_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '店员唯一id',
|
||||||
|
`role_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '角色唯一id',
|
||||||
|
PRIMARY KEY (`id`) USING BTREE
|
||||||
|
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
|
||||||
|
|
||||||
|
SET FOREIGN_KEY_CHECKS = 1;
|
||||||
|
|
||||||
|
|
||||||
|
/** 店铺部门 **/
|
||||||
|
/*
|
||||||
|
Navicat Premium Data Transfer
|
||||||
|
|
||||||
|
Source Server : lilishop
|
||||||
|
Source Server Type : MySQL
|
||||||
|
Source Server Version : 80025
|
||||||
|
Source Host : 192.168.0.116:3306
|
||||||
|
Source Schema : zhimai1
|
||||||
|
|
||||||
|
Target Server Type : MySQL
|
||||||
|
Target Server Version : 80025
|
||||||
|
File Encoding : 65001
|
||||||
|
|
||||||
|
Date: 03/03/2022 19:31:39
|
||||||
|
*/
|
||||||
|
|
||||||
|
SET NAMES utf8mb4;
|
||||||
|
SET FOREIGN_KEY_CHECKS = 0;
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- Table structure for li_store_department
|
||||||
|
-- ----------------------------
|
||||||
|
DROP TABLE IF EXISTS `li_store_department`;
|
||||||
|
CREATE TABLE `li_store_department` (
|
||||||
|
`id` bigint NOT NULL COMMENT 'ID',
|
||||||
|
`create_by` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '创建者',
|
||||||
|
`create_time` datetime(6) NULL DEFAULT NULL COMMENT '创建时间',
|
||||||
|
`delete_flag` bit(1) NULL DEFAULT NULL COMMENT '删除标志 true/false 删除/未删除',
|
||||||
|
`update_by` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '更新者',
|
||||||
|
`update_time` datetime(6) NULL DEFAULT NULL COMMENT '更新时间',
|
||||||
|
`title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '部门名称',
|
||||||
|
`store_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '店铺id',
|
||||||
|
`parent_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '父id',
|
||||||
|
`sort_order` decimal(20, 2) NULL DEFAULT NULL COMMENT '排序值',
|
||||||
|
PRIMARY KEY (`id`) USING BTREE
|
||||||
|
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
|
||||||
|
|
||||||
|
SET FOREIGN_KEY_CHECKS = 1;
|
||||||
|
|
||||||
|
/** 部门角色关联 **/
|
||||||
|
/*
|
||||||
|
Navicat Premium Data Transfer
|
||||||
|
|
||||||
|
Source Server : lilishop
|
||||||
|
Source Server Type : MySQL
|
||||||
|
Source Server Version : 80025
|
||||||
|
Source Host : 192.168.0.116:3306
|
||||||
|
Source Schema : zhimai1
|
||||||
|
|
||||||
|
Target Server Type : MySQL
|
||||||
|
Target Server Version : 80025
|
||||||
|
File Encoding : 65001
|
||||||
|
|
||||||
|
Date: 03/03/2022 19:32:01
|
||||||
|
*/
|
||||||
|
|
||||||
|
SET NAMES utf8mb4;
|
||||||
|
SET FOREIGN_KEY_CHECKS = 0;
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- Table structure for li_store_department_role
|
||||||
|
-- ----------------------------
|
||||||
|
DROP TABLE IF EXISTS `li_store_department_role`;
|
||||||
|
CREATE TABLE `li_store_department_role` (
|
||||||
|
`id` bigint NOT NULL COMMENT 'ID',
|
||||||
|
`create_by` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '创建者',
|
||||||
|
`create_time` datetime(6) NULL DEFAULT NULL COMMENT '创建时间',
|
||||||
|
`delete_flag` bit(1) NULL DEFAULT NULL COMMENT '删除标志 true/false 删除/未删除',
|
||||||
|
`update_by` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '更新者',
|
||||||
|
`update_time` datetime(6) NULL DEFAULT NULL COMMENT '更新时间',
|
||||||
|
`role_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '角色id',
|
||||||
|
`department_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '部门id',
|
||||||
|
PRIMARY KEY (`id`) USING BTREE
|
||||||
|
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
|
||||||
|
|
||||||
|
SET FOREIGN_KEY_CHECKS = 1;
|
||||||
|
|
||||||
|
/**店铺角色菜单**/
|
||||||
|
/*
|
||||||
|
Navicat Premium Data Transfer
|
||||||
|
|
||||||
|
Source Server : lilishop
|
||||||
|
Source Server Type : MySQL
|
||||||
|
Source Server Version : 80025
|
||||||
|
Source Host : 192.168.0.116:3306
|
||||||
|
Source Schema : zhimai1
|
||||||
|
|
||||||
|
Target Server Type : MySQL
|
||||||
|
Target Server Version : 80025
|
||||||
|
File Encoding : 65001
|
||||||
|
|
||||||
|
Date: 03/03/2022 19:34:42
|
||||||
|
*/
|
||||||
|
|
||||||
|
SET NAMES utf8mb4;
|
||||||
|
SET FOREIGN_KEY_CHECKS = 0;
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- Table structure for li_store_menu_role
|
||||||
|
-- ----------------------------
|
||||||
|
DROP TABLE IF EXISTS `li_store_menu_role`;
|
||||||
|
CREATE TABLE `li_store_menu_role` (
|
||||||
|
`id` bigint NOT NULL COMMENT 'ID',
|
||||||
|
`create_by` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '创建者',
|
||||||
|
`create_time` datetime(6) NULL DEFAULT NULL COMMENT '创建时间',
|
||||||
|
`delete_flag` bit(1) NULL DEFAULT NULL COMMENT '删除标志 true/false 删除/未删除',
|
||||||
|
`update_by` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '更新者',
|
||||||
|
`update_time` datetime(6) NULL DEFAULT NULL COMMENT '更新时间',
|
||||||
|
`role_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '角色id',
|
||||||
|
`menu_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '菜单',
|
||||||
|
`store_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '店铺id',
|
||||||
|
`is_super` bit(1) NULL DEFAULT NULL COMMENT '是否拥有操作数据权限,为否则只有查看权限',
|
||||||
|
PRIMARY KEY (`id`) USING BTREE
|
||||||
|
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
|
||||||
|
|
||||||
|
SET FOREIGN_KEY_CHECKS = 1;
|
||||||
|
|
||||||
|
|
||||||
|
/**店铺角色**/
|
||||||
|
/*
|
||||||
|
Navicat Premium Data Transfer
|
||||||
|
|
||||||
|
Source Server : lilishop
|
||||||
|
Source Server Type : MySQL
|
||||||
|
Source Server Version : 80025
|
||||||
|
Source Host : 192.168.0.116:3306
|
||||||
|
Source Schema : zhimai1
|
||||||
|
|
||||||
|
Target Server Type : MySQL
|
||||||
|
Target Server Version : 80025
|
||||||
|
File Encoding : 65001
|
||||||
|
|
||||||
|
Date: 03/03/2022 19:32:59
|
||||||
|
*/
|
||||||
|
|
||||||
|
SET NAMES utf8mb4;
|
||||||
|
SET FOREIGN_KEY_CHECKS = 0;
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- Table structure for li_store_role
|
||||||
|
-- ----------------------------
|
||||||
|
DROP TABLE IF EXISTS `li_store_role`;
|
||||||
|
CREATE TABLE `li_store_role` (
|
||||||
|
`id` bigint NOT NULL COMMENT 'ID',
|
||||||
|
`create_by` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '创建者',
|
||||||
|
`create_time` datetime(6) NULL DEFAULT NULL COMMENT '创建时间',
|
||||||
|
`delete_flag` bit(1) NULL DEFAULT NULL COMMENT '删除标志 true/false 删除/未删除',
|
||||||
|
`update_by` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '更新者',
|
||||||
|
`update_time` datetime(6) NULL DEFAULT NULL COMMENT '更新时间',
|
||||||
|
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '角色名称',
|
||||||
|
`store_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '店铺id',
|
||||||
|
`default_role` bit(1) NULL DEFAULT NULL COMMENT '是否为注册默认角色',
|
||||||
|
`description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '备注',
|
||||||
|
PRIMARY KEY (`id`) USING BTREE
|
||||||
|
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = DYNAMIC;
|
||||||
|
|
||||||
|
SET FOREIGN_KEY_CHECKS = 1;
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
Navicat Premium Data Transfer
|
||||||
|
|
||||||
|
Source Server : lilishop
|
||||||
|
Source Server Type : MySQL
|
||||||
|
Source Server Version : 80025
|
||||||
|
Source Host : 192.168.0.116:3306
|
||||||
|
Source Schema : zhimai1
|
||||||
|
|
||||||
|
Target Server Type : MySQL
|
||||||
|
Target Server Version : 80025
|
||||||
|
File Encoding : 65001
|
||||||
|
|
||||||
|
Date: 02/03/2022 09:57:49
|
||||||
|
*/
|
||||||
|
|
||||||
|
SET NAMES utf8mb4;
|
||||||
|
SET FOREIGN_KEY_CHECKS = 0;
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- Table structure for li_menu
|
||||||
|
-- ----------------------------
|
||||||
|
DROP TABLE IF EXISTS `li_menu`;
|
||||||
|
CREATE TABLE `li_menu` (
|
||||||
|
`id` bigint NOT NULL COMMENT 'ID',
|
||||||
|
`create_by` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '创建者',
|
||||||
|
`create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
|
||||||
|
`delete_flag` bit(1) NULL DEFAULT NULL COMMENT '删除标志 true/false 删除/未删除',
|
||||||
|
`update_by` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '更新者',
|
||||||
|
`update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
|
||||||
|
`description` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '说明备注',
|
||||||
|
`front_route` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '前端路由',
|
||||||
|
`icon` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '图标',
|
||||||
|
`level` int NULL DEFAULT NULL COMMENT '层级',
|
||||||
|
`name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '菜单/权限名称',
|
||||||
|
`parent_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '父id',
|
||||||
|
`path` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '赋权API地址,正则表达式',
|
||||||
|
`sort_order` decimal(10, 2) NULL DEFAULT NULL COMMENT '排序值',
|
||||||
|
`title` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '菜单标题',
|
||||||
|
`front_component` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '文件地址',
|
||||||
|
`permission` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '权限url',
|
||||||
|
PRIMARY KEY (`id`) USING BTREE
|
||||||
|
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- Records of li_menu
|
||||||
|
-- ----------------------------
|
||||||
|
INSERT INTO `li_menu` VALUES (1348810750596767744, 'admin', '2021-01-12 09:55:17', b'0', 'admin', '2021-01-15 09:42:50', 'null', '1', 'ios-american-football', 0, 'settings', '0', '1', 2.00, '设置', 'null', NULL);
|
||||||
|
INSERT INTO `li_menu` VALUES (1348810864748945408, 'admin', '2021-01-12 09:55:45', b'0', 'admin', '2021-03-15 20:57:12', 'null', 'null', 'ios-american-football', 0, 'log', '0', 'null', 3.00, '日志', 'null', '/manager/setting/log*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1349237129847005184, 'admin', '2021-01-13 14:09:34', b'0', 'admin', '2021-01-15 09:43:16', 'null', 'Main', 'ios-american-football', 1, 'sys', '1348810750596767744', '/sys', 1.00, '系统设置', 'null', NULL);
|
||||||
|
INSERT INTO `li_menu` VALUES (1349237207378714624, 'admin', '2021-01-13 14:09:53', b'0', 'admin', '2021-07-27 16:07:49', 'null', 'Main', 'ios-american-football', 1, 'member', '1348810750596767744', '/member', 0.00, '用户管理', 'null', '/manager/permission/department*,/manager/passport/user*,/manager/permission/role*,/manager/permission/menu*,/manager/passport/user/admin/edit*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1349237928434098176, 'admin', '2021-01-13 14:13:03', b'0', 'admin', '2021-07-27 16:09:11', 'null', 'Main', 'ios-american-football', 1, 'log', '1348810864748945408', '/log', 1.00, '系统监控', 'null', '/manager/log*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1349246048900243456, 'admin', '2021-01-13 14:45:00', b'0', 'admin', '2021-07-27 16:07:57', 'null', 'sys/setting-manage/settingManage', 'ios-american-football', 2, 'setting', '1349237129847005184', 'setting', 1.00, '系统设置', 'null', '/manager/system/setting/get*,/manager/system/setting/put*,/manager/setting/setting*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1349246347597602816, 'admin', '2021-01-13 14:46:12', b'0', 'admin', '2021-07-27 16:08:03', 'null', 'sys/oss-manage/ossManage', 'ios-american-football', 2, 'oss-manage', '1349237129847005184', 'oss-manage', 3.00, 'OSS资源', '', '/manager/common/file*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1349246468775239680, 'admin', '2021-01-13 14:46:41', b'0', 'admin', '2021-07-27 16:08:14', 'null', 'region/index', 'ios-american-football', 2, 'region', '1349237129847005184', 'region', 4.00, '行政地区', 'null', '/manager/region*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1349246671158796288, 'admin', '2021-01-13 14:47:29', b'0', 'admin', '2021-07-27 16:08:09', 'null', 'logistics/index', 'ios-american-football', 2, 'logistics', '1349237129847005184', 'logistics', 5.00, '物流公司', 'null', '/manager/other/logistics*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1349246896661356544, 'admin', '2021-01-13 14:48:23', b'0', 'admin', '2021-07-27 16:08:23', 'null', 'sys/setting-manage/settingManage', 'ios-american-football', 2, 'authLogin', '1349237129847005184', 'authLogin', 6.00, '信任登录', 'null', '/manager/system/setting/get*,/manager/system/setting/put*,/manager/setting/setting*\r\n');
|
||||||
|
INSERT INTO `li_menu` VALUES (1349247081504333824, 'admin', '2021-01-13 14:49:07', b'0', 'admin', '2021-07-27 16:08:45', 'null', 'sys/setting-manage/settingManage', 'ios-american-football', 2, 'pay', '1349237129847005184', 'pay', 7.00, '支付设置', 'null', '/manager/system/setting/get*,/manager/system/setting/put*,/manager/system/setting*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1349247640584085504, 'admin', '2021-01-13 14:51:20', b'0', 'admin', '2021-07-27 16:08:56', 'null', 'sensitiveWords/index', 'ios-american-football', 2, 'sensitiveWords', '1349237129847005184', 'sensitiveWords', 8.00, '敏感词', 'null', '/manager/other/sensitiveWords*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1349254815809298432, 'admin', '2021-01-13 15:19:51', b'0', 'admin', '2021-01-15 11:15:40', 'null', 'sys/user-manage/userManage', 'ios-american-football', 2, 'user-manage', '1349237207378714624', 'user-manage', 1.00, '用户管理', 'null', NULL);
|
||||||
|
INSERT INTO `li_menu` VALUES (1349255214977015808, 'admin', '2021-01-13 15:21:26', b'0', 'admin', '2021-01-15 11:16:21', 'null', 'sys/department-manage/departmentManage', 'ios-american-football', 2, 'department-manage', '1349237207378714624', 'department-manage', 3.00, '部门管理', 'null', '/manager/permission/department*,/manager/permission/departmentRole*,');
|
||||||
|
INSERT INTO `li_menu` VALUES (1349255404425338880, 'admin', '2021-01-13 15:22:11', b'0', 'admin', '2021-02-24 09:22:21', 'null', 'sys/role-manage/roleManage', 'ios-american-football', 2, 'role-manage', '1349237207378714624', 'role-manage', 4.00, '角色权限', 'null', '/manager/permission/role*,/manager/permission/roleMenu*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1349256082979840000, 'admin', '2021-01-13 15:24:53', b'0', 'admin', '2021-01-15 11:18:14', 'null', 'sys/log-manage/logManage', 'ios-american-football', 2, 'log-manage', '1349237928434098176', 'log-manage', 2.00, '日志管理', 'null', NULL);
|
||||||
|
INSERT INTO `li_menu` VALUES (1357584224760102912, 'admin', '2021-02-05 06:57:57', b'0', 'admin', '2021-07-27 16:09:02', 'null', 'sys/app-version/appVersion', 'ios-american-football', 2, 'appVersion', '1349237129847005184', 'appVersion', 9.00, 'APP版本', 'null', '/manager/other/appVersion*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1357873097859923969, 'admin', '2021-02-24 09:53:02', b'0', 'admin', '2021-02-24 09:53:12', NULL, 'sys/menu-manage/menuManage', 'ios-american-football', 2, 'menuManage', '1349237207378714624', 'menu-manage', 2.00, '菜单管理', NULL, NULL);
|
||||||
|
INSERT INTO `li_menu` VALUES (1367038467288072192, 'admin', '2021-03-03 09:05:44', b'0', 'admin', '2021-03-03 09:09:27', 'null', 'null', 'ios-person-add', 0, 'member', '0', 'null', 0.00, '会员', 'null', NULL);
|
||||||
|
INSERT INTO `li_menu` VALUES (1367039534616805376, 'admin', '2021-03-03 09:09:58', b'0', 'admin', '2021-05-18 10:51:12', 'null', 'null', 'md-reorder', 0, 'order', '0', 'null', 0.00, '订单', 'null', NULL);
|
||||||
|
INSERT INTO `li_menu` VALUES (1367039950368800768, 'admin', '2021-03-03 09:11:37', b'0', NULL, NULL, NULL, NULL, 'ios-share', 0, 'goods', '0', NULL, 0.20, '商品', NULL, NULL);
|
||||||
|
INSERT INTO `li_menu` VALUES (1367040067201138688, 'admin', '2021-03-03 09:12:05', b'0', 'admin', '2021-12-02 19:45:22', NULL, 'null', 'ios-hammer', 0, 'promotions', '0', 'null', 0.30, '促销', NULL, 'null');
|
||||||
|
INSERT INTO `li_menu` VALUES (1367040599596728320, 'admin', '2021-03-03 09:14:12', b'0', 'admin', '2021-03-03 09:52:13', 'null', 'null', 'ios-color-palette', 0, 'operate', '0', 'null', 0.50, '运营', 'null', NULL);
|
||||||
|
INSERT INTO `li_menu` VALUES (1367040819248234496, 'admin', '2021-03-03 09:15:04', b'0', 'lili_ftyy', '2022-03-01 15:13:04', NULL, 'null', 'ios-stats', 0, 'statistics', '0', 'null', 0.70, '统计', NULL, 'null');
|
||||||
|
INSERT INTO `li_menu` VALUES (1367041332861730816, 'admin', '2021-03-03 09:17:07', b'0', NULL, NULL, NULL, 'Main', 'ios-aperture', 1, '/', '1367038467288072192', '/', 0.00, '会员管理', NULL, NULL);
|
||||||
|
INSERT INTO `li_menu` VALUES (1367041461194850304, 'admin', '2021-03-03 09:17:37', b'0', 'admin', '2021-07-27 16:02:17', NULL, 'member/list/index', 'ios-aperture', 2, 'memberList', '1367041332861730816', 'memberList', 0.00, '会员列表', NULL, '/manager/common/file*,/manager/passport/member*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1367041575619657728, 'admin', '2021-03-03 09:18:05', b'0', 'admin', '2021-07-27 15:59:50', NULL, 'member/list/memberRecycle', 'ios-aperture', 2, 'memberRecycle', '1367041332861730816', 'memberRecycle', 1.00, '回收站', NULL, '/manager/member*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1367042490443497472, 'admin', '2021-03-03 09:21:43', b'0', NULL, NULL, NULL, 'Main', 'ios-aperture', 1, '/', '1367038467288072192', '/', 1.00, '预存款', NULL, NULL);
|
||||||
|
INSERT INTO `li_menu` VALUES (1367042664410644480, 'admin', '2021-03-03 09:22:24', b'0', 'admin', '2021-07-27 16:02:44', 'null', 'member/advance/walletLog', 'ios-aperture', 2, 'walletLog', '1367042490443497472', 'walletLog', 0.00, '会员资金', 'null', '/manager/wallet/log*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1367042804944994304, 'admin', '2021-03-03 09:22:58', b'0', 'admin', '2021-07-27 16:02:48', NULL, 'member/advance/recharge', 'ios-alert', 2, 'recharge', '1367042490443497472', 'recharge', 1.00, '充值记录', NULL, '/manager/wallet/recharge*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1367042804944994305, 'admin', '2021-03-03 09:22:58', b'0', 'admin', '2021-07-27 16:02:52', NULL, 'member/advance/withdrawApply', 'ios-alert', 2, 'withdrawApply', '1367042490443497472', 'withdrawApply', 1.00, '提现申请', NULL, '/manager/wallet/withdrawApply*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1367042917113266176, 'admin', '2021-03-03 09:23:25', b'0', NULL, NULL, NULL, 'Main', 'ios-aperture', 1, 'commont', '1367038467288072192', '/', 0.00, '评价', NULL, NULL);
|
||||||
|
INSERT INTO `li_menu` VALUES (1367043020976816128, 'admin', '2021-03-03 09:23:49', b'0', 'admin', '2021-07-27 16:02:35', NULL, 'goods/goods-review/index', 'md-aperture', 2, 'goodsReview', '1367042917113266176', 'goodsReview', 0.00, '会员评价', NULL, '/manager/memberEvaluation*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1367043443917848576, 'admin', '2021-03-03 09:25:30', b'0', 'admin', '2021-07-27 16:03:00', NULL, 'Main', 'md-aperture', 1, 'order', '1367039534616805376', '/', 0.00, '订单', NULL, '/manager/orders*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1367043505771249664, 'admin', '2021-03-03 09:25:45', b'0', NULL, NULL, NULL, 'Main', 'md-aperture', 1, 'aftersale', '1367039534616805376', '/', 0.00, '售后', NULL, NULL);
|
||||||
|
INSERT INTO `li_menu` VALUES (1367043642379730944, 'admin', '2021-03-03 09:26:17', b'0', NULL, NULL, NULL, 'order/order/orderList', 'ios-aperture', 2, 'orderList', '1367043443917848576', 'orderList', 0.00, '商品订单', NULL, '/manager/order/order*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1367043791105556480, 'admin', '2021-03-03 09:26:53', b'0', NULL, NULL, NULL, 'order/order/fictitiousOrderList', 'ios-aperture', 2, 'fictitiousOrderList', '1367043443917848576', 'fictitiousOrderList', 1.00, '虚拟订单', NULL, '/manager/order/order*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1367043980407078912, 'admin', '2021-03-03 09:27:38', b'0', 'admin', '2021-07-27 16:03:43', NULL, 'order/after-order/afterSaleOrder', 'md-alert', 2, 'afterSaleOrder', '1367043505771249664', 'afterSaleOrder', 0.00, '售后管理', NULL, '/manager/order/afterSale*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1367044121163726848, 'admin', '2021-03-03 09:28:12', b'0', 'admin', '2021-07-27 16:03:48', NULL, 'order/after-order/orderComplaint', 'md-alert', 2, 'orderComplaint', '1367043505771249664', 'orderComplaint', 2.00, '交易投诉', NULL, '/manager/order/complain*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1367044247978508288, 'admin', '2021-03-03 09:28:42', b'0', 'admin', '2021-07-27 16:03:52', NULL, 'order/after-order/afterSale', 'md-aperture', 2, 'afterSaleReason', '1367043505771249664', 'afterSaleReason', 3.00, '售后原因', NULL, '/manager/order/afterSaleReason*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1367044376391319552, 'admin', '2021-03-03 09:29:12', b'0', 'admin', '2021-07-27 16:04:08', NULL, 'Main', 'md-aperture', 1, 'goodsManager', '1367039950368800768', '/', 0.00, '商品管理', NULL, '/manager/goods*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1367044657296441344, 'admin', '2021-03-03 09:30:19', b'0', NULL, NULL, NULL, 'Main', 'ios-aperture', 1, 'association', '1367039950368800768', '/', 1.00, '关联管理', NULL, NULL);
|
||||||
|
INSERT INTO `li_menu` VALUES (1367045529720061952, 'admin', '2021-03-03 09:33:47', b'0', 'admin', '2021-07-27 15:38:46', NULL, 'goods/goods-info/goods', 'md-aperture', 2, 'managerGoods', '1367044376391319552', 'managerGoods', 0.00, '平台商品', NULL, 'null');
|
||||||
|
INSERT INTO `li_menu` VALUES (1367045630710513664, 'admin', '2021-03-03 09:34:11', b'0', 'admin', '2021-07-27 15:38:56', NULL, 'goods/goods-info/goodsApply', 'ios-alert', 2, 'applyGoods', '1367044376391319552', 'applyGoods', 1.00, '商品审核', NULL, 'null');
|
||||||
|
INSERT INTO `li_menu` VALUES (1367045794284175360, 'admin', '2021-03-03 09:34:50', b'0', 'admin', '2021-07-27 16:04:18', NULL, 'goods/goods-manage/category', 'md-alert', 2, 'goodsCategory', '1367044657296441344', 'goodsCategory', 0.00, '商品分类', NULL, '/manager/goods/category*,/manager/goods/brand*,/manager/goods/spec*,/manager/goods/parameters*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1367045921434501120, 'admin', '2021-03-03 09:35:21', b'0', 'admin', '2021-07-27 16:04:23', NULL, 'goods/goods-manage/brand', 'md-alert', 2, 'goodsBrand', '1367044657296441344', 'goodsBrand', 1.00, '品牌列表', NULL, '/manager/goods/brand*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1367046068369358848, 'admin', '2021-03-03 09:35:56', b'0', 'admin', '2021-07-27 16:04:27', NULL, 'goods/goods-manage/spec', 'md-aperture', 2, 'goodsSpec', '1367044657296441344', 'goodsSpec', 2.00, '规格列表', NULL, '/manager/goods/spec*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1367046266214678528, 'admin', '2021-03-03 09:36:43', b'0', 'admin', '2021-07-27 16:04:32', NULL, 'goods-unit/index', 'md-alert', 2, 'goodsUnit', '1367044657296441344', 'goodsUnit', 4.00, '计量单位', NULL, '/manager/goods/goodsUnit*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1367048084701315072, 'admin', '2021-03-03 09:43:57', b'0', 'admin', '2021-03-03 09:52:17', 'null', 'null', 'ios-pricetags', 0, 'shop', '0', 'null', 0.40, '店铺', 'null', NULL);
|
||||||
|
INSERT INTO `li_menu` VALUES (1367048684339986432, 'admin', '2021-03-03 09:46:20', b'0', NULL, NULL, NULL, 'Main', 'md-aperture', 1, 'shopManager', '1367048084701315072', '/', 0.00, '店铺管理', NULL, NULL);
|
||||||
|
INSERT INTO `li_menu` VALUES (1367048754229673984, 'admin', '2021-03-03 09:46:36', b'0', NULL, NULL, NULL, 'Main', 'md-aperture', 1, 'bill', '1367048084701315072', '/', 0.00, ' 店铺结算', NULL, NULL);
|
||||||
|
INSERT INTO `li_menu` VALUES (1367048832210173952, 'admin', '2021-03-03 09:46:55', b'0', 'admin', '2021-07-27 16:05:30', NULL, 'seller/shop/shopList', 'md-aperture', 2, 'shopList', '1367048684339986432', 'shopList', 0.00, '店铺列表', NULL, '/manager/order/order*,/manager/store*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1367048967635861504, 'admin', '2021-03-03 09:47:27', b'0', 'admin', '2021-07-27 16:05:32', NULL, 'seller/shop/shopAuditList', 'md-alert', 2, 'shopAuth', '1367048684339986432', 'shopAuth', 1.00, '店铺审核', NULL, '/manager/store*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1367049068122996736, 'admin', '2021-03-03 09:47:51', b'0', 'admin', '2021-07-27 16:05:36', NULL, 'seller/bill/bill', 'md-alert', 2, 'billList', '1367048754229673984', 'billList', 0.00, '店铺结算', NULL, '/manager/order/bill*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1367049214198022144, 'admin', '2021-03-03 09:48:26', b'0', 'admin', '2021-12-02 19:45:28', NULL, 'Main', 'md-aperture', 1, 'promotionsManager', '1367040067201138688', '/', 0.00, '促销管理', NULL, 'null');
|
||||||
|
INSERT INTO `li_menu` VALUES (1367049384792948736, 'admin', '2021-03-03 09:49:07', b'0', 'admin', '2021-12-02 19:54:12', NULL, 'promotions/coupon/coupon', 'md-alert', 2, 'promotions/coupon', '1367049214198022144', 'promotions/coupon', 0.00, '优惠券', NULL, '/manager/promotion/coupon*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1367049500782231552, 'admin', '2021-03-03 09:49:34', b'0', 'admin', '2021-12-02 19:41:37', 'null', 'promotions/full-discount/full-discount', 'md-alert', 2, 'promotions/full-discount', '1367049214198022144', 'promotions/full-discount', 1.00, '满额活动', 'null', '/manager/promotion/fullDiscount*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1367049611578966016, 'admin', '2021-03-03 09:50:01', b'0', 'admin', '2021-12-02 20:16:10', 'null', 'promotions/seckill/seckill', 'md-alert', 2, 'promotions/seckill', '1367049214198022144', 'promotions/seckill', 2.00, '秒杀活动', 'null', '/manager/promotion/seckill*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1367049712657498112, 'admin', '2021-03-03 09:50:25', b'0', 'admin', '2021-12-02 20:22:04', 'null', 'promotions/pintuan/pintuan', 'md-alert', 2, 'promotions/pintuan', '1367049214198022144', 'promotions/pintuan', 3.00, '拼团活动', 'null', '/manager/promotion/pintuan*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1367050250249830400, 'admin', '2021-03-03 09:52:33', b'0', 'admin', '2021-03-22 20:38:14', 'null', 'Main', 'md-aperture', 1, 'document', '1367040599596728320', '/', 2.00, '文章管理', 'null', NULL);
|
||||||
|
INSERT INTO `li_menu` VALUES (1367050320584114176, 'admin', '2021-03-03 09:52:50', b'0', 'admin', '2021-07-27 16:05:49', NULL, 'Main', 'md-aperture', 1, 'floor', '1367040599596728320', '/', 0.00, '楼层装修', NULL, '/manager/pageData*,/manager/file*,/manager/article-category*,/manager/article*,/manager/promotion*,/manager/goods*,/manager/store*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1367050530030878720, 'admin', '2021-03-03 09:53:40', b'0', 'admin', '2021-03-04 01:05:57', 'null', 'lili-floor-renovation/floorList', 'md-alert', 2, 'pcFloor', '1367050320584114176', 'pcFloor', 0.00, 'PC端', 'null', '/manager/other/pageData*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1367050673312497664, 'admin', '2021-03-03 09:54:14', b'0', 'admin', '2021-03-04 01:06:04', 'null', 'lili-floor-renovation/wap/wapList', 'md-aperture', 2, 'wapList', '1367050320584114176', 'wapList', 1.00, '移动端', 'null', '/manager/other/pageData*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1367050829697122304, 'admin', '2021-03-03 09:54:51', b'0', 'admin', '2021-07-27 16:06:32', 'null', 'page/article-manage/hotWords', 'md-aperture', 2, 'hotKeyWord', '1367050250249830400', 'hotKeyWord', 0.00, '搜索热词', 'null', '/manager/hotwords*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1367050939084570624, 'admin', '2021-03-03 09:55:17', b'0', 'admin', '2021-07-27 16:06:38', NULL, 'page/article-manage/ArticleCategory', 'md-aperture', 2, 'article-category', '1367050250249830400', 'article-category', 1.00, '文章分类', NULL, '/manager/other/articleCategory*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1367051048232943616, 'admin', '2021-03-03 09:55:43', b'0', 'admin', '2021-07-27 16:06:42', NULL, 'page/article-manage/articleList', 'md-alert', 2, 'articleList', '1367050250249830400', 'articleList', 3.00, '文章管理', NULL, '/manager/other/article*,/manager/other/articleCategory*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1367052616634204160, 'admin', '2021-03-03 10:01:57', b'0', 'admin', '2021-07-27 16:07:38', NULL, 'Main', 'md-aperture', 1, 'statistics', '1367040819248234496', '/', 0.00, '统计', NULL, '/manager/store*,/manager/member*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1367052705725415424, 'admin', '2021-03-03 10:02:18', b'0', 'admin', '2021-03-11 22:11:05', 'null', 'statistics/member', 'md-alert', 2, 'memberStatistics', '1367052616634204160', 'memberStatistics', 0.00, '会员统计', 'null', NULL);
|
||||||
|
INSERT INTO `li_menu` VALUES (1367052805503713280, 'admin', '2021-03-03 10:02:42', b'0', 'admin', '2021-03-11 22:11:14', 'null', 'statistics/order', 'md-alert', 2, 'orderStatistics', '1367052616634204160', 'orderStatistics', 1.00, '订单统计', 'null', NULL);
|
||||||
|
INSERT INTO `li_menu` VALUES (1367052915314786304, 'admin', '2021-03-03 10:03:08', b'0', 'admin', '2021-03-11 22:11:23', 'null', 'statistics/goods', 'md-alert', 2, 'goodsStatistics', '1367052616634204160', 'goodsStatistics', 2.00, '商品统计', 'null', NULL);
|
||||||
|
INSERT INTO `li_menu` VALUES (1367053087121866752, 'admin', '2021-03-03 10:03:49', b'0', 'admin', '2021-03-11 22:11:34', 'null', 'statistics/traffic', 'md-alert', 2, 'trafficStatistics', '1367052616634204160', 'trafficStatistics', 4.00, '流量统计', 'null', NULL);
|
||||||
|
INSERT INTO `li_menu` VALUES (1372807928452481024, 'admin', '2021-03-19 02:11:30', b'0', NULL, NULL, NULL, 'Main', 'ios-aperture', 1, 'flow', '1367039534616805376', '/', 3.00, '流水', NULL, NULL);
|
||||||
|
INSERT INTO `li_menu` VALUES (1372808148565360640, 'admin', '2021-03-19 02:12:23', b'0', 'admin', '2021-07-27 16:03:57', NULL, 'order/flow/paymentLog', 'md-alert', 2, 'paymentLog', '1372807928452481024', 'paymentLog', 1.00, '收款记录', NULL, '/manager/order/paymentLog*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1372808352295288832, 'admin', '2021-03-19 02:13:11', b'0', 'admin', '2021-07-27 16:04:01', NULL, 'order/flow/refundLog', 'ios-aperture', 2, 'refundLog', '1372807928452481024', 'refundLog', 2.00, '退款流水', NULL, '/manager/order/refundLog*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1373166892465782784, 'admin', '2021-03-20 01:57:54', b'0', 'admin', '2021-03-22 20:13:48', 'null', 'Main', 'ios-aperture', 1, '/', '1367038467288072192', '/', 0.00, '积分', 'null', NULL);
|
||||||
|
INSERT INTO `li_menu` VALUES (1373167227385151488, 'admin', '2021-03-20 01:59:14', b'0', 'admin', '2021-07-27 16:02:40', 'null', 'member/point/point', 'ios-aperture', 2, 'point', '1373166892465782784', 'point', 0.00, '积分历史', 'null', '/manager/member/memberPointsHistory*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1373791578371391488, 'admin', '2021-03-21 19:20:11', b'0', 'admin', '2021-07-27 16:05:38', NULL, 'seller/bill/accountStatementBill', 'md-alert', 2, 'accountStatementBill', '1367048754229673984', 'accountStatementBill', 0.00, '商家对账', NULL, '/manager/order/bill*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1374154349697040384, 'admin', '2021-03-22 19:21:42', b'0', 'admin', '2021-07-27 16:06:55', 'null', 'Main', 'md-aperture', 1, 'feedback', '1367040599596728320', '/', 3.00, '意见反馈', 'null', '/manager/other/feedback*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1374155741123837952, 'admin', '2021-03-22 19:27:14', b'0', 'admin', '2021-07-27 15:41:40', 'null', 'page/feedback/feedback', 'md-aperture', 2, 'feedback', '1374154349697040384', 'feedback', 0.00, '意见反馈', 'null', 'null');
|
||||||
|
INSERT INTO `li_menu` VALUES (1374173575405109248, 'admin', '2021-03-22 20:38:06', b'0', 'admin', '2021-03-22 20:52:58', 'null', 'Main', 'ios-analytics', 1, 'distributionManager', '1367040599596728320', '/', 1.00, '分销管理', 'null', NULL);
|
||||||
|
INSERT INTO `li_menu` VALUES (1374177618072436736, 'admin', '2021-03-22 20:54:10', b'0', 'admin', '2021-07-27 16:05:58', 'null', 'distribution/distributionSetting', 'ios-basketball', 2, 'distributionSetting', '1374173575405109248', 'distributionSetting', 0.00, '分销设置', 'null', '/manager/system/setting/put/DISTRIBUTION_SETTING*,/manager/system/setting/get/DISTRIBUTION_SETTING*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1374177789581721600, 'admin', '2021-03-22 20:54:51', b'0', 'admin', '2021-07-27 16:06:15', 'null', 'distribution/distributionGoods', 'ios-chatbubbles', 2, 'distributionGoods', '1374173575405109248', 'distributionGoods', 3.00, '分销商品', 'null', '/manager/distribution/goods*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1374177910411231232, 'admin', '2021-03-22 20:55:19', b'0', 'admin', '2021-07-27 16:06:20', 'null', 'distribution/distributionOrder', 'ios-cloudy', 2, 'distributionOrder', '1374173575405109248', 'distributionOrder', 4.00, '分销订单', 'null', '/manager/distribution/order*,/manager/store*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1374178079181635584, 'admin', '2021-03-22 20:56:00', b'0', 'admin', '2021-07-27 16:06:05', 'null', 'distribution/distributionApply', 'md-egg', 2, 'distributionApply', '1374173575405109248', 'distributionApply', 1.00, '分销申请', 'null', '/manager/distribution*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1374178303975358464, 'admin', '2021-03-22 20:56:53', b'0', 'admin', '2021-07-27 16:06:08', 'null', 'distribution/distribution', 'md-person', 2, 'distribution', '1374173575405109248', 'distribution', 2.00, '分销员', 'null', '/manager/distribution*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1374916594269945856, 'admin', '2021-03-24 21:50:35', b'0', 'admin', '2021-07-27 16:08:51', NULL, 'sys/slider/slider', 'ios-aperture', 2, 'slider', '1349237129847005184', 'slider', 7.00, '验证码', NULL, '/manager/other/verificationSource*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1376450531517530112, 'admin', '2021-03-29 03:25:55', b'0', NULL, NULL, NULL, 'Main', 'md-basketball', 1, 'notice', '1367040599596728320', '/', 5.00, '站内信', NULL, NULL);
|
||||||
|
INSERT INTO `li_menu` VALUES (1376450662098796544, 'admin', '2021-03-29 03:26:26', b'0', 'admin', '2021-07-27 16:07:23', NULL, 'sys/message/noticeMessageTemplate', 'ios-american-football', 2, 'noticeMessageTemplate', '1376450531517530112', 'noticeMessageTemplate', 1.00, '站内信', NULL, '/manager/other/message*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1376450766817984512, 'admin', '2021-03-29 03:26:51', b'0', 'admin', '2021-03-29 03:27:25', 'null', 'Main', 'md-checkmark', 1, 'sms', '1367040599596728320', '/', 6.00, '短信管理', 'null', NULL);
|
||||||
|
INSERT INTO `li_menu` VALUES (1376450876423536640, 'admin', '2021-03-29 03:27:17', b'0', 'admin', '2021-07-27 16:07:29', NULL, 'sys/message/sms', 'ios-timer', 2, 'sms', '1376450766817984512', 'sms', 1.00, '短信', NULL, '/manager/sms/sms*,/manager/passport/member*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1384035281702748160, 'admin', '2021-04-19 14:45:00', b'0', 'admin', '2021-07-27 16:08:18', 'null', 'member/message-manage/weChatMessageManager', 'md-aperture', 2, 'message-manage', '1349237129847005184', 'message-manage', 5.00, '微信消息', 'null', '/manager/wechat/wechatMessage*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1403988156444962818, 'admin', '2021-06-13 16:10:36', b'0', 'admin', '2021-12-02 19:54:37', 'null', 'promotions/coupon-activity/coupon', '', 2, 'promotions/coupon-activity', '1367049214198022144', 'promotions/coupon-activity', 0.00, '券活动', 'null', '/manager/promotion/couponActivity*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1407601962899230721, 'admin', '2021-06-23 15:30:35', b'0', 'admin', '2021-07-27 16:05:08', NULL, 'Main', '', 1, 'liveManage', '1367040067201138688', '/', 2.00, '直播管理', NULL, '/manager/broadcast*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1407602049759072258, 'admin', '2021-06-23 15:30:55', b'0', 'admin', '2021-12-07 10:54:54', NULL, 'promotions/live/live', '', 2, 'promotions/live', '1407601962899230721', 'promotions/live', 1.00, '直播管理', NULL, 'null');
|
||||||
|
INSERT INTO `li_menu` VALUES (1407602441964244994, 'admin', '2021-06-23 15:32:29', b'0', NULL, NULL, NULL, 'Main', '', 1, 'pointManage', '1367040067201138688', '/', 3.00, '积分活动', NULL, NULL);
|
||||||
|
INSERT INTO `li_menu` VALUES (1407602516912263170, 'admin', '2021-06-23 15:32:47', b'0', 'admin', '2021-12-03 19:18:30', NULL, 'promotions/points-goods/points-goods', '', 2, 'promotions/points-goods', '1407602441964244994', 'promotions/points-goods', 1.00, '积分商品', NULL, '/manager/promotion/pointsGoods*,/manager/goods*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1407602673334636546, 'admin', '2021-06-23 15:33:24', b'0', 'admin', '2021-12-03 19:19:23', NULL, 'promotions/points-goods-category/points-goods-category', '', 2, 'promotions/points-goods-category', '1407602441964244994', 'promotions/points-goods-category', 2.00, '积分分类', NULL, '/manager/promotion/pointsGoodsCategory*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1410862675914764290, 'admin', '2021-07-02 15:27:29', b'0', 'admin', '2021-07-27 16:06:26', 'null', 'distribution/distributionCash', '', 2, 'distributionCash', '1374173575405109248', 'distributionCash', 5.00, '分销提现', 'null', '/manager/distribution/cash*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1419926569920536578, 'admin', '2021-07-27 15:44:10', b'0', 'admin', '2021-07-27 16:07:10', NULL, 'customWords/index', NULL, 2, 'customWords', '1367050250249830400', 'customWords', 4.00, 'ES分词', NULL, '/manager/other/customWords*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1430799171593535490, 'admin', '2021-08-26 15:48:00', b'0', 'admin', '2021-12-02 20:21:34', NULL, 'promotions/kanjia/kanjia-activity-goods', NULL, 2, 'promotions/kanjia', '1367049214198022144', 'promotions/kanjia', 6.00, '砍价活动', NULL, '/manager/promotion/kanJiaGoods*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1495665663207432193, 'admin', '2022-02-21 15:44:17', b'0', 'admin', '2022-02-21 15:45:44', NULL, 'distribution/distrbutionGrade', NULL, 2, 'distrbutionGrade', '1374173575405109248', 'distrbutionGrade', 0.00, '分销等级', NULL, '/manager/distrbutionGrade*');
|
||||||
|
|
||||||
|
SET FOREIGN_KEY_CHECKS = 1;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
Navicat Premium Data Transfer
|
||||||
|
|
||||||
|
Source Server : lilishop
|
||||||
|
Source Server Type : MySQL
|
||||||
|
Source Server Version : 80025
|
||||||
|
Source Host : 192.168.0.116:3306
|
||||||
|
Source Schema : zhimai1
|
||||||
|
|
||||||
|
Target Server Type : MySQL
|
||||||
|
Target Server Version : 80025
|
||||||
|
File Encoding : 65001
|
||||||
|
|
||||||
|
Date: 01/03/2022 15:36:03
|
||||||
|
*/
|
||||||
|
|
||||||
|
SET NAMES utf8mb4;
|
||||||
|
SET FOREIGN_KEY_CHECKS = 0;
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- Table structure for li_store_menu
|
||||||
|
-- ----------------------------
|
||||||
|
DROP TABLE IF EXISTS `li_store_menu`;
|
||||||
|
CREATE TABLE `li_store_menu` (
|
||||||
|
`id` bigint NOT NULL COMMENT 'ID',
|
||||||
|
`create_by` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '创建者',
|
||||||
|
`create_time` datetime(6) NULL DEFAULT NULL COMMENT '创建时间',
|
||||||
|
`delete_flag` bit(1) NULL DEFAULT NULL COMMENT '删除标志 true/false 删除/未删除',
|
||||||
|
`update_by` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '更新者',
|
||||||
|
`update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
|
||||||
|
`description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '说明备注',
|
||||||
|
`front_route` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '前端路由',
|
||||||
|
`icon` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '图标',
|
||||||
|
`level` int NULL DEFAULT NULL COMMENT '层级',
|
||||||
|
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '菜单/权限名称',
|
||||||
|
`parent_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '父id',
|
||||||
|
`path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '赋权API地址,正则表达式',
|
||||||
|
`sort_order` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '排序值',
|
||||||
|
`title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '菜单标题',
|
||||||
|
`permission` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '权限url',
|
||||||
|
PRIMARY KEY (`id`) USING BTREE
|
||||||
|
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = DYNAMIC;
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- Records of li_store_menu
|
||||||
|
-- ----------------------------
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1348810750596767744, NULL, '2022-01-11 22:35:33.000000', b'0', NULL, '2022-01-11 22:36:52', NULL, 'Main', 'ios-american-football', 0, 'goods', '0', '/', '1', '商品', NULL);
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1348810864748945408, NULL, '2022-01-11 22:35:37.000000', b'0', NULL, '2022-01-11 22:36:55', NULL, 'Main', 'ios-american-football', 1, 'Main', '1348810750596767744', '/', '1.1', '商品管理', '');
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1349237129847005184, NULL, '2022-01-11 22:35:40.000000', b'0', NULL, '2022-01-11 22:36:59', NULL, 'goods-operation', 'ios-american-football', 2, 'goods-operation', '1348810864748945408', '/goods-operation', '1.11', '商品发布', '/store/goods/category*,/store/goods/categorySpec*,/store/goods/categoryParameters*,/store/goods/draftGoods*,/store/goods/label*,/store/goods/goods*,/store/goods/goodsUnit*,/store/goods/spec*');
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1349237207378714624, NULL, '2022-01-11 22:35:42.000000', b'0', NULL, '2022-01-11 22:37:02', NULL, 'goods/goods-seller/goods', 'ios-american-football', 2, 'goods', '1348810864748945408', 'goods', '1.12', '商品列表', NULL);
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1349237928434098176, NULL, '2022-01-11 22:35:45.000000', b'0', NULL, '2022-01-11 22:37:05', NULL, 'goods/goods-seller/draftGoods', 'ios-american-football', 2, 'template-goods', '1348810864748945408', 'template-goods', '1.13', '商品模板', NULL);
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1349246048900243456, NULL, '2022-01-11 22:35:48.000000', b'0', NULL, '2022-01-11 22:37:08', NULL, 'goods/goods-manage/category', 'ios-american-football', 2, 'category', '1348810864748945408', 'category', '1.14', '店铺分类', NULL);
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1349246347597602816, NULL, '2022-01-11 22:35:51.000000', b'0', NULL, '2022-01-11 22:37:11', NULL, 'Main', 'ios-american-football', 0, 'order', '0', '/', '2', '订单', NULL);
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1349246468775239680, NULL, '2022-01-11 22:38:28.000000', b'0', NULL, '2022-01-11 22:38:31', NULL, 'Main', 'ios-american-football', 1, 'Main', '1349246347597602816', '/', '2.1', '订单管理', NULL);
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1349246671158796288, NULL, '2022-01-11 22:38:42.000000', b'0', NULL, '2022-01-11 22:38:35', NULL, 'order/order/orderList', 'ios-american-football', 2, 'orderList', '1349246468775239680', 'orderList', '2.11', '商品订单', '/store/order/order*');
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1349246896661356544, NULL, '2022-01-11 22:40:27.000000', b'0', NULL, '2022-01-11 22:40:34', NULL, 'order/order/virtualOrderList', 'ios-american-football', 2, 'virtualOrderList', '1349246468775239680', 'virtualOrderList', '2.12', '虚拟订单', '/store/order/order*');
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1349247081504333824, NULL, '2022-01-11 22:41:47.000000', b'0', NULL, '2022-01-11 22:41:50', NULL, 'Main', 'ios-american-football', 1, 'Main', '1349246347597602816', '/', '2.2', '评价管理', NULL);
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1349247640584085504, NULL, '2022-01-11 22:43:29.000000', b'0', NULL, '2022-01-11 22:45:47', NULL, 'member/memberComment', 'ios-american-football', 2, 'memberComment', '1349247081504333824', 'memberComment', '2.21', '评价管理', '/store/member/evaluation*');
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1349254815809298432, NULL, '2022-01-11 22:45:35.000000', b'0', NULL, '2022-01-11 22:45:50', NULL, 'Main', 'ios-american-football', 1, 'Main', '1349246347597602816', '/', '2.3', '售后管理', NULL);
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1349255214977015808, NULL, '2022-01-11 22:49:22.000000', b'0', NULL, '2022-01-11 22:49:27', NULL, 'order/after-order/returnGoodsOrder', 'ios-american-football', 2, 'returnGoodsOrder', '1349254815809298432', 'returnGoodsOrder', '2.31', '退货管理', '/store/order/afterSale*');
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1349255404425338880, NULL, '2022-01-11 22:51:20.000000', b'0', NULL, '2022-01-11 22:51:22', NULL, 'order/after-order/returnMoneyOrder', 'ios-american-football', 2, 'returnMoneyOrder', '1349254815809298432', 'returnMoneyOrder', '2.32', '退款管理', '/store/order/afterSale*');
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1349256082979840000, NULL, '2022-01-11 22:52:50.000000', b'0', NULL, '2022-01-11 22:52:55', NULL, 'order/after-order/orderComplaint', 'ios-american-football', 2, 'orderComplaint', '1349254815809298432', 'orderComplaint', '2.33', '投诉管理', '/store/order/complain*');
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1357584224760102912, NULL, '2022-01-11 23:02:20.000000', b'0', NULL, '2022-01-11 23:02:25', NULL, 'Main', 'ios-american-football', 0, 'bill', '0', '/', '3', '财务', NULL);
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1357873097859923969, NULL, '2022-01-11 23:04:13.000000', b'0', NULL, '2022-01-11 23:04:17', NULL, 'Main', 'ios-american-football', 1, 'Main', '1357584224760102912', '/', '3.1', '财务管理', '');
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1367038467288072192, NULL, '2022-01-11 23:06:11.000000', b'0', NULL, '2022-01-11 23:06:16', NULL, 'shop/bill/accountStatementBill', 'ios-american-football', 2, 'accountStatementBill', '1357873097859923969', 'accountStatementBill', '3.11', '财务对账', '/store/order/bill*');
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1367039534616805376, NULL, '2022-01-11 23:07:54.000000', b'0', NULL, '2022-01-11 23:07:57', NULL, 'shop/bill/storeBill', 'ios-american-football', 2, 'storeBill', '1357873097859923969', 'storeBill', '3.12', '店铺结算', '/store/order/bill*');
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1367039950368800768, NULL, '2022-01-11 23:09:26.000000', b'0', NULL, '2022-01-11 23:09:29', NULL, 'Main', 'ios-american-football', 1, 'Main', '1357584224760102912', '/', '3.2', '发票管理', NULL);
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1367040067201138688, NULL, '2022-01-11 23:11:14.000000', b'0', NULL, '2022-01-11 23:11:18', NULL, 'order/receiptManager/receipt', 'ios-american-football', 2, 'receipt', '1367039950368800768', 'receipt', '3.21', '发票管理', '/store/trade/receipt*');
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1367040599596728320, NULL, '2022-01-11 23:12:49.000000', b'0', NULL, '2022-01-11 23:12:52', NULL, 'Main', 'ios-american-football', 0, 'promotion', '0', '/', '4', '营销', NULL);
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1367040819248234496, NULL, '2022-01-11 23:14:35.000000', b'0', NULL, '2022-01-11 23:14:38', NULL, 'Main', 'ios-american-football', 1, 'Main', '1367040599596728320', '/', '4.1', '平台活动', NULL);
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1367041332861730816, NULL, '2022-01-11 23:15:42.000000', b'0', NULL, '2022-01-11 23:15:48', NULL, 'promotion/pintuan/pintuan', 'ios-american-football', 2, 'pintuan', '1367040819248234496', 'pintuan', '4.11', '拼团活动', '/store/promotion/pintuan*');
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1367041461194850304, NULL, '2022-01-11 23:17:32.000000', b'0', NULL, '2022-01-11 23:17:44', NULL, 'promotion/seckill/seckill', 'ios-american-football', 2, 'seckill', '1367040819248234496', 'seckill', '4.12', '秒杀活动', '/store/promotion/seckill*');
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1367041575619657728, NULL, '2022-01-11 23:20:19.000000', b'0', NULL, '2022-01-11 23:20:24', NULL, 'Main', 'ios-american-football', 1, 'Main', '1367040599596728320', '/', '4.2', '直播活动', '');
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1367042490443497472, NULL, '2022-01-11 23:21:13.000000', b'0', NULL, '2022-01-11 23:21:22', NULL, 'promotion/live/live', 'ios-american-football', 2, 'live', '1367041575619657728', 'live', '4.21', '直播管理', '/store/broadcast/studio*');
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1367042664410644480, NULL, '2022-01-11 23:22:42.000000', b'0', NULL, '2022-01-11 23:22:59', NULL, 'promotion/live/liveGoods', 'ios-american-football', 2, 'liveGoods', '1367041575619657728', 'liveGoods', '4.22', '直播商品', '/store/broadcast/commodity*');
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1367042804944994304, NULL, '2022-01-11 23:24:24.000000', b'0', NULL, '2022-01-11 23:24:38', NULL, 'Main', 'ios-american-football', 1, 'Main', '1367040599596728320', '/', '4.3', '商家活动', NULL);
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1367042804944994305, NULL, '2022-01-11 23:24:29.000000', b'0', NULL, '2022-01-11 23:24:42', NULL, 'promotion/full-discount/full-discount', 'ios-american-football', 2, 'full-cut', '1367042804944994304', 'full-discount', '4.31', '满额活动', '/store/promotion/fullDiscount*');
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1367042917113266176, NULL, '2022-01-11 23:26:45.000000', b'0', NULL, '2022-01-11 23:26:50', NULL, 'promotion/coupon/coupon', 'ios-american-football', 2, 'coupon', '1367042804944994304', 'coupon', '4.32', '优惠券', '/store/promotion/coupon*');
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1367043020976816128, NULL, '2022-01-11 23:28:50.000000', b'0', NULL, '2022-01-11 23:29:02', NULL, 'Main', 'ios-american-football', 1, 'Main', '1367040599596728320', '/', '4.4', '分销管理', NULL);
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1367043443917848576, NULL, '2022-01-11 23:28:53.000000', b'0', NULL, '2022-01-11 23:29:04', NULL, 'distribution/distributionGoods', 'ios-american-football', 2, 'distributionGoods', '1367043020976816128', 'distributionGoods', '4.41', '分销商品', '/store/distribution/goods*');
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1367043505771249664, NULL, '2022-01-11 23:28:56.000000', b'0', NULL, '2022-01-11 23:29:07', NULL, 'distribution/distributionOrder', 'ios-american-football', 2, 'distributionOrder', '1367043020976816128', 'distributionOrderdistributionOrder', '4.42', '分销订单', '/store/distribution/order*');
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1367044121163726848, NULL, '2022-01-12 21:47:03.000000', b'0', NULL, '2022-01-12 21:47:25', NULL, 'Main', 'ios-american-football', 0, 'statistics', '0', '/', '5', '统计', NULL);
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1367044247978508288, NULL, '2022-01-12 21:47:19.000000', b'0', NULL, '2022-01-12 21:47:28', NULL, 'Main', 'ios-american-football', 1, 'Main', '1367044121163726848', '/', '5.1', '统计管理', NULL);
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1367044376391319552, NULL, '2022-01-12 21:49:45.000000', b'0', NULL, '2022-01-12 21:50:01', NULL, 'statistics/goods', 'ios-american-football', 2, 'goodsStatistics', '1367044247978508288', 'goodsStatistics', '5.11', '商品统计', '/store/statistics/goods*');
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1367044657296441344, NULL, '2022-01-12 21:49:48.000000', b'0', NULL, '2022-01-12 21:49:58', NULL, 'statistics/order', 'ios-american-football', 2, 'orderStatistics', '1367044247978508288', 'orderStatistics', '5.12', '订单统计', '/store/statistics/order*,/store/statistics/order*,/store/statistics/order*,/store/statistics/order*');
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1367045529720061952, NULL, '2022-01-12 21:49:51.000000', b'0', NULL, '2022-01-12 21:50:03', NULL, 'statistics/traffic', 'ios-american-football', 2, 'trafficStatistics', '1367044247978508288', 'trafficStatistics', '5.13', '流量统计', '/store/statistics/view*');
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1367045630710513664, NULL, '2022-01-12 21:52:59.000000', b'0', NULL, '2022-01-12 21:53:09', NULL, 'Main', 'ios-american-football', 0, 'settings', '0', '/', '6', '设置', NULL);
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1367045794284175360, NULL, '2022-01-12 21:53:03.000000', b'0', NULL, '2022-01-12 21:53:12', NULL, 'Main', 'ios-american-football', 1, 'Main', '1367045630710513664', '/', '6.1', '配送设置', NULL);
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1367045921434501120, NULL, '2022-01-12 21:55:49.000000', b'0', NULL, '2022-01-12 21:55:52', NULL, 'shop/ship/shipTemplate', 'ios-american-football', 2, 'shipTemplate', '1367045794284175360', 'shipTemplate', '6.11', '配送模板', '/store/setting/freightTemplate*');
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1367046068369358848, NULL, '2022-01-12 21:58:05.000000', b'0', NULL, '2022-01-12 21:58:13', NULL, 'shop/ship/logistics', 'ios-american-football', 2, 'logistics', '1367045794284175360', 'logistics', '6.12', '物流公司', '/store/other/logistics*');
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1367046266214678528, NULL, '2022-01-12 21:59:07.000000', b'0', NULL, '2022-01-12 21:59:43', NULL, 'Main', 'ios-american-football', 1, 'Main', '1367045630710513664', '/', '6.2', '店铺管理', NULL);
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1367048084701315072, NULL, '2022-01-12 21:59:32.000000', b'0', NULL, '2022-01-12 21:59:48', NULL, 'shop/shopSetting', 'ios-american-football', 2, 'shopSetting', '1367046266214678528', 'shopSetting', '6.21', '店铺设置', NULL);
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1367048684339986432, NULL, '2022-01-12 21:59:36.000000', b'0', NULL, '2022-01-12 21:59:51', NULL, 'shop/shopAddress', 'ios-american-football', 2, 'shopAddress', '1367046266214678528', 'shopAddress', '6.22', '自提管理', '/store/member/storeAddress*');
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1367048754229673984, NULL, '2022-01-12 22:02:11.000000', b'0', NULL, '2022-01-12 22:04:36', NULL, 'Main', 'ios-american-football', 0, 'Main', '0', '/', '7', '消息', NULL);
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1367048832210173952, NULL, '2022-01-12 22:02:49.000000', b'0', NULL, '2022-01-12 22:04:39', NULL, 'Main', 'ios-american-football', 1, 'Main', '1367048754229673984', '/', '7.1', '系统消息', NULL);
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1367048967635861503, NULL, '2022-02-18 16:08:30.000000', b'0', NULL, '2022-02-18 16:08:36', NULL, 'Main', 'ios-american-football', 1, 'Main', '1367045630710513664', '/', '6.3', '店员设置', '');
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1367048967635861504, NULL, '2022-01-12 22:02:51.000000', b'0', NULL, '2022-01-12 22:04:45', NULL, 'message', 'ios-american-football', 2, 'message_index', '1367048832210173952', 'message', '7.11', '系统消息', '/store/message/storeMessage*');
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1367048967635861505, NULL, '2022-02-18 16:12:18.000000', b'0', NULL, '2022-02-18 16:12:21', NULL, 'shop/system/clerk/clerkManage', 'ios-american-football', 2, '\nclerkManage', '1367048967635861503', '\nclerkManage', '6.31', '店员管理', '/store/department*,/store/clerk*,/store/role*,/store/department*');
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1367048967635861506, NULL, '2022-02-18 16:25:27.000000', NULL, NULL, '2022-02-18 16:25:31', NULL, 'shop/system/department/storeDepartmentManage', 'ios-american-football', 2, 'storeDepartmentManage', '1367048967635861503', 'storeDepartmentManage', '6.32', '部门管理', '/store/department*');
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1367048967635861507, NULL, '2022-02-18 16:27:28.000000', NULL, NULL, '2022-02-18 16:27:30', NULL, 'shop/system/role/storeRoleManage', 'ios-american-football', 2, 'storeRoleManage', '1367048967635861503', 'storeRoleManage', '6.33', '角色权限', '/store/role*');
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1367048967635861510, NULL, '2022-03-07 14:45:10.000000', b'0', NULL, '2022-03-07 14:45:13', NULL, 'shop/floorList', 'ios-american-football', 2, 'floorList', '1367046266214678528', 'floorList', '6.23', 'PC端', '/store/other/pageData*');
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1367048967635861511, NULL, '2022-03-07 15:13:52.000000', b'0', NULL, '2022-03-07 15:13:55', NULL, 'shop/wap/wapList', 'ios-american-football', 2, 'wapList', '1367046266214678528', 'wapList', '6.24', '移动端', '/store/other/pageData*');
|
||||||
|
|
||||||
|
SET FOREIGN_KEY_CHECKS = 1;
|
||||||
|
|
||||||
|
|
||||||
|
insert li_clerk(id,create_by,create_time,store_id,clerk_name,member_id,shopkeeper,is_super,`status`) select id,member_name,current_date(),id,member_name,member_id ,TRUE,TRUE,TRUE from li_store
|
||||||
|
|
||||||
|
|
||||||
48
DB/version4.2.4toMASTER.sql
Normal file
48
DB/version4.2.4toMASTER.sql
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
/** 增加签到日期 **/
|
||||||
|
ALTER TABLE li_member_sign
|
||||||
|
ADD day int DEFAULT NULL COMMENT '签到日 ';
|
||||||
|
ALTER TABLE li_member_sign
|
||||||
|
DROP INDEX uk_member_day;
|
||||||
|
ALTER TABLE li_member_sign
|
||||||
|
add unique uk_member_day (member_id, day) COMMENT 'uk_member_day';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- Table structure for li_hot_words_history
|
||||||
|
-- ----------------------------
|
||||||
|
DROP TABLE IF EXISTS `li_hot_words_history`;
|
||||||
|
CREATE TABLE `li_hot_words_history`
|
||||||
|
(
|
||||||
|
`id` bigint NOT NULL COMMENT 'ID',
|
||||||
|
`create_time` datetime(6) DEFAULT NULL COMMENT '创建时间',
|
||||||
|
`keywords` varchar(255) COLLATE utf8_bin DEFAULT NULL COMMENT '热词',
|
||||||
|
`score` int DEFAULT NULL COMMENT '热词分数',
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb3 COLLATE = utf8_bin COMMENT '热词历史表';
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- Records of li_hot_words_history
|
||||||
|
-- ----------------------------
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- Table structure for li_wholesale
|
||||||
|
-- ----------------------------
|
||||||
|
DROP TABLE IF EXISTS `li_wholesale`;
|
||||||
|
CREATE TABLE `li_wholesale`
|
||||||
|
(
|
||||||
|
`id` bigint NOT NULL,
|
||||||
|
`create_by` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
|
||||||
|
`create_time` datetime(6) DEFAULT NULL,
|
||||||
|
`delete_flag` bit(1) DEFAULT NULL,
|
||||||
|
`update_by` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
|
||||||
|
`update_time` datetime(6) DEFAULT NULL,
|
||||||
|
`price` decimal(10, 2) DEFAULT NULL COMMENT '价格',
|
||||||
|
`goods_id` bigint DEFAULT NULL COMMENT '商品id',
|
||||||
|
`sku_id` bigint DEFAULT NULL COMMENT '商品skuId',
|
||||||
|
`num` int DEFAULT NULL COMMENT '起购量',
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_bin COMMENT '批发规则表';
|
||||||
|
|
||||||
|
ALTER TABLE li_wholesale
|
||||||
|
ADD template_id bigint DEFAULT NULL COMMENT '商品模版id';
|
||||||
40
README.md
40
README.md
@@ -1,20 +1,23 @@
|
|||||||
## Lilishop B2B2C商城系统
|
## Lilishop B2B2C商城系统
|
||||||
|
|
||||||
##### 开源不易,如有帮助请点Star
|
#### 欢迎交流需求,交流业务,交流技术(基础问题自行解决,其他问题先看文档后提问)
|
||||||
|
|
||||||
|
#### 不用削尖脑袋往老群里加,老群活跃度较低,很多潜水党,新群相对而言活跃一些 :tw-1f606: :tw-1f606: :tw-1f606: :tw-1f606: :tw-1f606: :tw-1f606:
|
||||||
|
|
||||||
#### 欢迎交流需求,交流业务,交流技术(基础问题自行解决,进群先看文档后提问)
|
|
||||||
|
|
||||||
|
|
||||||
##### 交流 qq 1群 961316482(已满)
|
##### 交流 qq 1群 961316482(已满)
|
||||||
<a target="_blank" href="https://qm.qq.com/cgi-bin/qm/qr?k=BAhURE3DG2YWhQk6kRxVapbLykqMoPS8&jump_from=webapi"><img border="0" src="https://pub.idqqimg.com/wpa/images/group.png" alt="Lilishop交流群" title="Lilishop交流群">点击快捷加群</a>
|
<a target="_blank" href="https://qm.qq.com/cgi-bin/qm/qr?k=BAhURE3DG2YWhQk6kRxVapbLykqMoPS8&jump_from=webapi"><img border="0" src="https://pub.idqqimg.com/wpa/images/group.png" alt="Lilishop交流群" title="Lilishop交流群">点击快捷加群</a>
|
||||||
|
|
||||||
##### 交流 qq 2群 875294241
|
##### 交流 qq 2群 875294241(已满)
|
||||||
|
|
||||||
<a target="_blank" href="https://qm.qq.com/cgi-bin/qm/qr?k=_lrekOvr5k2p5uTn5GRidI-chKEmpCX3&jump_from=webapi"><img border="0" src="https://pub.idqqimg.com/wpa/images/group.png" alt="Lilishop交流群2群" title="Lilishop交流群2群">点击快捷加群</a>
|
<a target="_blank" href="https://qm.qq.com/cgi-bin/qm/qr?k=_lrekOvr5k2p5uTn5GRidI-chKEmpCX3&jump_from=webapi"><img border="0" src="https://pub.idqqimg.com/wpa/images/group.png" alt="Lilishop交流群2群" title="Lilishop交流群2群">点击快捷加群</a>
|
||||||
|
|
||||||
|
|
||||||
|
##### 交流 qq 3群 263785057
|
||||||
|
|
||||||
|
<a target="_blank" href="https://qm.qq.com/cgi-bin/qm/qr?k=VUogkDvaso4zLTFH8nxFPDRKq0EthUn1&jump_from=webapi"><img border="0" src="//pub.idqqimg.com/wpa/images/group.png" alt="Lilishop交流群3群" title="Lilishop交流群3群">点击快捷加群</a>
|
||||||
|
|
||||||
|
|
||||||
##### 体验 公众号/小程序/APP 体验,扫描二维码
|
##### 体验 公众号/小程序/APP 体验,扫描二维码
|
||||||
|
|
||||||

|

|
||||||
@@ -28,13 +31,13 @@
|
|||||||
|
|
||||||
Lilishop商城系统支持商家入驻,后端基于SpringBoot 研发,前端使用 Vue、uniapp开发, **系统全端全部代码开源**
|
Lilishop商城系统支持商家入驻,后端基于SpringBoot 研发,前端使用 Vue、uniapp开发, **系统全端全部代码开源**
|
||||||
|
|
||||||
商城前后端分离,支持分布式部署,支持Docker,各个API独立,并且有独立的消费者。
|
前后端分离,支持分布式部署,支持Docker,各个API独立,并且有独立的消费者。
|
||||||
|
|
||||||
### 商城 API/消费者 聚合版
|
### 商城 API/消费者 聚合版
|
||||||
api不需要单独部署,只需启动一个jar包就可以正常运转 如有需要,可以点击跳转
|
api不需要单独部署,只需启动一个jar包就可以正常运转 如有需要,可以点击跳转
|
||||||
https://gitee.com/beijing_hongye_huicheng/lilishop-simplify
|
https://gitee.com/beijing_hongye_huicheng/lilishop-simplify
|
||||||
|
|
||||||
### 商城 开发/使用/常见问题 帮助文档
|
### 开发/使用/常见问题 帮助文档
|
||||||
|
|
||||||
https://docs.pickmall.cn
|
https://docs.pickmall.cn
|
||||||
|
|
||||||
@@ -61,7 +64,7 @@ PS:手机验证码为 ‘111111’
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
### 快速部署本地商城
|
### 快速本地部署
|
||||||
|
|
||||||
[点击跳转](https://docs.pickmall.cn/deploy/%E8%BF%90%E8%A1%8C%E7%8E%AF%E5%A2%83%E5%87%86%E5%A4%87.html)
|
[点击跳转](https://docs.pickmall.cn/deploy/%E8%BF%90%E8%A1%8C%E7%8E%AF%E5%A2%83%E5%87%86%E5%A4%87.html)
|
||||||
|
|
||||||
@@ -138,11 +141,19 @@ PS:手机验证码为 ‘111111’
|
|||||||
### 版本升级
|
### 版本升级
|
||||||
|
|
||||||
```
|
```
|
||||||
商城后续会持续版本升级,修复bug,完善功能,覆盖更多业务场景 o2o/b2b/s2b2b2c/跨境电商
|
系统后续会提供多场景解决方案。
|
||||||
|
更多架构:微服务、Saas、中台等,都会支持。 支持差价升级商业授权
|
||||||
后续会考虑推出微服务商城系统/商城中台等
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### 商业授权
|
||||||
|
商业版本与开源版本代码一致,没有区分
|
||||||
|
|
||||||
|
商业使用需要授权,授权方式可选择联系官网客服,或者qq群联系群主。
|
||||||
|
|
||||||
|
商业授权模式为永久授权,支持永久升级。
|
||||||
|
|
||||||
|
商业案例由于涉及部分多层二开关系,如需了解可以咨询销售。
|
||||||
|
|
||||||
|
|
||||||
### 开源须知
|
### 开源须知
|
||||||
1.仅允许用于个人学习研究使用.
|
1.仅允许用于个人学习研究使用.
|
||||||
@@ -151,11 +162,12 @@ PS:手机验证码为 ‘111111’
|
|||||||
|
|
||||||
3.软件受国家计算机软件著作权保护(登记号:2021SR0805085)。
|
3.软件受国家计算机软件著作权保护(登记号:2021SR0805085)。
|
||||||
|
|
||||||
4.限制商用,如果需要商业使用请联系我们。QQ3409056806.
|
4.限制商用,如果需要商业使用请联系我们。QQ3409056806.或者加入qq群联系群主。
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### 交流群
|
### 交流群
|
||||||
|
|
||||||
##### 官方qq 1群 961316482(已满)
|
##### 官方qq 1群 961316482(已满)
|
||||||
##### 官方qq 2群 875294241
|
##### 官方qq 2群 875294241(已满)
|
||||||
|
##### 官网qq 3群 263785057
|
||||||
|
|||||||
@@ -32,10 +32,10 @@
|
|||||||
<artifactId>logstash-logback-encoder</artifactId>
|
<artifactId>logstash-logback-encoder</artifactId>
|
||||||
<version>${logstash-logback-encoder}</version>
|
<version>${logstash-logback-encoder}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- <dependency>-->
|
<!-- <dependency>-->
|
||||||
<!-- <groupId>org.springframework.boot</groupId>-->
|
<!-- <groupId>org.springframework.boot</groupId>-->
|
||||||
<!-- <artifactId>spring-boot-starter-mail</artifactId>-->
|
<!-- <artifactId>spring-boot-starter-mail</artifactId>-->
|
||||||
<!-- </dependency> -->
|
<!-- </dependency> -->
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|||||||
@@ -16,5 +16,6 @@ spring.mail.username=1814994716@qq.com
|
|||||||
spring.mail.password=abcdefg123456!@#$%^
|
spring.mail.password=abcdefg123456!@#$%^
|
||||||
# 日志文件路径
|
# 日志文件路径
|
||||||
logging.file.path=lili-logs/admin
|
logging.file.path=lili-logs/admin
|
||||||
|
lili.data.logstash.server=106.124.130.167:4560
|
||||||
# 文件格式
|
# 文件格式
|
||||||
logging.pattern.file=%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(%5p) %clr(${PID}){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n%wEx
|
logging.pattern.file=%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(%5p) %clr(${PID}){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n%wEx
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ public class BuyerApiApplication {
|
|||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
System.setProperty("es.set.netty.runtime.available.processors", "false");
|
System.setProperty("es.set.netty.runtime.available.processors", "false");
|
||||||
|
System.setProperty("rocketmq.client.logUseSlf4j","true");
|
||||||
SpringApplication.run(BuyerApiApplication.class, args);
|
SpringApplication.run(BuyerApiApplication.class, args);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import cn.lili.modules.search.entity.dos.EsGoodsIndex;
|
|||||||
import cn.lili.modules.search.entity.dos.EsGoodsRelatedInfo;
|
import cn.lili.modules.search.entity.dos.EsGoodsRelatedInfo;
|
||||||
import cn.lili.modules.search.entity.dto.EsGoodsSearchDTO;
|
import cn.lili.modules.search.entity.dto.EsGoodsSearchDTO;
|
||||||
import cn.lili.modules.search.service.EsGoodsSearchService;
|
import cn.lili.modules.search.service.EsGoodsSearchService;
|
||||||
|
import cn.lili.modules.search.service.HotWordsService;
|
||||||
import cn.lili.modules.statistics.aop.PageViewPoint;
|
import cn.lili.modules.statistics.aop.PageViewPoint;
|
||||||
import cn.lili.modules.statistics.aop.enums.PageViewEnum;
|
import cn.lili.modules.statistics.aop.enums.PageViewEnum;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
@@ -62,6 +63,9 @@ public class GoodsBuyerController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private EsGoodsSearchService goodsSearchService;
|
private EsGoodsSearchService goodsSearchService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private HotWordsService hotWordsService;
|
||||||
|
|
||||||
@ApiOperation(value = "通过id获取商品信息")
|
@ApiOperation(value = "通过id获取商品信息")
|
||||||
@ApiImplicitParam(name = "goodsId", value = "商品ID", required = true, paramType = "path", dataType = "Long")
|
@ApiImplicitParam(name = "goodsId", value = "商品ID", required = true, paramType = "path", dataType = "Long")
|
||||||
@GetMapping(value = "/get/{goodsId}")
|
@GetMapping(value = "/get/{goodsId}")
|
||||||
@@ -117,7 +121,7 @@ public class GoodsBuyerController {
|
|||||||
@ApiOperation(value = "获取搜索热词")
|
@ApiOperation(value = "获取搜索热词")
|
||||||
@GetMapping("/hot-words")
|
@GetMapping("/hot-words")
|
||||||
public ResultMessage<List<String>> getGoodsHotWords(Integer count) {
|
public ResultMessage<List<String>> getGoodsHotWords(Integer count) {
|
||||||
List<String> hotWords = goodsSearchService.getHotWords(count);
|
List<String> hotWords = hotWordsService.getHotWords(count);
|
||||||
return ResultUtil.data(hotWords);
|
return ResultUtil.data(hotWords);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import cn.lili.common.vo.PageVO;
|
|||||||
import cn.lili.common.vo.ResultMessage;
|
import cn.lili.common.vo.ResultMessage;
|
||||||
import cn.lili.modules.member.service.FootprintService;
|
import cn.lili.modules.member.service.FootprintService;
|
||||||
import cn.lili.modules.search.entity.dos.EsGoodsIndex;
|
import cn.lili.modules.search.entity.dos.EsGoodsIndex;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
@@ -34,7 +35,7 @@ public class FootprintController {
|
|||||||
|
|
||||||
@ApiOperation(value = "分页获取")
|
@ApiOperation(value = "分页获取")
|
||||||
@GetMapping
|
@GetMapping
|
||||||
public ResultMessage<List<EsGoodsIndex>> getByPage(PageVO page) {
|
public ResultMessage<IPage<EsGoodsIndex>> getByPage(PageVO page) {
|
||||||
return ResultUtil.data(footprintService.footPrintPage(page));
|
return ResultUtil.data(footprintService.footPrintPage(page));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ public class MemberEvaluationBuyerController {
|
|||||||
@ApiOperation(value = "查看会员评价详情")
|
@ApiOperation(value = "查看会员评价详情")
|
||||||
@ApiImplicitParam(name = "id", value = "评价ID", required = true, paramType = "path")
|
@ApiImplicitParam(name = "id", value = "评价ID", required = true, paramType = "path")
|
||||||
@GetMapping(value = "/get/{id}")
|
@GetMapping(value = "/get/{id}")
|
||||||
public ResultMessage<MemberEvaluationVO> save(@NotNull(message = "评价ID不能为空") @PathVariable("id") String id) {
|
public ResultMessage<MemberEvaluationVO> get(@NotNull(message = "评价ID不能为空") @PathVariable("id") String id) {
|
||||||
return ResultUtil.data(memberEvaluationService.queryById(id));
|
return ResultUtil.data(memberEvaluationService.queryById(id));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package cn.lili.controller.member;
|
package cn.lili.controller.member;
|
||||||
|
|
||||||
|
import cn.lili.cache.limit.annotation.LimitPoint;
|
||||||
import cn.lili.common.aop.annotation.PreventDuplicateSubmissions;
|
import cn.lili.common.aop.annotation.PreventDuplicateSubmissions;
|
||||||
import cn.lili.common.enums.ResultUtil;
|
import cn.lili.common.enums.ResultUtil;
|
||||||
import cn.lili.common.vo.ResultMessage;
|
import cn.lili.common.vo.ResultMessage;
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ public class OrderComplaintBuyerController {
|
|||||||
@PostMapping("/communication")
|
@PostMapping("/communication")
|
||||||
public ResultMessage<OrderComplaintCommunicationVO> addCommunication(@RequestParam String complainId, @RequestParam String content) {
|
public ResultMessage<OrderComplaintCommunicationVO> addCommunication(@RequestParam String complainId, @RequestParam String content) {
|
||||||
AuthUser currentUser = Objects.requireNonNull(UserContext.getCurrentUser());
|
AuthUser currentUser = Objects.requireNonNull(UserContext.getCurrentUser());
|
||||||
OrderComplaintCommunicationVO communicationVO = new OrderComplaintCommunicationVO(complainId, content, CommunicationOwnerEnum.BUYER.name(), currentUser.getId(), currentUser.getNickName());
|
OrderComplaintCommunicationVO communicationVO = new OrderComplaintCommunicationVO(complainId, content, CommunicationOwnerEnum.BUYER.name(), currentUser.getNickName(), currentUser.getId());
|
||||||
orderComplaintCommunicationService.addCommunication(communicationVO);
|
orderComplaintCommunicationService.addCommunication(communicationVO);
|
||||||
return ResultUtil.data(communicationVO);
|
return ResultUtil.data(communicationVO);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,17 +2,17 @@ package cn.lili.controller.other;
|
|||||||
|
|
||||||
import cn.lili.common.enums.ResultUtil;
|
import cn.lili.common.enums.ResultUtil;
|
||||||
import cn.lili.common.vo.ResultMessage;
|
import cn.lili.common.vo.ResultMessage;
|
||||||
|
import cn.lili.modules.page.entity.dos.PageData;
|
||||||
import cn.lili.modules.page.entity.dto.PageDataDTO;
|
import cn.lili.modules.page.entity.dto.PageDataDTO;
|
||||||
import cn.lili.modules.page.entity.enums.PageEnum;
|
import cn.lili.modules.page.entity.enums.PageEnum;
|
||||||
import cn.lili.modules.page.entity.vos.PageDataVO;
|
import cn.lili.modules.page.entity.vos.PageDataVO;
|
||||||
import cn.lili.modules.page.service.PageDataService;
|
import cn.lili.modules.page.service.PageDataService;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 买家端,页面接口
|
* 买家端,页面接口
|
||||||
@@ -36,12 +36,53 @@ public class PageBuyerController {
|
|||||||
public ResultMessage<PageDataVO> getIndex(@RequestParam String clientType) {
|
public ResultMessage<PageDataVO> getIndex(@RequestParam String clientType) {
|
||||||
PageDataDTO pageDataDTO = new PageDataDTO(PageEnum.INDEX.name());
|
PageDataDTO pageDataDTO = new PageDataDTO(PageEnum.INDEX.name());
|
||||||
pageDataDTO.setPageClientType(clientType);
|
pageDataDTO.setPageClientType(clientType);
|
||||||
return ResultUtil.data(pageService.getPageData(pageDataDTO));
|
PageDataVO pageDataVO=pageService.getPageData(pageDataDTO);
|
||||||
|
return ResultUtil.data(pageDataVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "获取页面数据")
|
@ApiOperation(value = "获取页面数据")
|
||||||
@GetMapping
|
@GetMapping
|
||||||
public ResultMessage<PageDataVO> get(PageDataDTO pageDataDTO) {
|
public ResultMessage<PageDataVO> get(PageDataDTO pageDataDTO) {
|
||||||
return ResultUtil.data(pageService.getPageData(pageDataDTO));
|
PageDataVO pageDataVO=pageService.getPageData(pageDataDTO);
|
||||||
|
return ResultUtil.data(pageDataVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "获取页面数据")
|
||||||
|
@ApiImplicitParam(name = "id", value = "id", required = true, dataType = "String", paramType = "path")
|
||||||
|
@GetMapping("/get/{id}")
|
||||||
|
public ResultMessage<PageData> getPage(@PathVariable("id") String id) {
|
||||||
|
return ResultUtil.data(pageService.getSpecial(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "获取专题页面数据(根据消息内容得知)")
|
||||||
|
@GetMapping("/getSpecial")
|
||||||
|
public ResultMessage<PageData> getSpecial(@RequestParam String body) {
|
||||||
|
String name = "";
|
||||||
|
if (body.indexOf("』") >= 0 && body.indexOf("『") >= 0) {
|
||||||
|
name = body.substring(body.indexOf("『") + 1, body.lastIndexOf("』"));
|
||||||
|
} else if (body.indexOf("〉") >= 0 && body.indexOf("〈") >= 0) {
|
||||||
|
name = body.substring(body.indexOf("〈") + 1, body.lastIndexOf("〉"));
|
||||||
|
} else if (body.indexOf("」") >= 0 && body.indexOf("「") >= 0) {
|
||||||
|
name = body.substring(body.indexOf("「") + 1, body.lastIndexOf("」"));
|
||||||
|
} else if (body.indexOf("》") >= 0 && body.indexOf("《") >= 0) {
|
||||||
|
name = body.substring(body.indexOf("《") + 1, body.lastIndexOf("》"));
|
||||||
|
} else if (body.indexOf(")") >= 0 && body.indexOf("(") >= 0) {
|
||||||
|
name = body.substring(body.indexOf("(") + 1, body.lastIndexOf(")"));
|
||||||
|
} else if (body.indexOf("】") >= 0 && body.indexOf("【") >= 0) {
|
||||||
|
name = body.substring(body.indexOf("【") + 1, body.lastIndexOf("】"));
|
||||||
|
} else if (body.indexOf("}") >= 0 && body.indexOf("{") >= 0) {
|
||||||
|
name = body.substring(body.indexOf("{") + 1, body.lastIndexOf("}"));
|
||||||
|
} else if (body.indexOf("!") >= 0) {
|
||||||
|
name = body.substring(body.indexOf("!") + 1, body.lastIndexOf("!"));
|
||||||
|
} else if (body.indexOf("|") >= 0) {
|
||||||
|
name = body.substring(body.indexOf("|") + 1, body.lastIndexOf("|"));
|
||||||
|
}
|
||||||
|
|
||||||
|
PageData pageData = pageService.getOne(
|
||||||
|
new LambdaQueryWrapper<PageData>()
|
||||||
|
.eq(PageData::getPageType, PageEnum.SPECIAL.name())
|
||||||
|
.eq(PageData::getName, name));
|
||||||
|
return ResultUtil.data(pageData);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package cn.lili.controller.other.broadcast;
|
|||||||
import cn.lili.common.enums.ResultUtil;
|
import cn.lili.common.enums.ResultUtil;
|
||||||
import cn.lili.common.vo.PageVO;
|
import cn.lili.common.vo.PageVO;
|
||||||
import cn.lili.common.vo.ResultMessage;
|
import cn.lili.common.vo.ResultMessage;
|
||||||
import cn.lili.modules.goods.entity.dos.Studio;
|
import cn.lili.modules.goods.entity.vos.StudioVO;
|
||||||
import cn.lili.modules.goods.service.StudioService;
|
import cn.lili.modules.goods.service.StudioService;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
@@ -35,7 +35,7 @@ public class StudioController {
|
|||||||
@ApiImplicitParam(name = "status", value = "直播间状态", paramType = "query", dataType = "String")
|
@ApiImplicitParam(name = "status", value = "直播间状态", paramType = "query", dataType = "String")
|
||||||
})
|
})
|
||||||
@GetMapping
|
@GetMapping
|
||||||
public ResultMessage<IPage<Studio>> page(PageVO pageVO, Integer recommend, String status) {
|
public ResultMessage<IPage<StudioVO>> page(PageVO pageVO, Integer recommend, String status) {
|
||||||
return ResultUtil.data(studioService.studioList(pageVO, recommend, status));
|
return ResultUtil.data(studioService.studioList(pageVO, recommend, status));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ import cn.lili.common.security.enums.UserEnums;
|
|||||||
import cn.lili.common.vo.ResultMessage;
|
import cn.lili.common.vo.ResultMessage;
|
||||||
import cn.lili.modules.member.entity.dos.Member;
|
import cn.lili.modules.member.entity.dos.Member;
|
||||||
import cn.lili.modules.member.entity.dto.MemberEditDTO;
|
import cn.lili.modules.member.entity.dto.MemberEditDTO;
|
||||||
|
import cn.lili.modules.member.entity.enums.QRCodeLoginSessionStatusEnum;
|
||||||
|
import cn.lili.modules.member.entity.vo.QRLoginResultVo;
|
||||||
import cn.lili.modules.member.service.MemberService;
|
import cn.lili.modules.member.service.MemberService;
|
||||||
import cn.lili.modules.sms.SmsUtil;
|
import cn.lili.modules.sms.SmsUtil;
|
||||||
import cn.lili.modules.verification.entity.enums.VerificationEnums;
|
import cn.lili.modules.verification.entity.enums.VerificationEnums;
|
||||||
@@ -15,10 +17,18 @@ import io.swagger.annotations.Api;
|
|||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
import io.swagger.annotations.ApiImplicitParams;
|
import io.swagger.annotations.ApiImplicitParams;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.context.request.async.DeferredResult;
|
||||||
|
|
||||||
import javax.validation.constraints.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.util.concurrent.CompletableFuture;
|
||||||
|
import java.util.concurrent.Executors;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 买家端,会员接口
|
* 买家端,会员接口
|
||||||
@@ -26,6 +36,7 @@ import javax.validation.constraints.NotNull;
|
|||||||
* @author Chopper
|
* @author Chopper
|
||||||
* @since 2020/11/16 10:07 下午
|
* @since 2020/11/16 10:07 下午
|
||||||
*/
|
*/
|
||||||
|
@Slf4j
|
||||||
@RestController
|
@RestController
|
||||||
@Api(tags = "买家端,会员接口")
|
@Api(tags = "买家端,会员接口")
|
||||||
@RequestMapping("/buyer/passport/member")
|
@RequestMapping("/buyer/passport/member")
|
||||||
@@ -39,6 +50,73 @@ public class MemberBuyerController {
|
|||||||
private VerificationService verificationService;
|
private VerificationService verificationService;
|
||||||
|
|
||||||
|
|
||||||
|
@ApiOperation(value = "web-获取登录二维码")
|
||||||
|
@PostMapping(value = "/pc_session", produces = "application/json;charset=UTF-8")
|
||||||
|
public ResultMessage<Object> createPcSession() {
|
||||||
|
return ResultUtil.data(memberService.createPcSession());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 长轮询:参考nacos
|
||||||
|
*
|
||||||
|
* @param token
|
||||||
|
* @param beforeSessionStatus 上次记录的session状态
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "web-二维码登录")
|
||||||
|
@PostMapping(value = "/session_login/{token}", produces = "application/json;charset=UTF-8")
|
||||||
|
public Object loginWithSession(@PathVariable("token") String token, Integer beforeSessionStatus) {
|
||||||
|
log.info("receive login with session key {}", token);
|
||||||
|
ResponseEntity<ResultMessage<Object>> timeoutResponseEntity =
|
||||||
|
new ResponseEntity<>(ResultUtil.error(ResultCode.ERROR), HttpStatus.OK);
|
||||||
|
int timeoutSecond = 20;
|
||||||
|
DeferredResult<ResponseEntity<Object>> deferredResult = new DeferredResult<>(timeoutSecond * 1000L, timeoutResponseEntity);
|
||||||
|
CompletableFuture.runAsync(() -> {
|
||||||
|
try {
|
||||||
|
int i = 0;
|
||||||
|
while (i < timeoutSecond) {
|
||||||
|
QRLoginResultVo queryResult = memberService.loginWithSession(token);
|
||||||
|
int status = queryResult.getStatus();
|
||||||
|
if (status == beforeSessionStatus
|
||||||
|
&& (QRCodeLoginSessionStatusEnum.WAIT_SCANNING.getCode() == status
|
||||||
|
|| QRCodeLoginSessionStatusEnum.SCANNING.getCode() == status)) {
|
||||||
|
//睡眠一秒种,继续等待结果
|
||||||
|
TimeUnit.SECONDS.sleep(1);
|
||||||
|
} else {
|
||||||
|
deferredResult.setResult(new ResponseEntity<>(ResultUtil.data(queryResult), HttpStatus.OK));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("获取登录状态异常,", e);
|
||||||
|
deferredResult.setResult(new ResponseEntity<>(ResultUtil.error(ResultCode.ERROR), HttpStatus.OK));
|
||||||
|
Thread.currentThread().interrupt();
|
||||||
|
}
|
||||||
|
}, Executors.newCachedThreadPool());
|
||||||
|
return deferredResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "app扫码")
|
||||||
|
@PostMapping(value = "/app_scanner", produces = "application/json;charset=UTF-8")
|
||||||
|
public ResultMessage<Object> appScanner(String token) {
|
||||||
|
return ResultUtil.data(memberService.appScanner(token));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ApiOperation(value = "app扫码-登录确认:同意/拒绝")
|
||||||
|
@ApiImplicitParams({
|
||||||
|
@ApiImplicitParam(name = "token", value = "sessionToken", required = true, paramType = "query"),
|
||||||
|
@ApiImplicitParam(name = "code", value = "操作:0拒绝登录,1同意登录", required = true, paramType = "query")
|
||||||
|
})
|
||||||
|
@PostMapping(value = "/app_confirm", produces = "application/json;charset=UTF-8")
|
||||||
|
public ResultMessage<Object> appSConfirm(String token, Integer code) {
|
||||||
|
boolean flag = memberService.appSConfirm(token, code);
|
||||||
|
return flag ? ResultUtil.success() : ResultUtil.error(ResultCode.ERROR);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@ApiOperation(value = "登录接口")
|
@ApiOperation(value = "登录接口")
|
||||||
@ApiImplicitParams({
|
@ApiImplicitParams({
|
||||||
@ApiImplicitParam(name = "username", value = "用户名", required = true, paramType = "query"),
|
@ApiImplicitParam(name = "username", value = "用户名", required = true, paramType = "query"),
|
||||||
@@ -125,7 +203,6 @@ public class MemberBuyerController {
|
|||||||
|
|
||||||
@ApiOperation(value = "修改密码")
|
@ApiOperation(value = "修改密码")
|
||||||
@ApiImplicitParams({
|
@ApiImplicitParams({
|
||||||
@ApiImplicitParam(name = "mobile", value = "手机号", required = true, paramType = "query"),
|
|
||||||
@ApiImplicitParam(name = "password", value = "是否保存登录", required = true, paramType = "query")
|
@ApiImplicitParam(name = "password", value = "是否保存登录", required = true, paramType = "query")
|
||||||
})
|
})
|
||||||
@PostMapping("/resetPassword")
|
@PostMapping("/resetPassword")
|
||||||
@@ -152,6 +229,34 @@ public class MemberBuyerController {
|
|||||||
return ResultUtil.data(memberService.modifyPass(password, newPassword));
|
return ResultUtil.data(memberService.modifyPass(password, newPassword));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "初始设置密码")
|
||||||
|
@ApiImplicitParams({
|
||||||
|
@ApiImplicitParam(name = "newPassword", value = "新密码", required = true, paramType = "query")
|
||||||
|
})
|
||||||
|
@PutMapping("/canInitPassword")
|
||||||
|
public ResultMessage<Object> canInitPassword() {
|
||||||
|
return ResultUtil.data(memberService.canInitPass());
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "初始设置密码")
|
||||||
|
@ApiImplicitParams({
|
||||||
|
@ApiImplicitParam(name = "newPassword", value = "新密码", required = true, paramType = "query")
|
||||||
|
})
|
||||||
|
@PutMapping("/initPassword")
|
||||||
|
public ResultMessage<Object> initPassword(@NotNull(message = "密码不能为空") @RequestParam String password) {
|
||||||
|
memberService.initPass(password);
|
||||||
|
return ResultUtil.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "注销账号")
|
||||||
|
@ApiImplicitParams({
|
||||||
|
@ApiImplicitParam(name = "password", value = "密码", required = true, paramType = "query")
|
||||||
|
})
|
||||||
|
@PutMapping("/cancellation")
|
||||||
|
public ResultMessage<Member> cancellation(@NotNull(message = "密码不能为空") @RequestParam String password) {
|
||||||
|
memberService.cancellation(password);
|
||||||
|
return ResultUtil.success();
|
||||||
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "刷新token")
|
@ApiOperation(value = "刷新token")
|
||||||
@GetMapping("/refresh/{refreshToken}")
|
@GetMapping("/refresh/{refreshToken}")
|
||||||
|
|||||||
@@ -0,0 +1,30 @@
|
|||||||
|
package cn.lili.init;
|
||||||
|
|
||||||
|
import cn.lili.modules.search.service.EsGoodsIndexService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.boot.ApplicationArguments;
|
||||||
|
import org.springframework.boot.ApplicationRunner;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author paulG
|
||||||
|
* @since 2022/6/9
|
||||||
|
**/
|
||||||
|
@Component
|
||||||
|
@Slf4j
|
||||||
|
public class EsGoodsIndexInitRunner implements ApplicationRunner {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private EsGoodsIndexService esGoodsIndexService;
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run(ApplicationArguments args) {
|
||||||
|
try {
|
||||||
|
esGoodsIndexService.initIndex();
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("检测ES商品索引失败", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
0
buyer-api/src/main/java/cn/lili/security/BuyerAuthenticationFilter.java
Executable file → Normal file
0
buyer-api/src/main/java/cn/lili/security/BuyerAuthenticationFilter.java
Executable file → Normal file
@@ -20,6 +20,23 @@
|
|||||||
</encoder>
|
</encoder>
|
||||||
</appender>
|
</appender>
|
||||||
|
|
||||||
|
<appender name="RocketmqClientAppender" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
|
<file>${LOG_FILE_PATH}/rocketmq.log</file>
|
||||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
|
<fileNamePattern>${LOG_FILE_PATH}/rocketmq/rocketmq-%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||||
|
<maxHistory>30</maxHistory>
|
||||||
|
<totalSizeCap>30MB</totalSizeCap>
|
||||||
|
</rollingPolicy>
|
||||||
|
<encoder>
|
||||||
|
<pattern>%d{yy-MM-dd.HH:mm:ss.SSS} [%-16t] %-5p %-22c{0} %X{ServiceId} - %m%n</pattern>
|
||||||
|
</encoder>
|
||||||
|
</appender>
|
||||||
|
<logger name="RocketmqClient" additivity="false">
|
||||||
|
<level value="info" />
|
||||||
|
<appender-ref ref="RocketmqClientAppender"/>
|
||||||
|
</logger>
|
||||||
|
|
||||||
|
|
||||||
<!--输出到elk的LOGSTASH-->
|
<!--输出到elk的LOGSTASH-->
|
||||||
<appender name="LOGSTASH" class="net.logstash.logback.appender.LogstashTcpSocketAppender">
|
<appender name="LOGSTASH" class="net.logstash.logback.appender.LogstashTcpSocketAppender">
|
||||||
<!-- 配置elk日志收集 配饰的是 LOGSTASH 的地址-->
|
<!-- 配置elk日志收集 配饰的是 LOGSTASH 的地址-->
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package cn.lili.buyer.test.cart;
|
package cn.lili.buyer.test.cart;
|
||||||
|
|
||||||
|
|
||||||
import cn.lili.modules.file.plugin.FileManagerPlugin;
|
import cn.lili.modules.file.plugin.FilePlugin;
|
||||||
import cn.lili.modules.goods.entity.dos.Brand;
|
import cn.lili.modules.goods.entity.dos.Brand;
|
||||||
import cn.lili.modules.goods.service.BrandService;
|
import cn.lili.modules.goods.service.BrandService;
|
||||||
import com.xkcoding.http.util.StringUtil;
|
import com.xkcoding.http.util.StringUtil;
|
||||||
@@ -27,7 +27,7 @@ class FileTest {
|
|||||||
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private FileManagerPlugin fileManagerPlugin;
|
private FilePlugin fileManagerPlugin;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private BrandService brandService;
|
private BrandService brandService;
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import org.springframework.cache.annotation.EnableCaching;
|
|||||||
public class CommonApiApplication {
|
public class CommonApiApplication {
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
System.setProperty("rocketmq.client.logUseSlf4j","true");
|
||||||
SpringApplication.run(CommonApiApplication.class, args);
|
SpringApplication.run(CommonApiApplication.class, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ public class IMController {
|
|||||||
try {
|
try {
|
||||||
Setting imSettingVal = settingService.get(SettingEnum.IM_SETTING.name());
|
Setting imSettingVal = settingService.get(SettingEnum.IM_SETTING.name());
|
||||||
ImSetting imSetting = JSONUtil.toBean(imSettingVal.getSettingValue(), ImSetting.class);
|
ImSetting imSetting = JSONUtil.toBean(imSettingVal.getSettingValue(), ImSetting.class);
|
||||||
imUrl = imSetting.getHttpUrl() + "?tenant_id=" + imSetting.getTenantId()+"&merchant_euid=";
|
imUrl = imSetting.getHttpUrl();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new ServiceException(ResultCode.PLATFORM_NOT_SUPPORTED_IM);
|
throw new ServiceException(ResultCode.PLATFORM_NOT_SUPPORTED_IM);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,9 +2,9 @@ package cn.lili.controller.common;
|
|||||||
|
|
||||||
import cn.lili.common.enums.ResultUtil;
|
import cn.lili.common.enums.ResultUtil;
|
||||||
import cn.lili.common.vo.ResultMessage;
|
import cn.lili.common.vo.ResultMessage;
|
||||||
import cn.lili.modules.system.service.RegionService;
|
|
||||||
import cn.lili.modules.system.entity.dos.Region;
|
import cn.lili.modules.system.entity.dos.Region;
|
||||||
import cn.lili.modules.system.entity.vo.RegionVO;
|
import cn.lili.modules.system.entity.vo.RegionVO;
|
||||||
|
import cn.lili.modules.system.service.RegionService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
import io.swagger.annotations.ApiImplicitParams;
|
import io.swagger.annotations.ApiImplicitParams;
|
||||||
@@ -38,6 +38,11 @@ public class RegionController {
|
|||||||
return ResultUtil.data(regionService.getRegion(cityCode,townName));
|
return ResultUtil.data(regionService.getRegion(cityCode,townName));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping(value = "/name")
|
||||||
|
@ApiOperation(value = "根据名字获取地区地址id")
|
||||||
|
public ResultMessage<String> getItemByLastName(String lastName) {
|
||||||
|
return ResultUtil.data(regionService.getItemByLastName(lastName));
|
||||||
|
}
|
||||||
|
|
||||||
@GetMapping(value = "/item/{id}")
|
@GetMapping(value = "/item/{id}")
|
||||||
@ApiImplicitParam(name = "id", value = "地区ID", required = true, dataType = "String", paramType = "path")
|
@ApiImplicitParam(name = "id", value = "地区ID", required = true, dataType = "String", paramType = "path")
|
||||||
|
|||||||
@@ -6,31 +6,30 @@ import cn.lili.modules.system.entity.enums.SettingEnum;
|
|||||||
import cn.lili.modules.system.service.SettingService;
|
import cn.lili.modules.system.service.SettingService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 文件管理管理接口
|
* 站点基础配置获取
|
||||||
*
|
*
|
||||||
* @author Chopper
|
* @author liushuai(liushuai711 @ gmail.com)
|
||||||
* @since 2020/11/26 15:41
|
* @version v4.0
|
||||||
|
* @Description:
|
||||||
|
* @since 2022/9/22 17:49
|
||||||
*/
|
*/
|
||||||
|
@Slf4j
|
||||||
@RestController
|
@RestController
|
||||||
@Api(tags = "文件管理接口")
|
@RequestMapping("/common/common/site")
|
||||||
@RequestMapping("/common/common/logo")
|
@Api(tags = "站点基础接口")
|
||||||
public class LogoController {
|
public class SiteController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private SettingService settingService;
|
private SettingService settingService;
|
||||||
|
|
||||||
@ApiOperation(value = "获取logo")
|
@ApiOperation(value = "获取站点基础信息")
|
||||||
@GetMapping
|
@GetMapping
|
||||||
public ResultMessage<Object> getFileList() {
|
public ResultMessage<Object> baseSetting() {
|
||||||
return ResultUtil.data(settingService.get(SettingEnum.BASE_SETTING.name()));
|
return ResultUtil.data(settingService.get(SettingEnum.BASE_SETTING.name()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,43 +1,43 @@
|
|||||||
package cn.lili.controller.common;
|
package cn.lili.controller.common;
|
||||||
|
|
||||||
import cn.lili.cache.limit.annotation.LimitPoint;
|
import cn.lili.cache.limit.annotation.LimitPoint;
|
||||||
import cn.lili.common.enums.ResultUtil;
|
import cn.lili.common.enums.ResultUtil;
|
||||||
import cn.lili.common.vo.ResultMessage;
|
import cn.lili.common.vo.ResultMessage;
|
||||||
import cn.lili.modules.verification.entity.enums.VerificationEnums;
|
import cn.lili.modules.verification.entity.enums.VerificationEnums;
|
||||||
import cn.lili.modules.verification.service.VerificationService;
|
import cn.lili.modules.verification.service.VerificationService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 滑块验证码接口
|
* 滑块验证码接口
|
||||||
*
|
*
|
||||||
* @author Chopper
|
* @author Chopper
|
||||||
* @since 2020/11/26 15:41
|
* @since 2020/11/26 15:41
|
||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/common/common/slider")
|
@RequestMapping("/common/common/slider")
|
||||||
@Api(tags = "滑块验证码接口")
|
@Api(tags = "滑块验证码接口")
|
||||||
public class SliderImageController {
|
public class SliderImageController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private VerificationService verificationService;
|
private VerificationService verificationService;
|
||||||
|
|
||||||
@LimitPoint(name = "slider_image", key = "verification")
|
@LimitPoint(name = "slider_image", key = "verification")
|
||||||
@GetMapping("/{verificationEnums}")
|
@GetMapping("/{verificationEnums}")
|
||||||
@ApiOperation(value = "获取校验接口,一分钟同一个ip请求10次")
|
@ApiOperation(value = "获取校验接口,一分钟同一个ip请求10次")
|
||||||
public ResultMessage getSliderImage(@RequestHeader String uuid, @PathVariable VerificationEnums verificationEnums) {
|
public ResultMessage getSliderImage(@RequestHeader String uuid, @PathVariable VerificationEnums verificationEnums) {
|
||||||
return ResultUtil.data(verificationService.createVerification(verificationEnums, uuid));
|
return ResultUtil.data(verificationService.createVerification(verificationEnums, uuid));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@LimitPoint(name = "slider_image", key = "verification_pre_check", limit = 600)
|
@LimitPoint(name = "slider_image", key = "verification_pre_check", limit = 600)
|
||||||
@PostMapping("/{verificationEnums}")
|
@PostMapping("/{verificationEnums}")
|
||||||
@ApiOperation(value = "验证码预校验")
|
@ApiOperation(value = "验证码预校验")
|
||||||
public ResultMessage verificationImage(Integer xPos, @RequestHeader String uuid, @PathVariable VerificationEnums verificationEnums) {
|
public ResultMessage verificationImage(Integer xPos, @RequestHeader String uuid, @PathVariable VerificationEnums verificationEnums) {
|
||||||
return ResultUtil.data(verificationService.preCheck(xPos, uuid, verificationEnums));
|
return ResultUtil.data(verificationService.preCheck(xPos, uuid, verificationEnums));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,48 +1,48 @@
|
|||||||
package cn.lili.controller.common;
|
package cn.lili.controller.common;
|
||||||
|
|
||||||
import cn.lili.cache.limit.annotation.LimitPoint;
|
import cn.lili.cache.limit.annotation.LimitPoint;
|
||||||
import cn.lili.common.enums.ResultCode;
|
import cn.lili.common.enums.ResultCode;
|
||||||
import cn.lili.common.enums.ResultUtil;
|
import cn.lili.common.enums.ResultUtil;
|
||||||
import cn.lili.common.vo.ResultMessage;
|
import cn.lili.common.vo.ResultMessage;
|
||||||
import cn.lili.modules.sms.SmsUtil;
|
import cn.lili.modules.sms.SmsUtil;
|
||||||
import cn.lili.modules.verification.entity.enums.VerificationEnums;
|
import cn.lili.modules.verification.entity.enums.VerificationEnums;
|
||||||
import cn.lili.modules.verification.service.VerificationService;
|
import cn.lili.modules.verification.service.VerificationService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
import io.swagger.annotations.ApiImplicitParams;
|
import io.swagger.annotations.ApiImplicitParams;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 短信验证码接口
|
* 短信验证码接口
|
||||||
*
|
*
|
||||||
* @author Chopper
|
* @author Chopper
|
||||||
* @since 2020/11/26 15:41
|
* @since 2020/11/26 15:41
|
||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@Api(tags = "短信验证码接口")
|
@Api(tags = "短信验证码接口")
|
||||||
@RequestMapping("/common/common/sms")
|
@RequestMapping("/common/common/sms")
|
||||||
public class SmsController {
|
public class SmsController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private SmsUtil smsUtil;
|
private SmsUtil smsUtil;
|
||||||
@Autowired
|
@Autowired
|
||||||
private VerificationService verificationService;
|
private VerificationService verificationService;
|
||||||
|
|
||||||
@LimitPoint(name = "sms_send", key = "sms")
|
@LimitPoint(name = "sms_send", key = "sms")
|
||||||
@ApiImplicitParams({
|
@ApiImplicitParams({
|
||||||
@ApiImplicitParam(paramType = "path", dataType = "String", name = "mobile", value = "手机号"),
|
@ApiImplicitParam(paramType = "path", dataType = "String", name = "mobile", value = "手机号"),
|
||||||
@ApiImplicitParam(paramType = "header", dataType = "String", name = "uuid", value = "uuid"),
|
@ApiImplicitParam(paramType = "header", dataType = "String", name = "uuid", value = "uuid"),
|
||||||
})
|
})
|
||||||
@GetMapping("/{verificationEnums}/{mobile}")
|
@GetMapping("/{verificationEnums}/{mobile}")
|
||||||
@ApiOperation(value = "发送短信验证码,一分钟同一个ip请求1次")
|
@ApiOperation(value = "发送短信验证码,一分钟同一个ip请求1次")
|
||||||
public ResultMessage getSmsCode(
|
public ResultMessage getSmsCode(
|
||||||
@RequestHeader String uuid,
|
@RequestHeader String uuid,
|
||||||
@PathVariable String mobile,
|
@PathVariable String mobile,
|
||||||
@PathVariable VerificationEnums verificationEnums) {
|
@PathVariable VerificationEnums verificationEnums) {
|
||||||
verificationService.check(uuid, verificationEnums);
|
verificationService.check(uuid, verificationEnums);
|
||||||
smsUtil.sendSmsCode(mobile, verificationEnums, uuid);
|
smsUtil.sendSmsCode(mobile, verificationEnums, uuid);
|
||||||
return ResultUtil.success(ResultCode.VERIFICATION_SEND_SUCCESS);
|
return ResultUtil.success(ResultCode.VERIFICATION_SEND_SUCCESS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,8 @@ import cn.lili.common.utils.Base64DecodeMultipartFile;
|
|||||||
import cn.lili.common.utils.CommonUtil;
|
import cn.lili.common.utils.CommonUtil;
|
||||||
import cn.lili.common.vo.ResultMessage;
|
import cn.lili.common.vo.ResultMessage;
|
||||||
import cn.lili.modules.file.entity.File;
|
import cn.lili.modules.file.entity.File;
|
||||||
import cn.lili.modules.file.plugin.FileManagerPlugin;
|
import cn.lili.modules.file.plugin.FilePlugin;
|
||||||
|
import cn.lili.modules.file.plugin.FilePluginFactory;
|
||||||
import cn.lili.modules.file.service.FileService;
|
import cn.lili.modules.file.service.FileService;
|
||||||
import cn.lili.modules.system.entity.dos.Setting;
|
import cn.lili.modules.system.entity.dos.Setting;
|
||||||
import cn.lili.modules.system.entity.enums.SettingEnum;
|
import cn.lili.modules.system.entity.enums.SettingEnum;
|
||||||
@@ -47,7 +48,7 @@ public class UploadController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private SettingService settingService;
|
private SettingService settingService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private FileManagerPlugin fileManagerPlugin;
|
private FilePluginFactory filePluginFactory;
|
||||||
@Autowired
|
@Autowired
|
||||||
private Cache cache;
|
private Cache cache;
|
||||||
|
|
||||||
@@ -86,7 +87,7 @@ public class UploadController {
|
|||||||
try {
|
try {
|
||||||
InputStream inputStream = file.getInputStream();
|
InputStream inputStream = file.getInputStream();
|
||||||
//上传至第三方云服务或服务器
|
//上传至第三方云服务或服务器
|
||||||
result = fileManagerPlugin.inputStreamUpload(inputStream, fileKey);
|
result = filePluginFactory.filePlugin().inputStreamUpload(inputStream, fileKey);
|
||||||
//保存数据信息至数据库
|
//保存数据信息至数据库
|
||||||
newFile.setName(file.getOriginalFilename());
|
newFile.setName(file.getOriginalFilename());
|
||||||
newFile.setFileSize(file.getSize());
|
newFile.setFileSize(file.getSize());
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
package cn.lili.controller.security;
|
package cn.lili.controller.security;
|
||||||
|
|
||||||
import cn.lili.cache.Cache;
|
|
||||||
import cn.lili.common.security.CustomAccessDeniedHandler;
|
|
||||||
import cn.lili.common.properties.IgnoredUrlsProperties;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
@@ -25,19 +22,10 @@ import org.springframework.web.cors.CorsConfigurationSource;
|
|||||||
public class CommonSecurityConfig extends WebSecurityConfigurerAdapter {
|
public class CommonSecurityConfig extends WebSecurityConfigurerAdapter {
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 忽略验权配置
|
|
||||||
*/
|
|
||||||
@Autowired
|
|
||||||
private IgnoredUrlsProperties ignoredUrlsProperties;
|
|
||||||
/**
|
/**
|
||||||
* spring security -》 权限不足处理
|
* spring security -》 权限不足处理
|
||||||
*/
|
*/
|
||||||
@Autowired
|
@Autowired
|
||||||
private CustomAccessDeniedHandler accessDeniedHandler;
|
|
||||||
@Autowired
|
|
||||||
private Cache<String> cache;
|
|
||||||
@Autowired
|
|
||||||
private CorsConfigurationSource corsConfigurationSource;
|
private CorsConfigurationSource corsConfigurationSource;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -121,6 +121,8 @@ ignored:
|
|||||||
- /source/**
|
- /source/**
|
||||||
- /common/common/slider/**
|
- /common/common/slider/**
|
||||||
- /common/common/sms/**
|
- /common/common/sms/**
|
||||||
|
- /common/common/logo
|
||||||
|
- /common/common/site
|
||||||
- /druid/**
|
- /druid/**
|
||||||
- /swagger-ui.html
|
- /swagger-ui.html
|
||||||
- /doc.html
|
- /doc.html
|
||||||
|
|||||||
@@ -20,6 +20,22 @@
|
|||||||
</encoder>
|
</encoder>
|
||||||
</appender>
|
</appender>
|
||||||
|
|
||||||
|
<appender name="RocketmqClientAppender" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
|
<file>${LOG_FILE_PATH}/rocketmq.log</file>
|
||||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
|
<fileNamePattern>${LOG_FILE_PATH}/rocketmq/rocketmq-%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||||
|
<maxHistory>30</maxHistory>
|
||||||
|
<totalSizeCap>30MB</totalSizeCap>
|
||||||
|
</rollingPolicy>
|
||||||
|
<encoder>
|
||||||
|
<pattern>%d{yy-MM-dd.HH:mm:ss.SSS} [%-16t] %-5p %-22c{0} %X{ServiceId} - %m%n</pattern>
|
||||||
|
</encoder>
|
||||||
|
</appender>
|
||||||
|
<logger name="RocketmqClient" additivity="false">
|
||||||
|
<level value="info" />
|
||||||
|
<appender-ref ref="RocketmqClientAppender"/>
|
||||||
|
</logger>
|
||||||
|
|
||||||
<!--输出到elk的LOGSTASH-->
|
<!--输出到elk的LOGSTASH-->
|
||||||
<appender name="LOGSTASH" class="net.logstash.logback.appender.LogstashTcpSocketAppender">
|
<appender name="LOGSTASH" class="net.logstash.logback.appender.LogstashTcpSocketAppender">
|
||||||
<!-- 配置elk日志收集 配饰的是 LOGSTASH 的地址-->
|
<!-- 配置elk日志收集 配饰的是 LOGSTASH 的地址-->
|
||||||
|
|||||||
@@ -25,20 +25,11 @@ spring:
|
|||||||
admin:
|
admin:
|
||||||
client:
|
client:
|
||||||
url: http://192.168.0.116:8000
|
url: http://192.168.0.116:8000
|
||||||
# mongodb
|
|
||||||
data:
|
|
||||||
mongodb:
|
|
||||||
uri: 192.168.0.116:27017
|
|
||||||
database: lilishop
|
|
||||||
username: root
|
|
||||||
password: lilishop
|
|
||||||
authentication-database: admin
|
|
||||||
# replica-set-name: mongoreplset
|
|
||||||
cache:
|
cache:
|
||||||
type: redis
|
type: redis
|
||||||
# Redis
|
# Redis
|
||||||
redis:
|
redis:
|
||||||
host: 192.168.0.116
|
host: 127.0.0.1
|
||||||
port: 6379
|
port: 6379
|
||||||
password: lilishop
|
password: lilishop
|
||||||
lettuce:
|
lettuce:
|
||||||
@@ -69,7 +60,7 @@ spring:
|
|||||||
default-datasource:
|
default-datasource:
|
||||||
type: com.alibaba.druid.pool.DruidDataSource
|
type: com.alibaba.druid.pool.DruidDataSource
|
||||||
driverClassName: com.mysql.cj.jdbc.Driver
|
driverClassName: com.mysql.cj.jdbc.Driver
|
||||||
url: jdbc:mysql://192.168.0.116:3306/lilishop?useUnicode=true&characterEncoding=utf-8&useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
|
url: jdbc:mysql://127.0.0.1:3306/lilishop?useUnicode=true&characterEncoding=utf-8&useSSL=false&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
|
||||||
username: root
|
username: root
|
||||||
password: lilishop
|
password: lilishop
|
||||||
maxActive: 50
|
maxActive: 50
|
||||||
@@ -128,6 +119,7 @@ ignored:
|
|||||||
- /store/passport/login/refresh/**
|
- /store/passport/login/refresh/**
|
||||||
- /common/common/slider/**
|
- /common/common/slider/**
|
||||||
- /common/common/sms/**
|
- /common/common/sms/**
|
||||||
|
- /common/common/site
|
||||||
- /buyer/payment/cashier/**
|
- /buyer/payment/cashier/**
|
||||||
- /buyer/other/pageData/**
|
- /buyer/other/pageData/**
|
||||||
- /buyer/other/article/**
|
- /buyer/other/article/**
|
||||||
@@ -191,7 +183,6 @@ logging:
|
|||||||
cn.lili: info
|
cn.lili: info
|
||||||
# org.hibernate: debug
|
# org.hibernate: debug
|
||||||
# org.springframework: debug
|
# org.springframework: debug
|
||||||
# org.springframework.data.mongodb.core: debug
|
|
||||||
file:
|
file:
|
||||||
# 指定路径
|
# 指定路径
|
||||||
path: logs
|
path: logs
|
||||||
@@ -278,7 +269,7 @@ lili:
|
|||||||
data:
|
data:
|
||||||
elasticsearch:
|
elasticsearch:
|
||||||
cluster-name: elasticsearch
|
cluster-name: elasticsearch
|
||||||
cluster-nodes: 192.168.0.116:9200
|
cluster-nodes: 127.0.0.1:9200
|
||||||
index:
|
index:
|
||||||
number-of-replicas: 0
|
number-of-replicas: 0
|
||||||
number-of-shards: 3
|
number-of-shards: 3
|
||||||
@@ -289,7 +280,7 @@ lili:
|
|||||||
# password: LiLiShopES
|
# password: LiLiShopES
|
||||||
|
|
||||||
logstash:
|
logstash:
|
||||||
server: 192.168.0.116:4560
|
server: 127.0.0.1:4560
|
||||||
rocketmq:
|
rocketmq:
|
||||||
promotion-topic: lili_promotion_topic
|
promotion-topic: lili_promotion_topic
|
||||||
promotion-group: lili_promotion_group
|
promotion-group: lili_promotion_group
|
||||||
@@ -307,8 +298,10 @@ lili:
|
|||||||
notice-group: lili_notice_group
|
notice-group: lili_notice_group
|
||||||
notice-send-topic: lili_send_notice_topic
|
notice-send-topic: lili_send_notice_topic
|
||||||
notice-send-group: lili_send_notice_group
|
notice-send-group: lili_send_notice_group
|
||||||
|
after-sale-topic: lili_after_sale_topic
|
||||||
|
after-sale-group: lili_after_sale_group
|
||||||
rocketmq:
|
rocketmq:
|
||||||
name-server: 192.168.0.116:9876
|
name-server: 127.0.0.1:9876
|
||||||
isVIPChannel: false
|
isVIPChannel: false
|
||||||
producer:
|
producer:
|
||||||
group: lili_group
|
group: lili_group
|
||||||
@@ -317,7 +310,7 @@ rocketmq:
|
|||||||
xxl:
|
xxl:
|
||||||
job:
|
job:
|
||||||
admin:
|
admin:
|
||||||
addresses: http://192.168.0.116:9001/xxl-job-admin
|
addresses: http://127.0.0.1:9001/xxl-job-admin
|
||||||
executor:
|
executor:
|
||||||
appname: xxl-job-executor-lilishop
|
appname: xxl-job-executor-lilishop
|
||||||
address:
|
address:
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ public class ConsumerApplication {
|
|||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
System.setProperty("es.set.netty.runtime.available.processors", "false");
|
System.setProperty("es.set.netty.runtime.available.processors", "false");
|
||||||
|
System.setProperty("rocketmq.client.logUseSlf4j","true");
|
||||||
SpringApplication.run(ConsumerApplication.class, args);
|
SpringApplication.run(ConsumerApplication.class, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ import cn.lili.modules.order.cart.entity.vo.CartVO;
|
|||||||
import cn.lili.modules.order.order.entity.dos.Order;
|
import cn.lili.modules.order.order.entity.dos.Order;
|
||||||
import cn.lili.modules.order.order.entity.dos.OrderItem;
|
import cn.lili.modules.order.order.entity.dos.OrderItem;
|
||||||
import cn.lili.modules.order.order.entity.dto.OrderMessage;
|
import cn.lili.modules.order.order.entity.dto.OrderMessage;
|
||||||
|
import cn.lili.modules.order.order.entity.dto.OrderSearchParams;
|
||||||
import cn.lili.modules.order.order.entity.dto.PriceDetailDTO;
|
import cn.lili.modules.order.order.entity.dto.PriceDetailDTO;
|
||||||
import cn.lili.modules.order.order.entity.enums.*;
|
import cn.lili.modules.order.order.entity.enums.*;
|
||||||
import cn.lili.modules.order.order.service.OrderItemService;
|
import cn.lili.modules.order.order.service.OrderItemService;
|
||||||
@@ -96,6 +97,15 @@ public class FullDiscountExecute implements TradeEvent, OrderStatusChangeEvent {
|
|||||||
if (orderMessage.getNewStatus().equals(OrderStatusEnum.PAID)) {
|
if (orderMessage.getNewStatus().equals(OrderStatusEnum.PAID)) {
|
||||||
log.debug("满减活动,订单状态操作 {}", CachePrefix.ORDER.getPrefix() + orderMessage.getOrderSn());
|
log.debug("满减活动,订单状态操作 {}", CachePrefix.ORDER.getPrefix() + orderMessage.getOrderSn());
|
||||||
renderGift(JSONUtil.toBean(cache.getString(CachePrefix.ORDER.getPrefix() + orderMessage.getOrderSn()), CartVO.class), orderMessage);
|
renderGift(JSONUtil.toBean(cache.getString(CachePrefix.ORDER.getPrefix() + orderMessage.getOrderSn()), CartVO.class), orderMessage);
|
||||||
|
} else if (orderMessage.getNewStatus().equals(OrderStatusEnum.CANCELLED)) {
|
||||||
|
log.debug("满减活动,取消订单状态操作 {}", CachePrefix.ORDER.getPrefix() + orderMessage.getOrderSn());
|
||||||
|
OrderSearchParams searchParams = new OrderSearchParams();
|
||||||
|
searchParams.setParentOrderSn(orderMessage.getOrderSn());
|
||||||
|
searchParams.setOrderPromotionType(OrderPromotionTypeEnum.GIFT.name());
|
||||||
|
List<Order> orders = orderService.queryListByParams(searchParams);
|
||||||
|
if (orders != null && !orders.isEmpty()) {
|
||||||
|
orderService.systemCancel(orders.get(0).getSn(),"主订单取消,赠送订单字段自动取消");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -190,6 +200,7 @@ public class FullDiscountExecute implements TradeEvent, OrderStatusChangeEvent {
|
|||||||
BeanUtil.copyProperties(priceDetailDTO, order, "id");
|
BeanUtil.copyProperties(priceDetailDTO, order, "id");
|
||||||
//生成订单参数
|
//生成订单参数
|
||||||
order.setSn(SnowFlake.createStr("G"));
|
order.setSn(SnowFlake.createStr("G"));
|
||||||
|
order.setParentOrderSn(originOrder.getSn());
|
||||||
order.setOrderPromotionType(OrderPromotionTypeEnum.GIFT.name());
|
order.setOrderPromotionType(OrderPromotionTypeEnum.GIFT.name());
|
||||||
order.setOrderStatus(OrderStatusEnum.UNPAID.name());
|
order.setOrderStatus(OrderStatusEnum.UNPAID.name());
|
||||||
order.setPayStatus(PayStatusEnum.PAID.name());
|
order.setPayStatus(PayStatusEnum.PAID.name());
|
||||||
|
|||||||
@@ -0,0 +1,65 @@
|
|||||||
|
package cn.lili.event.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.ListUtil;
|
||||||
|
import cn.hutool.core.text.CharSequenceUtil;
|
||||||
|
import cn.lili.event.AfterSaleStatusChangeEvent;
|
||||||
|
import cn.lili.event.OrderStatusChangeEvent;
|
||||||
|
import cn.lili.modules.order.aftersale.entity.dos.AfterSale;
|
||||||
|
import cn.lili.modules.order.order.entity.dos.Order;
|
||||||
|
import cn.lili.modules.order.order.entity.dto.OrderMessage;
|
||||||
|
import cn.lili.modules.order.order.entity.enums.OrderStatusEnum;
|
||||||
|
import cn.lili.modules.order.order.service.OrderService;
|
||||||
|
import cn.lili.modules.order.trade.entity.enums.AfterSaleStatusEnum;
|
||||||
|
import cn.lili.modules.promotion.service.MemberCouponService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 会员优惠券执行类
|
||||||
|
*
|
||||||
|
* @author paulG
|
||||||
|
* @since 2022/8/12
|
||||||
|
**/
|
||||||
|
@Service
|
||||||
|
public class MemberCouponExecute implements OrderStatusChangeEvent, AfterSaleStatusChangeEvent {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单
|
||||||
|
*/
|
||||||
|
@Autowired
|
||||||
|
private OrderService orderService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private MemberCouponService memberCouponService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void orderChange(OrderMessage orderMessage) {
|
||||||
|
// 订单取消返还优惠券
|
||||||
|
if (orderMessage.getNewStatus() == OrderStatusEnum.CANCELLED) {
|
||||||
|
this.refundCoupon(orderMessage.getOrderSn());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void afterSaleStatusChange(AfterSale afterSale) {
|
||||||
|
// 售后完成返还优惠券
|
||||||
|
if (afterSale.getServiceStatus().equals(AfterSaleStatusEnum.COMPLETE.name())) {
|
||||||
|
this.refundCoupon(afterSale.getOrderSn());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退款返还优惠券
|
||||||
|
* @param orderSn 订单编号
|
||||||
|
*/
|
||||||
|
private void refundCoupon(String orderSn) {
|
||||||
|
Order order = orderService.getBySn(orderSn);
|
||||||
|
if (CharSequenceUtil.isNotEmpty(order.getUseStoreMemberCouponIds())) {
|
||||||
|
memberCouponService.recoveryMemberCoupon(ListUtil.toList(order.getUseStoreMemberCouponIds().split(",")));
|
||||||
|
}
|
||||||
|
if (CharSequenceUtil.isNotEmpty(order.getUsePlatformMemberCouponId())) {
|
||||||
|
memberCouponService.recoveryMemberCoupon(ListUtil.toList(order.getUsePlatformMemberCouponId().split(",")));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
package cn.lili.event.impl;
|
package cn.lili.event.impl;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.hutool.core.text.CharSequenceUtil;
|
||||||
import cn.lili.common.utils.CurrencyUtil;
|
import cn.lili.common.utils.CurrencyUtil;
|
||||||
import cn.lili.common.utils.StringUtils;
|
|
||||||
import cn.lili.event.AfterSaleStatusChangeEvent;
|
import cn.lili.event.AfterSaleStatusChangeEvent;
|
||||||
import cn.lili.event.GoodsCommentCompleteEvent;
|
import cn.lili.event.GoodsCommentCompleteEvent;
|
||||||
import cn.lili.event.MemberRegisterEvent;
|
import cn.lili.event.MemberRegisterEvent;
|
||||||
@@ -104,7 +104,7 @@ public class MemberPointExecute implements MemberRegisterEvent, GoodsCommentComp
|
|||||||
case COMPLETED: {
|
case COMPLETED: {
|
||||||
Order order = orderService.getBySn(orderMessage.getOrderSn());
|
Order order = orderService.getBySn(orderMessage.getOrderSn());
|
||||||
//如果是积分订单 则直接返回
|
//如果是积分订单 则直接返回
|
||||||
if (StringUtils.isNotEmpty(order.getOrderPromotionType())
|
if (CharSequenceUtil.isNotEmpty(order.getOrderPromotionType())
|
||||||
&& order.getOrderPromotionType().equals(OrderPromotionTypeEnum.POINTS.name())) {
|
&& order.getOrderPromotionType().equals(OrderPromotionTypeEnum.POINTS.name())) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import cn.lili.common.utils.SpringContextUtil;
|
|||||||
import cn.lili.event.OrderStatusChangeEvent;
|
import cn.lili.event.OrderStatusChangeEvent;
|
||||||
import cn.lili.modules.order.order.entity.dos.Order;
|
import cn.lili.modules.order.order.entity.dos.Order;
|
||||||
import cn.lili.modules.order.order.entity.dto.OrderMessage;
|
import cn.lili.modules.order.order.entity.dto.OrderMessage;
|
||||||
|
import cn.lili.modules.order.order.entity.enums.OrderStatusEnum;
|
||||||
import cn.lili.modules.order.order.entity.enums.PayStatusEnum;
|
import cn.lili.modules.order.order.entity.enums.PayStatusEnum;
|
||||||
import cn.lili.modules.order.order.service.OrderService;
|
import cn.lili.modules.order.order.service.OrderService;
|
||||||
import cn.lili.modules.payment.entity.RefundLog;
|
import cn.lili.modules.payment.entity.RefundLog;
|
||||||
@@ -33,52 +34,32 @@ public class PaymentExecute implements OrderStatusChangeEvent {
|
|||||||
@Override
|
@Override
|
||||||
public void orderChange(OrderMessage orderMessage) {
|
public void orderChange(OrderMessage orderMessage) {
|
||||||
|
|
||||||
switch (orderMessage.getNewStatus()) {
|
if (orderMessage.getNewStatus() == OrderStatusEnum.CANCELLED) {
|
||||||
case CANCELLED:
|
Order order = orderService.getBySn(orderMessage.getOrderSn());
|
||||||
Order order = orderService.getBySn(orderMessage.getOrderSn());
|
|
||||||
|
|
||||||
//如果未付款,则不去要退回相关代码执行
|
//如果未付款,则不去要退回相关代码执行
|
||||||
if (order.getPayStatus().equals(PayStatusEnum.UNPAID.name())) {
|
if (order.getPayStatus().equals(PayStatusEnum.UNPAID.name())) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
PaymentMethodEnum paymentMethodEnum = PaymentMethodEnum.valueOf(order.getPaymentMethod());
|
PaymentMethodEnum paymentMethodEnum = PaymentMethodEnum.valueOf(order.getPaymentMethod());
|
||||||
//进行退款操作
|
|
||||||
switch (paymentMethodEnum) {
|
|
||||||
case WALLET:
|
|
||||||
case ALIPAY:
|
|
||||||
case WECHAT:
|
|
||||||
//获取支付方式
|
|
||||||
Payment payment =
|
|
||||||
(Payment) SpringContextUtil.getBean(paymentMethodEnum.getPlugin());
|
|
||||||
|
|
||||||
RefundLog refundLog = RefundLog.builder()
|
//获取支付方式
|
||||||
.isRefund(false)
|
Payment payment =
|
||||||
.totalAmount(order.getFlowPrice())
|
(Payment) SpringContextUtil.getBean(paymentMethodEnum.getPlugin());
|
||||||
.payPrice(order.getFlowPrice())
|
|
||||||
.memberId(order.getMemberId())
|
RefundLog refundLog = RefundLog.builder()
|
||||||
.paymentName(order.getPaymentMethod())
|
.isRefund(false)
|
||||||
.afterSaleNo("订单取消")
|
.totalAmount(order.getFlowPrice())
|
||||||
.orderSn(order.getSn())
|
.payPrice(order.getFlowPrice())
|
||||||
.paymentReceivableNo(order.getReceivableNo())
|
.memberId(order.getMemberId())
|
||||||
.outOrderNo("AF" + SnowFlake.getIdStr())
|
.paymentName(order.getPaymentMethod())
|
||||||
.outOrderNo("AF" + SnowFlake.getIdStr())
|
.afterSaleNo("订单取消")
|
||||||
.refundReason("订单取消")
|
.orderSn(order.getSn())
|
||||||
.build();
|
.paymentReceivableNo(order.getReceivableNo())
|
||||||
payment.cancel(refundLog);
|
.outOrderNo("AF" + SnowFlake.getIdStr())
|
||||||
break;
|
.refundReason("订单取消")
|
||||||
case BANK_TRANSFER:
|
.build();
|
||||||
break;
|
payment.refund(refundLog);
|
||||||
default:
|
|
||||||
log.error("订单支付执行异常,订单编号:{}", orderMessage.getOrderSn());
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 库存扣减,他表示了订单状态是否出库成功
|
* 库存扣减,他表示了订单状态是否出库成功
|
||||||
@@ -156,7 +157,7 @@ public class StockUpdateExecute implements OrderStatusChangeEvent {
|
|||||||
* @param stocks
|
* @param stocks
|
||||||
*/
|
*/
|
||||||
private void checkStocks(List<Integer> stocks, OrderDetailVO order) {
|
private void checkStocks(List<Integer> stocks, OrderDetailVO order) {
|
||||||
if (order.getOrderItems().size() == stocks.size()) {
|
if (!stocks.isEmpty() && order.getOrderItems().size() == stocks.size() && stocks.stream().anyMatch(Objects::nonNull)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
initSkuCache(order.getOrderItems());
|
initSkuCache(order.getOrderItems());
|
||||||
@@ -332,7 +333,7 @@ public class StockUpdateExecute implements OrderStatusChangeEvent {
|
|||||||
Integer num = promotionGoods.get(i).getNum();
|
Integer num = promotionGoods.get(i).getNum();
|
||||||
promotionGoods.get(i).setNum((num != null ? num : 0) + order.getOrder().getGoodsNum());
|
promotionGoods.get(i).setNum((num != null ? num : 0) + order.getOrder().getGoodsNum());
|
||||||
}
|
}
|
||||||
promotionGoodsService.updateBatchById(promotionGoods);
|
promotionGoodsService.updatePromotionGoodsStock(promotionGoods);
|
||||||
}
|
}
|
||||||
//商品库存,包含sku库存集合,批量更新商品库存相关
|
//商品库存,包含sku库存集合,批量更新商品库存相关
|
||||||
goodsSkuService.updateGoodsStuck(goodsSkus);
|
goodsSkuService.updateGoodsStuck(goodsSkus);
|
||||||
@@ -357,6 +358,7 @@ public class StockUpdateExecute implements OrderStatusChangeEvent {
|
|||||||
skuKeys.add(GoodsSkuService.getStockCacheKey(orderItem.getSkuId()));
|
skuKeys.add(GoodsSkuService.getStockCacheKey(orderItem.getSkuId()));
|
||||||
GoodsSku goodsSku = new GoodsSku();
|
GoodsSku goodsSku = new GoodsSku();
|
||||||
goodsSku.setId(orderItem.getSkuId());
|
goodsSku.setId(orderItem.getSkuId());
|
||||||
|
goodsSku.setGoodsId(orderItem.getGoodsId());
|
||||||
goodsSkus.add(goodsSku);
|
goodsSkus.add(goodsSku);
|
||||||
}
|
}
|
||||||
//批量获取商品库存
|
//批量获取商品库存
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ import cn.hutool.core.util.ArrayUtil;
|
|||||||
import cn.hutool.core.util.ClassLoaderUtil;
|
import cn.hutool.core.util.ClassLoaderUtil;
|
||||||
import cn.hutool.json.JSONObject;
|
import cn.hutool.json.JSONObject;
|
||||||
import cn.hutool.json.JSONUtil;
|
import cn.hutool.json.JSONUtil;
|
||||||
|
import cn.lili.common.aop.annotation.RetryOperation;
|
||||||
|
import cn.lili.common.exception.RetryException;
|
||||||
import cn.lili.event.GoodsCommentCompleteEvent;
|
import cn.lili.event.GoodsCommentCompleteEvent;
|
||||||
import cn.lili.modules.distribution.entity.dos.DistributionGoods;
|
import cn.lili.modules.distribution.entity.dos.DistributionGoods;
|
||||||
import cn.lili.modules.distribution.entity.dto.DistributionGoodsSearchParams;
|
import cn.lili.modules.distribution.entity.dto.DistributionGoodsSearchParams;
|
||||||
@@ -30,7 +32,6 @@ import cn.lili.modules.promotion.service.PromotionGoodsService;
|
|||||||
import cn.lili.modules.promotion.service.PromotionService;
|
import cn.lili.modules.promotion.service.PromotionService;
|
||||||
import cn.lili.modules.search.entity.dos.EsGoodsIndex;
|
import cn.lili.modules.search.entity.dos.EsGoodsIndex;
|
||||||
import cn.lili.modules.search.service.EsGoodsIndexService;
|
import cn.lili.modules.search.service.EsGoodsIndexService;
|
||||||
import cn.lili.modules.store.service.StoreService;
|
|
||||||
import cn.lili.rocketmq.tags.GoodsTagsEnum;
|
import cn.lili.rocketmq.tags.GoodsTagsEnum;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.rocketmq.common.message.MessageExt;
|
import org.apache.rocketmq.common.message.MessageExt;
|
||||||
@@ -58,11 +59,6 @@ public class GoodsMessageListener implements RocketMQListener<MessageExt> {
|
|||||||
*/
|
*/
|
||||||
@Autowired
|
@Autowired
|
||||||
private EsGoodsIndexService goodsIndexService;
|
private EsGoodsIndexService goodsIndexService;
|
||||||
/**
|
|
||||||
* 店铺
|
|
||||||
*/
|
|
||||||
@Autowired
|
|
||||||
private StoreService storeService;
|
|
||||||
/**
|
/**
|
||||||
* 商品
|
* 商品
|
||||||
*/
|
*/
|
||||||
@@ -121,6 +117,7 @@ public class GoodsMessageListener implements RocketMQListener<MessageExt> {
|
|||||||
private PromotionGoodsService promotionGoodsService;
|
private PromotionGoodsService promotionGoodsService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@RetryOperation
|
||||||
public void onMessage(MessageExt messageExt) {
|
public void onMessage(MessageExt messageExt) {
|
||||||
|
|
||||||
switch (GoodsTagsEnum.valueOf(messageExt.getTags())) {
|
switch (GoodsTagsEnum.valueOf(messageExt.getTags())) {
|
||||||
@@ -135,20 +132,32 @@ public class GoodsMessageListener implements RocketMQListener<MessageExt> {
|
|||||||
String goodsId = new String(messageExt.getBody());
|
String goodsId = new String(messageExt.getBody());
|
||||||
log.info("生成索引: {}", goodsId);
|
log.info("生成索引: {}", goodsId);
|
||||||
Goods goods = this.goodsService.getById(goodsId);
|
Goods goods = this.goodsService.getById(goodsId);
|
||||||
updateGoodsIndex(goods);
|
this.updateGoodsIndex(goods);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("生成商品索引事件执行异常,商品信息 {}", new String(messageExt.getBody()));
|
log.error("生成商品索引事件执行异常,商品信息: " + new String(messageExt.getBody()), e);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case GENERATOR_STORE_GOODS_INDEX:
|
||||||
|
try {
|
||||||
|
String storeId = new String(messageExt.getBody());
|
||||||
|
this.updateGoodsIndex(storeId);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("生成店铺商品索引事件执行异常,商品信息: " + new String(messageExt.getBody()), e);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case UPDATE_GOODS_INDEX_PROMOTIONS:
|
case UPDATE_GOODS_INDEX_PROMOTIONS:
|
||||||
this.updateGoodsIndexPromotions(new String(messageExt.getBody()));
|
this.updateGoodsIndexPromotions(new String(messageExt.getBody()));
|
||||||
break;
|
break;
|
||||||
case DELETE_GOODS_INDEX_PROMOTIONS:
|
case DELETE_GOODS_INDEX_PROMOTIONS:
|
||||||
BasePromotions promotions = JSONUtil.toBean(new String(messageExt.getBody()), BasePromotions.class);
|
JSONObject jsonObject = JSONUtil.parseObj(new String(messageExt.getBody()));
|
||||||
if (CharSequenceUtil.isNotEmpty(promotions.getScopeId())) {
|
String promotionKey = jsonObject.getStr("promotionKey");
|
||||||
this.goodsIndexService.deleteEsGoodsPromotionByPromotionId(Arrays.asList(promotions.getScopeId().split(",")), promotions.getId());
|
if (CharSequenceUtil.isEmpty(promotionKey)) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (CharSequenceUtil.isNotEmpty(jsonObject.getStr("scopeId"))) {
|
||||||
|
this.goodsIndexService.deleteEsGoodsPromotionByPromotionKey(Arrays.asList(jsonObject.getStr("scopeId").split(",")), promotionKey);
|
||||||
} else {
|
} else {
|
||||||
this.goodsIndexService.deleteEsGoodsPromotionByPromotionId(null, promotions.getId());
|
this.goodsIndexService.deleteEsGoodsPromotionByPromotionKey(promotionKey);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case UPDATE_GOODS_INDEX:
|
case UPDATE_GOODS_INDEX:
|
||||||
@@ -159,7 +168,7 @@ public class GoodsMessageListener implements RocketMQListener<MessageExt> {
|
|||||||
List<Goods> goodsList = goodsService.queryListByParams(searchParams);
|
List<Goods> goodsList = goodsService.queryListByParams(searchParams);
|
||||||
this.updateGoodsIndex(goodsList);
|
this.updateGoodsIndex(goodsList);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("更新商品索引事件执行异常,商品信息 {}", new String(messageExt.getBody()));
|
log.error("更新商品索引事件执行异常,商品信息: " + new String(messageExt.getBody()), e);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case UPDATE_GOODS_INDEX_FIELD:
|
case UPDATE_GOODS_INDEX_FIELD:
|
||||||
@@ -172,7 +181,7 @@ public class GoodsMessageListener implements RocketMQListener<MessageExt> {
|
|||||||
Map<String, Object> updateFields = updateIndexFields.get("updateFields", Map.class);
|
Map<String, Object> updateFields = updateIndexFields.get("updateFields", Map.class);
|
||||||
goodsIndexService.updateIndex(queryFields, updateFields);
|
goodsIndexService.updateIndex(queryFields, updateFields);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("更新商品索引事件执行异常,商品信息 {}", new String(messageExt.getBody()));
|
log.error("更新商品索引事件执行异常,商品信息: " + new String(messageExt.getBody()), e);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case RESET_GOODS_INDEX:
|
case RESET_GOODS_INDEX:
|
||||||
@@ -181,13 +190,12 @@ public class GoodsMessageListener implements RocketMQListener<MessageExt> {
|
|||||||
List<EsGoodsIndex> goodsIndices = JSONUtil.toList(goodsIdsJsonStr, EsGoodsIndex.class);
|
List<EsGoodsIndex> goodsIndices = JSONUtil.toList(goodsIdsJsonStr, EsGoodsIndex.class);
|
||||||
goodsIndexService.updateBulkIndex(goodsIndices);
|
goodsIndexService.updateBulkIndex(goodsIndices);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("重置商品索引事件执行异常,商品信息 {}", new String(messageExt.getBody()));
|
log.error("重置商品索引事件执行异常,商品信息: " + new String(messageExt.getBody()), e);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
//审核商品
|
//审核商品
|
||||||
case GOODS_AUDIT:
|
case GOODS_AUDIT:
|
||||||
Goods goods = JSONUtil.toBean(new String(messageExt.getBody()), Goods.class);
|
Goods goods = JSONUtil.toBean(new String(messageExt.getBody()), Goods.class);
|
||||||
updateGoodsNum(goods);
|
|
||||||
updateGoodsIndex(goods);
|
updateGoodsIndex(goods);
|
||||||
break;
|
break;
|
||||||
//删除商品
|
//删除商品
|
||||||
@@ -195,27 +203,34 @@ public class GoodsMessageListener implements RocketMQListener<MessageExt> {
|
|||||||
try {
|
try {
|
||||||
String goodsIdsJsonStr = new String(messageExt.getBody());
|
String goodsIdsJsonStr = new String(messageExt.getBody());
|
||||||
for (String goodsId : JSONUtil.toList(goodsIdsJsonStr, String.class)) {
|
for (String goodsId : JSONUtil.toList(goodsIdsJsonStr, String.class)) {
|
||||||
Goods goodsById = this.goodsService.getById(goodsId);
|
goodsIndexService.deleteIndex(MapUtil.builder(new HashMap<String, Object>()).put("goodsId", goodsId).build());
|
||||||
if (goodsById != null) {
|
|
||||||
this.deleteGoods(goodsById);
|
|
||||||
this.updateGoodsNum(goodsById);
|
|
||||||
List<String> skuIdsByGoodsId = this.goodsSkuService.getSkuIdsByGoodsId(goodsId);
|
|
||||||
if (skuIdsByGoodsId != null && !skuIdsByGoodsId.isEmpty()) {
|
|
||||||
this.goodsIndexService.deleteIndexByIds(skuIdsByGoodsId);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
promotionService.removeByGoodsIds(goodsIdsJsonStr);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("删除商品索引事件执行异常,商品信息 {}", new String(messageExt.getBody()));
|
log.error("删除商品索引事件执行异常,商品信息: " + new String(messageExt.getBody()), e);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case DOWN:
|
||||||
|
String goodsIdsJsonStr = new String(messageExt.getBody());
|
||||||
|
promotionService.removeByGoodsIds(goodsIdsJsonStr);
|
||||||
|
break;
|
||||||
//规格删除
|
//规格删除
|
||||||
case SKU_DELETE:
|
case SKU_DELETE:
|
||||||
String message = new String(messageExt.getBody());
|
String message = new String(messageExt.getBody());
|
||||||
List<String> skuIds = JSONUtil.toList(message, String.class);
|
List<String> skuIds = JSONUtil.toList(message, String.class);
|
||||||
goodsCollectionService.deleteSkuCollection(skuIds);
|
goodsCollectionService.deleteSkuCollection(skuIds);
|
||||||
break;
|
break;
|
||||||
|
case STORE_GOODS_DELETE:
|
||||||
|
try {
|
||||||
|
String storeId = new String(messageExt.getBody());
|
||||||
|
goodsIndexService.deleteIndex(MapUtil.builder(new HashMap<String, Object>()).put("storeId", storeId).build());
|
||||||
|
} catch (RetryException re) {
|
||||||
|
throw re;
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("删除店铺商品索引事件执行异常,商品信息: " + new String(messageExt.getBody()), e);
|
||||||
|
}
|
||||||
|
break;
|
||||||
//商品评价
|
//商品评价
|
||||||
case GOODS_COMMENT_COMPLETE:
|
case GOODS_COMMENT_COMPLETE:
|
||||||
MemberEvaluation memberEvaluation = JSONUtil.toBean(new String(messageExt.getBody()), MemberEvaluation.class);
|
MemberEvaluation memberEvaluation = JSONUtil.toBean(new String(messageExt.getBody()), MemberEvaluation.class);
|
||||||
@@ -244,22 +259,26 @@ public class GoodsMessageListener implements RocketMQListener<MessageExt> {
|
|||||||
try {
|
try {
|
||||||
log.info("更新商品索引促销信息: {}", promotionsJsonStr);
|
log.info("更新商品索引促销信息: {}", promotionsJsonStr);
|
||||||
JSONObject jsonObject = JSONUtil.parseObj(promotionsJsonStr);
|
JSONObject jsonObject = JSONUtil.parseObj(promotionsJsonStr);
|
||||||
|
// 转换为详细的促销信息(注:促销信息必须继承自 BasePromotions,且必须保证派生类存在与sdk包下)
|
||||||
BasePromotions promotions = (BasePromotions) jsonObject.get("promotions",
|
BasePromotions promotions = (BasePromotions) jsonObject.get("promotions",
|
||||||
ClassLoaderUtil.loadClass(jsonObject.get("promotionsType").toString()));
|
ClassLoaderUtil.loadClass(jsonObject.get("promotionsType").toString()));
|
||||||
|
// 获取促销唯一key,由 促销类型 + 促销id 组成
|
||||||
String esPromotionKey = jsonObject.get("esPromotionKey").toString();
|
String esPromotionKey = jsonObject.get("esPromotionKey").toString();
|
||||||
if (PromotionsScopeTypeEnum.PORTION_GOODS.name().equals(promotions.getScopeType())) {
|
if (PromotionsScopeTypeEnum.PORTION_GOODS.name().equals(promotions.getScopeType())) {
|
||||||
PromotionGoodsSearchParams searchParams = new PromotionGoodsSearchParams();
|
PromotionGoodsSearchParams searchParams = new PromotionGoodsSearchParams();
|
||||||
searchParams.setPromotionId(promotions.getId());
|
searchParams.setPromotionId(promotions.getId());
|
||||||
List<PromotionGoods> promotionGoodsList = this.promotionGoodsService.listFindAll(searchParams);
|
List<PromotionGoods> promotionGoodsList = this.promotionGoodsService.listFindAll(searchParams);
|
||||||
List<String> skuIds = promotionGoodsList.stream().map(PromotionGoods::getSkuId).collect(Collectors.toList());
|
List<String> skuIds = promotionGoodsList.stream().map(PromotionGoods::getSkuId).collect(Collectors.toList());
|
||||||
this.goodsIndexService.deleteEsGoodsPromotionByPromotionId(skuIds, promotions.getId());
|
// 更新商品索引促销信息(删除原索引中相关的促销信息,更新索引中促销信息)
|
||||||
|
this.goodsIndexService.deleteEsGoodsPromotionByPromotionKey(skuIds, esPromotionKey);
|
||||||
this.goodsIndexService.updateEsGoodsIndexByList(promotionGoodsList, promotions, esPromotionKey);
|
this.goodsIndexService.updateEsGoodsIndexByList(promotionGoodsList, promotions, esPromotionKey);
|
||||||
} else if (PromotionsScopeTypeEnum.PORTION_GOODS_CATEGORY.name().equals(promotions.getScopeType())) {
|
} else if (PromotionsScopeTypeEnum.PORTION_GOODS_CATEGORY.name().equals(promotions.getScopeType())) {
|
||||||
GoodsSearchParams searchParams = new GoodsSearchParams();
|
GoodsSearchParams searchParams = new GoodsSearchParams();
|
||||||
searchParams.setCategoryPath(promotions.getScopeId());
|
searchParams.setCategoryPath(promotions.getScopeId());
|
||||||
List<GoodsSku> goodsSkuByList = this.goodsSkuService.getGoodsSkuByList(searchParams);
|
List<GoodsSku> goodsSkuByList = this.goodsSkuService.getGoodsSkuByList(searchParams);
|
||||||
List<String> skuIds = goodsSkuByList.stream().map(GoodsSku::getId).collect(Collectors.toList());
|
List<String> skuIds = goodsSkuByList.stream().map(GoodsSku::getId).collect(Collectors.toList());
|
||||||
this.goodsIndexService.deleteEsGoodsPromotionByPromotionId(skuIds, promotions.getId());
|
// 更新商品索引促销信息(删除原索引中相关的促销信息,更新索引中促销信息)
|
||||||
|
this.goodsIndexService.deleteEsGoodsPromotionByPromotionKey(skuIds, esPromotionKey);
|
||||||
this.goodsIndexService.updateEsGoodsIndexPromotions(skuIds, promotions, esPromotionKey);
|
this.goodsIndexService.updateEsGoodsIndexPromotions(skuIds, promotions, esPromotionKey);
|
||||||
} else if (PromotionsScopeTypeEnum.ALL.name().equals(promotions.getScopeType())) {
|
} else if (PromotionsScopeTypeEnum.ALL.name().equals(promotions.getScopeType())) {
|
||||||
this.goodsIndexService.updateEsGoodsIndexAllByList(promotions, esPromotionKey);
|
this.goodsIndexService.updateEsGoodsIndexAllByList(promotions, esPromotionKey);
|
||||||
@@ -275,32 +294,25 @@ public class GoodsMessageListener implements RocketMQListener<MessageExt> {
|
|||||||
* @param goodsList 商品列表消息
|
* @param goodsList 商品列表消息
|
||||||
*/
|
*/
|
||||||
private void updateGoodsIndex(List<Goods> goodsList) {
|
private void updateGoodsIndex(List<Goods> goodsList) {
|
||||||
List<EsGoodsIndex> goodsIndices = new ArrayList<>();
|
|
||||||
for (Goods goods : goodsList) {
|
for (Goods goods : goodsList) {
|
||||||
//如果商品通过审核&&并且已上架
|
this.updateGoodsIndex(goods);
|
||||||
GoodsSearchParams searchParams = new GoodsSearchParams();
|
|
||||||
searchParams.setGoodsId(goods.getId());
|
|
||||||
searchParams.setGeQuantity(0);
|
|
||||||
List<GoodsSku> goodsSkuList = this.goodsSkuService.getGoodsSkuByList(searchParams);
|
|
||||||
if (goods.getAuthFlag().equals(GoodsAuthEnum.PASS.name())
|
|
||||||
&& goods.getMarketEnable().equals(GoodsStatusEnum.UPPER.name())
|
|
||||||
&& Boolean.FALSE.equals(goods.getDeleteFlag())) {
|
|
||||||
goodsSkuList.forEach(goodsSku -> {
|
|
||||||
EsGoodsIndex goodsIndex = this.settingUpGoodsIndexData(goods, goodsSku);
|
|
||||||
goodsIndices.add(goodsIndex);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
//如果商品状态值不支持es搜索,那么将商品信息做下架处理
|
|
||||||
else {
|
|
||||||
for (GoodsSku goodsSku : goodsSkuList) {
|
|
||||||
EsGoodsIndex esGoodsOld = goodsIndexService.findById(goodsSku.getId());
|
|
||||||
if (esGoodsOld != null) {
|
|
||||||
goodsIndexService.deleteIndexById(goodsSku.getId());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
goodsIndexService.updateBulkIndex(goodsIndices);
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新商品索引根据店铺id
|
||||||
|
*
|
||||||
|
* @param storeId 店铺id
|
||||||
|
*/
|
||||||
|
private void updateGoodsIndex(String storeId) {
|
||||||
|
//如果商品通过审核&&并且已上架
|
||||||
|
GoodsSearchParams searchParams = new GoodsSearchParams();
|
||||||
|
searchParams.setStoreId(storeId);
|
||||||
|
for (Goods goods : this.goodsService.queryListByParams(searchParams)) {
|
||||||
|
this.updateGoodsIndex(goods);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -339,20 +351,19 @@ public class GoodsMessageListener implements RocketMQListener<MessageExt> {
|
|||||||
*/
|
*/
|
||||||
private void generatorGoodsIndex(Goods goods, List<GoodsSku> goodsSkuList) {
|
private void generatorGoodsIndex(Goods goods, List<GoodsSku> goodsSkuList) {
|
||||||
int skuSource = 100;
|
int skuSource = 100;
|
||||||
|
List<EsGoodsIndex> esGoodsIndices = new ArrayList<>();
|
||||||
for (GoodsSku goodsSku : goodsSkuList) {
|
for (GoodsSku goodsSku : goodsSkuList) {
|
||||||
EsGoodsIndex esGoodsOld = goodsIndexService.findById(goodsSku.getId());
|
|
||||||
EsGoodsIndex goodsIndex = this.settingUpGoodsIndexData(goods, goodsSku);
|
EsGoodsIndex goodsIndex = this.settingUpGoodsIndexData(goods, goodsSku);
|
||||||
goodsIndex.setSkuSource(skuSource--);
|
goodsIndex.setSkuSource(skuSource--);
|
||||||
log.info("goodsSku:{}", goodsSku);
|
log.info("goodsSku:{}", goodsSku);
|
||||||
log.info("esGoodsOld:{}", esGoodsOld);
|
|
||||||
//如果商品库存不为0,并且es中有数据
|
//如果商品库存不为0,并且es中有数据
|
||||||
if (goodsSku.getQuantity() > 0 && esGoodsOld == null) {
|
if (goodsSku.getQuantity() > 0) {
|
||||||
log.info("生成商品索引 {}", goodsIndex);
|
log.info("生成商品索引 {}", goodsIndex);
|
||||||
this.goodsIndexService.addIndex(goodsIndex);
|
esGoodsIndices.add(goodsIndex);
|
||||||
} else if (goodsSku.getQuantity() > 0 && esGoodsOld != null) {
|
|
||||||
goodsIndexService.updateIndex(goodsIndex);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
this.goodsIndexService.deleteIndex(MapUtil.builder(new HashMap<String, Object>()).put("goodsId", goods.getId()).build());
|
||||||
|
this.goodsIndexService.addIndex(esGoodsIndices);
|
||||||
}
|
}
|
||||||
|
|
||||||
private EsGoodsIndex settingUpGoodsIndexData(Goods goods, GoodsSku goodsSku) {
|
private EsGoodsIndex settingUpGoodsIndexData(Goods goods, GoodsSku goodsSku) {
|
||||||
@@ -389,7 +400,7 @@ public class GoodsMessageListener implements RocketMQListener<MessageExt> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (goodsIndex.getPromotionMap() == null || goodsIndex.getPromotionMap().isEmpty()) {
|
if (goodsIndex.getOriginPromotionMap() == null || goodsIndex.getOriginPromotionMap().isEmpty()) {
|
||||||
Map<String, Object> goodsCurrentPromotionMap = promotionService.getGoodsSkuPromotionMap(goodsIndex.getStoreId(), goodsIndex.getId());
|
Map<String, Object> goodsCurrentPromotionMap = promotionService.getGoodsSkuPromotionMap(goodsIndex.getStoreId(), goodsIndex.getId());
|
||||||
goodsIndex.setPromotionMapJson(JSONUtil.toJsonStr(goodsCurrentPromotionMap));
|
goodsIndex.setPromotionMapJson(JSONUtil.toJsonStr(goodsCurrentPromotionMap));
|
||||||
}
|
}
|
||||||
@@ -421,21 +432,6 @@ public class GoodsMessageListener implements RocketMQListener<MessageExt> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改商品数量
|
|
||||||
*
|
|
||||||
* @param goods 信息体
|
|
||||||
*/
|
|
||||||
private void updateGoodsNum(Goods goods) {
|
|
||||||
try {
|
|
||||||
//更新店铺商品数量
|
|
||||||
assert goods != null;
|
|
||||||
storeService.updateStoreGoodsNum(goods.getStoreId());
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("修改商品数量错误");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 商品购买完成
|
* 商品购买完成
|
||||||
* 1.更新商品购买数量
|
* 1.更新商品购买数量
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package cn.lili.sucurity;
|
||||||
|
|
||||||
|
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
||||||
|
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author paulG
|
||||||
|
* @since 2022/2/18
|
||||||
|
**/
|
||||||
|
@Component
|
||||||
|
public class ConsumerSecurityConfig extends WebSecurityConfigurerAdapter {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void configure(HttpSecurity http) throws Exception {
|
||||||
|
http.formLogin().disable();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -71,7 +71,7 @@ public class TimedTaskJobHandler {
|
|||||||
try {
|
try {
|
||||||
everyHourExecutes.get(i).execute();
|
everyHourExecutes.get(i).execute();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("每分钟任务异常", e);
|
log.error("每小时任务异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ReturnT.SUCCESS;
|
return ReturnT.SUCCESS;
|
||||||
@@ -94,7 +94,7 @@ public class TimedTaskJobHandler {
|
|||||||
try {
|
try {
|
||||||
everyDayExecutes.get(i).execute();
|
everyDayExecutes.get(i).execute();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("每分钟任务异常", e);
|
log.error("每日任务异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ReturnT.SUCCESS;
|
return ReturnT.SUCCESS;
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ public class CouponExecute implements EveryDayExecute {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void execute() {
|
public void execute() {
|
||||||
//将过期优惠券变更为过期状体
|
//将过期优惠券变更为过期状态
|
||||||
LambdaUpdateWrapper<MemberCoupon> updateWrapper = new LambdaUpdateWrapper<MemberCoupon>()
|
LambdaUpdateWrapper<MemberCoupon> updateWrapper = new LambdaUpdateWrapper<MemberCoupon>()
|
||||||
.eq(MemberCoupon::getMemberCouponStatus, MemberCouponStatusEnum.NEW.name())
|
.eq(MemberCoupon::getMemberCouponStatus, MemberCouponStatusEnum.NEW.name())
|
||||||
.le(MemberCoupon::getEndTime, new Date())
|
.le(MemberCoupon::getEndTime, new Date())
|
||||||
|
|||||||
@@ -1,11 +1,24 @@
|
|||||||
package cn.lili.timetask.handler.impl.hotwords;
|
package cn.lili.timetask.handler.impl.hotwords;
|
||||||
|
|
||||||
|
import cn.hutool.json.JSONUtil;
|
||||||
import cn.lili.cache.Cache;
|
import cn.lili.cache.Cache;
|
||||||
import cn.lili.cache.CachePrefix;
|
import cn.lili.cache.CachePrefix;
|
||||||
|
import cn.lili.common.utils.StringUtils;
|
||||||
|
import cn.lili.modules.search.entity.dos.HotWordsHistory;
|
||||||
|
import cn.lili.modules.search.service.HotWordsHistoryService;
|
||||||
|
import cn.lili.modules.system.entity.dos.Setting;
|
||||||
|
import cn.lili.modules.system.entity.dto.HotWordsSetting;
|
||||||
|
import cn.lili.modules.system.entity.dto.HotWordsSettingItem;
|
||||||
|
import cn.lili.modules.system.entity.enums.SettingEnum;
|
||||||
|
import cn.lili.modules.system.service.SettingService;
|
||||||
import cn.lili.timetask.handler.EveryDayExecute;
|
import cn.lili.timetask.handler.EveryDayExecute;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.data.redis.core.DefaultTypedTuple;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author paulG
|
* @author paulG
|
||||||
@@ -18,13 +31,54 @@ public class HotWordsEveryDayTaskExecute implements EveryDayExecute {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private Cache cache;
|
private Cache cache;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private HotWordsHistoryService hotWordsHistoryService;
|
||||||
|
@Autowired
|
||||||
|
private SettingService settingService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 执行每日任务
|
* 执行每日任务
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void execute() {
|
public void execute() {
|
||||||
|
//获取大于0分的热词
|
||||||
|
Set<DefaultTypedTuple> tuples = cache.zRangeByScore(CachePrefix.HOT_WORD.getPrefix(), 1, Integer.MAX_VALUE);
|
||||||
|
//如果任务不为空
|
||||||
|
if (!CollectionUtils.isEmpty(tuples)) {
|
||||||
|
|
||||||
|
//因为是第二天统计第一天的数据,所以这里获取昨天凌晨的时间
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
calendar.set(Calendar.HOUR_OF_DAY, 0);
|
||||||
|
calendar.set(Calendar.SECOND, 0);
|
||||||
|
calendar.set(Calendar.MILLISECOND, 0);
|
||||||
|
calendar.set(Calendar.MINUTE, 0);
|
||||||
|
calendar.set(Calendar.DAY_OF_YEAR, calendar.get(Calendar.DAY_OF_YEAR) - 1);
|
||||||
|
|
||||||
|
//批量保存热词
|
||||||
|
List<HotWordsHistory> hotWordsHistories = new ArrayList<>();
|
||||||
|
for (DefaultTypedTuple tuple : tuples) {
|
||||||
|
String keywords = (String) tuple.getValue();
|
||||||
|
Double score = tuple.getScore();
|
||||||
|
hotWordsHistories.add(new HotWordsHistory(keywords, score.intValue(), calendar.getTime()));
|
||||||
|
}
|
||||||
|
|
||||||
|
hotWordsHistoryService.saveBatch(hotWordsHistories);
|
||||||
|
}
|
||||||
//移除昨日的热搜词
|
//移除昨日的热搜词
|
||||||
cache.remove(CachePrefix.HOT_WORD.getPrefix());
|
cache.remove(CachePrefix.HOT_WORD.getPrefix());
|
||||||
|
|
||||||
|
//设置今日默认热词
|
||||||
|
Setting setting = settingService.get(SettingEnum.HOT_WORDS.name());
|
||||||
|
if (setting == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
HotWordsSetting hotWordsSetting = JSONUtil.toBean(setting.getSettingValue(), HotWordsSetting.class);
|
||||||
|
List<HotWordsSettingItem> hotWordsSettingItems = hotWordsSetting.getHotWordsSettingItems();
|
||||||
|
if (hotWordsSettingItems != null && !hotWordsSettingItems.isEmpty()) {
|
||||||
|
for (HotWordsSettingItem hotWordsSettingItem : hotWordsSettingItems) {
|
||||||
|
cache.zAdd(CachePrefix.HOT_WORD.getPrefix(), hotWordsSettingItem.getScore(), hotWordsSettingItem.getKeywords());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -160,7 +160,7 @@ public class OrderEveryDayTaskExecute implements EveryDayExecute {
|
|||||||
private void closeAfterSale(OrderSetting orderSetting) {
|
private void closeAfterSale(OrderSetting orderSetting) {
|
||||||
|
|
||||||
//订单关闭售后申请时间 = 当前时间 - 自动关闭售后申请天数
|
//订单关闭售后申请时间 = 当前时间 - 自动关闭售后申请天数
|
||||||
DateTime receiveTime = DateUtil.offsetDay(DateUtil.date(), -orderSetting.getAutoEvaluation());
|
DateTime receiveTime = DateUtil.offsetDay(DateUtil.date(), -orderSetting.getCloseAfterSale());
|
||||||
|
|
||||||
//关闭售后订单=未售后订单+小于订单关闭售后申请时间
|
//关闭售后订单=未售后订单+小于订单关闭售后申请时间
|
||||||
QueryWrapper queryWrapper = new QueryWrapper();
|
QueryWrapper queryWrapper = new QueryWrapper();
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
package cn.lili.timetask.handler.impl.promotion;
|
package cn.lili.timetask.handler.impl.promotion;
|
||||||
|
|
||||||
|
import cn.lili.common.enums.PromotionTypeEnum;
|
||||||
import cn.lili.modules.promotion.entity.dos.Seckill;
|
import cn.lili.modules.promotion.entity.dos.Seckill;
|
||||||
import cn.lili.modules.promotion.service.SeckillService;
|
import cn.lili.modules.promotion.service.SeckillService;
|
||||||
|
import cn.lili.modules.promotion.tools.PromotionTools;
|
||||||
import cn.lili.modules.search.service.EsGoodsIndexService;
|
import cn.lili.modules.search.service.EsGoodsIndexService;
|
||||||
import cn.lili.modules.system.entity.dos.Setting;
|
import cn.lili.modules.system.entity.dos.Setting;
|
||||||
import cn.lili.modules.system.entity.dto.SeckillSetting;
|
import cn.lili.modules.system.entity.dto.SeckillSetting;
|
||||||
@@ -62,14 +64,21 @@ public class PromotionEverydayExecute implements EveryDayExecute {
|
|||||||
/**
|
/**
|
||||||
* 添加秒杀活动
|
* 添加秒杀活动
|
||||||
* 从系统设置中获取秒杀活动的配置
|
* 从系统设置中获取秒杀活动的配置
|
||||||
* 添加30天后的秒杀活动
|
* 添加明天后的秒杀活动
|
||||||
*/
|
*/
|
||||||
private void addSeckill() {
|
private void addSeckill() {
|
||||||
Setting setting = settingService.get(SettingEnum.SECKILL_SETTING.name());
|
Setting setting = settingService.get(SettingEnum.SECKILL_SETTING.name());
|
||||||
SeckillSetting seckillSetting = new Gson().fromJson(setting.getSettingValue(), SeckillSetting.class);
|
SeckillSetting seckillSetting = new Gson().fromJson(setting.getSettingValue(), SeckillSetting.class);
|
||||||
|
log.info("生成秒杀活动设置:{}", seckillSetting);
|
||||||
for (int i = 1; i <= SeckillService.PRE_CREATION; i++) {
|
for (int i = 1; i <= SeckillService.PRE_CREATION; i++) {
|
||||||
Seckill seckill = new Seckill(i, seckillSetting.getHours(), seckillSetting.getSeckillRule());
|
Seckill seckill = new Seckill(i, seckillSetting.getHours(), seckillSetting.getSeckillRule());
|
||||||
seckillService.savePromotions(seckill);
|
|
||||||
|
//如果已经存在促销,则不再次保存
|
||||||
|
if (seckillService.list(
|
||||||
|
PromotionTools.checkActiveTime(seckill.getStartTime(), seckill.getEndTime(), PromotionTypeEnum.SECKILL, null, seckill.getId())).isEmpty()) {
|
||||||
|
boolean result = seckillService.savePromotions(seckill);
|
||||||
|
log.info("生成秒杀活动参数:{},结果:{}", seckill, result);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.concurrent.atomic.AtomicReference;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -54,8 +55,16 @@ public class OnlineMemberStatistics implements EveryHourExecute {
|
|||||||
calendar.set(Calendar.MILLISECOND, 0);
|
calendar.set(Calendar.MILLISECOND, 0);
|
||||||
|
|
||||||
Calendar finalCalendar = calendar;
|
Calendar finalCalendar = calendar;
|
||||||
|
|
||||||
|
AtomicReference<Integer> lastNum = new AtomicReference<>(0);
|
||||||
onlineMemberVOS = onlineMemberVOS.stream()
|
onlineMemberVOS = onlineMemberVOS.stream()
|
||||||
.filter(onlineMemberVO -> onlineMemberVO.getDate().after(finalCalendar.getTime()))
|
.filter(onlineMemberVO -> {
|
||||||
|
//如果为过滤参数,则记录为过期参数,则为统一时段上一周期的在线人数
|
||||||
|
if (!onlineMemberVO.getDate().after(finalCalendar.getTime())) {
|
||||||
|
lastNum.set(onlineMemberVO.getNum());
|
||||||
|
}
|
||||||
|
return onlineMemberVO.getDate().after(finalCalendar.getTime());
|
||||||
|
})
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
//计入新数据
|
//计入新数据
|
||||||
@@ -63,7 +72,7 @@ public class OnlineMemberStatistics implements EveryHourExecute {
|
|||||||
calendar.set(Calendar.MINUTE, 0);
|
calendar.set(Calendar.MINUTE, 0);
|
||||||
calendar.set(Calendar.SECOND, 0);
|
calendar.set(Calendar.SECOND, 0);
|
||||||
calendar.set(Calendar.MILLISECOND, 0);
|
calendar.set(Calendar.MILLISECOND, 0);
|
||||||
onlineMemberVOS.add(new OnlineMemberVO(calendar.getTime(), cache.keys(CachePrefix.ACCESS_TOKEN.getPrefix(UserEnums.MEMBER) + "*").size()));
|
onlineMemberVOS.add(new OnlineMemberVO(calendar.getTime(), cache.keys(CachePrefix.ACCESS_TOKEN.getPrefix(UserEnums.MEMBER) + "*").size(), lastNum.get()));
|
||||||
|
|
||||||
//写入缓存
|
//写入缓存
|
||||||
cache.put(CachePrefix.ONLINE_MEMBER.getPrefix(), onlineMemberVOS);
|
cache.put(CachePrefix.ONLINE_MEMBER.getPrefix(), onlineMemberVOS);
|
||||||
@@ -95,7 +104,7 @@ public class OnlineMemberStatistics implements EveryHourExecute {
|
|||||||
onlineMemberVOS = onlineMemberVOS.stream()
|
onlineMemberVOS = onlineMemberVOS.stream()
|
||||||
.filter(onlineMemberVO -> onlineMemberVO.getDate().after(calendar.getTime()))
|
.filter(onlineMemberVO -> onlineMemberVO.getDate().after(calendar.getTime()))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
onlineMemberVOS.add(new OnlineMemberVO(time, num));
|
onlineMemberVOS.add(new OnlineMemberVO(time, num, num));
|
||||||
|
|
||||||
//写入缓存
|
//写入缓存
|
||||||
cache.put(CachePrefix.ONLINE_MEMBER.getPrefix(), onlineMemberVOS);
|
cache.put(CachePrefix.ONLINE_MEMBER.getPrefix(), onlineMemberVOS);
|
||||||
|
|||||||
@@ -0,0 +1,49 @@
|
|||||||
|
package cn.lili.timetask.handler.impl.store;
|
||||||
|
|
||||||
|
import cn.lili.modules.goods.service.GoodsSkuService;
|
||||||
|
import cn.lili.modules.store.entity.dos.Store;
|
||||||
|
import cn.lili.modules.store.entity.enums.StoreStatusEnum;
|
||||||
|
import cn.lili.modules.store.service.StoreService;
|
||||||
|
import cn.lili.timetask.handler.EveryDayExecute;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 店铺信息更新
|
||||||
|
*
|
||||||
|
* @author Chopper
|
||||||
|
* @since 2021/3/15 5:30 下午
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
@Slf4j
|
||||||
|
public class StoreExecute implements EveryDayExecute {
|
||||||
|
/**
|
||||||
|
* 店铺
|
||||||
|
*/
|
||||||
|
@Autowired
|
||||||
|
private StoreService storeService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private GoodsSkuService goodsSkuService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void execute() {
|
||||||
|
//获取所有开启的店铺
|
||||||
|
List<Store> storeList = storeService.list(new LambdaQueryWrapper<Store>().eq(Store::getStoreDisable, StoreStatusEnum.OPEN.name()));
|
||||||
|
|
||||||
|
for (Store store : storeList) {
|
||||||
|
try {
|
||||||
|
Long num = goodsSkuService.countSkuNum(store.getId());
|
||||||
|
storeService.updateStoreGoodsNum(store.getId(), num);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("店铺id为{},更新商品数量失败", store.getId(), e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package cn.lili.timetask.handler.impl.storerating;
|
package cn.lili.timetask.handler.impl.store;
|
||||||
|
|
||||||
import cn.lili.common.enums.SwitchEnum;
|
import cn.lili.common.enums.SwitchEnum;
|
||||||
import cn.lili.modules.member.entity.dos.MemberEvaluation;
|
import cn.lili.modules.member.entity.dos.MemberEvaluation;
|
||||||
@@ -67,7 +67,7 @@ spring:
|
|||||||
default-datasource:
|
default-datasource:
|
||||||
type: com.alibaba.druid.pool.DruidDataSource
|
type: com.alibaba.druid.pool.DruidDataSource
|
||||||
driverClassName: com.mysql.cj.jdbc.Driver
|
driverClassName: com.mysql.cj.jdbc.Driver
|
||||||
url: jdbc:mysql://127.0.0.1:3306/lilishop?useUnicode=true&characterEncoding=utf-8&useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
|
url: jdbc:mysql://127.0.0.1:3306/lilishop?useUnicode=true&characterEncoding=utf-8&useSSL=false&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
|
||||||
username: root
|
username: root
|
||||||
password: lilishop
|
password: lilishop
|
||||||
maxActive: 20
|
maxActive: 20
|
||||||
|
|||||||
@@ -20,6 +20,22 @@
|
|||||||
</encoder>
|
</encoder>
|
||||||
</appender>
|
</appender>
|
||||||
|
|
||||||
|
<appender name="RocketmqClientAppender" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
|
<file>${LOG_FILE_PATH}/rocketmq.log</file>
|
||||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
|
<fileNamePattern>${LOG_FILE_PATH}/rocketmq/rocketmq-%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||||
|
<maxHistory>30</maxHistory>
|
||||||
|
<totalSizeCap>30MB</totalSizeCap>
|
||||||
|
</rollingPolicy>
|
||||||
|
<encoder>
|
||||||
|
<pattern>%d{yy-MM-dd.HH:mm:ss.SSS} [%-16t] %-5p %-22c{0} %X{ServiceId} - %m%n</pattern>
|
||||||
|
</encoder>
|
||||||
|
</appender>
|
||||||
|
<logger name="RocketmqClient" additivity="false">
|
||||||
|
<level value="info" />
|
||||||
|
<appender-ref ref="RocketmqClientAppender"/>
|
||||||
|
</logger>
|
||||||
|
|
||||||
<!--输出到elk的LOGSTASH-->
|
<!--输出到elk的LOGSTASH-->
|
||||||
<appender name="LOGSTASH" class="net.logstash.logback.appender.LogstashTcpSocketAppender">
|
<appender name="LOGSTASH" class="net.logstash.logback.appender.LogstashTcpSocketAppender">
|
||||||
<!-- 配置elk日志收集 配饰的是 LOGSTASH 的地址-->
|
<!-- 配置elk日志收集 配饰的是 LOGSTASH 的地址-->
|
||||||
|
|||||||
651
deploy-api.yml
Normal file
651
deploy-api.yml
Normal file
@@ -0,0 +1,651 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Namespace
|
||||||
|
metadata:
|
||||||
|
name: lilishop-service
|
||||||
|
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: buyer-api-service
|
||||||
|
namespace: lilishop-service
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/name: buyer-api-service
|
||||||
|
app.kubernetes.io/instance: api
|
||||||
|
app.kubernetes.io/version: "4.2.4.1"
|
||||||
|
app.kubernetes.io/component: api
|
||||||
|
app.kubernetes.io/part-of: lilishop
|
||||||
|
tier: "api-service"
|
||||||
|
spec:
|
||||||
|
type: NodePort
|
||||||
|
ports:
|
||||||
|
- name: "8888"
|
||||||
|
nodePort: 30888
|
||||||
|
port: 8888
|
||||||
|
targetPort: buyer8888
|
||||||
|
selector:
|
||||||
|
lilishop.service: buyer-api
|
||||||
|
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: common-api-service
|
||||||
|
namespace: lilishop-service
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/name: common-api-service
|
||||||
|
app.kubernetes.io/instance: api
|
||||||
|
app.kubernetes.io/version: "4.2.4.1"
|
||||||
|
app.kubernetes.io/component: api
|
||||||
|
app.kubernetes.io/part-of: lilishop
|
||||||
|
tier: "api-service"
|
||||||
|
spec:
|
||||||
|
type: NodePort
|
||||||
|
ports:
|
||||||
|
- name: "8890"
|
||||||
|
nodePort: 30890
|
||||||
|
port: 8890
|
||||||
|
targetPort: common8890
|
||||||
|
selector:
|
||||||
|
lilishop.service: common-api
|
||||||
|
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: seller-api-service
|
||||||
|
namespace: lilishop-service
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/name: seller-api-service
|
||||||
|
app.kubernetes.io/instance: api
|
||||||
|
app.kubernetes.io/version: "4.2.4.1"
|
||||||
|
app.kubernetes.io/component: api
|
||||||
|
app.kubernetes.io/part-of: lilishop
|
||||||
|
tier: "api-service"
|
||||||
|
spec:
|
||||||
|
type: NodePort
|
||||||
|
ports:
|
||||||
|
- name: "8889"
|
||||||
|
nodePort: 30889
|
||||||
|
port: 8889
|
||||||
|
targetPort: seller8889
|
||||||
|
selector:
|
||||||
|
lilishop.service: seller-api
|
||||||
|
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: manager-api-service
|
||||||
|
namespace: lilishop-service
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/name: manager-api-service
|
||||||
|
app.kubernetes.io/instance: api
|
||||||
|
app.kubernetes.io/version: "4.2.4.1"
|
||||||
|
app.kubernetes.io/component: api
|
||||||
|
app.kubernetes.io/part-of: lilishop
|
||||||
|
tier: "api-service"
|
||||||
|
spec:
|
||||||
|
type: NodePort
|
||||||
|
ports:
|
||||||
|
- name: "8887"
|
||||||
|
nodePort: 30887
|
||||||
|
port: 8887
|
||||||
|
targetPort: manager8887
|
||||||
|
selector:
|
||||||
|
lilishop.service: manager-api
|
||||||
|
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: api-config
|
||||||
|
namespace: lilishop-service
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/name: mysql-db-config
|
||||||
|
app.kubernetes.io/instance: mysql-single
|
||||||
|
app.kubernetes.io/version: "8.0.28"
|
||||||
|
app.kubernetes.io/component: database
|
||||||
|
app.kubernetes.io/part-of: lilishop
|
||||||
|
data:
|
||||||
|
application.yml: |
|
||||||
|
server:
|
||||||
|
servlet:
|
||||||
|
context-path: /
|
||||||
|
|
||||||
|
tomcat:
|
||||||
|
uri-encoding: UTF-8
|
||||||
|
threads:
|
||||||
|
min-spare: 50
|
||||||
|
max: 1000
|
||||||
|
|
||||||
|
# 与Spring Boot 2一样,默认情况下,大多数端点都不通过http公开,我们公开了所有端点。对于生产,您应该仔细选择要公开的端点。
|
||||||
|
management:
|
||||||
|
# health:
|
||||||
|
# elasticsearch:
|
||||||
|
# enabled: false
|
||||||
|
# datasource:
|
||||||
|
# enabled: false
|
||||||
|
endpoints:
|
||||||
|
web:
|
||||||
|
exposure:
|
||||||
|
include: '*'
|
||||||
|
spring:
|
||||||
|
# 要在其中注册的Spring Boot Admin Server的URL。
|
||||||
|
boot:
|
||||||
|
admin:
|
||||||
|
client:
|
||||||
|
url: http://192.168.0.116:8000
|
||||||
|
cache:
|
||||||
|
type: redis
|
||||||
|
# Redis
|
||||||
|
redis:
|
||||||
|
host: redis-service.lilishop-middleware
|
||||||
|
port: 6379
|
||||||
|
password: lilishop
|
||||||
|
lettuce:
|
||||||
|
pool:
|
||||||
|
# 连接池最大连接数(使用负值表示没有限制) 默认 8
|
||||||
|
max-active: 200
|
||||||
|
# 连接池最大阻塞等待时间(使用负值表示没有限制) 默认 -1
|
||||||
|
max-wait: 20
|
||||||
|
# 连接池中的最大空闲连接 默认 8
|
||||||
|
max-idle: 10
|
||||||
|
# 连接池中的最小空闲连接 默认 8
|
||||||
|
min-idle: 8
|
||||||
|
# 文件大小上传配置
|
||||||
|
servlet:
|
||||||
|
multipart:
|
||||||
|
max-file-size: 20MB
|
||||||
|
max-request-size: 20MB
|
||||||
|
jackson:
|
||||||
|
time-zone: GMT+8
|
||||||
|
serialization:
|
||||||
|
#关闭jackson 对json做解析
|
||||||
|
fail-on-empty-beans: false
|
||||||
|
|
||||||
|
shardingsphere:
|
||||||
|
datasource:
|
||||||
|
# 数据库名称,可自定义,可以为多个,以逗号隔开,每个在这里定义的库,都要在下面定义连接属性
|
||||||
|
names: default-datasource
|
||||||
|
default-datasource:
|
||||||
|
type: com.alibaba.druid.pool.DruidDataSource
|
||||||
|
driverClassName: com.mysql.cj.jdbc.Driver
|
||||||
|
url: jdbc:mysql://mysql.lilishop-middleware:3306/lilishop?useUnicode=true&characterEncoding=utf-8&useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
|
||||||
|
username: root
|
||||||
|
password: lilishop
|
||||||
|
maxActive: 50
|
||||||
|
initialSize: 20
|
||||||
|
maxWait: 60000
|
||||||
|
minIdle: 5
|
||||||
|
timeBetweenEvictionRunsMillis: 60000
|
||||||
|
minEvictableIdleTimeMillis: 300000
|
||||||
|
validationQuery: SELECT 1 FROM DUAL
|
||||||
|
testWhileIdle: true
|
||||||
|
testOnBorrow: false
|
||||||
|
testOnReturn: false
|
||||||
|
#是否缓存preparedStatement,也就是PSCache。在mysql下建议关闭。 PSCache对支持游标的数据库性能提升巨大,比如说oracle。
|
||||||
|
poolPreparedStatements: false
|
||||||
|
#要启用PSCache,-1为关闭 必须配置大于0,当大于0时,poolPreparedStatements自动触发修改为true 可以把这个数值配置大一些,比如说100
|
||||||
|
maxOpenPreparedStatements: -1
|
||||||
|
#配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
|
||||||
|
filters: stat,wall,log4j2
|
||||||
|
#通过connectProperties属性来打开mergeSql功能;慢SQL记录
|
||||||
|
connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
|
||||||
|
#合并多个DruidDataSource的监控数据
|
||||||
|
useGlobalDataSourceStat: true
|
||||||
|
loginUsername: druid
|
||||||
|
loginPassword: druid
|
||||||
|
# sharding:
|
||||||
|
# default-data-source-name: default-datasource
|
||||||
|
# #需要拆分的表,可以设置多个 在 li_order 级别即可
|
||||||
|
# tables:
|
||||||
|
# #需要进行分表的逻辑表名
|
||||||
|
# li_order:
|
||||||
|
# #实际的表结点,下面代表的是li_order_为开头的所有表,如果能确定表的范围例如按月份分表,这里的写法是data2020.li_order_$->{2020..2021}_$->{01..12} 表示例如 li_order_2020_01 li_order_2020_03 li_order_2021_01
|
||||||
|
# actual-data-nodes: data2020.li_order_$->{2019..2021}_$->{01..12}
|
||||||
|
# table-strategy:
|
||||||
|
# # 分表策略,根据创建日期
|
||||||
|
# standard:
|
||||||
|
# sharding-column: create_time
|
||||||
|
# #分表策略
|
||||||
|
# precise-algorithm-class-name: cn.lili.mybatis.sharding.CreateTimeShardingTableAlgorithm
|
||||||
|
# #范围查询实现
|
||||||
|
# range-algorithm-class-name: cn.lili.mybatis.sharding.CreateTimeShardingTableAlgorithm
|
||||||
|
props:
|
||||||
|
#是否打印逻辑SQL语句和实际SQL语句,建议调试时打印,在生产环境关闭
|
||||||
|
sql:
|
||||||
|
show: true
|
||||||
|
|
||||||
|
# 忽略鉴权url
|
||||||
|
ignored:
|
||||||
|
urls:
|
||||||
|
- /editor-app/**
|
||||||
|
- /actuator**
|
||||||
|
- /actuator/**
|
||||||
|
- /MP_verify_qSyvBPhDsPdxvOhC.txt
|
||||||
|
- /weixin/**
|
||||||
|
- /source/**
|
||||||
|
- /store/passport/login/**
|
||||||
|
- /store/passport/login/refresh/**
|
||||||
|
- /common/common/slider/**
|
||||||
|
- /common/common/sms/**
|
||||||
|
- /buyer/payment/cashier/**
|
||||||
|
- /buyer/other/pageData/**
|
||||||
|
- /buyer/other/article/**
|
||||||
|
- /buyer/goods/**
|
||||||
|
- /buyer/store/**
|
||||||
|
- /buyer/passport/connect/**
|
||||||
|
- /buyer/members/**
|
||||||
|
- /buyer/passport/member/**
|
||||||
|
- /buyer/passport/member/refresh/**
|
||||||
|
- /buyer/promotion/pintuan/**
|
||||||
|
- /buyer/promotion/seckill/**
|
||||||
|
- /buyer/promotion/pointsGoods/**
|
||||||
|
- /buyer/promotion/coupon
|
||||||
|
- /buyer/member/evaluation/**/goodsEvaluation
|
||||||
|
- /buyer/member/evaluation/**/evaluationNumber
|
||||||
|
- /buyer/other/appVersion/**
|
||||||
|
- /buyer/broadcast/studio/**
|
||||||
|
- /manager/passport/user/login
|
||||||
|
- /manager/passport/user/refresh/**
|
||||||
|
- /manager/other/elasticsearch
|
||||||
|
- /manager/other/customWords
|
||||||
|
- /druid/**
|
||||||
|
- /swagger-ui.html
|
||||||
|
- /doc.html
|
||||||
|
- /swagger-resources/**
|
||||||
|
- /swagger/**
|
||||||
|
- /webjars/**
|
||||||
|
- /v2/api-docs**
|
||||||
|
- /configuration/ui
|
||||||
|
- /boot-admin
|
||||||
|
- /manager/promotion/seckill/init
|
||||||
|
- /**/*.js
|
||||||
|
- /**/*.css
|
||||||
|
- /**/*.png
|
||||||
|
- /**/*.ico
|
||||||
|
|
||||||
|
# Swagger界面内容配置
|
||||||
|
swagger:
|
||||||
|
title: lilishop API接口文档
|
||||||
|
description: lilishop Api Documentation
|
||||||
|
version: 4.2.2
|
||||||
|
termsOfServiceUrl: https://pickmall.cn
|
||||||
|
contact:
|
||||||
|
name: lili
|
||||||
|
url: https://pickmall.cn
|
||||||
|
email: admin@pickmall.com
|
||||||
|
|
||||||
|
# Mybatis-plus
|
||||||
|
mybatis-plus:
|
||||||
|
mapper-locations: classpath*:mapper/*.xml
|
||||||
|
configuration:
|
||||||
|
#缓存开启
|
||||||
|
cache-enabled: true
|
||||||
|
#日志
|
||||||
|
# log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
|
||||||
|
|
||||||
|
# 日志
|
||||||
|
logging:
|
||||||
|
# 输出级别
|
||||||
|
level:
|
||||||
|
cn.lili: info
|
||||||
|
# org.hibernate: debug
|
||||||
|
# org.springframework: debug
|
||||||
|
file:
|
||||||
|
# 指定路径
|
||||||
|
path: logs
|
||||||
|
logback:
|
||||||
|
rollingpolicy:
|
||||||
|
# 最大保存天数
|
||||||
|
max-history: 7
|
||||||
|
# 每个文件最大大小
|
||||||
|
max-file-size: 5MB
|
||||||
|
#加密参数
|
||||||
|
jasypt:
|
||||||
|
encryptor:
|
||||||
|
password: lili
|
||||||
|
|
||||||
|
|
||||||
|
lili:
|
||||||
|
#验证码设置
|
||||||
|
verification-code:
|
||||||
|
#图形验证码有效时间 秒 包含滑块验证码有效时间, 以及验证通过之后,缓存中存储的验证结果有效时间
|
||||||
|
effectiveTime: 300
|
||||||
|
#水印
|
||||||
|
watermark: LILI-SHOP
|
||||||
|
#干扰项数量 最大2 默认0
|
||||||
|
interfereNum: 1
|
||||||
|
#允许误差像素
|
||||||
|
faultTolerant: 3
|
||||||
|
#短信模版配置
|
||||||
|
sms:
|
||||||
|
#登录
|
||||||
|
LOGIN: SMS_205755300
|
||||||
|
#注册
|
||||||
|
REGISTER: SMS_205755298
|
||||||
|
#找回密码
|
||||||
|
FIND_USER: SMS_205755301
|
||||||
|
#设置密码
|
||||||
|
UPDATE_PASSWORD: SMS_205755297
|
||||||
|
#支付密码
|
||||||
|
WALLET_PASSWORD: SMS_205755301
|
||||||
|
system:
|
||||||
|
isDemoSite: false
|
||||||
|
isTestModel: true
|
||||||
|
# 脱敏级别:
|
||||||
|
# 0:不做脱敏处理
|
||||||
|
# 1:管理端用户手机号等信息脱敏
|
||||||
|
# 2:商家端信息脱敏(为2时,表示管理端,商家端同时脱敏)
|
||||||
|
sensitiveLevel: 1
|
||||||
|
|
||||||
|
statistics:
|
||||||
|
# 在线人数统计 X 小时。这里设置48,即统计过去48小时每小时在线人数
|
||||||
|
onlineMember: 48
|
||||||
|
# 当前在线人数刷新时间间隔,单位秒,设置为600,则每10分钟刷新一次
|
||||||
|
currentOnlineUpdate: 600
|
||||||
|
#qq lbs 申请
|
||||||
|
lbs:
|
||||||
|
key: 4BYBZ-7MT6S-PUAOA-6BNWL-FJUD7-UUFXT
|
||||||
|
sk: zhNKVrJK6UPOhqIjn8AQvG37b9sz6
|
||||||
|
#域名
|
||||||
|
domain:
|
||||||
|
pc: http://192.168.0.116:8888
|
||||||
|
wap: http://192.168.0.116:8888
|
||||||
|
seller: http://192.168.0.116:8888
|
||||||
|
admin: http://192.168.0.116:8888
|
||||||
|
#api地址
|
||||||
|
api:
|
||||||
|
buyer: http://192.168.0.116:8888
|
||||||
|
base: http://192.168.0.116:8888
|
||||||
|
manager: http://192.168.0.116:8888
|
||||||
|
seller: http://192.168.0.116:8888
|
||||||
|
|
||||||
|
# jwt 细节设定
|
||||||
|
jwt-setting:
|
||||||
|
# token过期时间(分钟)
|
||||||
|
tokenExpireTime: 30
|
||||||
|
|
||||||
|
# 使用Spring @Cacheable注解失效时间
|
||||||
|
cache:
|
||||||
|
# 过期时间 单位秒 永久不过期设为-1
|
||||||
|
timeout: 1500
|
||||||
|
#多线程配置
|
||||||
|
thread:
|
||||||
|
corePoolSize: 5
|
||||||
|
maxPoolSize: 50
|
||||||
|
queueCapacity: 50
|
||||||
|
data:
|
||||||
|
elasticsearch:
|
||||||
|
cluster-name: elasticsearch
|
||||||
|
cluster-nodes: elasticsearch.lilishop-middleware:9200
|
||||||
|
index:
|
||||||
|
number-of-replicas: 0
|
||||||
|
number-of-shards: 3
|
||||||
|
index-prefix: lili
|
||||||
|
schema: http
|
||||||
|
# account:
|
||||||
|
# username: elastic
|
||||||
|
# password: LiLiShopES
|
||||||
|
|
||||||
|
logstash:
|
||||||
|
server: logstash-service.lilishop-middleware:4560
|
||||||
|
rocketmq:
|
||||||
|
promotion-topic: lili_promotion_topic
|
||||||
|
promotion-group: lili_promotion_group
|
||||||
|
msg-ext-topic: lili_msg_topic
|
||||||
|
msg-ext-group: lili_msg_group
|
||||||
|
goods-topic: lili_goods_topic
|
||||||
|
goods-group: lili_goods_group
|
||||||
|
order-topic: lili_order_topic
|
||||||
|
order-group: lili_order_group
|
||||||
|
member-topic: lili_member_topic
|
||||||
|
member-group: lili_member_group
|
||||||
|
other-topic: lili_other_topic
|
||||||
|
other-group: lili_other_group
|
||||||
|
notice-topic: lili_notice_topic
|
||||||
|
notice-group: lili_notice_group
|
||||||
|
notice-send-topic: lili_send_notice_topic
|
||||||
|
notice-send-group: lili_send_notice_group
|
||||||
|
after-sale-topic: lili_after_sale_topic
|
||||||
|
after-sale-group: lili_after_sale_group
|
||||||
|
rocketmq:
|
||||||
|
name-server: rocketmq.lilishop-middleware:9876
|
||||||
|
isVIPChannel: false
|
||||||
|
producer:
|
||||||
|
group: lili_group
|
||||||
|
send-message-timeout: 30000
|
||||||
|
|
||||||
|
xxl:
|
||||||
|
job:
|
||||||
|
admin:
|
||||||
|
addresses: http://xxl-job-service.lilishop-middleware:9001/xxl-job-admin
|
||||||
|
executor:
|
||||||
|
appname: xxl-job-executor-lilishop
|
||||||
|
address:
|
||||||
|
ip:
|
||||||
|
port: 8891
|
||||||
|
logpath: ./xxl-job/executor
|
||||||
|
logretentiondays: 7
|
||||||
|
|
||||||
|
---
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: buyer-api
|
||||||
|
namespace: lilishop-service
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/name: buyer-api-service
|
||||||
|
app.kubernetes.io/instance: buyer-api
|
||||||
|
app.kubernetes.io/version: "4.2.4.1"
|
||||||
|
app.kubernetes.io/component: api
|
||||||
|
app.kubernetes.io/part-of: lilishop
|
||||||
|
tier: "api-service"
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
lilishop.service: buyer-api
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
lilishop.service: buyer-api
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- image: 192.168.0.108:31320/buyer-api:4.2.4.1
|
||||||
|
name: buyer-api
|
||||||
|
env:
|
||||||
|
- name: TZ
|
||||||
|
value: Asia/Shanghai
|
||||||
|
- name: JAVA_OPTS
|
||||||
|
value: -XX:MetaspaceSize=64m -XX:MaxMetaspaceSize=128m -Xms128m -Xmx256m -Xmn128m -Xss256k -XX:SurvivorRatio=8 -XX:+UseConcMarkSweepGC
|
||||||
|
ports:
|
||||||
|
- name: buyer8888
|
||||||
|
containerPort: 8888
|
||||||
|
volumeMounts:
|
||||||
|
- mountPath: /application.yml
|
||||||
|
name: application-yml
|
||||||
|
subPath: application.yml
|
||||||
|
restartPolicy: Always
|
||||||
|
volumes:
|
||||||
|
- configMap:
|
||||||
|
name: api-config
|
||||||
|
name: application-yml
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: common-api
|
||||||
|
namespace: lilishop-service
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/name: common-api-service
|
||||||
|
app.kubernetes.io/instance: common-api
|
||||||
|
app.kubernetes.io/version: "4.2.4.1"
|
||||||
|
app.kubernetes.io/component: api
|
||||||
|
app.kubernetes.io/part-of: lilishop
|
||||||
|
tier: "api-service"
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
lilishop.service: common-api
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
lilishop.service: common-api
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- image: 192.168.0.108:31320/common-api:4.2.4.1
|
||||||
|
name: common-api
|
||||||
|
env:
|
||||||
|
- name: TZ
|
||||||
|
value: Asia/Shanghai
|
||||||
|
- name: JAVA_OPTS
|
||||||
|
value: -XX:MetaspaceSize=64m -XX:MaxMetaspaceSize=128m -Xms128m -Xmx256m -Xmn128m -Xss256k -XX:SurvivorRatio=8 -XX:+UseConcMarkSweepGC
|
||||||
|
ports:
|
||||||
|
- name: common8890
|
||||||
|
containerPort: 8890
|
||||||
|
volumeMounts:
|
||||||
|
- mountPath: /application.yml
|
||||||
|
name: application-yml
|
||||||
|
subPath: application.yml
|
||||||
|
restartPolicy: Always
|
||||||
|
volumes:
|
||||||
|
- configMap:
|
||||||
|
name: api-config
|
||||||
|
name: application-yml
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: seller-api
|
||||||
|
namespace: lilishop-service
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/name: seller-api-service
|
||||||
|
app.kubernetes.io/instance: seller-api
|
||||||
|
app.kubernetes.io/version: "4.2.4.1"
|
||||||
|
app.kubernetes.io/component: api
|
||||||
|
app.kubernetes.io/part-of: lilishop
|
||||||
|
tier: "api-service"
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
lilishop.service: seller-api
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
lilishop.service: seller-api
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- image: 192.168.0.108:31320/seller-api:4.2.4.1
|
||||||
|
name: seller-api
|
||||||
|
env:
|
||||||
|
- name: TZ
|
||||||
|
value: Asia/Shanghai
|
||||||
|
- name: JAVA_OPTS
|
||||||
|
value: -XX:MetaspaceSize=64m -XX:MaxMetaspaceSize=128m -Xms128m -Xmx256m -Xmn128m -Xss256k -XX:SurvivorRatio=8 -XX:+UseConcMarkSweepGC
|
||||||
|
ports:
|
||||||
|
- name: seller8889
|
||||||
|
containerPort: 8889
|
||||||
|
volumeMounts:
|
||||||
|
- mountPath: /application.yml
|
||||||
|
name: application-yml
|
||||||
|
subPath: application.yml
|
||||||
|
restartPolicy: Always
|
||||||
|
volumes:
|
||||||
|
- configMap:
|
||||||
|
name: api-config
|
||||||
|
name: application-yml
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: manager-api
|
||||||
|
namespace: lilishop-service
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/name: manager-api-service
|
||||||
|
app.kubernetes.io/instance: manager-api
|
||||||
|
app.kubernetes.io/version: "4.2.4.1"
|
||||||
|
app.kubernetes.io/component: api
|
||||||
|
app.kubernetes.io/part-of: lilishop
|
||||||
|
tier: "api-service"
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
lilishop.service: manager-api
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
lilishop.service: manager-api
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- image: 192.168.0.108:31320/manager-api:4.2.4.1
|
||||||
|
name: manager-api
|
||||||
|
env:
|
||||||
|
- name: TZ
|
||||||
|
value: Asia/Shanghai
|
||||||
|
- name: JAVA_OPTS
|
||||||
|
value: -XX:MetaspaceSize=64m -XX:MaxMetaspaceSize=128m -Xms128m -Xmx256m -Xmn128m -Xss256k -XX:SurvivorRatio=8 -XX:+UseConcMarkSweepGC
|
||||||
|
ports:
|
||||||
|
- name: manager8887
|
||||||
|
containerPort: 8887
|
||||||
|
volumeMounts:
|
||||||
|
- mountPath: /application.yml
|
||||||
|
name: application-yml
|
||||||
|
subPath: application.yml
|
||||||
|
restartPolicy: Always
|
||||||
|
volumes:
|
||||||
|
- configMap:
|
||||||
|
name: api-config
|
||||||
|
name: application-yml
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: consumer
|
||||||
|
namespace: lilishop-service
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/name: consumer-service
|
||||||
|
app.kubernetes.io/instance: buyer-api
|
||||||
|
app.kubernetes.io/version: "4.2.4.1"
|
||||||
|
app.kubernetes.io/component: api
|
||||||
|
app.kubernetes.io/part-of: lilishop
|
||||||
|
tier: "api-service"
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
lilishop.service: consumer
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
lilishop.service: consumer
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- image: 192.168.0.108:31320/consumer:4.2.4.1
|
||||||
|
name: consumer
|
||||||
|
env:
|
||||||
|
- name: TZ
|
||||||
|
value: Asia/Shanghai
|
||||||
|
- name: JAVA_OPTS
|
||||||
|
value: -XX:MetaspaceSize=64m -XX:MaxMetaspaceSize=128m -Xms128m -Xmx256m -Xmn128m -Xss256k -XX:SurvivorRatio=8 -XX:+UseConcMarkSweepGC
|
||||||
|
volumeMounts:
|
||||||
|
- mountPath: /application.yml
|
||||||
|
name: application-yml
|
||||||
|
subPath: application.yml
|
||||||
|
restartPolicy: Always
|
||||||
|
volumes:
|
||||||
|
- configMap:
|
||||||
|
name: api-config
|
||||||
|
name: application-yml
|
||||||
@@ -15,6 +15,15 @@
|
|||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.qiniu</groupId>
|
||||||
|
<artifactId>qiniu-java-sdk</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.qiniu</groupId>
|
||||||
|
<artifactId>qiniu-java-sdk</artifactId>
|
||||||
|
<version>7.4.0</version>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-properties-migrator</artifactId>
|
<artifactId>spring-boot-properties-migrator</artifactId>
|
||||||
@@ -123,6 +132,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>mysql</groupId>
|
<groupId>mysql</groupId>
|
||||||
<artifactId>mysql-connector-java</artifactId>
|
<artifactId>mysql-connector-java</artifactId>
|
||||||
|
<version>8.0.29</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- Redis-->
|
<!-- Redis-->
|
||||||
<dependency>
|
<dependency>
|
||||||
@@ -134,6 +144,12 @@
|
|||||||
<groupId>org.redisson</groupId>
|
<groupId>org.redisson</groupId>
|
||||||
<artifactId>redisson</artifactId>
|
<artifactId>redisson</artifactId>
|
||||||
<version>${redisson}</version>
|
<version>${redisson}</version>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<artifactId>slf4j-api</artifactId>
|
||||||
|
<groupId>org.slf4j</groupId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
@@ -413,6 +429,13 @@
|
|||||||
</exclusions>
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.minio</groupId>
|
||||||
|
<artifactId>minio</artifactId>
|
||||||
|
<version>${minio.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
13
framework/src/main/java/cn/lili/cache/Cache.java
vendored
13
framework/src/main/java/cn/lili/cache/Cache.java
vendored
@@ -153,7 +153,15 @@ public interface Cache<T> {
|
|||||||
* @param pattern 模糊key
|
* @param pattern 模糊key
|
||||||
* @return 缓存中的数据
|
* @return 缓存中的数据
|
||||||
*/
|
*/
|
||||||
List<String> keys(String pattern);
|
List<Object> keys(String pattern);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 原生阻塞keys 不推荐使用
|
||||||
|
*
|
||||||
|
* @param pattern 模糊key
|
||||||
|
* @return 缓存中的数据
|
||||||
|
*/
|
||||||
|
List<Object> keysBlock(String pattern);
|
||||||
|
|
||||||
|
|
||||||
//-----------------------------------------------用于特殊场景,redis去重计数---------------------------------------------
|
//-----------------------------------------------用于特殊场景,redis去重计数---------------------------------------------
|
||||||
@@ -211,11 +219,12 @@ public interface Cache<T> {
|
|||||||
* @return 计数器结果
|
* @return 计数器结果
|
||||||
*/
|
*/
|
||||||
Long incr(String key, long liveTime);
|
Long incr(String key, long liveTime);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* redis 计数器 累加
|
* redis 计数器 累加
|
||||||
* 注:到达liveTime之后,该次增加取消,即自动-1,而不是redis值为空
|
* 注:到达liveTime之后,该次增加取消,即自动-1,而不是redis值为空
|
||||||
*
|
*
|
||||||
* @param key 为累计的key,同一key每次调用则值 +1
|
* @param key 为累计的key,同一key每次调用则值 +1
|
||||||
* @return 计数器结果
|
* @return 计数器结果
|
||||||
*/
|
*/
|
||||||
Long incr(String key);
|
Long incr(String key);
|
||||||
|
|||||||
@@ -465,6 +465,10 @@ public enum CachePrefix {
|
|||||||
*/
|
*/
|
||||||
INIT_INDEX_FLAG,
|
INIT_INDEX_FLAG,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 店铺
|
||||||
|
*/
|
||||||
|
STORE,
|
||||||
/**
|
/**
|
||||||
* 店铺分类
|
* 店铺分类
|
||||||
*/
|
*/
|
||||||
@@ -473,10 +477,21 @@ public enum CachePrefix {
|
|||||||
* 用户菜单
|
* 用户菜单
|
||||||
*/
|
*/
|
||||||
MENU_USER_ID,
|
MENU_USER_ID,
|
||||||
|
/**
|
||||||
|
* 用户菜单
|
||||||
|
* <p>
|
||||||
|
* 这个缓存并非永久缓存,而是300秒缓存,也就是说修改用户关联的部门,关联的角色,
|
||||||
|
* 部门关联的角色,角色关联的菜单等等,最多需要5分钟才能生效
|
||||||
|
*/
|
||||||
|
STORE_MENU_USER_ID,
|
||||||
/**
|
/**
|
||||||
* 用户菜单
|
* 用户菜单
|
||||||
*/
|
*/
|
||||||
USER_MENU,
|
USER_MENU,
|
||||||
|
/**
|
||||||
|
* 用户菜单
|
||||||
|
*/
|
||||||
|
STORE_USER_MENU,
|
||||||
/**
|
/**
|
||||||
* 订单暂时缓存
|
* 订单暂时缓存
|
||||||
*/
|
*/
|
||||||
@@ -484,7 +499,16 @@ public enum CachePrefix {
|
|||||||
/**
|
/**
|
||||||
* 敏感词
|
* 敏感词
|
||||||
*/
|
*/
|
||||||
SENSITIVE;
|
SENSITIVE,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 扫码登录
|
||||||
|
* @param str
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
QR_CODE_LOGIN_SESSION
|
||||||
|
|
||||||
|
;
|
||||||
|
|
||||||
|
|
||||||
public static String removePrefix(String str) {
|
public static String removePrefix(String str) {
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import org.springframework.data.redis.serializer.RedisSerializer;
|
|||||||
import org.springframework.data.redis.serializer.SerializationException;
|
import org.springframework.data.redis.serializer.SerializationException;
|
||||||
|
|
||||||
import java.nio.charset.Charset;
|
import java.nio.charset.Charset;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 要实现对象的缓存,定义自己的序列化和反序列化器。使用阿里的fastjson来实现的比较多
|
* 要实现对象的缓存,定义自己的序列化和反序列化器。使用阿里的fastjson来实现的比较多
|
||||||
@@ -13,8 +14,8 @@ import java.nio.charset.Charset;
|
|||||||
* @author Bulbasaur
|
* @author Bulbasaur
|
||||||
*/
|
*/
|
||||||
public class FastJsonRedisSerializer<T> implements RedisSerializer<T> {
|
public class FastJsonRedisSerializer<T> implements RedisSerializer<T> {
|
||||||
private static final Charset DEFAULT_CHARSET = Charset.forName("UTF-8");
|
private static final Charset DEFAULT_CHARSET = StandardCharsets.UTF_8;
|
||||||
private Class<T> clazz;
|
private final Class<T> clazz;
|
||||||
|
|
||||||
public FastJsonRedisSerializer(Class<T> clazz) {
|
public FastJsonRedisSerializer(Class<T> clazz) {
|
||||||
super();
|
super();
|
||||||
@@ -26,7 +27,10 @@ public class FastJsonRedisSerializer<T> implements RedisSerializer<T> {
|
|||||||
if (null == t) {
|
if (null == t) {
|
||||||
return new byte[0];
|
return new byte[0];
|
||||||
}
|
}
|
||||||
return JSON.toJSONString(t, SerializerFeature.WriteClassName).getBytes(DEFAULT_CHARSET);
|
return JSON.toJSONString(t,
|
||||||
|
SerializerFeature.WriteClassName,
|
||||||
|
SerializerFeature.DisableCircularReferenceDetect)
|
||||||
|
.getBytes(DEFAULT_CHARSET);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ import org.redisson.config.ClusterServersConfig;
|
|||||||
import org.redisson.config.Config;
|
import org.redisson.config.Config;
|
||||||
import org.redisson.config.SentinelServersConfig;
|
import org.redisson.config.SentinelServersConfig;
|
||||||
import org.redisson.config.SingleServerConfig;
|
import org.redisson.config.SingleServerConfig;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||||
@@ -56,13 +55,11 @@ import java.util.Map;
|
|||||||
public class RedisConfig extends CachingConfigurerSupport {
|
public class RedisConfig extends CachingConfigurerSupport {
|
||||||
|
|
||||||
|
|
||||||
|
private static final String REDIS_PREFIX = "redis://";
|
||||||
|
|
||||||
@Value("${lili.cache.timeout:7200}")
|
@Value("${lili.cache.timeout:7200}")
|
||||||
private Integer timeout;
|
private Integer timeout;
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private RedisProperties redisProperties;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 当有多个管理器的时候,必须使用该注解在一个管理器上注释:表示该管理器为默认的管理器
|
* 当有多个管理器的时候,必须使用该注解在一个管理器上注释:表示该管理器为默认的管理器
|
||||||
*
|
*
|
||||||
@@ -101,7 +98,7 @@ public class RedisConfig extends CachingConfigurerSupport {
|
|||||||
public RedisTemplate<Object, Object> redisTemplate(LettuceConnectionFactory lettuceConnectionFactory) {
|
public RedisTemplate<Object, Object> redisTemplate(LettuceConnectionFactory lettuceConnectionFactory) {
|
||||||
RedisTemplate<Object, Object> template = new RedisTemplate<>();
|
RedisTemplate<Object, Object> template = new RedisTemplate<>();
|
||||||
//使用fastjson序列化
|
//使用fastjson序列化
|
||||||
FastJsonRedisSerializer fastJsonRedisSerializer = new FastJsonRedisSerializer(Object.class);
|
FastJsonRedisSerializer<Object> fastJsonRedisSerializer = new FastJsonRedisSerializer<>(Object.class);
|
||||||
//value值的序列化采用fastJsonRedisSerializer
|
//value值的序列化采用fastJsonRedisSerializer
|
||||||
template.setValueSerializer(fastJsonRedisSerializer);
|
template.setValueSerializer(fastJsonRedisSerializer);
|
||||||
template.setHashValueSerializer(fastJsonRedisSerializer);
|
template.setHashValueSerializer(fastJsonRedisSerializer);
|
||||||
@@ -113,16 +110,15 @@ public class RedisConfig extends CachingConfigurerSupport {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Bean(destroyMethod = "shutdown")
|
@Bean(destroyMethod = "shutdown")
|
||||||
public RedissonClient redisson() {
|
public RedissonClient redisson(RedisProperties redisProperties) {
|
||||||
Config config = new Config();
|
Config config = new Config();
|
||||||
|
|
||||||
if (redisProperties.getSentinel() != null && !redisProperties.getSentinel().getNodes().isEmpty()) {
|
if (redisProperties.getSentinel() != null && !redisProperties.getSentinel().getNodes().isEmpty()) {
|
||||||
// 哨兵模式
|
// 哨兵模式
|
||||||
SentinelServersConfig sentinelServersConfig = config.useSentinelServers();
|
SentinelServersConfig sentinelServersConfig = config.useSentinelServers();
|
||||||
sentinelServersConfig.setMasterName(redisProperties.getSentinel().getMaster());
|
sentinelServersConfig.setMasterName(redisProperties.getSentinel().getMaster());
|
||||||
List<String> sentinelAddress = new ArrayList<>();
|
List<String> sentinelAddress = new ArrayList<>();
|
||||||
for (String node : redisProperties.getCluster().getNodes()) {
|
for (String node : redisProperties.getCluster().getNodes()) {
|
||||||
sentinelAddress.add("redis://" + node);
|
sentinelAddress.add(REDIS_PREFIX + node);
|
||||||
}
|
}
|
||||||
sentinelServersConfig.setSentinelAddresses(sentinelAddress);
|
sentinelServersConfig.setSentinelAddresses(sentinelAddress);
|
||||||
if (CharSequenceUtil.isNotEmpty(redisProperties.getSentinel().getPassword())) {
|
if (CharSequenceUtil.isNotEmpty(redisProperties.getSentinel().getPassword())) {
|
||||||
@@ -133,7 +129,7 @@ public class RedisConfig extends CachingConfigurerSupport {
|
|||||||
ClusterServersConfig clusterServersConfig = config.useClusterServers();
|
ClusterServersConfig clusterServersConfig = config.useClusterServers();
|
||||||
List<String> clusterNodes = new ArrayList<>();
|
List<String> clusterNodes = new ArrayList<>();
|
||||||
for (String node : redisProperties.getCluster().getNodes()) {
|
for (String node : redisProperties.getCluster().getNodes()) {
|
||||||
clusterNodes.add("redis://" + node);
|
clusterNodes.add(REDIS_PREFIX + node);
|
||||||
}
|
}
|
||||||
clusterServersConfig.setNodeAddresses(clusterNodes);
|
clusterServersConfig.setNodeAddresses(clusterNodes);
|
||||||
if (CharSequenceUtil.isNotEmpty(redisProperties.getPassword())) {
|
if (CharSequenceUtil.isNotEmpty(redisProperties.getPassword())) {
|
||||||
@@ -141,10 +137,11 @@ public class RedisConfig extends CachingConfigurerSupport {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
SingleServerConfig singleServerConfig = config.useSingleServer();
|
SingleServerConfig singleServerConfig = config.useSingleServer();
|
||||||
singleServerConfig.setAddress("redis://" + redisProperties.getHost() + ":" + redisProperties.getPort());
|
singleServerConfig.setAddress(REDIS_PREFIX + redisProperties.getHost() + ":" + redisProperties.getPort());
|
||||||
if (CharSequenceUtil.isNotEmpty(redisProperties.getPassword())) {
|
if (CharSequenceUtil.isNotEmpty(redisProperties.getPassword())) {
|
||||||
singleServerConfig.setPassword(redisProperties.getPassword());
|
singleServerConfig.setPassword(redisProperties.getPassword());
|
||||||
}
|
}
|
||||||
|
singleServerConfig.setPingConnectionInterval(1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
return Redisson.create(config);
|
return Redisson.create(config);
|
||||||
|
|||||||
@@ -90,14 +90,13 @@ public class RedisCache implements Cache {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void vagueDel(Object key) {
|
public void vagueDel(Object key) {
|
||||||
Set<Object> keys = redisTemplate.keys(key + "*");
|
List keys = this.keys(key + "*");
|
||||||
redisTemplate.delete(keys);
|
redisTemplate.delete(keys);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void clear() {
|
public void clear() {
|
||||||
|
List keys = this.keys("*");
|
||||||
Set keys = redisTemplate.keys("*");
|
|
||||||
redisTemplate.delete(keys);
|
redisTemplate.delete(keys);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -133,8 +132,8 @@ public class RedisCache implements Cache {
|
|||||||
* @return 模糊匹配key
|
* @return 模糊匹配key
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<String> keys(String pattern) {
|
public List<Object> keys(String pattern) {
|
||||||
List<String> keys = new ArrayList<>();
|
List<Object> keys = new ArrayList<>();
|
||||||
this.scan(pattern, item -> {
|
this.scan(pattern, item -> {
|
||||||
//符合条件的key
|
//符合条件的key
|
||||||
String key = new String(item, StandardCharsets.UTF_8);
|
String key = new String(item, StandardCharsets.UTF_8);
|
||||||
@@ -143,6 +142,13 @@ public class RedisCache implements Cache {
|
|||||||
return keys;
|
return keys;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Object> keysBlock(String pattern) {
|
||||||
|
Set<Object> set = redisTemplate.keys(pattern);
|
||||||
|
List<Object> list = new ArrayList<>();
|
||||||
|
list.addAll(set);
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* scan 实现
|
* scan 实现
|
||||||
|
|||||||
@@ -45,21 +45,20 @@ public class LimitInterceptor {
|
|||||||
@Before("@annotation(limitPointAnnotation)")
|
@Before("@annotation(limitPointAnnotation)")
|
||||||
public void interceptor(LimitPoint limitPointAnnotation) {
|
public void interceptor(LimitPoint limitPointAnnotation) {
|
||||||
LimitTypeEnums limitTypeEnums = limitPointAnnotation.limitType();
|
LimitTypeEnums limitTypeEnums = limitPointAnnotation.limitType();
|
||||||
String name = limitPointAnnotation.name();
|
|
||||||
String key;
|
String key;
|
||||||
int limitPeriod = limitPointAnnotation.period();
|
int limitPeriod = limitPointAnnotation.period();
|
||||||
int limitCount = limitPointAnnotation.limit();
|
int limitCount = limitPointAnnotation.limit();
|
||||||
switch (limitTypeEnums) {
|
if (limitTypeEnums == LimitTypeEnums.CUSTOMER) {
|
||||||
case CUSTOMER:
|
key = limitPointAnnotation.key();
|
||||||
key = limitPointAnnotation.key();
|
} else {
|
||||||
break;
|
key = limitPointAnnotation.key() + IpUtils
|
||||||
default:
|
.getIpAddress(((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
|
||||||
key = limitPointAnnotation.key() + IpUtils
|
|
||||||
.getIpAddress(((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
|
|
||||||
}
|
}
|
||||||
ImmutableList<String> keys = ImmutableList.of(StringUtils.join(limitPointAnnotation.prefix(), key));
|
ImmutableList<String> keys = ImmutableList.of(StringUtils.join(limitPointAnnotation.prefix(), key));
|
||||||
try {
|
try {
|
||||||
Number count = redisTemplate.execute(limitScript, keys, limitCount, limitPeriod);
|
Number count = redisTemplate.execute(limitScript, keys, limitCount, limitPeriod);
|
||||||
|
assert count != null;
|
||||||
log.info("限制请求{}, 当前请求{},缓存key{}", limitCount, count.intValue(), key);
|
log.info("限制请求{}, 当前请求{},缓存key{}", limitCount, count.intValue(), key);
|
||||||
//如果缓存里没有值,或者他的值小于限制频率
|
//如果缓存里没有值,或者他的值小于限制频率
|
||||||
if (count.intValue() >= limitCount) {
|
if (count.intValue() >= limitCount) {
|
||||||
@@ -72,6 +71,7 @@ public class LimitInterceptor {
|
|||||||
} catch (ServiceException e) {
|
} catch (ServiceException e) {
|
||||||
throw e;
|
throw e;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
log.error("限流异常", e);
|
||||||
throw new ServiceException(ResultCode.ERROR);
|
throw new ServiceException(ResultCode.ERROR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,25 @@
|
|||||||
|
package cn.lili.common.aop.annotation;
|
||||||
|
|
||||||
|
import java.lang.annotation.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 异常重试注解
|
||||||
|
*
|
||||||
|
* @author paulG
|
||||||
|
* @since 2022/4/26
|
||||||
|
**/
|
||||||
|
@Target(ElementType.METHOD)
|
||||||
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
|
@Documented
|
||||||
|
@Inherited
|
||||||
|
public @interface RetryOperation {
|
||||||
|
/**
|
||||||
|
* 重试次数
|
||||||
|
*/
|
||||||
|
int retryCount() default 3;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 重试间隔
|
||||||
|
*/
|
||||||
|
int waitSeconds() default 10;
|
||||||
|
}
|
||||||
@@ -1,13 +1,5 @@
|
|||||||
package cn.lili.common.aop.interceptor;
|
package cn.lili.common.aop.interceptor;
|
||||||
|
|
||||||
/**
|
|
||||||
* 防重复提交业务
|
|
||||||
*
|
|
||||||
* @author Chopper
|
|
||||||
* @version v1.0
|
|
||||||
* 2022-01-25 09:20
|
|
||||||
*/
|
|
||||||
|
|
||||||
import cn.lili.cache.Cache;
|
import cn.lili.cache.Cache;
|
||||||
import cn.lili.common.aop.annotation.PreventDuplicateSubmissions;
|
import cn.lili.common.aop.annotation.PreventDuplicateSubmissions;
|
||||||
import cn.lili.common.enums.ResultCode;
|
import cn.lili.common.enums.ResultCode;
|
||||||
@@ -23,6 +15,13 @@ import org.springframework.web.context.request.ServletRequestAttributes;
|
|||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 防重复提交业务
|
||||||
|
*
|
||||||
|
* @author Chopper
|
||||||
|
* @version v1.0
|
||||||
|
* 2022-01-25 09:20
|
||||||
|
*/
|
||||||
@Aspect
|
@Aspect
|
||||||
@Component
|
@Component
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@@ -37,8 +36,8 @@ public class PreventDuplicateSubmissionsInterceptor {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
Long count = cache.incr(getParams(), preventDuplicateSubmissions.expire());
|
Long count = cache.incr(getParams(), preventDuplicateSubmissions.expire());
|
||||||
//如果超过1或者设置的参数,则表示重复提交了
|
//如果超过2或者设置的参数,则表示重复提交了
|
||||||
if (count.intValue() >= preventDuplicateSubmissions.expire()) {
|
if (count.intValue() >= 2) {
|
||||||
throw new ServiceException(ResultCode.LIMIT_ERROR);
|
throw new ServiceException(ResultCode.LIMIT_ERROR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -48,6 +47,7 @@ public class PreventDuplicateSubmissionsInterceptor {
|
|||||||
} catch (ServiceException e) {
|
} catch (ServiceException e) {
|
||||||
throw e;
|
throw e;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
log.error("防重复提交拦截器异常", e);
|
||||||
throw new ServiceException(ResultCode.ERROR);
|
throw new ServiceException(ResultCode.ERROR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,50 @@
|
|||||||
|
package cn.lili.common.aop.interceptor;
|
||||||
|
|
||||||
|
import cn.lili.common.aop.annotation.RetryOperation;
|
||||||
|
import cn.lili.common.exception.RetryException;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.aspectj.lang.ProceedingJoinPoint;
|
||||||
|
import org.aspectj.lang.annotation.Around;
|
||||||
|
import org.aspectj.lang.annotation.Aspect;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author paulG
|
||||||
|
* @since 2022/4/26
|
||||||
|
**/
|
||||||
|
@Aspect
|
||||||
|
@Component
|
||||||
|
@Slf4j
|
||||||
|
public class RetryAspect {
|
||||||
|
|
||||||
|
|
||||||
|
@Around(value = "@annotation(retryOperation)")
|
||||||
|
public Object retryOperation(ProceedingJoinPoint joinPoint, RetryOperation retryOperation) throws Throwable {
|
||||||
|
|
||||||
|
Object response = null;
|
||||||
|
int retryCount = retryOperation.retryCount();
|
||||||
|
int waitSeconds = retryOperation.waitSeconds();
|
||||||
|
boolean successful = false;
|
||||||
|
|
||||||
|
do {
|
||||||
|
try {
|
||||||
|
response = joinPoint.proceed();
|
||||||
|
successful = true;
|
||||||
|
} catch (RetryException ex) {
|
||||||
|
log.info("Operation failed, retries remaining: {}", retryCount);
|
||||||
|
retryCount--;
|
||||||
|
if (retryCount < 0) {
|
||||||
|
successful = true;
|
||||||
|
log.error(ex.getMessage());
|
||||||
|
}
|
||||||
|
if (waitSeconds > 0 && !successful) {
|
||||||
|
log.info("Waiting for {} second(s) before next retry", waitSeconds);
|
||||||
|
Thread.sleep(waitSeconds * 1000L);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} while (!successful);
|
||||||
|
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -40,6 +40,7 @@ public enum ResultCode {
|
|||||||
FILE_TYPE_NOT_SUPPORT(1010, "不支持上传的文件类型!"),
|
FILE_TYPE_NOT_SUPPORT(1010, "不支持上传的文件类型!"),
|
||||||
PLATFORM_NOT_SUPPORTED_IM(1006, "平台未开启IM"),
|
PLATFORM_NOT_SUPPORTED_IM(1006, "平台未开启IM"),
|
||||||
STORE_NOT_SUPPORTED_IM(1007, "店铺未开启IM"),
|
STORE_NOT_SUPPORTED_IM(1007, "店铺未开启IM"),
|
||||||
|
UNINITIALIZED_PASSWORD(1008, "非初始化密码,无法进行初始化设置"),
|
||||||
/**
|
/**
|
||||||
* 分类
|
* 分类
|
||||||
*/
|
*/
|
||||||
@@ -75,9 +76,14 @@ public enum ResultCode {
|
|||||||
GOODS_SKU_QUANTITY_ERROR(11011, "商品库存数量不能为负数"),
|
GOODS_SKU_QUANTITY_ERROR(11011, "商品库存数量不能为负数"),
|
||||||
GOODS_SKU_QUANTITY_NOT_ENOUGH(11011, "商品库存不足"),
|
GOODS_SKU_QUANTITY_NOT_ENOUGH(11011, "商品库存不足"),
|
||||||
MUST_HAVE_GOODS_SKU(11012, "规格必须要有一个!"),
|
MUST_HAVE_GOODS_SKU(11012, "规格必须要有一个!"),
|
||||||
|
MUST_HAVE_SALES_MODEL(11022, "销售模式为批发时必须要有批发规则!"),
|
||||||
|
|
||||||
|
HAVE_INVALID_SALES_MODEL(11023, "批发规则存在小于等于0的无效数据!"),
|
||||||
|
MUST_HAVE_GOODS_SKU_VALUE(11024, "规格值不能为空!"),
|
||||||
|
|
||||||
GOODS_PARAMS_ERROR(11013, "商品参数错误,刷新后重试"),
|
GOODS_PARAMS_ERROR(11013, "商品参数错误,刷新后重试"),
|
||||||
PHYSICAL_GOODS_NEED_TEMP(11014, "实物商品需选择配送模板"),
|
PHYSICAL_GOODS_NEED_TEMP(11014, "实物商品需选择配送模板"),
|
||||||
VIRTUAL_GOODS_NOT_NEED_TEMP(11015, "实物商品需选择配送模板"),
|
VIRTUAL_GOODS_NOT_NEED_TEMP(11015, "虚拟商品无需选择配送模板"),
|
||||||
GOODS_NOT_EXIST_STORE(11017, "当前用户无权操作此商品"),
|
GOODS_NOT_EXIST_STORE(11017, "当前用户无权操作此商品"),
|
||||||
GOODS_TYPE_ERROR(11016, "需选择商品类型"),
|
GOODS_TYPE_ERROR(11016, "需选择商品类型"),
|
||||||
|
|
||||||
@@ -132,7 +138,14 @@ public enum ResultCode {
|
|||||||
USER_CONNECT_BANDING_ERROR(20023, "当前联合登陆方式,已绑定其他账号,需进行解绑操作"),
|
USER_CONNECT_BANDING_ERROR(20023, "当前联合登陆方式,已绑定其他账号,需进行解绑操作"),
|
||||||
USER_CONNECT_NOT_EXIST_ERROR(20024, "暂无联合登陆信息,无法实现一键注册功能,请点击第三方登录进行授权"),
|
USER_CONNECT_NOT_EXIST_ERROR(20024, "暂无联合登陆信息,无法实现一键注册功能,请点击第三方登录进行授权"),
|
||||||
USER_POINTS_ERROR(20024, "用户积分不足"),
|
USER_POINTS_ERROR(20024, "用户积分不足"),
|
||||||
|
CLERK_SUPPER(20025, "店主无法操作"),
|
||||||
|
CLERK_SAVE_ERROR(20026, "店员保存失败"),
|
||||||
|
CLERK_NOT_FOUND_ERROR(20027, "店员不存在"),
|
||||||
|
USER_STATUS_ERROR(20028, "用户已禁用"),
|
||||||
|
CLERK_USER_ERROR(20029, "此账户已经绑定其他店铺"),
|
||||||
|
CLERK_ALREADY_EXIT_ERROR(20030, "店员已经存在"),
|
||||||
|
CLERK_DISABLED_ERROR(20031, "店员已禁用"),
|
||||||
|
CLERK_CURRENT_SUPPER(20032, "无法删除当前登录店员"),
|
||||||
/**
|
/**
|
||||||
* 权限
|
* 权限
|
||||||
*/
|
*/
|
||||||
@@ -141,6 +154,10 @@ public enum ResultCode {
|
|||||||
PERMISSION_MENU_ROLE_ERROR(21003, "菜单已绑定角色,请先删除或编辑角色"),
|
PERMISSION_MENU_ROLE_ERROR(21003, "菜单已绑定角色,请先删除或编辑角色"),
|
||||||
PERMISSION_DEPARTMENT_DELETE_ERROR(21004, "部门已经绑定管理员,请先删除或编辑管理员"),
|
PERMISSION_DEPARTMENT_DELETE_ERROR(21004, "部门已经绑定管理员,请先删除或编辑管理员"),
|
||||||
PERMISSION_BEYOND_TEN(21005, "最多可以设置10个角色"),
|
PERMISSION_BEYOND_TEN(21005, "最多可以设置10个角色"),
|
||||||
|
PERMISSION_NOT_FOUND_ERROR(21006, "部门不存在"),
|
||||||
|
PERMISSION_ROLE_NOT_FOUND_ERROR(21007, "角色不存在"),
|
||||||
|
PERMISSION_CLERK_BAND_ERROR(21008, "此手机号码已绑定其他店铺 "),
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分销
|
* 分销
|
||||||
@@ -176,6 +193,7 @@ public enum ResultCode {
|
|||||||
MEMBER_ADDRESS_NOT_EXIST(31009, "订单无收货地址,请先配置收货地址"),
|
MEMBER_ADDRESS_NOT_EXIST(31009, "订单无收货地址,请先配置收货地址"),
|
||||||
ORDER_DELIVER_NUM_ERROR(31010, "没有待发货的订单"),
|
ORDER_DELIVER_NUM_ERROR(31010, "没有待发货的订单"),
|
||||||
ORDER_NOT_SUPPORT_DISTRIBUTION(31011, "购物车中包含不支持配送的商品,请重新选择收货地址,或者重新选择商品"),
|
ORDER_NOT_SUPPORT_DISTRIBUTION(31011, "购物车中包含不支持配送的商品,请重新选择收货地址,或者重新选择商品"),
|
||||||
|
ORDER_NOT_EXIST_VALID(31041, "购物车中无有效商品,请检查购物车内商品,或者重新选择商品"),
|
||||||
ORDER_CAN_NOT_CANCEL(31012, "当前订单状态不可取消"),
|
ORDER_CAN_NOT_CANCEL(31012, "当前订单状态不可取消"),
|
||||||
ORDER_BATCH_DELIVER_ERROR(31013, "批量发货,文件读取失败"),
|
ORDER_BATCH_DELIVER_ERROR(31013, "批量发货,文件读取失败"),
|
||||||
ORDER_ITEM_NOT_EXIST(31014, "当前订单项不存在!"),
|
ORDER_ITEM_NOT_EXIST(31014, "当前订单项不存在!"),
|
||||||
@@ -246,6 +264,8 @@ public enum ResultCode {
|
|||||||
* 活动
|
* 活动
|
||||||
*/
|
*/
|
||||||
PROMOTION_GOODS_NOT_EXIT(40000, "当前促销商品不存在!"),
|
PROMOTION_GOODS_NOT_EXIT(40000, "当前促销商品不存在!"),
|
||||||
|
PROMOTION_GOODS_QUANTITY_NOT_EXIT(40020, "当前促销商品库存不足!"),
|
||||||
|
PROMOTION_GOODS_DO_NOT_JOIN_WHOLESALE(40050, "批发商品无法参加促销"),
|
||||||
PROMOTION_SAME_ACTIVE_EXIST(40001, "活动时间内已存在同类活动,请选择关闭、删除当前时段的活动"),
|
PROMOTION_SAME_ACTIVE_EXIST(40001, "活动时间内已存在同类活动,请选择关闭、删除当前时段的活动"),
|
||||||
PROMOTION_START_TIME_ERROR(40002, "活动起始时间不能小于当前时间"),
|
PROMOTION_START_TIME_ERROR(40002, "活动起始时间不能小于当前时间"),
|
||||||
PROMOTION_END_TIME_ERROR(40003, "活动结束时间不能小于当前时间"),
|
PROMOTION_END_TIME_ERROR(40003, "活动结束时间不能小于当前时间"),
|
||||||
@@ -270,11 +290,6 @@ public enum ResultCode {
|
|||||||
COUPON_RECEIVE_ERROR(41005, "当前优惠券已经被领取完了,下次要早点来哦"),
|
COUPON_RECEIVE_ERROR(41005, "当前优惠券已经被领取完了,下次要早点来哦"),
|
||||||
COUPON_NUM_INSUFFICIENT_ERROR(41006, "优惠券剩余领取数量不足"),
|
COUPON_NUM_INSUFFICIENT_ERROR(41006, "优惠券剩余领取数量不足"),
|
||||||
COUPON_NOT_EXIST(41007, "当前优惠券不存在"),
|
COUPON_NOT_EXIST(41007, "当前优惠券不存在"),
|
||||||
COUPON_DO_NOT_RECEIVER(41030, "当前优惠券不允许主动领取"),
|
|
||||||
COUPON_ACTIVITY_NOT_EXIST(410022, "当前优惠券活动不存在"),
|
|
||||||
COUPON_SAVE_ERROR(41020, "保存优惠券失败"),
|
|
||||||
COUPON_ACTIVITY_SAVE_ERROR(41023, "保存优惠券活动失败"),
|
|
||||||
COUPON_DELETE_ERROR(41021, "删除优惠券失败"),
|
|
||||||
COUPON_LIMIT_NUM_LESS_THAN_0(41008, "领取限制数量不能为负数"),
|
COUPON_LIMIT_NUM_LESS_THAN_0(41008, "领取限制数量不能为负数"),
|
||||||
COUPON_LIMIT_GREATER_THAN_PUBLISH(41009, "领取限制数量超出发行数量"),
|
COUPON_LIMIT_GREATER_THAN_PUBLISH(41009, "领取限制数量超出发行数量"),
|
||||||
COUPON_DISCOUNT_ERROR(41010, "优惠券折扣必须小于10且大于0"),
|
COUPON_DISCOUNT_ERROR(41010, "优惠券折扣必须小于10且大于0"),
|
||||||
@@ -285,6 +300,15 @@ public enum ResultCode {
|
|||||||
COUPON_MEMBER_NOT_EXIST(41015, "没有当前会员优惠券"),
|
COUPON_MEMBER_NOT_EXIST(41015, "没有当前会员优惠券"),
|
||||||
COUPON_MEMBER_STATUS_ERROR(41016, "当前会员优惠券已过期/作废无法变更状态!"),
|
COUPON_MEMBER_STATUS_ERROR(41016, "当前会员优惠券已过期/作废无法变更状态!"),
|
||||||
|
|
||||||
|
SPECIAL_CANT_USE(41019, "特殊商品不能使用优惠券,不能使用"),
|
||||||
|
|
||||||
|
COUPON_SAVE_ERROR(41020, "保存优惠券失败"),
|
||||||
|
COUPON_DELETE_ERROR(41021, "删除优惠券失败"),
|
||||||
|
COUPON_ACTIVITY_NOT_EXIST(41022, "当前优惠券活动不存在"),
|
||||||
|
COUPON_ACTIVITY_SAVE_ERROR(41023, "保存优惠券活动失败"),
|
||||||
|
COUPON_ACTIVITY_MAX_NUM(41024, "优惠券活动赠券数量最多为3"),
|
||||||
|
|
||||||
|
COUPON_DO_NOT_RECEIVER(41030, "当前优惠券不允许主动领取"),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 拼团
|
* 拼团
|
||||||
@@ -377,7 +401,7 @@ public enum ResultCode {
|
|||||||
|
|
||||||
STORE_NOT_EXIST(50001, "此店铺不存在"),
|
STORE_NOT_EXIST(50001, "此店铺不存在"),
|
||||||
STORE_NAME_EXIST_ERROR(50002, "店铺名称已存在!"),
|
STORE_NAME_EXIST_ERROR(50002, "店铺名称已存在!"),
|
||||||
STORE_APPLY_DOUBLE_ERROR(50003, "已有店铺,无需重复申请!"),
|
STORE_APPLY_DOUBLE_ERROR(50003, "已经拥有店铺!"),
|
||||||
STORE_NOT_OPEN(50004, "该会员未开通店铺"),
|
STORE_NOT_OPEN(50004, "该会员未开通店铺"),
|
||||||
STORE_NOT_LOGIN_ERROR(50005, "未登录店铺"),
|
STORE_NOT_LOGIN_ERROR(50005, "未登录店铺"),
|
||||||
STORE_CLOSE_ERROR(50006, "店铺关闭,请联系管理员"),
|
STORE_CLOSE_ERROR(50006, "店铺关闭,请联系管理员"),
|
||||||
|
|||||||
@@ -0,0 +1,32 @@
|
|||||||
|
package cn.lili.common.event;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import org.springframework.context.ApplicationEvent;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 事务提交后发生mq事件
|
||||||
|
*
|
||||||
|
* @author paulG
|
||||||
|
* @since 2022/1/19
|
||||||
|
**/
|
||||||
|
public class TransactionCommitSendMQEvent extends ApplicationEvent {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 5885956821347953071L;
|
||||||
|
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
private final String topic;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
private final String tag;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
private final Object message;
|
||||||
|
|
||||||
|
public TransactionCommitSendMQEvent(Object source, String topic, String tag, Object message) {
|
||||||
|
super(source);
|
||||||
|
this.topic = topic;
|
||||||
|
this.tag = tag;
|
||||||
|
this.message = message;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -18,7 +18,7 @@ import javax.validation.ConstraintViolationException;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 全局异常异常处理
|
* 异常处理
|
||||||
*
|
*
|
||||||
* @author Chopper
|
* @author Chopper
|
||||||
*/
|
*/
|
||||||
@@ -74,6 +74,15 @@ public class GlobalControllerExceptionHandler {
|
|||||||
}
|
}
|
||||||
return ResultUtil.error(ResultCode.ERROR.code(), errorMsg);
|
return ResultUtil.error(ResultCode.ERROR.code(), errorMsg);
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
|
@ExceptionHandler(ConstraintViolationException.class)
|
||||||
|
@ResponseStatus(value = HttpStatus.BAD_REQUEST)
|
||||||
|
public ResultMessage<Object> constraintExceptionHandler(HttpServletRequest request, final Exception e, HttpServletResponse response) {
|
||||||
|
|
||||||
|
log.error("全局异常[RuntimeException]:", e);
|
||||||
|
|
||||||
|
return ResultUtil.error(001, e.getMessage());
|
||||||
|
}*/
|
||||||
|
|
||||||
@ExceptionHandler(RuntimeException.class)
|
@ExceptionHandler(RuntimeException.class)
|
||||||
@ResponseStatus(value = HttpStatus.BAD_REQUEST)
|
@ResponseStatus(value = HttpStatus.BAD_REQUEST)
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package cn.lili.common.exception;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 如需异常重试,则抛出此异常
|
||||||
|
*
|
||||||
|
* @author paulG
|
||||||
|
* @since 2022/4/26
|
||||||
|
**/
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Data
|
||||||
|
public class RetryException extends RuntimeException {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 7886918292771470846L;
|
||||||
|
|
||||||
|
public RetryException(String message) {
|
||||||
|
super(message);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
package cn.lili.common.fulu.core;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Auther: chenYing
|
||||||
|
* @Date: 2019/8/26 0026 15:08
|
||||||
|
*/
|
||||||
|
public interface MethodConst {
|
||||||
|
//卡密下单接口method方法
|
||||||
|
String OPEN_API_CARD_ORDER_ADD = "fulu.order.card.add";
|
||||||
|
// 根据话费查询归属地和城市编码,面值,城市等信息
|
||||||
|
String OPEN_API_CHECK_PHONE = "fulu.mobile.info.get";
|
||||||
|
// 直充下单接口method方法
|
||||||
|
String OPEN_API_DIRECT_ORDER_ADD = "fulu.order.direct.add";
|
||||||
|
// 获取商品信息接口method方法
|
||||||
|
String OPEN_API_GOODS_GET = "fulu.goods.info.get";
|
||||||
|
// 获取商品模板信息接口method方法
|
||||||
|
String OPEN_API_GOODS_TEMPLATE_GET = "fulu.goods.template.get";
|
||||||
|
// 查单接口method方法
|
||||||
|
String OPEN_API_ORDER_GET = "fulu.order.info.get";
|
||||||
|
// 话费下单接口method方法
|
||||||
|
String OPEN_API_PHONE_ORDER_ADD = "fulu.order.mobile.add";
|
||||||
|
// 流量下单接口method方法
|
||||||
|
String OPEN_API_TRAFFIC_ORDER_ADD = "fulu.order.data.add";
|
||||||
|
// 获取用户信息接口method方法
|
||||||
|
String OPEN_API_USER_INFO_GET = "fulu.user.info.get";
|
||||||
|
//获取商品列表method方法
|
||||||
|
String OPEN_API_GOODS_LIST = "fulu.goods.list.get";
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
package cn.lili.common.fulu.core.http;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.lili.common.fulu.core.utils.HttpUtil;
|
||||||
|
|
||||||
|
import java.util.concurrent.Callable;
|
||||||
|
import java.util.concurrent.ExecutorService;
|
||||||
|
import java.util.concurrent.Executors;
|
||||||
|
import java.util.concurrent.Future;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Auther: chenYing
|
||||||
|
* @Date: 2019/8/19 0019 16:16
|
||||||
|
*/
|
||||||
|
public class FuluClient implements IFuluClient {
|
||||||
|
private static volatile ExecutorService executor;
|
||||||
|
private String url;
|
||||||
|
|
||||||
|
public FuluClient() {
|
||||||
|
this.url = "http://openapi.fulu.com/api/getway";
|
||||||
|
}
|
||||||
|
|
||||||
|
public FuluClient(String url) {
|
||||||
|
this.url = url;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建线程池
|
||||||
|
*/
|
||||||
|
private static void createThreadPool() {
|
||||||
|
if (executor == null) {
|
||||||
|
synchronized (FuluClient.class) {
|
||||||
|
if (executor == null) {
|
||||||
|
executor = Executors.newCachedThreadPool();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String send(final String postData) {
|
||||||
|
String result = HttpUtil.sendPostJson(this.url, postData);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Future<String> sendAsync(final String postData) {
|
||||||
|
createThreadPool();
|
||||||
|
return executor.submit(new Callable<String>() {
|
||||||
|
@Override
|
||||||
|
public String call() throws Exception {
|
||||||
|
String result = HttpUtil.sendPostJson(url, postData);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package cn.lili.common.fulu.core.http;
|
||||||
|
|
||||||
|
import java.util.concurrent.Future;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Auther: chenYing
|
||||||
|
* @Date: 2019/8/19 0019 16:15
|
||||||
|
*/
|
||||||
|
public interface IFuluClient {
|
||||||
|
/**
|
||||||
|
* 同步请求openapi2.0
|
||||||
|
*
|
||||||
|
* @param postData
|
||||||
|
* @return String
|
||||||
|
*/
|
||||||
|
String send(final String postData);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 异步请求openapi2.0
|
||||||
|
*
|
||||||
|
* @param postData
|
||||||
|
* @return Future<String>
|
||||||
|
*/
|
||||||
|
Future<String> sendAsync(final String postData);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
package cn.lili.common.fulu.core.utils;
|
||||||
|
|
||||||
|
import javax.crypto.Cipher;
|
||||||
|
import javax.crypto.spec.SecretKeySpec;
|
||||||
|
import java.security.Security;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Auther: chenYing
|
||||||
|
* @Date: 2019/8/27 0027 17:38
|
||||||
|
*/
|
||||||
|
public class CardUtil {
|
||||||
|
private static final String ALGORITHM = "AES/ECB/PKCS7Padding";
|
||||||
|
|
||||||
|
|
||||||
|
private CardUtil() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String cardDecode(String str, byte[] key) {
|
||||||
|
byte[] bytes = org.apache.commons.codec.binary.Base64.decodeBase64(str);
|
||||||
|
String result = null;
|
||||||
|
try {
|
||||||
|
Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider());
|
||||||
|
Cipher cipher = Cipher.getInstance(ALGORITHM, "BC");
|
||||||
|
SecretKeySpec keySpec = new SecretKeySpec(key, "AES");
|
||||||
|
cipher.init(Cipher.DECRYPT_MODE, keySpec);
|
||||||
|
byte[] decoded = cipher.doFinal(bytes);
|
||||||
|
result = new String(decoded, "UTF-8");
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new RuntimeException(e.getMessage(), e);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String cardEncode(String str, byte[] key) {
|
||||||
|
byte[] result = null;
|
||||||
|
try {
|
||||||
|
Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider());
|
||||||
|
Cipher cipher = Cipher.getInstance(ALGORITHM, "BC");
|
||||||
|
SecretKeySpec keySpec = new SecretKeySpec(key, "AES");
|
||||||
|
cipher.init(Cipher.ENCRYPT_MODE, keySpec);
|
||||||
|
result = cipher.doFinal(str.getBytes("UTF-8"));
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new RuntimeException(e.getMessage(), e);
|
||||||
|
}
|
||||||
|
return new String(org.apache.commons.codec.binary.Base64.encodeBase64(result));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package cn.lili.common.fulu.core.utils;
|
||||||
|
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Auther: chenYing
|
||||||
|
* @Date: 2019/8/19 0019 15:17
|
||||||
|
*/
|
||||||
|
public class DateFormatUtil {
|
||||||
|
private static final String DATE_FORMAT = "yyyy-MM-dd HH:mm:ss";
|
||||||
|
|
||||||
|
private DateFormatUtil() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String currentDateTime() {
|
||||||
|
return new SimpleDateFormat(DATE_FORMAT).format(new Date());
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,206 @@
|
|||||||
|
package cn.lili.common.fulu.core.utils;
|
||||||
|
|
||||||
|
|
||||||
|
import org.apache.http.HttpResponse;
|
||||||
|
import org.apache.http.NameValuePair;
|
||||||
|
import org.apache.http.client.HttpClient;
|
||||||
|
import org.apache.http.client.entity.UrlEncodedFormEntity;
|
||||||
|
import org.apache.http.client.methods.HttpPost;
|
||||||
|
import org.apache.http.impl.client.DefaultHttpClient;
|
||||||
|
import org.apache.http.message.BasicNameValuePair;
|
||||||
|
import org.apache.http.protocol.HTTP;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import java.io.BufferedReader;
|
||||||
|
import java.io.InputStreamReader;
|
||||||
|
import java.io.PrintWriter;
|
||||||
|
import java.net.*;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author cheny
|
||||||
|
*/
|
||||||
|
public class HttpUtil {
|
||||||
|
private static Logger log = LoggerFactory.getLogger(HttpUtil.class);
|
||||||
|
|
||||||
|
public final static int CONNECT_TIMEOUT = 10000;
|
||||||
|
public final static int READ_TIMEOUT = 10000;
|
||||||
|
|
||||||
|
private static final String ENCODING_GBK = "GBK";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* POST请求,json字符串形式数据
|
||||||
|
*
|
||||||
|
* @param url 请求地址
|
||||||
|
* @param param 请求的json数据
|
||||||
|
* @return response body
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public static String sendPostJson(String url, String param) {
|
||||||
|
return sendPostWithHeads(url, param, "application/json", null);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static String sendPostWithHeads(String url, String param, String contentType, Map<String, String> heads) {
|
||||||
|
PrintWriter out = null;
|
||||||
|
BufferedReader in = null;
|
||||||
|
StringBuilder result = new StringBuilder();
|
||||||
|
HttpURLConnection conn = null;
|
||||||
|
|
||||||
|
try {
|
||||||
|
URL realUrl = new URL(url);
|
||||||
|
// 打开和URL之间的连接
|
||||||
|
conn = (HttpURLConnection) realUrl.openConnection();
|
||||||
|
// 设置通用的请求属性
|
||||||
|
conn.setRequestMethod("POST");// 提交模式
|
||||||
|
conn.setConnectTimeout(CONNECT_TIMEOUT);// 连接超时 单位毫秒
|
||||||
|
conn.setReadTimeout(READ_TIMEOUT);// 读取超时 单位毫秒
|
||||||
|
if (contentType != null && !contentType.isEmpty()) {
|
||||||
|
conn.setRequestProperty("Content-Type", contentType);
|
||||||
|
}
|
||||||
|
conn.setRequestProperty("accept", "*/*");
|
||||||
|
conn.setRequestProperty("connection", "Keep-Alive");
|
||||||
|
conn.setRequestProperty("user-agent",
|
||||||
|
"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36");
|
||||||
|
|
||||||
|
// 添加头信息
|
||||||
|
if (heads != null && !heads.isEmpty()) {
|
||||||
|
for (String key : heads.keySet()) {
|
||||||
|
conn.setRequestProperty(key, heads.get(key));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 发送POST请求必须设置如下两行
|
||||||
|
conn.setDoOutput(true);
|
||||||
|
conn.setDoInput(true);
|
||||||
|
// 获取URLConnection对象对应的输出流
|
||||||
|
out = new PrintWriter(conn.getOutputStream());
|
||||||
|
// 发送请求参数
|
||||||
|
out.print(param);
|
||||||
|
// flush输出流的缓冲
|
||||||
|
out.flush();
|
||||||
|
// 定义BufferedReader输入流来读取URL的响应
|
||||||
|
in = new BufferedReader(new InputStreamReader(conn.getInputStream(), "UTF-8"));
|
||||||
|
String line;
|
||||||
|
while ((line = in.readLine()) != null) {
|
||||||
|
result.append(line);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
throw new RuntimeException("send POST request exception :" + e.getMessage(), e);
|
||||||
|
} finally {
|
||||||
|
try {
|
||||||
|
if (out != null) {
|
||||||
|
out.close();
|
||||||
|
}
|
||||||
|
if (in != null) {
|
||||||
|
in.close();
|
||||||
|
}
|
||||||
|
if (conn != null) {
|
||||||
|
conn.disconnect();
|
||||||
|
}
|
||||||
|
} catch (Exception e2) {
|
||||||
|
throw new RuntimeException("close Connection exception :" + e2.getMessage(), e2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* POST请求,String字符串形式数据
|
||||||
|
*
|
||||||
|
* @param url
|
||||||
|
* @param paramXmlStr
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static String sendPostXmlStr(String url, String paramXmlStr) {
|
||||||
|
String tmpparamXmlStr = "";
|
||||||
|
try {
|
||||||
|
tmpparamXmlStr = URLEncoder.encode(paramXmlStr, ENCODING_GBK);
|
||||||
|
tmpparamXmlStr = sendPostWithHeads(url, tmpparamXmlStr, "application/xml", null);
|
||||||
|
tmpparamXmlStr = URLDecoder.decode(tmpparamXmlStr,ENCODING_GBK);
|
||||||
|
|
||||||
|
}catch (Exception e){
|
||||||
|
e.printStackTrace();
|
||||||
|
log.error("post请求URL数据转码报错,{}", e.getMessage());
|
||||||
|
}
|
||||||
|
return tmpparamXmlStr;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* POST请求,String字符串形式数据
|
||||||
|
*
|
||||||
|
* @param url
|
||||||
|
* @param paramXmlStr
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static String sendPostXmlUrlencode(String url, String paramXmlStr) {
|
||||||
|
String tmpparamXmlStr = "";
|
||||||
|
Map<String, String> rspMap = new LinkedHashMap<>();
|
||||||
|
rspMap.put("req", paramXmlStr);
|
||||||
|
|
||||||
|
try {
|
||||||
|
tmpparamXmlStr = URLEncoder.encode(paramXmlStr, ENCODING_GBK);
|
||||||
|
tmpparamXmlStr = doPostMapParams(url, rspMap);
|
||||||
|
tmpparamXmlStr = URLDecoder.decode(tmpparamXmlStr,ENCODING_GBK);
|
||||||
|
}catch (Exception e){
|
||||||
|
e.printStackTrace();
|
||||||
|
log.error("post请求URL数据转码报错,{}", e.getMessage());
|
||||||
|
}
|
||||||
|
return tmpparamXmlStr;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发送POST请求
|
||||||
|
* @param url String对象为 目的地址
|
||||||
|
* @param parameters 请求参数,Map类型。
|
||||||
|
* @return 远程响应结果
|
||||||
|
*/
|
||||||
|
public static String doPostMapParams(String url, Map<String, String> parameters) {
|
||||||
|
|
||||||
|
BufferedReader in = null;
|
||||||
|
try {
|
||||||
|
// 定义HttpClient
|
||||||
|
HttpClient client = new DefaultHttpClient();
|
||||||
|
// 实例化HTTP方法
|
||||||
|
HttpPost request = new HttpPost();
|
||||||
|
request.setURI(new URI(url));
|
||||||
|
|
||||||
|
//设置参数
|
||||||
|
List<NameValuePair> nvps = new ArrayList<NameValuePair>();
|
||||||
|
for (Iterator iter = parameters.keySet().iterator(); iter.hasNext();) {
|
||||||
|
String name = (String) iter.next();
|
||||||
|
String value = String.valueOf(parameters.get(name));
|
||||||
|
nvps.add(new BasicNameValuePair(name, value));
|
||||||
|
}
|
||||||
|
request.setEntity(new UrlEncodedFormEntity(nvps, HTTP.UTF_8));
|
||||||
|
|
||||||
|
HttpResponse response = client.execute(request);
|
||||||
|
int code = response.getStatusLine().getStatusCode();
|
||||||
|
if(code == 200){ //请求成功
|
||||||
|
in = new BufferedReader(new InputStreamReader(response.getEntity()
|
||||||
|
.getContent(),"UTF-8"));
|
||||||
|
StringBuffer sb = new StringBuffer("");
|
||||||
|
String line = "";
|
||||||
|
String NL = System.getProperty("line.separator");
|
||||||
|
while ((line = in.readLine()) != null) {
|
||||||
|
sb.append(line + NL);
|
||||||
|
}
|
||||||
|
|
||||||
|
in.close();
|
||||||
|
return sb.toString();
|
||||||
|
}else{
|
||||||
|
System.out.println("状态码:" + code);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch(Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
package cn.lili.common.fulu.core.utils;
|
||||||
|
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
import com.google.gson.reflect.TypeToken;
|
||||||
|
|
||||||
|
public class JSONUtil {
|
||||||
|
private static Gson gson = new Gson();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将 JSON 字符串转为 Java 对象
|
||||||
|
*/
|
||||||
|
public static <T> T fromJSON(String json, Class<T> type) {
|
||||||
|
T obj;
|
||||||
|
try {
|
||||||
|
obj = gson.fromJson(json, type);
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
return obj;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* json字符串转list或者map
|
||||||
|
*/
|
||||||
|
public static <T> T fromJSON(String json, TypeToken<T> typeToken) {
|
||||||
|
return gson.fromJson(json, typeToken.getType());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将 Java 对象转为 JSON 字符串
|
||||||
|
*/
|
||||||
|
public static <T> String toJSON(T obj) {
|
||||||
|
String jsonStr;
|
||||||
|
try {
|
||||||
|
jsonStr = gson.toJson(obj);
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
return jsonStr;
|
||||||
|
}
|
||||||
|
}
|
||||||
342
framework/src/main/java/cn/lili/common/fulu/core/utils/Test.java
Normal file
342
framework/src/main/java/cn/lili/common/fulu/core/utils/Test.java
Normal file
@@ -0,0 +1,342 @@
|
|||||||
|
package cn.lili.common.fulu.core.utils;
|
||||||
|
|
||||||
|
import cn.lili.common.fulu.core.MethodConst;
|
||||||
|
import cn.lili.common.fulu.model.*;
|
||||||
|
import cn.lili.common.fulu.sdk.DefaultOpenApiClient;
|
||||||
|
import cn.lili.modules.store.entity.dto.FuLuConfigureDTO;
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.google.gson.reflect.TypeToken;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.concurrent.*;
|
||||||
|
|
||||||
|
public class Test {
|
||||||
|
private final static String APP_KEY = "lzHi7ewuTkplx2ePX0eQzN65TIFRk1zFClcoj1Jim/MHmu0X7ZqxMtSLENhvr1xD";
|
||||||
|
private final static Logger LOGGER = LoggerFactory.getLogger(Test.class);
|
||||||
|
private final static String SYS_SECRET = "9da68b0f8bcb470e84c3d30e343727e2";
|
||||||
|
private final static String URL = "http://openapi.fulu.com/api/getway";
|
||||||
|
|
||||||
|
// private final static String APP_KEY = "i4esv1l+76l/7NQCL3QudG90Fq+YgVfFGJAWgT+7qO1Bm9o/adG/1iwO2qXsAXNB";
|
||||||
|
// private final static Logger LOGGER = LoggerFactory.getLogger(Test.class);
|
||||||
|
// private final static String SYS_SECRET = "0a091b3aa4324435aab703142518a8f7";
|
||||||
|
// private final static String URL = "http://pre.openapi.fulu.com/api/getway";
|
||||||
|
|
||||||
|
private static String repeat(String ch, int num) {
|
||||||
|
StringBuilder str = new StringBuilder();
|
||||||
|
for (int i = 0; i < num; i++) {
|
||||||
|
str.append(ch);
|
||||||
|
}
|
||||||
|
return str.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void waitFor(Future<String> future) throws Exception {
|
||||||
|
while (!future.isDone()) {
|
||||||
|
TimeUnit.MILLISECONDS.sleep(500);
|
||||||
|
}
|
||||||
|
LOGGER.info("excuteAsync:\n{}", future.get());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 卡密下单
|
||||||
|
*
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public static void cardOrderAddTest(FuLuConfigureDTO fuLuConfigureDTO, Integer productId, Integer buyNum,String orderSn) throws Exception {
|
||||||
|
LOGGER.info("\n卡密下单{}", repeat("=", 100));
|
||||||
|
DefaultOpenApiClient client =
|
||||||
|
new DefaultOpenApiClient(URL, fuLuConfigureDTO.getAppMerchantKey(), fuLuConfigureDTO.getAppSecretKey(), MethodConst.OPEN_API_CARD_ORDER_ADD);
|
||||||
|
InputCardOrderDto dto = new InputCardOrderDto();
|
||||||
|
dto.setProductId(productId);
|
||||||
|
dto.setCustomerOrderNo(orderSn);
|
||||||
|
dto.setBuyNum(buyNum);
|
||||||
|
|
||||||
|
client.setBizObject(dto);
|
||||||
|
LOGGER.info("excute:\n{}\n{}", client.excute(), repeat("-", 100));
|
||||||
|
dto.setCustomerOrderNo(UUID.randomUUID().toString());
|
||||||
|
waitFor(client.excuteAsync());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 直充下单
|
||||||
|
*
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public static void directOrderAddTest(FuLuConfigureDTO fuLuConfigureDTO, Integer productId, Integer buyNum,String qrCode,String orderSn) throws Exception {
|
||||||
|
LOGGER.info("\n直充下单{}", repeat("=", 100));
|
||||||
|
DefaultOpenApiClient client =
|
||||||
|
new DefaultOpenApiClient(URL, fuLuConfigureDTO.getAppMerchantKey(), fuLuConfigureDTO.getAppSecretKey(), MethodConst.OPEN_API_DIRECT_ORDER_ADD);
|
||||||
|
InputDirectOrderDto dto = new InputDirectOrderDto();
|
||||||
|
dto.setProductId(productId);
|
||||||
|
dto.setBuyNum(buyNum);
|
||||||
|
client.setBizObject(dto);
|
||||||
|
int count = 1;
|
||||||
|
|
||||||
|
for (String chargeAccount : Arrays.asList(qrCode)) {
|
||||||
|
dto.setChargeAccount(chargeAccount);
|
||||||
|
dto.setCustomerOrderNo(orderSn);
|
||||||
|
|
||||||
|
LOGGER.info("excute:\n{}\n{}", client.excute(), repeat("-", 100));
|
||||||
|
if (count++ >= 3) {
|
||||||
|
waitFor(client.excuteAsync());
|
||||||
|
} else {
|
||||||
|
LOGGER.info("excuteAsync:\n{}\n{}", client.excuteAsync().get(), repeat("-", 100));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手机号归属地
|
||||||
|
*
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public void matchPhoneProducGetTest(FuLuConfigureDTO fuLuConfigureDTO) throws Exception {
|
||||||
|
LOGGER.info("\n手机号归属地{}", repeat("=", 100));
|
||||||
|
DefaultOpenApiClient client = new DefaultOpenApiClient(URL, fuLuConfigureDTO.getAppMerchantKey(), fuLuConfigureDTO.getAppSecretKey(), MethodConst.OPEN_API_CHECK_PHONE);
|
||||||
|
InputMatchPhoneProductListDto dto = new InputMatchPhoneProductListDto();
|
||||||
|
dto.setFaceValue(50D);
|
||||||
|
|
||||||
|
int count = 1;
|
||||||
|
for (String phone : Arrays.asList("15972368779", "13971553804")) {
|
||||||
|
dto.setPhone(phone);
|
||||||
|
|
||||||
|
client.setBizObject(dto);
|
||||||
|
|
||||||
|
LOGGER.info("excute:\n{}\n{}", client.excute(), repeat("-", 100));
|
||||||
|
if (count++ >= 2) {
|
||||||
|
waitFor(client.excuteAsync());
|
||||||
|
} else {
|
||||||
|
LOGGER.info("excuteAsync:\n{}\n{}", client.excuteAsync().get(), repeat("-", 100));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单查单
|
||||||
|
*
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public void orderInfoGetTest(FuLuConfigureDTO fuLuConfigureDTO) throws Exception {
|
||||||
|
LOGGER.info("\n订单查单{}", repeat("=", 100));
|
||||||
|
DefaultOpenApiClient client = new DefaultOpenApiClient(URL, fuLuConfigureDTO.getAppMerchantKey(), fuLuConfigureDTO.getAppSecretKey(), MethodConst.OPEN_API_ORDER_GET);
|
||||||
|
InputOrderGetDto dto = new InputOrderGetDto();
|
||||||
|
client.setBizObject(dto);
|
||||||
|
int count = 1;
|
||||||
|
|
||||||
|
for (String customerOrderNo : Arrays
|
||||||
|
.asList("0d19f8e4-5af3-490d-a8d8-47fd457da7de", "31b6b96b-a21e-4bc4-bc0c-6e77a2ffb698")) {
|
||||||
|
dto.setCustomerOrderNo(customerOrderNo);
|
||||||
|
|
||||||
|
LOGGER.info("excute:\n{}\n{}", client.excute(), repeat("-", 100));
|
||||||
|
if (count++ >= 2) {
|
||||||
|
Future<String> future = client.excuteAsync();
|
||||||
|
waitFor(future);
|
||||||
|
Map<String, String> result = JSONUtil.fromJSON(future.get(), new TypeToken<Map>() {
|
||||||
|
});
|
||||||
|
Map<String, Object> resultMap = JSONUtil.fromJSON(result.get("result"), new TypeToken<Map<String, Object>>() {
|
||||||
|
});
|
||||||
|
|
||||||
|
List<Map<String, String>> cardList = (List<Map<String, String>>) resultMap.get("cards");
|
||||||
|
StringBuilder decodeStr = new StringBuilder();
|
||||||
|
for (Map<String, String> map : cardList) {
|
||||||
|
decodeStr.append("card_number:").append(map.get("card_number")).append(";desc_card_number:")
|
||||||
|
.append(CardUtil.cardDecode(map.get("card_number"), SYS_SECRET.getBytes("UTF-8")));
|
||||||
|
decodeStr.append(" card_pwd:").append(map.get("card_pwd")).append(";card_pwd:")
|
||||||
|
.append(CardUtil.cardDecode(map.get("card_pwd"), SYS_SECRET.getBytes("UTF-8")));
|
||||||
|
decodeStr.append("\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
System.out.println(decodeStr.toString());
|
||||||
|
System.out.println(CardUtil.cardEncode("CD10002502019061217430016421", SYS_SECRET.getBytes("UTF-8")));
|
||||||
|
} else {
|
||||||
|
LOGGER.info("excuteAsync:\n{}\n{}", client.excuteAsync().get(), repeat("-", 100));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 话费下单
|
||||||
|
*
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public void phoneOrderAddTest(FuLuConfigureDTO fuLuConfigureDTO) throws Exception {
|
||||||
|
LOGGER.info("\n话费下单{}", repeat("=", 100));
|
||||||
|
DefaultOpenApiClient client =
|
||||||
|
new DefaultOpenApiClient(URL, fuLuConfigureDTO.getAppMerchantKey(), fuLuConfigureDTO.getAppSecretKey(), MethodConst.OPEN_API_PHONE_ORDER_ADD);
|
||||||
|
InputPhoneOrderDto dto = new InputPhoneOrderDto();
|
||||||
|
dto.setChargeValue(Double.valueOf(50));
|
||||||
|
int count = 1;
|
||||||
|
|
||||||
|
for (String chargePhone : Arrays.asList("15972368779", "13971553804")) {
|
||||||
|
dto.setCustomerOrderNo(UUID.randomUUID().toString());
|
||||||
|
dto.setChargePhone(chargePhone);
|
||||||
|
client.setBizObject(dto);
|
||||||
|
|
||||||
|
LOGGER.info("excute:\n{}\n{}", client.excute(), repeat("-", 100));
|
||||||
|
dto.setCustomerOrderNo(UUID.randomUUID().toString());
|
||||||
|
if (count++ >= 2) {
|
||||||
|
waitFor(client.excuteAsync());
|
||||||
|
} else {
|
||||||
|
LOGGER.info("excuteAsync:\n{}\n{}", client.excuteAsync().get(), repeat("-", 100));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得商品信息
|
||||||
|
*
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public static Map<String, Object> productInfoGetTest(FuLuConfigureDTO fuLuConfigureDTO,String productIdS) throws Exception {
|
||||||
|
LOGGER.info("\n获得商品信息{}", repeat("=", 100));
|
||||||
|
DefaultOpenApiClient client = new DefaultOpenApiClient(URL, fuLuConfigureDTO.getAppMerchantKey(), fuLuConfigureDTO.getAppSecretKey(), MethodConst.OPEN_API_GOODS_GET);
|
||||||
|
InputProductDto dto = new InputProductDto();
|
||||||
|
int count = 1;
|
||||||
|
Map<String, Object> maps = new HashMap();
|
||||||
|
for (String productId : Arrays.asList(productIdS)) {
|
||||||
|
dto.setProductId(productId);
|
||||||
|
client.setBizObject(dto);
|
||||||
|
maps = (Map) JSON.parse(client.excute());
|
||||||
|
LOGGER.info("excute:\n{}\n{}", client.excute(), repeat("-", 100));
|
||||||
|
if (count++ >= 10) {
|
||||||
|
waitFor(client.excuteAsync());
|
||||||
|
} else {
|
||||||
|
LOGGER.info("excuteAsync:\n{}\n{}", client.excuteAsync().get(), repeat("-", 100));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return maps;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得商品模板信息
|
||||||
|
*
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public void productTemplateGetTest(FuLuConfigureDTO fuLuConfigureDTO) throws Exception {
|
||||||
|
LOGGER.info("\n获得商品模板信息{}", repeat("=", 100));
|
||||||
|
DefaultOpenApiClient client =
|
||||||
|
new DefaultOpenApiClient(URL, fuLuConfigureDTO.getAppMerchantKey(), fuLuConfigureDTO.getAppSecretKey(), MethodConst.OPEN_API_GOODS_TEMPLATE_GET);
|
||||||
|
InputProductTemplateDto dto = new InputProductTemplateDto();
|
||||||
|
dto.setTemplateId("e1dac0ea-dc86-4c9d-a778-c9e19203ecb8");
|
||||||
|
client.setBizObject(dto);
|
||||||
|
LOGGER.info("excute:\n{}\n{}", client.excute(), repeat("-", 100));
|
||||||
|
waitFor(client.excuteAsync());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流量下单
|
||||||
|
*
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public void trafficOrderAddTest(FuLuConfigureDTO fuLuConfigureDTO) throws Exception {
|
||||||
|
LOGGER.info("\n流量下单{}", repeat("=", 100));
|
||||||
|
DefaultOpenApiClient client =
|
||||||
|
new DefaultOpenApiClient(URL, fuLuConfigureDTO.getAppMerchantKey(), fuLuConfigureDTO.getAppSecretKey(), MethodConst.OPEN_API_TRAFFIC_ORDER_ADD);
|
||||||
|
InputTrafficOrderDto dto = new InputTrafficOrderDto();
|
||||||
|
dto.setChargeValue(Double.valueOf(1024));
|
||||||
|
dto.setPacketKind(4);
|
||||||
|
|
||||||
|
int count = 1;
|
||||||
|
for (String chargePhone : Arrays.asList("15972368779", "13971553804")) {
|
||||||
|
client.setBizObject(dto);
|
||||||
|
dto.setChargePhone(chargePhone);
|
||||||
|
dto.setCustomerOrderNo(UUID.randomUUID().toString());
|
||||||
|
|
||||||
|
LOGGER.info("excute:\n{}\n{}", client.excute(), repeat("-", 100));
|
||||||
|
dto.setCustomerOrderNo(UUID.randomUUID().toString());
|
||||||
|
if (count++ >= 2) {
|
||||||
|
waitFor(client.excuteAsync());
|
||||||
|
} else {
|
||||||
|
LOGGER.info("excuteAsync:\n{}\n{}", client.excuteAsync().get(), repeat("-", 100));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户信息
|
||||||
|
*
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public static void userInfoGetTest(FuLuConfigureDTO fuLuConfigureDTO) throws Exception {
|
||||||
|
LOGGER.info("\n用户信息{}", repeat("=", 100));
|
||||||
|
DefaultOpenApiClient client =
|
||||||
|
new DefaultOpenApiClient(URL, fuLuConfigureDTO.getAppMerchantKey(), fuLuConfigureDTO.getAppSecretKey(), MethodConst.OPEN_API_USER_INFO_GET);
|
||||||
|
InputUserDto dto = new InputUserDto();
|
||||||
|
client.setBizObject(dto);
|
||||||
|
|
||||||
|
LOGGER.info("excute:\n{}\n{}", client.excute(), repeat("-", 100));
|
||||||
|
waitFor(client.excuteAsync());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户信息:高并发场景
|
||||||
|
*
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public static void userInfoGetTest2(FuLuConfigureDTO fuLuConfigureDTO) throws Exception {
|
||||||
|
LOGGER.info("\n用户信息:高并发场景{}", repeat("=", 100));
|
||||||
|
Executor executor = Executors.newCachedThreadPool();
|
||||||
|
|
||||||
|
final int count = 10;
|
||||||
|
final CountDownLatch downLatch = new CountDownLatch(count);
|
||||||
|
|
||||||
|
for (int i = 0; i < count; ++i) {
|
||||||
|
executor.execute(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
try {
|
||||||
|
String name = Thread.currentThread().getName();
|
||||||
|
LOGGER.info("\n线程名:{}{}", name, repeat("+", 100));
|
||||||
|
|
||||||
|
DefaultOpenApiClient client =
|
||||||
|
new DefaultOpenApiClient(URL, fuLuConfigureDTO.getAppMerchantKey(), fuLuConfigureDTO.getAppSecretKey(), MethodConst.OPEN_API_USER_INFO_GET);
|
||||||
|
InputUserDto dto = new InputUserDto();
|
||||||
|
client.setBizObject(dto);
|
||||||
|
|
||||||
|
LOGGER.info("\n线程名:{}\n{}\n{}", name, client.excute(), repeat("+", 100));
|
||||||
|
waitFor(client.excuteAsync());
|
||||||
|
} catch (Exception ex) {
|
||||||
|
LOGGER.error(ex.getMessage(), ex);
|
||||||
|
} finally {
|
||||||
|
downLatch.countDown();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
downLatch.await();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* 获得商品信息列表
|
||||||
|
*
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public static String getGoodsInfoList(FuLuConfigureDTO fuLuConfigureDTO) throws Exception {
|
||||||
|
LOGGER.info("\n获得商品信息{}", repeat("=", 100));
|
||||||
|
DefaultOpenApiClient client = new DefaultOpenApiClient(URL, fuLuConfigureDTO.getAppMerchantKey(), fuLuConfigureDTO.getAppSecretKey(), MethodConst.OPEN_API_GOODS_LIST);
|
||||||
|
InputProductDto dto = new InputProductDto();
|
||||||
|
client.setBizObject(dto);
|
||||||
|
return client.excute().toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
try {
|
||||||
|
// productInfoGetTest();
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,159 @@
|
|||||||
|
package cn.lili.common.fulu.model;
|
||||||
|
|
||||||
|
import cn.lili.common.fulu.core.utils.DateFormatUtil;
|
||||||
|
import cn.lili.common.fulu.core.utils.JSONUtil;
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
import com.google.gson.reflect.TypeToken;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Auther: chenYing
|
||||||
|
* @Date: 2019/8/19 0019 10:49
|
||||||
|
*/
|
||||||
|
public class CommonRequest implements Serializable {
|
||||||
|
private static final long serialVersionUID = 2L;
|
||||||
|
|
||||||
|
@SerializedName(value = "app_auth_token")
|
||||||
|
private String appAuthToken = "";
|
||||||
|
@SerializedName(value = "app_key")
|
||||||
|
private String appKey;
|
||||||
|
@SerializedName(value = "biz_content")
|
||||||
|
private String bizContent = "{}";
|
||||||
|
private transient Map<String, Object> bizContentMap = Collections.emptyMap();
|
||||||
|
private String charset;
|
||||||
|
private String format;
|
||||||
|
private String method;
|
||||||
|
private String sign;
|
||||||
|
@SerializedName(value = "sign_type")
|
||||||
|
private String signType;
|
||||||
|
private String timestamp;
|
||||||
|
private String version;
|
||||||
|
|
||||||
|
public CommonRequest() {
|
||||||
|
format = "json";
|
||||||
|
version = "2.0";
|
||||||
|
charset = "utf-8";
|
||||||
|
signType = "md5";
|
||||||
|
// timestamp = "2019-08-20 13:59:38";
|
||||||
|
timestamp = DateFormatUtil.currentDateTime();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getAppAuthToken() {
|
||||||
|
return appAuthToken;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAppAuthToken(String appAuthToken) {
|
||||||
|
this.appAuthToken = appAuthToken;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAppKey() {
|
||||||
|
return appKey;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAppKey(String appKey) {
|
||||||
|
this.appKey = appKey;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBizContent() {
|
||||||
|
if (!bizContentMap.isEmpty()) {
|
||||||
|
bizContent = JSONUtil.toJSON(bizContentMap);
|
||||||
|
}
|
||||||
|
return bizContent;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 直接将变量以json格式保存
|
||||||
|
*
|
||||||
|
* @param bizContent bizContent
|
||||||
|
*/
|
||||||
|
public void setBizContent(String bizContent) {
|
||||||
|
if (bizContent != null && !"".equals(bizContent.trim())) {
|
||||||
|
Map<String, Object> dataMap = JSONUtil.fromJSON(bizContent, new TypeToken<Map<String, Object>>() {
|
||||||
|
});
|
||||||
|
|
||||||
|
if (bizContentMap.isEmpty()) {
|
||||||
|
bizContentMap = new HashMap<String, Object>();
|
||||||
|
}
|
||||||
|
bizContentMap.putAll(dataMap);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCharset() {
|
||||||
|
return charset;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCharset(String charset) {
|
||||||
|
this.charset = charset;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFormat() {
|
||||||
|
return format;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFormat(String format) {
|
||||||
|
this.format = format;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMethod() {
|
||||||
|
return method;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMethod(String method) {
|
||||||
|
this.method = method;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSign() {
|
||||||
|
return sign;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSign(String sign) {
|
||||||
|
this.sign = sign;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSignType() {
|
||||||
|
return signType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSignType(String signType) {
|
||||||
|
this.signType = signType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTimestamp() {
|
||||||
|
return timestamp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTimestamp(String timestamp) {
|
||||||
|
this.timestamp = timestamp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getVersion() {
|
||||||
|
return version;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVersion(String version) {
|
||||||
|
this.version = version;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 以key:value形式保存,程序会转换为json格式
|
||||||
|
*
|
||||||
|
* @param key key
|
||||||
|
* @param value value
|
||||||
|
*/
|
||||||
|
public void setBizContent(String key, Object value) {
|
||||||
|
if (bizContentMap.isEmpty()) {
|
||||||
|
bizContentMap = new HashMap<String, Object>();
|
||||||
|
}
|
||||||
|
bizContentMap.put(key, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected Object getBizContentValue(String key) {
|
||||||
|
return bizContentMap.get(key);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
package cn.lili.common.fulu.model;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 卡密订单input dto
|
||||||
|
*
|
||||||
|
* @Auther: chenYing
|
||||||
|
* @Date: 2019/8/19 0019 15:35
|
||||||
|
*/
|
||||||
|
public class InputCardOrderDto extends CommonRequest {
|
||||||
|
public InputCardOrderDto() {
|
||||||
|
super();
|
||||||
|
setMethod("fulu.order.card.add");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 购买数量
|
||||||
|
*
|
||||||
|
* @return Integer
|
||||||
|
*/
|
||||||
|
public Integer getBuyNum() {
|
||||||
|
Object value = getBizContentValue("buy_num");
|
||||||
|
return value != null ? Integer.valueOf(value.toString()) : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBuyNum(Integer buyNum) {
|
||||||
|
setBizContent("buy_num", buyNum);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 外部订单号
|
||||||
|
*
|
||||||
|
* @return String
|
||||||
|
*/
|
||||||
|
public String getCustomerOrderNo() {
|
||||||
|
Object value = getBizContentValue("customer_order_no");
|
||||||
|
return value != null ? String.valueOf(value) : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCustomerOrderNo(String customerOrderNo) {
|
||||||
|
setBizContent("customer_order_no", customerOrderNo);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品编号
|
||||||
|
*
|
||||||
|
* @return Integer
|
||||||
|
*/
|
||||||
|
public Integer getProductId() {
|
||||||
|
Object value = getBizContentValue("product_id");
|
||||||
|
return value != null ? Integer.valueOf(value.toString()) : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProductId(Integer productId) {
|
||||||
|
setBizContent("product_id", productId);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,213 @@
|
|||||||
|
package cn.lili.common.fulu.model;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 直充商品订单input dto
|
||||||
|
*
|
||||||
|
* @Auther: chenYing
|
||||||
|
* @Date: 2019/8/19 0019 15:39
|
||||||
|
*/
|
||||||
|
public class InputDirectOrderDto extends CommonRequest {
|
||||||
|
|
||||||
|
public InputDirectOrderDto() {
|
||||||
|
super();
|
||||||
|
setMethod("fulu.order.direct.add");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 购买数量
|
||||||
|
*
|
||||||
|
* @return Integer
|
||||||
|
*/
|
||||||
|
public Integer getBuyNum() {
|
||||||
|
Object value = getBizContentValue("buy_num");
|
||||||
|
return value != null ? Integer.valueOf(value.toString()) : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBuyNum(Integer buyNum) {
|
||||||
|
setBizContent("buy_num", buyNum);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 充值账号
|
||||||
|
*
|
||||||
|
* @return String
|
||||||
|
*/
|
||||||
|
public String getChargeAccount() {
|
||||||
|
Object value = getBizContentValue("charge_account");
|
||||||
|
return value != null ? String.valueOf(value) : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setChargeAccount(String chargeAccount) {
|
||||||
|
setBizContent("charge_account", chargeAccount);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 充值游戏名称
|
||||||
|
*
|
||||||
|
* @return String
|
||||||
|
*/
|
||||||
|
public String getChargeGameName() {
|
||||||
|
Object value = getBizContentValue("charge_game_name");
|
||||||
|
return value != null ? String.valueOf(value) : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setChargeGameName(String chargeGameName) {
|
||||||
|
setBizContent("charge_game_name", chargeGameName);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 充值游戏区
|
||||||
|
*
|
||||||
|
* @return String
|
||||||
|
*/
|
||||||
|
public String getChargeGameRegion() {
|
||||||
|
Object value = getBizContentValue("charge_game_region");
|
||||||
|
return value != null ? String.valueOf(value) : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setChargeGameRegion(String chargeGameRegion) {
|
||||||
|
setBizContent("charge_game_region", chargeGameRegion);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 充值游戏角色
|
||||||
|
*
|
||||||
|
* @return String
|
||||||
|
*/
|
||||||
|
public String getChargeGameRole() {
|
||||||
|
Object value = getBizContentValue("charge_game_role");
|
||||||
|
return value != null ? String.valueOf(value) : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setChargeGameRole(String chargeGameRole) {
|
||||||
|
setBizContent("charge_game_role", chargeGameRole);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 充值游戏服
|
||||||
|
*
|
||||||
|
* @return String
|
||||||
|
*/
|
||||||
|
public String getChargeGameSrv() {
|
||||||
|
Object value = getBizContentValue("charge_game_srv");
|
||||||
|
return value != null ? String.valueOf(value) : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setChargeGameSrv(String chargeGameSrv) {
|
||||||
|
setBizContent("charge_game_srv", chargeGameSrv);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下单真实Ip,区域商品要传
|
||||||
|
*
|
||||||
|
* @return String
|
||||||
|
*/
|
||||||
|
public String getChargeIp() {
|
||||||
|
Object value = getBizContentValue("charge_ip");
|
||||||
|
return value != null ? String.valueOf(value) : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setChargeIp(String chargeIp) {
|
||||||
|
setBizContent("charge_ip", chargeIp);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 充值密码,部分游戏类要传
|
||||||
|
*
|
||||||
|
* @return String
|
||||||
|
*/
|
||||||
|
public String getChargePassword() {
|
||||||
|
Object value = getBizContentValue("charge_password");
|
||||||
|
return value != null ? String.valueOf(value) : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setChargePassword(String chargePassword) {
|
||||||
|
setBizContent("charge_password", chargePassword);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 充值类型
|
||||||
|
*
|
||||||
|
* @return String
|
||||||
|
*/
|
||||||
|
public String getChargeType() {
|
||||||
|
Object value = getBizContentValue("charge_type");
|
||||||
|
return value != null ? String.valueOf(value) : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setChargeType(String chargeType) {
|
||||||
|
setBizContent("charge_type", chargeType);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 联系QQ
|
||||||
|
*
|
||||||
|
* @return String
|
||||||
|
*/
|
||||||
|
public String getContactQq() {
|
||||||
|
Object value = getBizContentValue("contact_qq");
|
||||||
|
return value != null ? String.valueOf(value) : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setContactQq(String contactQq) {
|
||||||
|
setBizContent("contact_qq", contactQq);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 联系电话
|
||||||
|
*
|
||||||
|
* @return String
|
||||||
|
*/
|
||||||
|
public String getContactTel() {
|
||||||
|
Object value = getBizContentValue("contact_tel");
|
||||||
|
return value != null ? String.valueOf(value) : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setContactTel(String contactTel) {
|
||||||
|
setBizContent("contact_tel", contactTel);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 外部订单号
|
||||||
|
*
|
||||||
|
* @return String
|
||||||
|
*/
|
||||||
|
public String getCustomerOrderNo() {
|
||||||
|
Object value = getBizContentValue("customer_order_no");
|
||||||
|
return value != null ? String.valueOf(value) : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCustomerOrderNo(String customerOrderNo) {
|
||||||
|
setBizContent("customer_order_no", customerOrderNo);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品编号
|
||||||
|
*
|
||||||
|
* @return Integer
|
||||||
|
*/
|
||||||
|
public Integer getProductId() {
|
||||||
|
Object value = getBizContentValue("product_id");
|
||||||
|
return value != null ? Integer.valueOf(value.toString()) : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProductId(Integer productId) {
|
||||||
|
setBizContent("product_id", productId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 剩余数量
|
||||||
|
*
|
||||||
|
* @return Integer
|
||||||
|
*/
|
||||||
|
public Integer getRemainingNumber() {
|
||||||
|
Object value = getBizContentValue("remaining_number");
|
||||||
|
return value != null ? Integer.valueOf(value.toString()) : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRemainingNumber(Integer remainingNumber) {
|
||||||
|
setBizContent("remaining_number", remainingNumber);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
package cn.lili.common.fulu.model;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手机号归属地input dto
|
||||||
|
*
|
||||||
|
* @Auther: chenYing
|
||||||
|
* @Date: 2019/8/19 0019 16:08
|
||||||
|
*/
|
||||||
|
public class InputMatchPhoneProductListDto extends CommonRequest {
|
||||||
|
|
||||||
|
public InputMatchPhoneProductListDto() {
|
||||||
|
super();
|
||||||
|
setMethod("fulu.mobile.info.get");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 面值
|
||||||
|
*
|
||||||
|
* @return Double
|
||||||
|
*/
|
||||||
|
public Double getFaceValue() {
|
||||||
|
Object value = getBizContentValue("face_value");
|
||||||
|
return value != null ? Double.valueOf(value.toString()) : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFaceValue(Double faceValue) {
|
||||||
|
setBizContent("face_value", faceValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手机号
|
||||||
|
*
|
||||||
|
* @return String
|
||||||
|
*/
|
||||||
|
public String getPhone() {
|
||||||
|
Object value = getBizContentValue("phone");
|
||||||
|
return value != null ? String.valueOf(value) : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPhone(String phone) {
|
||||||
|
setBizContent("phone", phone);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
package cn.lili.common.fulu.model;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单查单input dto
|
||||||
|
*
|
||||||
|
* @Auther: chenYing
|
||||||
|
* @Date: 2019/8/19 0019 15:23
|
||||||
|
*/
|
||||||
|
public class InputOrderGetDto extends CommonRequest {
|
||||||
|
|
||||||
|
public InputOrderGetDto() {
|
||||||
|
super();
|
||||||
|
setMethod("fulu.order.info.get");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 外部订单号
|
||||||
|
*
|
||||||
|
* @return String
|
||||||
|
*/
|
||||||
|
public String getCustomerOrderNo() {
|
||||||
|
Object value = getBizContentValue("customer_order_no");
|
||||||
|
return value != null ? String.valueOf(value) : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCustomerOrderNo(String customerOrderNo) {
|
||||||
|
setBizContent("customer_order_no", customerOrderNo);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,57 @@
|
|||||||
|
package cn.lili.common.fulu.model;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 话费订单input dto
|
||||||
|
*
|
||||||
|
* @Auther: chenYing
|
||||||
|
* @Date: 2019/8/19 0019 15:31
|
||||||
|
*/
|
||||||
|
public class InputPhoneOrderDto extends CommonRequest {
|
||||||
|
|
||||||
|
public InputPhoneOrderDto() {
|
||||||
|
super();
|
||||||
|
setMethod("fulu.order.mobile.add");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 充值手机号
|
||||||
|
*
|
||||||
|
* @return String
|
||||||
|
*/
|
||||||
|
public String getChargePhone() {
|
||||||
|
Object value = getBizContentValue("charge_phone");
|
||||||
|
return value != null ? String.valueOf(value) : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setChargePhone(String chargePhone) {
|
||||||
|
setBizContent("charge_phone", chargePhone);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 充值数额
|
||||||
|
*
|
||||||
|
* @return Double
|
||||||
|
*/
|
||||||
|
public Double getChargeValue() {
|
||||||
|
Object value = getBizContentValue("charge_value");
|
||||||
|
return value != null ? Double.valueOf(value.toString()) : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setChargeValue(Double chargeValue) {
|
||||||
|
setBizContent("charge_value", chargeValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 外部订单号
|
||||||
|
*
|
||||||
|
* @return String
|
||||||
|
*/
|
||||||
|
public String getCustomerOrderNo() {
|
||||||
|
Object value = getBizContentValue("customer_order_no");
|
||||||
|
return value != null ? String.valueOf(value) : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCustomerOrderNo(String customerOrderNo) {
|
||||||
|
setBizContent("customer_order_no", customerOrderNo);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
package cn.lili.common.fulu.model;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品信息input dto
|
||||||
|
*
|
||||||
|
* @Auther: chenYing
|
||||||
|
* @Date: 2019/8/19 0019 16:04
|
||||||
|
*/
|
||||||
|
public class InputProductDto extends CommonRequest {
|
||||||
|
|
||||||
|
public InputProductDto() {
|
||||||
|
super();
|
||||||
|
setMethod("fulu.goods.info.get");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品编号
|
||||||
|
*
|
||||||
|
* @return String
|
||||||
|
*/
|
||||||
|
public String getProductId() {
|
||||||
|
Object value = getBizContentValue("product_id");
|
||||||
|
return value != null ? String.valueOf(value) : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProductId(String productId) {
|
||||||
|
setBizContent("product_id", productId);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package cn.lili.common.fulu.model;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品模板信息input dto
|
||||||
|
*
|
||||||
|
* @Auther: chenYing
|
||||||
|
* @Date: 2019/8/19 0019 16:01
|
||||||
|
*/
|
||||||
|
public class InputProductTemplateDto extends CommonRequest {
|
||||||
|
|
||||||
|
public InputProductTemplateDto() {
|
||||||
|
super();
|
||||||
|
setMethod("fulu.goods.template.get");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品模板编号
|
||||||
|
*
|
||||||
|
* @return String
|
||||||
|
*/
|
||||||
|
public String getTemplateId() {
|
||||||
|
Object value = getBizContentValue("template_id");
|
||||||
|
return value != null ? String.valueOf(value) : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTemplateId(String templateId) {
|
||||||
|
setBizContent("template_id", templateId);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,72 @@
|
|||||||
|
package cn.lili.common.fulu.model;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流量订单input dto
|
||||||
|
*
|
||||||
|
* @Auther: chenYing
|
||||||
|
* @Date: 2019/8/19 0019 13:50
|
||||||
|
*/
|
||||||
|
public class InputTrafficOrderDto extends CommonRequest {
|
||||||
|
|
||||||
|
public InputTrafficOrderDto() {
|
||||||
|
super();
|
||||||
|
setMethod("fulu.order.data.add");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 充值手机号
|
||||||
|
*
|
||||||
|
* @return String
|
||||||
|
*/
|
||||||
|
public String getChargePhone() {
|
||||||
|
Object value = getBizContentValue("charge_phone");
|
||||||
|
return value != null ? String.valueOf(value) : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setChargePhone(String chargePhone) {
|
||||||
|
setBizContent("charge_phone", chargePhone);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 充值数额(M)
|
||||||
|
*
|
||||||
|
* @return Double
|
||||||
|
*/
|
||||||
|
public Double getChargeValue() {
|
||||||
|
Object value = getBizContentValue("charge_value");
|
||||||
|
return value != null ? Double.valueOf(value.toString()) : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setChargeValue(Double chargeValue) {
|
||||||
|
setBizContent("charge_value", chargeValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 外部订单号
|
||||||
|
*
|
||||||
|
* @return String
|
||||||
|
*/
|
||||||
|
public String getCustomerOrderNo() {
|
||||||
|
Object value = getBizContentValue("customer_order_no");
|
||||||
|
return value != null ? String.valueOf(value) : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCustomerOrderNo(String customerOrderNo) {
|
||||||
|
setBizContent("customer_order_no", customerOrderNo);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流量性质 1:小时 2:日 3:7天 4:月 5:季度 6:半年 7:年
|
||||||
|
*
|
||||||
|
* @return Integer
|
||||||
|
*/
|
||||||
|
public Integer getPacketKind() {
|
||||||
|
Object value = getBizContentValue("packet_kind");
|
||||||
|
return value != null ? Integer.valueOf(value.toString()) : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPacketKind(Integer packetKind) {
|
||||||
|
setBizContent("packet_kind", packetKind);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package cn.lili.common.fulu.model;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户信息input dto
|
||||||
|
*
|
||||||
|
* @Auther: chenYing
|
||||||
|
* @Date: 2019/8/19 0019 16:06
|
||||||
|
*/
|
||||||
|
public class InputUserDto extends CommonRequest {
|
||||||
|
|
||||||
|
public InputUserDto() {
|
||||||
|
super();
|
||||||
|
setMethod("fulu.user.info.get");
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
package cn.lili.common.fulu.model.response;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 响应对象
|
||||||
|
*
|
||||||
|
* @Auther: chenYing
|
||||||
|
* @Date: 2019/8/19 0019 15:06
|
||||||
|
*/
|
||||||
|
public class DefaultClientResponse {
|
||||||
|
private String code;
|
||||||
|
private String message;
|
||||||
|
private String result;
|
||||||
|
private String sign;
|
||||||
|
|
||||||
|
public String getCode() {
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCode(String code) {
|
||||||
|
this.code = code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMessage() {
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMessage(String message) {
|
||||||
|
this.message = message;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getResult() {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setResult(String result) {
|
||||||
|
this.result = result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSign() {
|
||||||
|
return sign;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSign(String sign) {
|
||||||
|
this.sign = sign;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,129 @@
|
|||||||
|
package cn.lili.common.fulu.sdk;
|
||||||
|
|
||||||
|
import cn.lili.common.fulu.core.http.FuluClient;
|
||||||
|
import cn.lili.common.fulu.core.http.IFuluClient;
|
||||||
|
import cn.lili.common.fulu.core.utils.JSONUtil;
|
||||||
|
import cn.lili.common.fulu.model.CommonRequest;
|
||||||
|
import org.apache.commons.codec.digest.DigestUtils;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.concurrent.Future;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 默认OpenApi客户请求实现
|
||||||
|
*
|
||||||
|
* @Auther: chenYing
|
||||||
|
* @Date: 2019/8/19 0019 16:45
|
||||||
|
*/
|
||||||
|
public class DefaultOpenApiClient implements IDefaultOpenApiClient {
|
||||||
|
/**
|
||||||
|
* 商户AppKey
|
||||||
|
*/
|
||||||
|
private String appKey;
|
||||||
|
/**
|
||||||
|
* 业务参数
|
||||||
|
*/
|
||||||
|
private CommonRequest bizContent;
|
||||||
|
/**
|
||||||
|
* http请求
|
||||||
|
*/
|
||||||
|
private IFuluClient fuluClient;
|
||||||
|
/**
|
||||||
|
* 方法
|
||||||
|
*/
|
||||||
|
private String method;
|
||||||
|
/**
|
||||||
|
* 应用秘钥
|
||||||
|
*/
|
||||||
|
private String sysSecret;
|
||||||
|
|
||||||
|
// public DefaultOpenApiClient(String url, String appKey, String sysSecret) {
|
||||||
|
// this.appKey = appKey;
|
||||||
|
// this.sysSecret = sysSecret;
|
||||||
|
//
|
||||||
|
// if (url == null || "".equals(url.trim())) {
|
||||||
|
// this.fuluClient = new FuluClient();
|
||||||
|
// } else {
|
||||||
|
// this.fuluClient = new FuluClient(url);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 如果url没改变,可以使用这个构造
|
||||||
|
*
|
||||||
|
* @param appKey appKey
|
||||||
|
* @param sysSecret sysSecret
|
||||||
|
*/
|
||||||
|
// public DefaultOpenApiClient(String appKey, String sysSecret) {
|
||||||
|
// this.appKey = appKey;
|
||||||
|
// this.fuluClient = new FuluClient();
|
||||||
|
// this.sysSecret = sysSecret;
|
||||||
|
// }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 使用public void setBizContent(String bizContent)此方法,method不能为空,必填
|
||||||
|
* 或者使用其它构造,调用fulu.sup.open.api.model.CommonRequest的setMethod也可以
|
||||||
|
*
|
||||||
|
* @param url url
|
||||||
|
* @param appKey appKey
|
||||||
|
* @param sysSecret sysSecret
|
||||||
|
* @param method method
|
||||||
|
*/
|
||||||
|
public DefaultOpenApiClient(String url, String appKey, String sysSecret, String method) {
|
||||||
|
this.appKey = appKey;
|
||||||
|
this.sysSecret = sysSecret;
|
||||||
|
this.method = method;
|
||||||
|
|
||||||
|
if (url == null || "".equals(url.trim())) {
|
||||||
|
this.fuluClient = new FuluClient();
|
||||||
|
} else {
|
||||||
|
this.fuluClient = new FuluClient(url);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String excute() {
|
||||||
|
doSign();
|
||||||
|
return fuluClient.send(JSONUtil.toJSON(this.bizContent));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Future<String> excuteAsync() {
|
||||||
|
doSign();
|
||||||
|
return fuluClient.sendAsync(JSONUtil.toJSON(this.bizContent));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setBizContent(String bizContent) {
|
||||||
|
this.bizContent = new CommonRequest();
|
||||||
|
this.bizContent.setBizContent(bizContent);
|
||||||
|
this.bizContent.setAppKey(this.appKey);
|
||||||
|
this.bizContent.setMethod(this.method);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setBizObject(CommonRequest bizModel) {
|
||||||
|
this.bizContent = bizModel;
|
||||||
|
this.bizContent.setAppKey(this.appKey);
|
||||||
|
|
||||||
|
if (method != null && !"".equals(method)) {
|
||||||
|
this.bizContent.setMethod(this.method);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void doSign() {
|
||||||
|
if (bizContent.getMethod() == null || "".equals(bizContent.getMethod().trim())) {
|
||||||
|
throw new RuntimeException("param \"method\" can not blank!");
|
||||||
|
}
|
||||||
|
|
||||||
|
this.bizContent.setSign(null);
|
||||||
|
this.bizContent.getBizContent();
|
||||||
|
String json = JSONUtil.toJSON(this.bizContent);
|
||||||
|
char[] charArray = json.toCharArray();
|
||||||
|
Arrays.sort(charArray);
|
||||||
|
String signStr = new String(charArray);
|
||||||
|
signStr = String.format("%s%s", signStr, sysSecret);
|
||||||
|
this.bizContent.setSign(DigestUtils.md5Hex(signStr));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
package cn.lili.common.fulu.sdk;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
import cn.lili.common.fulu.model.CommonRequest;
|
||||||
|
|
||||||
|
import java.util.concurrent.Future;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 默认OpenApi客户请求接口
|
||||||
|
*
|
||||||
|
* @Auther: chenYing
|
||||||
|
* @Date: 2019/8/19 0019 16:40
|
||||||
|
*/
|
||||||
|
public interface IDefaultOpenApiClient {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 执行请求,同步方法
|
||||||
|
*
|
||||||
|
* @return String
|
||||||
|
*/
|
||||||
|
String excute();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 执行请求,异步方法
|
||||||
|
*
|
||||||
|
* @return Future<String>
|
||||||
|
*/
|
||||||
|
Future<String> excuteAsync();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置业务参数
|
||||||
|
*
|
||||||
|
* @param bizContent
|
||||||
|
*/
|
||||||
|
@Deprecated
|
||||||
|
void setBizContent(String bizContent);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置业务参数
|
||||||
|
*/
|
||||||
|
void setBizObject(CommonRequest bizModel);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
package cn.lili.common.listener;
|
||||||
|
|
||||||
|
import cn.lili.common.event.TransactionCommitSendMQEvent;
|
||||||
|
import cn.lili.rocketmq.RocketmqSendCallbackBuilder;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.rocketmq.spring.core.RocketMQTemplate;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.transaction.event.TransactionPhase;
|
||||||
|
import org.springframework.transaction.event.TransactionalEventListener;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 事务提交监听器
|
||||||
|
*
|
||||||
|
* @author paulG
|
||||||
|
* @since 2022/1/19
|
||||||
|
**/
|
||||||
|
@Component
|
||||||
|
@Slf4j
|
||||||
|
public class TransactionCommitSendMQListener {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* rocketMq
|
||||||
|
*/
|
||||||
|
@Autowired
|
||||||
|
private RocketMQTemplate rocketMQTemplate;
|
||||||
|
|
||||||
|
|
||||||
|
@TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT)
|
||||||
|
public void send(TransactionCommitSendMQEvent event) {
|
||||||
|
log.info("事务提交,发送mq信息!{}", event);
|
||||||
|
String destination = event.getTopic() + ":" + event.getTag();
|
||||||
|
//发送订单变更mq消息
|
||||||
|
rocketMQTemplate.asyncSend(destination, event.getMessage(), RocketmqSendCallbackBuilder.commonCallback());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -16,21 +16,21 @@ public class SmsTemplateProperties {
|
|||||||
/**
|
/**
|
||||||
* 登录
|
* 登录
|
||||||
*/
|
*/
|
||||||
private String lOGIN = "SMS_205755300";
|
private String lOGIN = "SMS_185821482";
|
||||||
/**
|
/**
|
||||||
* 注册
|
* 注册
|
||||||
*/
|
*/
|
||||||
private String REGISTER = "SMS_205755298";
|
private String REGISTER = "SMS_185821482";
|
||||||
/**
|
/**
|
||||||
* 找回密码
|
* 找回密码
|
||||||
*/
|
*/
|
||||||
private String FIND_USER = "SMS_205755301";
|
private String FIND_USER = "SMS_185821482";
|
||||||
/**
|
/**
|
||||||
* 设置密码
|
* 设置密码
|
||||||
*/
|
*/
|
||||||
private String UPDATE_PASSWORD = "SMS_205755297";
|
private String UPDATE_PASSWORD = "SMS_185821482";
|
||||||
/**
|
/**
|
||||||
* 设置支付密码
|
* 设置支付密码
|
||||||
*/
|
*/
|
||||||
private String WALLET_PASSWORD = "SMS_205755297";
|
private String WALLET_PASSWORD = "SMS_185821482";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,8 +24,7 @@ public class VerificationCodeProperties {
|
|||||||
/**
|
/**
|
||||||
* 水印
|
* 水印
|
||||||
*/
|
*/
|
||||||
private String watermark = "LILI-SHOP";
|
private String watermark = "";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 干扰数量 最大数量
|
* 干扰数量 最大数量
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -51,6 +51,11 @@ public class AuthUser implements Serializable {
|
|||||||
* storeId
|
* storeId
|
||||||
*/
|
*/
|
||||||
private String storeId;
|
private String storeId;
|
||||||
|
/**
|
||||||
|
* 如果角色是商家,则存在此店铺id字段
|
||||||
|
* clerkId
|
||||||
|
*/
|
||||||
|
private String clerkId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 如果角色是商家,则存在此店铺名称字段
|
* 如果角色是商家,则存在此店铺名称字段
|
||||||
@@ -79,4 +84,14 @@ public class AuthUser implements Serializable {
|
|||||||
this.isSuper = isSuper;
|
this.isSuper = isSuper;
|
||||||
this.nickName = nickName;
|
this.nickName = nickName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public AuthUser(String username, String id, UserEnums manager, String nickName, Boolean isSuper, String clerkId,String face) {
|
||||||
|
this.username = username;
|
||||||
|
this.id = id;
|
||||||
|
this.role = manager;
|
||||||
|
this.isSuper = isSuper;
|
||||||
|
this.nickName = nickName;
|
||||||
|
this.clerkId = clerkId;
|
||||||
|
this.face = face;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package cn.lili.common.security.context;
|
package cn.lili.common.security.context;
|
||||||
|
|
||||||
import cn.lili.cache.Cache;
|
import cn.lili.cache.Cache;
|
||||||
|
import cn.lili.cache.CachePrefix;
|
||||||
import cn.lili.common.enums.ResultCode;
|
import cn.lili.common.enums.ResultCode;
|
||||||
import cn.lili.common.exception.ServiceException;
|
import cn.lili.common.exception.ServiceException;
|
||||||
import cn.lili.common.security.AuthUser;
|
import cn.lili.common.security.AuthUser;
|
||||||
@@ -60,10 +61,13 @@ public class UserContext {
|
|||||||
*/
|
*/
|
||||||
public static AuthUser getAuthUser(Cache cache, String accessToken) {
|
public static AuthUser getAuthUser(Cache cache, String accessToken) {
|
||||||
try {
|
try {
|
||||||
if (cache.keys("*" + accessToken).isEmpty()) {
|
AuthUser authUser = getAuthUser(accessToken);
|
||||||
|
assert authUser != null;
|
||||||
|
|
||||||
|
if (!cache.hasKey(CachePrefix.ACCESS_TOKEN.getPrefix(authUser.getRole()) + accessToken)) {
|
||||||
throw new ServiceException(ResultCode.USER_AUTHORITY_ERROR);
|
throw new ServiceException(ResultCode.USER_AUTHORITY_ERROR);
|
||||||
}
|
}
|
||||||
return getAuthUser(accessToken);
|
return authUser;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -181,7 +181,7 @@ public class XssHttpServletRequestWrapper extends HttpServletRequestWrapper {
|
|||||||
//将resultMap转换为json字符串
|
//将resultMap转换为json字符串
|
||||||
String resultStr = JSONUtil.toJsonStr(resultMap);
|
String resultStr = JSONUtil.toJsonStr(resultMap);
|
||||||
//将json字符串转换为字节
|
//将json字符串转换为字节
|
||||||
final ByteArrayInputStream resultBIS = new ByteArrayInputStream(resultStr.getBytes());
|
final ByteArrayInputStream resultBIS = new ByteArrayInputStream(resultStr.getBytes(StandardCharsets.UTF_8));
|
||||||
|
|
||||||
//实现接口
|
//实现接口
|
||||||
return new ServletInputStream() {
|
return new ServletInputStream() {
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ public class SecretKeyUtil {
|
|||||||
public static SecretKey generalKey() {
|
public static SecretKey generalKey() {
|
||||||
//自定义
|
//自定义
|
||||||
byte[] encodedKey = Base64.decodeBase64("cuAihCz53DZRjZwbsGcZJ2Ai6At+T142uphtJMsk7iQ=");
|
byte[] encodedKey = Base64.decodeBase64("cuAihCz53DZRjZwbsGcZJ2Ai6At+T142uphtJMsk7iQ=");
|
||||||
javax.crypto.SecretKey key = Keys.hmacShaKeyFor(encodedKey);
|
SecretKey key = Keys.hmacShaKeyFor(encodedKey);
|
||||||
return key;
|
return key;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -34,9 +34,9 @@ public class TokenUtil {
|
|||||||
/**
|
/**
|
||||||
* 构建token
|
* 构建token
|
||||||
*
|
*
|
||||||
* @param username 主体
|
* @param username 主体
|
||||||
* @param claim 私有声明
|
* @param claim 私有声明
|
||||||
* @param longTerm 长时间特殊token 如:移动端,微信小程序等
|
* @param longTerm 长时间特殊token 如:移动端,微信小程序等
|
||||||
* @param userEnums 用户枚举
|
* @param userEnums 用户枚举
|
||||||
* @return TOKEN
|
* @return TOKEN
|
||||||
*/
|
*/
|
||||||
@@ -62,7 +62,7 @@ public class TokenUtil {
|
|||||||
* 刷新token
|
* 刷新token
|
||||||
*
|
*
|
||||||
* @param oldRefreshToken 刷新token
|
* @param oldRefreshToken 刷新token
|
||||||
* @param userEnums 用户枚举
|
* @param userEnums 用户枚举
|
||||||
* @return token
|
* @return token
|
||||||
*/
|
*/
|
||||||
public Token refreshToken(String oldRefreshToken, UserEnums userEnums) {
|
public Token refreshToken(String oldRefreshToken, UserEnums userEnums) {
|
||||||
|
|||||||
@@ -77,6 +77,11 @@ public class SensitiveWordsFilter implements Serializable {
|
|||||||
int step = 1;
|
int step = 1;
|
||||||
//计算此位置开始2个字符的hash
|
//计算此位置开始2个字符的hash
|
||||||
int hash = sp.nextTwoCharHash(i);
|
int hash = sp.nextTwoCharHash(i);
|
||||||
|
|
||||||
|
//如果没有敏感词,则直接返回内容
|
||||||
|
if (nodes.length == 0) {
|
||||||
|
return sentence;
|
||||||
|
}
|
||||||
/*
|
/*
|
||||||
* 根据hash获取第一个节点,
|
* 根据hash获取第一个节点,
|
||||||
* 真正匹配的节点可能不是第一个,
|
* 真正匹配的节点可能不是第一个,
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package cn.lili.common.utils;
|
package cn.lili.common.utils;
|
||||||
|
|
||||||
import java.util.Random;
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
import java.util.concurrent.ThreadLocalRandom;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通用工具
|
* 通用工具
|
||||||
@@ -9,6 +9,8 @@ import java.util.UUID;
|
|||||||
*/
|
*/
|
||||||
public class CommonUtil {
|
public class CommonUtil {
|
||||||
|
|
||||||
|
public static final String BASE_NUMBER = "0123456789";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 以UUID重命名
|
* 以UUID重命名
|
||||||
* @param fileName 文件名称
|
* @param fileName 文件名称
|
||||||
@@ -24,12 +26,12 @@ public class CommonUtil {
|
|||||||
* 随机6位数生成
|
* 随机6位数生成
|
||||||
*/
|
*/
|
||||||
public static String getRandomNum() {
|
public static String getRandomNum() {
|
||||||
|
StringBuilder sb = new StringBuilder(6);
|
||||||
Random random = new Random();
|
for (int i = 0; i < 6; i++) {
|
||||||
int num = random.nextInt(999999);
|
int num = ThreadLocalRandom.current().nextInt(BASE_NUMBER.length());
|
||||||
//不足六位前面补0
|
sb.append(BASE_NUMBER.charAt(num));
|
||||||
String str = String.format("%06d", num);
|
}
|
||||||
return str;
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user