Compare commits

...

884 Commits

Author SHA1 Message Date
Tankaikai 3efa643d82 Merge remote-tracking branch 'origin/test' into es_release_0.1 2025-01-15 16:00:46 +08:00
谭凯凯 ab674a2ee1 测试环境合并集成ES 20240115 2025-01-15 15:58:15 +08:00
谭凯凯 5a3ae55492 测试环境合并集成ES 20240113 2025-01-13 17:38:36 +08:00
谭凯凯 4c28282f6a 测试环境合并集成ES 20240113 2025-01-13 10:23:39 +08:00
Tankaikai f27ca3228c Merge remote-tracking branch 'origin/es' into es_release_0.1
# Conflicts:
#	src/main/java/com/sqx/modules/app/entity/UserEntity.java
#	src/main/java/com/sqx/modules/app/entity/UserInfo.java
#	src/main/java/com/sqx/modules/app/entity/UserMoneyDetails.java
#	src/main/java/com/sqx/modules/app/service/impl/UserServiceImpl.java
#	src/main/java/com/sqx/modules/course/entity/CourseCollect.java
#	src/main/java/com/sqx/modules/course/entity/CourseUser.java
#	src/main/java/com/sqx/modules/discSpinning/entity/DiscSpinningRecord.java
#	src/main/java/com/sqx/modules/pay/controller/app/WuyouController.java
#	src/main/java/com/sqx/modules/pay/entity/CashOut.java
#	src/main/java/com/sqx/modules/pay/entity/PayDetails.java
#	src/main/java/com/sqx/modules/taskCenter/entity/TaskCenterRecord.java
#	src/main/java/com/sqx/modules/userSign/entity/UserSignRecord.java
#	src/main/resources/application-dev.yml
#	src/main/resources/application.yml
2025-01-13 10:22:04 +08:00
GYJ 0dd1ddf829 Merge remote-tracking branch 'origin/test' into test 2025-01-13 09:58:42 +08:00
GYJ a17df0ab5e 修改 redis 配置 2025-01-13 09:58:20 +08:00
谭凯凯 6c45e24c77 生产环境关闭swagger 2025-01-13 09:41:45 +08:00
谭凯凯 a8f1871a48 集成ES 2025-01-13 09:40:01 +08:00
谭凯凯 0321b4753a 集成ES 2025-01-13 09:39:29 +08:00
张松 6368120a1b 拉新奖励去除与邀请人身份信息相同的数据 2025-01-10 18:22:49 +08:00
wangw fa285004b3 任务领取 2025-01-10 17:30:48 +08:00
wangw a8444e34e6 上级为官方 优化执行 2025-01-10 17:12:25 +08:00
wangw a88b6a225c 上级为官方时 不统计 2025-01-10 17:08:38 +08:00
wangw 27c19e979e 邀请人 userID优化 2025-01-10 16:53:04 +08:00
张松 29cea2bd7d Merge remote-tracking branch 'origin/test' into test 2025-01-10 16:42:49 +08:00
张松 a7147f875d user增加邀请人id,通过邀请码获取用户修改为id获取 2025-01-10 16:42:39 +08:00
Tankaikai d0a5e26834 Merge remote-tracking branch 'origin/test' into test 2025-01-10 16:41:39 +08:00
谭凯凯 988737d25e 邀请用户列表增加字段,显示未认证、新人、老人 2025-01-10 16:41:34 +08:00
wangw 1e3cc8b217 多余代码移除 2025-01-10 16:29:18 +08:00
张松 591929d979 userinfo获取不插入记录 2025-01-10 16:16:39 +08:00
谭凯凯 61303bf0d6 邀请用户列表增加字段,显示未认证、新人、老人 2025-01-10 16:12:12 +08:00
Tankaikai a9252c49ce Merge remote-tracking branch 'origin/test' into test 2025-01-10 16:08:13 +08:00
谭凯凯 0d87c9ac50 邀请用户列表增加字段,显示未认证、新人、老人 2025-01-10 16:08:07 +08:00
wangw 399c68db86 任务中心 展示优化 2025-01-10 16:05:39 +08:00
wangw 3fde641ce3 无邀请人时 return 2025-01-10 16:00:45 +08:00
wangw beb2648726 优化任务中心 2025-01-10 15:42:53 +08:00
Tankaikai f7df0eb0d5 Merge remote-tracking branch 'origin/test' into test 2025-01-10 15:14:17 +08:00
谭凯凯 e5e7962cc3 敏感数据脱敏 2025-01-10 15:14:11 +08:00
wangw e3f3e7d654 任务中心 处理一次性任务
大转盘抽奖 第三次需要实名后使用
2025-01-10 14:58:02 +08:00
Tankaikai 8d12ce9ae5 Merge remote-tracking branch 'origin/test' into test 2025-01-10 14:33:43 +08:00
Tankaikai 96cb4d934c 一个身份证号可以认证三个账号 2025-01-10 14:33:35 +08:00
张松 46305060ff 15人达标奖励领取条件需要实名认证去除重复认证信息 2025-01-10 14:17:35 +08:00
Tankaikai f3989082cf Merge remote-tracking branch 'origin/test' into test 2025-01-10 14:15:43 +08:00
谭凯凯 ad193e1416 一个身份证号可以认证三个账号 2025-01-10 14:15:36 +08:00
张松 3231f9c3f4 15人达标奖励领取条件需要实名认证 2025-01-10 13:55:42 +08:00
wangw 9976e12396 提现回调 提示描述修改 2025-01-10 10:55:22 +08:00
wangw 95fd316f4d nsq消息队列 初始2 2025-01-10 10:55:03 +08:00
张松 28112104c4 Merge remote-tracking branch 'origin/test' into test 2025-01-10 09:56:59 +08:00
张松 3ec519e95f 一分钟支付超12次拉入黑名单 2025-01-10 09:56:45 +08:00
谭凯凯 f9b6e75def bug修复 2025-01-10 09:56:30 +08:00
谭凯凯 9d0ed1ff9c 捕获IoException: Broken pip并处理 2025-01-10 09:31:18 +08:00
GYJ 230f172b51 log 2025-01-09 19:09:12 +08:00
GYJ bece507b11 bug fix 2025-01-09 19:02:03 +08:00
GYJ ef3c35fd08 bug fix 2025-01-09 18:45:37 +08:00
Tankaikai afbeee7f9d 提现策略改动 2025-01-09 18:40:38 +08:00
Tankaikai a15d317e77 Merge remote-tracking branch 'origin/test' into test 2025-01-09 18:36:04 +08:00
谭凯凯 b870e916f7 提现策略改动 2025-01-09 18:35:58 +08:00
wangw d9208a5228 多余参数移除 2025-01-09 18:20:53 +08:00
wangw 63c1862a2b 优化日志打印 2025-01-09 17:44:24 +08:00
GYJ db504fb664 注释 nsq 2025-01-09 17:17:36 +08:00
张松 b58d3a7cf0 courseMessage报错修复 2025-01-09 17:13:39 +08:00
wangw e5ebc3798f channel 配置 初版 2025-01-09 17:08:26 +08:00
张松 fc01fdca2b 公告列表去除分页参数 2025-01-09 16:33:48 +08:00
GYJ aa20ba6437 token 非彼选 2025-01-09 16:27:46 +08:00
张松 d78388fed3 公告列表返回所有信息 2025-01-09 16:16:42 +08:00
张松 ffaac7d6dd Merge remote-tracking branch 'origin/test' into test 2025-01-09 16:08:10 +08:00
张松 b30d7673d7 公告列表增加默认值 2025-01-09 16:08:01 +08:00
Tankaikai f06b217f97 Merge remote-tracking branch 'origin/test' into test 2025-01-09 16:03:33 +08:00
谭凯凯 f1f4da6dab common查询优化 2025-01-09 16:03:27 +08:00
张松 a018bb36ed 公告id返回为string 2025-01-09 15:50:41 +08:00
张松 04bc369859 Merge remote-tracking branch 'origin/test' into test 2025-01-09 15:46:31 +08:00
张松 63426cf962 公告id返回为string 2025-01-09 15:46:21 +08:00
Tankaikai c6dacc49aa Merge remote-tracking branch 'origin/test' into test 2025-01-09 15:35:39 +08:00
谭凯凯 404cac71c5 提现时间加配置 2025-01-09 15:35:34 +08:00
张松 693c7b0abc 公告增加类型 2025-01-09 15:32:38 +08:00
张松 7724d2ec65 公告增加类型 2025-01-09 15:25:19 +08:00
谭凯凯 d2f8267fc6 管理端bug修复 2025-01-09 14:44:42 +08:00
谭凯凯 acc36e92dd 管理端bug修复 2025-01-09 14:37:37 +08:00
谭凯凯 bc06b2c139 提现全面使用银行卡 2025-01-09 13:56:43 +08:00
GYJ abc8e53a0e 修改 提现时间判断 2025-01-09 12:40:21 +08:00
谭凯凯 1d7ac18cb8 提现全面使用银行卡 2025-01-09 11:50:45 +08:00
Tankaikai a8dcde7b52 Merge remote-tracking branch 'origin/test' into test 2025-01-09 11:48:33 +08:00
谭凯凯 70a14baac4 提现全面使用银行卡 2025-01-09 11:48:25 +08:00
wangw 6c3899599b 拉黑用户时 记录用户行为 2025-01-09 11:41:59 +08:00
wangw 7460f19592 拉黑用户时 记录用户行为 2025-01-09 11:39:35 +08:00
Tankaikai 779eb706c7 Merge remote-tracking branch 'origin/test' into test 2025-01-09 11:39:24 +08:00
谭凯凯 feaa941d67 提现全面使用银行卡 2025-01-09 11:39:16 +08:00
wangw ae45ce5d12 拉黑用户时 增加更新时间 2025-01-09 10:50:08 +08:00
GYJ 88a4bc1171 Merge branch 'dev' into test 2025-01-09 10:20:38 +08:00
GYJ 76256efe99 修改提现方式 2025-01-09 10:20:07 +08:00
wangw 47c0d9a93a 推荐视频 优化 2025-01-09 10:04:21 +08:00
wangw 61a4415d5b CourseDetails 移除多余值 2025-01-09 09:40:07 +08:00
GYJ 09b6469cc5 四要素认证暂时关闭 2025-01-08 22:27:15 +08:00
GYJ 625a2aeb9b 提现时间为每天8:00-18:00 2025-01-08 22:24:37 +08:00
Tankaikai 9cca25f3a7 Merge remote-tracking branch 'origin/test' into test 2025-01-08 22:23:55 +08:00
谭凯凯 18a20f750d 分开绑定支付宝接口和实名认证接口 2025-01-08 22:23:34 +08:00
wangw 60fa47ff69 shiroConfig配置 2025-01-08 22:21:47 +08:00
wangw 2dbf17ba2a 喜欢 收藏 观看记录 排序问题
视频点赞问题
2025-01-08 22:12:44 +08:00
谭凯凯 3a072bf17b 黑名单及用户访问拦截 2025-01-08 21:45:08 +08:00
谭凯凯 40b085aa2d 分开绑定支付宝接口和实名认证接口 2025-01-08 21:38:54 +08:00
谭凯凯 2aa8232480 分开绑定支付宝接口和实名认证接口 2025-01-08 20:48:27 +08:00
谭凯凯 9d09e21090 分开绑定支付宝接口和实名认证接口 2025-01-08 20:47:33 +08:00
Tankaikai e85d5a770b Merge remote-tracking branch 'origin/test' into test 2025-01-08 20:46:53 +08:00
谭凯凯 9bf587dbf0 分开绑定支付宝接口和实名认证接口 2025-01-08 20:46:48 +08:00
GYJ 549cacf0fa Merge remote-tracking branch 'origin/test' into test 2025-01-08 20:03:15 +08:00
GYJ e78abbb6c2 增加单日提现总额限制 2025-01-08 20:03:04 +08:00
Tankaikai c03b171b0a 未登录首页异常 2025-01-08 20:02:23 +08:00
谭凯凯 03df4a740b 未登录首页异常 2025-01-08 20:01:32 +08:00
谭凯凯 bd8b327466 四要素用户身份认证 2025-01-08 19:52:57 +08:00
谭凯凯 df1fba7465 未登录首页异常 2025-01-08 19:46:16 +08:00
谭凯凯 7186e2c989 ES全量同步数据 2025-01-08 19:26:41 +08:00
Tankaikai 4f9eaf9aca Merge remote-tracking branch 'origin/test' into test
# Conflicts:
#	src/main/java/com/sqx/modules/pay/service/impl/CashOutServiceImpl.java
2025-01-08 19:06:17 +08:00
谭凯凯 0dd28536e1 四要素用户身份认证 2025-01-08 19:05:22 +08:00
GYJ 838bfdc5f0 删除 无用操作 2025-01-08 18:15:07 +08:00
GYJ 24f8934541 提现文字描述做区分 2025-01-08 17:03:22 +08:00
wangw ea9c4299e2 更新榴莲记录 优化 2025-01-08 16:22:29 +08:00
GYJ 82ea822ed1 修改 提现回调处理逻辑 2025-01-08 14:53:11 +08:00
谭凯凯 5a79c868b1 提现黑名单用户转入人工审核,并打上标记 2025-01-08 14:38:11 +08:00
谭凯凯 e1a652f496 提现黑名单用户转入人工审核,并打上标记 2025-01-08 14:36:27 +08:00
张松 f71ade8129 提现定时任务增加日志 2025-01-08 11:51:14 +08:00
张松 af60bdfb96 Merge remote-tracking branch 'origin/test' into test 2025-01-08 11:42:49 +08:00
张松 432499d7d5 提现定时任务增加时间记录 2025-01-08 11:42:30 +08:00
wangw 06618d798f 查询剧集 部分查询优化 2025-01-08 11:29:49 +08:00
张松 39bf999b71 Merge remote-tracking branch 'origin/test' into test 2025-01-08 11:10:58 +08:00
张松 7fb1d8c542 Merge branch 'refs/heads/dev' into test
# Conflicts:
#	src/main/java/com/sqx/OneTimeTaskListener.java
2025-01-08 11:10:52 +08:00
张松 de7213e37a 提现定时任务修改 2025-01-08 11:10:32 +08:00
GYJ 9b1e5f5946 针对 iOS 列表页不需要登录 rollback 2025-01-08 11:02:49 +08:00
GYJ b15d615d81 针对 iOS 列表页不需要登录 rollback 2025-01-08 10:48:03 +08:00
GYJ 0ae10135be 针对 iOS 列表页不需要登录 2025-01-08 10:40:15 +08:00
张松 d541c4b173 提现定时任务修改 2025-01-08 10:38:45 +08:00
张松 76303230e0 提现定时任务修改 2025-01-08 10:37:01 +08:00
张松 6b68ad9455 提现定时任务修改 2025-01-08 09:41:49 +08:00
张松 e34dd90fd0 定时任务bug修复 2025-01-08 09:41:48 +08:00
张松 c40b36ab50 定时任务bug修复 2025-01-08 09:41:48 +08:00
张松 69741be97c 提现定时任务修改 2025-01-08 09:41:20 +08:00
张松 e585b10566 定时任务bug修复 2025-01-08 09:23:41 +08:00
张松 3407339f36 Merge remote-tracking branch 'origin/test' into test 2025-01-08 09:21:16 +08:00
张松 ae54a07c53 定时任务bug修复 2025-01-08 09:21:06 +08:00
GYJ f64856308f 单独拆分接口 2025-01-08 09:16:03 +08:00
张松 ce6bdc0aa7 喜欢列表不准确修复 2025-01-07 20:04:20 +08:00
张松 82f29c8ea6 喜欢列表不准确修复 2025-01-07 20:00:06 +08:00
张松 fd00388654 增加黑名单方法 2025-01-07 19:43:52 +08:00
张松 d2f2f900f6 增加黑名单方法 2025-01-07 19:41:00 +08:00
GYJ cdc7629f14 增加从库配置 2025-01-07 19:20:32 +08:00
wangw 053df2c892 提现任务 仅在正式上使用 2025-01-07 19:14:32 +08:00
wangw d1242e8573 Merge remote-tracking branch 'origin/test' into test 2025-01-07 19:12:55 +08:00
wangw cafa150d02 Merge branch 'dev' into test
# Conflicts:
#	src/main/java/com/sqx/modules/taskCenter/controller/TaskCenterController.java
2025-01-07 19:12:27 +08:00
张松 3439ebd4cb Merge remote-tracking branch 'origin/test' into test 2025-01-07 19:11:20 +08:00
张松 da9b74b89b userInfo获取修改 2025-01-07 19:11:12 +08:00
wangw 411337bbd5 任务中心 领取频率恢复正常 2025-01-07 18:59:12 +08:00
Tankaikai 5dcc299ee1 Merge remote-tracking branch 'origin/test' into test 2025-01-07 18:59:08 +08:00
谭凯凯 7725dcb352 提现频率限制3分钟 2025-01-07 18:59:02 +08:00
张松 938b26449f Merge remote-tracking branch 'origin/test' into test 2025-01-07 18:55:33 +08:00
张松 5db2885f73 实名校验黑名单用户 2025-01-07 18:55:24 +08:00
Tankaikai a120d6acb0 Merge remote-tracking branch 'origin/test' into test 2025-01-07 18:37:23 +08:00
谭凯凯 12fa583292 提现频率限制3分钟 2025-01-07 18:37:17 +08:00
张松 2f8a6e1a90 记录异常领取任务用户 2025-01-07 18:26:02 +08:00
张松 71f0f5f5b1 记录异常领取任务用户 2025-01-07 18:24:19 +08:00
张松 7d9e72dac8 记录异常领取任务用户 2025-01-07 18:23:57 +08:00
wangw 26ee94e3b6 任务未开启 领取失败 2025-01-07 18:21:36 +08:00
wangw 9642d0ad2b 任务中心领取防抖 2025-01-07 18:03:42 +08:00
wangw 3ef912482e 任务中心领取防抖 2025-01-07 18:02:12 +08:00
张松 2774a14edd 提现定时任务失败返还余额 2025-01-07 17:56:33 +08:00
谭凯凯 306ac16a77 黑名单及用户访问拦截 2025-01-07 17:50:41 +08:00
wangw 0e71a843cc Merge branch 'test' into dev
# Conflicts:
#	src/main/java/com/sqx/modules/course/service/impl/CourseCollectServiceImpl.java
2025-01-07 17:42:43 +08:00
Tankaikai 7302728129 Merge remote-tracking branch 'origin/test' into test 2025-01-07 17:30:54 +08:00
谭凯凯 4a4a0b2af1 黑名单及用户访问拦截 2025-01-07 17:30:48 +08:00
wangw 00b3f065fb 重复键值问题 2025-01-07 17:24:02 +08:00
Tankaikai a0300d134f Merge remote-tracking branch 'origin/test' into test 2025-01-07 17:14:13 +08:00
谭凯凯 c9e0f347ba 黑名单及用户访问拦截 2025-01-07 17:14:06 +08:00
wangw cc52d4923f 异常打印 2025-01-07 17:13:10 +08:00
wangw 15144a0021 异常打印 2025-01-07 17:04:18 +08:00
wangw a91947ee51 请求剧集 Io异常问题 2025-01-07 16:55:34 +08:00
wangw 3054abbf7c 精度丢失问题 2025-01-07 16:55:32 +08:00
wangw a6c1f90345 查询集数 问题 2025-01-07 16:55:29 +08:00
wangw b5e55b020b 精度丢失问题 2025-01-07 16:55:27 +08:00
wangw b6362b7623 group by问题 2025-01-07 16:55:24 +08:00
wangw 36157f1085 请求剧集 Io异常问题 2025-01-07 16:54:39 +08:00
wangw 0eaa579b98 精度丢失问题 2025-01-07 16:47:55 +08:00
wangw b29d195664 查询集数 问题 2025-01-07 16:38:39 +08:00
wangw bbde7e53f5 精度丢失问题 2025-01-07 16:36:53 +08:00
谭凯凯 243f8ee259 黑名单及用户访问拦截 2025-01-07 16:35:11 +08:00
Tankaikai 2900cbdf6d Merge remote-tracking branch 'origin/test' into test 2025-01-07 16:33:04 +08:00
谭凯凯 8f18dbe953 orders表sys_user_id字段进行填充 2025-01-07 16:32:57 +08:00
wangw a98a249b13 group by问题 2025-01-07 16:29:48 +08:00
wangw b8614728b9 Merge branch 'test' into dev
# Conflicts:
#	src/main/java/com/sqx/modules/course/service/impl/CourseCollectServiceImpl.java
2025-01-07 16:25:32 +08:00
wangw 61301104b1 观看记录问题 2025-01-07 16:23:52 +08:00
wangw b4c7ee22db 剧的id 精度丢失问题 2025-01-07 16:20:07 +08:00
wangw 576ff58d63 group by问题 和 剧集为空的问题 2025-01-07 16:12:53 +08:00
wangw 766e310d8d group by问题 和 剧集为空的问题 2025-01-07 16:12:11 +08:00
张松 9a85ff85c6 定时任务增加状态判断 2025-01-07 16:11:56 +08:00
Tankaikai 026d98022a Merge remote-tracking branch 'origin/test' into test 2025-01-07 16:04:30 +08:00
谭凯凯 43c852ca54 orders表sys_user_id字段进行填充 2025-01-07 16:04:24 +08:00
张松 af691b1d08 1.提现没有时间修复 2025-01-07 16:03:05 +08:00
wangw 67fe587233 剧集bug 2025-01-07 15:58:51 +08:00
张松 b8f7dbcc60 1.提现没有时间修复 2025-01-07 15:58:18 +08:00
Tankaikai a5106297e0 Merge remote-tracking branch 'origin/test' into test 2025-01-07 15:51:55 +08:00
谭凯凯 989783a9f8 orders表sys_user_id字段进行填充 2025-01-07 15:51:47 +08:00
wangw 5e93eb23dc Merge branch 'test' into dev 2025-01-07 15:47:23 +08:00
wangw 51214845f9 首页登录问题 2025-01-07 15:30:31 +08:00
Tankaikai f45f5e5615 Merge remote-tracking branch 'origin/test' into test 2025-01-07 15:28:41 +08:00
谭凯凯 b237d3125e orders表sys_user_id字段进行填充 2025-01-07 15:28:35 +08:00
张松 e55866f7ac 1.cashOut定时任务修改 2025-01-07 15:28:19 +08:00
wangw 16d7b9db0a 喜欢列表 和 收藏列表
总集数
2025-01-07 14:18:07 +08:00
张松 8cc5975fc3 1.排行榜修改 2025-01-07 14:15:41 +08:00
张松 cb8ee06087 Merge remote-tracking branch 'origin/test' into test 2025-01-07 13:49:36 +08:00
张松 0f9d710607 1.排行榜修改 2025-01-07 13:49:27 +08:00
Tankaikai e530955959 Merge remote-tracking branch 'origin/test' into test 2025-01-07 13:34:39 +08:00
谭凯凯 1ed411578f 黑名单及用户访问拦截 2025-01-07 13:34:33 +08:00
张松 cf232586dc 1.修改实名认证rediskey 2025-01-07 13:23:29 +08:00
张松 cd0763ccab Merge remote-tracking branch 'origin/test' into test 2025-01-07 13:20:21 +08:00
张松 a490541ccb 1.排行榜查询数据不准确修复 2025-01-07 13:20:00 +08:00
Tankaikai 6832745f99 Merge remote-tracking branch 'origin/test' into test 2025-01-07 13:19:23 +08:00
谭凯凯 f234fc84da 支付宝黑名单及用户访问拦截 2025-01-07 13:18:17 +08:00
wangw 52f6016e39 充值记录 2025-01-07 13:17:15 +08:00
Tankaikai 0084d6be0f Merge remote-tracking branch 'origin/test' into test 2025-01-07 13:15:29 +08:00
谭凯凯 cba8d75943 支付宝黑名单及用户访问拦截 2025-01-07 13:15:22 +08:00
GYJ 5acbec182b 修改实名认证校验 2025-01-07 12:44:53 +08:00
张松 0711e21f2f 1.实名修改 2025-01-07 11:20:00 +08:00
张松 bf3621a9ff Merge remote-tracking branch 'origin/test' into test 2025-01-07 11:06:43 +08:00
张松 fa6603212a 1.实名次数限制 2025-01-07 11:06:32 +08:00
wangw 89a1e0c4e8 代理商提现记录 2025-01-07 10:47:11 +08:00
张松 5624342d71 Merge remote-tracking branch 'origin/test' into test 2025-01-07 10:45:19 +08:00
张松 8888b0b731 1.取消记录用户url 2025-01-07 10:45:07 +08:00
wangw 7811a9b4af 正式环境执行 2025-01-07 10:34:01 +08:00
GYJ 4eee0b5b0a Merge branch 'test' into dev 2025-01-07 10:31:11 +08:00
GYJ 61c465a904 Merge branch 'test' into dev 2025-01-07 10:24:40 +08:00
wangw c5d25a879a 精度丢失问题 2025-01-07 10:23:49 +08:00
Tankaikai 490c7b694c Merge remote-tracking branch 'origin/test' into test 2025-01-07 10:08:34 +08:00
谭凯凯 6d12251b39 空指针异常 2025-01-07 10:08:24 +08:00
张松 fcc3b84d06 1.实名修改 2025-01-07 10:06:01 +08:00
张松 c275b1a912 1.实名修改 2025-01-07 10:02:42 +08:00
GYJ ae6394b3df Merge branch 'test' into dev 2025-01-07 10:01:14 +08:00
wangw 5f05f55579 推广人员达标 奖励0的问题 2025-01-07 09:52:07 +08:00
wangw 2734f1f169 任务中心 2025-01-07 09:29:55 +08:00
GYJ 48300f1dac 提现 bug 修复 2025-01-07 09:05:52 +08:00
wangw 696ee71b8a 分销账号 提现 2025-01-06 22:40:40 +08:00
wangw fece3d1843 收藏中心 多少集 2025-01-06 22:36:39 +08:00
谭凯凯 f98891b616 解决空指针bug 2025-01-06 22:00:18 +08:00
GYJ 1ff5ee72ea Merge branch 'test' into dev 2025-01-06 21:38:57 +08:00
张松 59dd29f226 Merge remote-tracking branch 'origin/test' into test 2025-01-06 21:20:55 +08:00
张松 d6e64ae2fc 1.提现记录不展示修复 2025-01-06 21:20:44 +08:00
wangw 8f48ea47a9 订单中心报错 2025-01-06 20:50:07 +08:00
wangw 0093701f80 月为单位 查用户 2025-01-06 20:34:59 +08:00
wangw f13daaf01e 月为单位 查用户 2025-01-06 20:34:59 +08:00
GYJ 9cdecb8172 Merge branch 'test' into dev 2025-01-06 19:53:11 +08:00
张松 d4183436e6 1.邀请排行榜没有收益修复 2025-01-06 19:52:33 +08:00
张松 3f8fd5b086 1.代理可以查看到其他用户提现记录修复 2025-01-06 19:42:49 +08:00
wangw 845fbf8319 下单报错 2025-01-06 19:33:03 +08:00
张松 652dacdf03 1.财务中心和数据中心收入明细不匹配修复 2025-01-06 19:27:59 +08:00
张松 fb34403e34 Merge remote-tracking branch 'origin/test' into test 2025-01-06 19:27:26 +08:00
张松 589fba42b9 1.财务中心和数据中心收入明细不匹配修复 2025-01-06 19:27:18 +08:00
wangw 8b0699ce73 点赞问题 2025-01-06 19:22:30 +08:00
wangw 7af9079e11 分页 严格模式 2025-01-06 19:17:01 +08:00
张松 73bd738c8b 1.体现审核列表用户信息不展示修复 2025-01-06 19:01:31 +08:00
GYJ 9f32c0580b sharding key 报错 CashOut 2025-01-06 18:40:56 +08:00
wangw 7333eaf163 代理商户 钱包明细 2025-01-06 18:39:59 +08:00
wangw 9b3de4624a 缓存优化 2025-01-06 18:10:36 +08:00
张松 cbb2d5f77a 1.一次性任务取消 2025-01-06 18:09:17 +08:00
张松 243870166b Merge remote-tracking branch 'origin/test' into test 2025-01-06 18:09:00 +08:00
wangw 707d6fdae0 整部剧的价 2025-01-06 18:05:55 +08:00
GYJ c092573222 Merge branch 'test' into dev 2025-01-06 17:55:15 +08:00
wangw 9028b3ee46 短剧收藏 处理 2025-01-06 17:47:29 +08:00
wangw 63fca8e8df sharding string 和 long 处理 2025-01-06 17:46:55 +08:00
GYJ e61e3bb520 sharding key 报错 2025-01-06 17:23:26 +08:00
张松 18a5eae1ae Merge remote-tracking branch 'origin/test' into test 2025-01-06 17:11:08 +08:00
张松 eaf928ef9c 1.支付回调报错导致奖励领取失败修复 2025-01-06 17:10:58 +08:00
wangw 6e9bf929c1 收藏 2025-01-06 16:57:10 +08:00
张松 81715401d0 Merge remote-tracking branch 'origin/dev' into dev 2025-01-06 16:51:06 +08:00
张松 21ae4d0c58 1.一次性任务增加 2025-01-06 16:50:59 +08:00
张松 a2e585e25f 1.一次性任务增加 2025-01-06 16:50:52 +08:00
GYJ e02879c04a Merge branch 'test' into dev 2025-01-06 16:38:28 +08:00
GYJ 5533e85ab7 Merge remote-tracking branch 'origin/test' into test 2025-01-06 16:37:59 +08:00
GYJ d4b2a35591 bug fix2 2025-01-06 16:37:50 +08:00
GYJ f3357014fd Merge branch 'test' into dev 2025-01-06 16:31:19 +08:00
wangw d000da2210 防抖 2025-01-06 16:30:45 +08:00
GYJ 1fdda30ed0 bug fix 2025-01-06 16:29:38 +08:00
张松 066aee89bc 1.一次性任务增加 2025-01-06 16:28:54 +08:00
wangw 859a62330b 移除 代理 关于钱的操作 2025-01-06 16:26:53 +08:00
wangw a16e632e98 观影记录 开始结束 全集 2025-01-06 16:24:46 +08:00
谭凯凯 1d5899cf46 集成ES 2025-01-06 16:04:07 +08:00
张松 c29aca69a1 1.回调事务记录邀请金额导致真实奖励被覆盖问题修复 2025-01-06 16:01:53 +08:00
张松 501757a51a 1.回调事务记录邀请金额导致真实奖励被覆盖问题修复 2025-01-06 16:01:52 +08:00
张松 156784f20b 1.回调事务记录邀请金额导致真实奖励被覆盖问题修复 2025-01-06 16:00:46 +08:00
张松 0af9d06de6 1.回调事务记录邀请金额导致真实奖励被覆盖问题修复 2025-01-06 16:00:35 +08:00
wangw 9d8a057620 收藏 点赞 观看记录 2025-01-06 15:47:23 +08:00
谭凯凯 42cd464a33 生成订单报错 2025-01-06 15:22:53 +08:00
Tankaikai bff6bbb8f3 Merge remote-tracking branch 'origin/test' into test 2025-01-06 14:59:08 +08:00
谭凯凯 8ca771ff6e 解决高并发下交易号重复生成的bug 2025-01-06 14:59:02 +08:00
张松 7566e41c7a 1.提现记录根据时间降序 2025-01-06 14:55:55 +08:00
GYJ b9c18358ee Merge remote-tracking branch 'origin/test' into test 2025-01-06 14:52:41 +08:00
GYJ f2d275055b 订单查询回调优化 2025-01-06 14:51:46 +08:00
张松 cdb007c4b5 Merge remote-tracking branch 'origin/test' into test 2025-01-06 14:40:44 +08:00
张松 03694d4886 1.用户信息姓名展示异常修复 2025-01-06 14:40:35 +08:00
wangw 07aa1e07cf 剧集列表 是否收藏 2025-01-06 14:36:40 +08:00
wangw 5d291816d6 系统用户钱包 拆分 2025-01-06 14:33:34 +08:00
wangw 0e512bfc69 系统用户钱包 拆分 2025-01-06 14:32:42 +08:00
张松 33b350e7b6 1.手机端提现列表增加类型限制查询 2025-01-06 14:12:19 +08:00
张松 c8d734a802 1.发卡列表报错修复 直接返回空 2025-01-06 13:36:53 +08:00
张松 14cfa8f522 Merge remote-tracking branch 'origin/test' into test 2025-01-06 13:25:37 +08:00
张松 737fcdc841 1.体现报错修复 2025-01-06 13:25:28 +08:00
GYJ e3bc9ad1a7 Merge remote-tracking branch 'origin/test' into test 2025-01-06 13:25:13 +08:00
GYJ 83922a1c11 修改配置文件 2025-01-06 13:25:00 +08:00
张松 c03ace8658 1.提现列表倒序 2025-01-06 13:05:08 +08:00
wangw b850045f72 日志打印 2025-01-06 11:48:25 +08:00
张松 59b978fdb0 Merge remote-tracking branch 'origin/test' into test 2025-01-06 11:47:18 +08:00
张松 5f8f2c5f87 Merge branch 'refs/heads/dev' into test 2025-01-06 11:47:12 +08:00
张松 f6fc55bf25 1.实名接口修改
2.用户余额更新bug修复
2025-01-06 11:46:52 +08:00
wangw 93784e9a77 按日期目录 压缩 2025-01-06 11:38:33 +08:00
张松 6639e37fd4 实名认证接口修改 2025-01-06 11:28:56 +08:00
张松 779fcb8c63 Merge remote-tracking branch 'origin/test' into test 2025-01-06 11:25:13 +08:00
张松 81386e2f7d 提现修改 2025-01-06 11:24:59 +08:00
wangw 58be937d06 当前集 提出 2025-01-06 11:03:39 +08:00
wangw 24b94a8ec7 订单统计 Bug3 2025-01-06 10:48:00 +08:00
wangw d43e03d149 订单统计 Bug2 2025-01-06 10:26:16 +08:00
wangw c407f21a0b 订单统计 Bug 2025-01-06 10:17:00 +08:00
张松 f45341c550 用户列表报错修复 2025-01-06 10:15:29 +08:00
Tankaikai f9e32bff7b Merge remote-tracking branch 'origin/test' into test 2025-01-06 10:08:38 +08:00
谭凯凯 98182fec9d 分库的表主键改为雪花id 2025-01-06 10:08:32 +08:00
wangw 400fce2c41 用户列表 报错 2025-01-06 10:03:45 +08:00
谭凯凯 c74d319fba 集成ES 2025-01-06 09:57:10 +08:00
wangw ec789a8df1 查询 集数 重写 2025-01-06 09:52:55 +08:00
GYJ f2114650db Merge branch 'test' into dev 2025-01-05 17:13:30 +08:00
GYJ 5828199ba0 回调订单查询优化 2025-01-05 17:12:58 +08:00
GYJ 79bc357bb1 处理三方订单回调 异常 bug 2025-01-05 17:02:26 +08:00
GYJ 06bae8fd95 Merge branch 'test' into dev 2025-01-05 16:58:22 +08:00
GYJ 7798c1ae10 自己生成订单号 2025-01-05 16:57:33 +08:00
GYJ 4fc6bd5357 Merge branch 'test' into dev 2025-01-05 16:30:50 +08:00
GYJ 8884d84186 改订单id 为 uuid,避免重复 2025-01-05 16:30:19 +08:00
GYJ 65b20b344d Merge branch 'test' into dev 2025-01-05 09:49:36 +08:00
GYJ 1bf1897f00 updateById 报错 2025-01-05 09:49:13 +08:00
GYJ b00fce8e75 Merge branch 'test' into dev 2025-01-05 09:27:04 +08:00
GYJ db5eba1282 正式环境配置文件1 2025-01-05 09:25:57 +08:00
GYJ 05516d9db6 Merge branch 'test' into dev 2025-01-04 22:02:32 +08:00
GYJ 8eab8bb1e2 正式环境配置文件 2025-01-04 21:44:44 +08:00
张松 d57fc833f2 增加sys_user_money_detail分片配置 2025-01-04 19:24:08 +08:00
张松 5d9fe65e9b 代理user_money_detail更换表 2025-01-04 19:20:32 +08:00
张松 cc978f44e8 Merge remote-tracking branch 'origin/test' into test 2025-01-04 18:33:00 +08:00
张松 1646af8c76 user_money数据同步测试代码 2025-01-04 18:32:49 +08:00
wangw 74edf421d4 Amazon 亚马逊 注释 2025-01-04 18:15:28 +08:00
wangw 464f4ba7c8 视频 查看集 和 集数列表 拆分2
配置日志
2025-01-04 17:50:11 +08:00
张松 a2fdd2c4fd sql报错修复 2025-01-04 17:13:58 +08:00
张松 d367fd178e 修改邀请信息接口 2025-01-04 16:44:26 +08:00
张松 9f3116bc9d Merge remote-tracking branch 'origin/test' into test 2025-01-04 16:35:55 +08:00
张松 8213c9b069 修改邀请信息接口 2025-01-04 16:35:45 +08:00
GYJ aa9502fdb6 bug fix 2025-01-04 16:10:10 +08:00
张松 af4852a223 修改邀请信息接口 2025-01-04 15:25:32 +08:00
张松 c8bf57c7ff Merge remote-tracking branch 'origin/test' into test 2025-01-04 15:17:35 +08:00
张松 2c5228b2eb 修改邀请信息接口 2025-01-04 15:17:27 +08:00
GYJ 8c3999219b 邀请列表 2025-01-04 14:38:50 +08:00
GYJ 02e33e7802 恢复代码 2025-01-04 14:10:27 +08:00
GYJ 1f37a8e709 修改 invite 统计 逻辑 2025-01-04 14:01:15 +08:00
wangw 4499d636d0 视频 查看集 和 集数列表 拆分2 2025-01-04 13:52:38 +08:00
wangw 1096c17345 视频 查看集 和 集数列表 拆分 2025-01-04 13:50:32 +08:00
张松 362e99c8c9 体现记录接口修改 2025-01-04 13:39:56 +08:00
GYJ acb3e97e5a 短剧收藏问题 2025-01-04 13:32:45 +08:00
谭凯凯 f58e07efdc CommonInfo APP配置查询接口 2025-01-04 10:41:38 +08:00
张松 af28b7266f 添加收藏信息统计接口 2025-01-04 10:05:43 +08:00
张松 c20133b410 添加收藏信息统计接口 2025-01-04 09:58:21 +08:00
张松 0539899129 剧集数量展示不正确修复 2025-01-04 09:32:20 +08:00
张松 a5a206ae8a 查询逻辑修改 2025-01-03 22:23:50 +08:00
张松 2ea74b96b7 查询逻辑修改 2025-01-03 22:21:37 +08:00
张松 5aeee2da3a 查询逻辑修改 2025-01-03 22:19:53 +08:00
张松 3841c95b56 查询逻辑修改 2025-01-03 21:58:30 +08:00
张松 d5553dd438 Merge remote-tracking branch 'origin/test' into test 2025-01-03 21:52:14 +08:00
张松 08949e4778 查询逻辑修改 2025-01-03 21:52:06 +08:00
谭凯凯 6ed279aa34 生成订单号换成雪花id 2025-01-03 21:51:48 +08:00
wangw 9d26091e55 id 自增 取消 2025-01-03 21:47:21 +08:00
张松 8b46967c53 查询逻辑修改 2025-01-03 21:46:51 +08:00
张松 11f5697b8b sql查询修改 2025-01-03 21:10:56 +08:00
张松 9f2f15b093 Merge remote-tracking branch 'origin/test' into test 2025-01-03 21:04:07 +08:00
张松 63d27895bd 返回结构修改 2025-01-03 21:03:57 +08:00
GYJ 404e7b663b 返回数据 2025-01-03 21:00:47 +08:00
wangw 4ab8f837d5 long类型 映射 2025-01-03 20:59:40 +08:00
wangw 8140b01fd2 sharding分片规则修改 2025-01-03 20:58:43 +08:00
张松 f5d00b189c 返回结构修改 2025-01-03 20:37:10 +08:00
wangw 98bfe34cbb 随机排序 2025-01-03 19:32:26 +08:00
wangw 1daec89b20 随机 2025-01-03 19:23:43 +08:00
wangw c6e45134d0 抽奖次数 2025-01-03 19:11:18 +08:00
张松 886392e878 Merge remote-tracking branch 'origin/test' into test 2025-01-03 19:11:05 +08:00
张松 0d23c99794 收藏记录查询不正确修复 2025-01-03 19:10:56 +08:00
GYJ 0aa85e1788 user_id 的问题 2025-01-03 19:10:26 +08:00
wangw c5f1456046 分页 关联查询 等 2025-01-03 18:13:56 +08:00
张松 4f6079dbb5 sql报错修复 2025-01-03 17:17:47 +08:00
GYJ 37742faa8c courseId string to long 2025-01-03 17:11:49 +08:00
张松 05a48ad986 根据配置项判断是否启用看广告体现 2025-01-03 16:48:58 +08:00
张松 3984027965 sql修改 2025-01-03 16:46:06 +08:00
张松 ca93eb959e 修改实名信息,错误不保存数据 2025-01-03 15:56:52 +08:00
张松 3349d84864 修改实名信息,错误不保存数据 2025-01-03 15:55:09 +08:00
张松 417d25795a Merge remote-tracking branch 'origin/test' into test 2025-01-03 15:52:06 +08:00
张松 108267818d 修改实名信息,仅不同修改数据 2025-01-03 15:51:15 +08:00
GYJ 020fb85a08 报错修改 2025-01-03 15:49:25 +08:00
张松 3fd322b355 分片键修改不更新 2025-01-03 15:21:06 +08:00
wangw c49a165dd9 移除广播表
短剧首页 关联查询修改
2025-01-03 11:30:43 +08:00
张松 3ef249a5d4 Merge remote-tracking branch 'origin/test' into test 2025-01-03 10:23:51 +08:00
张松 6ab171aa28 提现必须观看广告激励 2025-01-03 10:23:42 +08:00
wangw bb42b219d4 page 问题 sharding配置 2025-01-03 10:23:25 +08:00
wangw c07e7f48eb 雪花算法 YES/NO 2025-01-02 22:42:28 +08:00
wangw 8e07f8e7fd 配置文件 2025-01-02 22:09:52 +08:00
GYJ c9b9bb1a58 合并 代码 2025-01-02 21:52:39 +08:00
GYJ ea2e8a5d2b Merge branch 'sharding-分库' into test
# Conflicts:
#	src/main/java/com/sqx/modules/course/service/impl/CourseServiceImpl.java
#	src/main/java/com/sqx/modules/pay/dao/CashOutDao.java
#	src/main/java/com/sqx/modules/pay/service/impl/CashOutServiceImpl.java
#	src/main/resources/mapper/course/CourseCollectDao.xml
2025-01-02 21:48:53 +08:00
GYJ b9c4c25537 分页44 2025-01-02 21:12:22 +08:00
wangw 2025b4c397 分页2 2025-01-02 20:59:32 +08:00
GYJ e8a986e476 分页33 2025-01-02 20:56:19 +08:00
张松 71ff32998e 增加剧集周支付次数 2025-01-02 20:51:21 +08:00
GYJ d56a5df40e 分页22 2025-01-02 20:45:51 +08:00
wangw e3de8c009f 剧集报错sql 2025-01-02 20:08:17 +08:00
张松 eac53e57b0 selectPayDetails app sql查询缩小查询范围 2025-01-02 19:51:24 +08:00
GYJ 96aebfdd8b 分页 2025-01-02 19:49:10 +08:00
wangw f5626621f0 分页2 2025-01-02 19:42:30 +08:00
GYJ 297c94110b ParamPageUtils 2025-01-02 19:30:09 +08:00
wangw 2f2bae4aca 分页 2025-01-02 18:54:38 +08:00
张松 5e4aaf78ce 增加周播放量 2025-01-02 18:04:23 +08:00
wangw f4998e1073 shardingConfig2 2025-01-02 17:40:54 +08:00
张松 732ee1df4b 长sql优化 2025-01-02 17:30:10 +08:00
张松 5fa6fc2d8e 长sql优化 2025-01-02 17:24:41 +08:00
张松 eabc144eb4 长sql优化 2025-01-02 17:03:24 +08:00
张松 9a785ae37f 返回身份证信息 2025-01-02 16:46:14 +08:00
张松 bdc050ea1e 长sql优化 2025-01-02 16:36:12 +08:00
张松 cf2f17acc1 公告修改 2025-01-02 15:58:07 +08:00
张松 758c1aabbb 1.实名接口修改 2025-01-02 15:48:19 +08:00
张松 a9d195ed96 1.公告接口增删改查实现 2025-01-02 15:35:59 +08:00
张松 9af991348f 1.实名认证接口修改 2025-01-02 15:35:39 +08:00
张松 e97c0dc581 1.增加未实名状态码 2025-01-02 14:34:34 +08:00
张松 2accd47a9c 1.增加账号实名认证接口
2.去除自动提现
2025-01-02 14:27:33 +08:00
张松 a1ba6d9e76 Merge remote-tracking branch 'origin/test' into test 2025-01-02 14:10:05 +08:00
张松 6e4942e18a 1.增加账号实名认证接口
2.去除自动提现
2025-01-02 14:09:55 +08:00
谭凯凯 94b1cb20ca 提现人工审核,不受配置开关限制 2025-01-02 13:17:43 +08:00
wangw 4157bac93f 分4库 配置文件
prod 分库 其它环境不分库
2025-01-02 13:14:06 +08:00
谭凯凯 c73c00dd27 提现人工审核,不受配置开关限制 2025-01-02 12:51:05 +08:00
wangw b4c9687f4c 查询订单数量 优化 2025-01-02 11:23:59 +08:00
GYJ 179a9e361d 只是用一个从库 2025-01-02 10:46:17 +08:00
张松 f7a63cdea7 Merge remote-tracking branch 'origin/test' into test 2025-01-02 10:45:01 +08:00
张松 51e3639065 用户收藏sql优化,接口增加缓存 2025-01-02 10:44:39 +08:00
wangw 003db71b7c 配置文件修改
表映射配置 放在application.yml
2025-01-02 10:00:21 +08:00
GYJ 78bf1c8c01 删除定时更新 user vip 2025-01-02 09:59:14 +08:00
GYJ 65dce032fe 配置多个从库 2025-01-02 00:10:31 +08:00
GYJ 9624a3350d Merge branch 'test' into dev 2025-01-01 19:47:55 +08:00
GYJ ab24effd0f 修复验证码问题 2025-01-01 19:42:07 +08:00
wangw dcaf258e9a 空指针 2024-12-31 17:44:36 +08:00
wangw f3284c11f6 日志 2024-12-31 17:32:17 +08:00
张松 bce5111fed Merge branch 'refs/heads/test' into dev
# Conflicts:
#	src/main/java/com/sqx/modules/job/task/TempOrdersTask.java
#	src/main/java/com/sqx/modules/pay/wuyou/BaseResp.java
2024-12-31 17:17:32 +08:00
张松 fb00873494 订单状态同步定时任务修改 2024-12-31 17:14:14 +08:00
wangw 5419dd4102 万能验证码 61626364 2024-12-31 17:08:45 +08:00
张松 77cfa1af49 Merge remote-tracking branch 'origin/dev' into dev 2024-12-31 16:51:07 +08:00
张松 dab8c3cb26 增加定时任务日志 2024-12-31 16:50:59 +08:00
Tankaikai 808d781e8e Merge remote-tracking branch 'origin/test' into dev 2024-12-31 16:34:51 +08:00
张松 9f7cff7431 订单状态同步定时任务修改 2024-12-31 16:31:55 +08:00
Tankaikai fd0c4f5c5e Merge remote-tracking branch 'origin/test' into test 2024-12-31 16:29:53 +08:00
谭凯凯 f5e4e153e2 提现审核列表金额格式化bug 2024-12-31 16:29:48 +08:00
张松 55946abbcb Merge branch 'refs/heads/test' into dev 2024-12-31 15:50:55 +08:00
张松 8052af5f6a Merge branch 'refs/heads/test' into dev 2024-12-31 15:50:00 +08:00
GYJ 48f605ecb1 Merge remote-tracking branch 'origin/test' into test 2024-12-31 15:49:57 +08:00
张松 9160bf0a56 支付回调查询多条报错处理 2024-12-31 15:49:48 +08:00
GYJ f74e29c09f UserIntegral 异常处理 2024-12-31 15:49:48 +08:00
张松 c19cdd95a9 循环依赖解决 2024-12-31 15:06:13 +08:00
张松 de590aa30d 循环依赖解决 2024-12-31 15:06:12 +08:00
张松 ab8087e03d 循环依赖解决 2024-12-31 15:05:29 +08:00
张松 5aacd548c9 循环依赖解决 2024-12-31 15:05:20 +08:00
张松 5f7ee1fd8e Merge branch 'refs/heads/test' into dev 2024-12-31 14:58:34 +08:00
wangw eb3467ad5a 支付成功 无效问题 2024-12-31 14:32:52 +08:00
张松 282b772430 增加调试日志 2024-12-31 14:19:15 +08:00
wangw 65769b71d1 测试环境 万能验证码 147258 2024-12-31 11:44:37 +08:00
wangw 957682ef41 支付与提现 开关 2024-12-31 11:34:00 +08:00
张松 70d66864a3 签到人数接口修改 2024-12-31 11:29:21 +08:00
wangw 40c7bce626 达标奖励
抽奖补偿
2024-12-31 11:20:49 +08:00
张松 084828cd5b Merge branch 'refs/heads/test' into dev 2024-12-31 10:30:54 +08:00
张松 a6949a92a0 达标奖励修改 2024-12-31 10:28:59 +08:00
张松 0908d114a2 达标查询统一更换 2024-12-31 10:14:15 +08:00
张松 52a692ebd9 selectByUserId报错修复 2024-12-31 00:09:53 +08:00
张松 c7242e9ab0 Merge remote-tracking branch 'origin/test' into test 2024-12-30 23:55:30 +08:00
张松 9e74c5656e key设置错误修复 2024-12-30 23:55:21 +08:00
wangw a02d2eb157 Merge branch 'test' into dev 2024-12-30 23:52:45 +08:00
wangw 328298971c 支付宝次数问题 2024-12-30 23:52:03 +08:00
wangw 409365b9db 正式 shardingsphere 2024-12-30 23:46:03 +08:00
wangw f5b2f827d1 积分问题
banner问题
2024-12-30 23:45:45 +08:00
wangw 6671fadc40 积分问题
banner问题
2024-12-30 23:43:41 +08:00
张松 5f3e76fb5c sql报错修复 2024-12-30 23:31:56 +08:00
wangw 1123b518db 正式 shardingsphere 2024-12-30 23:07:28 +08:00
wangw 7e89bb182b Merge branch 'test' into dev
# Conflicts:
#	src/main/java/com/sqx/modules/pay/controller/app/WuyouController.java
2024-12-30 23:00:16 +08:00
张松 7f169ee677 增加pay配置文件 2024-12-30 22:58:26 +08:00
wangw 4c4c469db2 三方订单号 2024-12-30 22:54:42 +08:00
wangw cc18a05b45 三方订单号 2024-12-30 22:51:09 +08:00
张松 380648395c fix: 达标保存修改 2024-12-30 22:47:15 +08:00
wangw b123a059ce 日志打印 2024-12-30 22:05:13 +08:00
wangw a374f41847 关闭支付 2024-12-30 21:51:32 +08:00
Tankaikai e4ae8beb77 Merge remote-tracking branch 'origin/test' into test 2024-12-30 21:49:29 +08:00
谭凯凯 7cb257317c 首页查询优化 2024-12-30 21:49:23 +08:00
wangw 09a0cf09e4 根据id查询短剧详情 2024-12-30 21:43:05 +08:00
wangw 0aed96e92e 日志打印 2024-12-30 21:29:20 +08:00
wangw 435421be0a 子查询 以及 扫描路径 2024-12-30 21:21:49 +08:00
张松 d496efb196 fix: 拦截器增加异步 2024-12-30 21:17:56 +08:00
张松 649f8f0c3f refactor: 更改子查询为join 2024-12-30 21:04:18 +08:00
张松 ddb1c196b3 Merge remote-tracking branch 'origin/test' into test 2024-12-30 20:58:14 +08:00
张松 51e1db2bc4 refactor: 更改子查询为join 2024-12-30 20:58:05 +08:00
Tankaikai a22229b3df Merge remote-tracking branch 'origin/test' into test
# Conflicts:
#	src/main/resources/mapper/course/CourseDao.xml
2024-12-30 20:24:52 +08:00
谭凯凯 e5af376cae 分库不支持子查询修改为关联查询 2024-12-30 20:22:49 +08:00
张松 c4852d5e7e refactor: 更改子查询为join 2024-12-30 20:15:43 +08:00
张松 940f41930f refactor: 更改子查询为join 2024-12-30 20:08:39 +08:00
张松 6828c78114 Merge remote-tracking branch 'origin/test' into test
# Conflicts:
#	src/main/resources/mapper/course/CourseDao.xml
2024-12-30 20:06:15 +08:00
张松 e2ae91bcd6 refactor: 更改子查询为join 2024-12-30 20:05:04 +08:00
GYJ 808a5f9ce6 Merge remote-tracking branch 'origin/test' into test 2024-12-30 19:21:28 +08:00
GYJ 4355b9f292 sql 报错 2 2024-12-30 19:21:19 +08:00
wangw 52efab0331 意见反馈 2024-12-30 19:12:15 +08:00
wangw 315a341e41 提现次数/金额 2024-12-30 19:08:39 +08:00
谭凯凯 6f1e9e34df 修复无法返回videoUrl的bug 2024-12-30 19:02:01 +08:00
谭凯凯 0223eccd04 首页查询优化 2024-12-30 18:45:50 +08:00
Tankaikai dd59c4577e Merge remote-tracking branch 'origin/test' into test 2024-12-30 18:30:45 +08:00
谭凯凯 291b8e2646 修复无法返回videoUrl的bug 2024-12-30 18:30:39 +08:00
张松 379a6f81e0 Merge remote-tracking branch 'origin/test' into test 2024-12-30 18:28:25 +08:00
张松 99dba02361 feat: 定时任务调用修改 2024-12-30 18:28:17 +08:00
wangw f154973d2d 日期问题 2024-12-30 18:26:40 +08:00
wangw d3241cf504 日志打印 2024-12-30 18:26:10 +08:00
张松 91a1154383 feat: 定时任务调用修改 2024-12-30 18:23:21 +08:00
GYJ 5e06231aaa sql 报错 2024-12-30 18:16:59 +08:00
GYJ 7498922675 查询日期补全方法 2024-12-30 17:55:09 +08:00
张松 e0e53bfd9a feat: 增加根据beanName及方法调用接口 2024-12-30 17:48:28 +08:00
谭凯凯 c677d75feb 首页查询优化 2024-12-30 17:23:27 +08:00
谭凯凯 f8df78b065 首页查询优化 2024-12-30 17:16:08 +08:00
Tankaikai afcb0abc6a Merge remote-tracking branch 'origin/test' into test 2024-12-30 16:47:29 +08:00
谭凯凯 b45006d2f7 首页查询优化 2024-12-30 16:47:23 +08:00
张松 2fc1f1e61c Merge remote-tracking branch 'origin/test' into test 2024-12-30 16:44:35 +08:00
张松 4c1310c089 feat: InviteAchievementMapper字段調整 2024-12-30 16:44:24 +08:00
wangw 769e476b23 请求日志 异步打印 2024-12-30 16:42:32 +08:00
wangw b2eb085472 dev 配置文件 2024-12-30 16:40:14 +08:00
wangw adf0b74627 Merge remote-tracking branch 'origin/test' into test 2024-12-30 16:32:57 +08:00
张松 d475f34a0a Merge remote-tracking branch 'origin/test' into test 2024-12-30 16:31:27 +08:00
张松 95f4a1aab0 feat: 达标奖励查询方式修改 2024-12-30 16:31:11 +08:00
wangw 9bb24f0aba Merge branch 'sharding' into test
# Conflicts:
#	src/main/java/com/sqx/SqxApplication.java
#	src/main/java/com/sqx/modules/common/controller/app/AppCommonController.java
#	src/main/resources/mapper/course/CourseDao.xml
2024-12-30 16:30:04 +08:00
wangw 257bc9e760 云购os移除 2024-12-30 16:23:51 +08:00
谭凯凯 f8e4fbf057 首页查询优化 2024-12-30 16:21:33 +08:00
wangw 41eabc21b5 资源页报错 2024-12-30 16:17:12 +08:00
wangw 8ca14e05a1 定时任务处理 2024-12-30 15:32:56 +08:00
张松 84a93810c5 feat: 达标奖励查询方式增加状态限定 2024-12-30 14:43:00 +08:00
张松 b6c8a07486 feat: 达标奖励查询方式修改 2024-12-30 14:19:53 +08:00
张松 bd6499727e feat: 达标奖励查询方式修改 2024-12-30 14:18:04 +08:00
wangw eca308e06f ShardingConfig 2024-12-30 14:02:26 +08:00
张松 3481ae235b Merge remote-tracking branch 'origin/test' into test 2024-12-30 13:15:07 +08:00
张松 b8c0b8b2d9 feat: 封禁用户状态仅更改一次 2024-12-30 13:14:59 +08:00
GYJ bbb761561a 修改 WuyouPay 为 service 2024-12-30 13:12:59 +08:00
张松 6c02934e08 feat: 增加ip跳动检测 2024-12-30 12:50:06 +08:00
张松 46f1bde62e Merge remote-tracking branch 'origin/test' into test 2024-12-30 11:15:55 +08:00
张松 3386e1f6a4 feat: 增加ip跳动检测 2024-12-30 11:15:32 +08:00
GYJ ea7d51450e 处理浏览历史,保留一条记录 2024-12-30 10:55:04 +08:00
GYJ b5e8d2514b admin 不给分享奖励 2024-12-30 10:17:44 +08:00
GYJ fde0d80a16 bug fix 2024-12-28 19:19:52 +08:00
GYJ acccb9b7df 添加日志 2024-12-28 19:15:04 +08:00
GYJ 71baadec22 bug fix 2024-12-28 19:10:44 +08:00
GYJ 3a9653418f bug fix 2024-12-28 18:59:32 +08:00
GYJ af8a0ece55 Merge remote-tracking branch 'origin/test' into test 2024-12-28 18:55:58 +08:00
GYJ a52dee9bce 补发任务奖励 任务 2024-12-28 18:55:46 +08:00
wangw db4d7327cc 签到页面2 2024-12-28 18:37:57 +08:00
wangw 5e5605c8ea 签到页面 2024-12-28 18:33:08 +08:00
GYJ f95affc036 查询 提现 次数统计 bug 2024-12-28 18:17:59 +08:00
GYJ 3b5c8f0af4 自定义 过分请求异常 2024-12-28 17:39:19 +08:00
wangw 0f12ed5161 抽奖到账机制优化 2024-12-28 16:42:30 +08:00
GYJ 963ad5d223 批量机审 时间修改 2024-12-28 15:57:13 +08:00
wangw d973622445 红包任务 2024-12-28 15:49:21 +08:00
GYJ e77bb19459 提现审核修改 2024-12-28 15:41:36 +08:00
GYJ 3d1b966b11 支付回调增加三方订单号 2024-12-28 14:54:38 +08:00
GYJ 70404d83e8 查询邀请人数 bug 2024-12-28 14:37:20 +08:00
GYJ f11c80b895 查询签到人数 bug 2024-12-28 14:30:33 +08:00
wangw 5a305c2d43 提现问题 2024-12-28 11:59:05 +08:00
GYJ d24826f4bb 批量机审 2024-12-28 11:55:28 +08:00
wangw 55476d4936 全接口 需要登录
数据库线程池大小
获取提现规则
2024-12-28 09:03:34 +08:00
GYJ 8bfa7dd4c4 关闭跨域 2024-12-27 17:21:23 +08:00
GYJ e5d8d37877 打开跨域 2024-12-27 17:16:46 +08:00
谭凯凯 666a347433 提现审核相关接口+支付宝提现统计接口 2024-12-27 16:58:37 +08:00
wangw 3d263960e8 补偿机制3 2024-12-27 16:52:46 +08:00
wangw 9f4820f32f 补偿机制2 2024-12-27 16:40:25 +08:00
wangw fae9df231c 补偿机制 2024-12-27 16:15:48 +08:00
张松 3a15793bfb feat: 手动体现增加次数和金额限制,增加体现类型 2024-12-27 15:35:05 +08:00
谭凯凯 57b2253d9d 提现审核增加成功提现次数和成功提现金额 2024-12-27 14:43:59 +08:00
张松 a58f429783 Merge remote-tracking branch 'origin/test' into test 2024-12-27 14:18:44 +08:00
张松 9469ec3472 feat: 去除首绑支付宝奖励 2024-12-27 14:18:29 +08:00
Tankaikai 1f460ae1e2 Merge remote-tracking branch 'origin/test' into test 2024-12-27 11:54:48 +08:00
谭凯凯 756794d659 获取签到数据接口优化 2024-12-27 11:54:23 +08:00
张松 2d6c93938c feat: 增加单元测试 2024-12-27 11:30:26 +08:00
张松 d70a4dd7f2 fix: 渠道码为空导致奖励不发放修复 2024-12-27 11:27:10 +08:00
谭凯凯 0618f81f82 首页查询优化 2024-12-27 10:43:25 +08:00
张松 bce2fac418 fix: 增加详情错误信息 2024-12-27 09:48:53 +08:00
谭凯凯 5c95fc57ad 首页查询优化 2024-12-26 22:31:31 +08:00
Tankaikai e2554bae0f Merge remote-tracking branch 'origin/test' into test 2024-12-26 22:01:25 +08:00
谭凯凯 8ba258edb4 优化回调 2024-12-26 22:01:20 +08:00
wangw c365f1d6b5 生成订单 支付订单 防抖 2024-12-26 21:33:02 +08:00
Tankaikai 039bcaf262 Merge remote-tracking branch 'origin/test' into test 2024-12-26 21:30:29 +08:00
Tankaikai 0cd1086c79 签到记录 2024-12-26 21:30:22 +08:00
谭凯凯 e5ead76f4f 首页查询优化 2024-12-26 21:27:28 +08:00
wangw bedbdcb0d7 3秒缓存 2024-12-26 20:56:33 +08:00
张松 b39a7f6dc5 Merge branch 'refs/heads/dev' into test 2024-12-26 19:16:00 +08:00
张松 409c3cc81c fix: 体现注释放开 2024-12-26 19:13:26 +08:00
wangw 94add5ee6c 后期发起 state为0的 提现 2024-12-26 19:01:34 +08:00
张松 db5ea43238 fix: 地址更换 2024-12-26 18:55:00 +08:00
Tankaikai 6c72c85bbf Merge remote-tracking branch 'origin/test' into dev 2024-12-26 18:28:31 +08:00
wangw 98433783fa 关闭拦截 2024-12-26 18:25:14 +08:00
Tankaikai da64106678 Merge remote-tracking branch 'origin/test' into test 2024-12-26 18:20:00 +08:00
谭凯凯 eabee5f050 订单刷数据 2024-12-26 18:19:50 +08:00
Tankaikai dd10140147 Merge remote-tracking branch 'origin/test' into test
# Conflicts:
#	src/main/java/com/sqx/modules/job/task/TempOrdersTask.java
2024-12-26 18:18:03 +08:00
谭凯凯 48a152085b 订单刷数据 2024-12-26 18:16:29 +08:00
wangw 894ed787a4 接口防抖 2024-12-26 18:15:42 +08:00
张松 e3c5a96ed2 fix: tomcat线程数量修改 2024-12-26 18:11:44 +08:00
wangw 73ef19ead6 缓存 2024-12-26 18:11:15 +08:00
张松 faf89c5a9e fix: tomcat线程数量修改 2024-12-26 18:08:52 +08:00
张松 aaa87b6d50 fix: tomcat线程数量修改 2024-12-26 18:05:19 +08:00
张松 22b6065950 fix: 订单状态定时任务增加失败状态 2024-12-26 17:56:34 +08:00
张松 03c1193cc5 Merge branch 'refs/heads/test' into dev 2024-12-26 17:53:39 +08:00
张松 e97df47287 fix: 订单状态定时任务增加失败状态 2024-12-26 17:53:29 +08:00
张松 05d446a212 fix: 订单状态定时任务增加失败状态 2024-12-26 17:52:08 +08:00
张松 e7e0d6d484 Merge remote-tracking branch 'origin/test' into test
# Conflicts:
#	src/main/java/com/sqx/modules/job/task/TempOrdersTask.java
2024-12-26 17:42:10 +08:00
张松 3b925f5070 Merge branch 'refs/heads/dev' into test
# Conflicts:
#	src/main/java/com/sqx/modules/job/task/TempOrdersTask.java
2024-12-26 17:41:42 +08:00
张松 54778f4078 fix: 订单状态定时任务增加失败状态 2024-12-26 17:41:06 +08:00
Tankaikai 2f23e93b03 Merge remote-tracking branch 'origin/test' into test
# Conflicts:
#	src/main/java/com/sqx/modules/job/task/TempOrdersTask.java
2024-12-26 17:39:36 +08:00
谭凯凯 b875469beb 订单刷数据测试 2024-12-26 17:38:13 +08:00
张松 372754bb65 Merge remote-tracking branch 'origin/test' into test 2024-12-26 17:13:20 +08:00
张松 4f138ac57b Merge branch 'refs/heads/dev' into test 2024-12-26 17:13:13 +08:00
张松 3f8ca43b71 fix: 订单状态定时任务增加失败状态 2024-12-26 17:12:40 +08:00
Tankaikai f681af7fd8 Merge remote-tracking branch 'origin/test' into test 2024-12-26 17:00:13 +08:00
谭凯凯 93b591fac1 领取满签奖励 2024-12-26 17:00:07 +08:00
张松 85818ffd3d fix: 更改提示 2024-12-26 16:52:47 +08:00
张松 b9564d6e74 fix: 更改提示 2024-12-26 16:52:18 +08:00
张松 0289392f3c Merge remote-tracking branch 'origin/test' into test 2024-12-26 16:24:41 +08:00
张松 b28a5eedff feat: 修改回调前缀 2024-12-26 16:19:51 +08:00
谭凯凯 17b125d14d 提现申请审核 2024-12-26 16:02:04 +08:00
Tankaikai 6afe946441 Merge remote-tracking branch 'origin/test' into test 2024-12-26 15:56:54 +08:00
谭凯凯 82b1526071 提现申请审核 2024-12-26 15:56:49 +08:00
wangw c8cf607a72 swagger 开关 2024-12-26 15:42:53 +08:00
wangw 2a25a4792b 注册 渠道不存在时 2024-12-26 15:02:24 +08:00
张松 5f7c225582 Merge branch 'refs/heads/test' into dev 2024-12-26 14:51:18 +08:00
张松 5f68d4f4ad feat: 体现超限,延缓到明日复审打款 2024-12-26 14:45:34 +08:00
张松 b4cc37b110 feat: 体现超限,延缓到明日复审打款 2024-12-26 14:41:26 +08:00
wangw 05d1b39d4a 提现补发 2024-12-26 14:21:19 +08:00
张松 6bed73e48d Merge remote-tracking branch 'origin/test' into test 2024-12-26 14:11:32 +08:00
张松 ff86d3969b feat: updateOrderStatus异步执行方法增加锁,等待异步方法执行完毕 2024-12-26 14:11:21 +08:00
GYJ 5c7e91a563 Merge branch 'test' into dev 2024-12-26 14:06:36 +08:00
谭凯凯 5b632f80d8 签到记录 2024-12-26 14:01:04 +08:00
Tankaikai 16b158e5e1 Merge remote-tracking branch 'origin/test' into test 2024-12-26 13:57:38 +08:00
谭凯凯 70e0d736ba 签到记录 2024-12-26 13:57:27 +08:00
GYJ d9c1ccee48 修改 api 前缀 2024-12-26 13:40:42 +08:00
wangw a392dc6c59 首次绑定支付宝问题 2024-12-26 13:21:07 +08:00
wangw 81ee291c22 绑定账号问题 2024-12-26 13:12:20 +08:00
张松 650b3bc4ea feat: 体现增加每次体现次数上限 2024-12-26 12:59:09 +08:00
wangw ce9d92508e 重复领取问题 2024-12-26 11:27:10 +08:00
wangw 112bcc15b9 user表 zhi_fu_bao_name 2024-12-26 11:27:05 +08:00
wangw d89ca7bc3a user表 zhifubao_name 2024-12-26 11:27:02 +08:00
wangw 867b3a284e 重复领取问题 2024-12-26 11:25:58 +08:00
wangw 1f3de4c9ae user表 zhi_fu_bao_name 2024-12-26 11:05:37 +08:00
wangw 36531bd0e6 user表 zhifubao_name 2024-12-26 11:01:48 +08:00
wangw 81d823f6ce Merge branch 'test' into dev 2024-12-26 10:48:13 +08:00
wangw 1581c3c530 关闭 提现 2024-12-26 10:46:40 +08:00
wangw cdefd711be 提现问题 2024-12-26 10:21:27 +08:00
GYJ 917f7e3a77 Merge branch 'test' into dev 2024-12-26 02:00:40 +08:00
GYJ 6d2e5f0d2a 注册防抖1 2024-12-26 02:00:24 +08:00
GYJ bacd2694c5 Merge branch 'test' into dev 2024-12-26 01:20:47 +08:00
GYJ 50dab891cc 注册防抖 2024-12-26 01:20:04 +08:00
wangw 184b340111 是否已兑换 2024-12-25 17:04:43 +08:00
wangw 8542e94ed9 生成订单 校验
领奖 记录
2024-12-25 15:36:43 +08:00
Tankaikai 5aecada96e Merge remote-tracking branch 'origin/test' into test 2024-12-25 15:20:51 +08:00
谭凯凯 d00edd861c 奖品兑换需求 2024-12-25 15:20:44 +08:00
wangw f21972b14c 任务奖励 列表 2024-12-25 15:07:25 +08:00
wangw cef4c4a17b 任务奖励 列表 2024-12-25 15:00:00 +08:00
wangw 98c6959fe6 任务奖励添加数量 2024-12-25 14:26:44 +08:00
wangw b3f206ac40 忽略实体 2024-12-25 14:14:36 +08:00
wangw dacf309731 实物领取 2024-12-25 14:09:18 +08:00
wangw 2b0782ddee Merge branch 'test' into dev 2024-12-25 11:20:22 +08:00
wangw 131e022c76 抽奖 随机数生成 2024-12-25 11:19:41 +08:00
GYJ 6178b0440f Merge branch 'test' into dev 2024-12-25 10:55:23 +08:00
GYJ ba5ba7e16b 上级奖励 bug fix 2024-12-25 10:53:53 +08:00
wangw b6d9eaa2de 事务注解 2024-12-25 10:31:00 +08:00
GYJ dc3b8fe67e Merge branch 'test' into dev 2024-12-25 10:16:19 +08:00
GYJ 593b4cc982 Merge branch 'test' into dev 2024-12-25 10:15:55 +08:00
wangw b5584d4c6e 任务奖励 增加图片描述
周任务抽取为 谢谢惠顾的情况
2024-12-25 10:09:02 +08:00
GYJ 1252d63bfd 分享收益查询 fix 2024-12-25 09:43:52 +08:00
wangw 1f4de9490c 余额描述 chassify 2024-12-25 09:43:21 +08:00
wangw 285f1ce4c9 Merge branch 'test' into dev 2024-12-24 18:16:10 +08:00
Tankaikai c0f24ca3ed Merge remote-tracking branch 'origin/test' into test 2024-12-24 18:04:56 +08:00
谭凯凯 40dc17c7dc 奖品兑换需求 2024-12-24 18:04:50 +08:00
wangw f642cbe20f 月任务2 满足时 不展示几/几 2024-12-24 18:03:47 +08:00
wangw 3957ed8c34 抽奖继续 倒叙
月抽奖 次数
2024-12-24 17:52:00 +08:00
Tankaikai 26fbd94cd9 Merge remote-tracking branch 'origin/test' into test 2024-12-24 17:38:47 +08:00
谭凯凯 66ab8a66c5 奖品兑换需求 2024-12-24 17:37:52 +08:00
wangw 75a4c5e4fc 月抽奖
抽奖记录 增加 图片
2024-12-24 17:31:26 +08:00
张松 a684c60b3e Merge remote-tracking branch 'origin/test' into test 2024-12-24 17:00:04 +08:00
张松 cb20edf097 fix: 时间戳溢出导致时间失效修复 2024-12-24 16:59:55 +08:00
GYJ 054ecad4d8 分享收益查询 类型增加 2024-12-24 16:50:18 +08:00
张松 24571a7c64 Merge remote-tracking branch 'origin/test' into test 2024-12-24 15:41:36 +08:00
张松 9129feb204 fix: 广告累计时间不正确修复 2024-12-24 15:41:28 +08:00
谭凯凯 b112da418e 分批次10集购买需求 2024-12-24 15:33:42 +08:00
谭凯凯 8872b6e513 分批次10集购买需求 2024-12-24 15:13:33 +08:00
谭凯凯 4629ec8811 分批次10集购买需求 2024-12-24 14:57:21 +08:00
Tankaikai 6477e48b44 Merge remote-tracking branch 'origin/test' into test 2024-12-24 14:51:05 +08:00
谭凯凯 ebbd658ffb 分批次10集购买需求 2024-12-24 14:49:39 +08:00
张松 310f5b831c fix: 广告回调修改 2024-12-24 14:42:58 +08:00
张松 694a0feac2 Merge remote-tracking branch 'origin/test' into test 2024-12-24 13:58:58 +08:00
张松 bf6864b725 fix: 后台配置免费时长参数秒数改为分钟 2024-12-24 13:57:32 +08:00
谭凯凯 abcdef7b78 分批次10集购买需求 2024-12-24 13:54:47 +08:00
Tankaikai b45f2d6876 Merge remote-tracking branch 'origin/test' into test 2024-12-24 13:52:53 +08:00
谭凯凯 703346253a 分批次10集购买需求 2024-12-24 13:49:39 +08:00
wangw 2c8721e2e8 抽奖 类型问题 2024-12-24 11:44:57 +08:00
wangw 9e923b5d1c 抽奖 类型问题 2024-12-24 11:33:16 +08:00
wangw 062067d4c3 任务 有次数时 不展示 2024-12-24 10:52:46 +08:00
wangw 920d19f8a2 任务 有次数时 不展示 2024-12-24 10:46:44 +08:00
wangw 8ffb5bb329 抽奖次数 2024-12-24 10:39:11 +08:00
wangw 6ffa4d5bf8 抽奖次数 2024-12-24 09:29:33 +08:00
wangw a1f1e9a2de 缓存管理器3 2024-12-23 17:33:56 +08:00
wangw 35c6e4ed23 缓存管理器 2024-12-23 17:27:14 +08:00
wangw ed21f91555 缓存管理器 2024-12-23 17:17:09 +08:00
张松 81da6fa6a3 feat: 1.uni-ad广告回调接入 2.广告奖励免费观看时长 2024-12-23 17:12:38 +08:00
张松 b7e8047b4c Merge remote-tracking branch 'origin/test' into test 2024-12-23 17:07:12 +08:00
张松 45a7224b99 feat: 1.uni-ad广告回调接入 2.广告奖励免费观看时长 2024-12-23 17:07:03 +08:00
wangw e738d98948 生成订单 已存在的情况 2024-12-23 16:30:40 +08:00
张松 f11ae848b0 feat: 1.uni-ad广告回调接入 2.广告奖励免费观看时长 2024-12-23 16:16:36 +08:00
wangw f4e93e748e 任务 抽奖 签到 2024-12-23 16:02:44 +08:00
谭凯凯 4750dca914 分批次10集购买需求 2024-12-23 15:26:05 +08:00
谭凯凯 08dd65e7cb 签到记录需求变更 2024-12-23 15:11:53 +08:00
谭凯凯 73c0510211 分批次10集购买需求 2024-12-23 15:09:57 +08:00
wangw 32fe771c31 Merge branch 'test' into dev 2024-12-23 09:40:20 +08:00
wangw 9dff41383f 事务注解 2024-12-23 09:39:34 +08:00
wangw f131f5b786 任务次数 2024-12-21 18:20:15 +08:00
wangw eabcee6bf5 任务已达标次数
获取大转盘次数
2024-12-21 18:13:00 +08:00
wangw a5d17f7f57 抽奖 奖项概率设置 2024-12-21 17:34:00 +08:00
wangw 49859f9ea6 任务中心 奖励 跳转 2024-12-21 14:11:34 +08:00
Tankaikai 5b4fb7a983 Merge remote-tracking branch 'origin/test' into test 2024-12-21 11:01:17 +08:00
谭凯凯 a664a59286 奖品兑换需求 2024-12-21 11:01:09 +08:00
wangw d0d55ec8d1 大转盘 添加时 概率问题 2024-12-21 10:06:39 +08:00
wangw d6ac80cd1e 大转盘 添加 2024-12-21 09:59:28 +08:00
wangw 2035da163d 大转盘 参数 2024-12-21 09:30:37 +08:00
wangw e751d9b4cc 获取 大转盘 传参 2024-12-20 18:16:08 +08:00
wangw 18f1bf1f9b 每日任务 领取后可点击 2024-12-20 18:02:31 +08:00
wangw 8b6a67e17a 大转盘抽奖
任务中心
2024-12-20 14:44:53 +08:00
谭凯凯 4363e91fa7 首绑支付宝发放现金红包奖励 2024-12-20 14:29:27 +08:00
谭凯凯 c2643cf546 首绑支付宝发放现金红包奖励 2024-12-20 14:24:29 +08:00
谭凯凯 d135eb3c58 首绑支付宝发放现金红包奖励 2024-12-20 14:13:51 +08:00
谭凯凯 0584ef6566 首绑支付宝发放现金红包奖励 2024-12-20 14:02:50 +08:00
谭凯凯 8123d0223e 签到需求相关接口 2024-12-19 15:41:59 +08:00
谭凯凯 d1e6bbe252 签到需求相关接口 2024-12-19 15:32:48 +08:00
wangw dfc06961d9 注册 代理商 2024-12-19 14:16:06 +08:00
wangw e09d2cee39 注册 代理商 2024-12-19 14:14:42 +08:00
wangw 893a37c752 提现问题 2024-12-19 13:31:48 +08:00
wangw 764dcb72ad 提现问题 2024-12-19 11:37:12 +08:00
wangw b8923516e5 注册 不校验token 2024-12-19 11:36:53 +08:00
wangw aba9025464 现金红包抽奖概率设置 2024-12-19 10:43:04 +08:00
wangw 17213fafd9 提现异步回调 执行时间问题 2024-12-19 10:42:26 +08:00
wangw 59dd621bab 提现总次数 提现总金额 2024-12-19 10:41:44 +08:00
Tankaikai c769b9b71d Merge remote-tracking branch 'origin/test' into test 2024-12-19 10:40:24 +08:00
谭凯凯 d6355e37ed 签到需求相关接口 2024-12-19 10:40:16 +08:00
wangw 9550e3d169 注册接口 2024-12-18 18:10:57 +08:00
wangw c510a32e71 登录接口 2024-12-18 17:59:30 +08:00
wangw 48ed1e3d7a 抽奖3次后 修改概率
redis 工具类 新增返回 map<String,List<T>> 格式
2024-12-18 17:49:34 +08:00
wangw 38decaa8f1 提现 增加验证码校验 2024-12-18 17:45:49 +08:00
wangw 297c028985 代理商 注册 2024-12-18 17:45:49 +08:00
张松 c9242db805 feat: 用户累计充值可得免费播放全集权限 2024-12-18 17:25:52 +08:00
张松 5a10f03a4a feat: 用户累计充值可得免费播放全集权限 2024-12-18 17:07:13 +08:00
wangw 4184193ee6 代理平台 提现扣款问题 2024-12-18 15:02:24 +08:00
wangw 616199ed71 代理平台 提现扣款问题 2024-12-18 15:01:53 +08:00
wangw 00d624f9ef 分享达标 代理奖励 2024-12-18 14:30:36 +08:00
wangw 54ea8c91a9 邀请人 签到 记录 2024-12-17 19:11:19 +08:00
wangw bf60074bd4 下级佣金不可大于渠道商佣金 2024-12-17 18:57:01 +08:00
wangw 0a3c890507 下级佣金不可大于渠道商佣金 2024-12-17 18:50:11 +08:00
wangw 8a92e23106 提现返回 2024-12-17 18:22:06 +08:00
wangw 29bc443422 提现记录 2024-12-17 18:02:44 +08:00
wangw 26f12ab48f 邀请用户 金钱到账记录 2024-12-17 17:58:46 +08:00
wangw 1c2243c692 邀请用户 查询是否签到 2024-12-17 17:48:18 +08:00
wangw 58b831b174 邀请用户是否已签到
邀请好友 佣金入账
2024-12-17 17:40:35 +08:00
wangw e6ca889f43 提现问题 2024-12-17 17:17:57 +08:00
wangw 48be3106b8 下级佣金不可大于渠道商佣金 2024-12-17 15:58:49 +08:00
wangw 982e79d268 redis密码 2024-12-17 14:13:35 +08:00
wangw e40068a762 redis密码 2024-12-17 13:42:35 +08:00
wangw ed4720d992 接口访问次数限制 2024-12-17 13:42:04 +08:00
wangw 85f71935cd 接口限制 2024-12-17 11:25:06 +08:00
wangw 42b33c5f0e 提现回调,已驳回的 返回内容 2024-12-17 10:29:11 +08:00
wangw 0bc204460e 分润问题 2024-12-17 09:57:39 +08:00
GYJ 249f857c9e 领取奖励时判断用户是否绑定支付宝 2024-12-16 15:17:41 +08:00
GYJ 12ca117e82 处理手机号未注册登录提示 2024-12-15 18:36:38 +08:00
GYJ 20753f84b3 bug fix1 2024-12-15 17:15:00 +08:00
GYJ 67f9f7bc82 bug fix 2024-12-15 17:11:26 +08:00
GYJ 09952a245e 抽奖次数bug fix 2024-12-14 15:05:34 +08:00
GYJ dec0a17935 查询流水区分类型 2024-12-14 14:33:25 +08:00
GYJ 0fc6bf0d6d 代理金额入账bug fix 2024-12-14 14:08:33 +08:00
GYJ c6692c87cd 积分未入账 2024-12-14 13:28:33 +08:00
GYJ 317f761aea 增加万能验证码 2024-12-14 10:27:01 +08:00
GYJ 88bb7e54a5 Merge remote-tracking branch 'origin/test' into test 2024-12-14 09:37:12 +08:00
GYJ 51e9ef0d91 修改达标奖励重复给的问题
增加万能验证码
2024-12-14 09:36:46 +08:00
GYJ 0973c4bc45 payType 非必填 2024-12-13 18:07:57 +08:00
GYJ c463ab0ae1 修改h5相关支付流程 2024-12-13 17:36:00 +08:00
GYJ ff634f2ded 测试支付回调地址3 2024-12-13 17:24:59 +08:00
GYJ bdd223ee5e 测试支付回调地址2 2024-12-13 17:14:58 +08:00
GYJ aa04da087b 测试支付回调地址1 2024-12-13 15:46:04 +08:00
wangw fcdf71a9b0 redis 缓存问题 2024-12-13 15:25:15 +08:00
GYJ 8879666375 测试支付回调地址 2024-12-13 15:21:33 +08:00
wangw af71811487 redis 缓存问题
id默认问题
2024-12-13 15:04:41 +08:00
wangw 73631f76a7 redis 方法封装
抽奖金额概率 配置
banner 跳转类型
2024-12-13 10:53:40 +08:00
wangw 4227ece60a 统计月签到次数 问题 2024-12-12 17:56:10 +08:00
GYJ 9775cf129a 查询分享收益接口修改 2024-12-12 16:40:41 +08:00
GYJ a6bcb3da8f 修改 收益类型对照关系 2024-12-12 16:24:03 +08:00
GYJ 6d96ea7dbd 修改金豆为金币 2024-12-12 14:45:41 +08:00
GYJ b763d69419 支付回调修改 2024-12-12 14:30:43 +08:00
GYJ 8dce86e874 代理修改账号 密码出错bug 1 2024-12-12 11:10:51 +08:00
GYJ 907b98914f 代理修改账号 密码出错bug 2024-12-12 10:59:15 +08:00
GYJ bc8dc5b0d8 支付处理 价格为0的情况 2024-12-12 10:55:15 +08:00
GYJ 6051d83bbc 支付删除成功回调url 2024-12-12 10:35:35 +08:00
wangw 978c4ff5b6 邀请人员达标人员够?额外奖励 2024-12-12 10:10:25 +08:00
GYJ af6efd83be 查询订单支付状态 2024-12-12 09:52:51 +08:00
wangw a810db24fe 抽奖绑定order id 2024-12-11 18:08:41 +08:00
wangw b4e1fd3826 抽奖值 2024-12-11 17:57:22 +08:00
wangw c9fa6a7185 抽奖值 2024-12-11 17:51:35 +08:00
wangw ac6f6d07c7 一次性任务 领取 2024-12-11 17:30:19 +08:00
wangw 0b0fac8aa1 单词错误 2024-12-11 17:18:47 +08:00
wangw e93e201dd2 单次任务处理 2024-12-11 16:45:06 +08:00
GYJ 211f99c87b 流水区分金豆和钱 2024-12-11 16:10:24 +08:00
wangw 2f73eb9032 抽奖金额修改
订单笔数统计 只统计支付宝支付
增加 一次性任务 新人福利 领取1元
2024-12-11 15:47:47 +08:00
GYJ b36abdd513 分享签到相关修改 2024-12-11 15:24:28 +08:00
wangw 85235ae78b Merge branch 'test' into dev 2024-12-11 11:00:04 +08:00
wangw 1d714f7383 奖励类型 9 为大转盘 2024-12-11 10:59:40 +08:00
wangw dddc343261 已领取后 number置空 2024-12-11 10:52:03 +08:00
wangw 2ededc726f 重复领取问题 2024-12-11 10:49:09 +08:00
wangw 3824038f36 达标 置为null
任务领取
2024-12-11 10:45:49 +08:00
wangw a9ca0f4fb2 达标 置为null 2024-12-11 10:39:42 +08:00
wangw 5607bfcd8e 任务 是否已领取 2024-12-11 10:31:35 +08:00
wangw d001b23e7f 每日次数 永远可点 2024-12-11 10:21:17 +08:00
wangw 0bdf1c585d 剩余次数 2024-12-11 10:13:13 +08:00
wangw d30ed4aba6 Merge branch 'test' into dev 2024-12-11 10:06:09 +08:00
wangw 6bc31b3484 支付笔数 2024-12-11 10:05:39 +08:00
wangw ffc289cc7d 任务剩余次数 2024-12-11 10:00:08 +08:00
wangw 35cc3a6c4d Merge branch 'test' into dev 2024-12-11 09:35:02 +08:00
wangw 5333c8775e 任务剩余次数 2024-12-11 09:34:14 +08:00
wangw 38572e9077 签到任务 剩余 次数 2024-12-10 17:55:11 +08:00
wangw b6c0815a59 顺序问题 2024-12-10 16:30:08 +08:00
wangw 48311dc69e Merge branch 'test' into dev 2024-12-10 10:13:25 +08:00
wangw 742c4e8735 提现问题 2024-12-10 10:10:50 +08:00
GYJ d5078718a6 Merge branch 'test' into dev 2024-12-09 17:38:00 +08:00
GYJ 2546025d70 支付回调处理 2024-12-09 17:37:02 +08:00
GYJ c4790628f0 支付成功回调地址 2024-12-09 17:12:12 +08:00
wangw 7c1685f993 抽奖 金额 2024-12-09 16:45:30 +08:00
wangw 4ed9da9448 Merge branch 'test' into dev 2024-12-09 15:39:34 +08:00
wangw 6771ad1d25 日志打印 避免回填 2024-12-09 15:38:31 +08:00
wangw 357595bda9 任务中心 获得抽奖次数 与订单 次数不冲突 2024-12-09 15:30:53 +08:00
wangw 318d252a32 防抖 2024-12-09 14:51:10 +08:00
GYJ 9696e6e9de 添加提现成功时间 2024-12-09 14:36:04 +08:00
GYJ a241322cb4 统计播放量不要用户id 2024-12-09 14:31:10 +08:00
GYJ fc0bb7795f Merge branch 'test' into dev 2024-12-09 14:14:48 +08:00
GYJ 842cacd88e 金豆购买视频 修复 2024-12-09 14:01:55 +08:00
wangw 3eeaa2b947 内部预留字段 sql执行问题 2024-12-09 13:59:44 +08:00
wangw 32dcd1573e 任务中心问题 2024-12-09 13:54:31 +08:00
wangw 18cf4bd1c5 Merge branch 'test' into dev
# Conflicts:
#	src/main/java/com/sqx/modules/taskCenter/service/TaskCenterService.java
#	src/main/java/com/sqx/modules/taskCenter/service/impl/TaskCenterServiceImpl.java
2024-12-09 11:12:09 +08:00
wangw 03526f7c4a 大转盘 领取奖励修改
提现 修改
任务中心 记录 领取记录 是否可领取
2024-12-09 11:05:22 +08:00
GYJ 02dd3b4587 金豆购买视频 2024-12-07 17:52:08 +08:00
wangw e81d2a1d57 任务中心
任务列表
 任务领取(不包括领取记录)
签到
2024-12-07 17:19:01 +08:00
wangw 1b1a1e6c49 任务中心
任务列表
 任务领取(不包括领取记录)
签到
2024-12-07 17:17:53 +08:00
wangw 53f6a8c24e Merge branch 'test' into dev
# Conflicts:
#	src/main/java/com/sqx/modules/discSpinning/controller/DiscSpinningController.java
2024-12-07 15:48:26 +08:00
wangw ed2774907e 根据订单落地 抽奖记录 2024-12-07 15:46:42 +08:00
wangw 9c40748e3f 抽奖 maps为空 2024-12-07 15:35:23 +08:00
wangw 2c8cc45ce0 抽奖 maps为空 2024-12-07 15:33:28 +08:00
wangw 387af834ae 抽奖 2024-12-07 15:22:45 +08:00
GYJ 09c68c015b 修改用户信息bug修复 2024-12-07 13:50:51 +08:00
GYJ 8c22e7ed95 红包抽奖次数提示 2024-12-07 11:36:09 +08:00
wangw 94159c174e 分享达标
大转盘 获取次数区分
抽奖 区分
统计 订单数统一接口
2024-12-07 11:04:15 +08:00
GYJ a297859b47 代理商提现 2024-12-07 10:56:22 +08:00
wangw db80169234 任务中心 接口路径修改 2024-12-07 09:37:48 +08:00
wangw b781a7f670 拦截器 2024-12-06 18:27:37 +08:00
wangw 125e2b59a3 sessionCreated 报错问题 2024-12-06 17:30:28 +08:00
wangw b8282bc471 sessionCreated 报错问题 2024-12-06 17:27:59 +08:00
wangw beb963d785 提现额度过低问题 2024-12-06 17:17:17 +08:00
wangw b7c2e95298 sessionCreated 报错问题 2024-12-06 17:13:48 +08:00
GYJ 17fbb078f2 代理商固定分润 2024-12-06 17:04:10 +08:00
wangw af7a1f14a4 提现失败 描述 2024-12-06 16:17:34 +08:00
wangw 383867e7a2 用户为空 2024-12-06 16:01:34 +08:00
wangw ce8c9f38e0 异步领取 奖项 2024-12-06 15:54:27 +08:00
wangw 0f2cac26b7 异步注解启动 2024-12-06 15:41:50 +08:00
wangw ad1f5d2df2 接口执行时间
领取过慢
2024-12-06 15:35:01 +08:00
wangw 3a66ec6eda 接口执行时间 2024-12-06 15:19:18 +08:00
GYJ 12ed8f03d3 支付回调去除签名校验 2024-12-06 15:09:33 +08:00
wangw a0e9582233 任务中心 /app 2024-12-06 14:22:16 +08:00
wangw 5b50aa54b7 任务中心 2024-12-06 14:21:01 +08:00
wangw 6f89ce84fe 提现 字段 存入 问题 2024-12-06 11:50:54 +08:00
wangw 793e6eefe8 提现 字段 存入 问题 2024-12-06 11:49:01 +08:00
wangw 8bfe18f6d8 钱包 明细 2024-12-06 11:37:13 +08:00
wangw 858bf4fc79 提现 失败 情况 处理 2024-12-06 11:21:59 +08:00
wangw c6dae69abc Merge branch 'dev' into test
# Conflicts:
#	src/main/java/com/sqx/modules/discSpinning/controller/DiscSpinningController.java
2024-12-06 11:17:20 +08:00
GYJ 16a823d330 提现失败 处理 2024-12-06 11:14:08 +08:00
wangw 5ea41773c7 抽奖 获取抽奖次数 2024-12-06 10:53:51 +08:00
wangw 436c2afcd7 抽奖 获取抽奖次数 2024-12-06 10:42:42 +08:00
wangw ece33e9299 抽奖 获取抽奖次数 2024-12-06 10:04:16 +08:00
GYJ f6d6603f8d Merge branch 'test' into dev 2024-12-05 18:16:41 +08:00
GYJ ada714d68e 统计播放量 和 完播量 2024-12-05 17:32:04 +08:00
wangw 8672a9f2c7 提现获取 userId 2024-12-05 17:15:31 +08:00
wangw 96c333fcc4 提现 2024-12-05 17:02:41 +08:00
GYJ 2c07d98be9 修改无忧支付配置 2024-12-05 17:01:32 +08:00
wangw 2d9a74158a 我的钱包 2024-12-05 16:45:31 +08:00
wangw 2379cae506 我的钱包
通用日志
2024-12-05 16:42:41 +08:00
wangw 2ea9a4d813 全局 日志
领取红包 返回
2024-12-05 16:06:50 +08:00
wangw 07a75fdfe7 Merge branch 'master' into dev 2024-12-05 14:51:04 +08:00
wangw 3416b0ef7f Merge branch 'master' into test 2024-12-05 14:50:24 +08:00
GYJ ded4804ca4 修改配置文件 2024-12-05 14:47:38 +08:00
421 changed files with 18056 additions and 5257 deletions

View File

@ -249,7 +249,7 @@ INSERT INTO `common_info` VALUES (420, '2023-08-28 11:23:02', NULL, '一级佣
INSERT INTO `common_info` VALUES (421, '2024-03-05 16:55:37', NULL, '二级佣金比例', 421, '0.04', 'fuwufei');
INSERT INTO `common_info` VALUES (450, '2024-02-02 18:12:27', NULL, '剧导入模板', 450, 'https://duanju.xianmxkj.com/剧导入模板.xlsx', 'xitong');
INSERT INTO `common_info` VALUES (451, '2024-02-02 18:12:49', NULL, '集导入模板', 451, 'https://duanju.xianmxkj.com/集导入模板.xlsx', 'xitong');
INSERT INTO `common_info` VALUES (500, '2020-02-25 20:44:15', NULL, '付费须知说明', 500, '一经购买不予退款未满18岁需在监护人的指导、同意下进行付费操作', 'xieyi');
INSERT INTO `common_info` VALUES (500, '2020-02-25 20:44:15', NULL, '付费须知说明', 500, '一经购买不予退款未满18岁需在监护人的指导、同意下进行付费操作', 'xieyi');
INSERT INTO `common_info` VALUES (800, '2024-05-30 18:08:11', NULL, '腾讯云oss AccessKey', 800, '', 'oss');
INSERT INTO `common_info` VALUES (801, '2024-05-30 18:08:06', NULL, '腾讯云oss SecretKey', 801, '', 'oss');
INSERT INTO `common_info` VALUES (802, '2024-05-30 18:08:17', NULL, '腾讯云oss bucket地域', 802, 'ap-shanghai', 'oss');
@ -274,7 +274,7 @@ INSERT INTO `common_info` VALUES (821, '2024-01-06 11:40:25', NULL, '抖音原
INSERT INTO `common_info` VALUES (822, '2024-06-26 16:07:33', NULL, '小程序AppKey', 822, '', 'xitong');
INSERT INTO `common_info` VALUES (823, '2024-06-26 16:07:18', NULL, '微信虚拟支付OfferID', 823, '', 'xitong');
INSERT INTO `common_info` VALUES (824, '2024-07-08 02:19:39', NULL, '微信虚拟支付环境 0正式环境 1沙盒环境', 824, '0', 'xitong');
INSERT INTO `common_info` VALUES (825, '2024-01-06 11:40:25', NULL, '充值提示', 825, '一经购买不予退款未满18岁需在监护人的指导、同意下进行付费操作', 'xitong');
INSERT INTO `common_info` VALUES (825, '2024-01-06 11:40:25', NULL, '充值提示', 825, '一经购买不予退款未满18岁需在监护人的指导、同意下进行付费操作', 'xitong');
INSERT INTO `common_info` VALUES (826, '2024-06-26 16:07:54', NULL, '小程序Token', 826, '', 'weixin');
INSERT INTO `common_info` VALUES (827, '2024-06-26 16:07:44', NULL, '小程序EncodingAESKey ', 827, '', 'weixin');
INSERT INTO `common_info` VALUES (828, '2020-02-25 20:43:59', NULL, '快手AppId', 828, '', 'xitong');

186
pom.xml
View File

@ -23,7 +23,7 @@
<mssql.version>4.0</mssql.version>
<oracle.version>11.2.0.3</oracle.version>
<druid.version>1.1.13</druid.version>
<quartz.version>2.3.0</quartz.version>
<!-- <quartz.version>2.3.0</quartz.version>-->
<commons.lang.version>2.6</commons.lang.version>
<commons.fileupload.version>1.2.2</commons.fileupload.version>
<commons.io.version>2.5</commons.io.version>
@ -35,12 +35,14 @@
<qiniu.version>7.2.23</qiniu.version>
<aliyun.oss.version>3.4.0</aliyun.oss.version>
<qcloud.cos.version>4.4</qcloud.cos.version>
<swagger.version>2.7.0</swagger.version>
<!-- <swagger.version>2.7.0</swagger.version>-->
<swagger.version>2.9.2</swagger.version>
<joda.time.version>2.9.9</joda.time.version>
<gson.version>2.8.5</gson.version>
<fastjson.version>1.2.83</fastjson.version>
<hutool.version>4.6.10</hutool.version>
<lombok.version>1.18.4</lombok.version>
<shardingsphere.version>4.1.1</shardingsphere.version>
<!--wagon plugin 配置-->
<!--<service-path>/work/sz</service-path>
@ -51,6 +53,31 @@
</properties>
<dependencies>
<dependency>
<groupId>com.github.brainlag</groupId>
<artifactId>nsq-client</artifactId>
<version>1.0.0.RC4</version>
</dependency>
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>dytnsapi20200217</artifactId>
<version>2.9.0</version>
</dependency>
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>tea-openapi</artifactId>
<version>0.3.6</version>
</dependency>
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>tea-console</artifactId>
<version>0.0.1</version>
</dependency>
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>tea-util</artifactId>
<version>0.2.23</version>
</dependency>
<dependency>
<groupId>com.volcengine</groupId>
@ -63,15 +90,27 @@
<artifactId>guava</artifactId>
<version>19.0</version>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk</artifactId>
<version>1.11.274</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>com.amazonaws</groupId>-->
<!-- <artifactId>aws-java-sdk</artifactId>-->
<!-- <version>1.11.274</version>-->
<!-- <exclusions>-->
<!-- <exclusion>-->
<!-- <artifactId>aws-java-sdk-simpleworkflow</artifactId>-->
<!-- <groupId>com.amazonaws</groupId>-->
<!-- </exclusion>-->
<!-- </exclusions>-->
<!-- </dependency>-->
<dependency>
<groupId>cn.afterturn</groupId>
<artifactId>easypoi-spring-boot-starter</artifactId>
<version>4.0.0</version>
<exclusions>
<exclusion>
<artifactId>javassist</artifactId>
<groupId>org.javassist</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.github.qcloudsms</groupId>
@ -91,13 +130,6 @@
</exclusions>
</dependency>
<!--云购os支付-->
<dependency>
<groupId>com.yungouos.pay</groupId>
<artifactId>yungouos-pay-sdk</artifactId>
<version>2.0.10</version>
</dependency>
<dependency>
<groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator</artifactId>
@ -123,11 +155,11 @@
<version>5.5.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.alibaba/druid -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
<version>1.1.10</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>com.alibaba</groupId>-->
<!-- <artifactId>druid</artifactId>-->
<!-- <version>1.1.10</version>-->
<!-- </dependency>-->
<!-- 苹果工具类 -->
<dependency>
<groupId>com.auth0</groupId>
@ -177,6 +209,12 @@
<groupId>com.aliyun.oss</groupId>
<artifactId>aliyun-sdk-oss</artifactId>
<version>3.4.0</version>
<exclusions>
<exclusion>
<artifactId>aliyun-java-sdk-core</artifactId>
<groupId>com.aliyun</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.aliyun</groupId>
@ -207,6 +245,16 @@
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.elasticsearch.client</groupId>
<artifactId>elasticsearch-rest-high-level-client</artifactId>
</exclusion>
<exclusion>
<groupId>org.elasticsearch</groupId>
<artifactId>elasticsearch</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
@ -241,16 +289,40 @@
</exclusion>
</exclusions>
</dependency>
<!--动态数据库切换-->
<!-- <dependency>-->
<!-- <groupId>com.baomidou</groupId>-->
<!-- <artifactId>dynamic-datasource-spring-boot-starter</artifactId>-->
<!-- <version>4.1.3</version>-->
<!-- </dependency>-->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>${mysql.version}</version>
</dependency>
<!--oracle驱动-->
<!-- <dependency>-->
<!-- <groupId>com.oracle</groupId>-->
<!-- <artifactId>ojdbc6</artifactId>-->
<!-- <version>${oracle.version}</version>-->
<!-- </dependency>-->
<!-- 用于定义sharding-jdbc 分片规则 -->
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc6</artifactId>
<version>${oracle.version}</version>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>sharding-core-api</artifactId>
<version>${shardingsphere.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>sharding-jdbc-core</artifactId>
<version>${shardingsphere.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<!--mssql驱动-->
<dependency>
@ -259,26 +331,26 @@
<version>${mssql.version}</version>
</dependency>
<!--postgresql驱动-->
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.postgresql</groupId>-->
<!-- <artifactId>postgresql</artifactId>-->
<!-- </dependency>-->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId>
<version>${druid.version}</version>
</dependency>
<dependency>
<groupId>org.quartz-scheduler</groupId>
<artifactId>quartz</artifactId>
<version>${quartz.version}</version>
<exclusions>
<exclusion>
<groupId>com.mchange</groupId>
<artifactId>c3p0</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.quartz-scheduler</groupId>-->
<!-- <artifactId>quartz</artifactId>-->
<!-- <version>${quartz.version}</version>-->
<!-- <exclusions>-->
<!-- <exclusion>-->
<!-- <groupId>com.mchange</groupId>-->
<!-- <artifactId>c3p0</artifactId>-->
<!-- </exclusion>-->
<!-- </exclusions>-->
<!-- </dependency>-->
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
@ -321,14 +393,25 @@
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<artifactId>springfox-swagger-ui</artifactId>
<version>${swagger.version}</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<artifactId>springfox-swagger2</artifactId>
<version>${swagger.version}</version>
</dependency>
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-annotations</artifactId>
<version>1.5.22</version>
</dependency>
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-models</artifactId>
<version>1.5.22</version>
</dependency>
<dependency>
<groupId>com.qiniu</groupId>
<artifactId>qiniu-java-sdk</artifactId>
@ -419,11 +502,26 @@
<artifactId>restful-sdk</artifactId>
<version>1.0.0.1</version>
</dependency>
<!--<dependency>-->
<!--<groupId>com.baidu.aip</groupId>-->
<!--            <artifactId>java-sdk</artifactId>-->
<!--            <version>4.11.3</version>-->
<!--</dependency>-->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.elasticsearch.client</groupId>
<artifactId>elasticsearch-rest-high-level-client</artifactId>
<version>7.14.0</version>
</dependency>
<dependency>
<groupId>org.elasticsearch</groupId>
<artifactId>elasticsearch</artifactId>
<version>7.14.0</version>
</dependency>
<dependency>
<groupId>org.dromara.easy-es</groupId>
<artifactId>easy-es-boot-starter</artifactId>
<version>2.0.0</version>
</dependency>
</dependencies>
<build>

View File

@ -1,23 +1,30 @@
package com.sqx;
import org.dromara.easyes.starter.register.EsMapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.scheduling.annotation.EnableScheduling;
/**
* @author GYJ
*/
@EnableCaching
@EnableScheduling
@EsMapperScan("com.sqx.modules.es.mapper")
@SpringBootApplication
public class SqxApplication {
public static void main(String[] args) {
SpringApplication.run(SqxApplication.class, args);
System.out.println("(♥◠‿◠)ノ゙ 短剧系统启动成功 ლ(´ڡ`ლ)゙ \n"+
" _ \n" +
" | | \n" +
" ___ | | __\n" +
" / _ \\| |/ /\n" +
"| (_) | < \n" +
" \\___/|_|\\_\\");
" _ \n" +
" | | \n" +
" ___ | | __\n" +
" / _ \\| |/ /\n" +
"| (_) | < \n" +
" \\___/|_|\\_\\");
}
}
}

View File

@ -0,0 +1,24 @@
package com.sqx.common.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.concurrent.TimeUnit;
/**
* @author ww
*/
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface Debounce {
// 防抖时间间隔默认2秒
long interval() default 2000;
// 时间单位默认毫秒
TimeUnit timeUnit() default TimeUnit.MILLISECONDS;
// 用于指定基于的入参表达式为空时对整个方法防抖
// 格式为 #入参键. 例如 #receive.id
// 多个参数 使用逗号进行拼接 例如: #receive.id,#receive.name
String value() default "";
}

View File

@ -0,0 +1,79 @@
package com.sqx.common.aspect;
import cn.hutool.core.thread.ThreadUtil;
import com.google.gson.Gson;
import com.sqx.common.utils.HttpContextUtils;
import com.sqx.common.utils.IPUtils;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Component;
import javax.servlet.http.HttpServletRequest;
/**
* 方法调用统一切面处理
*/
@Aspect
@Component
@Slf4j
@Profile({"dev"})
public class AppApiMethodAspect {
@Pointcut("!execution(public * (com.sqx.modules.sys.controller.SysLoginController).*(..)) " +
"&& execution(public * (com.sqx.modules.*.controller..*).*(..)))")
public void pkg() {
}
@Around("pkg()")
public Object around(ProceedingJoinPoint pjp) throws Throwable {
long start = System.currentTimeMillis();
//避免回填
Object[] args = pjp.getArgs();
// 如果请求参数中包含HttpServletRequest剔除HttpServletRequest
for (int i = 0; i < args.length; i++) {
if (args[i] instanceof HttpServletRequest) {
args[i] = null;
}
}
String params = new Gson().toJson(args);
// 执行被拦截的方法
Object result = pjp.proceed();
long end = System.currentTimeMillis();
HttpServletRequest request = HttpContextUtils.getHttpServletRequest();
String method = request.getMethod();
String requestUrl = request.getRequestURL().toString();
String requestIp = IPUtils.getIpAddr(request);
long useTime = end - start;
ThreadUtil.execAsync(() -> {
//请求的参数
String resultJson = new Gson().toJson(result);
try {
if (StringUtils.isNotBlank(resultJson) && !"null".equals(resultJson)) {
log.info("\n>>>>>> {} {}" +
"\n>>>>>> IP: {} " +
"\n>>>>>> execute time:{}ms " +
"\n>>>>>> Request: {}" +
"\n>>>>>> Response: {}",
method, requestUrl, requestIp, useTime,
params,
resultJson
);
}
} catch (Exception e) {
log.error("Request 为空" + e.getMessage());
}
});
return result;
}
}

View File

@ -0,0 +1,117 @@
package com.sqx.common.aspect;
import com.sqx.common.annotation.Debounce;
import com.sqx.common.utils.SpelUtil;
import org.apache.commons.lang3.StringUtils;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.aspectj.lang.reflect.MethodSignature;
import org.springframework.stereotype.Component;
import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.ReentrantLock;
/**
* 防抖切面
* @author ww
*/
@Aspect
@Component
public class DebounceAspect {
@Pointcut("@annotation(com.sqx.common.annotation.Debounce)")
public void logPointCut() {
}
// 用于存储基于方法和入参情况的上次执行时间结构为方法签名 -> (入参值 -> 上次执行时间)
private static final ConcurrentHashMap<String, ConcurrentHashMap<Object, Long>> executionTimeMap = new ConcurrentHashMap<>();
private static final ReentrantLock lock = new ReentrantLock();
@Around("logPointCut()")
public Object aroundDebounce(ProceedingJoinPoint joinPoint) throws Throwable {
cleanExpiredRecords();
String methodSignature = joinPoint.getSignature().toLongString();
MethodSignature signature = (MethodSignature) joinPoint.getSignature();
Debounce annotation = signature.getMethod().getAnnotation(Debounce.class);
long interval = annotation.interval();
TimeUnit timeUnit = annotation.timeUnit();
String value = annotation.value();
if (StringUtils.isBlank(value)) {
// 没有指定入参表达式按照整个方法进行防抖
return debounceForWholeMethod(joinPoint, methodSignature, interval, timeUnit);
}
String[] split = value.split(",");
StringBuilder values = new StringBuilder();
for (String str : split) {
values.append(SpelUtil.generateKeyBySpEL(str, joinPoint));
}
// 解析入参表达式获取对应入参的值
if (StringUtils.isBlank(values.toString())) {
// 如果解析失败或值为null按照整个方法进行防抖
return debounceForWholeMethod(joinPoint, methodSignature, interval, timeUnit);
}
// 根据方法签名和入参值进行防抖判断
return debounceForSpecificValue(joinPoint, methodSignature, interval, timeUnit, values.toString());
}
private Object debounceForWholeMethod(ProceedingJoinPoint joinPoint, String methodSignature, long interval, TimeUnit timeUnit) throws Throwable {
ConcurrentHashMap<Object, Long> methodExecutionTimeMap = executionTimeMap.computeIfAbsent(methodSignature, k -> new ConcurrentHashMap<>());
long currentTime = System.currentTimeMillis();
Long lastTime = methodExecutionTimeMap.get(methodSignature);
if (lastTime == null) {
// 如果不存在对应键值对设置初始值这里设置为一个表示很久之前的时间戳比如0
lastTime = 0L;
}
if (lastTime == null || currentTime - timeUnit.toMillis(interval) >= lastTime) {
// 满足防抖间隔更新上次执行时间并执行目标方法
methodExecutionTimeMap.put(methodSignature, currentTime);
return joinPoint.proceed();
}
// 在防抖间隔内不执行目标方法直接返回
return null;
}
private Object debounceForSpecificValue(ProceedingJoinPoint joinPoint, String methodSignature, long interval, TimeUnit timeUnit, Object targetValue) throws Throwable {
ConcurrentHashMap<Object, Long> methodExecutionTimeMap = executionTimeMap.computeIfAbsent(methodSignature, k -> new ConcurrentHashMap<>());
long currentTime = System.currentTimeMillis();
Long lastTime = methodExecutionTimeMap.get(targetValue);
if (lastTime == null || currentTime - timeUnit.toMillis(interval) >= lastTime) {
// 满足防抖间隔更新上次执行时间并执行目标方法
methodExecutionTimeMap.put(targetValue, currentTime);
return joinPoint.proceed();
}
// 在防抖间隔内不执行目标方法直接返回
return null;
}
public void cleanExpiredRecords() {
long expirationTime = System.currentTimeMillis() - TimeUnit.SECONDS.toMillis(10);
lock.lock();
try {
for (Entry<String, ConcurrentHashMap<Object, Long>> outerEntry : executionTimeMap.entrySet()) {
String methodSignature = outerEntry.getKey();
ConcurrentHashMap<Object, Long> innerMap = outerEntry.getValue();
ConcurrentHashMap<Object, Long> keysToRemove = new ConcurrentHashMap<>();
for (Entry<Object, Long> innerEntry : innerMap.entrySet()) {
if (innerEntry.getValue() < expirationTime) {
keysToRemove.put(innerEntry.getKey(), innerEntry.getValue());
}
}
innerMap.keySet().removeAll(keysToRemove.keySet());
if (innerMap.isEmpty()) {
executionTimeMap.remove(methodSignature);
}
}
} finally {
lock.unlock();
}
}
}

View File

@ -0,0 +1,10 @@
package com.sqx.common.exception;
/**
* @author GYJoker
*/
public class CzgException extends Exception {
public CzgException(String message) {
super(message);
}
}

View File

@ -5,6 +5,8 @@ import org.apache.shiro.authz.AuthorizationException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.dao.DuplicateKeyException;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.HttpRequestMethodNotSupportedException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
@ -12,6 +14,8 @@ import org.springframework.web.context.request.ServletWebRequest;
import org.springframework.web.context.request.WebRequest;
import org.springframework.web.servlet.NoHandlerFoundException;
import java.io.IOException;
/**
* 异常处理器
*
@ -65,9 +69,21 @@ public class SqxExceptionHandler {
public Result handleException(Exception e, WebRequest webRequest) {
logErrorInfo(webRequest);
logger.error(e.getMessage(), e);
e.printStackTrace();
return Result.error();
}
@ExceptionHandler(CzgException.class)
public ResponseEntity<Void> handleCzgException() {
// 响应状态码为 444 表示无法处理的异常
return new ResponseEntity<>(HttpStatus.TOO_MANY_REQUESTS);
}
@ExceptionHandler(IOException.class)
public Result handleIoException() {
return Result.error("请求中断,请重试");
}
private void logErrorInfo(WebRequest webRequest) {
if (webRequest instanceof ServletWebRequest) {
ServletWebRequest servletWebRequest = (ServletWebRequest) webRequest;

View File

@ -0,0 +1,233 @@
package com.sqx.common.utils;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
import java.util.UUID;
import java.util.function.Supplier;
/**
* 接口访问次数 月为单位
*/
@Component
@Slf4j
public class ApiAccessLimitUtil {
private static final String ACCESS_COUNT_KEY_PREFIX = "sys:limit:";
private static RedisUtils redisUtils;
private static final int DEFAULT_ACCESS_COUNT = 5;
private static final String DATE_TIME_FORMAT = "month";
@Autowired
public void setRedisUtils(RedisUtils redisUtils) {
ApiAccessLimitUtil.redisUtils = redisUtils;
}
/**
* 默认 当月5次
*
* @param id 唯一值
* @param key 接口名称 sys:limit:接口名称
* @return
*/
public static boolean isAccessAllowed(String id, String key) {
String redisKey = generateRedisKey(key, id);
Object countObj = redisUtils.get(redisKey);
if (countObj == null) {
// 根据不同时间周期设置过期时间并初始化访问次数为1
long expireAt = calculateExpireAt(DATE_TIME_FORMAT);
redisUtils.set(redisKey, 1, expireAt);
return true;
}
if ((int) countObj < DEFAULT_ACCESS_COUNT) {
// 访问次数未达上限次数加1
redisUtils.incr(redisKey);
return true;
}
return false;
}
/**
* 默认月 month//自然月
*
* @param id 唯一值
* @param key 接口名称 sys:limit:接口名称
* @param count 次数限制
* @return
*/
public static boolean isAccessAllowed(String id, String key, Integer count) {
String redisKey = generateRedisKey(key, id);
Object countObj = redisUtils.get(redisKey);
if (countObj == null) {
// 根据不同时间周期设置过期时间并初始化访问次数为1
long expireAt = calculateExpireAt(DATE_TIME_FORMAT);
redisUtils.set(redisKey, 1, expireAt);
return true;
}
if ((int) countObj < count) {
// 访问次数未达上限次数加1
redisUtils.incr(redisKey);
return true;
}
return false;
}
/**
* 默认 5次
*
* @param id 唯一值
* @param key 接口名称 sys:limit:接口名称
* @param timeFormat day//自然天 week//本周日 month//自然月 year//自然年
* @return
*/
public static boolean isAccessAllowed(String id, String key, String timeFormat) {
String redisKey = generateRedisKey(key, id);
Object countObj = redisUtils.get(redisKey);
if (countObj == null) {
// 根据不同时间周期设置过期时间并初始化访问次数为1
long expireAt = calculateExpireAt(timeFormat);
redisUtils.set(redisKey, 1, expireAt);
return true;
}
if ((int) countObj < DEFAULT_ACCESS_COUNT) {
// 访问次数未达上限次数加1
redisUtils.incr(redisKey);
return true;
}
return false;
}
/**
* @param id 唯一值
* @param key 接口名称 sys:limit:接口名称
* @param count 次数限制
* @param timeFormat day//自然天 week//本周日 month//自然月 year//自然年
* @return
*/
public static boolean isAccessAllowed(String id, String key, Integer count, String timeFormat) {
String redisKey = generateRedisKey(key, id);
Object countObj = redisUtils.get(redisKey);
if (countObj == null) {
long expireAt;
if (StrUtil.isBlank(timeFormat)) {
expireAt = count;
} else {
// 根据不同时间周期设置过期时间并初始化访问次数为1
expireAt = calculateExpireAt(timeFormat);
}
redisUtils.set(redisKey, 1, expireAt);
return true;
}
if (Integer.parseInt(countObj.toString()) < count) {
// 访问次数未达上限次数加1
redisUtils.incr(redisKey);
return true;
}
return false;
}
public static boolean getCertAuthIsAccessAllowed(String id, String key, Integer count) {
String redisKey = "app:updateLimit:auth:" + key + ":" + id;
Object countObj = redisUtils.get(redisKey);
if (countObj == null) {
return true;
}
return Integer.parseInt(countObj.toString()) < count;
}
public static void setCertAuthIsAccessAllowed(String id, String key, Integer count, String timeFormat) {
String redisKey = "app:updateLimit:auth:" + key + ":" + id;
Object countObj = redisUtils.get(redisKey);
if (countObj == null) {
long expireAt;
if (StrUtil.isBlank(timeFormat)) {
expireAt = count;
} else {
// 根据不同时间周期设置过期时间并初始化访问次数为1
expireAt = calculateExpireAt(timeFormat);
}
redisUtils.set(redisKey, 1, expireAt);
} else {
redisUtils.incr(redisKey);
}
}
public static void removeKey(String id, String key) {
String redisKey = generateRedisKey(key, id);
redisUtils.delete(redisKey);
}
public static <T> T runFunAndCheckKey(Supplier<T> supplier, String lockKey, Integer seconds) {
try {
// 创建线程id, 用作判断
String clientId = UUID.randomUUID().toString();
// 设置分布式锁
boolean lock = Boolean.TRUE.equals(redisUtils.setIfAbsent(lockKey, clientId, seconds));
int count = 0;
while (!lock) {
if (count++ > 100) {
throw new RuntimeException("系统繁忙, 稍后再试");
}
Thread.sleep(20);
lock = Boolean.TRUE.equals(redisUtils.setIfAbsent(lockKey, clientId, seconds));
}
return supplier.get();
} catch (RuntimeException e) {
log.error("执行出错", e);
throw e;
} catch (InterruptedException e) {
throw new RuntimeException(e);
} finally {
redisUtils.delete(lockKey);
}
}
public static boolean isAccessAllowed(String id, String key, Integer count, Integer seconds) {
String redisKey = generateRedisKey(key, id);
Object countObj = redisUtils.get(redisKey);
if (countObj == null) {
// 根据不同时间周期设置过期时间并初始化访问次数为1
redisUtils.set(redisKey, 1, seconds);
return true;
}
if (Integer.parseInt(countObj.toString()) < count) {
// 访问次数未达上限次数加1
redisUtils.incr(redisKey);
return true;
}
return false;
}
private static String generateRedisKey(String key, String id) {
return ACCESS_COUNT_KEY_PREFIX + key + ":" + id;
}
private static long calculateExpireAt(String timePeriod) {
Date now = DateUtil.beginOfDay(DateUtil.date());
Date expireDate = null;
if ("day".equals(timePeriod)) {
expireDate = DateUtil.endOfDay(now);
} else if ("week".equals(timePeriod)) {
expireDate = DateUtil.endOfWeek(now);
} else if ("month".equals(timePeriod)) {
expireDate = DateUtil.endOfMonth(now);
} else if ("year".equals(timePeriod)) {
expireDate = DateUtil.endOfYear(now);
}
long endTimeStamp = DateUtil.endOfDay(expireDate).getTime() / 1000L;
long currentTimeStamp = DateUtil.currentSeconds();
return endTimeStamp - currentTimeStamp;
}
}

View File

@ -0,0 +1,154 @@
package com.sqx.common.utils;
import cn.hutool.core.date.DateUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.Date;
/**
* 数据出现次数
*/
@Component
public class DataLimitUtil {
private static final String ACCESS_COUNT_KEY_PREFIX = "sys:data:";
private static RedisUtils redisUtils;
private static final int DEFAULT_ACCESS_COUNT = 5;
private static final String DATE_TIME_FORMAT = "month";
@Autowired
public void setRedisUtils(RedisUtils redisUtils) {
DataLimitUtil.redisUtils = redisUtils;
}
/**
* 默认 当月5次
*
* @param key 名称 sys:data:名称
* @return
*/
public static boolean isAccessAllowed(String key) {
String redisKey = generateRedisKey(key);
Object countObj = redisUtils.get(redisKey);
if (countObj == null) {
// 根据不同时间周期设置过期时间并初始化访问次数为1
long expireAt = calculateExpireAt(DATE_TIME_FORMAT);
redisUtils.set(redisKey, 1, expireAt);
return true;
}
if ((int) countObj < DEFAULT_ACCESS_COUNT) {
// 访问次数未达上限次数加1
redisUtils.incr(redisKey);
return true;
}
return false;
}
/**
* 默认月 month//自然月
*
* @param key 名称 sys:data:名称
* @param count 次数限制
* @return
*/
public static boolean isAccessAllowed(String key, Integer count) {
String redisKey = generateRedisKey(key);
Object countObj = redisUtils.get(redisKey);
if (countObj == null) {
// 根据不同时间周期设置过期时间并初始化访问次数为1
long expireAt = calculateExpireAt(DATE_TIME_FORMAT);
redisUtils.set(redisKey, 1, expireAt);
return true;
}
if ((int) countObj < count) {
// 访问次数未达上限次数加1
redisUtils.incr(redisKey);
return true;
}
return false;
}
/**
* 默认 5次
*
* @param key 名称 sys:data:名称
* @param timeFormat day//自然天 week//本周日 month//自然月 year//自然年
* @return
*/
public static boolean isAccessAllowed(String key, String timeFormat) {
String redisKey = generateRedisKey(key);
Object countObj = redisUtils.get(redisKey);
if (countObj == null) {
// 根据不同时间周期设置过期时间并初始化访问次数为1
long expireAt = calculateExpireAt(timeFormat);
redisUtils.set(redisKey, 1, expireAt);
return true;
}
if ((int) countObj < DEFAULT_ACCESS_COUNT) {
// 访问次数未达上限次数加1
redisUtils.incr(redisKey);
return true;
}
return false;
}
public static boolean isAllowed(String key, int seconds) {
String redisKey = generateRedisKey(key);
if (!redisUtils.hasKey(key)) {
redisUtils.set(redisKey, 1, seconds);
return true;
}
return false;
}
/**
* @param key 名称 sys:data:名称
* @param count 次数限制
* @param timeFormat day//自然天 week//本周日 month//自然月 year//自然年
* @return
*/
public static boolean isAccessAllowed(String key, Integer count, String timeFormat) {
String redisKey = generateRedisKey(key);
Object countObj = redisUtils.get(redisKey);
if (countObj == null) {
// 根据不同时间周期设置过期时间并初始化访问次数为1
long expireAt = calculateExpireAt(timeFormat);
redisUtils.set(redisKey, 1, expireAt);
return true;
}
if (Integer.parseInt(countObj.toString()) < count) {
// 访问次数未达上限次数加1
redisUtils.incr(redisKey);
return true;
}
return false;
}
private static String generateRedisKey(String key) {
return ACCESS_COUNT_KEY_PREFIX + key;
}
private static long calculateExpireAt(String timePeriod) {
Date now = DateUtil.beginOfDay(DateUtil.date());
Date expireDate = null;
if ("day".equals(timePeriod)) {
expireDate = DateUtil.endOfDay(now);
} else if ("week".equals(timePeriod)) {
expireDate = DateUtil.endOfWeek(now);
} else if ("month".equals(timePeriod)) {
expireDate = DateUtil.endOfMonth(now);
} else if ("year".equals(timePeriod)) {
expireDate = DateUtil.endOfYear(now);
}
long endTimeStamp = DateUtil.endOfDay(expireDate).getTime() / 1000L;
long currentTimeStamp = DateUtil.currentSeconds();
return endTimeStamp - currentTimeStamp;
}
}

View File

@ -1,5 +1,6 @@
package com.sqx.common.utils;
import cn.hutool.core.date.DateUtil;
import org.apache.commons.lang.StringUtils;
import org.joda.time.DateTime;
import org.joda.time.LocalDate;
@ -159,4 +160,17 @@ public class DateUtils {
DateTime dateTime = new DateTime(date);
return dateTime.plusYears(years).toDate();
}
//获取当日剩余秒数
public static long todayAfterSecond() {
Date now = new Date();
// 获取当天结束时间即当天23:59:59对应的Date对象
Date endOfDay = DateUtil.endOfDay(now);
// 计算时间差单位为毫秒
long diffMillis = endOfDay.getTime() - now.getTime();
// 将毫秒转换为秒
long diffSeconds = diffMillis / 1000;
return diffSeconds;
}
}

View File

@ -0,0 +1,364 @@
package com.sqx.common.utils;
import cn.hutool.core.util.CharUtil;
import cn.hutool.core.util.StrUtil;
/**
* 脱敏工具类支持以下类型信息的脱敏自动处理
*
* <ul>
* <li>用户ID</li>
* <li>中文名</li>
* <li>身份证</li>
* <li>座机号</li>
* <li>手机号</li>
* <li>地址</li>
* <li>电子邮件</li>
* <li>密码</li>
* <li>车牌</li>
* <li>银行卡号</li>
* </ul>
*
* @author dazer and neusoft and qiaomu
* @since 5.6.2
*/
public class DesensitizedUtil {
/**
* 支持的脱敏类型枚举
*
* @author dazer and neusoft and qiaomu
*/
public enum DesensitizedType {
/**
* 用户id
*/
USER_ID,
/**
* 中文名
*/
CHINESE_NAME,
/**
* 身份证号
*/
ID_CARD,
/**
* 座机号
*/
FIXED_PHONE,
/**
* 手机号
*/
MOBILE_PHONE,
/**
* 地址
*/
ADDRESS,
/**
* 电子邮件
*/
EMAIL,
/**
* 密码
*/
PASSWORD,
/**
* 中国大陆车牌包含普通车辆新能源车辆
*/
CAR_LICENSE,
/**
* 银行卡
*/
BANK_CARD,
/**
* IPv4地址
*/
IPV4,
/**
* IPv6地址
*/
IPV6,
/**
* 定义了一个first_mask的规则只显示第一个字符
*/
FIRST_MASK
}
/**
* 脱敏使用默认的脱敏策略
* <pre>
* DesensitizedUtil.desensitized("100", DesensitizedUtil.DesensitizedType.USER_ID)) = "0"
* DesensitizedUtil.desensitized("段正淳", DesensitizedUtil.DesensitizedType.CHINESE_NAME)) = "段**"
* DesensitizedUtil.desensitized("51343620000320711X", DesensitizedUtil.DesensitizedType.ID_CARD)) = "5***************1X"
* DesensitizedUtil.desensitized("09157518479", DesensitizedUtil.DesensitizedType.FIXED_PHONE)) = "0915*****79"
* DesensitizedUtil.desensitized("18049531999", DesensitizedUtil.DesensitizedType.MOBILE_PHONE)) = "180****1999"
* DesensitizedUtil.desensitized("北京市海淀区马连洼街道289号", DesensitizedUtil.DesensitizedType.ADDRESS)) = "北京市海淀区马********"
* DesensitizedUtil.desensitized("duandazhi-jack@gmail.com.cn", DesensitizedUtil.DesensitizedType.EMAIL)) = "d*************@gmail.com.cn"
* DesensitizedUtil.desensitized("1234567890", DesensitizedUtil.DesensitizedType.PASSWORD)) = "**********"
* DesensitizedUtil.desensitized("苏D40000", DesensitizedUtil.DesensitizedType.CAR_LICENSE)) = "苏D4***0"
* DesensitizedUtil.desensitized("11011111222233333256", DesensitizedUtil.DesensitizedType.BANK_CARD)) = "1101 **** **** **** 3256"
* DesensitizedUtil.desensitized("192.168.1.1", DesensitizedUtil.DesensitizedType.IPV4)) = "192.*.*.*"
* </pre>
*
* @param str 字符串
* @param desensitizedType 脱敏类型;可以脱敏用户id中文名身份证号座机号手机号地址电子邮件密码
* @return 脱敏之后的字符串
* @author dazer and neusoft and qiaomu
* @since 5.6.2
*/
public static String desensitized(CharSequence str, DesensitizedUtil.DesensitizedType desensitizedType) {
if (StrUtil.isBlank(str)) {
return StrUtil.EMPTY;
}
String newStr = String.valueOf(str);
switch (desensitizedType) {
case USER_ID:
newStr = String.valueOf(userId());
break;
case CHINESE_NAME:
newStr = chineseName(String.valueOf(str));
break;
case ID_CARD:
newStr = idCardNum(String.valueOf(str), 1, 2);
break;
case FIXED_PHONE:
newStr = fixedPhone(String.valueOf(str));
break;
case MOBILE_PHONE:
newStr = mobilePhone(String.valueOf(str));
break;
case ADDRESS:
newStr = address(String.valueOf(str), 8);
break;
case EMAIL:
newStr = email(String.valueOf(str));
break;
case PASSWORD:
newStr = password(String.valueOf(str));
break;
case CAR_LICENSE:
newStr = carLicense(String.valueOf(str));
break;
case BANK_CARD:
newStr = bankCard(String.valueOf(str));
break;
case IPV4:
newStr = ipv4(String.valueOf(str));
break;
case IPV6:
newStr = ipv6(String.valueOf(str));
break;
case FIRST_MASK:
newStr = firstMask(String.valueOf(str));
break;
default:
}
return newStr;
}
/**
* 用户id不对外提供userId
*
* @return 脱敏后的主键
*/
public static Long userId() {
return 0L;
}
/**
* 定义了一个first_mask的规则只显示第一个字符<br>
* 脱敏前123456789脱敏后1********
*
* @param str 字符串
* @return 脱敏后的字符串
*/
public static String firstMask(String str) {
if (StrUtil.isBlank(str)) {
return StrUtil.EMPTY;
}
return StrUtil.hide(str, 1, str.length());
}
/**
* 中文姓名只显示第一个汉字其他隐藏为2个星号比如**
*
* @param fullName 姓名
* @return 脱敏后的姓名
*/
public static String chineseName(String fullName) {
return firstMask(fullName);
}
/**
* 身份证号前1位 和后2位
*
* @param idCardNum 身份证
* @param front 保留前面的front位数从1开始
* @param end 保留后面的end位数从1开始
* @return 脱敏后的身份证
*/
public static String idCardNum(String idCardNum, int front, int end) {
//身份证不能为空
if (StrUtil.isBlank(idCardNum)) {
return StrUtil.EMPTY;
}
//需要截取的长度不能大于身份证号长度
if ((front + end) > idCardNum.length()) {
return StrUtil.EMPTY;
}
//需要截取的不能小于0
if (front < 0 || end < 0) {
return StrUtil.EMPTY;
}
return StrUtil.hide(idCardNum, front, idCardNum.length() - end);
}
/**
* 固定电话 前四位后两位
*
* @param num 固定电话
* @return 脱敏后的固定电话
*/
public static String fixedPhone(String num) {
if (StrUtil.isBlank(num)) {
return StrUtil.EMPTY;
}
return StrUtil.hide(num, 4, num.length() - 2);
}
/**
* 手机号码前三位后4位其他隐藏比如135****2210
*
* @param num 移动电话
* @return 脱敏后的移动电话
*/
public static String mobilePhone(String num) {
if (StrUtil.isBlank(num)) {
return StrUtil.EMPTY;
}
return StrUtil.hide(num, 3, num.length() - 4);
}
/**
* 地址只显示到地区不显示详细地址比如北京市海淀区****
*
* @param address 家庭住址
* @param sensitiveSize 敏感信息长度
* @return 脱敏后的家庭地址
*/
public static String address(String address, int sensitiveSize) {
if (StrUtil.isBlank(address)) {
return StrUtil.EMPTY;
}
int length = address.length();
return StrUtil.hide(address, length - sensitiveSize, length);
}
/**
* 电子邮箱邮箱前缀仅显示第一个字母前缀其他隐藏用星号代替@及后面的地址显示比如d**@126.com
*
* @param email 邮箱
* @return 脱敏后的邮箱
*/
public static String email(String email) {
if (StrUtil.isBlank(email)) {
return StrUtil.EMPTY;
}
int index = StrUtil.indexOf(email, '@');
if (index <= 1) {
return email;
}
return StrUtil.hide(email, 1, index);
}
/**
* 密码密码的全部字符都用*代替比如******
*
* @param password 密码
* @return 脱敏后的密码
*/
public static String password(String password) {
if (StrUtil.isBlank(password)) {
return StrUtil.EMPTY;
}
return StrUtil.repeat('*', password.length());
}
/**
* 中国车牌车牌中间用*代替
* eg1null - ""
* eg1"" - ""
* eg3苏D40000 - 苏D4***0
* eg4陕A12345D - 陕A1****D
* eg5京A123 - 京A123 如果是错误的车牌不处理
*
* @param carLicense 完整的车牌号
* @return 脱敏后的车牌
*/
public static String carLicense(String carLicense) {
if (StrUtil.isBlank(carLicense)) {
return StrUtil.EMPTY;
}
// 普通车牌
if (carLicense.length() == 7) {
carLicense = StrUtil.hide(carLicense, 3, 6);
} else if (carLicense.length() == 8) {
// 新能源车牌
carLicense = StrUtil.hide(carLicense, 3, 7);
}
return carLicense;
}
/**
* 银行卡号脱敏
* eg: 1101 **** **** **** 3256
*
* @param bankCardNo 银行卡号
* @return 脱敏之后的银行卡号
* @since 5.6.3
*/
public static String bankCard(String bankCardNo) {
if (StrUtil.isBlank(bankCardNo)) {
return bankCardNo;
}
bankCardNo = StrUtil.trim(bankCardNo);
if (bankCardNo.length() < 9) {
return bankCardNo;
}
final int length = bankCardNo.length();
final int midLength = length - 8;
final StringBuilder buf = new StringBuilder();
buf.append(bankCardNo, 0, 4);
for (int i = 0; i < midLength; ++i) {
if (i % 4 == 0) {
buf.append(CharUtil.SPACE);
}
buf.append('*');
}
buf.append(CharUtil.SPACE).append(bankCardNo, length - 4, length);
return buf.toString();
}
/**
* IPv4脱敏脱敏前192.0.2.1脱敏后192.*.*.*
*
* @param ipv4 IPv4地址
* @return 脱敏后的地址
*/
public static String ipv4(String ipv4) {
return StrUtil.subBefore(ipv4, '.', false) + ".*.*.*";
}
/**
* IPv4脱敏脱敏前2001:0db8:86a3:08d3:1319:8a2e:0370:7344脱敏后2001:*:*:*:*:*:*:*
*
* @param ipv6 IPv4地址
* @return 脱敏后的地址
*/
public static String ipv6(String ipv6) {
return StrUtil.subBefore(ipv6, ':', false) + ":*:*:*:*:*:*:*";
}
}

View File

@ -1,6 +1,6 @@
package com.sqx.common.utils;
import com.alibaba.druid.util.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

View File

@ -1,101 +1,120 @@
package com.sqx.common.utils;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.pagehelper.PageInfo;
import java.io.Serializable;
import java.util.List;
/**
* 分页工具类
*
*/
public class PageUtils implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 总记录数
*/
private int totalCount;
/**
* 每页记录数
*/
private int pageSize;
/**
* 总页数
*/
private int totalPage;
/**
* 当前页数
*/
private int currPage;
/**
* 列表数据
*/
private List<?> list;
/**
* 分页
* @param list 列表数据
* @param totalCount 总记录数
* @param pageSize 每页记录数
* @param currPage 当前页数
*/
public PageUtils(List<?> list, int totalCount, int pageSize, int currPage) {
this.list = list;
this.totalCount = totalCount;
this.pageSize = pageSize;
this.currPage = currPage;
this.totalPage = (int)Math.ceil((double)totalCount/pageSize);
}
private static final long serialVersionUID = 1L;
/**
* 总记录数
*/
private int totalCount;
/**
* 每页记录数
*/
private int pageSize;
/**
* 总页数
*/
private int totalPage;
/**
* 当前页数
*/
private int currPage;
/**
* 列表数据
*/
private List<?> list;
private List<?> records;
/**
* 分页
*/
public PageUtils(IPage<?> page) {
this.list = page.getRecords();
this.totalCount = (int)page.getTotal();
this.pageSize = (int)page.getSize();
this.currPage = (int)page.getCurrent();
this.totalPage = (int)page.getPages();
}
public int getTotalCount() {
return totalCount;
}
public PageUtils() {
}
public void setTotalCount(int totalCount) {
this.totalCount = totalCount;
}
/**
* 分页
*
* @param list 列表数据
* @param totalCount 总记录数
* @param pageSize 每页记录数
* @param currPage 当前页数
*/
public PageUtils(List<?> list, int totalCount, int pageSize, int currPage) {
this.list = list;
this.totalCount = totalCount;
this.pageSize = pageSize;
this.currPage = currPage;
this.totalPage = (int) Math.ceil((double) totalCount / pageSize);
}
public int getPageSize() {
return pageSize;
}
public static PageUtils page(PageInfo<?> page) {
return page(page,false);
}
public void setPageSize(int pageSize) {
this.pageSize = pageSize;
}
public static PageUtils page(PageInfo<?> page, boolean isRecords) {
PageUtils pageUtils = new PageUtils();
if (isRecords) {
pageUtils.records = page.getList();
} else {
pageUtils.list = page.getList();
}
pageUtils.totalCount = (int) page.getTotal();
pageUtils.pageSize = page.getSize();
pageUtils.currPage = page.getPageNum();
pageUtils.totalPage = page.getPages();
return pageUtils;
}
public int getTotalPage() {
return totalPage;
}
public int getTotalCount() {
return totalCount;
}
public void setTotalPage(int totalPage) {
this.totalPage = totalPage;
}
public void setTotalCount(int totalCount) {
this.totalCount = totalCount;
}
public int getCurrPage() {
return currPage;
}
public int getPageSize() {
return pageSize;
}
public void setCurrPage(int currPage) {
this.currPage = currPage;
}
public void setPageSize(int pageSize) {
this.pageSize = pageSize;
}
public List<?> getList() {
return list;
}
public int getTotalPage() {
return totalPage;
}
public void setList(List<?> list) {
this.list = list;
}
public void setTotalPage(int totalPage) {
this.totalPage = totalPage;
}
public int getCurrPage() {
return currPage;
}
public void setCurrPage(int currPage) {
this.currPage = currPage;
}
public List<?> getList() {
return list;
}
public void setList(List<?> list) {
this.list = list;
}
public List<?> getRecords() {
return records;
}
public void setRecords(List<?> records) {
this.records = records;
}
}

View File

@ -1,68 +0,0 @@
package com.sqx.common.utils;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.metadata.OrderItem;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sqx.common.xss.SQLFilter;
import org.apache.commons.lang.StringUtils;
import java.util.Map;
/**
* 查询参数
*
*/
public class Query<T> {
public IPage<T> getPage(Map<String, Object> params) {
return this.getPage(params, null, false);
}
public IPage<T> getPage(Map<String, Object> params, String defaultOrderField, boolean isAsc) {
//分页参数
long curPage = 1;
long limit = 10;
if(params.get(Constant.PAGE) != null){
curPage = Long.parseLong(String.valueOf(params.get(Constant.PAGE)));
}
if(params.get(Constant.LIMIT) != null){
limit = Long.parseLong(String.valueOf(params.get(Constant.LIMIT)));
}
//分页对象
Page<T> page = new Page<>(curPage, limit);
//分页参数
params.put(Constant.PAGE, page);
//排序字段
//防止SQL注入因为sidxorder是通过拼接SQL实现排序的会有SQL注入风险
String orderField = SQLFilter.sqlInject((String)params.get(Constant.ORDER_FIELD));
String order = (String)params.get(Constant.ORDER);
//前端字段排序
if(StringUtils.isNotEmpty(orderField) && StringUtils.isNotEmpty(order)){
if(Constant.ASC.equalsIgnoreCase(order)) {
return page.addOrder(OrderItem.asc(orderField));
}else {
return page.addOrder(OrderItem.desc(orderField));
}
}
//没有排序字段则不排序
if(StringUtils.isBlank(defaultOrderField)){
return page;
}
//默认排序
if(isAsc) {
page.addOrder(OrderItem.asc(defaultOrderField));
}else {
page.addOrder(OrderItem.desc(defaultOrderField));
}
return page;
}
}

View File

@ -1,12 +1,54 @@
package com.sqx.common.utils;
import cn.hutool.core.date.DateUtil;
/**
* Redis所有Keys
*
*/
public class RedisKeys {
public static final String FREE_WATCH_KEY = "free:watch:";
public static final String LOCK_KEY = "SYS:LOCK:";
public static final String RATE_LIMIT = "RATE:z";
public static String getSysConfigKey(String key){
return "sys:config:" + key;
}
public static String getDateKey(String key){
return "date:" + key;
}
public static String getFreeWatchKey(Long userId, boolean isPermanently) {
if (isPermanently) {
return FREE_WATCH_KEY + userId;
}
return FREE_WATCH_KEY + DateUtil.today() + ":" + userId;
}
public static void main(String[] args) {
System.out.println(DateUtil.today());
}
public static String getLockKey(String sign, Object... args) {
StringBuilder key = new StringBuilder(LOCK_KEY + ":" + sign + ":");
for (Object arg : args) {
if (arg != null) {
key.append(":").append(arg);
}
}
return key.toString();
}
public static String getUserIpRateKey(long userId, String ip) {
return RATE_LIMIT + "user:" + userId + ":ip:" + ip;
}
public static String getUserUrlRateKey(long userId, String url) {
return RATE_LIMIT + "user:" + userId + ":url:" + url;
}
}

View File

@ -1,18 +1,29 @@
package com.sqx.common.utils;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.gson.Gson;
import com.sqx.modules.redisService.RedisService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.*;
import org.springframework.stereotype.Component;
import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles;
import java.lang.invoke.MethodType;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
/**
* Redis工具类
*
*/
@Component
public class RedisUtils {
@Autowired
private RedisService redisService;
@Autowired
private RedisTemplate<String, Object> redisTemplate;
@Autowired
@ -25,38 +36,169 @@ public class RedisUtils {
private SetOperations<String, Object> setOperations;
@Autowired
private ZSetOperations<String, Object> zSetOperations;
/** 默认过期时长,单位:秒 */
/**
* 默认过期时长单位
*/
public final static long DEFAULT_EXPIRE = 60 * 60 * 24;
/** 不设置过期时长 */
/**
* 不设置过期时长
*/
public final static long NOT_EXPIRE = -1;
private final static Gson Gson = new Gson();
public void set(String key, Object value, long expire){
valueOperations.set(key, toJson(value));
if(expire != NOT_EXPIRE){
redisTemplate.expire(key, expire, TimeUnit.SECONDS);
public <T> Map<String, List<T>> getMapData(String key, String method, Class<T> clazz) {
String jsonStr = getDate(key, method);
ObjectMapper objectMapper = new ObjectMapper();
try {
JsonNode jsonNode = objectMapper.readTree(jsonStr);
return jsonNodeToMap(jsonNode, clazz);
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
public void set(String key, Object value){
public <T> List<T> getListData(String key, Class<T> clazz, String method) {
String jsonStr = getDate(key, method);
ObjectMapper objectMapper = new ObjectMapper();
try {
// 将JSON字符串转换为List<T>
return objectMapper.readValue(jsonStr, objectMapper.getTypeFactory().constructCollectionType(List.class, clazz));
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
/**
* 获取缓存里的数据 如果不存在 则插入 并返回
*
* @param key redis Key
* @param clazz 返回类型
* @param method RedisService调用的方法名 如果数据不存在会执行该调用方法
*/
public <T> T getObjectDate(String key, Class<T> clazz, String method) {
String jsonStr = getDate(key, method);
return this.fromJson(jsonStr, clazz);
}
public <T> T getObjectDate(String key, Class<T> clazz) {
String jsonStr = get(key);
return this.fromJson(jsonStr, clazz);
}
public String getDate(String key, String method) {
if (!this.hasKey(key)) {
try {
// 获取Lookup对象
MethodHandles.Lookup lookup = MethodHandles.lookup();
// 构建方法类型这里假设方法无参数返回类型为void
MethodType methodType = MethodType.methodType(void.class, String.class);
// 获取方法句柄
MethodHandle methodHandle = lookup.findVirtual(redisService.getClass(), method, methodType);
// 调用方法句柄
methodHandle.invoke(redisService, key);
} catch (Exception e) {
e.printStackTrace();
return null;
} catch (Throwable e) {
throw new RuntimeException(e);
}
}
return this.get(key);
}
public boolean hasKey(String key) {
return redisTemplate.hasKey(key);
}
public void set(String key, Object value, long expire) {
valueOperations.set(key, toJson(value));
if (expire != NOT_EXPIRE) {
redisTemplate.expire(key, expire, TimeUnit.SECONDS);
}
}
public boolean setIfAbsent(String key, Object value, long expire){
Boolean absent = valueOperations.setIfAbsent(key, toJson(value));
if (Boolean.FALSE.equals(absent)) {
return false;
}
if(expire != NOT_EXPIRE){
redisTemplate.expire(key, expire, TimeUnit.SECONDS);
}
return true;
}
public void set(String key, Object value) {
set(key, value, DEFAULT_EXPIRE);
}
public void expire(String key, long seconds){
redisTemplate.expire(key, seconds, TimeUnit.SECONDS);
}
public <T> T get(String key, Class<T> clazz, long expire) {
String value = valueOperations.get(key);
if(expire != NOT_EXPIRE){
if (expire != NOT_EXPIRE) {
redisTemplate.expire(key, expire, TimeUnit.SECONDS);
}
return value == null ? null : fromJson(value, clazz);
}
// 判断键是否设置了过期时间
public boolean isExpiredSet(String key) {
// 获取过期时间单位是秒
Long expireTime = redisTemplate.getExpire(key);
if (expireTime == null) {
return false; // 如果返回 null表示键不存在
}
return expireTime != -1; // 如果是 -1说明没有设置过期时间
}
public Long getExpire(String key) {
Long currentExpireTime = redisTemplate.getExpire(key);
if (currentExpireTime == null || currentExpireTime == -2 || currentExpireTime == -1) {
return null;
}
return currentExpireTime;
}
// 累加过期时间
public boolean extendExpireTime(String key, long additionalTimeInSeconds) {
// 获取当前键的剩余过期时间单位
Long currentExpireTime = redisTemplate.getExpire(key);
if (currentExpireTime == null || currentExpireTime == -2) {
// 键不存在或已经过期无法进行累加
return false;
}
if (currentExpireTime == -1) {
redisTemplate.expire(key, additionalTimeInSeconds, java.util.concurrent.TimeUnit.SECONDS);
}
// 累加剩余过期时间和新增时间
long newExpireTime = currentExpireTime + additionalTimeInSeconds;
// 设置新的过期时间
return Boolean.TRUE.equals(redisTemplate.expire(key, newExpireTime, TimeUnit.SECONDS));
}
public <T> T get(String key, Class<T> clazz) {
return get(key, clazz, NOT_EXPIRE);
}
public String get(String key, long expire) {
String value = valueOperations.get(key);
if(expire != NOT_EXPIRE){
if (expire != NOT_EXPIRE) {
redisTemplate.expire(key, expire, TimeUnit.SECONDS);
}
return value;
@ -66,6 +208,21 @@ public class RedisUtils {
return get(key, NOT_EXPIRE);
}
/**
* 对指定的键执行自增操作返回自增后的值
*
* @param key 要自增的键
* @return 自增后的值如果键不存在则初始化为1后返回1如果出现异常返回null
*/
public Long incr(String key) {
try {
return redisTemplate.opsForValue().increment(key);
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
public void delete(String key) {
redisTemplate.delete(key);
}
@ -73,9 +230,9 @@ public class RedisUtils {
/**
* Object转成JSON数据
*/
private String toJson(Object object){
if(object instanceof Integer || object instanceof Long || object instanceof Float ||
object instanceof Double || object instanceof Boolean || object instanceof String){
private String toJson(Object object) {
if (object instanceof Integer || object instanceof Long || object instanceof Float ||
object instanceof Double || object instanceof Boolean || object instanceof String) {
return String.valueOf(object);
}
return Gson.toJson(object);
@ -84,7 +241,25 @@ public class RedisUtils {
/**
* JSON数据转成Object
*/
private <T> T fromJson(String json, Class<T> clazz){
private <T> T fromJson(String json, Class<T> clazz) {
return Gson.fromJson(json, clazz);
}
public <T> Map<String, List<T>> jsonNodeToMap(JsonNode jsonNode, Class<T> clazz) {
Map<String, List<T>> resultMap = new HashMap<>();
ObjectMapper objectMapper = new ObjectMapper();
if (jsonNode.isObject()) {
// 获取字段名也就是键的迭代器
Iterator<String> fieldNames = jsonNode.fieldNames();
while (fieldNames.hasNext()) {
String key = fieldNames.next();
JsonNode elementNode = jsonNode.get(key);
resultMap.put(key, objectMapper.convertValue(elementNode,
objectMapper.getTypeFactory().constructCollectionType(List.class, clazz)));
}
}
return resultMap;
}
}

View File

@ -0,0 +1,52 @@
package com.sqx.common.utils;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.reflect.MethodSignature;
import org.springframework.core.DefaultParameterNameDiscoverer;
import org.springframework.expression.EvaluationContext;
import org.springframework.expression.Expression;
import org.springframework.expression.spel.standard.SpelExpressionParser;
import org.springframework.expression.spel.support.StandardEvaluationContext;
import java.lang.reflect.Method;
public class SpelUtil {
/**
* 用于SpEL表达式解析.
*/
private static final SpelExpressionParser parser = new SpelExpressionParser();
/**
* 用于获取方法参数定义名字.
*/
private static final DefaultParameterNameDiscoverer nameDiscoverer = new DefaultParameterNameDiscoverer();
/**
* 解析SpEL表达式
*
* @param spELStr
* @param joinPoint
* @return
*/
public static String generateKeyBySpEL(String spELStr, ProceedingJoinPoint joinPoint) {
// 通过joinPoint获取被注解方法
MethodSignature methodSignature = (MethodSignature) joinPoint.getSignature();
Method method = methodSignature.getMethod();
// 使用Spring的DefaultParameterNameDiscoverer获取方法形参名数组
String[] paramNames = nameDiscoverer.getParameterNames(method);
// // 解析过后的Spring表达式对象
Expression expression = parser.parseExpression(spELStr);
// Spring的表达式上下文对象
EvaluationContext context = new StandardEvaluationContext();
// 通过joinPoint获取被注解方法的形参
Object[] args = joinPoint.getArgs();
// 给上下文赋值
for (int i = 0; i < args.length; i++) {
context.setVariable(paramNames[i], args[i]);
}
if(expression.getValue(context)==null){
return "";
}
return expression.getValue(context).toString();
}
}

View File

@ -23,6 +23,11 @@ public class SpringContextUtils implements ApplicationContextAware {
return applicationContext.getBean(name);
}
public static Object getSpringBean(Class<?> clazz) {
return applicationContext == null ? null : applicationContext.getBean(clazz);
}
public static <T> T getBean(String name, Class<T> requiredType) {
return applicationContext.getBean(name, requiredType);
}

View File

@ -1,12 +1,20 @@
package com.sqx.config;
import com.sqx.common.utils.RedisUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.CacheManager;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.cache.RedisCacheConfiguration;
import org.springframework.data.redis.cache.RedisCacheManager;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.core.*;
import org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer;
import org.springframework.data.redis.serializer.RedisSerializationContext;
import org.springframework.data.redis.serializer.StringRedisSerializer;
import java.time.Duration;
/**
* Redis配置
*
@ -16,6 +24,18 @@ public class RedisConfig {
@Autowired
private RedisConnectionFactory factory;
@Bean
public CacheManager cacheManager(RedisConnectionFactory redisConnectionFactory) {
RedisCacheConfiguration cacheConfiguration = RedisCacheConfiguration.defaultCacheConfig().entryTtl(Duration.ofMinutes(30))
// 设置缓存过期时间为30分钟
.serializeKeysWith(RedisSerializationContext.SerializationPair.fromSerializer(new StringRedisSerializer()))
.serializeValuesWith(RedisSerializationContext.SerializationPair.fromSerializer(new GenericJackson2JsonRedisSerializer()))
.disableCachingNullValues();
return RedisCacheManager.builder(redisConnectionFactory)
.cacheDefaults(cacheConfiguration)
.build();
}
@Bean
public RedisTemplate<String, Object> redisTemplate() {
RedisTemplate<String, Object> redisTemplate = new RedisTemplate<>();
@ -51,4 +71,10 @@ public class RedisConfig {
public ZSetOperations<String, Object> zSetOperations(RedisTemplate<String, Object> redisTemplate) {
return redisTemplate.opsForZSet();
}
@Bean
public RedisUtils redisUtils() {
// 根据实际情况初始化RedisUtils实例可能需要传入相关配置参数如Redis连接信息等
return new RedisUtils();
}
}

View File

@ -0,0 +1,242 @@
package com.sqx.config;
import com.sqx.modules.utils.InvitationCodeUtil;
import com.sqx.sharding.MasterSlaveRules;
import com.sqx.sharding.ShardingDataBase;
import com.sqx.sharding.StandardShardingStrategyConf;
import com.zaxxer.hikari.HikariConfig;
import com.zaxxer.hikari.HikariDataSource;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.shardingsphere.api.config.masterslave.MasterSlaveRuleConfiguration;
import org.apache.shardingsphere.api.config.sharding.KeyGeneratorConfiguration;
import org.apache.shardingsphere.api.config.sharding.ShardingRuleConfiguration;
import org.apache.shardingsphere.api.config.sharding.TableRuleConfiguration;
import org.apache.shardingsphere.api.config.sharding.strategy.InlineShardingStrategyConfiguration;
import org.apache.shardingsphere.api.config.sharding.strategy.StandardShardingStrategyConfiguration;
import org.apache.shardingsphere.core.strategy.route.standard.StandardShardingStrategy;
import org.apache.shardingsphere.shardingjdbc.api.ShardingDataSourceFactory;
import org.codehaus.groovy.util.StringUtil;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import javax.sql.DataSource;
import java.sql.SQLException;
import java.util.*;
/**
* sharding-jdbc 配置文件
*/
@Slf4j
@Data
@Configuration
@ConfigurationProperties(prefix = "spring.shardingsphere")
public class ShardingConfig {
/**
* 读取数据源信息
*/
private Map<String, ShardingDataBase> datasource;
/**
* 读写分离的配置
*/
private Map<String, MasterSlaveRules> masterSlaveRules;
/**
* 显示sharding-jdbc的sql
*/
private String showSql;
/**
* 广播表
*/
// private Set<String> broadcastTables;
/**
* 中心库的节点
*/
private String centerTablesDataNode;
/**
* 中心表,不进行分库操作
*/
private Set<String> centerTables;
/**
* 区域库的节点
*/
private String regionTablesDataNode;
/**
* 区域表分库策略的字段
*/
private String regionTablesShardingDatabaseColumn;
/**
* 区域表分库的算法
*/
private String regionTablesShardingDatabaseAlgorithm;
/**
* 分库表,通过userId进行分库
*/
private Set<String> regionTables;
/**
* 区域表分库策略的字段
*/
private String courseDetailsShardingDatabaseColumn;
/**
* 区域表分库的算法
*/
private String courseDetailsShardingDatabaseAlgorithm;
/**
* 分库表,通过userId进行分库
*/
private Set<String> courseDetails;
/**
* 配置sharding-jdbc数据源
*/
@Bean
public DataSource dataSource() throws SQLException {
ShardingRuleConfiguration shardingRuleConfig = new ShardingRuleConfiguration();
// 配置数据库主从
shardingRuleConfig.setMasterSlaveRuleConfigs(masterSlaveRuleConfigs());
// 配置广播表
// shardingRuleConfig.setBroadcastTables(broadcastTables);
// 配置表的切分策略
shardingRuleConfig.setTableRuleConfigs(addTableRuleConfigs());
// 配置表绑定规则
List<Set<String>> sets = new ArrayList<>();
sets.add(regionTables);
shardingRuleConfig.setBindingTableGroups(bindingTableGroups(sets));
// 配置是否显示sql
Properties props = new Properties();
props.put("sql.show", showSql);
// 配置数据源
Map<String, DataSource> dataSourceMap = getShardingDataBase();
return ShardingDataSourceFactory.createDataSource(dataSourceMap, shardingRuleConfig, props);
}
/**
* 配置
*/
private Set<TableRuleConfiguration> addTableRuleConfigs() {
Set<TableRuleConfiguration> sets = new HashSet<>();
for (String centerTable : centerTables) {
TableRuleConfiguration tableRuleConfig = new TableRuleConfiguration(centerTable,
String.format(centerTablesDataNode, centerTable));
sets.add(tableRuleConfig);
}
// 定义区域表的分库规则
StandardShardingStrategyConfiguration databaseShardingStrategyConfig = new StandardShardingStrategyConfiguration(
regionTablesShardingDatabaseColumn, new StandardShardingStrategyConf());
// InlineShardingStrategyConfiguration databaseShardingStrategyConfig = new InlineShardingStrategyConfiguration(
// regionTablesShardingDatabaseColumn, regionTablesShardingDatabaseAlgorithm);
for (String regionTable : regionTables) {
TableRuleConfiguration tableRuleConfig = new TableRuleConfiguration(regionTable, String.format(regionTablesDataNode, regionTable));
tableRuleConfig.setDatabaseShardingStrategyConfig(databaseShardingStrategyConfig);
sets.add(tableRuleConfig);
}
// 定义区域表的分库规则
StandardShardingStrategyConfiguration courseDetailsShardingStrategyConfig = new StandardShardingStrategyConfiguration(
courseDetailsShardingDatabaseColumn, new StandardShardingStrategyConf());
for (String regionTable : courseDetails) {
TableRuleConfiguration tableRuleConfig = new TableRuleConfiguration(regionTable, String.format(regionTablesDataNode, regionTable));
tableRuleConfig.setDatabaseShardingStrategyConfig(courseDetailsShardingStrategyConfig);
// 设置区域表使用雪花算法生成主键
KeyGeneratorConfiguration keyGeneratorConfig = new KeyGeneratorConfiguration("SNOWFLAKE", "id");
tableRuleConfig.setKeyGeneratorConfig(keyGeneratorConfig);
sets.add(tableRuleConfig);
}
return sets;
}
/**
* 配置数据源
*/
private Map<String, DataSource> getShardingDataBase() {
String testQuery = "SELECT 1";
Map<String, DataSource> map = new HashMap<>();
datasource.forEach((datasourceName, shardingDataBase) -> {
HikariConfig config = new HikariConfig();
config.setDriverClassName(shardingDataBase.getDriverClassName());
config.setJdbcUrl(shardingDataBase.getJdbcUrl());
config.setUsername(shardingDataBase.getUsername());
config.setPassword(shardingDataBase.getPassword());
config.setPoolName(datasourceName);
config.setMinimumIdle(shardingDataBase.getMinimumIdle());
config.setMaximumPoolSize(shardingDataBase.getMaximumPoolSize());
config.setIdleTimeout(shardingDataBase.getIdleTimeout());
config.setMaxLifetime(shardingDataBase.getMaxLifetime());
config.setConnectionTimeout(shardingDataBase.getConnectionTimeout());
config.setConnectionTestQuery(testQuery);
map.put(datasourceName, new HikariDataSource(config));
});
return map;
}
/**
* 配置读写分离
*/
private Set<MasterSlaveRuleConfiguration> masterSlaveRuleConfigs() {
Set<MasterSlaveRuleConfiguration> sets = new HashSet<>();
masterSlaveRules.forEach((databaseName, masterSlaveRules) -> {
MasterSlaveRuleConfiguration masterSlaveRuleConfig = new MasterSlaveRuleConfiguration(databaseName,
masterSlaveRules.getMasterDataSourceName(), masterSlaveRules.getSlaveDataSourceNames());
sets.add(masterSlaveRuleConfig);
});
return sets;
}
/**
* 绑定表的分片规则
*/
public static Set<String> bindingTableGroups(List<Set<String>> sets) {
if (sets != null && !sets.isEmpty()) {
Set<String> tableGroups = new HashSet<>();
for (Set<String> set : sets) {
String tableNames = bindingTable(set.toArray(new String[0]));
if (StringUtils.isNotBlank(tableNames)) {
tableGroups.add(tableNames);
}
}
return tableGroups;
}
return null;
}
/**
* 批量绑定表规则
*
* @param tables 批量绑定的标规则
* @return tableNames
*/
private static String bindingTable(String... tables) {
StringBuilder tableNames = new StringBuilder();
if (tables != null && tables.length != 0) {
for (String table : tables) {
tableNames.append(table).append(",");
}
tableNames.deleteCharAt(tableNames.length() - 1);
}
return tableNames.toString();
}
}

View File

@ -41,22 +41,19 @@ public class ShiroConfig {
shiroFilter.setFilters(filters);
Map<String, String> filterMap = new LinkedHashMap<>();
filterMap.put("/es/**", "anon");
filterMap.put("/uniCallBack/**", "anon");
filterMap.put("/course/synCourse", "anon");
filterMap.put("/webjars/**", "anon");
filterMap.put("/druid/**", "anon");
filterMap.put("/app/**", "anon");
filterMap.put("/activity/**", "anon");
filterMap.put("/banner/**", "anon");
filterMap.put("/courseClassification/selectCourseClassification", "anon");
filterMap.put("/sys/login", "anon");
filterMap.put("/swagger/**", "anon");
filterMap.put("/sys/registered", "anon");
filterMap.put("/alioss/**", "anon");
filterMap.put("/v2/api-docs", "anon");
filterMap.put("/swagger-ui.html", "anon");
filterMap.put("/swagger-resources/**", "anon");
filterMap.put("/captcha.jpg", "anon");
filterMap.put("/aaa.txt", "anon");
filterMap.put("/search/**", "anon");
filterMap.put("/cashOutAudit/batchCashOutOrder", "anon");
filterMap.put("/**", "oauth2");
shiroFilter.setFilterChainDefinitionMap(filterMap);

View File

@ -0,0 +1,114 @@
package com.sqx.config;
/**
* 描述: Twitter的分布式自增ID雪花算法snowflake (Java版)
**/
public class SnowFlake {
/**
* 起始的时间戳
*/
private final static long START_STMP = 1480166465631L;
/**
* 每一部分占用的位数
*/
private final static long SEQUENCE_BIT = 12; //序列号占用的位数
private final static long MACHINE_BIT = 5; //机器标识占用的位数
private final static long DATACENTER_BIT = 5;//数据中心占用的位数
/**
* 每一部分的最大值
*/
private final static long MAX_DATACENTER_NUM = ~(-1L << DATACENTER_BIT);
private final static long MAX_MACHINE_NUM = ~(-1L << MACHINE_BIT);
private final static long MAX_SEQUENCE = ~(-1L << SEQUENCE_BIT);
/**
* 每一部分向左的位移
*/
private final static long MACHINE_LEFT = SEQUENCE_BIT;
private final static long DATACENTER_LEFT = SEQUENCE_BIT + MACHINE_BIT;
private final static long TIMESTMP_LEFT = DATACENTER_LEFT + DATACENTER_BIT;
/**
* 数据中心
*/
private long datacenterId;
/**
* 机器标识
*/
private long machineId;
/**
* 代表了一毫秒内生成的多个id的最新序号
*/
private long sequence = 10000L;
/**
* 上一次时间戳
*/
private long lastStmp = -1L;
public SnowFlake() {
}
public SnowFlake(long datacenterId, long machineId) {
if (datacenterId > MAX_DATACENTER_NUM || datacenterId < 0) {
throw new IllegalArgumentException("datacenterId can't be greater than MAX_DATACENTER_NUM or less than 0");
}
if (machineId > MAX_MACHINE_NUM || machineId < 0) {
throw new IllegalArgumentException("machineId can't be greater than MAX_MACHINE_NUM or less than 0");
}
this.datacenterId = datacenterId;
this.machineId = machineId;
}
/**
* 产生下一个ID
*
* @param ifEvenNum 是否偶数 true 时间不连续全是偶数 时间连续 奇数偶数 false 时间不连续 奇偶都有 所以一般建议用false
*/
public synchronized long nextId(boolean ifEvenNum) {
long currStmp = getNewstmp();
if (currStmp < lastStmp) {
throw new RuntimeException("Clock moved backwards. Refusing to generate id");
}
/**
* 时间不连续出来全是偶数
*/
if (ifEvenNum) {
if (currStmp == lastStmp) {
//相同毫秒内序列号自增
sequence = (sequence + 1) & MAX_SEQUENCE;
//同一毫秒的序列数已经达到最大
if (sequence == 0L) {
currStmp = getNextMill();
}
} else {
//不同毫秒内序列号置为0
sequence = 0L;
}
} else {
//相同毫秒内序列号自增
sequence = (sequence + 1) & MAX_SEQUENCE;
}
lastStmp = currStmp;
return (currStmp - START_STMP) << TIMESTMP_LEFT //时间戳部分
| datacenterId << DATACENTER_LEFT //数据中心部分
| machineId << MACHINE_LEFT //机器标识部分
| sequence; //序列号部分
}
private long getNextMill() {
long mill = getNewstmp();
while (mill <= lastStmp) {
mill = getNewstmp();
}
return mill;
}
private long getNewstmp() {
return System.currentTimeMillis();
}
}

View File

@ -0,0 +1,24 @@
package com.sqx.config;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class SnowFlakeConfig {
/**
* 数据中心
*/
@Value("${snowflake.datacenterId}")
private String datacenterId;
/**
* 机器标识
*/
@Value("${snowflake.machineId}")
private String machineId;
@Bean(name = "snowFlake")
public SnowFlake snowFlake() {
return new SnowFlake(Long.parseLong(datacenterId), Long.parseLong(machineId));
}
}

View File

@ -1,53 +1,85 @@
package com.sqx.config;
import io.swagger.annotations.ApiOperation;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.ApiKey;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
import java.util.List;
import static com.google.common.collect.Lists.newArrayList;
@Configuration
@EnableSwagger2
public class SwaggerConfig implements WebMvcConfigurer {
@Bean
public Docket createRestApi() {
return new Docket(DocumentationType.SWAGGER_2)
.apiInfo(apiInfo())
.select()
//加了ApiOperation注解的类才生成接口文档
.apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class))
//包下的类才生成接口文档
//.apis(RequestHandlerSelectors.basePackage("com.sqx.controller"))
.paths(PathSelectors.any())
.build()
.securitySchemes(security());
}
private ApiInfo apiInfo() {
return new ApiInfoBuilder()
.title("")
.description("sqx-fast文档")
.termsOfServiceUrl("")
.version("3.0.0")
.build();
}
private List<ApiKey> security() {
return newArrayList(
new ApiKey("token", "token", "header")
);
}
}
//package com.sqx.config;
//
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiOperation;
//import org.springframework.beans.factory.annotation.Value;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.context.annotation.Profile;
//import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
//import springfox.documentation.builders.ApiInfoBuilder;
//import springfox.documentation.builders.PathSelectors;
//import springfox.documentation.builders.RequestHandlerSelectors;
//import springfox.documentation.service.ApiInfo;
//import springfox.documentation.service.ApiKey;
//import springfox.documentation.spi.DocumentationType;
//import springfox.documentation.spring.web.plugins.Docket;
//import springfox.documentation.swagger2.annotations.EnableSwagger2;
//
//import java.util.List;
//
//import static com.google.common.collect.Lists.newArrayList;
//
////@Configuration
////@EnableSwagger2
////public class SwaggerConfig implements WebMvcConfigurer {
////
//// @Value("${swagger.enabled}")
//// private boolean enabled;
////
//// @Bean
//// public Docket createRestApi() {
//// return new Docket(DocumentationType.SWAGGER_2)
//// .enable(enabled)
//// .apiInfo(apiInfo())
//// .select()
//// //加了ApiOperation注解的类才生成接口文档
//// .apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class))
//// //包下的类才生成接口文档
//// //.apis(RequestHandlerSelectors.basePackage("com.sqx.controller"))
//// .paths(PathSelectors.any())
//// .build()
//// .securitySchemes(security());
//// }
////
//// private ApiInfo apiInfo() {
//// return new ApiInfoBuilder()
//// .title("")
//// .description("sqx-fast文档")
//// .termsOfServiceUrl("")
//// .version("3.0.0")
//// .build();
//// }
////
//// private List<ApiKey> security() {
//// return newArrayList(
//// new ApiKey("token", "token", "header")
//// );
//// }
////
////}
//
//@Configuration
//@EnableSwagger2
//@Profile({"local", "dev"})
//public class SwaggerConfig {
//
// @Bean
// public Docket api() {
// return new Docket(DocumentationType.SWAGGER_2)
// .apiInfo(apiInfo())
// .select()
// .apis(RequestHandlerSelectors.withClassAnnotation(Api.class))
// .apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class))
// .paths(PathSelectors.any())
// .build();
// }
//
// private ApiInfo apiInfo() {
// return new ApiInfoBuilder()
// .title("悠车位后台API接口文档")
// .description("悠车位服务端后台API接口文档")
// .version("1.0")
// .build();
// }
//}

View File

@ -1,14 +0,0 @@
package com.sqx.datasource.annotation;
import java.lang.annotation.*;
/**
* 多数据源注解
*/
@Target({ElementType.METHOD, ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Inherited
public @interface DataSource {
String value() default "";
}

View File

@ -1,61 +0,0 @@
package com.sqx.datasource.aspect;
import com.sqx.datasource.annotation.DataSource;
import com.sqx.datasource.config.DynamicContextHolder;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.aspectj.lang.reflect.MethodSignature;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.core.Ordered;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
import java.lang.reflect.Method;
/**
* 多数据源切面处理类
*/
@Aspect
@Component
@Order(Ordered.HIGHEST_PRECEDENCE)
public class DataSourceAspect {
protected Logger logger = LoggerFactory.getLogger(getClass());
@Pointcut("@annotation(com.sqx.datasource.annotation.DataSource) " +
"|| @within(com.sqx.datasource.annotation.DataSource)")
public void dataSourcePointCut() {
}
@Around("dataSourcePointCut()")
public Object around(ProceedingJoinPoint point) throws Throwable {
MethodSignature signature = (MethodSignature) point.getSignature();
Class targetClass = point.getTarget().getClass();
Method method = signature.getMethod();
DataSource targetDataSource = (DataSource)targetClass.getAnnotation(DataSource.class);
DataSource methodDataSource = method.getAnnotation(DataSource.class);
if(targetDataSource != null || methodDataSource != null){
String value;
if(methodDataSource != null){
value = methodDataSource.value();
}else {
value = targetDataSource.value();
}
DynamicContextHolder.push(value);
logger.debug("set datasource is {}", value);
}
try {
return point.proceed();
} finally {
DynamicContextHolder.poll();
logger.debug("clean datasource");
}
}
}

View File

@ -1,47 +0,0 @@
package com.sqx.datasource.config;
import java.util.ArrayDeque;
import java.util.Deque;
/**
* 多数据源上下文
*/
public class DynamicContextHolder {
@SuppressWarnings("unchecked")
private static final ThreadLocal<Deque<String>> CONTEXT_HOLDER = new ThreadLocal() {
@Override
protected Object initialValue() {
return new ArrayDeque();
}
};
/**
* 获得当前线程数据源
*
* @return 数据源名称
*/
public static String peek() {
return CONTEXT_HOLDER.get().peek();
}
/**
* 设置当前线程数据源
*
* @param dataSource 数据源名称
*/
public static void push(String dataSource) {
CONTEXT_HOLDER.get().push(dataSource);
}
/**
* 清空当前线程数据源
*/
public static void poll() {
Deque<String> deque = CONTEXT_HOLDER.get();
deque.poll();
if (deque.isEmpty()) {
CONTEXT_HOLDER.remove();
}
}
}

View File

@ -1,15 +0,0 @@
package com.sqx.datasource.config;
import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource;
/**
* 多数据源
*/
public class DynamicDataSource extends AbstractRoutingDataSource {
@Override
protected Object determineCurrentLookupKey() {
return DynamicContextHolder.peek();
}
}

View File

@ -1,53 +0,0 @@
package com.sqx.datasource.config;
import com.alibaba.druid.pool.DruidDataSource;
import com.sqx.datasource.properties.DataSourceProperties;
import com.sqx.datasource.properties.DynamicDataSourceProperties;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import java.util.HashMap;
import java.util.Map;
/**
* 配置多数据源
*/
@Configuration
@EnableConfigurationProperties(DynamicDataSourceProperties.class)
public class DynamicDataSourceConfig {
@Autowired
private DynamicDataSourceProperties properties;
@Bean
@ConfigurationProperties(prefix = "spring.datasource.druid")
public DataSourceProperties dataSourceProperties() {
return new DataSourceProperties();
}
@Bean
public DynamicDataSource dynamicDataSource(DataSourceProperties dataSourceProperties) {
DynamicDataSource dynamicDataSource = new DynamicDataSource();
dynamicDataSource.setTargetDataSources(getDynamicDataSource());
//默认数据源
DruidDataSource defaultDataSource = DynamicDataSourceFactory.buildDruidDataSource(dataSourceProperties);
dynamicDataSource.setDefaultTargetDataSource(defaultDataSource);
return dynamicDataSource;
}
private Map<Object, Object> getDynamicDataSource(){
Map<String, DataSourceProperties> dataSourcePropertiesMap = properties.getDatasource();
Map<Object, Object> targetDataSources = new HashMap<>(dataSourcePropertiesMap.size());
dataSourcePropertiesMap.forEach((k, v) -> {
DruidDataSource druidDataSource = DynamicDataSourceFactory.buildDruidDataSource(v);
targetDataSources.put(k, druidDataSource);
});
return targetDataSources;
}
}

View File

@ -1,44 +0,0 @@
package com.sqx.datasource.config;
import com.alibaba.druid.pool.DruidDataSource;
import com.sqx.datasource.properties.DataSourceProperties;
import java.sql.SQLException;
/**
* DruidDataSource
*
*/
public class DynamicDataSourceFactory {
public static DruidDataSource buildDruidDataSource(DataSourceProperties properties) {
DruidDataSource druidDataSource = new DruidDataSource();
druidDataSource.setDriverClassName(properties.getDriverClassName());
druidDataSource.setUrl(properties.getUrl());
druidDataSource.setUsername(properties.getUsername());
druidDataSource.setPassword(properties.getPassword());
druidDataSource.setInitialSize(properties.getInitialSize());
druidDataSource.setMaxActive(properties.getMaxActive());
druidDataSource.setMinIdle(properties.getMinIdle());
druidDataSource.setMaxWait(properties.getMaxWait());
druidDataSource.setTimeBetweenEvictionRunsMillis(properties.getTimeBetweenEvictionRunsMillis());
druidDataSource.setMinEvictableIdleTimeMillis(properties.getMinEvictableIdleTimeMillis());
druidDataSource.setMaxEvictableIdleTimeMillis(properties.getMaxEvictableIdleTimeMillis());
druidDataSource.setValidationQuery(properties.getValidationQuery());
druidDataSource.setValidationQueryTimeout(properties.getValidationQueryTimeout());
druidDataSource.setTestOnBorrow(properties.isTestOnBorrow());
druidDataSource.setTestOnReturn(properties.isTestOnReturn());
druidDataSource.setPoolPreparedStatements(properties.isPoolPreparedStatements());
druidDataSource.setMaxOpenPreparedStatements(properties.getMaxOpenPreparedStatements());
druidDataSource.setSharePreparedStatements(properties.isSharePreparedStatements());
try {
druidDataSource.setFilters(properties.getFilters());
druidDataSource.init();
} catch (SQLException e) {
e.printStackTrace();
}
return druidDataSource;
}
}

View File

@ -1,192 +0,0 @@
package com.sqx.datasource.properties;
/**
* 多数据源属性
*
*/
public class DataSourceProperties {
private String driverClassName;
private String url;
private String username;
private String password;
/**
* Druid默认参数
*/
private int initialSize = 2;
private int maxActive = 10;
private int minIdle = -1;
private long maxWait = 60 * 1000L;
private long timeBetweenEvictionRunsMillis = 60 * 1000L;
private long minEvictableIdleTimeMillis = 1000L * 60L * 30L;
private long maxEvictableIdleTimeMillis = 1000L * 60L * 60L * 7;
private String validationQuery = "select 1";
private int validationQueryTimeout = -1;
private boolean testOnBorrow = false;
private boolean testOnReturn = false;
private boolean testWhileIdle = true;
private boolean poolPreparedStatements = false;
private int maxOpenPreparedStatements = -1;
private boolean sharePreparedStatements = false;
private String filters = "stat,wall";
public String getDriverClassName() {
return driverClassName;
}
public void setDriverClassName(String driverClassName) {
this.driverClassName = driverClassName;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public int getInitialSize() {
return initialSize;
}
public void setInitialSize(int initialSize) {
this.initialSize = initialSize;
}
public int getMaxActive() {
return maxActive;
}
public void setMaxActive(int maxActive) {
this.maxActive = maxActive;
}
public int getMinIdle() {
return minIdle;
}
public void setMinIdle(int minIdle) {
this.minIdle = minIdle;
}
public long getMaxWait() {
return maxWait;
}
public void setMaxWait(long maxWait) {
this.maxWait = maxWait;
}
public long getTimeBetweenEvictionRunsMillis() {
return timeBetweenEvictionRunsMillis;
}
public void setTimeBetweenEvictionRunsMillis(long timeBetweenEvictionRunsMillis) {
this.timeBetweenEvictionRunsMillis = timeBetweenEvictionRunsMillis;
}
public long getMinEvictableIdleTimeMillis() {
return minEvictableIdleTimeMillis;
}
public void setMinEvictableIdleTimeMillis(long minEvictableIdleTimeMillis) {
this.minEvictableIdleTimeMillis = minEvictableIdleTimeMillis;
}
public long getMaxEvictableIdleTimeMillis() {
return maxEvictableIdleTimeMillis;
}
public void setMaxEvictableIdleTimeMillis(long maxEvictableIdleTimeMillis) {
this.maxEvictableIdleTimeMillis = maxEvictableIdleTimeMillis;
}
public String getValidationQuery() {
return validationQuery;
}
public void setValidationQuery(String validationQuery) {
this.validationQuery = validationQuery;
}
public int getValidationQueryTimeout() {
return validationQueryTimeout;
}
public void setValidationQueryTimeout(int validationQueryTimeout) {
this.validationQueryTimeout = validationQueryTimeout;
}
public boolean isTestOnBorrow() {
return testOnBorrow;
}
public void setTestOnBorrow(boolean testOnBorrow) {
this.testOnBorrow = testOnBorrow;
}
public boolean isTestOnReturn() {
return testOnReturn;
}
public void setTestOnReturn(boolean testOnReturn) {
this.testOnReturn = testOnReturn;
}
public boolean isTestWhileIdle() {
return testWhileIdle;
}
public void setTestWhileIdle(boolean testWhileIdle) {
this.testWhileIdle = testWhileIdle;
}
public boolean isPoolPreparedStatements() {
return poolPreparedStatements;
}
public void setPoolPreparedStatements(boolean poolPreparedStatements) {
this.poolPreparedStatements = poolPreparedStatements;
}
public int getMaxOpenPreparedStatements() {
return maxOpenPreparedStatements;
}
public void setMaxOpenPreparedStatements(int maxOpenPreparedStatements) {
this.maxOpenPreparedStatements = maxOpenPreparedStatements;
}
public boolean isSharePreparedStatements() {
return sharePreparedStatements;
}
public void setSharePreparedStatements(boolean sharePreparedStatements) {
this.sharePreparedStatements = sharePreparedStatements;
}
public String getFilters() {
return filters;
}
public void setFilters(String filters) {
this.filters = filters;
}
}

View File

@ -1,22 +0,0 @@
package com.sqx.datasource.properties;
import org.springframework.boot.context.properties.ConfigurationProperties;
import java.util.LinkedHashMap;
import java.util.Map;
/**
* 多数据源属性
*/
@ConfigurationProperties(prefix = "dynamic")
public class DynamicDataSourceProperties {
private Map<String, DataSourceProperties> datasource = new LinkedHashMap<>();
public Map<String, DataSourceProperties> getDatasource() {
return datasource;
}
public void setDatasource(Map<String, DataSourceProperties> datasource) {
this.datasource = datasource;
}
}

View File

@ -0,0 +1,41 @@
package com.sqx.modules.announcement.controller;
import com.sqx.common.utils.Result;
import com.sqx.modules.announcement.service.AnnouncementService;
import com.sqx.modules.common.dto.AddAnnouncementDTO;
import com.sqx.modules.common.dto.DeleteAnnouncementDTO;
import com.sqx.modules.common.dto.UpdateAnnouncementDTO;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping("/announcement")
public class AnnouncementController {
private final AnnouncementService announcementService;
public AnnouncementController(AnnouncementService announcementService) {
this.announcementService = announcementService;
}
@GetMapping("/list")
public Result list(@RequestParam(required = false) String title, @RequestParam(required = false) Integer state, @RequestParam(required = false) Integer id, @RequestParam(required = false) Integer type) {
return Result.success().put("data", announcementService.listInfo(title, state, id, type));
}
@PostMapping
public Result add(@RequestBody @Validated AddAnnouncementDTO announcementDTO) {
return Result.success().put("data", announcementService.add(announcementDTO));
}
@PutMapping
public Result update(@RequestBody @Validated UpdateAnnouncementDTO updateAnnouncementDTO) {
return Result.success().put("data", announcementService.updateInfo(updateAnnouncementDTO));
}
@DeleteMapping
public Result delete(@RequestBody @Validated DeleteAnnouncementDTO deleteAnnouncementDTO) {
return Result.success().put("data", announcementService.removeById(deleteAnnouncementDTO.getId()));
}
}

View File

@ -0,0 +1,60 @@
package com.sqx.modules.announcement.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 公告表
* @TableName announcement
*/
@TableName(value ="announcement")
@Data
@EqualsAndHashCode
public class Announcement implements Serializable {
/**
*
*/
// @TableId
@JsonSerialize(using = ToStringSerializer.class)
private Long id;
/**
* 标题
*/
private String title;
/**
* 内容
*/
private String content;
/**
* 状态0关闭 1打开
*/
private Integer state;
private Integer type;
/**
* 创建时间
*/
private Date createTime;
/**
* 修改时间
*/
private Date updateTime;
@TableField(exist = false)
private static final long serialVersionUID = 1L;
}

View File

@ -0,0 +1,20 @@
package com.sqx.modules.announcement.mapper;
import com.sqx.modules.announcement.entity.Announcement;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
/**
* @author Administrator
* @description 针对表announcement(公告表)的数据库操作Mapper
* @createDate 2025-01-02 14:33:44
* @Entity com.sqx.modules.announcement.entity.Announcement
*/
@Mapper
public interface AnnouncementMapper extends BaseMapper<Announcement> {
}

View File

@ -0,0 +1,22 @@
package com.sqx.modules.announcement.service;
import com.sqx.modules.announcement.entity.Announcement;
import com.baomidou.mybatisplus.extension.service.IService;
import com.sqx.modules.common.dto.AddAnnouncementDTO;
import com.sqx.modules.common.dto.DeleteAnnouncementDTO;
import com.sqx.modules.common.dto.UpdateAnnouncementDTO;
/**
* @author Administrator
* @description 针对表announcement(公告表)的数据库操作Service
* @createDate 2025-01-02 14:33:44
*/
public interface AnnouncementService extends IService<Announcement> {
Object add(AddAnnouncementDTO announcementDTO);
Object updateInfo(UpdateAnnouncementDTO updateAnnouncementDTO);
Object listInfo(String title, Integer state, Integer id, Integer type);
}

View File

@ -0,0 +1,65 @@
package com.sqx.modules.announcement.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sqx.common.exception.SqxException;
import com.sqx.modules.announcement.entity.Announcement;
import com.sqx.modules.announcement.service.AnnouncementService;
import com.sqx.modules.announcement.mapper.AnnouncementMapper;
import com.sqx.modules.common.dto.AddAnnouncementDTO;
import com.sqx.modules.common.dto.UpdateAnnouncementDTO;
import org.springframework.stereotype.Service;
/**
* @author Administrator
* @description 针对表announcement(公告表)的数据库操作Service实现
* @createDate 2025-01-02 14:33:44
*/
@Service
public class AnnouncementServiceImpl extends ServiceImpl<AnnouncementMapper, Announcement>
implements AnnouncementService{
@Override
public Object listInfo(String title, Integer state, Integer id, Integer type) {
LambdaQueryWrapper<Announcement> queryWrapper = new LambdaQueryWrapper<>();
if (StrUtil.isNotBlank(title)) {
queryWrapper.like(Announcement::getTitle, title);
}
if (type != null) {
queryWrapper.eq(Announcement::getType, type);
}
if (state != null) {
queryWrapper.eq(Announcement::getState, state);
}
if (id != null) {
queryWrapper.eq(Announcement::getId, id);
}
return queryWrapper.isEmptyOfWhere() ? list() : list(queryWrapper);
}
@Override
public Object add(AddAnnouncementDTO announcementDTO) {
Announcement announcement = new Announcement();
BeanUtil.copyProperties(announcementDTO, announcement);
announcement.setCreateTime(DateUtil.date());
return save(announcement);
}
@Override
public Object updateInfo(UpdateAnnouncementDTO updateAnnouncementDTO) {
Announcement announcement = getById(updateAnnouncementDTO.getId());
if (announcement == null) {
throw new SqxException("公告不存在");
}
BeanUtil.copyProperties(updateAnnouncementDTO, announcement);
announcement.setUpdateTime(DateUtil.date());
return updateById(announcement);
}
}

View File

@ -1,8 +1,9 @@
package com.sqx.modules.app.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.sqx.common.utils.PageUtils;
import com.sqx.common.utils.Result;
import com.sqx.modules.app.entity.App;
import com.sqx.modules.app.service.AppService;
@ -13,6 +14,7 @@ import org.springframework.web.bind.annotation.*;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
/**
* APP登录授权
@ -30,8 +32,10 @@ public class AppUpgradeController {
@ApiOperation("管理平台升级详情")
@ResponseBody
public Result list(Integer page,Integer limit) {
IPage<App> pages =new Page<>(page,limit);
return Result.success().put("data",iAppService.page(pages));
PageHelper.startPage(page,limit);
List<App> list = iAppService.list();
PageInfo<App> pageInfo = new PageInfo<>(list);
return Result.success().put("data", PageUtils.page(pageInfo, true));
}

View File

@ -0,0 +1,58 @@
package com.sqx.modules.app.controller;
import com.sqx.common.utils.Constant;
import com.sqx.common.utils.PageUtils;
import com.sqx.common.utils.Result;
import com.sqx.modules.app.annotation.Login;
import com.sqx.modules.app.entity.UserPrizeExchange;
import com.sqx.modules.app.service.UserPrizeExchangeService;
import com.sqx.modules.app.service.UserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import javax.annotation.Resource;
import java.util.Map;
@RestController
@RequestMapping("/app/userPrizeExchange")
@AllArgsConstructor
@Api(value = "用户奖品兑换", tags = {"用户奖品兑换"})
public class AppUserPrizeExchangeController {
private final UserPrizeExchangeService userPrizeExchangeService;
@Resource
private UserService userService;
@Login
@GetMapping("/page")
@ApiOperation("分页")
@ApiImplicitParams({
@ApiImplicitParam(name = Constant.PAGE, value = "当前页码从1开始", paramType = "query", required = true, dataType = "int"),
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query", required = true, dataType = "int"),
})
public Result page(@RequestAttribute("userId") Long userId, @ApiIgnore @RequestParam Map<String, Object> params) {
params.put("userId", userId);
PageUtils page = userPrizeExchangeService.page(params);
return Result.success().put("page", page);
}
@Login
@PostMapping("/exchange")
@ApiOperation("兑换")
public Result exchange(@RequestAttribute("userId") Long userId, @RequestBody UserPrizeExchange entity) {
userPrizeExchangeService.exchange(userId, entity);
return Result.success();
}
@Login
@PostMapping("/receive")
@ApiOperation("领取满签奖励")
public Result receive(@RequestAttribute("userId") Long userId) {
userService.addBlackUser(userId,"领取满签奖励");
return Result.success();
}
}

View File

@ -1,8 +1,8 @@
package com.sqx.modules.app.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.sqx.common.utils.PageUtils;
import com.sqx.common.utils.Result;
import com.sqx.modules.app.entity.UserEntity;
@ -23,6 +23,7 @@ import com.sqx.modules.pay.service.PayDetailsService;
import com.sqx.modules.sys.entity.SysUserEntity;
import com.sqx.modules.sys.service.SysUserService;
import com.sqx.modules.utils.EasyPoi.ExcelUtils;
import com.sqx.modules.utils.TimeCompleteUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
@ -74,7 +75,7 @@ public class UserController {
public Result selectUserByInvitationCode(String invitationCode) {
Map<String, Object> map = new HashMap<>();
UserEntity userEntity = userService.queryByInvitationCode(invitationCode);
Long userId=userEntity.getUserId();
Long userId = userEntity.getUserId();
//查询用户钱包
// Double money = cashOutDao.selectMayMoney(userId);
InviteMoney inviteMoney = inviteMoneyService.selectInviteMoneyByUserId(userId);
@ -88,7 +89,7 @@ public class UserController {
//查询邀请人数
int count = userService.queryInviterCount(userEntity.getInvitationCode());
UserVip userVip = userVipService.selectUserVipByUserId(userId);
if(userVip!=null){
if (userVip != null) {
userEntity.setMember(userVip.getIsVip());
userEntity.setEndTime(userVip.getEndTime());
userEntity.setVipType(userVip.getVipType());
@ -120,7 +121,7 @@ public class UserController {
//查询邀请人数
int count = userService.queryInviterCount(userEntity.getInvitationCode());
UserVip userVip = userVipService.selectUserVipByUserId(userId);
if(userVip!=null){
if (userVip != null) {
userEntity.setMember(userVip.getIsVip());
userEntity.setEndTime(userVip.getEndTime());
userEntity.setVipType(userVip.getVipType());
@ -136,12 +137,12 @@ public class UserController {
@RequestMapping(value = "/selectUserList", method = RequestMethod.GET)
@ApiOperation("查询所有用户列表")
@ResponseBody
public Result selectUserList(Integer page, Integer limit,String phone,Integer sex,String platform,
String sysPhone,Integer status, Integer member, String inviterCode,
public Result selectUserList(Integer page, Integer limit, String phone, Integer sex, String platform,
String sysPhone, Integer status, Integer member, String inviterCode,
String userName, String invitationCode, String startTime, String endTime,
String qdCode,String sysUserName,Integer vipType) {
String qdCode, String sysUserName, Integer vipType) {
return Result.success().put("data", userService.selectUserPage(page, limit, phone, sex, platform, sysPhone, status, member,
inviterCode, userName, invitationCode, startTime, endTime,qdCode,sysUserName,vipType));
inviterCode, userName, invitationCode, startTime, endTime, qdCode, sysUserName, vipType));
}
@GetMapping("/userListExcel")
@ -163,17 +164,28 @@ public class UserController {
@ApiOperation("修改用户")
@ResponseBody
public Result updateUserByUserId(@RequestBody UserEntity userEntity) {
if(StringUtils.isNotEmpty(userEntity.getPhone())){
if (StringUtils.isNotEmpty(userEntity.getPhone())) {
UserEntity phoneUser = userService.queryByPhone(userEntity.getPhone());
if(phoneUser!=null && !phoneUser.getUserId().equals(userEntity.getUserId())){
if (phoneUser != null && !phoneUser.getUserId().equals(userEntity.getUserId())) {
return Result.error("手机号已被其他用户绑定!");
}
}
if(StringUtils.isNotEmpty(userEntity.getQdCode())){
SysUserEntity sysUserEntity = sysUserService.getOne(new QueryWrapper<SysUserEntity>().eq("qd_code", userEntity.getQdCode()));
if(sysUserEntity==null){
UserEntity userEntity2 = userService.queryByUserId(userEntity.getUserId());
if (StringUtils.isNotEmpty(userEntity2.getQdCode())) {
SysUserEntity sysUserEntity = sysUserService.getOne(new QueryWrapper<SysUserEntity>().eq("qd_code", userEntity2.getQdCode()));
if (sysUserEntity == null) {
return Result.error("渠道码不正确!");
}
if (userEntity.getRate() != null) {
if (sysUserEntity.getQdRate().compareTo(userEntity.getRate()) < 0) {
return Result.error("下级佣金不可大于渠道商佣金");
}
}
if (userEntity.getTwoRate() != null) {
if (sysUserEntity.getQdRate().compareTo(userEntity.getTwoRate()) < 0) {
return Result.error("下级佣金不可大于渠道商佣金");
}
}
}
userService.updateById(userEntity);
return Result.success();
@ -224,28 +236,28 @@ public class UserController {
@GetMapping("/homeMessage")
@ApiOperation("信息分析")
public Result homeMessage(Long sysUserId) {
String qdCode=null;
if(sysUserId!=null){
qdCode=sysUserService.getById(sysUserId).getQdCode();
String qdCode = null;
if (sysUserId != null) {
qdCode = sysUserService.getById(sysUserId).getQdCode();
}
HomeMessageResponse homeMessageResponse = new HomeMessageResponse();
// 0查总 1查天 2查月 3查年
//设置总用户人数
homeMessageResponse.setTotalUsers(userService.queryUserCount(0, null,null,qdCode));
homeMessageResponse.setTotalUsers(userService.queryUserCount(0, null, null, qdCode));
//设置今日新增
homeMessageResponse.setNewToday(userService.queryUserCount(1, null,null,qdCode));
homeMessageResponse.setNewToday(userService.queryUserCount(1, null, null, qdCode));
//设置本月新增
homeMessageResponse.setNewMonth(userService.queryUserCount(2, null,null,qdCode));
homeMessageResponse.setNewMonth(userService.queryUserCount(2, null, null, qdCode));
//设置本年新增
homeMessageResponse.setNewYear(userService.queryUserCount(3, null,null,qdCode));
homeMessageResponse.setNewYear(userService.queryUserCount(3, null, null, qdCode));
//设置总收入
homeMessageResponse.setTotalRevenue(userService.queryPayMoney(0,qdCode));
homeMessageResponse.setTotalRevenue(userService.queryPayMoney(0, qdCode));
//设置今日收入
homeMessageResponse.setTodayRevenue(userService.queryPayMoney(1,qdCode));
homeMessageResponse.setTodayRevenue(userService.queryPayMoney(1, qdCode));
//设置本月收入
homeMessageResponse.setMonthRevenue(userService.queryPayMoney(2,qdCode));
homeMessageResponse.setMonthRevenue(userService.queryPayMoney(2, qdCode));
//设置本年收入
homeMessageResponse.setYearRevenue(userService.queryPayMoney(3,qdCode));
homeMessageResponse.setYearRevenue(userService.queryPayMoney(3, qdCode));
//查询指定日期下的短剧购买的
return Result.success().put("data", homeMessageResponse);
}
@ -257,10 +269,9 @@ public class UserController {
*/
@GetMapping("/courseMessage")
@ApiOperation("短剧分析")
public Result courseMessage(Long page, Long limit, String date, int type,Long sysUserId) {
Page<Map<String, Object>> iPage = new Page<>(page, limit);
IPage<Map<String, Object>> mapIPage = userService.queryCourseOrder(iPage, type, date,sysUserId);
return Result.success().put("data", new PageUtils(mapIPage));
public Result courseMessage(Long page, Long limit, String date, int type, Long sysUserId) {
PageUtils pageUtils = userService.queryCourseOrder(page, limit, type, TimeCompleteUtils.completeStartTime(date), sysUserId);
return Result.success().put("data", pageUtils);
}
/**
@ -268,55 +279,58 @@ public class UserController {
*/
@GetMapping("/userMessage")
@ApiOperation("用户分析")
public Result userMessage(String date, int type,Long sysUserId) {
String qdCode=null;
if(sysUserId!=null){
qdCode=sysUserService.getById(sysUserId).getQdCode();
public Result userMessage(String date, int type, Long sysUserId) {
date = TimeCompleteUtils.completeStartTime(date);
String qdCode = null;
if (sysUserId != null) {
qdCode = sysUserService.getById(sysUserId).getQdCode();
}
int sumUserCount = userService.queryUserCount(type, date,null,qdCode);
int h5Count = userService.queryUserCount(type, date,"h5",qdCode);
int appCount = userService.queryUserCount(type, date,"app",qdCode);
int wxCount = userService.queryUserCount(type, date,"小程序",qdCode);
int dyCount = userService.queryUserCount(type, date,"抖音",qdCode);
int giveMemberCount = userService.userMessage(date, type,qdCode,1);
int moneyMemberCount = userService.userMessage(date, type,qdCode,2);
int memberCount = userService.userMessage(date, type,qdCode,null);
int userCount = sumUserCount-memberCount;
Map<String,Integer> result=new HashMap<>();
result.put("sumUserCount",sumUserCount);
result.put("h5Count",h5Count);
result.put("appCount",appCount);
result.put("wxCount",wxCount);
result.put("dyCount",dyCount);
result.put("memberCount",memberCount);
result.put("giveMemberCount",giveMemberCount);
result.put("moneyMemberCount",moneyMemberCount);
result.put("userCount",userCount);
int sumUserCount = userService.queryUserCount(type, date, null, qdCode);
int h5Count = userService.queryUserCount(type, date, "h5", qdCode);
int appCount = userService.queryUserCount(type, date, "app", qdCode);
int wxCount = userService.queryUserCount(type, date, "小程序", qdCode);
int dyCount = userService.queryUserCount(type, date, "抖音", qdCode);
int giveMemberCount = userService.userMessage(date, type, qdCode, 1);
int moneyMemberCount = userService.userMessage(date, type, qdCode, 2);
// int memberCount = userVipService.userMessage(date, type, qdCode, null);
int memberCount = userService.userMessage(date, type, qdCode, null);
int userCount = sumUserCount - memberCount;
Map<String, Integer> result = new HashMap<>();
result.put("sumUserCount", sumUserCount);
result.put("h5Count", h5Count);
result.put("appCount", appCount);
result.put("wxCount", wxCount);
result.put("dyCount", dyCount);
result.put("memberCount", memberCount);
result.put("giveMemberCount", giveMemberCount);
result.put("moneyMemberCount", moneyMemberCount);
result.put("userCount", userCount);
return Result.success().put("data", result);
}
@PostMapping("addCannotMoney/{userId}/{money}")
@ApiOperation("添加金")
@ApiOperation("添加金")
public Result addCannotMoney(@PathVariable("userId") Long userId, @PathVariable("money") Double money) {
userMoneyService.updateMoney(1, userId, money);
//inviteMoneyDao.updateInviteMoneySum(money,userId);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
UserMoneyDetails userMoneyDetails = new UserMoneyDetails();
userMoneyDetails.setUserId(userId);
userMoneyDetails.setTitle("[增加金豆]平台增加金豆" + money);
userMoneyDetails.setContent("[增加金豆]平台增加金豆" + money);
userMoneyDetails.setTitle("[增加金币]平台增加金币" + money);
userMoneyDetails.setContent("[增加金币]平台增加金币" + money);
userMoneyDetails.setType(1);
userMoneyDetails.setClassify(1);
//
userMoneyDetails.setClassify(8);
userMoneyDetails.setMoney(new BigDecimal(money));
userMoneyDetails.setCreateTime(sdf.format(new Date()));
userMoneyDetails.setMoneyType(2);
userMoneyDetailsService.save(userMoneyDetails);
PayDetails payDetails=new PayDetails();
PayDetails payDetails = new PayDetails();
payDetails.setState(1);
payDetails.setCreateTime(sdf.format(new Date()));
payDetails.setUserId(userId);
payDetails.setMoney(money);
payDetails.setClassify(9);
payDetails.setType(1);
payDetails.setPayTime(sdf.format(new Date()));
payDetailsDao.insert(payDetails);
@ -324,68 +338,72 @@ public class UserController {
}
@PostMapping("subCannotMoney/{userId}/{money}")
@ApiOperation("减少金")
@ApiOperation("减少金")
public Result subCannotMoney(@PathVariable("userId") Long userId, @PathVariable("money") Double money) {
userMoneyService.updateMoney(2, userId, money);
//inviteMoneyDao.updateInviteMoneySumSub(money,userId);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
UserMoneyDetails userMoneyDetails = new UserMoneyDetails();
userMoneyDetails.setUserId(userId);
userMoneyDetails.setTitle("[减少金豆]平台减少金豆" + money);
userMoneyDetails.setContent("平台减少金" + money);
userMoneyDetails.setTitle("[减少金币]平台减少金币" + money);
userMoneyDetails.setContent("平台减少金" + money);
userMoneyDetails.setType(1);
userMoneyDetails.setClassify(1);
//
userMoneyDetails.setClassify(8);
userMoneyDetails.setMoney(new BigDecimal(money));
userMoneyDetails.setCreateTime(sdf.format(new Date()));
userMoneyDetails.setMoneyType(2);
userMoneyDetailsService.save(userMoneyDetails);
return Result.success();
}
@PostMapping("/updateSysUserMoney")
@ApiOperation("修改金豆")
public Result updateSysUserMoney(Long userId, Double money,Integer type) {
userMoneyService.updateSysMoney(type, userId, money);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
UserMoneyDetails userMoneyDetails = new UserMoneyDetails();
userMoneyDetails.setSysUserId(userId);
if(type==1){
userMoneyDetails.setTitle("[增加金豆]平台增加金豆:" + money);
userMoneyDetails.setContent("[增加金豆]平台增加金豆:" + money);
}else{
userMoneyDetails.setTitle("[减少金豆]平台减少金豆:" + money);
userMoneyDetails.setContent("[减少金豆]平台减少金豆:" + money);
}
userMoneyDetails.setType(type);
userMoneyDetails.setClassify(1);
userMoneyDetails.setMoney(new BigDecimal(money));
userMoneyDetails.setCreateTime(sdf.format(new Date()));
userMoneyDetailsService.save(userMoneyDetails);
@ApiOperation("修改金币")
public Result updateSysUserMoney(Long userId, Double money, Integer type) {
// userMoneyService.updateSysMoney(type, userId, money);
// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
// UserMoneyDetails userMoneyDetails = new UserMoneyDetails();
// userMoneyDetails.setSysUserId(userId);
// if (type == 1) {
// userMoneyDetails.setTitle("[增加金币]平台增加金币:" + money);
// userMoneyDetails.setContent("[增加金币]平台增加金币:" + money);
// } else {
// userMoneyDetails.setTitle("[减少金币]平台减少金币:" + money);
// userMoneyDetails.setContent("[减少金币]平台减少金币:" + money);
// }
// userMoneyDetails.setMoneyType(2);
// userMoneyDetails.setType(type);
// //
// userMoneyDetails.setClassify(8);
// userMoneyDetails.setMoney(new BigDecimal(money));
// userMoneyDetails.setCreateTime(sdf.format(new Date()));
// userMoneyDetailsService.save(userMoneyDetails);
return Result.success();
}
@GetMapping("/selectInviteUserList")
@ApiOperation("邀请用户排行榜")
public Result selectInviteUserList(Integer page,Integer limit,String phone,String userName){
public Result selectInviteUserList(Integer page, Integer limit, String phone, String userName) {
return userService.selectInviteUserList(page, limit, userName, phone);
}
@GetMapping("/selectUserOnLineCount")
@ApiOperation("统计当前在线人数")
public Result selectUserCount(Long sysUserId){
String qdCode=null;
if(sysUserId!=null){
qdCode=sysUserService.getById(sysUserId).getQdCode();
public Result selectUserCount(Long sysUserId) {
String qdCode = null;
if (sysUserId != null) {
qdCode = sysUserService.getById(sysUserId).getQdCode();
}
return userService.selectUserOnLineCount(qdCode);
}
@GetMapping("/selectUserCountStatisticsByTime")
@ApiOperation("用户统计")
public Result selectUserCountStatisticsByTime(String startTime,String endTime){
List<Integer> userCountList=new ArrayList<>();
List<String> year=new ArrayList<>();
public Result selectUserCountStatisticsByTime(String startTime, String endTime) {
List<Integer> userCountList = new ArrayList<>();
List<String> year = new ArrayList<>();
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
Calendar calendar=Calendar.getInstance();
Calendar calendar = Calendar.getInstance();
Date parse = null;
try {
parse = simpleDateFormat.parse(startTime);
@ -393,22 +411,21 @@ public class UserController {
e.printStackTrace();
}
calendar.setTime(parse);
while (true){
while (true) {
String dateTime = simpleDateFormat.format(calendar.getTime());
int i = userService.queryUserCount(1, dateTime,null,null);
int i = userService.queryUserCount(1, dateTime, null, null);
userCountList.add(i);
year.add(dateTime);
if(dateTime.equals(endTime)){
if (dateTime.equals(endTime)) {
break;
}
calendar.add(Calendar.DATE,1);
calendar.add(Calendar.DATE, 1);
}
Map<String,Object> result=new HashMap<>();
result.put("userCountList",userCountList);
result.put("year",year);
return Result.success().put("data",result);
Map<String, Object> result = new HashMap<>();
result.put("userCountList", userCountList);
result.put("year", year);
return Result.success().put("data", result);
}
}
}

View File

@ -3,6 +3,7 @@ package com.sqx.modules.app.controller;
import com.sqx.common.utils.Result;
import com.sqx.modules.app.service.UserMoneyDetailsService;
import com.sqx.modules.app.service.UserMoneyService;
import com.sqx.modules.sys.service.SysUserMoneyService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
@ -13,16 +14,17 @@ import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/moneyDetails")
@AllArgsConstructor
@Api("钱包明细")
@Api(value = "钱包明细", tags = {"钱包明细"})
public class UserMoneyDetailsController {
private UserMoneyDetailsService userMoneyDetailsService;
private UserMoneyService userMoneyService;
private SysUserMoneyService sysUserMoneyService;
@ApiOperation("钱包明细")
@GetMapping("/queryUserMoneyDetails")
public Result queryUserMoneyDetails(Integer page, Integer limit,Long sysUserId, Long userId,Integer classify,Integer type) {
return userMoneyDetailsService.queryUserMoneyDetails(page, limit, sysUserId, userId,classify,type);
public Result queryUserMoneyDetails(Integer page, Integer limit,Long sysUserId, Long userId,Integer classify,Integer type, Integer moneyType) {
return userMoneyDetailsService.queryUserMoneyDetails(page, limit, sysUserId, userId,classify,type, moneyType, 0);
}
@GetMapping("/selectUserMoney")
@ -34,7 +36,7 @@ public class UserMoneyDetailsController {
@GetMapping("/selectSysUserMoney")
@ApiOperation("代理钱包")
public Result selectSysUserMoney(Long userId){
return Result.success().put("data",userMoneyService.selectSysUserMoneyByUserId(userId));
return Result.success().put("data",sysUserMoneyService.selectSysUserMoneyByUserId(userId));
}

View File

@ -1,6 +1,8 @@
package com.sqx.modules.app.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.sqx.common.utils.DateUtils;
import com.sqx.common.utils.PageUtils;
import com.sqx.common.utils.Result;
@ -16,6 +18,7 @@ import org.springframework.web.bind.annotation.*;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
@RestController
@Api(value = "会员管理", tags = {"会员管理"})
@ -89,7 +92,10 @@ public class VipDetailsController {
@ApiParam("查询会员列表")
@GetMapping("/selectVipDetailsList")
public Result selectVipDetailsList(Integer page,Integer limit) {
return Result.success().put("data",new PageUtils(vipDetailsService.page(new Page<>(page,limit))));
PageHelper.startPage(page,limit);
List<VipDetails> list = vipDetailsService.list();
PageInfo<VipDetails> pageInfo = new PageInfo<>(list);
return Result.success().put("data", PageUtils.page(pageInfo));
}
}

View File

@ -0,0 +1,33 @@
package com.sqx.modules.app.controller.app;
import com.sqx.common.utils.Result;
import com.sqx.modules.app.annotation.Login;
import com.sqx.modules.app.service.AdService;
import com.sqx.modules.callback.service.UniAdCallbackRecordService;
import com.sqx.modules.sys.controller.AbstractController;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping("/app/ad")
public class AdController extends AbstractController {
private final UniAdCallbackRecordService callbackRecordService;
private final AdService adService;
public AdController(UniAdCallbackRecordService callbackRecordService, AdService adService) {
this.callbackRecordService = callbackRecordService;
this.adService = adService;
}
@Login
@GetMapping("/state")
public Result getAdState(@RequestParam String extraKey, @RequestAttribute Long userId) {
return Result.success(callbackRecordService.getStateByExtraKey(userId, extraKey));
}
@Login
@GetMapping("/detail")
public Result getAdDetail(@RequestAttribute Long userId) {
return Result.success(adService.getDetail(userId));
}
}

View File

@ -0,0 +1,34 @@
package com.sqx.modules.app.controller.app;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.github.pagehelper.PageHelper;
import com.sqx.common.utils.Result;
import com.sqx.modules.announcement.entity.Announcement;
import com.sqx.modules.announcement.service.AnnouncementService;
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;
import java.util.List;
@RestController
@RequestMapping("/app/announcement")
public class AppAnnouncementController {
private final AnnouncementService announcementService;
public AppAnnouncementController(AnnouncementService announcementService) {
this.announcementService = announcementService;
}
@GetMapping
public Result get(@RequestParam(defaultValue = "0") Integer type) {
List<Announcement> list = announcementService.list(new LambdaQueryWrapper<Announcement>()
.eq(Announcement::getType, type)
.eq(Announcement::getState, 1)
.orderByDesc(Announcement::getCreateTime));
return Result.success().put("data", list);
}
}

View File

@ -1,45 +1,78 @@
package com.sqx.modules.app.controller.app;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.lang.Validator;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.sqx.common.annotation.Debounce;
import com.sqx.common.utils.ApiAccessLimitUtil;
import com.sqx.common.utils.DataLimitUtil;
import com.sqx.common.utils.DesensitizedUtil;
import com.sqx.common.utils.Result;
import com.sqx.modules.app.annotation.Login;
import com.sqx.modules.app.annotation.LoginUser;
import com.sqx.modules.app.dto.AuthRespDTO;
import com.sqx.modules.app.entity.TbUserBlacklist;
import com.sqx.modules.app.entity.UserEntity;
import com.sqx.modules.app.entity.UserInfo;
import com.sqx.modules.app.mapper.TbUserBlacklistMapper;
import com.sqx.modules.app.service.AliService;
import com.sqx.modules.app.service.AppService;
import com.sqx.modules.app.service.UserInfoService;
import com.sqx.modules.app.service.UserService;
import com.sqx.modules.common.service.CommonInfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.codec.digest.DigestUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.util.Map;
/**
* APP登录授权
*
* @author mac
*/
@RestController
@RequestMapping("/app/user")
@Api(value = "APP管理", tags = {"APP管理"})
@Slf4j
public class AppController {
@Autowired
private UserService userService;
@Autowired
private AppService appService;
@Autowired
private CommonInfoService commonRepository;
private final UserInfoService userInfoService;
private final AliService aliService;
@Autowired
private TbUserBlacklistMapper tbUserBlacklistMapper;
public AppController(UserInfoService userInfoService, AliService aliService) {
this.userInfoService = userInfoService;
this.aliService = aliService;
}
@PostMapping("/authenticationRegister")
@ApiOperation("认证创建账号")
public Result authenticationRegister(@RequestBody JSONObject jsonObject, HttpServletRequest request){
return userService.authenticationRegister(jsonObject,request);
public Result authenticationRegister(@RequestBody JSONObject jsonObject, HttpServletRequest request) {
return userService.authenticationRegister(jsonObject, request);
}
@Login
@PostMapping("/getNewUserRed")
@ApiOperation("领取新用户红包")
public Result getNewUserRed(@RequestAttribute Long userId){
public Result getNewUserRed(@RequestAttribute Long userId) {
return userService.getNewUserRed(userId);
}
@ -47,15 +80,15 @@ public class AppController {
@RequestMapping(value = "/updatePwd", method = RequestMethod.POST)
@ResponseBody
@ApiOperation("用户端修改密码")
public Result updatePwd(@LoginUser UserEntity user,String pwd,String oldPwd) {
if(!user.getPassword().equals(DigestUtils.sha256Hex(oldPwd))){
public Result updatePwd(@LoginUser UserEntity user, String pwd, String oldPwd) {
if (!user.getPassword().equals(DigestUtils.sha256Hex(oldPwd))) {
return Result.error("原始密码不正确!");
}
if(pwd.equals(oldPwd)){
if (pwd.equals(oldPwd)) {
return Result.error("新密码不能与旧密码相同!");
}
user.setPassword(DigestUtils.sha256Hex(pwd));
userService.updateById(user);
userService.update(user, new LambdaQueryWrapper<UserEntity>().eq(UserEntity::getUserId, user.getUserId()));
return Result.success();
}
@ -63,58 +96,139 @@ public class AppController {
@RequestMapping(value = "/updatePhone", method = RequestMethod.POST)
@ApiOperation("用户端换绑手机号")
@ResponseBody
public Result updatePhone(@RequestAttribute("userId") Long userId,@RequestParam String phone, @RequestParam String msg) {
return userService.updatePhone(phone, msg,userId);
public Result updatePhone(@RequestAttribute("userId") Long userId, @RequestParam String phone, @RequestParam String msg) {
return userService.updatePhone(phone, msg, userId);
}
@Login
@RequestMapping(value = "/updateUser", method = RequestMethod.POST)
@ApiOperation("用户修改个人信息")
@RequestMapping(value = "/bindAlipay", method = RequestMethod.POST)
@ApiOperation("绑定支付宝")
@ResponseBody
public Result updateUserImageUrl(@RequestAttribute("userId") Long userId,String zhiFuBao,String zhiFuBaoName) {
UserEntity userEntity=new UserEntity();
@Debounce(interval = 3000, value = "#userId")
public Result bindAlipay(@RequestAttribute("userId") Long userId,
@RequestParam String zhiFuBao,
@RequestParam String certName
) {
if (StrUtil.isAllBlank(zhiFuBao, certName)) {
return Result.error("支付宝账号或姓名不能为空");
}
if(zhiFuBao.contains("*") || certName.contains("*")){
return Result.success();
}
UserEntity userEntity = userService.getById(userId);
if (zhiFuBao.equals(userEntity.getZhiFuBao()) && certName.equals(userEntity.getZhiFuBaoName())) {
return Result.success();
}
int count = userService.count(new QueryWrapper<UserEntity>()
.ne("user_id", userId)
.eq("zhi_fu_bao_name", certName)
.eq("zhi_fu_bao", zhiFuBao));
if (count > 0) {
return Result.error("支付宝信息修改失败: 此支付宝账号已被绑定");
}
UserInfo userInfo = userInfoService.getByUserId(userId);
if (userInfo != null) {
if (StrUtil.isNotBlank(userInfo.getCertName()) && !certName.equals(userInfo.getCertName())) {
return Result.error("支付宝信息修改失败: 姓名与实名认证信息不相符");
}
}
if (!DataLimitUtil.isAccessAllowed(zhiFuBao + certName, Integer.parseInt(commonRepository.findOne(924).getValue()), "month")) {
return Result.error("支付宝信息修改失败: 相同支付宝账号每月可绑定次数已用完");
}
if (!ApiAccessLimitUtil.isAccessAllowed(userId.toString(), "updateZFB", Integer.parseInt(commonRepository.findOne(925).getValue()), "month")) {
return Result.error("支付宝信息修改失败: 每月可修改次数已用完,请联系管理员");
}
userEntity.setZhiFuBao(zhiFuBao);
userEntity.setZhiFuBaoName(zhiFuBaoName);
userEntity.setUserId(userId);
userService.updateById(userEntity);
userEntity.setZhiFuBaoName(certName);
userService.update(userEntity, new LambdaQueryWrapper<UserEntity>().eq(UserEntity::getUserId, userId));
return Result.success();
}
@Login
@RequestMapping(value = "/realNameAuth", method = RequestMethod.POST)
@ApiOperation("实名认证")
@ResponseBody
@Debounce(interval = 3000, value = "#userId")
public Result bindAlipay(@RequestAttribute("userId") Long userId,
@RequestParam String certName,
@RequestParam String certNum,
@RequestParam String accountNo,
@RequestParam String mobile
) {
if (StrUtil.isAllBlank(certName, certNum, accountNo, mobile)) {
return Result.error("真实姓名、身份证号码、银行卡号、银行预留手机号缺一不可");
}
if(certNum.contains("*") || accountNo.contains("*") || mobile.contains("*")){
return Result.success();
}
int count = userInfoService.count(Wrappers.<UserInfo>lambdaQuery()
.eq(UserInfo::getUserId, userId)
.eq(UserInfo::getCertName, certName)
.eq(UserInfo::getCertNo, certNum)
);
if (count > 0) {
return Result.error("已完成实名认证,无需重复操作");
}
// 查询现在库里面姓名+身份证号认证过的用户数量
count = userInfoService.count(Wrappers.<UserInfo>lambdaQuery()
.eq(UserInfo::getCertName, certName)
.eq(UserInfo::getCertNo, certNum)
);
if (count >= 3) {
return Result.error("实名认证失败: 1个身份证号码最多绑定3个账号");
}
if (!ApiAccessLimitUtil.getCertAuthIsAccessAllowed(String.valueOf(userId), "updateAuthCertInfo", 5)) {
return Result.error("实名修改失败: 每月可修改次数已用完,请联系管理员");
}
AuthRespDTO resp = aliService.auth(certName, certNum, accountNo, mobile);
UserInfo userInfo = userInfoService.getByUserIdOrSave(userId);
userInfo.setCertName(certName);
userInfo.setCertNo(certNum);
userInfo.setAccountNo(accountNo);
userInfo.setMobile(mobile);
userInfo.setBankName(resp.getBankName());
userInfo.setRespJson(resp.getRespJson());
userInfo.setUpdateTime(DateUtil.date());
boolean update = userInfoService.update(userInfo, new LambdaQueryWrapper<UserInfo>().eq(UserInfo::getUserId, userId).eq(UserInfo::getId, userInfo.getId()));
if (!update) {
return Result.error("实名修改失败: 请稍后重试");
}
ApiAccessLimitUtil.setCertAuthIsAccessAllowed(String.valueOf(userId), "updateAuthCertInfo", 1, "month");
// 校验实名信息是否在黑名单里面
count = tbUserBlacklistMapper.selectCount(new LambdaQueryWrapper<TbUserBlacklist>().eq(TbUserBlacklist::getIdCardNo, certNum));
if (count > 0) {
UserEntity userEntity = userService.getById(userId);
userEntity.setStatus(0);
userService.update(userEntity, new LambdaQueryWrapper<UserEntity>().eq(UserEntity::getUserId, userId));
log.warn("异常行为用户:实名信息异常: {}", userId);
return Result.error("异常行为: 您的实名信息存在异常行为");
}
return Result.success();
}
@Login
@RequestMapping(value = "/updateUsers", method = RequestMethod.POST)
@ApiOperation("用户修改个人信息")
@ResponseBody
public Result updateUsers(@RequestAttribute("userId") Long userId,@RequestBody UserEntity userEntity) {
public Result updateUsers(@RequestAttribute("userId") Long userId, @RequestBody UserEntity userEntity) {
userEntity.setUserId(userId);
userService.updateById(userEntity);
userService.update(null, Wrappers.<UserEntity>lambdaUpdate().eq(UserEntity::getUserId, userId)
.set(StrUtil.isNotBlank(userEntity.getAvatar()), UserEntity::getAvatar, userEntity.getAvatar())
.set(StrUtil.isNotBlank(userEntity.getUserName()), UserEntity::getUserName, userEntity.getUserName())
);
return Result.success();
}
/*@Login
@RequestMapping(value = "/updateUsers", method = RequestMethod.POST)
@ApiOperation("用户修改个人信息")
@ResponseBody
public Result updateUsers(@RequestAttribute("userId") Long userId,String userName,String avatar,String phone) {
UserEntity userEntity=new UserEntity();
userEntity.setUserId(userId);
userEntity.setUserName(userName);
userEntity.setAvatar(avatar);
userEntity.setPhone(phone);
userService.updateById(userEntity);
return Result.success();
}*/
@Login
@RequestMapping(value = "/updateUserImageUrl", method = RequestMethod.POST)
@ApiOperation("用户修改头像")
@ResponseBody
public Result updateUserImageUrl(@LoginUser UserEntity user,String avatar) {
public Result updateUserImageUrl(@LoginUser UserEntity user, String avatar) {
user.setAvatar(avatar);
userService.updateById(user);
userService.update(user, new LambdaQueryWrapper<UserEntity>().eq(UserEntity::getUserId, user.getUserId()));
return Result.success();
}
@ -122,9 +236,9 @@ public class AppController {
@RequestMapping(value = "/updateUserName", method = RequestMethod.POST)
@ApiOperation("用户修改昵称")
@ResponseBody
public Result updateUserName(@LoginUser UserEntity user,String userName) {
public Result updateUserName(@LoginUser UserEntity user, String userName) {
user.setUserName(userName);
userService.updateById(user);
userService.update(user, new LambdaQueryWrapper<UserEntity>().eq(UserEntity::getUserId, user.getUserId()));
return Result.success();
}
@ -133,7 +247,30 @@ public class AppController {
@ApiOperation("获取用户详细信息")
@ResponseBody
public Result selectUserById(@LoginUser UserEntity user) {
return Result.success().put("data",user);
UserInfo userInfo = userInfoService.getByUserId(user.getUserId());
userInfo.setRespJson(null);
if (StrUtil.isNotEmpty(userInfo.getAccountNo())) {
userInfo.setAccountNo(DesensitizedUtil.bankCard(userInfo.getAccountNo()));
}
if (StrUtil.isNotEmpty(userInfo.getMobile())) {
userInfo.setMobile(DesensitizedUtil.mobilePhone(userInfo.getMobile()));
}
if (StrUtil.isNotEmpty(userInfo.getCertNo())) {
userInfo.setCertNo(DesensitizedUtil.idCardNum(userInfo.getCertNo(), 3, 2));
}
if (StrUtil.isNotEmpty(user.getZhiFuBao())) {
if (Validator.isEmail(user.getZhiFuBao())) {
user.setZhiFuBao(DesensitizedUtil.email(user.getZhiFuBao()));
} else {
user.setZhiFuBao(DesensitizedUtil.mobilePhone(user.getZhiFuBao()));
}
}
Map<String, Object> map = BeanUtil.beanToMap(user);
map.putAll(BeanUtil.beanToMap(userInfo));
if (StrUtil.isBlank(user.getZhiFuBaoName()) && StrUtil.isNotBlank(userInfo.getCertName())) {
map.put("zhiFuBaoName", userInfo.getCertName());
}
return Result.success().put("data", map);
}
@ -141,25 +278,25 @@ public class AppController {
@ApiOperation("升级检测")
@ResponseBody
public Result selectNewApp() {
return Result.success().put("data",appService.selectNewApp());
return Result.success().put("data", appService.selectNewApp());
}
@GetMapping("/openId/{code:.+}/{userId}")
@ApiOperation("根据code获取openid")
public Result getOpenid(@PathVariable("code") String code,@PathVariable("userId")Long userId) {
return userService.getOpenId(code,userId);
public Result getOpenid(@PathVariable("code") String code, @PathVariable("userId") Long userId) {
return userService.getOpenId(code, userId);
}
@RequestMapping(value = "/updateClientId", method = RequestMethod.GET)
@ApiOperation("绑定ClientId")
@ResponseBody
public Result updateClientId(String clientId,Long userId,Integer sysPhone ) {
public Result updateClientId(String clientId, Long userId, Integer sysPhone) {
userService.updateUserClientIdIsNull(clientId);
UserEntity userEntity=new UserEntity();
UserEntity userEntity = new UserEntity();
userEntity.setSysPhone(sysPhone);
userEntity.setUserId(userId);
userEntity.setClientid(clientId);
userService.updateById(userEntity);
userService.update(userEntity, new LambdaQueryWrapper<UserEntity>().eq(UserEntity::getUserId, userId));
return Result.success();
}

View File

@ -3,6 +3,7 @@ package com.sqx.modules.app.controller.app;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.sqx.common.annotation.Debounce;
import com.sqx.common.utils.Result;
import com.sqx.modules.app.entity.UserEntity;
import com.sqx.modules.app.service.IAppleService;
@ -143,6 +144,7 @@ public class AppLoginController {
@RequestMapping(value = "/registerCode", method = RequestMethod.POST)
@ApiOperation("app或h5注册或登录")
@ResponseBody
@Debounce(interval = 2500, value = "#phone")
public Result registerCode(@RequestParam String phone,String msg,String platform,Integer sysPhone,
String password,String inviterCode,String wxId,String qdCode) {
return userService.registerCode(phone,msg,platform,sysPhone,password,inviterCode,wxId,qdCode);

View File

@ -15,7 +15,7 @@ import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/app/moneyDetails")
@AllArgsConstructor
@Api("钱包明细")
@Api(value = "钱包明细app版本", tags = {"钱包明细app版本"})
public class AppUserMoneyDetailsController {
private UserMoneyDetailsService userMoneyDetailsService;
@ -25,8 +25,9 @@ public class AppUserMoneyDetailsController {
@Login
@ApiOperation("钱包明细")
@GetMapping("/queryUserMoneyDetails")
public Result queryUserMoneyDetails(Integer page, Integer limit, @RequestAttribute Long userId,Integer classify,Integer type) {
return userMoneyDetailsService.queryUserMoneyDetails(page, limit,null, userId,1,type);
public Result queryUserMoneyDetails(Integer page, Integer limit, @RequestAttribute Long userId,Integer classify,
Integer type, Integer moneyType, Integer viewType) {
return userMoneyDetailsService.queryUserMoneyDetails(page, limit,null, userId,classify,type, moneyType ,viewType);
}
@Login

View File

@ -0,0 +1,51 @@
package com.sqx.modules.app.controller.app;
import com.sqx.common.utils.Result;
import com.sqx.modules.app.annotation.Login;
import com.sqx.modules.userSign.dto.UserSignDTO;
import com.sqx.modules.userSign.service.UserSignRecordService;
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.GetMapping;
import org.springframework.web.bind.annotation.RequestAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @author tankaikai
* @since 2024-12-19 15:23
*/
@Slf4j
@RestController
@Api(value = "用户签到", tags = {"用户签到"})
@RequestMapping(value = "/app/userSignRecord")
public class AppUserSignController {
@Autowired
private UserSignRecordService userSignRecordService;
/**
* 获取用户连续签到数据
*/
@Login
@GetMapping("/getUserSignData")
@ApiOperation("获取用户连续签到数据")
public Result getUserSignData(@RequestAttribute("userId") Long userId) {
UserSignDTO data = userSignRecordService.getUserSignData(userId);
return Result.success().put("data", data);
}
/**
* 获取连续签到奖励配置
*/
@Login
@GetMapping("/getUserSignAwardConfig")
@ApiOperation(value = "获取连续签到奖励配置", notes = "如:[7,7] = 连续签到7天奖励7元")
public Result getUserSignAwardConfig() {
String[] data = userSignRecordService.getUserSignAwardConfig();
return Result.success().put("data", data);
}
}

View File

@ -1,14 +1,13 @@
package com.sqx.modules.app.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sqx.modules.app.entity.UserEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
* 用户
@ -17,7 +16,7 @@ import java.util.Map;
public interface UserDao extends BaseMapper<UserEntity> {
IPage<UserEntity> selectUserPage(@Param("page") Page<UserEntity> page, @Param("search") String search, @Param("sex") Integer sex, @Param("platform") String platform,
List<UserEntity> selectUserPage(@Param("search") String search, @Param("sex") Integer sex, @Param("platform") String platform,
@Param("sysPhone") String sysPhone, @Param("status") Integer status, @Param("member") Integer member,
@Param("inviterCode") String inviterCode, @Param("userName") String userName,
@Param("invitationCode") String invitationCode, @Param("startTime") String startTime,
@ -31,13 +30,13 @@ public interface UserDao extends BaseMapper<UserEntity> {
Double queryPayMoney(@Param("type") int type, @Param("date") String date,String qdCode);
IPage<Map<String, Object>> queryCourseOrder(Page iPage,@Param("type") int type, @Param("date") String date,Long sysUserId);
List<Map<String, Object>> queryCourseOrder(@Param("type") int type, @Param("start") String start, @Param("end") String end,Long sysUserId);
int userMessage( String date, int type,String qdCode,Integer vipType);
int insertUser(UserEntity userEntity);
IPage<UserEntity> selectInviteUserList(Page<UserEntity> page,String userName,String phone);
List<UserEntity> selectInviteUserList(@Param("queryUserIdList") Set<Long> queryUserIdList);
int selectUserOnLineCount(String qdCode);

View File

@ -3,14 +3,27 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sqx.modules.app.entity.UserMoney;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import java.math.BigDecimal;
@Mapper
public interface UserMoneyDao extends BaseMapper<UserMoney> {
void updateMayMoney(@Param("type") Integer type, @Param("userId")Long userId, @Param("money") Double money);
void updateMayAmount(@Param("type") Integer type, @Param("userId")Long userId, @Param("money") Double amount);
void updateMayAmount(@Param("type") Integer type, @Param("userId")Long userId, @Param("amount") Double amount);
void updateSysMoney(@Param("type") Integer type, @Param("sysUserId")Long sysUserId, @Param("money") Double money);
@Select("select sum(money) from user_money_details where user_id=#{userId} and classify in (6,1) and (content like '%额外奖励金币%' or content like '获取金币')")
BigDecimal sumMoney(Long userId);
@Select("select sum(money) from user_money_details where user_id=#{userId} and classify=6 and content like '%额外奖励现金红包%'")
BigDecimal sumMoney2(Long userId);
@Update("update user_money set amount=amount+#{money} where user_id=#{userId}")
Boolean incrMoney(@Param("money") String money, @Param("userId") Long userId);
@Update("update user_money set amount=amount-#{money} where user_id=#{userId}")
Boolean decrMoney(@Param("money") String money, @Param("userId") Long userId);
}

View File

@ -4,10 +4,21 @@ import com.sqx.modules.app.entity.UserMoneyDetails;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.Map;
@Mapper
public interface UserMoneyDetailsDao extends BaseMapper<UserMoneyDetails> {
Double monthIncome(@Param("date") String date,@Param("userId") Long userId);
/**
* 查询用户邀请收益
*/
Double queryUserInviteMoney(@Param("userId") Long userId);
/**
* 查询用户邀请金币
*/
Double queryUserInviteGoldMoney(@Param("userId") Long userId);
}

View File

@ -0,0 +1,15 @@
package com.sqx.modules.app.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sqx.modules.app.entity.UserPrizeExchange;
import org.apache.ibatis.annotations.Mapper;
/**
* 用户奖品兑换
*
* @author tankaikai
* @since 2024-12-20 18:11
*/
@Mapper
public interface UserPrizeExchangeDao extends BaseMapper<UserPrizeExchange> {
}

View File

@ -0,0 +1,13 @@
package com.sqx.modules.app.dto;
import lombok.Data;
import javax.validation.constraints.NotBlank;
@Data
public class AuthCertNoDTO {
@NotBlank
private String name;
@NotBlank
private String idNum;
}

View File

@ -0,0 +1,19 @@
package com.sqx.modules.app.dto;
import lombok.Data;
import javax.validation.constraints.NotBlank;
@Data
public class AuthDTO {
@NotBlank
private String name;
@NotBlank
private String idNum;
@NotBlank
private String accountNo;
@NotBlank
private String mobile;
}

View File

@ -0,0 +1,13 @@
package com.sqx.modules.app.dto;
import lombok.Data;
/**
* @author tankaikai
* @since 2025-01-09 10:37
*/
@Data
public class AuthRespDTO {
private String respJson;
private String bankName;
}

View File

@ -2,6 +2,8 @@ package com.sqx.modules.app.entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;
import java.io.Serializable;
@ -13,6 +15,7 @@ import java.io.Serializable;
@TableName("app")
public class App implements Serializable {
@TableId
@JsonSerialize(using = ToStringSerializer.class)
private Long id;
private String createAt;

View File

@ -0,0 +1,68 @@
package com.sqx.modules.app.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import java.io.Serializable;
import java.util.Date;
/**
*
* @TableName invite_achievement
*/
@TableName(value ="invite_achievement")
@Data
@EqualsAndHashCode
@ToString
public class InviteAchievement implements Serializable {
/**
*
*/
@TableId(type = IdType.ID_WORKER)
@JsonSerialize(using = ToStringSerializer.class)
private Long id;
/**
* 邀请用户用户id -- 上级
*/
@JsonSerialize(using = ToStringSerializer.class)
private Long userId;
/**
* 下级被邀请用户id 当前达标用户id
*/
@JsonSerialize(using = ToStringSerializer.class)
private Long targetUserId;
/**
* 达标次数
*/
private Integer count;
/**
* 是否首次达标
*/
private Integer state;
/**
* 一次性任务领取记录 默认为空 存储为 taskId,taskId
*/
private String tasks;
/**
* 创建时间
*/
private Date createTime;
private Date updateTime;
@TableField(exist = false)
private static final long serialVersionUID = 1L;
}

View File

@ -2,6 +2,8 @@ package com.sqx.modules.app.entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;
import java.io.Serializable;
@ -17,6 +19,7 @@ public class Msg implements Serializable {
private static final long serialVersionUID = 1L;
@TableId
@JsonSerialize(using = ToStringSerializer.class)
private Long id;
private String code;

View File

@ -0,0 +1,28 @@
package com.sqx.modules.app.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.io.Serializable;
/**
* 用户黑名单
* @author tankaikai
* @since 2025-01-07 12:56
*/
@Data
@TableName(value ="tb_user_blacklist")
public class TbUserBlacklist implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(type=IdType.AUTO)
private Long id;
private String idCardNo;
private String realName;
}

View File

@ -0,0 +1,25 @@
package com.sqx.modules.app.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.io.Serializable;
/**
* 提现黑名单表
* @author tankaikai
* @since 2025-01-07 12:56
*/
@Data
@TableName(value ="tb_withdraw_blacklist")
public class TbWithdrawBlacklist implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(type=IdType.AUTO)
private Long id;
private String realName;
}

View File

@ -11,7 +11,7 @@ public class UserDetails {
*/
private int monthlyOrderNum;
/**
* 本月充值金
* 本月充值金
*/
private BigDecimal monthlyRechargeMoney;
/**
@ -19,7 +19,7 @@ public class UserDetails {
*/
private int monthWithdrawalNum;
/**
* 本月提现金
* 本月提现金
*/
private BigDecimal monthlyWithdrawalMoney;

View File

@ -5,6 +5,8 @@ import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -21,182 +23,189 @@ import java.math.BigDecimal;
@ApiModel("用户")
@TableName("tb_user")
public class UserEntity implements Serializable {
private static final long serialVersionUID = 1L;
private static final long serialVersionUID = 1L;
/**
* 用户ID
*/
@Excel(name = "用户id", orderNum = "1")
@ApiModelProperty("用户id")
@TableId(type = IdType.AUTO, value = "user_id")
private Long userId;
/**
* 用户名
*/
@Excel(name = "用户昵称", orderNum = "2")
@ApiModelProperty("用户名")
@TableField("user_name")
private String userName;
/**
* 用户ID
*/
@Excel(name = "用户id", orderNum = "1")
@ApiModelProperty("用户id")
@TableId(type = IdType.ID_WORKER)
@JsonSerialize(using = ToStringSerializer.class)
private Long userId;
/**
* 用户名
*/
@Excel(name = "用户昵称", orderNum = "2")
@ApiModelProperty("用户名")
@TableField("user_name")
private String userName;
/**
* 手机号
*/
@Excel(name = "手机号", orderNum = "4")
@ApiModelProperty("手机号")
private String phone;
/**
* 手机号
*/
@Excel(name = "手机号", orderNum = "4")
@ApiModelProperty("手机号")
private String phone;
/**
* 头像
*/
@Excel(name = "头像", orderNum = "3")
@ApiModelProperty("头像")
private String avatar;
/**
* 头像
*/
@Excel(name = "头像", orderNum = "3")
@ApiModelProperty("头像")
private String avatar;
/**
* 性别 1男 2女
*/
@ApiModelProperty("性别 1男 2女")
private Integer sex;
/**
* 性别 1男 2女
*/
@ApiModelProperty("性别 1男 2女")
private Integer sex;
/**
* 微信小程序openid
*/
@ApiModelProperty("微信小程序openid")
@TableField("open_id")
private String openId;
/**
* 微信小程序openid
*/
@ApiModelProperty("微信小程序openid")
@TableField("open_id")
private String openId;
/**
* 微信小程序openid
*/
@ApiModelProperty("微信公众号openid")
@TableField("wx_id")
private String wxId;
/**
* 微信小程序openid
*/
@ApiModelProperty("微信公众号openid")
@TableField("wx_id")
private String wxId;
/**
* 微信app openid
*/
@ApiModelProperty("微信app openid")
@TableField("wx_open_id")
private String wxOpenId;
/**
* 微信app openid
*/
@ApiModelProperty("微信app openid")
@TableField("wx_open_id")
private String wxOpenId;
/**
* 抖音小程序openId
*/
private String dyOpenId;
/**
* 抖音小程序openId
*/
private String dyOpenId;
/**
* 快手小程序openId
*/
private String ksOpenId;
/**
* 快手小程序openId
*/
private String ksOpenId;
/**
* 密码
*/
private String password;
/**
* 密码
*/
private String password;
/**
* 创建时间
*/
@Excel(name = "创建时间", orderNum = "13", width = 18)
@TableField("create_time")
private String createTime;
/**
* 创建时间
*/
@Excel(name = "创建时间", orderNum = "13", width = 18)
@TableField("create_time")
private String createTime;
/**
* 更新时间
*/
@TableField("update_time")
private String updateTime;
/**
* 更新时间
*/
@TableField("update_time")
private String updateTime;
/**
* 苹果id
*/
@TableField("apple_id")
private String appleId;
/**
* 苹果id
*/
@TableField("apple_id")
private String appleId;
/**
* 手机类型 1安卓 2ios
*/
@TableField("sys_phone")
private Integer sysPhone;
/**
* 手机类型 1安卓 2ios
*/
@TableField("sys_phone")
private Integer sysPhone;
/**
* 状态 1正常 2禁用
*/
@Excel(name = "状态", orderNum = "13", replace = {"正常_1", "禁用_1"})
private Integer status;
/**
* 状态 1正常 2禁用
*/
@Excel(name = "状态", orderNum = "13", replace = {"正常_1", "禁用_1"})
private Integer status;
/**
* 来源 app 小程序 公众号
*/
@Excel(name = "渠道来源", orderNum = "9")
private String platform;
/**
* 来源 app 小程序 公众号
*/
@Excel(name = "渠道来源", orderNum = "9")
@TableField(select = false)
private String platform;
/**
* 积分
*/
private Integer jifen;
/**
* 积分
*/
private Integer jifen;
/**
* 邀请码
*/
@Excel(name = "邀请码", orderNum = "5")
@TableField("invitation_code")
private String invitationCode;
/**
* 邀请码
*/
@Excel(name = "邀请码", orderNum = "5")
@TableField("invitation_code")
private String invitationCode;
/**
* 邀请人邀请码
*/
@Excel(name = "邀请人邀请码", orderNum = "6",width = 15)
@TableField("inviter_code")
private String inviterCode;
/**
* 邀请人邀请码
*/
@Excel(name = "邀请人邀请码", orderNum = "6", width = 15)
@TableField("inviter_code")
private String inviterCode;
private String clientid;
private String clientid;
@Excel(name = "支付宝账号", orderNum = "8", width = 18)
private String zhiFuBao;
@Excel(name = "支付宝账号", orderNum = "8", width = 18)
private String zhiFuBao;
@Excel(name = "支付宝名称", orderNum = "8", width = 18)
private String zhiFuBaoName;
@Excel(name = "支付宝名称", orderNum = "8", width = 18)
@TableField("zhi_fu_bao_name")
private String zhiFuBaoName;
@Excel(name = "一级推广收益比例", orderNum = "8", width = 18)
private BigDecimal rate;
@Excel(name = "一级推广收益比例", orderNum = "8", width = 18)
private BigDecimal rate;
@Excel(name = "二级推广收益比例", orderNum = "8", width = 18)
private BigDecimal twoRate;
@Excel(name = "二级推广收益比例", orderNum = "8", width = 18)
private BigDecimal twoRate;
/**
* 最后一次在线时间
*/
private String onLineTime;
/**
* 最后一次在线时间
*/
private String onLineTime;
/**
* 渠道码
*/
private String qdCode;
/**
* 渠道码
*/
private String qdCode;
/**
* 是否是新用户 1否
*/
private Integer isNewUser;
/**
* 邀请人id
*/
private Long inviterUserId;
@TableField(exist = false)
private String sysUserName;
/**
* 是否是新用户 1否
*/
private Integer isNewUser;
@TableField(exist = false)
private String sysUserName;
@TableField(exist = false)
private Integer member;
@TableField(exist = false)
private Integer member;
@TableField(exist = false)
private Integer counts;
@TableField(exist = false)
private Integer counts;
@TableField(exist = false)
private BigDecimal money;
@TableField(exist = false)
private BigDecimal money;
@TableField(exist = false)
private String endTime;
@TableField(exist = false)
private Integer vipType;
@TableField(exist = false)
private String endTime;
@TableField(exist = false)
private Integer vipType;
}

View File

@ -0,0 +1,117 @@
package com.sqx.modules.app.entity;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
*
* @TableName user_info
*/
@TableName(value ="user_info")
@Data
public class UserInfo implements Serializable {
/**
*
*/
@TableId(type = IdType.ID_WORKER)
@JsonSerialize(using = ToStringSerializer.class)
private Long id;
/**
* 用户id
*/
@TableField(updateStrategy = FieldStrategy.NEVER)
@JsonSerialize(using = ToStringSerializer.class)
private Long userId;
/**
* 姓名
*/
private String certName;
/**
* 身份证号码
*/
private String certNo;
/**
* 银行账号
*/
private String accountNo;
/**
* 银行预留手机号
*/
private String mobile;
/**
* 银行预留手机号
*/
private String bankName;
/**
* 四要素接口响应报文
*/
private String respJson;
/**
* 修改时间
*/
private Date updateTime;
@TableField(exist = false)
private static final long serialVersionUID = 1L;
@Override
public boolean equals(Object that) {
if (this == that) {
return true;
}
if (that == null) {
return false;
}
if (getClass() != that.getClass()) {
return false;
}
UserInfo other = (UserInfo) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
&& (this.getCertName() == null ? other.getCertName() == null : this.getCertName().equals(other.getCertName()))
&& (this.getCertNo() == null ? other.getCertNo() == null : this.getCertNo().equals(other.getCertNo()))
&& (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()));
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
result = prime * result + ((getCertName() == null) ? 0 : getCertName().hashCode());
result = prime * result + ((getCertNo() == null) ? 0 : getCertNo().hashCode());
result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
return result;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", userId=").append(userId);
sb.append(", certName=").append(certName);
sb.append(", certNo=").append(certNo);
sb.append(", updateTime=").append(updateTime);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
}
}

View File

@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
@ -23,17 +25,18 @@ public class UserMoney implements Serializable {
* 主键id
*/
@ApiModelProperty("主键id")
@TableId(type = IdType.AUTO)
@TableId(type = IdType.ID_WORKER)
@JsonSerialize(using = ToStringSerializer.class)
private Long id;
/**
* 钱包金
* 钱包金
*/
@ApiModelProperty("钱包金")
@ApiModelProperty("钱包金")
private BigDecimal money;
/**
* 钱包金
* 钱包金
*/
@ApiModelProperty("钱包余额 钱")
private BigDecimal amount;
@ -43,6 +46,7 @@ public class UserMoney implements Serializable {
*/
@ApiModelProperty("用户id")
@TableField("user_id")
@JsonSerialize(using = ToStringSerializer.class)
private Long userId;
/**
@ -50,6 +54,10 @@ public class UserMoney implements Serializable {
*/
@ApiModelProperty("渠道用户id")
@TableField("sys_user_id")
@JsonSerialize(using = ToStringSerializer.class)
private Long sysUserId;
private BigDecimal inviteIncomeMoney;;
private BigDecimal inviteIncomeCoin;
}

View File

@ -1,35 +1,42 @@
package com.sqx.modules.app.entity;
import cn.hutool.core.date.DateUtil;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.dromara.easyes.annotation.IndexId;
import org.dromara.easyes.annotation.IndexName;
import java.io.Serializable;
import java.math.BigDecimal;
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("user_money_details")
@IndexName(value = "user_money_details", keepGlobalPrefix = true)
@ApiModel("钱包详情")
public class UserMoneyDetails implements Serializable {
/**
* 钱包详情id
*/
@ApiModelProperty("钱包详情id")
@TableId(type = IdType.AUTO)
@TableId(type = IdType.ID_WORKER)
@JsonSerialize(using = ToStringSerializer.class)
@IndexId(type = org.dromara.easyes.annotation.rely.IdType.CUSTOMIZE)
private Long id;
/**
* 用户id
*/
@TableField("user_id")
@ApiModelProperty("用户id")
@JsonSerialize(using = ToStringSerializer.class)
private Long userId;
/**
@ -37,23 +44,47 @@ public class UserMoneyDetails implements Serializable {
*/
@ApiModelProperty("渠道用户id")
@TableField("sys_user_id")
@JsonSerialize(using = ToStringSerializer.class)
private Long sysUserId;
@ApiModelProperty("源id")
@JsonSerialize(using = ToStringSerializer.class)
private Long sourceId;
/**
* 对应用户id
*/
@TableField("by_user_id")
@ApiModelProperty("对应用户id")
@JsonSerialize(using = ToStringSerializer.class)
private Long byUserId;
/**
* 标题
*/
@ApiModelProperty("标题")
private String title;
/**
* 1注册 2首次购买 3购买 4提现
/***
* 1 注册 上级
* 2 充值
* 3 购买
* 4 提现
* 5 现金大转盘
* 6 分享达标
* 7 任务领取
* 8 平台操作
* 9 订单退款
* 10 渠道推广
*/
@ApiModelProperty("1充值钱包明细 2提现钱包明细")
@ApiModelProperty(" * 1 注册 (上级)\n" +
" * 2 充值\n" +
" * 3 购买\n" +
" * 4 提现\n" +
" * 5 现金大转盘\n" +
" * 6 分享达标\n" +
" * 7 任务领取\n" +
" * 8 平台操作\n" +
" * 9 订单退款\n" +
" * 10 渠道推广")
private Integer classify;
/**
* 类别1充值2支出
@ -66,15 +97,19 @@ public class UserMoneyDetails implements Serializable {
@ApiModelProperty("状态 1待支付 2已到账 3取消")
private Integer state;
/**
*
*
*/
@ApiModelProperty("")
@ApiModelProperty("")
private BigDecimal money;
/**
* 内容
*/
@ApiModelProperty("内容")
private String content;
@ApiModelProperty("金额类型: 1 红包2金币")
private Integer moneyType;
/**
* 创建时间
*/
@ -82,5 +117,48 @@ public class UserMoneyDetails implements Serializable {
@ApiModelProperty("创建时间")
private String createTime;
public UserMoneyDetails() {
}
/**
* @param userId 用户Id tb_user的id
* @param sysUserId 系统用户Id tb_sys_user的id
* @param byUserId 对应用户Id
* @param title 标题
* @param classify 1 注册 上级2 充值 3 购买 4 提现 5 现金大转盘 6 分享达标 7 任务领取 8 平台操作 9 订单退款 10 渠道推广
* @param type 类别1充值2支出
* @param state 状态 1待支付 2已到账 3取消
* @param money 金额
* @param content 内容描述
*/
public UserMoneyDetails(Long userId, Long sysUserId, Long byUserId, String title, Integer classify, Integer type,
Integer state, BigDecimal money, String content, Integer moneyType, Long sourceId) {
this.userId = userId;
this.sysUserId = sysUserId;
this.byUserId = byUserId;
this.title = title;
this.classify = classify;
this.type = type;
this.state = state;
this.money = money;
this.content = content;
this.createTime = DateUtil.now();
this.moneyType = moneyType;
this.sourceId = sourceId;
}
public UserMoneyDetails(Long userId, Long sysUserId, Long byUserId, String title, Integer classify, Integer type,
Integer state, BigDecimal money, String content, Integer moneyType) {
this.userId = userId;
this.sysUserId = sysUserId;
this.byUserId = byUserId;
this.title = title;
this.classify = classify;
this.type = type;
this.state = state;
this.money = money;
this.content = content;
this.createTime = DateUtil.now();
this.moneyType = moneyType;
}
}

View File

@ -0,0 +1,81 @@
package com.sqx.modules.app.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 用户奖品兑换
*
* @author tankaikai
* @since 2024-12-20 17:52
*/
@Data
@TableName("user_prize_exchange")
public class UserPrizeExchange implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 奖品记录
*/
@TableId(type = IdType.ID_WORKER)
@JsonSerialize(using = ToStringSerializer.class)
private Long id;
/**
* 奖品引用id
*/
@JsonSerialize(using = ToStringSerializer.class)
private Long foreignId;
/**
* 活动类型 task-任务奖励 spinning-大转盘
*/
private String foreignType;
/**
* 奖品名称
*/
private String prizeName;
/**
* 奖品图片地址
*/
private String imgUrl;
/**
* 用户id
*/
@JsonSerialize(using = ToStringSerializer.class)
private Long userId;
/**
* 用户名
*/
private String userName;
/**
* 手机号
*/
private String phone;
/**
* 收货地址
*/
private String address;
/**
* 备注
*/
private String remark;
/**
* 状态 0-待发放 1-已发放
*/
private Integer status;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新时间
*/
private Date updateTime;
}

View File

@ -2,6 +2,8 @@ package com.sqx.modules.app.entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;
import java.io.Serializable;
@ -13,6 +15,7 @@ public class UserVip implements Serializable {
* 用户会员ID
*/
@TableId
@JsonSerialize(using = ToStringSerializer.class)
private Long vipId;
/**
* 会员类型
@ -21,6 +24,7 @@ public class UserVip implements Serializable {
/**
* 用户ID
*/
@JsonSerialize(using = ToStringSerializer.class)
private Long userId;
/**

View File

@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
@ -20,7 +22,8 @@ import java.math.BigDecimal;
@ApiModel("会员详情")
public class VipDetails implements Serializable {
@TableId(type = IdType.AUTO)
@TableId
@JsonSerialize(using = ToStringSerializer.class)
private Long id;
@ApiModelProperty("会员类型")

View File

@ -1,14 +1,29 @@
package com.sqx.modules.app.interceptor;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.thread.ThreadUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.sqx.common.exception.CzgException;
import com.sqx.common.exception.SqxException;
import com.sqx.common.utils.DateUtils;
import com.sqx.common.utils.IPUtils;
import com.sqx.modules.app.annotation.Login;
import com.sqx.modules.app.entity.TbUserBlacklist;
import com.sqx.modules.app.entity.UserEntity;
import com.sqx.modules.app.entity.UserInfo;
import com.sqx.modules.app.mapper.TbUserBlacklistMapper;
import com.sqx.modules.app.service.UserInfoService;
import com.sqx.modules.app.service.UserService;
import com.sqx.modules.app.utils.JwtUtils;
import com.sqx.modules.redisService.RedisService;
import io.jsonwebtoken.Claims;
import com.sqx.modules.app.annotation.Login;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Component;
@ -21,54 +36,103 @@ import java.util.Date;
/**
* 权限(Token)验证
*
*/
@Component
public class AuthorizationInterceptor extends HandlerInterceptorAdapter {
private static final Logger log = LoggerFactory.getLogger(AuthorizationInterceptor.class);
@Autowired
private JwtUtils jwtUtils;
@Autowired
private UserService userService;
@Autowired
private UserInfoService userInfoService;
@Autowired
private TbUserBlacklistMapper tbUserBlacklistMapper;
private final RedisService redisService;
public static final String USER_KEY = "userId";
public AuthorizationInterceptor(RedisService redisService) {
this.redisService = redisService;
}
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
Login annotation;
if(handler instanceof HandlerMethod) {
if (handler instanceof HandlerMethod) {
annotation = ((HandlerMethod) handler).getMethodAnnotation(Login.class);
}else{
} else {
return true;
}
if(annotation == null){
if (annotation == null) {
return true;
}
//获取用户凭证
// 获取用户凭证
String token = request.getHeader(jwtUtils.getHeader());
if(StringUtils.isBlank(token)){
if (StringUtils.isBlank(token)) {
token = request.getParameter(jwtUtils.getHeader());
}
//凭证为空
if(StringUtils.isBlank(token)){
// 凭证为空
if (StringUtils.isBlank(token)) {
throw new SqxException(jwtUtils.getHeader() + "不能为空", HttpStatus.UNAUTHORIZED.value());
}
Claims claims = jwtUtils.getClaimByToken(token);
if(claims == null || jwtUtils.isTokenExpired(claims.getExpiration())){
if (claims == null || jwtUtils.isTokenExpired(claims.getExpiration())) {
throw new SqxException(jwtUtils.getHeader() + "失效,请重新登录", HttpStatus.UNAUTHORIZED.value());
}
//设置userId到request里后续根据userId获取用户信息
long userId = Long.parseLong(claims.getSubject());
request.setAttribute(USER_KEY, userId);
//记录用户最后一次调用接口的时间
UserEntity userEntity=new UserEntity();
userEntity.setUserId(userId);
userEntity.setOnLineTime(DateUtils.format(new Date()));
userService.updateById(userEntity);
String ip = IPUtils.getIpAddr(request); // 获取用户的 IP 地址
// 检查用户是否超过限流
if (redisService.checkIpJumpLimit(userId, ip)) {
log.warn("用户地址跳动频繁,封禁: {}", userId);
if (!redisService.isSetUserState(userId)) {
ThreadUtil.execAsync(() -> {
userService.addBlackUser(userId,"IP频繁跳动");
});
}
throw new CzgException("ip跳动过于频繁请联系管理员解封");
}
// ThreadUtil.execAsync(() -> {
// redisService.recordUrlVisitCountWithIp(userId, request.getRequestURI(), ip);
// });
// 设置 userId request 后续根据 userId 获取用户信息
UserEntity user = userService.selectUserById(userId);
if(user == null) {
throw new SqxException("会话失效,请重新登录", HttpStatus.UNAUTHORIZED.value());
}
if (user != null && user.getStatus().equals(0)) {
throw new CzgException("异常行为用户: {}" + user.getUserId());
}
// 实名认证信息
UserInfo userInfo = userInfoService.getOne(new LambdaQueryWrapper<UserInfo>().eq(UserInfo::getUserId, user.getUserId()));
if (userInfo != null && StrUtil.isNotBlank(userInfo.getCertNo())) {
TbUserBlacklist blacklist = tbUserBlacklistMapper.selectOne(Wrappers.<TbUserBlacklist>lambdaQuery().eq(TbUserBlacklist::getIdCardNo, userInfo.getCertNo()));
if (blacklist != null) {
// 提出用户
throw new SqxException(jwtUtils.getHeader() + "失效,请重新登录", HttpStatus.UNAUTHORIZED.value());
}
}
if (redisService.isRecordUserOnLineTime(userId)) {
ThreadUtil.execAsync(() -> {
// 记录用户最后一次调用接口的时间
UserEntity userEntity = new UserEntity();
userEntity.setUserId(userId);
userEntity.setOnLineTime(DateUtils.format(new Date()));
userService.updateById(userEntity);
});
}
return true;
}
}

View File

@ -0,0 +1,31 @@
package com.sqx.modules.app.mapper;
import com.sqx.modules.app.entity.InviteAchievement;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;
/**
* @author Administrator
* @description 针对表invite_achievement的数据库操作Mapper
* @createDate 2024-12-30 13:26:18
* @Entity com.sqx.modules.app.entity.InviteAchievement
*/
@Mapper
public interface InviteAchievementMapper extends BaseMapper<InviteAchievement> {
@Update("update invite_achievement set count = count + #{i}, update_time=now() where id = #{id} and user_id = #{userId}")
int incrCount(Long id, Long userId, int i);
@Insert("INSERT INTO invite_achievement (user_id, source_user_id, count, state, create_time)\n" +
"SELECT #{userId}, #{sourceUserId}, #{count}, #{state}, #{createTime} " +
"WHERE NOT EXISTS ( " +
" SELECT 1 FROM invite_achievement WHERE user_id = #{userId} " +
");")
boolean insertNotExists(InviteAchievement inviteAchievement);
}

View File

@ -0,0 +1,14 @@
package com.sqx.modules.app.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sqx.modules.app.entity.TbUserBlacklist;
import org.apache.ibatis.annotations.Mapper;
/**
* 实名认证黑名单 Mapper
* @author tankaikai
* @since 2025-01-07 12:56
*/
@Mapper
public interface TbUserBlacklistMapper extends BaseMapper<TbUserBlacklist> {
}

View File

@ -0,0 +1,14 @@
package com.sqx.modules.app.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sqx.modules.app.entity.TbWithdrawBlacklist;
import org.apache.ibatis.annotations.Mapper;
/**
* 提现黑名单 Mapper
* @author tankaikai
* @since 2025-01-07 12:56
*/
@Mapper
public interface TbWithdrawBlacklistMapper extends BaseMapper<TbWithdrawBlacklist> {
}

View File

@ -0,0 +1,20 @@
package com.sqx.modules.app.mapper;
import com.sqx.modules.app.entity.UserInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
/**
* @author Administrator
* @description 针对表user_info的数据库操作Mapper
* @createDate 2025-01-02 14:15:08
* @Entity com.sqx.modules.app.entity.UserInfo
*/
@Mapper
public interface UserInfoMapper extends BaseMapper<UserInfo> {
}

View File

@ -19,7 +19,8 @@ public class CourseOrderResponse implements Serializable {
*/
private int coursenum;
/**
* 售卖金
* 售卖金
*/
private Double coursemoney;
private Long courseId;
}

View File

@ -0,0 +1,7 @@
package com.sqx.modules.app.service;
import java.util.HashMap;
public interface AdService {
HashMap<String, Object> getDetail(Long userId);
}

View File

@ -0,0 +1,10 @@
package com.sqx.modules.app.service;
import com.sqx.modules.app.dto.AuthRespDTO;
public interface AliService {
void authCertNo(String name, String idCard);
AuthRespDTO auth(String name, String idCard, String accountNo, String bankPreMobile);
}

View File

@ -0,0 +1,25 @@
package com.sqx.modules.app.service;
import com.sqx.modules.app.entity.InviteAchievement;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @author Administrator
* @description 针对表invite_achievement的数据库操作Service
* @createDate 2024-12-30 13:26:18
*/
public interface InviteAchievementService extends IService<InviteAchievement> {
int countByUserId(Long userId);
InviteAchievement getByUserId(Long userId);
int incrCount(Long id, Long userId, int i);
boolean insertNotExists(InviteAchievement inviteAchievement);
int countBySourceUserId(Long userId);
int countNum(Long userId, Integer signCount);
}

View File

@ -0,0 +1,33 @@
package com.sqx.modules.app.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.sqx.modules.app.entity.UserInfo;
import java.util.List;
/**
* @author Administrator
* @description 针对表user_info的数据库操作Service
* @createDate 2025-01-02 14:15:08
*/
public interface UserInfoService extends IService<UserInfo> {
UserInfo getByUserIdOrSave(long userId);
UserInfo getByUserId(long userId);
/**
* 查询用户是否实名
*/
boolean isAuth(long userId);
/**
* 通过查询用户实名信息 绑定的用户ID列表
*/
List<UserInfo> getUsersByNameAndCertNo(String certName,String certNo);
Integer countCertCount(String name, String idNum);
Integer countCertCount(String name, String idNum, String accountNo, String mobile);
int getAuthUserTag(long userId);
}

View File

@ -4,7 +4,13 @@ import com.baomidou.mybatisplus.extension.service.IService;
import com.sqx.common.utils.Result;
import com.sqx.modules.app.entity.UserMoneyDetails;
import java.util.Map;
public interface UserMoneyDetailsService extends IService<UserMoneyDetails> {
Result queryUserMoneyDetails(Integer page, Integer limit,Long sysUserId,Long userId,Integer classify,Integer type);
Double monthIncome(String date,Long userId);
Result queryUserMoneyDetails(Integer page, Integer limit, Long sysUserId, Long userId, Integer classify,
Integer type, Integer moneyType, Integer viewType);
Double monthIncome(String date, Long userId);
Map<String, Double> queryUserTotalEarning(Long userId);
}

View File

@ -7,12 +7,7 @@ public interface UserMoneyService extends IService<UserMoney> {
UserMoney selectUserMoneyByUserId(Long userId);
UserMoney selectSysUserMoneyByUserId(Long userId);
void updateMoney(int i, Long userId, double money);
void updateAmount(int i, Long userId, double amount);
void updateSysMoney(int i, Long userId, double money);
}

View File

@ -0,0 +1,38 @@
package com.sqx.modules.app.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.sqx.common.utils.PageUtils;
import com.sqx.modules.app.entity.UserPrizeExchange;
import java.util.Map;
/**
* 用户奖品兑换Service
*
* @author tankaikai
* @since 2024-12-20 18:04
*/
public interface UserPrizeExchangeService extends IService<UserPrizeExchange> {
/**
* 分页查询
*
* @param params
* @return
*/
PageUtils page(Map<String, Object> params);
/**
* 兑换奖品
*
* @param entity
*/
void exchange(Long currentUserId, UserPrizeExchange entity);
/**
* 发放奖品
*
* @param dto
*/
void deliver(UserPrizeExchange dto);
}

View File

@ -2,16 +2,15 @@ package com.sqx.modules.app.service;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.sqx.common.utils.PageUtils;
import com.sqx.common.utils.Result;
import com.sqx.modules.app.dto.AuthCertNoDTO;
import com.sqx.modules.app.dto.AuthDTO;
import com.sqx.modules.app.entity.UserEntity;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;
/**
* 用户
@ -214,7 +213,7 @@ public interface UserService extends IService<UserEntity> {
Double queryPayMoney(int type,String qdCode);
IPage<Map<String, Object>> queryCourseOrder(Page<Map<String, Object>> iPage, int type, String date,Long sysUserId);
PageUtils queryCourseOrder(Long page, Long limit, int type, String date,Long sysUserId);
int userMessage( String date, int type,String qdCode,Integer vipType);
@ -227,4 +226,13 @@ public interface UserService extends IService<UserEntity> {
int updateUserClientIdIsNull(String clientid);
void firstBindAwardsMoney(UserEntity entity);
/**
* 封禁拉黑用户
* 用户行为
*/
void addBlackUser(Long userId,String behavior);
UserEntity queryByInvitationCodeOrUserId(Long inviterUserId, String invitationCode);
}

View File

@ -0,0 +1,29 @@
package com.sqx.modules.app.service.impl;
import com.sqx.common.utils.RedisUtils;
import com.sqx.modules.app.service.AdService;
import com.sqx.modules.redisService.impl.RedisServiceImpl;
import org.springframework.stereotype.Service;
import java.util.HashMap;
@Service
public class AdServiceImpl implements AdService {
private final RedisServiceImpl redisServiceImpl;
public AdServiceImpl(RedisServiceImpl redisServiceImpl) {
this.redisServiceImpl = redisServiceImpl;
}
@Override
public HashMap<String, Object> getDetail(Long userId) {
Long freeWatchRemainTime = redisServiceImpl.getFreeWatchRemainTime(userId, false);
Long permanentlyFreeWatchRemainTime = redisServiceImpl.getFreeWatchRemainTime(userId, true);
return new HashMap<String, Object>(){{
put("adFreeWatchTime", permanentlyFreeWatchRemainTime);
put("payFreeWatchTime", freeWatchRemainTime);
put("totalFreeWatchTime", freeWatchRemainTime + permanentlyFreeWatchRemainTime);
}};
}
}

View File

@ -0,0 +1,149 @@
package com.sqx.modules.app.service.impl;
import cn.hutool.core.lang.Validator;
import cn.hutool.core.util.IdcardUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.core.util.URLUtil;
import cn.hutool.http.HttpUtil;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.aliyun.dytnsapi20200217.Client;
import com.aliyun.dytnsapi20200217.models.CertNoTwoElementVerificationRequest;
import com.aliyun.dytnsapi20200217.models.CertNoTwoElementVerificationResponse;
import com.aliyun.teautil.models.RuntimeOptions;
import com.sqx.common.exception.SqxException;
import com.sqx.modules.app.dto.AuthRespDTO;
import com.sqx.modules.app.service.AliService;
import com.sqx.modules.common.entity.CommonInfo;
import com.sqx.modules.common.service.CommonInfoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import javax.annotation.PostConstruct;
import java.nio.charset.Charset;
import java.util.HashMap;
import java.util.Map;
import java.util.regex.Pattern;
@Service
@Slf4j
public class AliServiceImpl implements AliService {
private final CommonInfoService commonInfoService;
private Client client;
public AliServiceImpl(CommonInfoService commonInfoService) {
this.commonInfoService = commonInfoService;
}
@PostConstruct
public void init() throws Exception {
CommonInfo keyIdInfo = commonInfoService.findOne(85);
CommonInfo securityInfo = commonInfoService.findOne(86);
com.aliyun.teaopenapi.models.Config config = new com.aliyun.teaopenapi.models.Config()
// 必填请确保代码运行环境设置了环境变量 ALIBABA_CLOUD_ACCESS_KEY_ID
.setAccessKeyId(keyIdInfo.getValue())
// 必填请确保代码运行环境设置了环境变量 ALIBABA_CLOUD_ACCESS_KEY_SECRET
.setAccessKeySecret(securityInfo.getValue());
config.endpoint = "dytnsapi.aliyuncs.com";
this.client = new Client(config);
}
@Override
public void authCertNo(String name, String idCard) {
log.info("阿里云二要素认证请求参数: {} {}", name, idCard);
CertNoTwoElementVerificationRequest certNoTwoElementVerificationRequest = new com.aliyun.dytnsapi20200217.models.CertNoTwoElementVerificationRequest()
.setAuthCode("t92K8i9ae6")
.setCertName(name)
.setCertNo(idCard);
RuntimeOptions runtime = new com.aliyun.teautil.models.RuntimeOptions();
try {
CertNoTwoElementVerificationResponse resp = client.certNoTwoElementVerificationWithOptions(certNoTwoElementVerificationRequest, runtime);
log.info("阿里云二要素认证响应参数: {}", resp);
if (resp.getStatusCode() != 200) {
throw new SqxException("请求失败");
}
if (!"OK".equals(resp.getBody().getCode())) {
throw new SqxException(resp.getBody().getMessage());
}
if (!"1".equals(resp.getBody().getData().getIsConsistent())) {
throw new SqxException("身份证信息不匹配,认证失败");
}
} catch (Exception e) {
throw new SqxException(e.getMessage());
}
}
public static final Pattern CHINESE_NAME = Pattern.compile("^[\u2E80-\u9FFF·]{2,60}$");
/**
* 阿里云四要素认证
*
* @param name
* @param idCard
* @param accountNo
* @param bankPreMobile
*/
@Override
public AuthRespDTO auth(String name, String idCard, String accountNo, String bankPreMobile) {
log.info("阿里云四要素认证请求参数: {} {} {} {}", name, idCard, accountNo, bankPreMobile);
if (StrUtil.isBlank(name)) {
throw new SqxException("持卡人姓名不能为空");
}
if (StrUtil.isBlank(idCard)) {
throw new SqxException("身份证号码不能为空");
}
if (StrUtil.isBlank(accountNo)) {
throw new SqxException("银行卡卡号不能为空");
}
if (StrUtil.isBlank(bankPreMobile)) {
throw new SqxException("银行预留手机号码不能为空");
}
if (!Validator.isMactchRegex(CHINESE_NAME, name)) {
throw new SqxException("持卡人姓名不合法");
}
boolean validCard = IdcardUtil.isValidCard(idCard);
if (!validCard) {
throw new SqxException("身份证号码不合法");
}
validCard = Validator.isMobile(bankPreMobile);
if (!validCard) {
throw new SqxException("银行预留手机号码格式不正确");
}
String appcode = "f98606b602564d209f37fc02b0bd590c";
Map<String, String> headers = new HashMap<>(2);
//最后在header中的格式(中间是英文空格)为Authorization:APPCODE 83359fd73fe94948385f570e3c139105
headers.put("Authorization", "APPCODE " + appcode);
//根据API的要求定义相对应的Content-Type
headers.put("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
Map<String, Object> params = new HashMap<>();
params.put("accountNo", accountNo);
params.put("name", name);
params.put("idCardCode", idCard);
params.put("bankPreMobile", bankPreMobile);
String reqBody = URLUtil.encode(StrUtil.format("accountNo={}&name={}&idCardCode={}&bankPreMobile={}", accountNo, name, idCard, bankPreMobile), Charset.defaultCharset());
String respBody = HttpUtil.createPost("https://bkvip.market.alicloudapi.com/v3/bcheck").headerMap(headers, true).body(reqBody).timeout(15 * 1000).execute().body();
// {"error_code":0,"reason":"成功","result":{"respCode":"0","respMsg":"银行卡鉴权成功","bancardInfor":{"bankName":"招商银行","BankCode":"03080000","BankId":5,"type":"借记卡","cardname":"一卡通(银联卡)","tel":"95555","Icon":"2014121619271052743.gif"}},"sn":"010817431025283426800706871"}
// {"error_code":10028,"reason":"成功","result":{"respCode":"6","respMsg":"身份证格式有误","bancardInfor":{"bankName":"招商银行","BankCode":"03080000","BankId":5,"type":"借记卡","cardname":"一卡通(银联卡)","tel":"95555","Icon":"2014121619271052743.gif"}},"sn":"010817575524183118006799233"}
JSONObject ret = JSONUtil.parseObj(respBody);
JSONObject result = ret.getJSONObject("result");
Integer errorCode = ret.getInt("error_code");
String respCode = result.getStr("respCode");
if (errorCode == 0 && "0".equals(respCode)) {
} else {
throw new SqxException(result.getStr("respMsg"));
}
String bankName = null;
boolean isExist = result.containsKey("bancardInfor");
if (isExist) {
bankName = result.getJSONObject("bancardInfor").getStr("bankName");
}
AuthRespDTO dto = new AuthRespDTO();
dto.setBankName(bankName);
dto.setRespJson(respBody);
return dto;
}
}

View File

@ -0,0 +1,54 @@
package com.sqx.modules.app.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sqx.modules.app.entity.InviteAchievement;
import com.sqx.modules.app.service.InviteAchievementService;
import com.sqx.modules.app.mapper.InviteAchievementMapper;
import org.springframework.stereotype.Service;
/**
* @author Administrator
* @description 针对表invite_achievement的数据库操作Service实现
* @createDate 2024-12-30 13:26:18
*/
@Service
public class InviteAchievementServiceImpl extends ServiceImpl<InviteAchievementMapper, InviteAchievement>
implements InviteAchievementService{
@Override
public int countByUserId(Long userId) {
return count(new LambdaQueryWrapper<InviteAchievement>()
.eq(InviteAchievement::getUserId, userId));
}
@Override
public InviteAchievement getByUserId(Long userId) {
return getOne(new LambdaQueryWrapper<InviteAchievement>()
.eq(InviteAchievement::getTargetUserId, userId));
}
@Override
public int incrCount(Long id, Long userId, int i) {
return baseMapper.incrCount(id, userId,i);
}
@Override
public boolean insertNotExists(InviteAchievement inviteAchievement) {
return baseMapper.insertNotExists(inviteAchievement);
}
@Override
public int countBySourceUserId(Long userId) {
return count(new LambdaQueryWrapper<InviteAchievement>()
.eq(InviteAchievement::getState, 1)
.eq(InviteAchievement::getUserId, userId));
}
@Override
public int countNum(Long userId, Integer signCount) {
return count(new LambdaQueryWrapper<InviteAchievement>()
.eq(InviteAchievement::getUserId, userId)
.ge(InviteAchievement::getCount, signCount));
}
}

View File

@ -0,0 +1,121 @@
package com.sqx.modules.app.service.impl;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sqx.modules.app.entity.UserInfo;
import com.sqx.modules.app.mapper.UserInfoMapper;
import com.sqx.modules.app.service.UserInfoService;
import org.springframework.stereotype.Service;
import java.util.Comparator;
import java.util.List;
/**
* @author Administrator
* @description 针对表user_info的数据库操作Service实现
* @createDate 2025-01-02 14:15:08
*/
@Service
public class UserInfoServiceImpl extends ServiceImpl<UserInfoMapper, UserInfo>
implements UserInfoService {
@Override
public UserInfo getByUserIdOrSave(long userId) {
UserInfo userInfo = getOne(new LambdaQueryWrapper<UserInfo>()
.eq(UserInfo::getUserId, userId));
if (userInfo == null) {
userInfo = new UserInfo();
userInfo.setUserId(userId);
save(userInfo);
}
return userInfo;
}
@Override
public UserInfo getByUserId(long userId) {
UserInfo userInfo = getOne(new LambdaQueryWrapper<UserInfo>()
.eq(UserInfo::getUserId, userId));
if (userInfo == null) {
userInfo = new UserInfo();
userInfo.setUserId(userId);
}
return userInfo;
}
@Override
public boolean isAuth(long userId) {
UserInfo userInfo = getOne(new LambdaQueryWrapper<UserInfo>()
.eq(UserInfo::getUserId, userId)
.isNotNull(UserInfo::getCertName)
.isNotNull(UserInfo::getCertNo)
);
if (userInfo != null) {
return true;
}
return false;
}
@Override
public List<UserInfo> getUsersByNameAndCertNo(String certName, String certNo) {
List<UserInfo> userIds = baseMapper.selectList(new LambdaQueryWrapper<UserInfo>()
.eq(UserInfo::getCertName, certName)
.eq(UserInfo::getCertNo, certNo)
.select(UserInfo::getUserId)
);
return userIds;
}
@Override
public Integer countCertCount(String name, String idNum) {
return count(new LambdaQueryWrapper<UserInfo>()
.eq(UserInfo::getCertName, name)
.eq(UserInfo::getCertNo, idNum)
.isNotNull(UserInfo::getAccountNo)
.isNotNull(UserInfo::getMobile)
);
}
@Override
public Integer countCertCount(String name, String idNum, String accountNo, String mobile) {
return count(new LambdaQueryWrapper<UserInfo>()
.eq(UserInfo::getCertName, name)
.eq(UserInfo::getCertNo, idNum)
.eq(UserInfo::getAccountNo, accountNo)
.eq(UserInfo::getMobile, mobile)
);
}
/**
* 获取用户认证标签
* @param userId 用户id
* @return 0-未认证1-新用户2-老用户
*/
@Override
public int getAuthUserTag(long userId) {
UserInfo userInfo = getByUserId(userId);
if (userInfo == null) {
// 未认证
return 0;
}
if(StrUtil.isEmpty(userInfo.getCertNo())){
// 未认证
return 0;
}
String certNo = userInfo.getCertNo();
List<UserInfo> authUserlist = baseMapper.selectList(Wrappers.<UserInfo>lambdaQuery().eq(UserInfo::getCertNo, certNo));
// 同身份证号第一个认证用户
UserInfo firstAuth = authUserlist.stream().sorted(Comparator.comparingLong(UserInfo::getId)).findFirst().get();
if (firstAuth.getUserId() == userId) {
// 新用户
return 1;
}
// 老用户
return 2;
}
}

View File

@ -1,40 +1,79 @@
package com.sqx.modules.app.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.sqx.common.utils.PageUtils;
import com.sqx.common.utils.Result;
import com.sqx.modules.app.dao.UserMoneyDetailsDao;
import com.sqx.modules.app.entity.UserMoney;
import com.sqx.modules.app.entity.UserMoneyDetails;
import com.sqx.modules.app.service.UserMoneyDetailsService;
import com.sqx.modules.sys.entity.SysUserMoneyDetails;
import com.sqx.modules.sys.service.SysUserMoneyDetailsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Service
public class UserMoneyDetailsServiceImpl extends ServiceImpl<UserMoneyDetailsDao, UserMoneyDetails> implements UserMoneyDetailsService {
@Autowired
private SysUserMoneyDetailsService sysUserMoneyDetailsService;
@Override
public Result queryUserMoneyDetails(Integer page, Integer limit,Long sysUserId,Long userId,Integer classify,Integer type) {
IPage<UserMoneyDetails> page1 = new Page(page, limit);
QueryWrapper<UserMoneyDetails> queryWrapper = new QueryWrapper();
if(sysUserId!=null){
queryWrapper.eq("sys_user_id", sysUserId);
public Result queryUserMoneyDetails(Integer page, Integer limit, Long sysUserId, Long userId, Integer classify,
Integer type, Integer moneyType, Integer viewType) {
PageHelper.startPage(page, limit);
if (sysUserId != null) {
List<SysUserMoneyDetails> list = sysUserMoneyDetailsService.list(new LambdaQueryWrapper<SysUserMoneyDetails>()
.eq(SysUserMoneyDetails::getUserId, sysUserId).orderByDesc(SysUserMoneyDetails::getCreateTime));
return Result.success().put("data", PageUtils.page(new PageInfo<>(list), true));
}
if(userId!=null){
QueryWrapper<UserMoneyDetails> queryWrapper = new QueryWrapper();
if (userId != null) {
queryWrapper.eq("user_id", userId);
}
if(classify!=null){
if (classify != null) {
queryWrapper.eq("classify", classify);
}
if(type!=null){
if (type != null) {
queryWrapper.eq("type", type);
}
if (moneyType != null) {
queryWrapper.eq("money_type", moneyType);
}
if (viewType == 1) {
ArrayList<Integer> arrayList = new ArrayList<>();
arrayList.add(1);
arrayList.add(6);
queryWrapper.in("classify", arrayList);
}
queryWrapper.orderByDesc("create_time");
return Result.success().put("data", baseMapper.selectPage(page1, queryWrapper));
return Result.success().put("data", PageUtils.page(new PageInfo<>(baseMapper.selectList(queryWrapper)), true));
}
@Override
public Double monthIncome(String date, Long userId) {
return baseMapper.monthIncome(date,userId);
return baseMapper.monthIncome(date, userId);
}
@Override
public Map<String, Double> queryUserTotalEarning(Long userId) {
Double inviteMoney = baseMapper.queryUserInviteMoney(userId);
Double inviteGoldMoney = baseMapper.queryUserInviteGoldMoney(userId);
Map<String, Double> map = new HashMap<>(2);
map.put("inviteMoney", inviteMoney == null ? 0 : inviteMoney);
map.put("inviteGoldMoney", inviteGoldMoney == null ? 0 : inviteGoldMoney);
return map;
}
}

View File

@ -24,12 +24,6 @@ public class UserMoneyServiceImpl extends ServiceImpl<UserMoneyDao, UserMoney> i
baseMapper.updateMayAmount(i,userId,amount);
}
@Override
public void updateSysMoney(int i, Long userId, double money){
selectSysUserMoneyByUserId(userId);
baseMapper.updateSysMoney(i,userId,money);
}
@Override
public UserMoney selectUserMoneyByUserId(Long userId){
UserMoney userMoney = baseMapper.selectOne(new QueryWrapper<UserMoney>().eq("user_id", userId));
@ -42,19 +36,4 @@ public class UserMoneyServiceImpl extends ServiceImpl<UserMoneyDao, UserMoney> i
}
return userMoney;
}
@Override
public UserMoney selectSysUserMoneyByUserId(Long userId){
UserMoney userMoney = baseMapper.selectOne(new QueryWrapper<UserMoney>().eq("sys_user_id", userId));
if(userMoney==null){
userMoney=new UserMoney();
userMoney.setSysUserId(userId);
userMoney.setMoney(new BigDecimal("0.00"));
userMoney.setAmount(new BigDecimal("0.00"));
baseMapper.insert(userMoney);
}
return userMoney;
}
}

View File

@ -0,0 +1,225 @@
package com.sqx.modules.app.service.impl;
import cn.hutool.core.lang.Dict;
import cn.hutool.core.lang.Validator;
import cn.hutool.core.map.MapProxy;
import cn.hutool.core.util.ArrayUtil;
import cn.hutool.core.util.StrUtil;
import com.aliyun.tea.ValidateException;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.sqx.common.exception.SqxException;
import com.sqx.common.utils.Constant;
import com.sqx.common.utils.PageUtils;
import com.sqx.modules.app.dao.UserDao;
import com.sqx.modules.app.dao.UserPrizeExchangeDao;
import com.sqx.modules.app.entity.UserEntity;
import com.sqx.modules.app.entity.UserPrizeExchange;
import com.sqx.modules.app.service.UserMoneyDetailsService;
import com.sqx.modules.app.service.UserMoneyService;
import com.sqx.modules.app.service.UserPrizeExchangeService;
import com.sqx.modules.common.service.CommonInfoService;
import com.sqx.modules.discSpinning.dao.DiscSpinningRecordDao;
import com.sqx.modules.discSpinning.entity.DiscSpinningRecord;
import com.sqx.modules.discSpinning.service.DiscSpinningRecordService;
import com.sqx.modules.taskCenter.dao.TaskCenterRecordDao;
import com.sqx.modules.taskCenter.dao.TaskCenterRewardDao;
import com.sqx.modules.taskCenter.entity.TaskCenterRecord;
import com.sqx.modules.taskCenter.entity.TaskCenterReward;
import com.sqx.modules.userSign.service.UserSignRecordService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.Date;
import java.util.Map;
/**
* @author tankaikai
* @since 2024-12-20 18:10
*/
@Slf4j
@Service
public class UserPrizeExchangeServiceImpl extends ServiceImpl<UserPrizeExchangeDao, UserPrizeExchange> implements UserPrizeExchangeService {
@Resource
private DiscSpinningRecordDao discSpinningRecordDao;
@Resource
private DiscSpinningRecordService discSpinningRecordService;
@Resource
private TaskCenterRecordDao taskCenterRecordDao;
@Resource
private TaskCenterRewardDao taskCenterRewardDao;
@Resource
private CommonInfoService commonRepository;
@Resource
private UserMoneyService userMoneyService;
@Resource
private UserMoneyDetailsService userMoneyDetailsService;
@Resource
private UserSignRecordService userSignRecordService;
@Resource
private UserDao userDao;
@Override
public PageUtils page(Map<String, Object> params) {
MapProxy proxy = MapProxy.create(params);
Long foreignId = proxy.getLong("foreignId");
String foreignType = proxy.getStr("foreignType");
Long userId = proxy.getLong("userId");
String userName = proxy.getStr("userName");
String prizeName = proxy.getStr("prizeName");
Integer status = proxy.getInt("status");
String phone = proxy.getStr("phone");
String remark = proxy.getStr("remark");
String beginDate = proxy.getStr("beginDate");
String endDate = proxy.getStr("endDate");
LambdaQueryWrapper<UserPrizeExchange> wrapper = Wrappers.lambdaQuery();
wrapper.eq(foreignId != null, UserPrizeExchange::getForeignId, foreignId);
wrapper.eq(StrUtil.isNotEmpty(foreignType), UserPrizeExchange::getForeignType, foreignType);
wrapper.eq(userId != null, UserPrizeExchange::getUserId, userId);
wrapper.like(StrUtil.isNotEmpty(userName), UserPrizeExchange::getUserName, userName);
wrapper.like(StrUtil.isNotEmpty(prizeName), UserPrizeExchange::getPrizeName, prizeName);
wrapper.eq(status != null, UserPrizeExchange::getStatus, status);
wrapper.like(StrUtil.isNotEmpty(phone), UserPrizeExchange::getPhone, phone);
wrapper.like(StrUtil.isNotEmpty(remark), UserPrizeExchange::getRemark, remark);
if (StrUtil.isNotEmpty(beginDate)) {
wrapper.apply("create_time >= str_to_date({0}, '%Y-%m-%d %H:%i:%s')", beginDate + " 00:00:00");
}
if (StrUtil.isNotEmpty(endDate)) {
wrapper.apply("create_time <= str_to_date({0}, '%Y-%m-%d %H:%i:%s')", endDate + " 23:59:59");
}
wrapper.orderByDesc(UserPrizeExchange::getId);
long pageNum = proxy.getLong(Constant.PAGE, 1L);
long pageSize = proxy.getLong(Constant.LIMIT, 10L);
PageHelper.startPage((int) pageNum, (int) pageSize);
return PageUtils.page(new PageInfo<>(this.list(wrapper)));
}
@Override
@Transactional(rollbackFor = Exception.class)
public void exchange(Long currentUserId, UserPrizeExchange dto) {
if (dto.getForeignId() == null) {
throw new SqxException("中奖记录ID不能为空");
}
if (StrUtil.isEmpty(dto.getForeignType())) {
throw new SqxException("活动类型不能为空");
}
if (!ArrayUtil.contains(new String[]{"spinning", "task"}, dto.getForeignType())) {
throw new SqxException("仅限大转盘、任务活动兑换奖品");
}
if (StrUtil.isBlank(dto.getPhone())) {
throw new SqxException("用户手机号码不能为空");
}
try {
Validator.isMobile(dto.getPhone());
} catch (ValidateException e) {
throw new SqxException("用户手机号码不合法");
}
Dict dict = Dict.create();
if ("spinning".equals(dto.getForeignType())) {
QueryWrapper<DiscSpinningRecord> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("id", dto.getForeignId());
queryWrapper.eq("user_id", currentUserId);
DiscSpinningRecord record = discSpinningRecordService.getOne(queryWrapper);
if (record == null) {
throw new SqxException("中奖记录不存在");
}
dict.put("userId", record.getUserId());
dict.put("name", record.getName());
dict.put("imgUrl", record.getImgUrl());
dict.put("type", record.getType());
} else if ("task".equals(dto.getForeignType())) {
TaskCenterRecord record = taskCenterRecordDao.selectById(dto.getForeignId());
if (record == null) {
throw new SqxException("中奖记录不存在");
}
if (record.getSourceId() == null) {
throw new SqxException("中奖记录未关联奖品");
}
TaskCenterReward reward = taskCenterRewardDao.selectById(record.getSourceId());
if (reward == null) {
throw new SqxException("对应的奖品信息不存在");
}
dict.put("userId", record.getUserId());
dict.put("name", record.getName());
dict.put("imgUrl", reward.getImg());
dict.put("type", reward.getType());
}
Long userId = dict.getLong("userId");
String name = dict.getStr("name");
String imgUrl = dict.getStr("imgUrl");
Integer type = dict.getInt("type");
if (userId == null) {
throw new SqxException("中奖用户数据不完整");
}
if (currentUserId == null) {
throw new SqxException("未获取当前登录用户id");
}
if (!currentUserId.equals(userId)) {
throw new SqxException("兑奖用户和获奖用户不一致");
}
UserEntity user = userDao.selectById(userId);
if (user == null) {
throw new SqxException("兑奖用户不存在");
}
if (ArrayUtil.contains(new int[]{1, 2}, type)) {
throw new SqxException("仅限兑换实物、会员卡等奖项");
}
Integer count = baseMapper.selectCount(Wrappers.<UserPrizeExchange>lambdaQuery()
.eq(UserPrizeExchange::getForeignId, dto.getForeignId())
.eq(UserPrizeExchange::getForeignType, dto.getForeignType())
);
if (count != null && count > 0) {
throw new SqxException("奖品已兑换,请勿重复操作");
}
dto.setPrizeName(name);
dto.setUserId(userId);
dto.setUserName(user.getUserName());
dto.setStatus(0);
dto.setCreateTime(new Date());
dto.setImgUrl(imgUrl);
baseMapper.insert(dto);
if ("spinning".equals(dto.getForeignType())) {
discSpinningRecordDao.update(null,
Wrappers.<DiscSpinningRecord>lambdaUpdate()
.set(DiscSpinningRecord::getTarget, "3")
.set(DiscSpinningRecord::getTargetId, dto.getId())
.eq(DiscSpinningRecord::getId, dto.getForeignId())
);
} else if ("task".equals(dto.getForeignType())) {
taskCenterRecordDao.update(null,
Wrappers.<TaskCenterRecord>lambdaUpdate()
.set(TaskCenterRecord::getTargetId, dto.getId())
.eq(TaskCenterRecord::getId, dto.getForeignId())
);
}
}
@Override
public void deliver(UserPrizeExchange dto) {
Long id = dto.getId();
if (id == null) {
throw new SqxException("兑奖id不能为空");
}
UserPrizeExchange entity = baseMapper.selectById(id);
if (entity == null) {
throw new SqxException("兑奖订单不存在");
}
entity.setStatus(1);
if (StrUtil.isNotEmpty(dto.getAddress())) {
entity.setAddress(dto.getAddress());
}
if (StrUtil.isNotEmpty(dto.getRemark())) {
entity.setRemark(dto.getRemark());
}
entity.setUpdateTime(new Date());
baseMapper.updateById(entity);
}
}

View File

@ -17,9 +17,9 @@ public class UserVipServiceImpl extends ServiceImpl<UserVipDao, UserVip> impleme
return baseMapper.selectOne(queryWrapper);
}
@Scheduled(cron="0 */1 * * * ?")
// @Scheduled(cron="0 */1 * * * ?")
public void getEndVip() {
baseMapper.updateUserVipByEndTime();
// baseMapper.updateUserVipByEndTime();
}
}

View File

@ -3,6 +3,8 @@ package com.sqx.modules.banner.controller.app;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.sqx.common.utils.PageUtils;
import com.sqx.common.utils.Result;
import com.sqx.modules.banner.entity.Banner;
@ -13,6 +15,8 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* @author fang
* @date 2020/7/9
@ -38,7 +42,10 @@ public class AppBannerController {
@ApiOperation("查询所有banner图")
@ResponseBody
public Result selectBannerPage(Integer page,Integer limit,Integer classify) {
return Result.success().put("data", new PageUtils(bannerService.page(new Page<>(page,limit),new QueryWrapper<Banner>().eq("classify",classify))));
PageHelper.startPage(page,limit);
List<Banner> classify1 = bannerService.list(new QueryWrapper<Banner>().eq("classify", classify));
PageInfo<Banner> pageInfo = new PageInfo<>(classify1);
return Result.success().put("data", PageUtils.page(pageInfo));
}
@RequestMapping(value = "/clickBanner", method = RequestMethod.GET)
@ -49,4 +56,4 @@ public class AppBannerController {
}
}
}

View File

@ -1,8 +1,6 @@
package com.sqx.modules.banner.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sqx.modules.banner.entity.Banner;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -19,8 +17,8 @@ public interface BannerDao extends BaseMapper<Banner> {
List<Banner> selectLists(@Param("classify") Integer classify);
List<Banner> selectList(@Param("classify") Integer classify);
// List<Banner> selectList(@Param("classify") Integer classify);
IPage<Banner> selectBannerPage(Page<Banner> page,@Param("classify") Integer classify);
List<Banner> selectBanner(@Param("classify") Integer classify);
}

View File

@ -3,6 +3,8 @@ package com.sqx.modules.banner.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;
import java.io.Serializable;
@ -14,6 +16,7 @@ import java.io.Serializable;
@TableName("activity")
public class Activity implements Serializable {
@TableId(type = IdType.INPUT)
@JsonSerialize(using = ToStringSerializer.class)
private Long id;
private String createAt;

View File

@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.sqx.modules.course.entity.Course;
import lombok.AllArgsConstructor;
import lombok.Data;
@ -27,6 +29,7 @@ public class Banner implements Serializable {
* banner图id
*/
@TableId(type = IdType.INPUT)
@JsonSerialize(using = ToStringSerializer.class)
private Long id;
/**
@ -53,6 +56,10 @@ public class Banner implements Serializable {
* 分类 1 banner图 2 首页分类
*/
private Integer classify;
/**
* 跳转类型 1 内部 2 外部
*/
private Integer jumpType;
/**
* 跳转地址

View File

@ -1,9 +1,9 @@
package com.sqx.modules.banner.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.sqx.common.utils.PageUtils;
import com.sqx.common.utils.Result;
import com.sqx.modules.banner.dao.BannerDao;
@ -13,6 +13,9 @@ import com.sqx.modules.course.dao.CourseDao;
import com.sqx.modules.course.dao.CourseDetailsDao;
import com.sqx.modules.course.entity.Course;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import java.text.SimpleDateFormat;
@ -23,6 +26,7 @@ import java.util.List;
* banner图
*/
@Service
@CacheConfig(cacheNames = "banner")
public class BannerServiceImpl extends ServiceImpl<BannerDao, Banner> implements BannerService {
@Autowired
@ -34,23 +38,26 @@ public class BannerServiceImpl extends ServiceImpl<BannerDao, Banner> implements
@Override
@Cacheable(key = "#classify")
public List<Banner> selectBannerList(Integer classify) {
return bannerDao.selectList(classify);
return bannerDao.selectList(new QueryWrapper<Banner>().eq("classify", classify).eq("state", 1).orderByDesc("sort"));
}
@Override
@Cacheable(key = "#classify")
public List<Banner> selectBannerLists(Integer classify) {
return bannerDao.selectLists(classify);
}
@Override
public PageUtils selectBannerPage(Integer page,Integer limit,Integer classify) {
Page<Banner> pages=new Page<>(page,limit);
return new PageUtils(bannerDao.selectBannerPage(pages,classify));
public PageUtils selectBannerPage(Integer page, Integer limit, Integer classify) {
PageHelper.startPage(page, limit);
return PageUtils.page(new PageInfo<>(bannerDao.selectBanner(classify)));
}
@Override
@CacheEvict(cacheNames = "banner", allEntries = true)
public int saveBody(String image, String url, Integer sort) {
Banner banner = new Banner();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
@ -64,6 +71,7 @@ public class BannerServiceImpl extends ServiceImpl<BannerDao, Banner> implements
}
@Override
@CacheEvict(cacheNames = "banner", allEntries = true)
public int insertBanner(Banner banner) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date now = new Date();
@ -74,12 +82,13 @@ public class BannerServiceImpl extends ServiceImpl<BannerDao, Banner> implements
@Override
public Result clickBanner(Integer bannerId, int page, int limit) {
Page<Course> page1 = new Page<>(page, limit);
PageHelper.startPage(page, limit);
QueryWrapper<Course> queryWrapper = new QueryWrapper();
//查询banner 对应短剧
queryWrapper.eq("banner_id", bannerId);
IPage<Course> coursePage = courseDao.selectPage(page1, queryWrapper);
return Result.success().put("data", coursePage);
List<Course> coursePage = courseDao.selectList(queryWrapper);
PageInfo<Course> pageInfo = new PageInfo<>(coursePage);
return Result.success().put("data", PageUtils.page(pageInfo, true));
}
@ -89,11 +98,13 @@ public class BannerServiceImpl extends ServiceImpl<BannerDao, Banner> implements
}
@Override
@CacheEvict(cacheNames = "banner", allEntries = true)
public int deleteBannerById(Long id) {
return bannerDao.deleteById(id);
}
@Override
@CacheEvict(cacheNames = "banner", allEntries = true)
public Result updateBannerStateById(Long id) {
Banner banner = selectBannerById(id);
if (banner != null) {
@ -110,6 +121,7 @@ public class BannerServiceImpl extends ServiceImpl<BannerDao, Banner> implements
}
@Override
@CacheEvict(cacheNames = "banner", allEntries = true)
public int updateBannerById(Banner banner) {
return bannerDao.updateById(banner);
}

View File

@ -0,0 +1,40 @@
package com.sqx.modules.callback;
import com.sqx.common.exception.CzgException;
import com.sqx.modules.callback.service.UniAdCallbackRecordService;
import lombok.extern.slf4j.Slf4j;
import com.sqx.modules.callback.dao.UniAdCallBackDTO;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping("/uniCallBack")
@Slf4j
public class UniCallBackController {
private final UniAdCallbackRecordService uniCallBackService;
public UniCallBackController(UniAdCallbackRecordService uniCallBackService) {
this.uniCallBackService = uniCallBackService;
}
@GetMapping("/adCallBack")
public ResponseEntity<?> adCallBack(@RequestParam String adpid, @RequestParam String provider,
@RequestParam String platform, @RequestParam String sign, @RequestParam String trans_id,
@RequestParam String user_id, @RequestParam(required = false) String extra) {
UniAdCallBackDTO dto = new UniAdCallBackDTO();
dto.setAdpid(adpid);
dto.setProvider(provider);
dto.setPlatform(platform);
dto.setSign(sign);
dto.setTrans_id(trans_id);
dto.setUser_id(user_id);
dto.setExtra(extra);
log.info("接收到uni-ad广告完播回调回调信息: {}", dto);
return ResponseEntity.ok(uniCallBackService.adCallBack(dto));
}
@GetMapping("/testException")
public String testException() throws CzgException {
throw new CzgException("测试异常");
}
}

View File

@ -0,0 +1,16 @@
package com.sqx.modules.callback.dao;
import lombok.Data;
import lombok.ToString;
@Data
@ToString
public class UniAdCallBackDTO {
private String adpid;
private String provider;
private String platform;
private String sign;
private String trans_id;
private String user_id;
private String extra;
}

View File

@ -0,0 +1,146 @@
package com.sqx.modules.callback.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;
/**
*
* @TableName uni_ad_callback_record
*/
@TableName(value ="uni_ad_callback_record")
@Data
public class UniAdCallbackRecord implements Serializable {
/**
*
*/
@TableId
@JsonSerialize(using = ToStringSerializer.class)
private Long id;
/**
* 用户id
*/
@JsonSerialize(using = ToStringSerializer.class)
private Long userId;
/**
* 平台
*/
private String platform;
/**
* 交易id
*/
private String transId;
/**
* DCloud广告位id
*/
private String adpid;
/**
* 广告服务商
*/
private String provider;
/**
*
*/
private String sign;
/**
* 调用SDK传入并透传自定义数据
*/
private String extra;
/**
* 是否播放完毕
*/
private Integer isEnded;
/**
* 回调时间
*/
private Date createTime;
/**
* 错误信息
*/
private String errMsg;
@TableField(exist = false)
private static final long serialVersionUID = 1L;
@Override
public boolean equals(Object that) {
if (this == that) {
return true;
}
if (that == null) {
return false;
}
if (getClass() != that.getClass()) {
return false;
}
UniAdCallbackRecord other = (UniAdCallbackRecord) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
&& (this.getPlatform() == null ? other.getPlatform() == null : this.getPlatform().equals(other.getPlatform()))
&& (this.getTransId() == null ? other.getTransId() == null : this.getTransId().equals(other.getTransId()))
&& (this.getAdpid() == null ? other.getAdpid() == null : this.getAdpid().equals(other.getAdpid()))
&& (this.getProvider() == null ? other.getProvider() == null : this.getProvider().equals(other.getProvider()))
&& (this.getSign() == null ? other.getSign() == null : this.getSign().equals(other.getSign()))
&& (this.getExtra() == null ? other.getExtra() == null : this.getExtra().equals(other.getExtra()))
&& (this.getIsEnded() == null ? other.getIsEnded() == null : this.getIsEnded().equals(other.getIsEnded()))
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
&& (this.getErrMsg() == null ? other.getErrMsg() == null : this.getErrMsg().equals(other.getErrMsg()));
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
result = prime * result + ((getPlatform() == null) ? 0 : getPlatform().hashCode());
result = prime * result + ((getTransId() == null) ? 0 : getTransId().hashCode());
result = prime * result + ((getAdpid() == null) ? 0 : getAdpid().hashCode());
result = prime * result + ((getProvider() == null) ? 0 : getProvider().hashCode());
result = prime * result + ((getSign() == null) ? 0 : getSign().hashCode());
result = prime * result + ((getExtra() == null) ? 0 : getExtra().hashCode());
result = prime * result + ((getIsEnded() == null) ? 0 : getIsEnded().hashCode());
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
result = prime * result + ((getErrMsg() == null) ? 0 : getErrMsg().hashCode());
return result;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", userId=").append(userId);
sb.append(", platform=").append(platform);
sb.append(", transId=").append(transId);
sb.append(", adpid=").append(adpid);
sb.append(", provider=").append(provider);
sb.append(", sign=").append(sign);
sb.append(", extra=").append(extra);
sb.append(", isEnded=").append(isEnded);
sb.append(", createTime=").append(createTime);
sb.append(", errMsg=").append(errMsg);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
}
}

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