初始化代码 2022-02-11前 最新版本

This commit is contained in:
itheinjury@163.com 2022-02-11 19:30:50 +08:00
commit bf8f8d9382
1399 changed files with 165963 additions and 0 deletions

41
.gitignore vendored Normal file
View File

@ -0,0 +1,41 @@
/.idea/
target
*.iml
*.class
.DS_Store
*.classpath
*.project
*.log
.settings/
.factorypath
log/
logs/
*.factorypath
lili-shop/src/main/java/cn/lili/generator/CodeGenerator.java
lili-logs
### STS ###
.apt_generated
.classpath
.project
.settings
.springBeans
.sts4-cache
### IntelliJ IDEA ###
.idea
*.iws
*.ipr
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
### VS Code ###
.vscode/

6
DB/README.md Normal file
View File

@ -0,0 +1,6 @@
## PS:数据库位置
点击跳转 https://gitee.com/beijing_hongye_huicheng/docker/tree/master/init/mysql 这里有与tag版本一致的sql根据tag获取sql如果使用master代码则需要在lilishop项目根目录的update-sql目录中获取对应的升级sql。
使用master分支代码时可能会无法运行执行完初始化sql之后需要执行当前目录下'versiontXXXXtoMASTER.sql'。

66
DB/li_notice_message.sql Normal file
View File

@ -0,0 +1,66 @@
/*
Navicat MySQL Data Transfer
Source Server : 192.168.0.116
Source Server Type : MySQL
Source Server Version : 80023
Source Host : 192.168.0.116:3306
Source Schema : lilishop
Target Server Type : MySQL
Target Server Version : 80023
File Encoding : 65001
Date: 27/07/2021 19:42:15
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for li_notice_message
-- ----------------------------
DROP TABLE IF EXISTS `li_notice_message`;
CREATE TABLE `li_notice_message` (
`id` bigint NOT NULL,
`create_by` varchar(255) DEFAULT NULL,
`create_time` datetime(6) DEFAULT NULL,
`delete_flag` bit(1) DEFAULT NULL,
`update_by` varchar(255) DEFAULT NULL,
`update_time` datetime(6) DEFAULT NULL,
`notice_content` varchar(255) DEFAULT NULL,
`notice_node` varchar(255) DEFAULT NULL,
`notice_status` varchar(255) DEFAULT NULL,
`notice_title` varchar(255) DEFAULT NULL,
`variable` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of li_notice_message
-- ----------------------------
BEGIN;
INSERT INTO `li_notice_message` VALUES (1, NULL, '2021-07-14 19:22:03.000000', NULL, NULL, '2021-07-14 19:22:09.000000', '订单 #{商品名称}已经提交成功,请及时付款哦~', '订单提交成功通知', 'OPEN', '订单提交成功通知', 'goods');
INSERT INTO `li_notice_message` VALUES (2, NULL, '2021-07-14 19:22:06.000000', NULL, NULL, '2021-07-14 19:22:11.000000', '订单#{商品名称}支付成功,我们将尽快为您安排发货哦~', '订单支付成功通知', 'OPEN', '订单支付成功通知', 'goods');
INSERT INTO `li_notice_message` VALUES (3, NULL, '2021-07-15 19:10:14.000000', NULL, NULL, '2021-07-15 19:10:17.000000', '订单#{商品名称}已发货,请注意物流进度哦~', '订单发货通知\n', 'OPEN', '订单发货通知', 'goods');
INSERT INTO `li_notice_message` VALUES (4, NULL, '2021-07-15 19:12:00.000000', NULL, NULL, '2021-07-15 19:12:02.000000', '订单#{商品名称}已完成,期待您分享商品评价与购物心得哦~', '订单完成通知', 'OPEN', '订单完成通知', 'goods');
INSERT INTO `li_notice_message` VALUES (5, NULL, '2021-07-15 19:14:01.000000', NULL, NULL, '2021-07-15 19:14:04.000000', '订单#{商品名称}已取消,取消原因为 #{取消原因},请及时关注您的订单状态哦~', '订单取消成功通知', 'OPEN', '订单取消通知', 'goods,cancel_reason');
INSERT INTO `li_notice_message` VALUES (6, NULL, '2021-07-15 19:26:27.000000', NULL, NULL, '2021-07-15 19:26:34.000000', '商品#{商品名称}还没有收到您的评价呢,期待您与我们分享哦~', '订单评价提醒', 'OPEN', '订单评价提醒', 'goods');
INSERT INTO `li_notice_message` VALUES (7, NULL, '2021-07-15 19:26:25.000000', NULL, NULL, '2021-07-15 19:26:37.000000', '恭喜,您的拼团#{商品名称}已成团,我们将尽快为您安排发货哦~', '拼团成功通知', 'OPEN', '拼团成功通知', 'goods');
INSERT INTO `li_notice_message` VALUES (8, NULL, '2021-07-15 19:31:45.000000', NULL, NULL, '2021-07-15 19:31:49.000000', '售后单 #{商品名称} 已经提交成功,需要商家审核,请耐心等待哦~', '售后提交成功通知', 'OPEN', '售后提交成功通知', 'goods');
INSERT INTO `li_notice_message` VALUES (9, NULL, '2021-07-15 19:32:44.000000', NULL, NULL, '2021-07-15 19:32:49.000000', '售后单 #{商品名称} 已通过退货审核,请尽快安排将货物退还至商家哦~', '退货审核通过通知', 'OPEN', '退货审核通过通知', 'goods');
INSERT INTO `li_notice_message` VALUES (10, NULL, '2021-07-15 19:32:46.000000', NULL, NULL, '2021-07-15 19:32:52.000000', '售后单 #{商品名称} 已通过退款审核将在1-3个工作日内自动退款~', '退款审核通过通知', 'OPEN', '退款审核通过通知', 'goods');
INSERT INTO `li_notice_message` VALUES (11, NULL, '2021-07-15 19:36:48.000000', NULL, NULL, '2021-07-15 19:36:50.000000', '很抱歉,售后单#{商品名称}未通过商家退货审核,原因是:#{拒绝原因}', '退货审核未通过通知', 'OPEN', '退货审核未通过通知', 'goods,refuse');
INSERT INTO `li_notice_message` VALUES (12, NULL, '2021-07-15 19:36:46.000000', NULL, NULL, '2021-07-15 19:36:52.000000', '很抱歉,售后单#{商品名称}未通过商家退款审核,原因是:#{拒绝原因}', '退款审核未通过通知', 'OPEN', '退款审核未通过通知', 'goods,refuse');
INSERT INTO `li_notice_message` VALUES (13, NULL, '2021-07-15 19:39:31.000000', NULL, NULL, '2021-07-15 19:39:34.000000', '很抱歉,您的退货物品{退单第一行商品名称}被商家拒收,原因是:#{拒绝原因}', '退货物品拒收通知', 'OPEN', '退货物品拒收通知', 'goods,refuse');
INSERT INTO `li_notice_message` VALUES (14, NULL, '2021-07-15 19:39:39.000000', NULL, NULL, '2021-07-15 19:39:43.000000', '订单 #{商品名称} 商家已签收哦请关注后续退款状态将在1-3个工作日内自动退款~', '退货物品签收通知', 'OPEN', '退货物品签收通知', 'goods');
INSERT INTO `li_notice_message` VALUES (15, NULL, '2021-07-15 19:44:38.000000', NULL, NULL, '2021-07-15 19:44:40.000000', '售后单 #{商品名称} 已经完成,请关注及时关注售后单状态~', '售后完成通知', 'OPEN', '售后完成通知', 'goods');
INSERT INTO `li_notice_message` VALUES (16, NULL, '2021-07-15 19:47:27.000000', NULL, NULL, '2021-07-15 19:47:31.000000', '您当前到账{获得积分}积分,消费#{消费积分} 积分,积分可以抵现金哦,真的很棒棒呢~', '积分变更通知', 'OPEN', '积分变更通知', 'income_points,expenditure_points');
INSERT INTO `li_notice_message` VALUES (17, NULL, '2021-07-15 19:53:10.000000', NULL, NULL, '2021-07-15 19:53:13.000000', '您的余额账户今日收入¥#{收入金额},支出¥#{支出金额},如遇异常变动,请及时联系我们哦~', '余额账户变更通知', 'OPEN', '余额账户变更通知', 'income,expenditure');
INSERT INTO `li_notice_message` VALUES (18, NULL, '2021-07-15 19:57:01.000000', NULL, NULL, '2021-07-15 19:57:04.000000', '恭喜您,您的提处理成功,提现金额为¥#{收入金额},请及时关注余额变动哦~', '余额提现成功通知', 'OPEN', '余额提现成功通知', 'income');
INSERT INTO `li_notice_message` VALUES (19, NULL, '2021-07-21 18:58:10.000000', NULL, NULL, '2021-07-21 18:58:13.000000', '恭喜您,您的提现金额为¥#{金额}的申请已经提交审核,请及时关注审核动态哦~', '提现申请提交成功通知', 'OPEN', '提现申请提交成功通知', 'price');
INSERT INTO `li_notice_message` VALUES (20, NULL, '2021-07-21 19:16:58.000000', NULL, NULL, '2021-07-21 19:17:02.000000', '很抱歉,您的提现金额为¥#{金额}的申请已被拒绝,如有问题请及时联系管理员哦~', '提现申请驳回通知', 'OPEN', '提现申请驳回通知', 'price');
INSERT INTO `li_notice_message` VALUES (21, NULL, '2021-07-26 18:59:00.000000', NULL, NULL, '2021-07-26 18:59:03.000000', '恭喜您,您的提处理成功,提现金额为¥#{收入金额}将在1-3个工作日内到账~', '微信提现成功通知', 'OPEN', '微信提现成功通知', 'income');
COMMIT;
SET FOREIGN_KEY_CHECKS = 1;

59666
DB/lilishop.sql Normal file

File diff suppressed because one or more lines are too long

124
DB/version4.0to4.1.sql Normal file
View File

@ -0,0 +1,124 @@
/** 修改文章表**/
ALTER TABLE li_article DROP COLUMN open_status;
ALTER TABLE li_article ADD open_status bit ( 1 );
UPDATE li_article SET open_status = 1;
/** 增加会员等级会员经验值**/
ALTER TABLE li_member ADD grade_id VARCHAR ( 32 );
ALTER TABLE li_member ADD experience BIGINT;
/**去除商品运费承担**/
ALTER TABLE li_goods DROP COLUMN freight_payer;
/**添加商品类型**/
ALTER TABLE li_goods ADD goods_type VARCHAR ( 32 );
ALTER TABLE li_goods_sku ADD goods_type VARCHAR ( 32 );
ALTER TABLE li_specification ADD spec_value text;
UPDATE li_goods SET goods_type = "PHYSICAL_GOODS";
UPDATE li_goods_sku SET goods_type = "PHYSICAL_GOODS";
/**增加优惠券有效期类型**/
ALTER TABLE li_coupon ADD range_day_type VARCHAR ( 32 );
ALTER TABLE li_coupon ADD effective_days INT;
/**秒杀增加显示商品数量**/
ALTER TABLE li_seckill ADD goods_num INT;
/**商品参数增加字段**/
ALTER TABLE li_goods_params ADD is_index INT;
/**添加优惠券活动、直播、积分商品菜单**/
DELETE FROM li_menu WHERE id = '1372391359398281216';
DELETE FROM li_menu WHERE id = '1372394573938032640';
INSERT INTO `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 (1403988156444962818, 'admin', '2021-06-13 16:10:36', b'0', 'admin', '2021-06-13 16:44:47', 'null', 'promotion/couponActivity/coupon', '', 2, 'coupon-activity', '1367049214198022144', 'coupon-activity', 0.00, '券活动', 'null');
INSERT INTO `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 (1407601962899230721, 'admin', '2021-06-23 15:30:35', b'0', NULL, NULL, NULL, 'Main', '', 1, 'liveManage', '1367040067201138688', '/', 2.00, '直播管理', NULL);
INSERT INTO `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 (1407602049759072258, 'admin', '2021-06-23 15:30:55', b'0', NULL, NULL, NULL, 'promotion/live/live', '', 2, 'live', '1407601962899230721', 'live', 1.00, '直播管理', NULL);
INSERT INTO `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 (1407602441964244994, 'admin', '2021-06-23 15:32:29', b'0', NULL, NULL, NULL, 'Main', '', 1, 'pointManage', '1367040067201138688', '/', 3.00, '积分活动', NULL);
INSERT INTO `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 (1407602516912263170, 'admin', '2021-06-23 15:32:47', b'0', NULL, NULL, NULL, 'promotion/pointsGoods/pointsGoods', '', 2, 'pointsGoods', '1407602441964244994', 'pointsGoods', 1.00, '积分商品', NULL);
INSERT INTO `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 (1407602673334636546, 'admin', '2021-06-23 15:33:24', b'0', NULL, NULL, NULL, 'promotion/pointsGoodsCategory/pointsGoodsCategory', '', 2, 'pointsGoodsCategory', '1407602441964244994', 'pointsGoodsCategory', 2.00, '积分分类', NULL);
/** 添加直播间**/
CREATE TABLE `li_studio` (
`id` bigint NOT NULL COMMENT 'ID',
`create_by` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '创建者',
`create_time` datetime(6) DEFAULT NULL COMMENT '创建时间',
`delete_flag` bit(1) DEFAULT NULL COMMENT '是否删除',
`update_by` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '修改者',
`update_time` datetime(6) DEFAULT NULL COMMENT '修改时间',
`anchor_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '主播昵称',
`anchor_wechat` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '主播微信号',
`cover_img` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '背景图',
`end_time` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '结束时间',
`feeds_img` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '封面图',
`media_url` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '回放视频链接',
`name` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '直播间名字',
`qr_code_url` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '小程序直播码',
`recommend` bit(1) DEFAULT NULL COMMENT '推荐直播间',
`room_goods_list` text CHARACTER SET utf8 COLLATE utf8_bin COMMENT '直播间商品',
`room_goods_num` int DEFAULT NULL COMMENT '直播间商品数量',
`room_id` int DEFAULT NULL COMMENT '房间ID',
`share_img` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '分享图',
`start_time` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '开始时间',
`status` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '直播间状态',
`store_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '店铺ID',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/**添加直播间商品**/
CREATE TABLE `li_commodity` (
`id` bigint NOT NULL COMMENT 'ID',
`create_by` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '创建者',
`create_time` datetime(6) DEFAULT NULL COMMENT '创建时间',
`delete_flag` bit(1) DEFAULT NULL COMMENT '是否删除',
`update_by` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '修改者',
`update_time` datetime(6) DEFAULT NULL COMMENT '修改时间',
`audit_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '审核单ID',
`audit_status` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '审核状态',
`goods_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '商品ID',
`goods_image` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '图片',
`live_goods_id` int DEFAULT NULL COMMENT '微信程序直播商品ID',
`name` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '商品名称',
`price` double DEFAULT NULL COMMENT '价格',
`price2` double DEFAULT NULL COMMENT '价格2',
`price_type` int DEFAULT NULL COMMENT '价格类型',
`sku_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '规格ID',
`store_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '店铺ID',
`url` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '商品详情页的小程序路径',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/**添加小程序直播-商品关联 **/
CREATE TABLE `li_studio_commodity` (
`id` bigint NOT NULL COMMENT 'ID',
`goods_id` int DEFAULT NULL COMMENT '商品ID',
`room_id` int DEFAULT NULL COMMENT '房间ID',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/**添加优惠券活动 **/
CREATE TABLE `li_coupon_activity` (
`id` bigint NOT NULL COMMENT 'ID',
`create_by` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '创建者',
`create_time` datetime(6) DEFAULT NULL COMMENT '创建时间',
`delete_flag` bit(1) DEFAULT NULL COMMENT '是否删除',
`update_by` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '修改者',
`update_time` datetime(6) DEFAULT NULL COMMENT '修改时间',
`end_time` datetime(6) DEFAULT NULL COMMENT '结束时间',
`promotion_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '活动名称',
`promotion_status` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '活动状态',
`start_time` datetime(6) DEFAULT NULL COMMENT '开始时间',
`store_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '店铺ID',
`store_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '店铺名称',
`activity_scope` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '活动范围',
`activity_scope_info` text CHARACTER SET utf8 COLLATE utf8_bin COMMENT '活动范围详细',
`coupon_activity_type` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '活动类型',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/**添加优惠券活动-优惠券关联 **/
CREATE TABLE `li_coupon_activity_item` (
`id` bigint NOT NULL COMMENT 'ID',
`create_by` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '创建者',
`create_time` datetime(6) DEFAULT NULL COMMENT '创建时间',
`delete_flag` bit(1) DEFAULT NULL COMMENT '是否删除',
`update_by` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '修改者',
`update_time` datetime(6) DEFAULT NULL COMMENT '修改时间',
`activity_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '活动ID',
`coupon_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '优惠券ID',
`num` int DEFAULT NULL COMMENT '优惠券数量',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/** 修改商品模板详情字段类型**/
ALTER TABLE `li_draft_goods` MODIFY COLUMN `intro` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL;
/** 添加秒杀设置**/
INSERT INTO `li_setting` ( `id`, `create_by`, `create_time`, `delete_flag`, `update_by`, `update_time`, `setting_value` ) VALUES ( 'SECKILL_SETTING', NULL, NULL, NULL, 'admin', '2021-06-04 09:58:39.384000', '{\"seckillRule\":\"秒杀规则\",\"hours\":\"9,10,11,12,13,14,15,21,22,23\"}' );
/** 添加直播间商品默认数量**/
alter table li_studio alter column room_goods_num set default 0;

28
DB/version4.1to4.2.sql Normal file
View File

@ -0,0 +1,28 @@
/** 添加分销员结算信息**/
ALTER TABLE li_distribution ADD settlement_bank_account_name varchar ( 200 );
ALTER TABLE li_distribution ADD settlement_bank_account_num varchar ( 200 );
ALTER TABLE li_distribution ADD settlement_bank_branch_name varchar ( 200 );
/** 文章分类添加默认值**/
ALTER TABLE li_article_category alter column sort set default 0;
/** 添加分销提现菜单**/
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_member_points_history modify column point_type varchar(50);
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;
/** 添加分词管理菜单*/
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_after_sale modify column after_sale_image text;
/** 提现申请审核sql **/
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);

View File

@ -0,0 +1,2 @@
/** 新增店铺客服字段 **/
ALTER TABLE li_store ADD merchant_euid varchar(255) COMMENT '客服标识';

View File

@ -0,0 +1,64 @@
/** 新增已退货数量 **/
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';

161
DB/version4.2to4.2.2.sql Normal file
View File

@ -0,0 +1,161 @@
/*
Navicat Premium Data Transfer
Source Server : 192.168.0.116
Source Server Type : MySQL
Source Server Version : 80023
Source Host : 192.168.0.116:3306
Source Schema : lilishop
Target Server Type : MySQL
Target Server Version : 80023
File Encoding : 65001
Date: 27/07/2021 17:04:46
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
/** 添加结算单积分、砍价结算价信息**/
ALTER TABLE li_bill ADD point_settlement_price double DEFAULT 0.00 COMMENT '积分商品结算金额 ';
ALTER TABLE li_bill ADD kanjia_settlement_price double DEFAULT 0.00 COMMENT '砍价商品结算金额';
ALTER TABLE li_store_flow ADD point_settlement_price double DEFAULT 0.00 COMMENT '积分商品结算金额';
ALTER TABLE li_store_flow ADD kanjia_settlement_price double DEFAULT 0.00 COMMENT '砍价商品结算金额';
ALTER TABLE li_order ADD order_promotion_type varchar(255) DEFAULT null COMMENT '订单促销类型';
/** 热词管理*/
UPDATE `lilishop`.`li_menu` SET `create_by` = 'admin', `create_time` = '2021-03-03 09:54:51', `delete_flag` = b'0', `update_by` = 'admin', `update_time` = '2021-07-23 19:07:45', `description` = 'null', `front_route` = 'page/article-manage/hotWords', `icon` = 'md-aperture', `level` = 2, `name` = 'hotKeyWord', `parent_id` = '1367050250249830400', `path` = 'hotKeyWord', `sort_order` = 0.00, `title` = '搜索热词', `front_component` = 'null' WHERE `id` = 1367050829697122304;
-- ----------------------------
-- 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 DEFAULT NULL COMMENT '创建者',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`delete_flag` bit(1) DEFAULT NULL COMMENT '删除标志 true/false 删除/未删除',
`update_by` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '更新者',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
`description` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '说明备注',
`front_route` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '前端路由',
`icon` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '图标',
`level` int DEFAULT NULL COMMENT '层级',
`name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '菜单/权限名称',
`parent_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '父id',
`path` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '赋权API地址,正则表达式',
`sort_order` decimal(10,2) DEFAULT NULL COMMENT '排序值',
`title` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '菜单标题',
`front_component` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '文件地址',
`permission` varchar(255) DEFAULT NULL COMMENT '权限url',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of li_menu
-- ----------------------------
BEGIN;
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', NULL);
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/user*,/manager/department*,/manager/role*,/manager/menu*');
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*');
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/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/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*');
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/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', NULL);
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', NULL);
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/systems/app*');
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', NULL, NULL, NULL, NULL, 'ios-hammer', 0, 'promotion', '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', NULL, NULL, 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/member*,/manager/orders*,/manager/wallet/log*,/manager/receipt*');
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/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/members/withdraw-apply*');
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, NULL);
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, NULL);
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/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/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/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/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/store/bill*');
INSERT INTO `li_menu` VALUES (1367049214198022144, 'admin', '2021-03-03 09:48:26', b'0', NULL, NULL, NULL, 'Main', 'md-aperture', 1, 'promotionManager', '1367040067201138688', '/', 0.00, '促销管理', NULL, NULL);
INSERT INTO `li_menu` VALUES (1367049384792948736, 'admin', '2021-03-03 09:49:07', b'0', 'admin', '2021-07-27 16:04:42', NULL, 'promotion/coupon/coupon', 'md-alert', 2, 'coupon', '1367049214198022144', 'coupon', 0.00, '优惠券', NULL, '/manager/promotion/coupon*');
INSERT INTO `li_menu` VALUES (1367049500782231552, 'admin', '2021-03-03 09:49:34', b'0', 'admin', '2021-07-27 16:04:53', 'null', 'promotion/fullCut/full-cut', 'md-alert', 2, 'fullCut', '1367049214198022144', 'fullCut', 1.00, '满额活动', 'null', '/manager/promotion/fullDiscount*');
INSERT INTO `li_menu` VALUES (1367049611578966016, 'admin', '2021-03-03 09:50:01', b'0', 'admin', '2021-07-27 16:04:58', 'null', 'promotion/seckill/seckill', 'md-alert', 2, 'seckill', '1367049214198022144', 'seckill', 2.00, '秒杀活动', 'null', '/manager/promotion/seckill*');
INSERT INTO `li_menu` VALUES (1367049712657498112, 'admin', '2021-03-03 09:50:25', b'0', 'admin', '2021-07-27 16:05:02', 'null', 'promotion/pintuan/pintuan', 'md-alert', 2, 'pintuan', '1367049214198022144', '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', NULL);
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', NULL);
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/article-category*');
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/article-category*,/manager/article*');
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/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/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/store/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/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/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/noticeMessage*,/manager/message*,/manager/store*,/manager/member*');
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*,/manager/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/message/wechat*,/manager/message/wechatMPMessage*');
INSERT INTO `li_menu` VALUES (1403988156444962818, 'admin', '2021-06-13 16:10:36', b'0', 'admin', '2021-07-27 16:04:48', 'null', 'promotion/couponActivity/coupon', '', 2, 'coupon-activity', '1367049214198022144', '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', NULL, NULL, NULL, 'promotion/live/live', '', 2, 'live', '1407601962899230721', '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-07-27 16:05:14', NULL, 'promotion/pointsGoods/pointsGoods', '', 2, 'pointsGoods', '1407602441964244994', 'pointsGoods', 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-07-27 16:05:18', NULL, 'promotion/pointsGoodsCategory/pointsGoodsCategory', '', 2, 'pointsGoodsCategory', '1407602441964244994', 'pointsGoodsCategory', 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/manager/custom-words*');
COMMIT;
SET FOREIGN_KEY_CHECKS = 1;
/** 新增会员获的总积分 **/
ALTER TABLE li_member ADD total_point bigint ( 20 ) DEFAULT 0 COMMENT '积分总数量';

674
LICENSE Normal file
View File

@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

158
README.md Normal file
View File

@ -0,0 +1,158 @@
## Lilishop B2B2C商城系统
##### 开源不易如有帮助请点Star
#### 欢迎交流需求,交流业务,交流技术(基础问题自行解决,进群先看文档后提问)
##### 交流 qq 1群 961316482已满
##### 交流 qq 2群 875294241
##### 体验 公众号/小程序/APP 体验,扫描二维码
![image-20210511171611793](https://pickmall.cn/assets/imgs/h5-qrcode.png)
[![star](https://gitee.com/beijing_hongye_huicheng/lilishop/badge/star.svg?theme=dark)](https://gitee.com/beijing_hongye_huicheng/lilishop/stargazers)
&nbsp;&nbsp;![github](https://img.shields.io/github/stars/hongyehuicheng/lilishop.svg?style=social&logo=#181717)
### 商城介绍
**官网**https://pickmall.cn
Lilishop商城系统支持商家入驻后端基于SpringBoot 研发,前端使用 Vue、uniapp开发 **系统全端全部代码开源**
商城前后端分离支持分布式部署支持Docker各个API独立并且有独立的消费者。
### 商城 API/消费者 聚合版
api不需要单独部署只需启动一个jar包就可以正常运转 如有需要,可以点击跳转
https://gitee.com/beijing_hongye_huicheng/lilishop-simplify
### 商城 开发/使用/常见问题 帮助文档
https://docs.pickmall.cn
### 项目地址
gitee : https://gitee.com/beijing_hongye_huicheng
github 镜像: https://github.com/lilishop?tab=repositories
商城UI 项目下3个文件夹
buyer买家PC端seller商家端manager后台管理端
### 演示地址
PS手机验证码为 111111
**平台管理端**https://admin-b2b2c.pickmall.cn 账号admin/123456
**店铺管理端**https://store-b2b2c.pickmall.cn 账号13011111111/111111
**商城PC页面**https://pc-b2b2c.pickmall.cn
**商城 小程序/公众号/APP**:扫描二维码
![image-20210511171611793](https://pickmall.cn/assets/imgs/h5-qrcode.png)
### 快速部署本地商城
[点击跳转](https://docs.pickmall.cn/deploy/%E8%BF%90%E8%A1%8C%E7%8E%AF%E5%A2%83%E5%87%86%E5%A4%87.html)
**商城数据库**
使用docker-compose部署数据库自动初始化数据库不需要手动下载等操作
如果手动部署才需要获取sql [点击跳转](https://gitee.com/beijing_hongye_huicheng/docker/tree/master/init/mysql) PS这里有与tag版本一致的sql如果是历史版本则docker项目也切换至历史版本获取sql即可历史版本升级则根据java相聚的根目录DB目录下的升级sql按需执行
### 功能列表
#### 平台管理端功能
![平台管理端功能](https://pickmall.cn/assets/imgs/other/managerList1.jpg)
#### 卖家功能
![商家端功能](https://pickmall.cn/assets/imgs/other/storeList.jpg)
### 商城前端功能展示
#### 商城移动端
<img src="https://pickmall.cn/assets/imgs/other/app.gif" alt="移动端功能展示" style="zoom:50%;" />
#### 平台管理端
![管理端功能展示](https://pickmall.cn/assets/imgs/other/manager.gif)
### 技术选型
#### 架构图
![技术选型](https://lili-system.oss-cn-beijing.aliyuncs.com/docs/%E6%9E%B6%E6%9E%84.png)
##### 后台技术选型
| 说明 | 框架 | 说明 | |
| -------------- | --------------- | -------------- | ------------- |
| 基础框架 | Spring Boot | MVC框架 | Spring MVC |
| 持久框架 | Mybatis-Plus | 程序构建 | Maven |
| 关系型数据库 | MySQL | 消息中间件AMQP | RocketMQ |
| 缓存 | Redis +MongoDB | 搜索引擎 | Elasticsearch |
| 安全框架 | Spring Security | 数据库连接池 | Druid |
| 数据库分库分表 | sharding | 定时任务 | xxl-job |
| 负载均衡 | Nginx | 静态资源 | 阿里云OSS |
| 短信 | 阿里云短信 | 认证 | JWT |
| 日志处理 | Log4j | 接口规范 | RESTful |
##### 前端-运营后台、店铺后台
| 说明 | 框架 | 说明 | 框架 |
| ---------- | ---------- | ---------- | ------- |
| 构建工具 | webpack | JS版本 | ES6 |
| 基础JS框架 | Vue.js | 视频播放器 | Dplayer |
| 路由管理 | Vue Router | 状态管理 | Vuex |
| 基础UI库 | iView | UI界面基于 | iView |
| 网络请求 | axios | | |
##### 前端-移动端
| 说明 | 架构 | 说明 | 架构 |
| --------- | ------- | -------- | ------- |
| 基础UI库 | uViewui | 基础框架 | uni-app |
| CSS预处理 | scss | 地图引擎 | amap |
### 版本升级
```
商城后续会持续版本升级修复bug完善功能覆盖更多业务场景 o2o/b2b/s2b2b2c/跨境电商
后续会考虑推出微服务商城系统/商城中台等
```
### 开源须知
1.仅允许用于个人学习研究使用.
2.禁止将本开源的代码和资源进行任何形式任何名义的出售.
3.软件受国家计算机软件著作权保护登记号2021SR0805085
4.限制商用如果需要商业使用请联系我们。QQ3409056806.
### 交流群
##### 官方qq 1群 961316482已满
##### 官方qq 2群 875294241

33
admin/.gitignore vendored Normal file
View File

@ -0,0 +1,33 @@
HELP.md
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/
### VS Code ###
.vscode/

View File

@ -0,0 +1,118 @@
/*
* Copyright 2007-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import java.net.*;
import java.io.*;
import java.nio.channels.*;
import java.util.Properties;
public class MavenWrapperDownloader {
private static final String WRAPPER_VERSION = "0.5.6";
/**
* Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
*/
private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/"
+ WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar";
/**
* Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
* use instead of the default one.
*/
private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
".mvn/wrapper/maven-wrapper.properties";
/**
* Path where the maven-wrapper.jar will be saved to.
*/
private static final String MAVEN_WRAPPER_JAR_PATH =
".mvn/wrapper/maven-wrapper.jar";
/**
* Name of the property which should be used to override the default download url for the wrapper.
*/
private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";
public static void main(String args[]) {
System.out.println("- Downloader started");
File baseDirectory = new File(args[0]);
System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());
// If the maven-wrapper.properties exists, read it and check if it contains a custom
// wrapperUrl parameter.
File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
String url = DEFAULT_DOWNLOAD_URL;
if (mavenWrapperPropertyFile.exists()) {
FileInputStream mavenWrapperPropertyFileInputStream = null;
try {
mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
Properties mavenWrapperProperties = new Properties();
mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
} catch (IOException e) {
System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
} finally {
try {
if (mavenWrapperPropertyFileInputStream != null) {
mavenWrapperPropertyFileInputStream.close();
}
} catch (IOException e) {
// Ignore ...
}
}
}
System.out.println("- Downloading from: " + url);
File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
if (!outputFile.getParentFile().exists()) {
if (!outputFile.getParentFile().mkdirs()) {
System.out.println(
"- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'");
}
}
System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
try {
downloadFileFromURL(url, outputFile);
System.out.println("Done");
System.exit(0);
} catch (Throwable e) {
System.out.println("- Error downloading");
e.printStackTrace();
System.exit(1);
}
}
private static void downloadFileFromURL(String urlString, File destination) throws Exception {
if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) {
String username = System.getenv("MVNW_USERNAME");
char[] password = System.getenv("MVNW_PASSWORD").toCharArray();
Authenticator.setDefault(new Authenticator() {
@Override
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(username, password);
}
});
}
URL website = new URL(urlString);
ReadableByteChannel rbc;
rbc = Channels.newChannel(website.openStream());
FileOutputStream fos = new FileOutputStream(destination);
fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
fos.close();
rbc.close();
}
}

BIN
admin/.mvn/wrapper/maven-wrapper.jar vendored Normal file

Binary file not shown.

View File

@ -0,0 +1,2 @@
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar

50
admin/pom.xml Normal file
View File

@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>cn.lili</groupId>
<artifactId>lili-shop-parent</artifactId>
<version>${revision}</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>admin</artifactId>
<dependencies>
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-starter-server</artifactId>
<version>${spring-boot-admin}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>net.logstash.logback</groupId>
<artifactId>logstash-logback-encoder</artifactId>
<version>${logstash-logback-encoder}</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.springframework.boot</groupId>-->
<!-- <artifactId>spring-boot-starter-mail</artifactId>-->
<!-- </dependency> -->
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,56 @@
package cn.lili.admin;
import de.codecentric.boot.admin.server.config.AdminServerProperties;
import de.codecentric.boot.admin.server.config.EnableAdminServer;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.Customizer;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler;
import java.util.UUID;
/**
* Admin
*
* @author Chopper
* @since 2020/11/16 10:03 下午
*/
@Configuration
@EnableAutoConfiguration
@EnableAdminServer
public class AdminApplication {
public static void main(String[] args) {
SpringApplication.run(AdminApplication.class, args);
}
@Configuration
public class SecuritySecureConfig extends WebSecurityConfigurerAdapter {
private final AdminServerProperties adminServer;
public SecuritySecureConfig(AdminServerProperties adminServer) {
this.adminServer = adminServer;
}
@Override
protected void configure(HttpSecurity http) throws Exception {
SavedRequestAwareAuthenticationSuccessHandler successHandler = new SavedRequestAwareAuthenticationSuccessHandler();
successHandler.setTargetUrlParameter("redirectTo");
successHandler.setDefaultTargetUrl(this.adminServer.path("/"));
http.authorizeRequests().antMatchers("/instances**").permitAll();
http.authorizeRequests(
(authorizeRequests) -> authorizeRequests.antMatchers(this.adminServer.path("/assets/**")).permitAll() //授予公众对所有静态资产和登录页面的访问权限
.antMatchers(this.adminServer.path("/login")).permitAll().anyRequest().authenticated() //其他所有请求都必须经过验证
).formLogin(
(formLogin) -> formLogin.loginPage(this.adminServer.path("/login")).successHandler(successHandler).and() //配置登录和注销
).logout((logout) -> logout.logoutUrl(this.adminServer.path("/logout"))).httpBasic(Customizer.withDefaults()) //启用HTTP基本支持这是Spring Boot Admin Client注册所必需的
.csrf().disable()
.rememberMe((rememberMe) -> rememberMe.key(UUID.randomUUID().toString()).tokenValiditySeconds(1209600));
}
}
}

View File

@ -0,0 +1,20 @@
# 应用程序名称
spring.application.name=SpringBootAdmin
# 应用程序端口
server.port=8000
management.endpoints.web.exposure.include=*
management.endpoint.health.show-details=always
#账号密码
spring.security.user.name=admin
spring.security.user.password=admin
spring.mail.host=smtp.qq.com
# to和from都要配置否则发送邮件时会报错
spring.boot.admin.notify.mail.to=1814994716@qq.com
spring.boot.admin.notify.mail.from=1814994716@qq.com
# 邮件的用户名和密码
spring.mail.username=1814994716@qq.com
spring.mail.password=abcdefg123456!@#$%^
# 日志文件路径
logging.file.path=lili-logs/admin
# 文件格式
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

View File

@ -0,0 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE configuration>
<configuration>
<include resource="org/springframework/boot/logging/logback/defaults.xml"/>
<include resource="org/springframework/boot/logging/logback/console-appender.xml"/>
<!--应用名称-->
<springProperty scope="context" name="APP_NAME" source="spring.application.name"/>
<!--日志文件保存路径-->
<springProperty scope="context" name="LOG_FILE_PATH" source="logging.file.path"/>
<springProperty scope="context" name="LOGSTASH_SERVER" source="lili.data.logstash.server"/>
<contextName>${APP_NAME}</contextName>
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${LOG_FILE_PATH}/${APP_NAME}-%d{yyyy-MM-dd}.log</fileNamePattern>
<maxHistory>30</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${FILE_LOG_PATTERN}</pattern>
</encoder>
</appender>
<!--输出到elk的LOGSTASH-->
<appender name="LOGSTASH" class="net.logstash.logback.appender.LogstashTcpSocketAppender">
<!-- 配置elk日志收集 配饰的是 LOGSTASH 的地址-->
<destination>${LOGSTASH_SERVER}</destination>
<encoder charset="UTF-8" class="net.logstash.logback.encoder.LogstashEncoder">
<providers>
<timestamp>
<timeZone>UTC</timeZone>
</timestamp>
</providers>
<!--自定义字段 区分项目-->
<customFields>{"appName":"${APP_NAME}"}</customFields>
</encoder>
</appender>
<!-- <root level="INFO">-->
<root>
<appender-ref ref="CONSOLE"/>
<appender-ref ref="FILE"/>
<appender-ref ref="LOGSTASH"/>
</root>
</configuration>

36
buyer-api/pom.xml Normal file
View File

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>buyer-api</artifactId>
<parent>
<groupId>cn.lili</groupId>
<artifactId>lili-shop-parent</artifactId>
<version>${revision}</version>
<relativePath>../pom.xml</relativePath>
</parent>
<dependencies>
<dependency>
<groupId>cn.lili</groupId>
<artifactId>framework</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>com.jfinal</groupId>
<artifactId>enjoy</artifactId>
<version>${enjoy.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,34 @@
package cn.lili;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Primary;
import org.springframework.core.task.TaskExecutor;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
/**
* 买家API
*
* @author Chopper
* @since 2020/11/16 10:03 下午
*/
@SpringBootApplication
@EnableCaching
@EnableAsync
public class BuyerApiApplication {
@Primary
@Bean
public TaskExecutor primaryTaskExecutor() {
return new ThreadPoolTaskExecutor();
}
public static void main(String[] args) {
System.setProperty("es.set.netty.runtime.available.processors", "false");
SpringApplication.run(BuyerApiApplication.class, args);
}
}

View File

@ -0,0 +1,70 @@
package cn.lili.controller.distribution;
import cn.lili.common.enums.ResultUtil;
import cn.lili.common.vo.ResultMessage;
import cn.lili.modules.distribution.entity.dos.Distribution;
import cn.lili.modules.distribution.entity.dos.DistributionOrder;
import cn.lili.modules.distribution.entity.dto.DistributionApplyDTO;
import cn.lili.modules.distribution.entity.vos.DistributionOrderSearchParams;
import cn.lili.modules.distribution.service.DistributionOrderService;
import cn.lili.modules.distribution.service.DistributionService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
* 买家端,分销员接口
*
* @author pikachu
* @since 2020/11/16 10:03 下午
*/
@RestController
@Api(tags = "买家端,分销员接口")
@RequestMapping("/buyer/distribution")
public class DistributionBuyerController {
/**
* 分销员
*/
@Autowired
private DistributionService distributionService;
/**
* 分销员订单
*/
@Autowired
private DistributionOrderService distributionOrderService;
@ApiOperation(value = "申请分销员")
@PostMapping
public ResultMessage<Object> applyDistribution(DistributionApplyDTO distributionApplyDTO) {
return ResultUtil.data(distributionService.applyDistribution(distributionApplyDTO));
}
@ApiOperation(value = "获取分销员分页订单列表")
@GetMapping("/distributionOrder")
public ResultMessage<IPage<DistributionOrder>> distributionOrderPage(DistributionOrderSearchParams distributionOrderSearchParams) {
distributionOrderSearchParams.setDistributionId(distributionService.getDistribution().getId());
return ResultUtil.data(distributionOrderService.getDistributionOrderPage(distributionOrderSearchParams));
}
@ApiOperation(value = "获取当前会员的分销员信息", notes = "可根据分销员信息查询待提现金额以及冻结金额等信息")
@GetMapping
public ResultMessage<Distribution> getDistribution() {
//检查分销开关
distributionService.checkDistributionSetting();
return ResultUtil.data(distributionService.getDistribution());
}
@ApiOperation(value = "绑定分销员")
@ApiImplicitParam(name = "distributionId", value = "分销员ID", required = true, paramType = "path")
@GetMapping("/bindingDistribution/{distributionId}")
public ResultMessage<Object> bindingDistribution(@PathVariable String distributionId){
distributionService.bindingDistribution(distributionId);
return ResultUtil.success();
}
}

View File

@ -0,0 +1,75 @@
package cn.lili.controller.distribution;
import cn.lili.common.aop.annotation.PreventDuplicateSubmissions;
import cn.lili.common.enums.ResultCode;
import cn.lili.common.enums.ResultUtil;
import cn.lili.common.exception.ServiceException;
import cn.lili.common.vo.PageVO;
import cn.lili.common.vo.ResultMessage;
import cn.lili.modules.distribution.entity.dos.DistributionCash;
import cn.lili.modules.distribution.service.DistributionCashService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
/**
* 买家端,分销商品佣金提现接口
*
* @author pikachu
* @since 2020/11/16 10:03 下午
*/
@RestController
@Api(tags = "买家端,分销商品佣金提现接口")
@RequestMapping("/buyer/distribution/cash")
@Validated
public class DistributionCashBuyerController {
/**
* 分销佣金
*/
@Autowired
private DistributionCashService distributionCashService;
/**
* 分销员提现
*/
@Autowired
private DistributionCashService distributorCashService;
@PreventDuplicateSubmissions
@ApiOperation(value = "分销员提现")
@ApiImplicitParams({
@ApiImplicitParam(name = "price", value = "申请金额", required = true, paramType = "query", dataType = "double")
})
@PostMapping
public ResultMessage<Object> cash(@Validated @Max(value = 9999, message = "提现金额单次最多允许提现9999元")
@Min(value = 1, message = "提现金额单次最少提现金额为1元")
@NotNull @ApiIgnore Double price) {
if (Boolean.TRUE.equals(distributionCashService.cash(price))) {
return ResultUtil.success();
}
throw new ServiceException(ResultCode.ERROR);
}
@ApiOperation(value = "分销员提现历史")
@GetMapping
public ResultMessage<IPage<DistributionCash>> casHistory(PageVO page) {
return ResultUtil.data(distributorCashService.getDistributionCash(page));
}
}

View File

@ -0,0 +1,77 @@
package cn.lili.controller.distribution;
import cn.lili.common.aop.annotation.PreventDuplicateSubmissions;
import cn.lili.common.enums.ResultCode;
import cn.lili.common.enums.ResultUtil;
import cn.lili.common.exception.ServiceException;
import cn.lili.common.vo.ResultMessage;
import cn.lili.modules.distribution.entity.dto.DistributionGoodsSearchParams;
import cn.lili.modules.distribution.entity.vos.DistributionGoodsVO;
import cn.lili.modules.distribution.service.DistributionGoodsService;
import cn.lili.modules.distribution.service.DistributionSelectedGoodsService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.validation.constraints.NotNull;
/**
* 买家端,分销商品接口
*
* @author Bulbasaur
* @since 2020/11/16 10:06 下午
*/
@RestController
@Api(tags = "买家端,分销商品接口")
@RequestMapping("/buyer/distributionGoods")
public class DistributionGoodsBuyerController {
/**
* 分销商品
*/
@Autowired
private DistributionGoodsService distributionGoodsService;
/**
* 选择分销商品
*/
@Autowired
private DistributionSelectedGoodsService distributionSelectedGoodsService;
@ApiOperation(value = "获取分销商商品列表")
@GetMapping
public ResultMessage<IPage<DistributionGoodsVO>> distributionGoods(DistributionGoodsSearchParams distributionGoodsSearchParams) {
return ResultUtil.data(distributionGoodsService.goodsPage(distributionGoodsSearchParams));
}
@PreventDuplicateSubmissions
@ApiOperation(value = "选择分销商品")
@ApiImplicitParams({
@ApiImplicitParam(name = "distributionGoodsId", value = "分销ID", required = true, dataType = "String", paramType = "path"),
@ApiImplicitParam(name = "checked", value = "是否选择", required = true, dataType = "boolean", paramType = "query")
})
@GetMapping(value = "/checked/{distributionGoodsId}")
public ResultMessage<Object> distributionCheckGoods(
@NotNull(message = "分销商品不能为空") @PathVariable("distributionGoodsId") String distributionGoodsId,Boolean checked) {
Boolean result=false;
if(checked){
result=distributionSelectedGoodsService.add(distributionGoodsId);
}else {
result=distributionSelectedGoodsService.delete(distributionGoodsId);
}
//判断操作结果
if(result){
return ResultUtil.success(ResultCode.SUCCESS);
}else{
throw new ServiceException(ResultCode.ERROR);
}
}
}

View File

@ -0,0 +1,50 @@
package cn.lili.controller.distribution;
import cn.lili.common.enums.ResultUtil;
import cn.lili.common.vo.ResultMessage;
import cn.lili.modules.distribution.entity.dos.DistributionOrder;
import cn.lili.modules.distribution.entity.vos.DistributionOrderSearchParams;
import cn.lili.modules.distribution.service.DistributionOrderService;
import cn.lili.modules.distribution.service.DistributionService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 买家端,分销商品佣金提现接口
*
* @author pikachu
* @since 2020/11/16 10:03 下午
*/
@RestController
@Api(tags = "买家端,分销订单接口")
@RequestMapping("/buyer/distribution/order")
public class DistributionOrderBuyerController {
/**
* 分销订单
*/
@Autowired
private DistributionOrderService distributionOrderService;
/**
* 分销员
*/
@Autowired
private DistributionService distributionService;
@ApiOperation(value = "分销员订单")
@GetMapping
public ResultMessage<IPage<DistributionOrder>> casHistory(DistributionOrderSearchParams distributionOrderSearchParams) {
//获取当前登录的分销员
distributionOrderSearchParams.setDistributionId(distributionService.getDistribution().getId());
return ResultUtil.data(distributionOrderService.getDistributionOrderPage(distributionOrderSearchParams));
}
}

View File

@ -0,0 +1,43 @@
package cn.lili.controller.goods;
import cn.lili.common.enums.ResultUtil;
import cn.lili.common.vo.ResultMessage;
import cn.lili.modules.goods.entity.vos.CategoryVO;
import cn.lili.modules.goods.service.CategoryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.validation.constraints.NotNull;
import java.util.List;
/**
* 买家端,商品分类接口
*
* @author Chopper
* @since 2020/11/16 10:05 下午
*/
@RestController
@Api(tags = "买家端,商品分类接口")
@RequestMapping("/buyer/category")
public class CategoryBuyerController {
/**
* 商品分类
*/
@Autowired
private CategoryService categoryService;
@ApiOperation(value = "获取商品分类列表")
@ApiImplicitParam(name = "parentId", value = "上级分类ID全部分类为0", required = true, dataType = "Long", paramType = "path")
@GetMapping(value = "/get/{parentId}")
public ResultMessage<List<CategoryVO>> list(@NotNull(message = "分类ID不能为空") @PathVariable String parentId) {
return ResultUtil.data(categoryService.listAllChildren(parentId));
}
}

View File

@ -0,0 +1,124 @@
package cn.lili.controller.goods;
import cn.lili.common.enums.ResultCode;
import cn.lili.common.enums.ResultUtil;
import cn.lili.common.exception.ServiceException;
import cn.lili.common.vo.PageVO;
import cn.lili.common.vo.ResultMessage;
import cn.lili.modules.goods.entity.dos.Goods;
import cn.lili.modules.goods.entity.dto.GoodsSearchParams;
import cn.lili.modules.goods.entity.vos.GoodsVO;
import cn.lili.modules.goods.service.GoodsService;
import cn.lili.modules.goods.service.GoodsSkuService;
import cn.lili.modules.search.entity.dos.EsGoodsIndex;
import cn.lili.modules.search.entity.dos.EsGoodsRelatedInfo;
import cn.lili.modules.search.entity.dto.EsGoodsSearchDTO;
import cn.lili.modules.search.service.EsGoodsSearchService;
import cn.lili.modules.statistics.aop.PageViewPoint;
import cn.lili.modules.statistics.aop.enums.PageViewEnum;
import com.baomidou.mybatisplus.core.metadata.IPage;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.elasticsearch.core.SearchPage;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.validation.constraints.NotNull;
import java.util.List;
import java.util.Map;
/**
* 买家端,商品接口
*
* @author Chopper
* @since 2020/11/16 10:06 下午
*/
@Slf4j
@Api(tags = "买家端,商品接口")
@RestController
@RequestMapping("/buyer/goods")
public class GoodsBuyerController {
/**
* 商品
*/
@Autowired
private GoodsService goodsService;
/**
* 商品SKU
*/
@Autowired
private GoodsSkuService goodsSkuService;
/**
* ES商品搜索
*/
@Autowired
private EsGoodsSearchService goodsSearchService;
@ApiOperation(value = "通过id获取商品信息")
@ApiImplicitParam(name = "goodsId", value = "商品ID", required = true, paramType = "path", dataType = "Long")
@GetMapping(value = "/get/{goodsId}")
public ResultMessage<GoodsVO> get(@NotNull(message = "商品ID不能为空") @PathVariable("goodsId") String id) {
return ResultUtil.data(goodsService.getGoodsVO(id));
}
@ApiOperation(value = "通过id获取商品信息")
@ApiImplicitParams({
@ApiImplicitParam(name = "goodsId", value = "商品ID", required = true, paramType = "path"),
@ApiImplicitParam(name = "skuId", value = "skuId", required = true, paramType = "path")
})
@GetMapping(value = "/sku/{goodsId}/{skuId}")
@PageViewPoint(type = PageViewEnum.SKU, id = "#id")
public ResultMessage<Map<String, Object>> getSku(@NotNull(message = "商品ID不能为空") @PathVariable("goodsId") String goodsId,
@NotNull(message = "SKU ID不能为空") @PathVariable("skuId") String skuId) {
try {
// 读取选中的列表
Map<String, Object> map = goodsSkuService.getGoodsSkuDetail(goodsId, skuId);
return ResultUtil.data(map);
} catch (ServiceException se) {
log.info(se.getMsg(), se);
throw se;
} catch (Exception e) {
log.error(ResultCode.GOODS_ERROR.message(), e);
return ResultUtil.error(ResultCode.GOODS_ERROR);
}
}
@ApiOperation(value = "获取商品分页列表")
@GetMapping
public ResultMessage<IPage<Goods>> getByPage(GoodsSearchParams goodsSearchParams) {
return ResultUtil.data(goodsService.queryByParams(goodsSearchParams));
}
@ApiOperation(value = "从ES中获取商品信息")
@GetMapping("/es")
public ResultMessage<SearchPage<EsGoodsIndex>> getGoodsByPageFromEs(EsGoodsSearchDTO goodsSearchParams, PageVO pageVO) {
pageVO.setNotConvert(true);
SearchPage<EsGoodsIndex> esGoodsIndices = goodsSearchService.searchGoods(goodsSearchParams, pageVO);
return ResultUtil.data(esGoodsIndices);
}
@ApiOperation(value = "从ES中获取相关商品品牌名称分类名称及属性")
@GetMapping("/es/related")
public ResultMessage<EsGoodsRelatedInfo> getGoodsRelatedByPageFromEs(EsGoodsSearchDTO goodsSearchParams, PageVO pageVO) {
pageVO.setNotConvert(true);
EsGoodsRelatedInfo selector = goodsSearchService.getSelector(goodsSearchParams, pageVO);
return ResultUtil.data(selector);
}
@ApiOperation(value = "获取搜索热词")
@GetMapping("/hot-words")
public ResultMessage<List<String>> getGoodsHotWords(Integer count) {
List<String> hotWords = goodsSearchService.getHotWords(count);
return ResultUtil.data(hotWords);
}
}

View File

@ -0,0 +1,63 @@
package cn.lili.controller.member;
import cn.lili.common.enums.ResultUtil;
import cn.lili.common.vo.PageVO;
import cn.lili.common.vo.ResultMessage;
import cn.lili.modules.member.service.FootprintService;
import cn.lili.modules.search.entity.dos.EsGoodsIndex;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.validation.constraints.NotNull;
import java.util.List;
/**
* 买家端,浏览历史接口
*
* @author Chopper
* @since 2020/11/16 10:06 下午
*/
@RestController
@Api(tags = "买家端,浏览历史接口")
@RequestMapping("/buyer/footprint")
public class FootprintController {
/**
* 会员足迹
*/
@Autowired
private FootprintService footprintService;
@ApiOperation(value = "分页获取")
@GetMapping
public ResultMessage<List<EsGoodsIndex>> getByPage(PageVO page) {
return ResultUtil.data(footprintService.footPrintPage(page));
}
@ApiOperation(value = "根据id删除")
@ApiImplicitParam(name = "ids", value = "商品ID", required = true, allowMultiple = true, dataType = "String", paramType = "path")
@DeleteMapping(value = "/delByIds/{ids}")
public ResultMessage<Object> delAllByIds(@NotNull(message = "商品ID不能为空") @PathVariable("ids") List ids) {
footprintService.deleteByIds(ids);
return ResultUtil.success();
}
@ApiOperation(value = "清空足迹")
@DeleteMapping
public ResultMessage<Object> deleteAll() {
footprintService.clean();
return ResultUtil.success();
}
@ApiOperation(value = "获取当前会员足迹数量")
@GetMapping(value = "/getFootprintNum")
public ResultMessage<Object> getFootprintNum() {
return ResultUtil.data(footprintService.getFootprintNum());
}
}

View File

@ -0,0 +1,83 @@
package cn.lili.controller.member;
import cn.lili.common.enums.ResultUtil;
import cn.lili.common.security.OperationalJudgment;
import cn.lili.common.security.context.UserContext;
import cn.lili.common.vo.PageVO;
import cn.lili.common.vo.ResultMessage;
import cn.lili.modules.member.entity.dos.MemberAddress;
import cn.lili.modules.member.service.MemberAddressService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.Objects;
/**
* 买家端,会员地址接口
*
* @author Bulbasaur
* @since 2020/11/16 10:07 下午
*/
@RestController
@Api(tags = "买家端,会员地址接口")
@RequestMapping("/buyer/memberAddress")
public class MemberAddressBuyerController {
/**
* 会员收件地址
*/
@Autowired
private MemberAddressService memberAddressService;
@ApiOperation(value = "获取会员收件地址分页列表")
@GetMapping
public ResultMessage<IPage<MemberAddress>> page(PageVO page) {
return ResultUtil.data(memberAddressService.getAddressByMember(page, UserContext.getCurrentUser().getId()));
}
@ApiOperation(value = "根据ID获取会员收件地址")
@ApiImplicitParam(name = "id", value = "会员地址ID", dataType = "String", paramType = "path")
@GetMapping(value = "/get/{id}")
public ResultMessage<MemberAddress> getShippingAddress(@PathVariable String id) {
return ResultUtil.data(memberAddressService.getMemberAddress(id));
}
@ApiOperation(value = "获取当前会员默认收件地址")
@GetMapping(value = "/get/default")
public ResultMessage<MemberAddress> getDefaultShippingAddress() {
return ResultUtil.data(memberAddressService.getDefaultMemberAddress());
}
@ApiOperation(value = "新增会员收件地址")
@PostMapping
public ResultMessage<MemberAddress> addShippingAddress(@Valid MemberAddress shippingAddress) {
//添加会员地址
shippingAddress.setMemberId(Objects.requireNonNull(UserContext.getCurrentUser()).getId());
if(shippingAddress.getIsDefault()==null){
shippingAddress.setIsDefault(false);
}
return ResultUtil.data(memberAddressService.saveMemberAddress(shippingAddress));
}
@ApiOperation(value = "修改会员收件地址")
@PutMapping
public ResultMessage<MemberAddress> editShippingAddress(@Valid MemberAddress shippingAddress) {
return ResultUtil.data(memberAddressService.updateMemberAddress(shippingAddress));
}
@ApiOperation(value = "删除会员收件地址")
@ApiImplicitParam(name = "id", value = "会员地址ID", dataType = "String", paramType = "path")
@DeleteMapping(value = "/delById/{id}")
public ResultMessage<Object> delShippingAddressById(@PathVariable String id) {
OperationalJudgment.judgment(memberAddressService.getById(id));
memberAddressService.removeMemberAddress(id);
return ResultUtil.success();
}
}

View File

@ -0,0 +1,96 @@
package cn.lili.controller.member;
import cn.lili.common.enums.ResultUtil;
import cn.lili.common.vo.PageVO;
import cn.lili.common.vo.ResultMessage;
import cn.lili.modules.member.service.GoodsCollectionService;
import cn.lili.modules.member.service.StoreCollectionService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.validation.constraints.NotNull;
/**
* 买家端,会员收藏接口
*
* @author Chopper
* @since 2020/11/17 2:32 下午
*/
@RestController
@Api(tags = "买家端,会员收藏接口")
@RequestMapping("/buyer/member/collection")
public class MemberCollectionController {
/**
* 会员商品收藏
*/
@Autowired
private GoodsCollectionService goodsCollectionService;
/**
* 会员店铺
*/
@Autowired
private StoreCollectionService storeCollectionService;
/**
* 商品收藏关键字
*/
private String goods="GOODS";
@ApiOperation(value = "查询会员收藏列表")
@ApiImplicitParam(name = "type", value = "类型", dataType = "String", paramType = "path", example = "GOODS:商品,STORE:店铺")
@GetMapping("/{type}")
public ResultMessage<Object> goodsList(@PathVariable String type, PageVO page) {
if (goods.equals(type)) {
return ResultUtil.data(goodsCollectionService.goodsCollection(page));
}
return ResultUtil.data(storeCollectionService.storeCollection(page));
}
@ApiOperation(value = "添加会员收藏")
@ApiImplicitParams({
@ApiImplicitParam(name = "type", value = "类型", dataType = "String", paramType = "path", example = "GOODS:商品,STORE:店铺"),
@ApiImplicitParam(name = "num", value = "", dataType = "Long", paramType = "path")
})
@PostMapping("/add/{type}/{id}")
public ResultMessage<Object> addGoodsCollection(@PathVariable String type,
@NotNull(message = "值不能为空") @PathVariable String id) {
if (goods.equals(type)) {
return ResultUtil.data(goodsCollectionService.addGoodsCollection(id));
}
return ResultUtil.data(storeCollectionService.addStoreCollection(id));
}
@ApiOperation(value = "删除会员收藏")
@ApiImplicitParams({
@ApiImplicitParam(name = "type", value = "类型", dataType = "String", paramType = "path", example = "GOODS:商品,STORE:店铺"),
@ApiImplicitParam(name = "num", value = "", dataType = "Long", paramType = "path")
})
@DeleteMapping(value = "/delete/{type}/{id}")
public ResultMessage<Object> deleteGoodsCollection(@PathVariable String type,
@NotNull(message = "值不能为空") @PathVariable String id) {
if (goods.equals(type)) {
return ResultUtil.data(goodsCollectionService.deleteGoodsCollection(id));
}
return ResultUtil.data(storeCollectionService.deleteStoreCollection(id));
}
@ApiOperation(value = "查询会员是否收藏")
@ApiImplicitParams({
@ApiImplicitParam(name = "type", value = "类型", dataType = "String", paramType = "path", example = "GOODS:商品,STORE:店铺"),
@ApiImplicitParam(name = "id", value = "", dataType = "String", paramType = "path")
})
@GetMapping(value = "/isCollection/{type}/{id}")
public ResultMessage<Boolean> isCollection(@PathVariable String type,
@NotNull(message = "值不能为空") @PathVariable String id) {
if (goods.equals(type)) {
return ResultUtil.data(this.goodsCollectionService.isCollection(id));
}
return ResultUtil.data(this.storeCollectionService.isCollection(id));
}
}

View File

@ -0,0 +1,81 @@
package cn.lili.controller.member;
import cn.lili.common.aop.annotation.PreventDuplicateSubmissions;
import cn.lili.common.enums.ResultUtil;
import cn.lili.common.enums.SwitchEnum;
import cn.lili.common.security.context.UserContext;
import cn.lili.common.vo.ResultMessage;
import cn.lili.modules.member.entity.dos.MemberEvaluation;
import cn.lili.modules.member.entity.dto.EvaluationQueryParams;
import cn.lili.modules.member.entity.dto.MemberEvaluationDTO;
import cn.lili.modules.member.entity.vo.EvaluationNumberVO;
import cn.lili.modules.member.entity.vo.MemberEvaluationVO;
import cn.lili.modules.member.service.MemberEvaluationService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
/**
* 买家端,会员商品评价接口
*
* @author Bulbasaur
* @since 2020/11/16 10:08 下午
*/
@RestController
@Api(tags = "买家端,会员商品评价接口")
@RequestMapping("/buyer/memberEvaluation")
public class MemberEvaluationBuyerController {
/**
* 会员商品评价
*/
@Autowired
private MemberEvaluationService memberEvaluationService;
@PreventDuplicateSubmissions
@ApiOperation(value = "添加会员评价")
@PostMapping
public ResultMessage<MemberEvaluationDTO> save(@Valid MemberEvaluationDTO memberEvaluationDTO) {
return ResultUtil.data(memberEvaluationService.addMemberEvaluation(memberEvaluationDTO, true));
}
@ApiOperation(value = "查看会员评价详情")
@ApiImplicitParam(name = "id", value = "评价ID", required = true, paramType = "path")
@GetMapping(value = "/get/{id}")
public ResultMessage<MemberEvaluationVO> save(@NotNull(message = "评价ID不能为空") @PathVariable("id") String id) {
return ResultUtil.data(memberEvaluationService.queryById(id));
}
@ApiOperation(value = "查看当前会员评价列表")
@GetMapping
public ResultMessage<IPage<MemberEvaluation>> queryMineEvaluation(EvaluationQueryParams evaluationQueryParams) {
//设置当前登录会员
evaluationQueryParams.setMemberId(UserContext.getCurrentUser().getId());
return ResultUtil.data(memberEvaluationService.managerQuery(evaluationQueryParams));
}
@ApiOperation(value = "查看某一个商品的评价列表")
@ApiImplicitParam(name = "goodsId", value = "商品ID", required = true, dataType = "Long", paramType = "path")
@GetMapping(value = "/{goodsId}/goodsEvaluation")
public ResultMessage<IPage<MemberEvaluation>> queryGoodsEvaluation(EvaluationQueryParams evaluationQueryParams,
@NotNull @PathVariable("goodsId") String goodsId) {
//设置查询查询商品
evaluationQueryParams.setGoodsId(goodsId);
evaluationQueryParams.setStatus(SwitchEnum.OPEN.name());
return ResultUtil.data(memberEvaluationService.managerQuery(evaluationQueryParams));
}
@ApiOperation(value = "查看某一个商品的评价数量")
@ApiImplicitParam(name = "goodsId", value = "商品ID", required = true, dataType = "Long", paramType = "path")
@GetMapping(value = "/{goodsId}/evaluationNumber")
public ResultMessage<EvaluationNumberVO> queryEvaluationNumber(@NotNull @PathVariable("goodsId") String goodsId) {
return ResultUtil.data(memberEvaluationService.getEvaluationNumber(goodsId));
}
}

View File

@ -0,0 +1,45 @@
package cn.lili.controller.member;
import cn.lili.common.aop.annotation.PreventDuplicateSubmissions;
import cn.lili.common.enums.ResultUtil;
import cn.lili.common.vo.ResultMessage;
import cn.lili.modules.member.entity.dos.MemberSign;
import cn.lili.modules.member.service.MemberSignService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* 会员签到控制器
*
* @author pikachu
* @since 2020/11/16 10:07 下午
*/
@RestController
@Api(tags = "买家端会员签到API")
@RequestMapping("/buyer/members/sign")
public class MemberSignBuyerController {
@Autowired
private MemberSignService memberSignService;
@PreventDuplicateSubmissions
@PostMapping
@ApiOperation(value = "会员签到")
public ResultMessage<Boolean> memberSign() {
return ResultUtil.data(memberSignService.memberSign());
}
@GetMapping
@ApiOperation(value = "根据时间查询会员签到表类型是YYYYmm")
public ResultMessage<List<MemberSign>> memberSign(String time) {
return ResultUtil.data(memberSignService.getMonthSignDay(time));
}
}

View File

@ -0,0 +1,52 @@
package cn.lili.controller.member;
import cn.lili.common.security.context.UserContext;
import cn.lili.mybatis.util.PageUtil;
import cn.lili.common.enums.ResultUtil;
import cn.lili.common.vo.PageVO;
import cn.lili.common.vo.ResultMessage;
import cn.lili.modules.member.entity.dos.MemberPointsHistory;
import cn.lili.modules.member.entity.vo.MemberPointsHistoryVO;
import cn.lili.modules.member.service.MemberPointsHistoryService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 买家端,会员积分历史接口
*
* @author Bulbasaur
* @since 2020-02-25 14:10:16
*/
@RestController
@Api(tags = "买家端,会员积分历史接口")
@RequestMapping("/buyer/member/memberPointsHistory")
public class PointsHistoryBuyerController {
@Autowired
private MemberPointsHistoryService memberPointsHistoryService;
@ApiOperation(value = "分页获取")
@GetMapping(value = "/getByPage")
public ResultMessage<IPage<MemberPointsHistory>> getByPage(PageVO page) {
LambdaQueryWrapper<MemberPointsHistory> queryWrapper = Wrappers.lambdaQuery();
queryWrapper.eq(MemberPointsHistory::getMemberId, UserContext.getCurrentUser().getId());
queryWrapper.orderByDesc(MemberPointsHistory::getCreateTime);
return ResultUtil.data(memberPointsHistoryService.page(PageUtil.initPage(page), queryWrapper));
}
@ApiOperation(value = "获取会员积分VO")
@GetMapping(value = "/getMemberPointsHistoryVO")
public ResultMessage<MemberPointsHistoryVO> getMemberPointsHistoryVO() {
return ResultUtil.data(memberPointsHistoryService.getMemberPointsHistoryVO(UserContext.getCurrentUser().getId()));
}
}

View File

@ -0,0 +1,58 @@
package cn.lili.controller.message;
import cn.lili.common.enums.ResultUtil;
import cn.lili.common.security.context.UserContext;
import cn.lili.common.vo.PageVO;
import cn.lili.common.vo.ResultMessage;
import cn.lili.modules.message.entity.dos.MemberMessage;
import cn.lili.modules.message.entity.enums.MessageStatusEnum;
import cn.lili.modules.message.entity.vos.MemberMessageQueryVO;
import cn.lili.modules.message.service.MemberMessageService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
* 买家端,会员站内消息接口
*
* @author Bulbasaur
* @since 2020/11/16 10:07 下午
*/
@RestController
@Api(tags = "买家端,会员站内消息接口")
@RequestMapping("/buyer/member/message")
public class MemberMessageBuyerController {
/**
* 会员站内消息
*/
@Autowired
private MemberMessageService memberMessageService;
@ApiOperation(value = "分页获取会员站内消息")
@GetMapping
public ResultMessage<IPage<MemberMessage>> page(MemberMessageQueryVO memberMessageQueryVO, PageVO page) {
memberMessageQueryVO.setMemberId(UserContext.getCurrentUser().getId());
return ResultUtil.data(memberMessageService.getPage(memberMessageQueryVO, page));
}
@ApiOperation(value = "消息已读")
@ApiImplicitParam(name = "messageId", value = "会员消息id", required = true, paramType = "path")
@PutMapping("/{message_id}")
public ResultMessage<Boolean> read(@PathVariable("message_id") String messageId) {
return ResultUtil.data(memberMessageService.editStatus(MessageStatusEnum.ALREADY_READY.name(), messageId));
}
@ApiOperation(value = "消息放入回收站")
@ApiImplicitParam(name = "messageId", value = "会员消息id", required = true, paramType = "path")
@DeleteMapping("/{message_id}")
public ResultMessage<Boolean> deleteMessage(@PathVariable("message_id") String messageId) {
return ResultUtil.data(memberMessageService.editStatus(MessageStatusEnum.ALREADY_REMOVE.name(), messageId));
}
}

View File

@ -0,0 +1,137 @@
package cn.lili.controller.order;
import cn.lili.common.aop.annotation.PreventDuplicateSubmissions;
import cn.lili.common.enums.ResultUtil;
import cn.lili.common.security.OperationalJudgment;
import cn.lili.common.vo.ResultMessage;
import cn.lili.modules.order.aftersale.entity.dos.AfterSale;
import cn.lili.modules.order.aftersale.entity.dos.AfterSaleLog;
import cn.lili.modules.order.aftersale.entity.dos.AfterSaleReason;
import cn.lili.modules.order.aftersale.entity.dto.AfterSaleDTO;
import cn.lili.modules.order.aftersale.entity.vo.AfterSaleApplyVO;
import cn.lili.modules.order.aftersale.entity.vo.AfterSaleSearchParams;
import cn.lili.modules.order.aftersale.entity.vo.AfterSaleVO;
import cn.lili.modules.order.aftersale.service.AfterSaleLogService;
import cn.lili.modules.order.aftersale.service.AfterSaleReasonService;
import cn.lili.modules.order.aftersale.service.AfterSaleService;
import cn.lili.modules.store.entity.dto.StoreAfterSaleAddressDTO;
import com.baomidou.mybatisplus.core.metadata.IPage;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.*;
import javax.validation.constraints.NotNull;
import java.util.Date;
import java.util.List;
/**
* 买家端,售后管理接口
*
* @author Chopper
* @since 2020/11/16 10:02 下午
*/
@RestController
@Api(tags = "买家端,售后管理接口")
@RequestMapping("/buyer/afterSale")
public class AfterSaleBuyerController {
/**
* 售后
*/
@Autowired
private AfterSaleService afterSaleService;
/**
* 售后原因
*/
@Autowired
private AfterSaleReasonService afterSaleReasonService;
/**
* 售后日志
*/
@Autowired
private AfterSaleLogService afterSaleLogService;
@ApiOperation(value = "查看售后服务详情")
@ApiImplicitParam(name = "sn", value = "售后单号", required = true, paramType = "path")
@GetMapping(value = "/get/{sn}")
public ResultMessage<AfterSaleVO> get(@NotNull(message = "售后单号") @PathVariable("sn") String sn) {
AfterSaleVO afterSale = OperationalJudgment.judgment(afterSaleService.getAfterSale(sn));
return ResultUtil.data(afterSale);
}
@ApiOperation(value = "分页获取售后服务")
@GetMapping(value = "/page")
public ResultMessage<IPage<AfterSaleVO>> getByPage(AfterSaleSearchParams searchParams) {
return ResultUtil.data(afterSaleService.getAfterSalePages(searchParams));
}
@ApiOperation(value = "获取申请售后页面信息")
@ApiImplicitParams({
@ApiImplicitParam(name = "sn", value = "订单货物编号", required = true, dataType = "String", paramType = "path")
})
@GetMapping(value = "/applyAfterSaleInfo/{sn}")
public ResultMessage<AfterSaleApplyVO> applyAfterSaleInfo(@PathVariable String sn) {
return ResultUtil.data(afterSaleService.getAfterSaleVO(sn));
}
@PreventDuplicateSubmissions
@PostMapping(value = "/save/{orderItemSn}")
@ApiImplicitParam(name = "orderItemSn", value = "订单货物编号", required = true, paramType = "query")
@ApiOperation(value = "申请售后")
public ResultMessage<AfterSale> save(AfterSaleDTO afterSaleDTO) {
return ResultUtil.data(afterSaleService.saveAfterSale(afterSaleDTO));
}
@ApiOperation(value = "买家 退回 物流信息")
@ApiImplicitParams({
@ApiImplicitParam(name = "afterSaleSn", value = "售后sn", required = true, dataType = "String", paramType = "path"),
@ApiImplicitParam(name = "logisticsNo", value = "发货单号", required = true, dataType = "String", paramType = "query"),
@ApiImplicitParam(name = "logisticsId", value = "物流公司id", required = true, dataType = "String", paramType = "query"),
@ApiImplicitParam(name = "mDeliverTime", value = "买家发货时间", required = true, dataType = "date", paramType = "query")
})
@PostMapping(value = "/delivery/{afterSaleSn}")
public ResultMessage<AfterSale> delivery(@NotNull(message = "售后编号不能为空") @PathVariable("afterSaleSn") String afterSaleSn,
@NotNull(message = "发货单号不能为空") @RequestParam String logisticsNo,
@NotNull(message = "请选择物流公司") @RequestParam String logisticsId,
@NotNull(message = "请选择发货时间") @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date mDeliverTime) {
return ResultUtil.data(afterSaleService.buyerDelivery(afterSaleSn, logisticsNo, logisticsId, mDeliverTime));
}
@PreventDuplicateSubmissions
@ApiOperation(value = "售后,取消售后")
@ApiImplicitParams({
@ApiImplicitParam(name = "afterSaleSn", value = "售后sn", required = true, dataType = "String", paramType = "path")
})
@PostMapping(value = "/cancel/{afterSaleSn}")
public ResultMessage<AfterSale> cancel(@NotNull(message = "参数非法") @PathVariable("afterSaleSn") String afterSaleSn) {
return ResultUtil.data(afterSaleService.cancel(afterSaleSn));
}
@ApiOperation(value = "获取商家售后收件地址")
@ApiImplicitParam(name = "sn", value = "售后单号", required = true, paramType = "path")
@GetMapping(value = "/getStoreAfterSaleAddress/{sn}")
public ResultMessage<StoreAfterSaleAddressDTO> getStoreAfterSaleAddress(@NotNull(message = "售后单号") @PathVariable("sn") String sn) {
return ResultUtil.data(afterSaleService.getStoreAfterSaleAddressDTO(sn));
}
@ApiOperation(value = "获取售后原因")
@ApiImplicitParam(name = "serviceType", value = "售后类型", required = true, paramType = "path", allowableValues = "CANCEL,RETURN_GOODS,RETURN_MONEY,COMPLAIN")
@GetMapping(value = "/get/afterSaleReason/{serviceType}")
public ResultMessage<List<AfterSaleReason>> getAfterSaleReason(@PathVariable String serviceType) {
return ResultUtil.data(afterSaleReasonService.afterSaleReasonList(serviceType));
}
@ApiOperation(value = "获取售后日志")
@ApiImplicitParam(name = "sn", value = "售后编号", required = true, paramType = "path")
@GetMapping(value = "/get/getAfterSaleLog/{sn}")
public ResultMessage<List<AfterSaleLog>> getAfterSaleLog(@PathVariable String sn) {
return ResultUtil.data(afterSaleLogService.getAfterSaleLog(sn));
}
}

View File

@ -0,0 +1,254 @@
package cn.lili.controller.order;
import cn.lili.common.aop.annotation.PreventDuplicateSubmissions;
import cn.lili.common.enums.ResultCode;
import cn.lili.common.enums.ResultUtil;
import cn.lili.common.exception.ServiceException;
import cn.lili.common.vo.ResultMessage;
import cn.lili.modules.order.cart.entity.dto.TradeDTO;
import cn.lili.modules.order.cart.entity.enums.CartTypeEnum;
import cn.lili.modules.order.cart.entity.vo.TradeParams;
import cn.lili.modules.order.cart.service.CartService;
import cn.lili.modules.order.order.entity.vo.ReceiptVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
/**
* 买家端购物车接口
*
* @author Chopper
* @since 2020/11/16 10:04 下午
*/
@Slf4j
@RestController
@Api(tags = "买家端,购物车接口")
@RequestMapping("/buyer/trade/carts")
public class CartController {
/**
* 购物车
*/
@Autowired
private CartService cartService;
@ApiOperation(value = "向购物车中添加一个产品")
@PostMapping
@ApiImplicitParams({
@ApiImplicitParam(name = "skuId", value = "产品ID", required = true, dataType = "Long", paramType = "query"),
@ApiImplicitParam(name = "num", value = "此产品的购买数量", required = true, dataType = "int", paramType = "query"),
@ApiImplicitParam(name = "cartType", value = "购物车类型,默认加入购物车", paramType = "query")
})
public ResultMessage<Object> add(@NotNull(message = "产品id不能为空") String skuId,
@NotNull(message = "购买数量不能为空") @Min(value = 1, message = "加入购物车数量必须大于0") Integer num,
String cartType) {
try {
//读取选中的列表
cartService.add(skuId, num, cartType, false);
return ResultUtil.success();
} catch (ServiceException se) {
log.info(se.getMsg(), se);
throw se;
} catch (Exception e) {
log.error(ResultCode.CART_ERROR.message(), e);
throw new ServiceException(ResultCode.CART_ERROR);
}
}
@ApiOperation(value = "获取购物车页面购物车详情")
@GetMapping("/all")
public ResultMessage<TradeDTO> cartAll() {
return ResultUtil.data(this.cartService.getAllTradeDTO());
}
@ApiOperation(value = "获取购物车数量")
@GetMapping("/count")
public ResultMessage<Long> cartCount(@RequestParam(required = false) Boolean checked) {
return ResultUtil.data(this.cartService.getCartNum(checked));
}
@ApiOperation(value = "获取购物车可用优惠券数量")
@GetMapping("/coupon/num")
@ApiImplicitParams({
@ApiImplicitParam(name = "way", value = "购物车购买CART/立即购买BUY_NOW/拼团购买PINTUAN / 积分购买POINT ", required = true, paramType = "query")
})
public ResultMessage<Long> cartCouponNum(String way) {
return ResultUtil.data(this.cartService.getCanUseCoupon(CartTypeEnum.valueOf(way)));
}
@ApiOperation(value = "更新购物车中单个产品数量", notes = "更新购物车中的多个产品的数量或选中状态")
@ApiImplicitParams({
@ApiImplicitParam(name = "skuId", value = "产品id数组", required = true, dataType = "Long", paramType = "path"),
@ApiImplicitParam(name = "num", value = "产品数量", dataType = "int", paramType = "query"),
})
@PostMapping(value = "/sku/num/{skuId}")
public ResultMessage<Object> update(@NotNull(message = "产品id不能为空") @PathVariable(name = "skuId") String skuId,
Integer num) {
cartService.add(skuId, num, CartTypeEnum.CART.name(), true);
return ResultUtil.success();
}
@ApiOperation(value = "更新购物车中单个产品", notes = "更新购物车中的多个产品的数量或选中状态")
@ApiImplicitParams({
@ApiImplicitParam(name = "skuId", value = "产品id数组", required = true, dataType = "Long", paramType = "path")
})
@PostMapping(value = "/sku/checked/{skuId}")
public ResultMessage<Object> updateChecked(@NotNull(message = "产品id不能为空") @PathVariable(name = "skuId") String skuId,
boolean checked) {
cartService.checked(skuId, checked);
return ResultUtil.success();
}
@ApiOperation(value = "购物车选中设置")
@PostMapping(value = "/sku/checked", produces = MediaType.APPLICATION_JSON_VALUE)
public ResultMessage<Object> updateAll(boolean checked) {
cartService.checkedAll(checked);
return ResultUtil.success();
}
@ApiOperation(value = "批量设置某商家的商品为选中或不选中")
@ApiImplicitParams({
@ApiImplicitParam(name = "storeId", value = "卖家id", required = true, dataType = "Long", paramType = "path"),
@ApiImplicitParam(name = "checked", value = "是否选中", required = true, dataType = "int", paramType = "query", allowableValues = "0,1")
})
@ResponseBody
@PostMapping(value = "/store/{storeId}", produces = MediaType.APPLICATION_JSON_VALUE)
public ResultMessage<Object> updateStoreAll(@NotNull(message = "卖家id不能为空") @PathVariable(name = "storeId") String storeId, boolean checked) {
cartService.checkedStore(storeId, checked);
return ResultUtil.success();
}
@ApiOperation(value = "清空购物车")
@DeleteMapping()
public ResultMessage<Object> clean() {
cartService.clean();
return ResultUtil.success();
}
@ApiOperation(value = "删除购物车中的一个或多个产品")
@ApiImplicitParams({
@ApiImplicitParam(name = "skuIds", value = "产品id", required = true, dataType = "Long", paramType = "path", allowMultiple = true)
})
@DeleteMapping(value = "/sku/remove")
public ResultMessage<Object> delete(String[] skuIds) {
cartService.delete(skuIds);
return ResultUtil.success();
}
@ApiOperation(value = "获取结算页面购物车详情")
@ApiImplicitParams({
@ApiImplicitParam(name = "way", value = "购物车购买CART/立即购买BUY_NOW/拼团购买PINTUAN / 积分购买POINT ", required = true, paramType = "query")
})
@GetMapping("/checked")
public ResultMessage<TradeDTO> cartChecked(@NotNull(message = "读取选中列表") String way) {
try {
//读取选中的列表
return ResultUtil.data(this.cartService.getCheckedTradeDTO(CartTypeEnum.valueOf(way)));
} catch (ServiceException se) {
log.error(se.getMsg(), se);
throw se;
} catch (Exception e) {
log.error(ResultCode.CART_ERROR.message(), e);
throw new ServiceException(ResultCode.CART_ERROR);
}
}
@ApiOperation(value = "选择收货地址")
@ApiImplicitParams({
@ApiImplicitParam(name = "shippingAddressId", value = "收货地址id ", required = true, paramType = "query"),
@ApiImplicitParam(name = "way", value = "购物车类型 ", paramType = "query")
})
@GetMapping("/shippingAddress")
public ResultMessage<Object> shippingAddress(@NotNull(message = "收货地址ID不能为空") String shippingAddressId,
String way) {
try {
cartService.shippingAddress(shippingAddressId, way);
return ResultUtil.success();
} catch (ServiceException se) {
log.error(ResultCode.SHIPPING_NOT_APPLY.message(), se);
throw new ServiceException(ResultCode.SHIPPING_NOT_APPLY);
} catch (Exception e) {
log.error(ResultCode.CART_ERROR.message(), e);
throw new ServiceException(ResultCode.CART_ERROR);
}
}
@ApiOperation(value = "选择配送方式")
@ApiImplicitParams({
@ApiImplicitParam(name = "shippingMethod", value = "配送方式SELF_PICK_UP(自提)," +
"LOCAL_TOWN_DELIVERY(同城配送)," +
"LOGISTICS(物流) ", required = true, paramType = "query"),
@ApiImplicitParam(name = "selleId", value = "店铺id", paramType = "query"),
@ApiImplicitParam(name = "way", value = "购物车类型 ", paramType = "query")
})
@GetMapping("/shippingMethod")
public ResultMessage<Object> shippingMethod(@NotNull(message = "配送方式不能为空") String shippingMethod,
String selleId,
String way) {
try {
cartService.shippingMethod(selleId, shippingMethod, way);
return ResultUtil.success();
} catch (ServiceException se) {
log.error(se.getMsg(), se);
throw se;
} catch (Exception e) {
log.error(ResultCode.CART_ERROR.message(), e);
throw new ServiceException(ResultCode.CART_ERROR);
}
}
@ApiOperation(value = "选择发票")
@ApiImplicitParams({
@ApiImplicitParam(name = "way", value = "购物车购买CART/立即购买BUY_NOW/拼团购买PINTUAN / 积分购买POINT ", required = true, paramType = "query"),
})
@GetMapping("/select/receipt")
public ResultMessage<Object> selectReceipt(String way, ReceiptVO receiptVO) {
this.cartService.shippingReceipt(receiptVO, way);
return ResultUtil.success();
}
@ApiOperation(value = "选择优惠券")
@ApiImplicitParams({
@ApiImplicitParam(name = "way", value = "购物车购买CART/立即购买BUY_NOW/拼团购买PINTUAN / 积分购买POINT ", required = true, paramType = "query"),
@ApiImplicitParam(name = "memberCouponId", value = "优惠券id ", required = true, paramType = "query"),
@ApiImplicitParam(name = "used", value = "使用true 弃用false ", required = true, paramType = "query")
})
@GetMapping("/select/coupon")
public ResultMessage<Object> selectCoupon(String way, @NotNull(message = "优惠券id不能为空") String memberCouponId, boolean used) {
this.cartService.selectCoupon(memberCouponId, way, used);
return ResultUtil.success();
}
@PreventDuplicateSubmissions
@ApiOperation(value = "创建交易")
@PostMapping(value = "/create/trade", consumes = "application/json", produces = "application/json")
public ResultMessage<Object> crateTrade(@RequestBody TradeParams tradeParams) {
try {
//读取选中的列表
return ResultUtil.data(this.cartService.createTrade(tradeParams));
} catch (ServiceException se) {
log.info(se.getMsg(), se);
throw se;
} catch (Exception e) {
log.error(ResultCode.ORDER_ERROR.message(), e);
throw e;
}
}
}

View File

@ -0,0 +1,132 @@
package cn.lili.controller.order;
import cn.lili.common.aop.annotation.PreventDuplicateSubmissions;
import cn.lili.common.enums.ResultCode;
import cn.lili.common.enums.ResultUtil;
import cn.lili.common.exception.ServiceException;
import cn.lili.common.security.AuthUser;
import cn.lili.common.security.OperationalJudgment;
import cn.lili.common.security.context.UserContext;
import cn.lili.common.vo.ResultMessage;
import cn.lili.modules.order.order.entity.dos.Order;
import cn.lili.modules.order.order.entity.dto.OrderSearchParams;
import cn.lili.modules.order.order.entity.enums.OrderStatusEnum;
import cn.lili.modules.order.order.entity.vo.OrderDetailVO;
import cn.lili.modules.order.order.entity.vo.OrderSimpleVO;
import cn.lili.modules.order.order.service.OrderService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Objects;
/**
* 买家端,订单接口
*
* @author Chopper
* @since 2020/11/16 10:08 下午
*/
@RestController
@Api(tags = "买家端,订单接口")
@RequestMapping("/buyer/orders")
public class OrderBuyerController {
/**
* 订单
*/
@Autowired
private OrderService orderService;
@ApiOperation(value = "查询会员订单列表")
@GetMapping
public ResultMessage<IPage<OrderSimpleVO>> queryMineOrder(OrderSearchParams orderSearchParams) {
AuthUser currentUser = Objects.requireNonNull(UserContext.getCurrentUser());
orderSearchParams.setMemberId(currentUser.getId());
return ResultUtil.data(orderService.queryByParams(orderSearchParams));
}
@ApiOperation(value = "订单明细")
@ApiImplicitParams({
@ApiImplicitParam(name = "orderSn", value = "订单编号", required = true, paramType = "path")
})
@GetMapping(value = "/{orderSn}")
public ResultMessage<OrderDetailVO> detail(@NotNull(message = "订单编号不能为空") @PathVariable("orderSn") String orderSn) {
OrderDetailVO orderDetailVO = orderService.queryDetail(orderSn);
OperationalJudgment.judgment(orderDetailVO.getOrder());
return ResultUtil.data(orderDetailVO);
}
@PreventDuplicateSubmissions
@ApiOperation(value = "确认收货")
@ApiImplicitParams({
@ApiImplicitParam(name = "orderSn", value = "订单编号", required = true, paramType = "path")
})
@PostMapping(value = "/{orderSn}/receiving")
public ResultMessage<Object> receiving(@NotNull(message = "订单编号不能为空") @PathVariable("orderSn") String orderSn) {
Order order = orderService.getBySn(orderSn);
if (order == null) {
throw new ServiceException(ResultCode.ORDER_NOT_EXIST);
}
//判定是否是待收货状态
if (!order.getOrderStatus().equals(OrderStatusEnum.DELIVERED.name())) {
throw new ServiceException(ResultCode.ORDER_DELIVERED_ERROR);
}
orderService.complete(orderSn);
return ResultUtil.success();
}
@PreventDuplicateSubmissions
@ApiOperation(value = "取消订单")
@ApiImplicitParams({
@ApiImplicitParam(name = "orderSn", value = "订单编号", required = true, dataType = "String", paramType = "path"),
@ApiImplicitParam(name = "reason", value = "取消原因", required = true, dataType = "String", paramType = "query")
})
@PostMapping(value = "/{orderSn}/cancel")
public ResultMessage<Object> cancel(@ApiIgnore @PathVariable String orderSn, @RequestParam String reason) {
orderService.cancel(orderSn, reason);
return ResultUtil.success();
}
@PreventDuplicateSubmissions
@ApiOperation(value = "删除订单")
@ApiImplicitParams({
@ApiImplicitParam(name = "orderSn", value = "订单编号", required = true, dataType = "String", paramType = "path")
})
@DeleteMapping(value = "/{orderSn}")
public ResultMessage<Object> deleteOrder(@PathVariable String orderSn) {
OperationalJudgment.judgment(orderService.getBySn(orderSn));
orderService.deleteOrder(orderSn);
return ResultUtil.success();
}
@ApiOperation(value = "查询物流踪迹")
@ApiImplicitParams({
@ApiImplicitParam(name = "orderSn", value = "订单编号", required = true, dataType = "String", paramType = "path")
})
@PostMapping(value = "/getTraces/{orderSn}")
public ResultMessage<Object> getTraces(@NotBlank(message = "订单编号不能为空") @PathVariable String orderSn) {
OperationalJudgment.judgment(orderService.getBySn(orderSn));
return ResultUtil.data(orderService.getTraces(orderSn));
}
@PreventDuplicateSubmissions
@ApiOperation(value = "开票")
@ApiImplicitParams({
@ApiImplicitParam(name = "orderSn", value = "订单编号", required = true, dataType = "String", paramType = "path")
})
@PostMapping(value = "/receipt/{orderSn}")
public ResultMessage<Object> invoice(@NotBlank(message = "订单编号不能为空") @PathVariable String orderSn) {
OperationalJudgment.judgment(orderService.getBySn(orderSn));
return ResultUtil.data(orderService.invoice(orderSn));
}
}

View File

@ -0,0 +1,100 @@
package cn.lili.controller.order;
import cn.lili.common.aop.annotation.PreventDuplicateSubmissions;
import cn.lili.common.enums.ResultUtil;
import cn.lili.common.security.AuthUser;
import cn.lili.common.security.OperationalJudgment;
import cn.lili.common.security.context.UserContext;
import cn.lili.common.vo.PageVO;
import cn.lili.common.vo.ResultMessage;
import cn.lili.modules.order.order.entity.dos.OrderComplaint;
import cn.lili.modules.order.order.entity.dto.OrderComplaintDTO;
import cn.lili.modules.order.order.entity.enums.CommunicationOwnerEnum;
import cn.lili.modules.order.order.entity.vo.OrderComplaintCommunicationVO;
import cn.lili.modules.order.order.entity.vo.OrderComplaintSearchParams;
import cn.lili.modules.order.order.entity.vo.OrderComplaintVO;
import cn.lili.modules.order.order.service.OrderComplaintCommunicationService;
import cn.lili.modules.order.order.service.OrderComplaintService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.Objects;
/**
* 买家端,交易投诉接口
*
* @author paulG
* @since 2020/12/7
**/
@RestController
@Api(tags = "买家端,交易投诉接口")
@RequestMapping("/buyer/complain")
public class OrderComplaintBuyerController {
/**
* 交易投诉
*/
@Autowired
private OrderComplaintService orderComplaintService;
/**
* 交易投诉沟通
*/
@Autowired
private OrderComplaintCommunicationService orderComplaintCommunicationService;
@ApiOperation(value = "通过id获取")
@ApiImplicitParam(name = "id", value = "投诉单ID", required = true, paramType = "path")
@GetMapping(value = "/{id}")
public ResultMessage<OrderComplaintVO> get(@PathVariable String id) {
OrderComplaintVO orderComplaintVO = OperationalJudgment.judgment(orderComplaintService.getOrderComplainById(id));
return ResultUtil.data(orderComplaintVO);
}
@ApiOperation(value = "分页获取")
@GetMapping
public ResultMessage<IPage<OrderComplaint>> get(OrderComplaintSearchParams searchParams, PageVO pageVO) {
AuthUser currentUser = Objects.requireNonNull(UserContext.getCurrentUser());
searchParams.setMemberId(currentUser.getId());
return ResultUtil.data(orderComplaintService.getOrderComplainByPage(searchParams, pageVO));
}
@PreventDuplicateSubmissions
@ApiOperation(value = "添加交易投诉")
@PostMapping
public ResultMessage<OrderComplaint> add(@Valid OrderComplaintDTO orderComplaintDTO) {
return ResultUtil.data(orderComplaintService.addOrderComplain(orderComplaintDTO));
}
@ApiOperation(value = "添加交易投诉对话")
@ApiImplicitParams({
@ApiImplicitParam(name = "complainId", value = "投诉单ID", required = true, paramType = "query"),
@ApiImplicitParam(name = "content", value = "内容", required = true, paramType = "query")
})
@PostMapping("/communication")
public ResultMessage<OrderComplaintCommunicationVO> addCommunication(@RequestParam String complainId, @RequestParam String content) {
AuthUser currentUser = Objects.requireNonNull(UserContext.getCurrentUser());
OrderComplaintCommunicationVO communicationVO = new OrderComplaintCommunicationVO(complainId, content, CommunicationOwnerEnum.BUYER.name(), currentUser.getId(), currentUser.getNickName());
orderComplaintCommunicationService.addCommunication(communicationVO);
return ResultUtil.data(communicationVO);
}
@PreventDuplicateSubmissions
@ApiOperation(value = "取消售后")
@ApiImplicitParam(name = "id", value = "投诉单ID", required = true, paramType = "path")
@PutMapping(value = "/status/{id}")
public ResultMessage<Object> cancel(@PathVariable String id) {
orderComplaintService.cancel(id);
return ResultUtil.success();
}
}

View File

@ -0,0 +1,52 @@
package cn.lili.controller.order;
import cn.lili.common.aop.annotation.PreventDuplicateSubmissions;
import cn.lili.common.enums.ResultUtil;
import cn.lili.common.vo.PageVO;
import cn.lili.common.vo.ResultMessage;
import cn.lili.modules.order.order.entity.dos.Receipt;
import cn.lili.modules.order.order.entity.dto.OrderReceiptDTO;
import cn.lili.modules.order.order.entity.dto.ReceiptSearchParams;
import cn.lili.modules.order.order.service.ReceiptService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
/**
* 买家端,发票接口
*
* @author paulG
* @since 2021/1/12
**/
@RestController
@Api(tags = "买家端,发票接口")
@RequestMapping("/buyer/trade/receipt")
public class ReceiptBuyerController {
@Autowired
private ReceiptService receiptService;
@ApiOperation(value = "获取发票详情")
@GetMapping("/{id}")
public ResultMessage<Receipt> getDetail(@PathVariable String id) {
return ResultUtil.data(this.receiptService.getDetail(id));
}
@ApiOperation(value = "获取发票分页信息")
@GetMapping
public ResultMessage<IPage<OrderReceiptDTO>> getPage(ReceiptSearchParams searchParams, PageVO pageVO) {
return ResultUtil.data(this.receiptService.getReceiptData(searchParams, pageVO));
}
@PreventDuplicateSubmissions
@ApiOperation(value = "保存发票信息")
@PostMapping
public ResultMessage<Receipt> save(@Valid Receipt receipt) {
return ResultUtil.data(receiptService.saveReceipt(receipt));
}
}

View File

@ -0,0 +1,46 @@
package cn.lili.controller.order;
import cn.lili.common.aop.annotation.PreventDuplicateSubmissions;
import cn.lili.common.enums.ResultUtil;
import cn.lili.common.vo.ResultMessage;
import cn.lili.modules.wallet.entity.dos.Recharge;
import cn.lili.modules.wallet.service.RechargeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
/**
* 买家端,预存款充值记录接口
*
* @author paulG
* @since 2020/11/16 10:07 下午
*/
@RestController
@Api(tags = "买家端,预存款充值记录接口")
@RequestMapping("/buyer/trade/recharge")
public class RechargeTradeBuyerController {
@Autowired
private RechargeService rechargeService;
@PreventDuplicateSubmissions
@PostMapping
@ApiOperation(value = "创建余额充值订单")
@ApiImplicitParams({
@ApiImplicitParam(name = "price", value = "充值金额", required = true, dataType = "double", paramType = "query")
})
public ResultMessage<Recharge> create(@Max(value = 10000, message = "充值金额单次最多允许充值10000元") @Min(value = 1, message = "充值金额单次最少充值金额为1元") Double price) {
Recharge recharge = this.rechargeService.recharge(price);
return ResultUtil.data(recharge);
}
}

View File

@ -0,0 +1,50 @@
package cn.lili.controller.other;
import cn.lili.common.enums.ResultUtil;
import cn.lili.common.vo.PageVO;
import cn.lili.common.vo.ResultMessage;
import cn.lili.modules.system.entity.dos.AppVersion;
import cn.lili.modules.system.service.AppVersionService;
import cn.lili.mybatis.util.PageUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 买家端,APP版本
*
* @author Bulbasaur
* @since 2021/5/21 11:15 上午
*/
@RestController
@Api(tags = "买家端,APP版本")
@RequestMapping("/buyer/appVersion")
public class AppVersionBuyerController {
@Autowired
private AppVersionService appVersionService;
@ApiOperation(value = "获取版本号")
@ApiImplicitParam(name = "appType", value = "app类型", required = true, paramType = "path")
@GetMapping("/{appType}")
public ResultMessage<Object> getAppVersion(@PathVariable String appType) {
return ResultUtil.data(appVersionService.getAppVersion(appType));
}
@ApiOperation(value = "获取版本号列表")
@ApiImplicitParam(name = "appType", value = "app类型", required = true, paramType = "path")
@GetMapping("/appVersion/{appType}")
public ResultMessage<IPage<AppVersion>> appVersion(@PathVariable String appType, PageVO pageVO) {
IPage<AppVersion> page = appVersionService.page(PageUtil.initPage(pageVO), new LambdaQueryWrapper<AppVersion>().eq(AppVersion::getType, appType));
return ResultUtil.data(page);
}
}

View File

@ -0,0 +1,72 @@
package cn.lili.controller.other;
import cn.lili.common.enums.ResultUtil;
import cn.lili.common.vo.ResultMessage;
import cn.lili.modules.page.entity.dos.Article;
import cn.lili.modules.page.entity.dto.ArticleSearchParams;
import cn.lili.modules.page.entity.vos.ArticleCategoryVO;
import cn.lili.modules.page.entity.vos.ArticleVO;
import cn.lili.modules.page.service.ArticleCategoryService;
import cn.lili.modules.page.service.ArticleService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.validation.constraints.NotNull;
import java.util.List;
/**
* 买家端,文章接口
*
* @author Chopper
* @since 2020/11/16 10:02 下午
*/
@RestController
@Api(tags = "买家端,文章接口")
@RequestMapping("/buyer/article")
public class ArticleBuyerController {
/**
* 文章
*/
@Autowired
private ArticleService articleService;
/**
* 文章分类
*/
@Autowired
private ArticleCategoryService articleCategoryService;
@ApiOperation(value = "获取文章分类列表")
@GetMapping(value = "/articleCategory/list")
public ResultMessage<List<ArticleCategoryVO>> getArticleCategoryList() {
return ResultUtil.data(articleCategoryService.allChildren());
}
@ApiOperation(value = "分页获取")
@GetMapping
public ResultMessage<IPage<ArticleVO>> getByPage(ArticleSearchParams articleSearchParams) {
return ResultUtil.data(articleService.articlePage(articleSearchParams));
}
@ApiOperation(value = "通过id获取文章")
@ApiImplicitParam(name = "id", value = "文章ID", required = true, paramType = "path")
@GetMapping(value = "/get/{id}")
public ResultMessage<Article> get(@NotNull(message = "文章ID") @PathVariable("id") String id) {
return ResultUtil.data(articleService.customGet(id));
}
@ApiOperation(value = "通过类型获取文章")
@ApiImplicitParam(name = "type", value = "文章类型", required = true, paramType = "path")
@GetMapping(value = "/type/{type}")
public ResultMessage<Article> getByType(@NotNull(message = "文章类型") @PathVariable("type") String type) {
return ResultUtil.data(articleService.customGetByType(type));
}
}

View File

@ -0,0 +1,44 @@
package cn.lili.controller.other;
import cn.lili.common.aop.annotation.PreventDuplicateSubmissions;
import cn.lili.common.enums.ResultUtil;
import cn.lili.common.security.context.UserContext;
import cn.lili.common.vo.ResultMessage;
import cn.lili.modules.page.entity.dos.Feedback;
import cn.lili.modules.page.service.FeedbackService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.validation.Valid;
/**
* 买家端,意见反馈接口
*
* @author Bulbasaur
* @since 2020-05-5 15:10:16
*/
@RestController
@Api(tags = "买家端,意见反馈接口")
@RequestMapping("/buyer/feedback")
public class FeedbackBuyerController {
/**
* 意见反馈
*/
@Autowired
private FeedbackService feedbackService;
@PreventDuplicateSubmissions
@ApiOperation(value = "添加意见反馈")
@PostMapping()
public ResultMessage<Object> save(@Valid Feedback feedback) {
feedback.setUserName(UserContext.getCurrentUser().getNickName());
feedbackService.save(feedback);
return ResultUtil.success();
}
}

View File

@ -0,0 +1,37 @@
package cn.lili.controller.other;
import cn.lili.common.enums.ResultUtil;
import cn.lili.common.vo.ResultMessage;
import cn.lili.modules.system.entity.dos.Logistics;
import cn.lili.modules.system.service.LogisticsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* 买家端,物流公司接口
*
* @author Bulbasaur
* @since 2020-05-5 15:10:16
*/
@RestController
@Api(tags = "买家端,物流公司接口")
@RequestMapping("/buyer/logistics")
public class LogisticsBuyerController {
@Autowired
private LogisticsService logisticsService;
@ApiOperation(value = "分页获取物流公司")
@GetMapping
public ResultMessage<List<Logistics>> getByPage() {
return ResultUtil.data(logisticsService.getOpenLogistics());
}
}

View File

@ -0,0 +1,47 @@
package cn.lili.controller.other;
import cn.lili.common.enums.ResultUtil;
import cn.lili.common.vo.ResultMessage;
import cn.lili.modules.page.entity.dto.PageDataDTO;
import cn.lili.modules.page.entity.enums.PageEnum;
import cn.lili.modules.page.entity.vos.PageDataVO;
import cn.lili.modules.page.service.PageDataService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
* 买家端,页面接口
*
* @author Chopper
* @since 2020/11/16 10:08 下午
*/
@RestController
@Api(tags = "买家端,页面接口")
@RequestMapping("/buyer/pageData")
public class PageBuyerController {
/**
* 页面管理
*/
@Autowired
private PageDataService pageService;
@ApiOperation(value = "获取首页数据")
@GetMapping("/getIndex")
public ResultMessage<PageDataVO> getIndex(@RequestParam String clientType) {
PageDataDTO pageDataDTO = new PageDataDTO(PageEnum.INDEX.name());
pageDataDTO.setPageClientType(clientType);
return ResultUtil.data(pageService.getPageData(pageDataDTO));
}
@ApiOperation(value = "获取页面数据")
@GetMapping
public ResultMessage<PageDataVO> get(PageDataDTO pageDataDTO) {
return ResultUtil.data(pageService.getPageData(pageDataDTO));
}
}

View File

@ -0,0 +1,48 @@
package cn.lili.controller.other.broadcast;
import cn.lili.common.enums.ResultUtil;
import cn.lili.common.vo.PageVO;
import cn.lili.common.vo.ResultMessage;
import cn.lili.modules.goods.entity.dos.Studio;
import cn.lili.modules.goods.service.StudioService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 买家端,直播间接口
*
* @author Bulbasaur
* @since 2021/5/20 12:03 下午
*/
@RestController
@Api(tags = "买家端,直播间接口")
@RequestMapping("/buyer/broadcast/studio")
public class StudioController {
@Autowired
private StudioService studioService;
@ApiOperation(value = "获取店铺直播间列表")
@ApiImplicitParams({
@ApiImplicitParam(name = "recommend", value = "是否推荐", paramType = "query", dataType = "int"),
@ApiImplicitParam(name = "status", value = "直播间状态", paramType = "query", dataType = "String")
})
@GetMapping
public ResultMessage<IPage<Studio>> page(PageVO pageVO, Integer recommend, String status) {
return ResultUtil.data(studioService.studioList(pageVO, recommend, status));
}
@ApiOperation(value = "获取店铺直播间回放地址")
@GetMapping("/getLiveInfo/{roomId}")
public ResultMessage<Object> getLiveInfo(Integer roomId) {
return ResultUtil.data(studioService.getLiveInfo(roomId));
}
}

View File

@ -0,0 +1,89 @@
package cn.lili.controller.other.purchase;
import cn.lili.common.aop.annotation.PreventDuplicateSubmissions;
import cn.lili.common.enums.ResultCode;
import cn.lili.common.enums.ResultUtil;
import cn.lili.common.security.context.UserContext;
import cn.lili.common.vo.PageVO;
import cn.lili.common.vo.ResultMessage;
import cn.lili.modules.goods.entity.dos.GoodsUnit;
import cn.lili.modules.goods.service.GoodsUnitService;
import cn.lili.modules.purchase.entity.dos.PurchaseOrder;
import cn.lili.modules.purchase.entity.params.PurchaseOrderSearchParams;
import cn.lili.modules.purchase.entity.vos.PurchaseOrderVO;
import cn.lili.modules.purchase.service.PurchaseOrderService;
import cn.lili.mybatis.util.PageUtil;
import com.baomidou.mybatisplus.core.metadata.IPage;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.validation.constraints.NotNull;
/**
* 买家端,采购接口
*
* @author Chopper
* @since 2020/11/16 10:06 下午
*/
@Api(tags = "买家端,采购接口")
@RestController
@RequestMapping("/buyer/purchase")
public class PurchaseBuyerController {
/**
* 采购单
*/
@Autowired
private PurchaseOrderService purchaseOrderService;
@Autowired
private GoodsUnitService goodsUnitService;
@ApiOperation(value = "分页获取商品计量单位")
@GetMapping("/goodsUnit")
public ResultMessage<IPage<GoodsUnit>> goodsUnitPage(PageVO pageVO) {
return ResultUtil.data(goodsUnitService.page(PageUtil.initPage(pageVO)));
}
@PreventDuplicateSubmissions
@ApiOperation(value = "添加采购单")
@PostMapping
public ResultMessage<PurchaseOrderVO> addPurchaseOrderVO(@RequestBody PurchaseOrderVO purchaseOrderVO) {
return ResultUtil.data(purchaseOrderService.addPurchaseOrder(purchaseOrderVO));
}
@ApiOperation(value = "采购单分页")
@GetMapping
public ResultMessage<IPage<PurchaseOrder>> get(PurchaseOrderSearchParams purchaseOrderSearchParams) {
return ResultUtil.data(purchaseOrderService.page(purchaseOrderSearchParams));
}
@ApiOperation(value = "采购单详情")
@ApiImplicitParam(name = "id", value = "采购单ID", required = true, dataType = "Long", paramType = "path")
@GetMapping("/{id}")
public ResultMessage<PurchaseOrderVO> getPurchaseOrder(@NotNull @PathVariable String id) {
return ResultUtil.data(purchaseOrderService.getPurchaseOrder(id));
}
@ApiOperation(value = "会员采购单分页")
@GetMapping("/getByMember")
public ResultMessage<IPage<PurchaseOrder>> getByMember(PurchaseOrderSearchParams purchaseOrderSearchParams) {
purchaseOrderSearchParams.setMemberId(UserContext.getCurrentUser().getId());
return ResultUtil.data(purchaseOrderService.page(purchaseOrderSearchParams));
}
@PreventDuplicateSubmissions
@ApiOperation(value = "关闭采购单")
@ApiImplicitParam(name = "id", value = "采购单ID", required = true, dataType = "Long", paramType = "path")
@PutMapping("/{id}")
public ResultMessage<Object> close(@NotNull @PathVariable String id) {
purchaseOrderService.close(id);
return ResultUtil.success(ResultCode.SUCCESS);
}
}

View File

@ -0,0 +1,69 @@
package cn.lili.controller.other.purchase;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import cn.lili.common.enums.ResultCode;
import cn.lili.common.enums.ResultUtil;
import cn.lili.common.vo.ResultMessage;
import cn.lili.modules.purchase.entity.dos.PurchaseOrder;
import cn.lili.modules.purchase.entity.dos.PurchaseQuoted;
import cn.lili.modules.purchase.entity.vos.PurchaseQuotedVO;
import cn.lili.modules.purchase.service.PurchaseOrderService;
import cn.lili.modules.purchase.service.PurchaseQuotedService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.validation.constraints.NotNull;
import java.util.List;
/**
* 买家端,采购报价接口
*
* @author Bulbasaur
* @since 2020/11/16 10:06 下午
*/
@Api(tags = "买家端,采购报价接口")
@RestController
@RequestMapping("/buyer/purchaseQuoted")
public class PurchaseQuotedController {
/**
* 采购单报价
*/
@Autowired
private PurchaseQuotedService purchaseQuotedService;
/**
* 采购单
*/
@Autowired
private PurchaseOrderService purchaseOrderService;
@ApiOperation(value = "添加采购单报价")
@PostMapping
public ResultMessage<PurchaseQuoted> addPurchaseOrderVO(@RequestBody PurchaseQuotedVO purchaseQuotedVO) {
PurchaseOrder purchaseOrder=purchaseOrderService.getById(purchaseQuotedVO.getPurchaseOrderId());
if(DateUtil.compare(purchaseOrder.getDeadline(),new DateTime())< 0){
ResultUtil.error(ResultCode.PURCHASE_ORDER_DEADLINE_ERROR);
}
return ResultUtil.data(purchaseQuotedService.addPurchaseQuoted(purchaseQuotedVO));
}
@ApiOperation(value = "报价列表")
@ApiImplicitParam(name = "purchaseOrderId", value = "报价单ID", required = true, dataType = "String", paramType = "path")
@GetMapping("/purchaseOrder/{purchaseOrderId}")
public ResultMessage<List<PurchaseQuoted>> get(@NotNull @PathVariable String purchaseOrderId) {
return ResultUtil.data(purchaseQuotedService.getByPurchaseOrderId(purchaseOrderId));
}
@ApiOperation(value = "报价单详情")
@ApiImplicitParam(name = "id", value = "报价单ID", required = true, dataType = "String", paramType = "path")
@GetMapping(value = "purchaseQuoted/{id}")
public ResultMessage<PurchaseQuotedVO> getPurchaseQuoted(@NotNull @PathVariable String id) {
return ResultUtil.data(purchaseQuotedService.getById(id));
}
}

View File

@ -0,0 +1,162 @@
package cn.lili.controller.passport;
import cn.lili.common.enums.ResultCode;
import cn.lili.common.enums.ResultUtil;
import cn.lili.common.exception.ServiceException;
import cn.lili.common.security.enums.UserEnums;
import cn.lili.common.vo.ResultMessage;
import cn.lili.modules.member.entity.dos.Member;
import cn.lili.modules.member.entity.dto.MemberEditDTO;
import cn.lili.modules.member.service.MemberService;
import cn.lili.modules.sms.SmsUtil;
import cn.lili.modules.verification.entity.enums.VerificationEnums;
import cn.lili.modules.verification.service.VerificationService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.validation.constraints.NotNull;
/**
* 买家端,会员接口
*
* @author Chopper
* @since 2020/11/16 10:07 下午
*/
@RestController
@Api(tags = "买家端,会员接口")
@RequestMapping("/buyer/members")
public class MemberBuyerController {
@Autowired
private MemberService memberService;
@Autowired
private SmsUtil smsUtil;
@Autowired
private VerificationService verificationService;
@ApiOperation(value = "登录接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "username", value = "用户名", required = true, paramType = "query"),
@ApiImplicitParam(name = "password", value = "密码", required = true, paramType = "query")
})
@PostMapping("/userLogin")
public ResultMessage<Object> userLogin(@NotNull(message = "用户名不能为空") @RequestParam String username,
@NotNull(message = "密码不能为空") @RequestParam String password,
@RequestHeader String uuid) {
verificationService.check(uuid, VerificationEnums.LOGIN);
return ResultUtil.data(this.memberService.usernameLogin(username, password));
}
@ApiOperation(value = "注销接口")
@PostMapping("/logout")
public ResultMessage<Object> logout() {
this.memberService.logout(UserEnums.MEMBER);
return ResultUtil.success();
}
@ApiOperation(value = "短信登录接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "mobile", value = "手机号", required = true, paramType = "query"),
@ApiImplicitParam(name = "code", value = "验证码", required = true, paramType = "query")
})
@PostMapping("/smsLogin")
public ResultMessage<Object> smsLogin(@NotNull(message = "手机号为空") @RequestParam String mobile,
@NotNull(message = "验证码为空") @RequestParam String code,
@RequestHeader String uuid) {
if (smsUtil.verifyCode(mobile, VerificationEnums.LOGIN, uuid, code)) {
return ResultUtil.data(memberService.mobilePhoneLogin(mobile));
} else {
throw new ServiceException(ResultCode.VERIFICATION_SMS_CHECKED_ERROR);
}
}
@ApiOperation(value = "注册用户")
@ApiImplicitParams({
@ApiImplicitParam(name = "username", value = "用户名", required = true, paramType = "query"),
@ApiImplicitParam(name = "password", value = "密码", required = true, paramType = "query"),
@ApiImplicitParam(name = "mobilePhone", value = "手机号", required = true, paramType = "query"),
@ApiImplicitParam(name = "code", value = "验证码", required = true, paramType = "query")
})
@PostMapping("/register")
public ResultMessage<Object> register(@NotNull(message = "用户名不能为空") @RequestParam String username,
@NotNull(message = "密码不能为空") @RequestParam String password,
@NotNull(message = "手机号为空") @RequestParam String mobilePhone,
@RequestHeader String uuid,
@NotNull(message = "验证码不能为空") @RequestParam String code) {
if (smsUtil.verifyCode(mobilePhone, VerificationEnums.REGISTER, uuid, code)) {
return ResultUtil.data(memberService.register(username, password, mobilePhone));
} else {
throw new ServiceException(ResultCode.VERIFICATION_SMS_CHECKED_ERROR);
}
}
@ApiOperation(value = "获取当前登录用户接口")
@GetMapping
public ResultMessage<Member> getUserInfo() {
return ResultUtil.data(memberService.getUserInfo());
}
@ApiOperation(value = "通过短信重置密码")
@ApiImplicitParams({
@ApiImplicitParam(name = "mobile", value = "手机号", required = true, paramType = "query"),
@ApiImplicitParam(name = "password", value = "是否保存登录", required = true, paramType = "query")
})
@PostMapping("/resetByMobile")
public ResultMessage<Member> resetByMobile(@NotNull(message = "手机号为空") @RequestParam String mobile,
@NotNull(message = "验证码为空") @RequestParam String code,
@RequestHeader String uuid) {
//校验短信验证码是否正确
if (smsUtil.verifyCode(mobile, VerificationEnums.FIND_USER, uuid, code)) {
//校验是否通过手机号可获取会员,存在则将会员信息存入缓存有效时间3分钟
memberService.findByMobile(uuid, mobile);
return ResultUtil.success();
} else {
throw new ServiceException(ResultCode.VERIFICATION_SMS_CHECKED_ERROR);
}
}
@ApiOperation(value = "修改密码")
@ApiImplicitParams({
@ApiImplicitParam(name = "mobile", value = "手机号", required = true, paramType = "query"),
@ApiImplicitParam(name = "password", value = "是否保存登录", required = true, paramType = "query")
})
@PostMapping("/resetPassword")
public ResultMessage<Object> resetByMobile(@NotNull(message = "密码为空") @RequestParam String password, @RequestHeader String uuid) {
return ResultUtil.data(memberService.resetByMobile(uuid, password));
}
@ApiOperation(value = "修改用户自己资料")
@PutMapping("/editOwn")
public ResultMessage<Member> editOwn(MemberEditDTO memberEditDTO) {
return ResultUtil.data(memberService.editOwn(memberEditDTO));
}
@ApiOperation(value = "修改密码")
@ApiImplicitParams({
@ApiImplicitParam(name = "password", value = "旧密码", required = true, paramType = "query"),
@ApiImplicitParam(name = "newPassword", value = "新密码", required = true, paramType = "query")
})
@PutMapping("/modifyPass")
public ResultMessage<Member> modifyPass(@NotNull(message = "旧密码不能为空") @RequestParam String password,
@NotNull(message = "新密码不能为空") @RequestParam String newPassword) {
return ResultUtil.data(memberService.modifyPass(password, newPassword));
}
@ApiOperation(value = "刷新token")
@GetMapping("/refresh/{refreshToken}")
public ResultMessage<Object> refreshToken(@NotNull(message = "刷新token不能为空") @PathVariable String refreshToken) {
return ResultUtil.data(this.memberService.refreshToken(refreshToken));
}
}

View File

@ -0,0 +1,55 @@
package cn.lili.controller.passport.connect;
import cn.lili.common.enums.ResultUtil;
import cn.lili.common.vo.ResultMessage;
import cn.lili.modules.connect.service.ConnectService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 买家端,app/小程序 联合登录
*
* @author Chopper
* @since 2020-11-25 19:29
*/
@RestController
@Api(tags = "买家端,app/小程序 联合登录")
@RequestMapping("/buyer/connect/bind")
public class ConnectBuyerBindController {
@Autowired
private ConnectService connectService;
@ApiOperation(value = "unionID 绑定")
@ApiImplicitParams({
@ApiImplicitParam(name = "unionID", value = "unionID", required = true, paramType = "query"),
@ApiImplicitParam(name = "type", value = "type", required = true, paramType = "query")
})
@PostMapping
public void unionIDBind(@RequestParam String unionID, @RequestParam String type) {
connectService.bind(unionID, type);
}
@ApiOperation(value = "unionID 解绑")
@ApiImplicitParam(name = "type", value = "type", required = true, paramType = "query")
@PostMapping("/unbind")
public void unionIDBind(@RequestParam String type) {
connectService.unbind(type);
}
@GetMapping("/list")
@ApiOperation(value = "绑定列表")
public ResultMessage<List<String>> bindList() {
return ResultUtil.data(connectService.bindList());
}
}

View File

@ -0,0 +1,102 @@
package cn.lili.controller.passport.connect;
import cn.lili.common.enums.ResultCode;
import cn.lili.common.enums.ResultUtil;
import cn.lili.common.exception.ServiceException;
import cn.lili.common.security.token.Token;
import cn.lili.common.utils.UuidUtils;
import cn.lili.common.vo.ResultMessage;
import cn.lili.modules.connect.entity.dto.AuthCallback;
import cn.lili.modules.connect.entity.dto.ConnectAuthUser;
import cn.lili.modules.connect.request.AuthRequest;
import cn.lili.modules.connect.service.ConnectService;
import cn.lili.modules.connect.util.ConnectUtil;
import cn.lili.modules.member.service.MemberService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
/**
* 买家端,web联合登录
*
* @author Chopper
*/
@Slf4j
@RestController
@Api(tags = "买家端,web联合登录")
@RequestMapping("/buyer/connect")
public class ConnectBuyerWebController {
@Autowired
private ConnectService connectService;
@Autowired
private MemberService memberService;
@Autowired
private ConnectUtil connectUtil;
@GetMapping("/login/web/{type}")
@ApiOperation(value = "WEB信任登录授权")
@ApiImplicitParams({
@ApiImplicitParam(name = "type", value = "登录方式:QQ,微信,微信_PC",
allowableValues = "QQ,WECHAT,WECHAT_PC", paramType = "path")
})
public ResultMessage<String> webAuthorize(@PathVariable String type, HttpServletResponse response) throws IOException {
AuthRequest authRequest = connectUtil.getAuthRequest(type);
String authorizeUrl = authRequest.authorize(UuidUtils.getUUID());
response.sendRedirect(authorizeUrl);
return ResultUtil.data(authorizeUrl);
}
@ApiOperation(value = "信任登录统一回调地址", hidden = true)
@GetMapping("/callback/{type}")
public void callBack(@PathVariable String type, AuthCallback callback, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws IOException {
connectUtil.callback(type, callback, httpServletRequest, httpServletResponse);
}
@ApiOperation(value = "信任登录响应结果获取")
@GetMapping("/result")
public ResultMessage<Object> callBackResult(String state) {
if (state == null) {
throw new ServiceException(ResultCode.USER_CONNECT_LOGIN_ERROR);
}
return connectUtil.getResult(state);
}
@GetMapping("/register/auto")
@ApiOperation(value = "WEB信任登录授权")
public ResultMessage<Token> webAuthorize() {
Token token = memberService.autoRegister();
return ResultUtil.data(token);
}
@ApiOperation(value = "unionID登录")
@ApiImplicitParams({
@ApiImplicitParam(name = "openId", value = "openid", required = true, paramType = "query"),
@ApiImplicitParam(name = "type", value = "联合类型", required = true,
allowableValues = "WECHAT,QQ,ALIPAY,WEIBO,APPLE", paramType = "query"),
@ApiImplicitParam(name = "uniAccessToken", value = "联合登陆返回的accessToken", required = true, paramType = "query")
})
@GetMapping("/app/login")
public ResultMessage<Token> unionLogin(ConnectAuthUser authUser, @RequestHeader("uuid") String uuid) {
try {
return ResultUtil.data(connectService.appLoginCallback(authUser, uuid));
} catch (Exception e) {
log.error("unionID登录错误", e);
}
return null;
}
}

View File

@ -0,0 +1,74 @@
package cn.lili.controller.passport.connect;
import cn.lili.common.enums.ResultUtil;
import cn.lili.common.security.token.Token;
import cn.lili.common.vo.ResultMessage;
import cn.lili.modules.connect.entity.dto.WechatMPLoginParams;
import cn.lili.modules.connect.service.ConnectService;
import cn.lili.modules.message.service.ShortLinkService;
import cn.lili.modules.wechat.entity.dos.WechatMPMessage;
import cn.lili.modules.wechat.service.WechatMPMessageService;
import cn.lili.modules.wechat.util.WechatMpCodeUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* 买家端,小程序登录接口
*
* @author Chopper
* @since 2021/2/19 09:28
*/
@RestController
@RequestMapping("/buyer/mini-program")
@Api(tags = "买家端,小程序登录接口")
public class MiniProgramBuyerController {
@Autowired
public ConnectService connectService;
@Autowired
public WechatMpCodeUtil wechatMpCodeUtil;
@SuppressWarnings("AlibabaLowerCamelCaseVariableNaming")
@Autowired
public WechatMPMessageService wechatMPMessageService;
@Autowired
public ShortLinkService shortLinkService;
@GetMapping("/auto-login")
@ApiOperation(value = "小程序自动登录")
public ResultMessage<Token> autoLogin(@RequestHeader String uuid, WechatMPLoginParams params) {
params.setUuid(uuid);
return ResultUtil.data(this.connectService.miniProgramAutoLogin(params));
}
@GetMapping("/subscribeMessage")
@ApiOperation(value = "消息订阅")
public ResultMessage<List<WechatMPMessage>> autoLogin() {
return ResultUtil.data(wechatMPMessageService.list());
}
@GetMapping("/mp/unlimited")
@ApiOperation(value = "小程序二维码生成不限制数量但是限制长度只能存放32为长度")
public ResultMessage<String> unlimited(String page, String scene) {
return ResultUtil.data(wechatMpCodeUtil.createCode(page, scene));
}
@GetMapping("/mp/qrcode")
@ApiOperation(value = "小程序二维码生成:只适用于少量场景多数场景需要unlimited接口实现")
public ResultMessage<String> qrcode(String page) {
return ResultUtil.data(wechatMpCodeUtil.createQrCode(page));
}
@GetMapping("/mp/unlimited/scene")
@ApiOperation(value = "根据shortlink 获取页面参数")
public ResultMessage<String> getScene(String id) {
return ResultUtil.data(shortLinkService.getById(id).getOriginalParams());
}
}

View File

@ -0,0 +1,105 @@
package cn.lili.controller.payment;
import cn.lili.common.enums.ResultCode;
import cn.lili.common.enums.ResultUtil;
import cn.lili.common.exception.ServiceException;
import cn.lili.common.vo.ResultMessage;
import cn.lili.modules.payment.kit.CashierSupport;
import cn.lili.modules.payment.kit.dto.PayParam;
import cn.lili.modules.payment.entity.enums.PaymentClientEnum;
import cn.lili.modules.payment.entity.enums.PaymentMethodEnum;
import cn.lili.modules.payment.kit.params.dto.CashierParam;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* 买家端,收银台接口
*
* @author Chopper
* @since 2020-12-18 16:59
*/
@Slf4j
@RestController
@Api(tags = "买家端,收银台接口")
@RequestMapping("/buyer/cashier")
public class CashierController {
@Autowired
private CashierSupport cashierSupport;
@ApiImplicitParams({
@ApiImplicitParam(name = "client", value = "客户端类型", paramType = "path", allowableValues = "PC,H5,WECHAT_MP,APP")
})
@GetMapping(value = "/tradeDetail")
@ApiOperation(value = "获取支付详情")
public ResultMessage paymentParams(@Validated PayParam payParam) {
CashierParam cashierParam = cashierSupport.cashierParam(payParam);
return ResultUtil.data(cashierParam);
}
@ApiImplicitParams({
@ApiImplicitParam(name = "paymentMethod", value = "支付方式", paramType = "path", allowableValues = "WECHAT,ALIPAY"),
@ApiImplicitParam(name = "paymentClient", value = "调起方式", paramType = "path", allowableValues = "APP,NATIVE,JSAPI,H5,MP")
})
@GetMapping(value = "/pay/{paymentMethod}/{paymentClient}")
@ApiOperation(value = "支付")
public ResultMessage payment(
HttpServletRequest request,
HttpServletResponse response,
@PathVariable String paymentMethod,
@PathVariable String paymentClient,
@Validated PayParam payParam) {
PaymentMethodEnum paymentMethodEnum = PaymentMethodEnum.valueOf(paymentMethod);
PaymentClientEnum paymentClientEnum = PaymentClientEnum.valueOf(paymentClient);
try {
return cashierSupport.payment(paymentMethodEnum, paymentClientEnum, request, response, payParam);
} catch (ServiceException se) {
log.info("支付异常", se);
throw se;
} catch (Exception e) {
log.error("收银台支付错误", e);
}
return null;
}
@ApiOperation(value = "支付回调")
@RequestMapping(value = "/callback/{paymentMethod}", method = {RequestMethod.GET, RequestMethod.POST})
public ResultMessage<Object> callback(HttpServletRequest request, @PathVariable String paymentMethod) {
PaymentMethodEnum paymentMethodEnum = PaymentMethodEnum.valueOf(paymentMethod);
cashierSupport.callback(paymentMethodEnum, request);
return ResultUtil.success(ResultCode.PAY_SUCCESS);
}
@ApiOperation(value = "支付异步通知")
@RequestMapping(value = "/notify/{paymentMethod}", method = {RequestMethod.GET, RequestMethod.POST})
public void notify(HttpServletRequest request, @PathVariable String paymentMethod) {
PaymentMethodEnum paymentMethodEnum = PaymentMethodEnum.valueOf(paymentMethod);
cashierSupport.notify(paymentMethodEnum, request);
}
@ApiOperation(value = "查询支付结果")
@GetMapping(value = "/result")
public ResultMessage<Boolean> paymentResult(PayParam payParam) {
return ResultUtil.data(cashierSupport.paymentResult(payParam));
}
}

View File

@ -0,0 +1,36 @@
package cn.lili.controller.payment;
import cn.lili.modules.payment.kit.RefundSupport;
import cn.lili.modules.payment.entity.enums.PaymentMethodEnum;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
/**
* 买家端,退款回调
*
* @author Chopper
* @since 2020-12-18 16:59
*/
@Api(tags = "买家端,退款回调")
@RestController
@RequestMapping("/buyer/cashier/refund")
public class CashierRefundController {
@Autowired
private RefundSupport refundSupport;
@ApiOperation(value = "退款通知")
@RequestMapping(value = "/notify/{paymentMethod}", method = {RequestMethod.GET, RequestMethod.POST})
public void notify(HttpServletRequest request, @PathVariable String paymentMethod) {
PaymentMethodEnum paymentMethodEnum = PaymentMethodEnum.valueOf(paymentMethod);
refundSupport.notify(paymentMethodEnum, request);
}
}

View File

@ -0,0 +1,107 @@
package cn.lili.controller.promotion;
import cn.lili.common.enums.ResultUtil;
import cn.lili.common.security.AuthUser;
import cn.lili.common.security.OperationalJudgment;
import cn.lili.common.security.context.UserContext;
import cn.lili.common.vo.PageVO;
import cn.lili.common.vo.ResultMessage;
import cn.lili.modules.promotion.entity.dos.MemberCoupon;
import cn.lili.modules.promotion.entity.dto.search.CouponSearchParams;
import cn.lili.modules.promotion.entity.dto.search.MemberCouponSearchParams;
import cn.lili.modules.promotion.entity.enums.CouponGetEnum;
import cn.lili.modules.promotion.entity.enums.PromotionsStatusEnum;
import cn.lili.modules.promotion.entity.vos.CouponVO;
import cn.lili.modules.promotion.service.CouponService;
import cn.lili.modules.promotion.service.MemberCouponService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.validation.constraints.NotNull;
import java.util.Objects;
/**
* 买家端,买家优惠券接口
*
* @author paulG
* @since 2020/11/17 3:35 下午
*/
@RestController
@Api(tags = "买家端,买家优惠券接口")
@RequestMapping("/buyer/promotion/coupon")
public class CouponBuyerController {
/**
* 优惠券
*/
@Autowired
private CouponService couponService;
/**
* 会员优惠券
*/
@Autowired
private MemberCouponService memberCouponService;
@GetMapping
@ApiOperation(value = "获取可领取优惠券列表")
public ResultMessage<IPage<CouponVO>> getCouponList(CouponSearchParams queryParam, PageVO page) {
queryParam.setPromotionStatus(PromotionsStatusEnum.START.name());
queryParam.setGetType(CouponGetEnum.FREE.name());
IPage<CouponVO> canUseCoupons = couponService.pageVOFindAll(queryParam, page);
return ResultUtil.data(canUseCoupons);
}
@ApiOperation(value = "获取当前会员的优惠券列表")
@GetMapping("/getCoupons")
public ResultMessage<IPage<MemberCoupon>> getCoupons(MemberCouponSearchParams param, PageVO pageVo) {
AuthUser currentUser = Objects.requireNonNull(UserContext.getCurrentUser());
param.setMemberId(currentUser.getId());
return ResultUtil.data(memberCouponService.getMemberCoupons(param, pageVo));
}
@ApiOperation(value = "获取当前会员的对于当前商品可使用的优惠券列表")
@GetMapping("/canUse")
public ResultMessage<IPage<MemberCoupon>> getCouponsByCanUse(MemberCouponSearchParams param, Double totalPrice, PageVO pageVo) {
AuthUser currentUser = Objects.requireNonNull(UserContext.getCurrentUser());
param.setMemberId(currentUser.getId());
return ResultUtil.data(memberCouponService.getMemberCouponsByCanUse(param, totalPrice, pageVo));
}
@ApiOperation(value = "获取当前会员可使用的优惠券数量")
@GetMapping("/getCouponsNum")
public ResultMessage<Object> getMemberCouponsNum() {
return ResultUtil.data(memberCouponService.getMemberCouponsNum());
}
@ApiOperation(value = "会员领取优惠券")
@ApiImplicitParams({
@ApiImplicitParam(name = "couponId", value = "优惠券ID", required = true, dataType = "Long", paramType = "path")
})
@GetMapping("/receive/{couponId}")
public ResultMessage<Object> receiveCoupon(@NotNull(message = "优惠券ID不能为空") @PathVariable("couponId") String couponId) {
AuthUser currentUser = Objects.requireNonNull(UserContext.getCurrentUser());
memberCouponService.receiveBuyerCoupon(couponId, currentUser.getId(), currentUser.getNickName());
return ResultUtil.success();
}
@ApiOperation(value = "通过id获取")
@ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "优惠券ID", required = true, dataType = "Long", paramType = "path")
})
@GetMapping(value = "/get/{id}")
public ResultMessage<MemberCoupon> get(@NotNull(message = "优惠券ID不能为空") @PathVariable("id") String id) {
MemberCoupon memberCoupon = OperationalJudgment.judgment(memberCouponService.getById(id));
return ResultUtil.data(memberCoupon);
}
}

View File

@ -0,0 +1,113 @@
package cn.lili.controller.promotion;
import cn.hutool.core.text.CharSequenceUtil;
import cn.lili.common.enums.ResultUtil;
import cn.lili.common.security.context.UserContext;
import cn.lili.common.vo.PageVO;
import cn.lili.common.vo.ResultMessage;
import cn.lili.modules.promotion.entity.dos.KanjiaActivity;
import cn.lili.modules.promotion.entity.dos.KanjiaActivityLog;
import cn.lili.modules.promotion.entity.dto.search.KanJiaActivityLogQuery;
import cn.lili.modules.promotion.entity.dto.search.KanjiaActivityGoodsParams;
import cn.lili.modules.promotion.entity.dto.search.KanjiaActivityQuery;
import cn.lili.modules.promotion.entity.dto.search.KanjiaActivitySearchParams;
import cn.lili.modules.promotion.entity.enums.PromotionsStatusEnum;
import cn.lili.modules.promotion.entity.vos.kanjia.KanjiaActivityGoodsListVO;
import cn.lili.modules.promotion.entity.vos.kanjia.KanjiaActivityGoodsVO;
import cn.lili.modules.promotion.entity.vos.kanjia.KanjiaActivityVO;
import cn.lili.modules.promotion.service.KanjiaActivityGoodsService;
import cn.lili.modules.promotion.service.KanjiaActivityLogService;
import cn.lili.modules.promotion.service.KanjiaActivityService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
* 买家端,砍价活动商品
*
* @author qiuqiu
* @date 2021/7/12
**/
@RestController
@Api(tags = "买家端,砍价商品接口")
@RequestMapping("/buyer/promotion/kanjiaGoods")
public class KanjiaGoodsActivityBuyerController {
/**
* 砍价活动商品
*/
@Autowired
private KanjiaActivityGoodsService kanJiaActivityGoodsService;
/**
* 帮砍记录
*/
@Autowired
private KanjiaActivityLogService kanJiaActivityLogService;
/**
* 砍价活动
*/
@Autowired
private KanjiaActivityService kanJiaActivityService;
@GetMapping
@ApiOperation(value = "分页获取砍价商品")
public ResultMessage<IPage<KanjiaActivityGoodsListVO>> kanjiaActivityGoodsPage(KanjiaActivityGoodsParams kanjiaActivityGoodsParams, PageVO page) {
// 会员端查询到的肯定是已经开始的活动商品
kanjiaActivityGoodsParams.setPromotionStatus(PromotionsStatusEnum.START.name());
// kanjiaActivityGoodsParams.setStartTime(System.currentTimeMillis());
// kanjiaActivityGoodsParams.setEndTime(System.currentTimeMillis());
return ResultUtil.data(kanJiaActivityGoodsService.kanjiaGoodsVOPage(kanjiaActivityGoodsParams, page));
}
@GetMapping("/{id}")
@ApiOperation(value = "获取砍价活动商品")
@ApiImplicitParam(name = "id", value = "砍价活动商品ID", required = true, paramType = "path")
public ResultMessage<KanjiaActivityGoodsVO> getKanjiaActivityGoods(@PathVariable String id) {
return ResultUtil.data(kanJiaActivityGoodsService.getKanJiaGoodsVO(id));
}
@GetMapping("/getKanjiaActivity/logs")
@ApiOperation(value = "分页获取砍价活动-帮砍记录")
public ResultMessage<IPage<KanjiaActivityLog>> getKanjiaActivityLog(KanJiaActivityLogQuery kanJiaActivityLogQuery, PageVO page) {
return ResultUtil.data(kanJiaActivityLogService.getForPage(kanJiaActivityLogQuery, page));
}
@PostMapping("/getKanjiaActivity")
@ApiOperation(value = "获取砍价活动")
public ResultMessage<KanjiaActivityVO> getKanJiaActivity(KanjiaActivitySearchParams kanjiaActivitySearchParams) {
//如果是非被邀请关系则填写会员ID
if (CharSequenceUtil.isEmpty(kanjiaActivitySearchParams.getKanjiaActivityId())) {
kanjiaActivitySearchParams.setMemberId(UserContext.getCurrentUser().getId());
}
return ResultUtil.data(kanJiaActivityService.getKanjiaActivityVO(kanjiaActivitySearchParams));
}
@PostMapping
@ApiImplicitParam(name = "id", value = "砍价活动商品ID", required = true, paramType = "path")
@ApiOperation(value = "发起砍价活动")
public ResultMessage<KanjiaActivityLog> launchKanJiaActivity(String id) {
KanjiaActivityLog kanjiaActivityLog = kanJiaActivityService.add(id);
return ResultUtil.data(kanjiaActivityLog);
}
@PostMapping("/help/{kanjiaActivityId}")
@ApiImplicitParam(name = "kanJiaActivityId", value = "砍价活动ID", required = true, paramType = "path")
@ApiOperation(value = "帮砍一刀")
public ResultMessage<KanjiaActivityLog> helpKanJia(@PathVariable String kanjiaActivityId) {
KanjiaActivityLog kanjiaActivityLog = kanJiaActivityService.helpKanJia(kanjiaActivityId);
return ResultUtil.data(kanjiaActivityLog);
}
@GetMapping("/kanjiaActivity/mine/")
@ApiOperation(value = "分页获取已参与的砍价活动")
public ResultMessage<IPage<KanjiaActivity>> getPointsGoodsPage(KanjiaActivityQuery kanjiaActivityQuery, PageVO page) {
// 会员端查询到的肯定是已经开始的活动商品
kanjiaActivityQuery.setMemberId(UserContext.getCurrentUser().getId());
IPage<KanjiaActivity> kanjiaActivity = kanJiaActivityService.getForPage(kanjiaActivityQuery, page);
return ResultUtil.data(kanjiaActivity);
}
}

View File

@ -0,0 +1,64 @@
package cn.lili.controller.promotion;
import cn.lili.common.enums.PromotionTypeEnum;
import cn.lili.common.enums.ResultUtil;
import cn.lili.common.vo.PageVO;
import cn.lili.common.vo.ResultMessage;
import cn.lili.modules.promotion.entity.dos.PromotionGoods;
import cn.lili.modules.promotion.entity.dto.search.PromotionGoodsSearchParams;
import cn.lili.modules.promotion.entity.enums.PromotionsStatusEnum;
import cn.lili.modules.promotion.entity.vos.PintuanMemberVO;
import cn.lili.modules.promotion.entity.vos.PintuanShareVO;
import cn.lili.modules.promotion.service.PintuanService;
import cn.lili.modules.promotion.service.PromotionGoodsService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* 买家端,拼团接口
*
* @author paulG
* @since 2021/2/20
**/
@Api(tags = "买家端,拼团接口")
@RestController
@RequestMapping("/buyer/promotion/pintuan")
public class PintuanBuyerController {
@Autowired
private PromotionGoodsService promotionGoodsService;
@Autowired
private PintuanService pintuanService;
@ApiOperation(value = "获取拼团商品")
@GetMapping
public ResultMessage<IPage<PromotionGoods>> getPintuanCategory(String goodsName, String categoryPath, PageVO pageVo) {
PromotionGoodsSearchParams searchParams = new PromotionGoodsSearchParams();
searchParams.setGoodsName(goodsName);
searchParams.setPromotionType(PromotionTypeEnum.PINTUAN.name());
searchParams.setPromotionStatus(PromotionsStatusEnum.START.name());
searchParams.setCategoryPath(categoryPath);
return ResultUtil.data(promotionGoodsService.pageFindAll(searchParams, pageVo));
}
@ApiOperation(value = "获取当前拼团活动的未成团的会员")
@GetMapping("/{pintuanId}/members")
public ResultMessage<List<PintuanMemberVO>> getPintuanMember(@PathVariable String pintuanId) {
return ResultUtil.data(pintuanService.getPintuanMember(pintuanId));
}
@ApiOperation(value = "获取当前拼团订单的拼团分享信息")
@GetMapping("/share")
public ResultMessage<PintuanShareVO> share(String parentOrderSn, String skuId) {
return ResultUtil.data(pintuanService.getPintuanShareInfo(parentOrderSn, skuId));
}
}

View File

@ -0,0 +1,59 @@
package cn.lili.controller.promotion;
import cn.lili.common.enums.ResultUtil;
import cn.lili.common.vo.PageVO;
import cn.lili.common.vo.ResultMessage;
import cn.lili.modules.promotion.entity.dos.PointsGoods;
import cn.lili.modules.promotion.entity.dos.PointsGoodsCategory;
import cn.lili.modules.promotion.entity.dto.search.PointsGoodsSearchParams;
import cn.lili.modules.promotion.entity.enums.PromotionsStatusEnum;
import cn.lili.modules.promotion.entity.vos.PointsGoodsVO;
import cn.lili.modules.promotion.service.PointsGoodsCategoryService;
import cn.lili.modules.promotion.service.PointsGoodsService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 买家端,积分商品接口
*
* @author paulG
* @since 2021/1/19
**/
@RestController
@Api(tags = "买家端,积分商品接口")
@RequestMapping("/buyer/promotion/pointsGoods")
public class PointsGoodsBuyerController {
@Autowired
private PointsGoodsService pointsGoodsService;
@Autowired
private PointsGoodsCategoryService pointsGoodsCategoryService;
@GetMapping
@ApiOperation(value = "分页获取积分商品")
public ResultMessage<IPage<PointsGoods>> getPointsGoodsPage(PointsGoodsSearchParams searchParams, PageVO page) {
searchParams.setPromotionStatus(PromotionsStatusEnum.START.name());
IPage<PointsGoods> pointsGoodsByPage = pointsGoodsService.pageFindAll(searchParams, page);
return ResultUtil.data(pointsGoodsByPage);
}
@GetMapping("/category")
@ApiOperation(value = "获取积分商品分类分页")
public ResultMessage<IPage<PointsGoodsCategory>> page(String name, PageVO page) {
return ResultUtil.data(pointsGoodsCategoryService.getCategoryByPage(name, page));
}
@GetMapping("/{id}")
@ApiOperation(value = "获取积分活动商品")
@ApiImplicitParam(name = "id", value = "积分商品ID", required = true, paramType = "path")
public ResultMessage<PointsGoodsVO> getPointsGoodsPage(@PathVariable String id) {
return ResultUtil.data(pointsGoodsService.getPointsGoodsDetail(id));
}
}

View File

@ -0,0 +1,48 @@
package cn.lili.controller.promotion;
import cn.lili.common.enums.ResultUtil;
import cn.lili.common.vo.ResultMessage;
import cn.lili.modules.promotion.entity.vos.SeckillGoodsVO;
import cn.lili.modules.promotion.entity.vos.SeckillTimelineVO;
import cn.lili.modules.promotion.service.SeckillApplyService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* 买家端,秒杀活动接口
*
* @author paulG
* @since 2020/11/17 2:30 下午
*/
@Api(tags = "买家端,秒杀活动接口")
@RestController
@RequestMapping("/buyer/promotion/seckill")
public class SeckillBuyerController {
/**
* 秒杀活动
*/
@Autowired
private SeckillApplyService seckillApplyService;
@ApiOperation(value = "获取当天秒杀活动信息")
@GetMapping
public ResultMessage<List<SeckillTimelineVO>> getSeckillTime() {
return ResultUtil.data(seckillApplyService.getSeckillTimeline());
}
@ApiOperation(value = "获取某个时刻的秒杀活动商品信息")
@GetMapping("/{timeline}")
public ResultMessage<List<SeckillGoodsVO>> getSeckillGoods(@PathVariable Integer timeline) {
return ResultUtil.data(seckillApplyService.getSeckillGoods(timeline));
}
}

View File

@ -0,0 +1,109 @@
package cn.lili.controller.store;
import cn.lili.common.enums.ResultUtil;
import cn.lili.common.security.context.UserContext;
import cn.lili.common.vo.PageVO;
import cn.lili.common.vo.ResultMessage;
import cn.lili.modules.goods.entity.vos.StoreGoodsLabelVO;
import cn.lili.modules.goods.service.StoreGoodsLabelService;
import cn.lili.modules.store.entity.dto.StoreBankDTO;
import cn.lili.modules.store.entity.dto.StoreCompanyDTO;
import cn.lili.modules.store.entity.dto.StoreOtherInfoDTO;
import cn.lili.modules.store.entity.vos.*;
import cn.lili.modules.store.service.StoreDetailService;
import cn.lili.modules.store.service.StoreService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.validation.constraints.NotNull;
import java.util.List;
/**
* 买家端,店铺接口
*
* @author Bulbasaur
* @since 2020/11/17 2:32 下午
*/
@RestController
@RequestMapping("/buyer/store")
@Api(tags = "买家端,店铺接口")
public class StoreBuyerController {
/**
* 店铺
*/
@Autowired
private StoreService storeService;
/**
* 店铺商品分类
*/
@Autowired
private StoreGoodsLabelService storeGoodsLabelService;
/**
* 店铺详情
*/
@Autowired
private StoreDetailService storeDetailService;
@ApiOperation(value = "获取店铺列表分页")
@GetMapping
public ResultMessage<IPage<StoreVO>> getByPage(StoreSearchParams entity, PageVO page) {
return ResultUtil.data(storeService.findByConditionPage(entity, page));
}
@ApiOperation(value = "通过id获取店铺信息")
@ApiImplicitParam(name = "id", value = "店铺ID", required = true, paramType = "path")
@GetMapping(value = "/get/detail/{id}")
public ResultMessage<StoreBasicInfoVO> detail(@NotNull @PathVariable String id) {
return ResultUtil.data(storeDetailService.getStoreBasicInfoDTO(id));
}
@ApiOperation(value = "通过id获取店铺详细信息-营业执照")
@ApiImplicitParam(name = "id", value = "店铺ID", required = true, paramType = "path")
@GetMapping(value = "/get/licencePhoto/{id}")
public ResultMessage<StoreOtherVO> licencePhoto(@NotNull @PathVariable String id) {
return ResultUtil.data(storeDetailService.getStoreOtherVO(id));
}
@ApiOperation(value = "通过id获取店铺商品分类")
@ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "店铺ID", required = true, paramType = "path")
})
@GetMapping(value = "/label/get/{id}")
public ResultMessage<List<StoreGoodsLabelVO>> storeGoodsLabel(@NotNull @PathVariable String id) {
return ResultUtil.data(storeGoodsLabelService.listByStoreId(id));
}
@ApiOperation(value = "申请店铺第一步-填写企业信息")
@PutMapping(value = "/apply/first")
public ResultMessage<Object> applyFirstStep(StoreCompanyDTO storeCompanyDTO) {
storeService.applyFirstStep(storeCompanyDTO);
return ResultUtil.success();
}
@ApiOperation(value = "申请店铺第二步-填写银行信息")
@PutMapping(value = "/apply/second")
public ResultMessage<Object> applyFirstStep(StoreBankDTO storeBankDTO) {
storeService.applySecondStep(storeBankDTO);
return ResultUtil.success();
}
@ApiOperation(value = "申请店铺第三步-填写其他信息")
@PutMapping(value = "/apply/third")
public ResultMessage<Object> applyFirstStep(StoreOtherInfoDTO storeOtherInfoDTO) {
storeService.applyThirdStep(storeOtherInfoDTO);
return ResultUtil.success();
}
@ApiOperation(value = "获取当前登录会员的店铺信息-入驻店铺")
@GetMapping(value = "/apply")
public ResultMessage<StoreDetailVO> apply() {
return ResultUtil.data(storeDetailService.getStoreDetailVOByMemberId(UserContext.getCurrentUser().getId()));
}
}

View File

@ -0,0 +1,61 @@
package cn.lili.controller.wallet;
import cn.lili.common.aop.annotation.PreventDuplicateSubmissions;
import cn.lili.common.enums.ResultUtil;
import cn.lili.common.security.context.UserContext;
import cn.lili.common.vo.PageVO;
import cn.lili.common.vo.ResultMessage;
import cn.lili.modules.member.entity.vo.MemberReceiptAddVO;
import cn.lili.modules.member.entity.vo.MemberReceiptVO;
import cn.lili.modules.member.service.MemberReceiptService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
* 买家端,会员发票接口
*
* @author paulG
* @since 2021-03-29 14:10:16
*/
@RestController
@Api(tags = "买家端,会员发票接口")
@RequestMapping("/buyer/member/receipt")
public class MemberReceiptController {
@Autowired
private MemberReceiptService memberReceiptService;
@ApiOperation(value = "查询会员发票列表")
@GetMapping
public ResultMessage<Object> page(MemberReceiptVO memberReceiptVO, PageVO page) {
return ResultUtil.data(memberReceiptService.getPage(memberReceiptVO, page));
}
@PreventDuplicateSubmissions
@ApiOperation(value = "新增会员发票")
@PostMapping
public ResultMessage<Object> add(MemberReceiptAddVO memberReceiptAddVO) {
return ResultUtil.data(memberReceiptService.addMemberReceipt(memberReceiptAddVO, UserContext.getCurrentUser().getId()));
}
@ApiOperation(value = "修改会员发票")
@ApiImplicitParam(name = "id", value = "会员发票id", required = true, paramType = "path")
@PutMapping
public ResultMessage<Object> update(@PathVariable String id, MemberReceiptAddVO memberReceiptAddVO) {
memberReceiptAddVO.setId(id);
return ResultUtil.data(memberReceiptService.editMemberReceipt(memberReceiptAddVO, id));
}
@ApiOperation(value = "会员发票删除")
@ApiImplicitParam(name = "id", value = "会员发票id", required = true, paramType = "path")
@DeleteMapping
public ResultMessage<Boolean> deleteMessage(@PathVariable String id) {
return ResultUtil.data(memberReceiptService.deleteMemberReceipt(id));
}
}

View File

@ -0,0 +1,134 @@
package cn.lili.controller.wallet;
import cn.lili.common.aop.annotation.PreventDuplicateSubmissions;
import cn.lili.common.enums.ResultCode;
import cn.lili.common.enums.ResultUtil;
import cn.lili.common.exception.ServiceException;
import cn.lili.common.security.AuthUser;
import cn.lili.common.security.context.UserContext;
import cn.lili.common.vo.ResultMessage;
import cn.lili.modules.member.entity.dos.Member;
import cn.lili.modules.member.service.MemberService;
import cn.lili.modules.verification.entity.enums.VerificationEnums;
import cn.lili.modules.verification.service.VerificationService;
import cn.lili.modules.wallet.entity.dos.MemberWallet;
import cn.lili.modules.wallet.entity.vo.MemberWalletVO;
import cn.lili.modules.wallet.service.MemberWalletService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.web.bind.annotation.*;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.Pattern;
/**
* 买家端,会员余额接口
*
* @author pikachu
* @since 2020/11/16 10:07 下午
*/
@RestController
@Api(tags = "买家端,会员余额接口")
@RequestMapping("/buyer/members/wallet")
public class MemberWalletBuyerController {
/**
* 会员
*/
@Autowired
private MemberService memberService;
/**
* 会员余额
*/
@Autowired
private MemberWalletService memberWalletService;
/**
* 验证码
*/
@Autowired
private VerificationService verificationService;
@GetMapping
@ApiOperation(value = "查询会员预存款余额")
public ResultMessage<MemberWalletVO> get() {
AuthUser authUser = UserContext.getCurrentUser();
if (authUser != null) {
return ResultUtil.data(memberWalletService.getMemberWallet(authUser.getId()));
}
throw new ServiceException(ResultCode.USER_NOT_LOGIN);
}
@PostMapping(value = "/set-password")
@ApiOperation(value = "设置支付密码")
@ApiImplicitParams({
@ApiImplicitParam(name = "password", value = "支付密码", required = true, dataType = "String", paramType = "query")
})
public ResultMessage<Object> setPassword(String password, @RequestHeader String uuid) {
AuthUser authUser = UserContext.getCurrentUser();
//校验当前用户是否存在
Member member = memberService.getById(authUser.getId());
if (member == null) {
throw new ServiceException(ResultCode.USER_NOT_EXIST);
}
//校验验证码
if (verificationService.check(uuid, VerificationEnums.WALLET_PASSWORD)) {
memberWalletService.setMemberWalletPassword(member, password);
throw new ServiceException(ResultCode.SUCCESS);
} else {
throw new ServiceException(ResultCode.VERIFICATION_ERROR);
}
}
@PostMapping(value = "/update-password/ordinary")
@ApiOperation(value = "普通方式进行支付密码的修改")
@ApiImplicitParams({
@ApiImplicitParam(name = "oldPassword", value = "旧支付密码", required = true, dataType = "String", paramType = "query"),
@ApiImplicitParam(name = "newPassword", value = "新支付密码", required = true, dataType = "String", paramType = "query")
})
public ResultMessage updatePassword(@RequestParam @Pattern(regexp = "[a-fA-F0-9]{32}", message = "旧密码格式不正确") String oldPassword,
@RequestParam @Pattern(regexp = "[a-fA-F0-9]{32}", message = "新密码格式不正确") String newPassword) {
AuthUser authUser = UserContext.getCurrentUser();
//校验当前用户是否存在
Member member = memberService.getById(authUser.getId());
if (member == null) {
throw new ServiceException(ResultCode.USER_NOT_EXIST);
}
MemberWallet memberWallet = this.memberWalletService.getOne(new QueryWrapper<MemberWallet>().eq("member_id", member.getId()));
//校验新旧密码是否一致
if (memberWallet != null) {
if (!new BCryptPasswordEncoder().matches(oldPassword, memberWallet.getWalletPassword())) {
throw new ServiceException(ResultCode.USER_OLD_PASSWORD_ERROR);
}
this.memberWalletService.setMemberWalletPassword(member, newPassword);
return ResultUtil.data("修改成功");
} else {
throw new ServiceException(ResultCode.WALLET_NOT_EXIT_ERROR);
}
}
@GetMapping(value = "/check")
@ApiOperation(value = "检测会员是否设置过支付密码,会员中心设置或者修改密码时使用")
public Boolean checkPassword() {
return memberWalletService.checkPassword();
}
@PreventDuplicateSubmissions
@PostMapping(value = "/withdrawal")
@ApiOperation(value = "会员中心余额提现")
@ApiImplicitParams({
@ApiImplicitParam(name = "price", value = "提现金额", required = true, dataType = "double", paramType = "query")
})
public ResultMessage<Boolean> withdrawal(@Max(value = 9999, message = "充值金额单次最多允许提现9999元") @Min(value = 1, message = "充值金额单次最少提现金额为1元") Double price) {
return ResultUtil.data(memberWalletService.applyWithdrawal(price));
}
}

View File

@ -0,0 +1,44 @@
package cn.lili.controller.wallet;
import cn.lili.common.enums.ResultUtil;
import cn.lili.common.security.context.UserContext;
import cn.lili.common.vo.PageVO;
import cn.lili.common.vo.ResultMessage;
import cn.lili.modules.wallet.entity.dos.MemberWithdrawApply;
import cn.lili.modules.wallet.entity.vo.MemberWithdrawApplyQueryVO;
import cn.lili.modules.wallet.service.MemberWithdrawApplyService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 买家端,余额提现记录接口
*
* @author pikachu
* @since 2020/11/16 10:07 下午
*/
@RestController
@Api(tags = "买家端,余额提现记录接口")
@RequestMapping("/buyer/member/withdrawApply")
public class MemberWithdrawApplyBuyerController {
@Autowired
private MemberWithdrawApplyService memberWithdrawApplyService;
@ApiOperation(value = "分页获取提现记录")
@GetMapping
public ResultMessage<IPage<MemberWithdrawApply>> getByPage(PageVO page, MemberWithdrawApplyQueryVO memberWithdrawApplyQueryVO) {
memberWithdrawApplyQueryVO.setMemberId(UserContext.getCurrentUser().getId());
//构建查询 返回数据
IPage<MemberWithdrawApply> memberWithdrawApplyPage = memberWithdrawApplyService.getMemberWithdrawPage(page, memberWithdrawApplyQueryVO);
return ResultUtil.data(memberWithdrawApplyPage);
}
}

View File

@ -0,0 +1,43 @@
package cn.lili.controller.wallet;
import cn.lili.common.enums.ResultUtil;
import cn.lili.common.security.context.UserContext;
import cn.lili.common.vo.PageVO;
import cn.lili.common.vo.ResultMessage;
import cn.lili.modules.order.trade.entity.vo.RechargeQueryVO;
import cn.lili.modules.wallet.entity.dos.Recharge;
import cn.lili.modules.wallet.service.RechargeService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 买家端,预存款充值记录接口
*
* @author pikachu
* @since 2020/11/16 10:07 下午
*/
@RestController
@Api(tags = "买家端,预存款充值记录接口")
@RequestMapping("/buyer/member/recharge")
public class RechargeBuyerController {
@Autowired
private RechargeService rechargeService;
@ApiOperation(value = "分页获取预存款充值记录")
@GetMapping
public ResultMessage<IPage<Recharge>> getByPage(PageVO page) {
//构建查询参数
RechargeQueryVO rechargeQueryVO = new RechargeQueryVO();
rechargeQueryVO.setMemberId(UserContext.getCurrentUser().getId());
//构建查询 返回数据
IPage<Recharge> rechargePage = rechargeService.rechargePage(page, rechargeQueryVO);
return ResultUtil.data(rechargePage);
}
}

View File

@ -0,0 +1,44 @@
package cn.lili.controller.wallet;
import cn.lili.common.enums.ResultUtil;
import cn.lili.common.security.AuthUser;
import cn.lili.common.security.context.UserContext;
import cn.lili.common.vo.PageVO;
import cn.lili.common.vo.ResultMessage;
import cn.lili.modules.wallet.entity.dos.WalletLog;
import cn.lili.modules.wallet.service.WalletLogService;
import cn.lili.mybatis.util.PageUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 买家端,预存款变动日志记录接口
*
* @author pikachu
* @since 2020/11/16 10:07 下午
*/
@RestController
@Api(tags = "买家端,预存款变动日志记录接口")
@RequestMapping("/buyer/wallet/log")
public class WalletLogBuyerController {
@Autowired
private WalletLogService walletLogService;
@ApiOperation(value = "分页获取预存款变动日志")
@GetMapping
public ResultMessage<IPage<WalletLog>> getByPage(PageVO page) {
//获取当前登录用户
AuthUser authUser = UserContext.getCurrentUser();
//构建查询 返回数据
IPage<WalletLog> depositLogPage = walletLogService.page(PageUtil.initPage(page),
new QueryWrapper<WalletLog>().eq("member_id", authUser.getId()).orderByDesc("create_time"));
return ResultUtil.data(depositLogPage);
}
}

View File

@ -0,0 +1,121 @@
package cn.lili.security;
import cn.hutool.core.util.StrUtil;
import cn.lili.cache.Cache;
import cn.lili.cache.CachePrefix;
import cn.lili.common.security.AuthUser;
import cn.lili.common.security.enums.SecurityEnum;
import cn.lili.common.security.enums.UserEnums;
import cn.lili.common.security.token.SecretKeyUtil;
import cn.lili.common.utils.ResponseUtil;
import com.google.gson.Gson;
import io.jsonwebtoken.Claims;
import io.jsonwebtoken.ExpiredJwtException;
import io.jsonwebtoken.Jwts;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.web.authentication.www.BasicAuthenticationFilter;
import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
/**
* 认证结果过滤器
*
* @author Chopper
* @version v4.1
* @since 2020/11/17 3:37 下午
* @since
*/
@Slf4j
public class BuyerAuthenticationFilter extends BasicAuthenticationFilter {
/**
* 缓存
*/
@Autowired
private Cache cache;
/**
* 自定义构造器
*
* @param authenticationManager
* @param cache
*/
public BuyerAuthenticationFilter(AuthenticationManager authenticationManager,
Cache cache) {
super(authenticationManager);
this.cache = cache;
}
@Override
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain chain) throws IOException, ServletException {
//从header中获取jwt
String jwt = request.getHeader(SecurityEnum.HEADER_TOKEN.getValue());
try {
//如果没有token 则return
if (StrUtil.isBlank(jwt)) {
chain.doFilter(request, response);
return;
}
//获取用户信息存入context
UsernamePasswordAuthenticationToken authentication = getAuthentication(jwt, response);
SecurityContextHolder.getContext().setAuthentication(authentication);
} catch (Exception e) {
log.error("BuyerAuthenticationFilter-> member authentication exception:", e);
}
chain.doFilter(request, response);
}
/**
* 解析用户
*
* @param jwt
* @param response
* @return
*/
private UsernamePasswordAuthenticationToken getAuthentication(String jwt, HttpServletResponse response) {
try {
Claims claims
= Jwts.parser()
.setSigningKey(SecretKeyUtil.generalKeyByDecoders())
.parseClaimsJws(jwt).getBody();
//获取存储在claims中的用户信息
String json = claims.get(SecurityEnum.USER_CONTEXT.getValue()).toString();
AuthUser authUser = new Gson().fromJson(json, AuthUser.class);
//校验redis中是否有权限
if (cache.hasKey(CachePrefix.ACCESS_TOKEN.getPrefix(UserEnums.MEMBER) + jwt)) {
//构造返回信息
List<GrantedAuthority> auths = new ArrayList<>();
auths.add(new SimpleGrantedAuthority("ROLE_" + authUser.getRole().name()));
UsernamePasswordAuthenticationToken authentication = new UsernamePasswordAuthenticationToken(authUser.getUsername(), null, auths);
authentication.setDetails(authUser);
return authentication;
}
ResponseUtil.output(response, 403, ResponseUtil.resultMap(false, 403, "登录已失效,请重新登录"));
return null;
} catch (ExpiredJwtException e) {
log.debug("user analysis exception:", e);
} catch (Exception e) {
log.error("user analysis exception:", e);
}
return null;
}
}

View File

@ -0,0 +1,83 @@
package cn.lili.security;
import cn.lili.cache.Cache;
import cn.lili.common.security.CustomAccessDeniedHandler;
import cn.lili.common.utils.SpringContextUtil;
import cn.lili.common.properties.IgnoredUrlsProperties;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.config.annotation.web.configurers.ExpressionUrlAuthorizationConfigurer;
import org.springframework.security.config.http.SessionCreationPolicy;
import org.springframework.web.cors.CorsConfigurationSource;
/**
* spring Security 核心配置类 Buyer安全配置中心
*
* @author Chopper
* @version v4.0
* @since 2020/11/14 16:20
*/
@Slf4j
@Configuration
@EnableGlobalMethodSecurity(prePostEnabled = true)
public class BuyerSecurityConfig extends WebSecurityConfigurerAdapter {
/**
* 忽略验权配置
*/
@Autowired
private IgnoredUrlsProperties ignoredUrlsProperties;
/**
* spring security - 权限不足处理
*/
@Autowired
private CustomAccessDeniedHandler accessDeniedHandler;
@Autowired
private Cache<String> cache;
@Override
protected void configure(HttpSecurity http) throws Exception {
ExpressionUrlAuthorizationConfigurer<HttpSecurity>.ExpressionInterceptUrlRegistry registry = http
.authorizeRequests();
//配置的url 不需要授权
for (String url : ignoredUrlsProperties.getUrls()) {
registry.antMatchers(url).permitAll();
}
registry
.and()
//禁止网页iframe
.headers().frameOptions().disable()
.and()
.logout()
.permitAll()
.and()
.authorizeRequests()
//任何请求
.anyRequest()
//需要身份认证
.authenticated()
.and()
//允许跨域
.cors().configurationSource((CorsConfigurationSource) SpringContextUtil.getBean("corsConfigurationSource")).and()
//关闭跨站请求防护
.csrf().disable()
//前后端分离采用JWT 不需要session
.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS)
.and()
//自定义权限拒绝处理类
.exceptionHandling().accessDeniedHandler(accessDeniedHandler)
.and()
//添加JWT认证过滤器
.addFilter(new BuyerAuthenticationFilter(authenticationManager(), cache));
}
}

View File

@ -0,0 +1,296 @@
server:
port: 8885
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://127.0.0.1:8000
# 文件大小上传配置
servlet:
multipart:
max-file-size: 20MB
max-request-size: 20MB
cache:
type: redis
#jackson json解析
jackson:
time-zone: GMT+8
serialization:
#关闭jackson 对json做解析
fail-on-empty-beans: false
# mongodb
data:
mongodb:
host: 192.168.2.126
port: 27017
database: rx-shop
username: goboo
password: Gb84505016
authentication-database: admin
# replica-set-name: mongoreplset
# Redis
redis:
host: 192.168.2.126
port: 6379
password: Gb84505016
lettuce:
pool:
# 连接池最大连接数(使用负值表示没有限制) 默认 8
max-active: 200
# 连接池最大阻塞等待时间(使用负值表示没有限制) 默认 -1
max-wait: 20
# 连接池中的最大空闲连接 默认 8
max-idle: 10
# 连接池中的最小空闲连接 默认 8
min-idle: 8
#mysql
shardingsphere:
datasource:
# 数据库名称,可自定义,可以为多个,以逗号隔开,每个在这里定义的库,都要在下面定义连接属性
names: default-datasource
default-datasource:
type: com.alibaba.druid.pool.DruidDataSource
driverClassName: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://192.168.2.126:3306/rx-shop?useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC&allowPublicKeyRetrieval=true&verifyServerCertificate=false&useSSL=false
username: rx-shop
password: J2xEZ42HwPXrDXt3
maxActive: 20
initialSize: 5
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
# 忽略TOKEN 鉴权 的url
ignored:
urls:
- /editor-app/**
- /actuator**
- /actuator/**
- /MP_verify_qSyvBPhDsPdxvOhC.txt
- /weixin/**
- /source/**
- /buyer/mini-program/**
- /buyer/cashier/**
- /buyer/pageData/**
- /buyer/article/**
- /buyer/goods/**
- /buyer/category/**
- /buyer/store
- /buyer/store/get**
- /buyer/store/get/**
- /buyer/store/label/get**
- /buyer/store/label/get/**
- /buyer/connect/**
- /buyer/members/**
- /buyer/promotion/pintuan/**
- /buyer/promotion/coupon/**
- /buyer/promotion/seckill/**
- /buyer/promotion/pointsGoods/**
- /buyer/memberEvaluation/**/goodsEvaluation
- /buyer/memberEvaluation/**/evaluationNumber
- /buyer/appVersion/**
- /buyer/broadcast/studio/**
- /druid/**
- /swagger-ui.html
- /doc.html
- /swagger-resources/**
- /swagger/**
- /webjars/**
- /v2/api-docs
- /configuration/ui
- /boot-admin
- /**/*.js
- /**/*.css
- /**/*.png
- /**/*.ico
# Swagger界面内容配置
swagger:
title: API接口文档
description: Api Documentation
version: 1.0.0
termsOfServiceUrl:
contact:
name: rx
url:
email:
# 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: debug
org.hibernate: debug
# org.springframework: debug
# org.springframework.data.mongodb.core: debug
file:
# 指定路径
path: lili-logs
# 最大保存天数
max-history: 7
# 每个文件最大大小
max-size: 5MB
#加密参数
jasypt:
encryptor:
password: lili
lili:
system:
isDemoSite: false
statistics:
# 在线人数统计 X 小时。这里设置48即统计过去48小时每小时在线人数
onlineMember: 48
# 当前在线人数刷新时间间隔单位秒设置为600则每10分钟刷新一次
currentOnlineUpdate: 600
#qq lbs 申请
lbs:
key: 4BYBZ-7MT6S-PUAOA-6BNWL-FJUD7-UUFXT
sk: zhNKVrJK6UPOhqIjn8AQvG37b9sz6
#域名
domain:
pc: https://pc-b2b2c.pickmall.cn
wap: https://m-b2b2c.pickmall.cn
store: https://store-b2b2c.pickmall.cn
admin: https://admin-b2b2c.pickmall.cn
#api地址
api:
buyer: https://buyer-api.pickmall.cn
common: https://common-api.pickmall.cn
manager: https://admin-api.pickmall.cn
store: https://store-api.pickmall.cn
# jwt 细节设定
jwt-setting:
# token过期时间分钟
tokenExpireTime: 60
# 使用Spring @Cacheable注解失效时间
cache:
# 过期时间 单位秒 永久不过期设为-1
timeout: 1500
#多线程配置
thread:
corePoolSize: 5
maxPoolSize: 50
queueCapacity: 50
data:
elasticsearch:
cluster-name: elasticsearch
cluster-nodes: 192.168.2.126:9200
index:
number-of-replicas: 0
number-of-shards: 3
index-prefix: lili
schema: http
# account:
# username: elastic
# password: LiLiShopES
logstash:
server: 192.168.2.126: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: 192.168.2.126:9876
producer:
group: lili_group
send-message-timeout: 30000
xxl:
job:
admin:
addresses: http://192.168.2.126:9001/xxl-job-admin
executor:
appname: xxl-job-executor-lilishop
address:
ip:
port: 8891
logpath: ./xxl-job/executor
logretentiondays: 7

View File

@ -0,0 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE configuration>
<configuration>
<include resource="org/springframework/boot/logging/logback/defaults.xml"/>
<include resource="org/springframework/boot/logging/logback/console-appender.xml"/>
<!--应用名称-->
<springProperty scope="context" name="APP_NAME" source="spring.application.name"/>
<!--日志文件保存路径-->
<springProperty scope="context" name="LOG_FILE_PATH" source="logging.file.path"/>
<springProperty scope="context" name="LOGSTASH_SERVER" source="lili.data.logstash.server"/>
<contextName>${APP_NAME}</contextName>
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${LOG_FILE_PATH}/${APP_NAME}-%d{yyyy-MM-dd}.log</fileNamePattern>
<maxHistory>30</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${FILE_LOG_PATTERN}</pattern>
</encoder>
</appender>
<!--输出到elk的LOGSTASH-->
<appender name="LOGSTASH" class="net.logstash.logback.appender.LogstashTcpSocketAppender">
<!-- 配置elk日志收集 配饰的是 LOGSTASH 的地址-->
<destination>${LOGSTASH_SERVER}</destination>
<encoder charset="UTF-8" class="net.logstash.logback.encoder.LogstashEncoder">
<providers>
<timestamp>
<timeZone>UTC</timeZone>
</timestamp>
</providers>
<!--自定义字段 区分项目-->
<customFields>{"appName":"${APP_NAME}"}</customFields>
</encoder>
</appender>
<!-- <root level="INFO">-->
<root>
<appender-ref ref="CONSOLE"/>
<appender-ref ref="FILE"/>
<appender-ref ref="LOGSTASH"/>
</root>
</configuration>

View File

@ -0,0 +1 @@
qSyvBPhDsPdxvOhC

View File

@ -0,0 +1,75 @@
package cn.lili.buyer.test.cart;
import cn.hutool.json.JSONUtil;
import cn.lili.modules.goods.entity.vos.CategoryVO;
import cn.lili.modules.goods.service.CategoryService;
import cn.lili.modules.order.cart.entity.dto.TradeDTO;
import cn.lili.modules.order.cart.entity.enums.CartTypeEnum;
import cn.lili.modules.order.cart.entity.vo.TradeParams;
import cn.lili.modules.order.cart.service.CartService;
import cn.lili.modules.payment.service.PaymentService;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit.jupiter.SpringExtension;
import java.util.List;
/**
* @author paulG
* @since 2020/11/14
**/
@ExtendWith(SpringExtension.class)
@SpringBootTest
class CartTest {
@Autowired
private CartService cartService;
@Autowired
private CategoryService categoryService;
@Autowired
private PaymentService paymentService;
@Test
void getAll() {
TradeDTO allTradeDTO = cartService.getAllTradeDTO();
Assertions.assertNotNull(allTradeDTO);
System.out.println(JSONUtil.toJsonStr(allTradeDTO));
}
@Test
void deleteAll() {
cartService.delete(new String[]{"1344220459059404800"});
Assertions.assertTrue(true);
}
@Test
void createTrade() {
// TradeDTO allTradeDTO = cartService.getAllTradeDTO();
// Assert.assertNotNull(allTradeDTO);
// System.out.println(JsonUtil.objectToJson(allTradeDTO));
cartService.createTrade(new TradeParams());
}
@Test
void getAllCategory() {
List<CategoryVO> allCategory = categoryService.categoryTree();
for (CategoryVO categoryVO : allCategory) {
System.out.println(categoryVO);
}
Assertions.assertTrue(true);
}
@Test
void storeCoupon() {
cartService.selectCoupon("1333318596239843328", CartTypeEnum.CART.name(), true);
Assertions.assertTrue(true);
}
}

View File

@ -0,0 +1,54 @@
package cn.lili.buyer.test.cart;
import cn.lili.modules.file.plugin.FileManagerPlugin;
import cn.lili.modules.goods.entity.dos.Brand;
import cn.lili.modules.goods.service.BrandService;
import com.xkcoding.http.util.StringUtil;
import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit.jupiter.SpringExtension;
import java.io.*;
import java.net.URL;
import java.util.List;
/**
* @author paulG
* @since 2020/11/14
**/
@Slf4j
@ExtendWith(SpringExtension.class)
@SpringBootTest
class FileTest {
@Autowired
private FileManagerPlugin fileManagerPlugin;
@Autowired
private BrandService brandService;
@Test
void test() throws Exception {
List<Brand> categoryList = brandService.list();
for (Brand brand : categoryList) {
try {
if (StringUtil.isEmpty(brand.getLogo()) || brand.getLogo().indexOf("lilishop") > 1) {
continue;
}
URL url = new URL(brand.getLogo());
InputStream inputStream = url.openStream();
//上传至第三方云服务或服务器
brand.setLogo(fileManagerPlugin.inputStreamUpload(inputStream, brand.getId() + ".png"));
} catch (IOException e) {
log.error("上传你文件出错",e);
}
}
brandService.updateBatchById(categoryList);
}
}

View File

@ -0,0 +1,30 @@
package cn.lili.buyer.test.cart;
import cn.lili.modules.promotion.service.MemberCouponService;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit.jupiter.SpringExtension;
import static org.junit.jupiter.api.Assertions.assertTrue;
/**
* @author paulG
* @since 2020/11/27
**/
@ExtendWith(SpringExtension.class)
@SpringBootTest
class MemberCouponTest {
@Autowired
private MemberCouponService memberCouponService;
@Test
void receiveCoupon() {
memberCouponService.receiveCoupon("1333318596239843328", "1326834797335306240", "1");
assertTrue(true);
}
}

View File

@ -0,0 +1,287 @@
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.2.126:8000
# mongodb
data:
mongodb:
host: 192.168.2.126
port: 27017
database: rx-shop
username: goboo
password: Gb84505016
authentication-database: admin
# replica-set-name: mongoreplset
cache:
type: redis
#amqp
# rabbitmq:
# host: 192.168.2.126
# Redis
redis:
host: 192.168.2.126
port: 6379
password: Gb84505016
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://192.168.2.126:3306/rx-shop?useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC&allowPublicKeyRetrieval=true&verifyServerCertificate=false&useSSL=false
username: rx-shop
password: J2xEZ42HwPXrDXt3
maxActive: 20
initialSize: 5
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/**
- /buyer/mini-program/**
- /buyer/cashier/**
- /buyer/pageData/**
- /buyer/article/**
- /buyer/goods/**
- /buyer/category/**
- /buyer/store/**
- /buyer/connect/**
- /buyer/members/**
- /buyer/promotion/pintuan/**
- /buyer/promotion/seckill/**
- /buyer/promotion/pointsGoods/**
- /buyer/memberEvaluation/**/goodsEvaluation
- /buyer/memberEvaluation/**/evaluationNumber
- /store/login/**
- /manager/user/login
- /manager/user/refresh/**
- /druid/**
- /swagger-ui.html
- /doc.html
- /swagger-resources/**
- /swagger/**
- /webjars/**
- /v2/api-docs
- /configuration/ui
- /boot-admin
- /**/*.js
- /**/*.css
- /**/*.png
- /**/*.ico
# Swagger界面内容配置
swagger:
title: API接口文档
description: Api Documentation
version: 1.0.0
termsOfServiceUrl:
contact:
name: rx
url:
email:
# 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
# org.springframework.data.mongodb.core: debug
file:
# 指定路径
path: lili-logs
# 最大保存天数
max-history: 7
# 每个文件最大大小
max-size: 5MB
#加密参数
jasypt:
encryptor:
password: lili
lili:
system:
isDemoSite: false
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.2.126:8885
wap: http://192.168.2.126:8885
seller: http://192.168.2.126:8885
admin: http://192.168.2.126:8885
#api地址
api:
buyer: https://z171l91606.51mypc.cn
base: http://192.168.2.126:8885
manager: http://192.168.2.126:8885
seller: http://192.168.2.126:8885
# jwt 细节设定
jwt-setting:
# token过期时间分钟
tokenExpireTime: 60
# 使用Spring @Cacheable注解失效时间
cache:
# 过期时间 单位秒 永久不过期设为-1
timeout: 1500
#多线程配置
thread:
corePoolSize: 5
maxPoolSize: 50
queueCapacity: 50
data:
elasticsearch:
cluster-name: elasticsearch
cluster-nodes: 192.168.2.126:9200
index:
number-of-replicas: 0
number-of-shards: 3
index-prefix: lili
schema: http
# account:
# username: elastic
# password: LiLiShopES
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
rocketmq:
name-server: 192.168.2.126:9876
producer:
group: lili_group
send-message-timeout: 30000
xxl:
job:
admin:
addresses: http://192.168.2.126:9001/xxl-job-admin
executor:
appname: xxl-job-executor-lilishop
address:
ip:
port: 8891
logpath: ./xxl-job/executor
logretentiondays: 7

33
common-api/pom.xml Normal file
View File

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>cn.lili</groupId>
<artifactId>lili-shop-parent</artifactId>
<version>${revision}</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>common-api</artifactId>
<dependencies>
<dependency>
<groupId>cn.lili</groupId>
<artifactId>framework</artifactId>
<version>${revision}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,21 @@
package cn.lili;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching;
/**
* 基础API
*
* @author Chopper
* @since 2020/11/17 3:38 下午
*/
@EnableCaching
@SpringBootApplication
public class CommonApiApplication {
public static void main(String[] args) {
SpringApplication.run(CommonApiApplication.class, args);
}
}

View File

@ -0,0 +1,98 @@
package cn.lili.controller.common;
import cn.lili.cache.Cache;
import cn.lili.common.enums.ResultCode;
import cn.lili.common.enums.ResultUtil;
import cn.lili.common.exception.ServiceException;
import cn.lili.common.security.AuthUser;
import cn.lili.common.security.context.UserContext;
import cn.lili.common.security.enums.UserEnums;
import cn.lili.common.vo.PageVO;
import cn.lili.common.vo.ResultMessage;
import cn.lili.common.vo.SearchVO;
import cn.lili.modules.file.entity.File;
import cn.lili.modules.file.entity.dto.FileOwnerDTO;
import cn.lili.modules.file.service.FileService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 文件管理管理接口
*
* @author Chopper
* @since 2020/11/26 15:41
*/
@RestController
@Api(tags = "文件管理管理接口")
@RequestMapping("/common/file")
public class FileController {
@Autowired
private FileService fileService;
@Autowired
private Cache cache;
@ApiOperation(value = "获取自己的图片资源")
@GetMapping
@ApiImplicitParam(name = "title", value = "名称模糊匹配")
public ResultMessage<IPage<File>> getFileList(@RequestHeader String accessToken, File file, SearchVO searchVO, PageVO pageVo) {
AuthUser authUser = UserContext.getAuthUser(cache, accessToken);
FileOwnerDTO fileOwnerDTO = new FileOwnerDTO();
//只有买家才写入自己id
if (authUser.getRole().equals(UserEnums.MEMBER)) {
fileOwnerDTO.setOwnerId(authUser.getId());
}//如果是店铺则写入店铺id
else if (authUser.getRole().equals(UserEnums.STORE)) {
fileOwnerDTO.setOwnerId(authUser.getStoreId());
}
fileOwnerDTO.setUserEnums(authUser.getRole().name());
return ResultUtil.data(fileService.customerPageOwner(fileOwnerDTO, file, searchVO, pageVo));
}
@ApiOperation(value = "文件重命名")
@PostMapping(value = "/rename")
public ResultMessage<File> upload(@RequestHeader String accessToken, String id, String newName) {
AuthUser authUser = UserContext.getAuthUser(cache, accessToken);
File file = fileService.getById(id);
file.setName(newName);
//操作图片属性判定
switch (authUser.getRole()) {
case MEMBER:
if (file.getOwnerId().equals(authUser.getId()) && file.getUserEnums().equals(authUser.getRole().name())) {
break;
}
throw new ServiceException(ResultCode.USER_AUTHORITY_ERROR);
case STORE:
if (file.getOwnerId().equals(authUser.getStoreId()) && file.getUserEnums().equals(authUser.getRole().name())) {
break;
}
throw new ServiceException(ResultCode.USER_AUTHORITY_ERROR);
case MANAGER:
break;
default:
throw new ServiceException(ResultCode.USER_AUTHORITY_ERROR);
}
fileService.updateById(file);
return ResultUtil.data(file);
}
@ApiOperation(value = "文件删除")
@DeleteMapping(value = "/delete/{ids}")
public ResultMessage delete(@RequestHeader String accessToken, @PathVariable List<String> ids) {
AuthUser authUser = UserContext.getAuthUser(cache, accessToken);
fileService.batchDelete(ids, authUser);
return ResultUtil.success();
}
}

View File

@ -0,0 +1,49 @@
package cn.lili.controller.common;
import cn.hutool.json.JSONUtil;
import cn.lili.common.enums.ResultCode;
import cn.lili.common.enums.ResultUtil;
import cn.lili.common.exception.ServiceException;
import cn.lili.common.vo.ResultMessage;
import cn.lili.modules.system.entity.dos.Setting;
import cn.lili.modules.system.entity.dto.ImSetting;
import cn.lili.modules.system.entity.enums.SettingEnum;
import cn.lili.modules.system.service.SettingService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* IM控制器
*
* @author Chopper
* @version v1.0
* 2021-09-16 15:32
*/
@RestController
@RequestMapping("/common/IM")
@Api(tags = "IM 中心")
public class IMController {
@Autowired
private SettingService settingService;
@ApiOperation(value = "获取IM接口前缀")
@GetMapping
public ResultMessage<String> getUrl() {
String imUrl;
try {
Setting imSettingVal = settingService.get(SettingEnum.IM_SETTING.name());
ImSetting imSetting = JSONUtil.toBean(imSettingVal.getSettingValue(), ImSetting.class);
imUrl = imSetting.getHttpUrl() + "?tenant_id=" + imSetting.getTenantId()+"&merchant_euid=";
} catch (Exception e) {
throw new ServiceException(ResultCode.PLATFORM_NOT_SUPPORTED_IM);
}
return ResultUtil.data(imUrl);
}
}

View File

@ -0,0 +1,34 @@
package cn.lili.controller.common;
import cn.lili.common.enums.ResultUtil;
import cn.lili.common.utils.IpHelper;
import cn.lili.common.vo.ResultMessage;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
/**
* 管理端,IP接口
*
* @author Chopper
* @since 2020-02-25 14:10:16
*/
@RestController
@Api(tags = "获取IP信息以及天气")
@RequestMapping("/common/ip")
public class IpInfoManagerController {
@Autowired
private IpHelper ipHelper;
@RequestMapping(value = "/info", method = RequestMethod.GET)
@ApiOperation(value = "IP及天气相关信息")
public ResultMessage<Object> upload(HttpServletRequest request) {
String result = ipHelper.getIpCity(request);
return ResultUtil.data(result);
}
}

View File

@ -0,0 +1,36 @@
package cn.lili.controller.common;
import cn.lili.common.enums.ResultUtil;
import cn.lili.common.vo.ResultMessage;
import cn.lili.modules.system.entity.enums.SettingEnum;
import cn.lili.modules.system.service.SettingService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 文件管理管理接口
*
* @author Chopper
* @since 2020/11/26 15:41
*/
@RestController
@Api(tags = "文件管理管理接口")
@RequestMapping("/common/logo")
public class LogoController {
@Autowired
private SettingService settingService;
@ApiOperation(value = "获取logo")
@GetMapping
public ResultMessage<Object> getFileList() {
return ResultUtil.data(settingService.get(SettingEnum.BASE_SETTING.name()));
}
}

View File

@ -0,0 +1,56 @@
package cn.lili.controller.common;
import cn.lili.common.enums.ResultUtil;
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.vo.RegionVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 地址信息接口
*
* @author Chopper
*/
@RestController
@Api(tags = "地址信息接口")
@RequestMapping("/common/region")
public class RegionController {
@Autowired
private RegionService regionService;
@ApiOperation(value = "点地图获取地址信息")
@ApiImplicitParams({
@ApiImplicitParam(name = "cityCode", value = "城市code", dataType = "String", paramType = "query"),
@ApiImplicitParam(name = "townName", value = "镇名称", dataType = "Long", paramType = "query")
})
@GetMapping(value = "/region")
public ResultMessage<Object> getRegion(@RequestParam String cityCode,@RequestParam String townName) {
return ResultUtil.data(regionService.getRegion(cityCode,townName));
}
@GetMapping(value = "/item/{id}")
@ApiImplicitParam(name = "id", value = "地区ID", required = true, dataType = "String", paramType = "path")
@ApiOperation(value = "通过id获取子地区")
public ResultMessage<List<Region>> getItem(@PathVariable String id) {
return ResultUtil.data(regionService.getItem(id));
}
@GetMapping(value = "/allCity")
@ApiOperation(value = "获取所有的省-市")
public ResultMessage<List<RegionVO>> getAllCity() {
return ResultUtil.data(regionService.getAllCity());
}
}

View File

@ -0,0 +1,44 @@
package cn.lili.controller.common;
import cn.lili.cache.limit.annotation.LimitPoint;
import cn.lili.common.aop.annotation.PreventDuplicateSubmissions;
import cn.lili.common.enums.ResultUtil;
import cn.lili.common.vo.ResultMessage;
import cn.lili.modules.verification.entity.enums.VerificationEnums;
import cn.lili.modules.verification.service.VerificationService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
* 滑块验证码接口
*
* @author Chopper
* @since 2020/11/26 15:41
*/
@Slf4j
@RestController
@RequestMapping("/common/slider")
@Api(tags = "滑块验证码接口")
public class SliderImageController {
@Autowired
private VerificationService verificationService;
@LimitPoint(name = "slider_image", key = "verification")
@GetMapping("/{verificationEnums}")
@ApiOperation(value = "获取校验接口,一分钟同一个ip请求10次")
public ResultMessage getSliderImage(@RequestHeader String uuid, @PathVariable VerificationEnums verificationEnums) {
return ResultUtil.data(verificationService.createVerification(verificationEnums, uuid));
}
@LimitPoint(name = "slider_image", key = "verification_pre_check", limit = 600)
@PostMapping("/{verificationEnums}")
@ApiOperation(value = "验证码预校验")
public ResultMessage verificationImage(Integer xPos, @RequestHeader String uuid, @PathVariable VerificationEnums verificationEnums) {
return ResultUtil.data(verificationService.preCheck(xPos, uuid, verificationEnums));
}
}

View File

@ -0,0 +1,48 @@
package cn.lili.controller.common;
import cn.lili.cache.limit.annotation.LimitPoint;
import cn.lili.common.enums.ResultCode;
import cn.lili.common.enums.ResultUtil;
import cn.lili.common.vo.ResultMessage;
import cn.lili.modules.sms.SmsUtil;
import cn.lili.modules.verification.entity.enums.VerificationEnums;
import cn.lili.modules.verification.service.VerificationService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
* 短信验证码接口
*
* @author Chopper
* @since 2020/11/26 15:41
*/
@RestController
@Api(tags = "短信验证码接口")
@RequestMapping("/common/sms")
public class SmsController {
@Autowired
private SmsUtil smsUtil;
@Autowired
private VerificationService verificationService;
@LimitPoint(name = "sms_send", key = "sms")
@ApiImplicitParams({
@ApiImplicitParam(paramType = "path", dataType = "String", name = "mobile", value = "手机号"),
@ApiImplicitParam(paramType = "header", dataType = "String", name = "uuid", value = "uuid"),
})
@GetMapping("/{verificationEnums}/{mobile}")
@ApiOperation(value = "发送短信验证码,一分钟同一个ip请求1次")
public ResultMessage getSmsCode(
@RequestHeader String uuid,
@PathVariable String mobile,
@PathVariable VerificationEnums verificationEnums) {
verificationService.check(uuid, verificationEnums);
smsUtil.sendSmsCode(mobile, verificationEnums, uuid);
return ResultUtil.success(ResultCode.VERIFICATION_SEND_SUCCESS);
}
}

View File

@ -0,0 +1,112 @@
package cn.lili.controller.common;
import cn.hutool.core.text.CharSequenceUtil;
import cn.lili.cache.Cache;
import cn.lili.common.enums.ResultCode;
import cn.lili.common.enums.ResultUtil;
import cn.lili.common.exception.ServiceException;
import cn.lili.common.properties.SystemSettingProperties;
import cn.lili.common.security.AuthUser;
import cn.lili.common.security.context.UserContext;
import cn.lili.common.security.enums.UserEnums;
import cn.lili.common.utils.Base64DecodeMultipartFile;
import cn.lili.common.utils.CommonUtil;
import cn.lili.common.vo.ResultMessage;
import cn.lili.modules.file.entity.File;
import cn.lili.modules.file.plugin.QiNiuManagerPlugin;
import cn.lili.modules.file.service.FileService;
import cn.lili.modules.system.entity.dos.Setting;
import cn.lili.modules.system.entity.enums.SettingEnum;
import cn.lili.modules.system.service.SettingService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import java.io.InputStream;
import java.util.Objects;
/**
* 文件上传接口
*
* @author Chopper
* @since 2020/11/26 15:41
*/
@Slf4j
@RestController
@Api(tags = "文件上传接口")
@RequestMapping("/common/upload")
public class UploadController {
@Autowired
private FileService fileService;
@Autowired
private SettingService settingService;
@Autowired
private QiNiuManagerPlugin fileManagerPlugin;
@Autowired
private Cache cache;
@ApiOperation(value = "文件上传")
@PostMapping(value = "/file")
public ResultMessage<Object> upload(MultipartFile file,
String base64,
@RequestHeader String accessToken) {
AuthUser authUser = UserContext.getAuthUser(cache, accessToken);
//如果用户未登录则无法上传图片
if (authUser == null) {
throw new ServiceException(ResultCode.USER_AUTHORITY_ERROR);
}
Setting setting = settingService.get(SettingEnum.OSS_SETTING.name());
if (setting == null || CharSequenceUtil.isBlank(setting.getSettingValue())) {
throw new ServiceException(ResultCode.OSS_NOT_EXIST);
}
if (file == null || CharSequenceUtil.isEmpty(file.getContentType())) {
throw new ServiceException(ResultCode.IMAGE_FILE_EXT_ERROR);
}
if (!CharSequenceUtil.containsAny(file.getContentType().toLowerCase(), "image")) {
throw new ServiceException(ResultCode.FILE_TYPE_NOT_SUPPORT);
}
if (CharSequenceUtil.isNotBlank(base64)) {
//base64上传
file = Base64DecodeMultipartFile.base64Convert(base64);
}
String result;
String fileKey = CommonUtil.rename(Objects.requireNonNull(file.getOriginalFilename()));
File newFile = new File();
try {
InputStream inputStream = file.getInputStream();
//上传至第三方云服务或服务器
result = fileManagerPlugin.inputStreamUpload(inputStream, fileKey);
//保存数据信息至数据库
newFile.setName(file.getOriginalFilename());
newFile.setFileSize(file.getSize());
newFile.setFileType(file.getContentType());
newFile.setFileKey(fileKey);
newFile.setUrl(result);
newFile.setCreateBy(authUser.getUsername());
newFile.setUserEnums(authUser.getRole().name());
//如果是店铺则记录店铺id
if (authUser.getRole().equals(UserEnums.STORE)) {
newFile.setOwnerId(authUser.getStoreId());
} else {
newFile.setOwnerId(authUser.getId());
}
fileService.save(newFile);
} catch (Exception e) {
log.error("文件上传失败", e);
throw new ServiceException(ResultCode.OSS_EXCEPTION_ERROR);
}
return ResultUtil.data(result);
}
}

View File

@ -0,0 +1,65 @@
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 org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.config.annotation.web.configurers.ExpressionUrlAuthorizationConfigurer;
import org.springframework.web.cors.CorsConfigurationSource;
/**
* spring Security 核心配置类 通用安全
*
* @author Chopper
* @version v4.0
* @since 2020/11/14 16:20
*/
@Slf4j
@Configuration
@EnableGlobalMethodSecurity(prePostEnabled = true)
public class CommonSecurityConfig extends WebSecurityConfigurerAdapter {
/**
* 忽略验权配置
*/
@Autowired
private IgnoredUrlsProperties ignoredUrlsProperties;
/**
* spring security - 权限不足处理
*/
@Autowired
private CustomAccessDeniedHandler accessDeniedHandler;
@Autowired
private Cache<String> cache;
@Autowired
private CorsConfigurationSource corsConfigurationSource;
@Override
protected void configure(HttpSecurity http) throws Exception {
ExpressionUrlAuthorizationConfigurer<HttpSecurity>.ExpressionInterceptUrlRegistry registry = http
.authorizeRequests();
registry
.and()
//禁止网页iframe
.headers().frameOptions().disable()
.and()
.authorizeRequests()
//任何请求
.anyRequest()
//需要身份认证
.permitAll()
.and()
//允许跨域
.cors().configurationSource(corsConfigurationSource).and()
//关闭跨站请求防护
.csrf().disable();
}
}

View File

@ -0,0 +1,309 @@
server:
port: 8890
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://127.0.0.1:8000
# mongodb
data:
mongodb:
host: 192.168.2.126
port: 27017
database: rx-shop
username: goboo
password: Gb84505016
authentication-database: admin
# replica-set-name: mongoreplset
cache:
type: redis
# Redis
redis:
host: 192.168.2.126
port: 6379
password: Gb84505016
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://192.168.2.126:3306/rx-shop?useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC&allowPublicKeyRetrieval=true&verifyServerCertificate=false&useSSL=false
username: rx-shop
password: J2xEZ42HwPXrDXt3
maxActive: 20
initialSize: 5
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/**
- /buyer/mini-program/**
- /buyer/cashier/**
- /buyer/pageData/**
- /buyer/article/**
- /buyer/goods/**
- /buyer/category/**
- /buyer/shop/**
- /buyer/connect/**
- /buyer/members/smsLogin
- /buyer/members/refresh/*
- /buyer/members/refresh**
- /buyer/promotion/pintuan
- /buyer/promotion/seckill
- /buyer/memberEvaluation/**/goodsEvaluation
- /buyer/memberEvaluation/**/evaluationNumber
- /store/login/**
- /manager/user/login
- /manager/user/refresh/**
- /druid/**
- /swagger-ui.html
- /doc.html
- /swagger-resources/**
- /swagger/**
- /webjars/**
- /v2/api-docs
- /configuration/ui
- /boot-admin
- /**/*.js
- /**/*.css
- /**/*.png
- /**/*.ico
# Swagger界面内容配置
swagger:
title: API接口文档
description: Api Documentation
version: 1.0.0
termsOfServiceUrl:
contact:
name: rx
url:
email:
# 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
# org.springframework.data.mongodb.core: debug
file:
# 指定路径
path: lili-logs
# 最大保存天数
max-history: 7
# 每个文件最大大小
max-size: 5MB
#加密参数
jasypt:
encryptor:
password: lili
lili:
#验证码设置
verification-code:
#图形验证码有效时间 秒 包含滑块验证码有效时间, 以及验证通过之后,缓存中存储的验证结果有效时间
effectiveTime: 300
#水印
watermark:
#干扰项数量 最大2 默认0
interfereNum: 0
#允许误差像素
faultTolerant: 3
#短信模版配置
sms:
#登录
LOGIN: SMS_205755300
#注册
REGISTER: SMS_205755298
#找回密码
FIND_USER: SMS_205755301
#设置密码
UPDATE_PASSWORD: SMS_205755297
#支付密码
WALLET_PASSWORD: SMS_205755301
system:
isTestModel: true
statistics:
# 在线人数统计 X 小时。这里设置48即统计过去48小时每小时在线人数
onlineMember: 48
# 当前在线人数刷新时间间隔单位秒设置为600则每10分钟刷新一次
currentOnlineUpdate: 600
#qq lbs 申请
lbs:
key: 4BYBZ-7MT6S-PUAOA-6BNWL-FJUD7-UUFXT
sk: zhNKVrJK6UPOhqIjn8AQvG37b9sz6
#域名
domain:
pc: https://pc.b2b2c.pickmall.cn
wap: https://m.b2b2c.pickmall.cn
store: https://store.b2b2c.pickmall.cn
admin: https://admin.b2b2c.pickmall.cn
#api地址
api:
buyer: https://buyer-api.pickmall.cn
common: https://common-api.pickmall.cn
manager: https://admin-api.pickmall.cn
store: https://store-api.pickmall.cn
# jwt 细节设定
jwt-setting:
# token过期时间分钟
tokenExpireTime: 60
# 使用Spring @Cacheable注解失效时间
cache:
# 过期时间 单位秒 永久不过期设为-1
timeout: 1500
#多线程配置
thread:
corePoolSize: 5
maxPoolSize: 50
queueCapacity: 50
data:
elasticsearch:
cluster-name: elasticsearch
cluster-nodes: 192.168.2.126:9200
index:
number-of-replicas: 0
number-of-shards: 3
index-prefix: lili
schema: http
# account:
# username: elastic
# password: LiLiShopES
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
rocketmq:
name-server: 192.168.2.126:9876
producer:
group: lili_group
send-message-timeout: 30000
xxl:
job:
admin:
addresses: http://192.168.2.126:9001/xxl-job-admin
executor:
appname: xxl-job-executor-lilishop
address:
ip:
port: 8891
logpath: ./xxl-job/executor
logretentiondays: 7

View File

@ -0,0 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE configuration>
<configuration>
<include resource="org/springframework/boot/logging/logback/defaults.xml"/>
<include resource="org/springframework/boot/logging/logback/console-appender.xml"/>
<!--应用名称-->
<springProperty scope="context" name="APP_NAME" source="spring.application.name"/>
<!--日志文件保存路径-->
<springProperty scope="context" name="LOG_FILE_PATH" source="logging.file.path"/>
<springProperty scope="context" name="LOGSTASH_SERVER" source="lili.data.logstash.server"/>
<contextName>${APP_NAME}</contextName>
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${LOG_FILE_PATH}/${APP_NAME}-%d{yyyy-MM-dd}.log</fileNamePattern>
<maxHistory>30</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${FILE_LOG_PATTERN}</pattern>
</encoder>
</appender>
<!--输出到elk的LOGSTASH-->
<appender name="LOGSTASH" class="net.logstash.logback.appender.LogstashTcpSocketAppender">
<!-- 配置elk日志收集 配饰的是 LOGSTASH 的地址-->
<destination>${LOGSTASH_SERVER}</destination>
<encoder charset="UTF-8" class="net.logstash.logback.encoder.LogstashEncoder">
<providers>
<timestamp>
<timeZone>UTC</timeZone>
</timestamp>
</providers>
<!--自定义字段 区分项目-->
<customFields>{"appName":"${APP_NAME}"}</customFields>
</encoder>
</appender>
<!-- <root level="INFO">-->
<root>
<appender-ref ref="CONSOLE"/>
<appender-ref ref="FILE"/>
<appender-ref ref="LOGSTASH"/>
</root>
</configuration>

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Some files were not shown because too many files have changed in this diff Show More