462 Commits

Author SHA1 Message Date
3c2b4ffc48 TASK: 画布数据 回参添加返回crossOrigin 2025-07-22 11:31:26 +08:00
b90df7468e TASK:管理员权限变更 2025-07-18 17:32:03 +08:00
370d9402f2 TASK: 试用邮件通知权限变更 2025-07-02 10:08:54 +08:00
4d518d05b9 TASK: 管理员页面访问权限变动 2025-07-02 09:18:22 +08:00
13514b277b BUGFIX:用户注册后重发验证码,验证不通过 2025-06-24 19:30:20 +08:00
d6c5d0e95d TASK:查询交易记录 添加显示总金额和付款者邮箱 2025-06-23 10:53:30 +08:00
301a62a563 TASK:添加管理员访问人员 2025-06-19 17:39:18 +08:00
22e5a97143 BUGFIX: 优惠券的佣金计算,统计时间边界问题优化 2025-06-13 11:18:55 +08:00
765d404845 TASK: 将generate,用户输入中的中文字符转换为英文字符 2025-06-11 15:34:00 +08:00
d5cf4e9d3f TASK: 添加“新增试用用户”通知对象chelseayu@code-create.com.hk 2025-06-08 09:19:36 +08:00
4b7fd649a3 TASK: 推广码 添加开始生效时间;优化数据计算类型,使用BigDecimal替换float;更新paidCommission后自动计算unpaidCommission 2025-06-06 19:37:38 +08:00
6249d53b7b BUGFIX: modifySketch 除library以外的地方修改,originalIdSource允许不传 2025-06-04 22:04:09 +08:00
b445f1f11e BUGFIX: modifySketch 在library中修改后需要保存到library 2025-06-04 15:49:55 +08:00
5c66ece467 1.关闭续订前七天邮件提醒
2.优化订阅邮件提醒,向redis存储已发送的邮件类型
2025-05-23 17:16:19 +08:00
3b6b0c7e2c TASK: prom code 开启佣金计费定时器和商家邮件通知 2025-05-22 16:37:41 +08:00
9a81fb7ee4 TASK:将PromotionCode合并到生产-test 2025-05-20 16:53:48 +08:00
31bb29f2fd Affiliate 允许为不同的用户设置不同的affiliate
Stripe 添加优惠券删除接口;限制优惠券只能在订阅时使用

(cherry picked from commit 200c0adfba)
2025-05-20 11:30:42 +08:00
c7b46229b5 删除优惠券
(cherry picked from commit 58af5c5570)
2025-05-19 17:29:06 +08:00
1482bb6ab2 Stripe推广码 部分功能完善
(cherry picked from commit 218d828e0d)
2025-05-19 17:28:52 +08:00
eae4087b3e Stripe支付--添加推广码功能及相应佣金计算
(cherry picked from commit 0ba28588da)
2025-05-19 17:13:28 +08:00
faf98607c4 优惠券查询DTO
(cherry picked from commit 1ce6c74f2c)
2025-05-19 17:04:51 +08:00
c19e9094d1 BUGFIX: generate mode字段传递不准确导致生成结果与图片没有关联 2025-05-09 17:03:42 +08:00
db55c5597f undividedLayers数据保存失败原因查找 2025-05-09 00:18:00 +08:00
0c79739867 BUGFIX: design之后,未分割图片的保存问题 2025-05-08 15:26:06 +08:00
e484f22788 BUGFIX : design 未分割图层保存问题 2025-05-08 14:54:12 +08:00
6a694cee18 Merge remote-tracking branch 'origin/release/3.0' into release/3.0 2025-05-08 14:19:41 +08:00
1a077edf0c designSingle 取消颜色限制 2025-05-08 14:19:26 +08:00
shahaibo
68926757dc Merge remote-tracking branch 'origin/release/3.0' into release/3.0 2025-05-07 22:04:21 +08:00
shahaibo
eea57435e5 TASK:minio地址修改; 2025-05-07 22:04:10 +08:00
1f0e8f9cf2 BUGFIX: designSingle时,添加相同类型的服装导致未分割图层获取混乱 2025-05-07 14:10:42 +08:00
shahaibo
63ee41e3b8 Merge remote-tracking branch 'origin/release/3.0' into release/3.0 2025-03-31 17:47:33 +08:00
shahaibo
08072001a7 BUGFIX:dislike合并逻辑去除; 2025-03-31 17:47:25 +08:00
6b4d82a67d AiDA 8折优惠活动恢复 2025-03-31 17:45:16 +08:00
5612b5b1d4 AiDA 8折优惠活动 2025-03-31 09:48:09 +08:00
1d46a3b6d4 修改本地缓存的过期时间 2025-03-27 15:38:25 +08:00
0500557dca BUGFIX: 获取pantone值为空时返回rgb和hsv 2025-03-18 18:47:05 +08:00
654a3829c6 BUGFIX: 获取RGB对应的PanTone数据失败,导致返回颜色为空 2025-03-18 17:39:39 +08:00
fccafba438 Merge remote-tracking branch 'origin/release/3.0' into release/3.0 2025-03-18 15:33:38 +08:00
8cd4cfb36d getDetail 添加日志,打印入参回参 2025-03-18 15:33:24 +08:00
shahaibo
7e55b1f85e BUGFIX: 隐藏加载不出minio的相关数据; 2025-03-13 17:53:35 +08:00
shahaibo
a043db2de5 BUGFIX: 隐藏加载不出minio的相关数据; 2025-03-12 22:48:18 +08:00
shahaibo
d3ee0e5f4f BUGFIX: 隐藏加载不出minio的相关数据; 2025-03-12 22:06:39 +08:00
shahaibo
484a8d1d93 BUGFIX: 隐藏加载不出minio的相关数据; 2025-03-12 22:00:07 +08:00
shahaibo
7839ac3322 BUGFIX: 隐藏加载不出minio的相关数据; 2025-03-12 21:54:23 +08:00
shahaibo
e16f494cf4 Merge remote-tracking branch 'origin/release/3.0' into release/3.0 2025-03-12 21:26:33 +08:00
shahaibo
6fc22784b8 BUGFIX: 隐藏加载不出minio的相关数据; 2025-03-12 21:26:24 +08:00
52bafa95e3 关闭默认从Code-Create创建游客账号的定时器 2025-03-03 21:17:14 +08:00
377c86e390 Stripe 回调判空并直接返回 2025-02-28 14:30:35 +08:00
d809362ea7 Merge branch 'dev/dev' into release/3.0 2025-02-25 11:42:51 +08:00
c08987a781 Merge branch 'dev/dev_xp' into dev/dev 2025-02-24 10:37:14 +08:00
e60c3d7aa3 Stripe webhook charge回调处理 2025-02-24 10:36:42 +08:00
614b8d0948 to prod 2025-02-21 17:56:50 +08:00
8834b906f4 Merge branch 'dev/dev_xp' into dev/dev 2025-02-21 17:39:35 +08:00
828a022768 漏传 2025-02-21 17:39:12 +08:00
26c8d08d04 Merge branch 'dev/dev_xp' into dev/dev 2025-02-21 17:35:35 +08:00
68a9b2281a 管理员系统部分优化、stripe异常通知优化 2025-02-21 17:16:44 +08:00
63df493d33 切换dev支付环境为测试环境,回调端点为dev端点 2025-02-21 13:02:30 +08:00
b7110c80b5 切换dev支付回调端点 2025-02-21 12:51:11 +08:00
c4dbd10a85 to dev 2025-02-20 11:10:00 +08:00
041a407978 Merge branch 'release/3.0' into dev/dev 2025-02-20 11:00:41 +08:00
f73c997c38 Merge branch 'dev/dev_xp' into dev/dev 2025-02-20 10:59:58 +08:00
db2a955dea 生成结果均低于输出标准时的提示语句更换 2025-02-20 10:57:43 +08:00
a91643d2ec to prod 2025-02-19 17:44:14 +08:00
269cf7ea03 关闭merchant邮箱,test支付环境不通知商家 2025-02-19 16:40:12 +08:00
e3aa964db8 切换支付环境为test 2025-02-19 16:32:28 +08:00
fa2fa66d4a 打开商家邮箱 用于接收邮件通知 2025-02-19 14:54:24 +08:00
6d2a189fef 更换支付方式 2025-02-19 14:43:42 +08:00
2033f61c7e 切换支付环境为live 2025-02-19 14:28:07 +08:00
4e2222966f 修改邮件模板ID 2025-02-19 14:23:43 +08:00
fbe9dc87e9 Stripe 回调添加异常处理和异常情况下邮件通知 2025-02-19 14:14:20 +08:00
d6f078ab60 添加判断,确认邮件是否发送成功 2025-02-18 17:07:16 +08:00
a940863799 stripe 一次订阅 bug修复 2025-02-18 15:00:57 +08:00
11ffa66851 stripe 一次订阅 添加日志打印 2025-02-18 14:09:27 +08:00
fc3fa22bee 更换stripe-webhook回调密钥 2025-02-18 11:31:49 +08:00
37ff60fcfb Stripe 添加一次订阅服务(默认关闭自动续订功能) 2025-02-17 17:14:30 +08:00
d2d5eebe12 to dev 2025-02-17 10:52:11 +08:00
9cfb5aa344 Merge remote-tracking branch 'origin/release/3.0' into release/3.0 2025-02-17 10:19:17 +08:00
5e7f898840 BUGFIX: 用户支付后获取账号到期时间为空,无法更新账号信息 2025-02-17 10:18:57 +08:00
shahaibo
6d3253aed3 BUGFIX: bindEmail; 2025-02-14 11:49:37 +08:00
shahaibo
52e5f246ce Merge branch 'dev/dev' into release/3.0 2025-02-13 12:57:37 +08:00
shahaibo
6222377bc5 BUGFIX: dev恢复toProductImage、relight消费; 2025-02-13 11:57:00 +08:00
shahaibo
2d10f57643 BUGFIX: dev关闭toProductImage、relight消费; 2025-02-13 11:42:45 +08:00
shahaibo
5f27a95498 Merge remote-tracking branch 'origin/dev/dev' into dev/dev 2025-02-13 11:07:02 +08:00
shahaibo
7fdf832f44 BUGFIX: toProductImage、relight; 2025-02-13 11:06:19 +08:00
43d2f83677 BUGFIX:For input string: "[0.3400879, 0.3400879]" 2025-02-12 13:20:12 +08:00
e882a15aa0 Merge branch 'dev/dev' into release/3.0 2025-02-12 13:07:25 +08:00
1a3f16119b Merge branch 'dev/dev_xp' into dev/dev 2025-02-12 12:13:52 +08:00
8e2e515af3 BUGFIX:印花 不等比缩放适配历史数据 2025-02-12 12:13:25 +08:00
f1a2495431 Merge branch 'dev/dev' into release/3.0 2025-02-12 10:34:02 +08:00
c66b794daa Merge branch 'dev/dev_xp' into dev/dev 2025-02-12 10:33:39 +08:00
b9f7ea2722 BUGFIX: 多个印花 不等比缩放适配历史数据 2025-02-12 10:33:11 +08:00
455e17d4b1 Merge branch 'dev/dev' into release/3.0 2025-02-12 10:19:45 +08:00
a1a6a78dac Merge branch 'dev/dev_xp' into dev/dev 2025-02-12 10:14:17 +08:00
07f91aef74 BUGFIX: 印花不等比缩放适配历史数据 2025-02-12 10:13:54 +08:00
shahaibo
079ab4d98f BUGFIX: name 信息绑定邮箱录入; 2025-02-12 09:56:55 +08:00
shahaibo
6e53bc3ca5 TASK: 定时任务; 2025-02-12 09:28:04 +08:00
shahaibo
5e8eb716b1 TASK: name信息; 2025-02-11 20:50:22 +08:00
shahaibo
34ee8fa11d TASK: name信息; 2025-02-11 13:08:00 +08:00
shahaibo
b7dc95af26 TASK:name信息; 2025-02-11 11:35:57 +08:00
shahaibo
297391d57e BUGFIX:试用订单邮件 订单更新时间判断; 2025-02-11 11:27:08 +08:00
shahaibo
aff870fba7 Merge remote-tracking branch 'origin/dev/dev' into dev/dev 2025-02-11 10:25:08 +08:00
7b1ac47228 Merge branch 'dev/dev_xp' into dev/dev 2025-02-10 16:15:20 +08:00
7eb9abbdb5 优化接收Stripe回调时数据重复存储问题(添加唯一索引) 2025-02-10 16:11:59 +08:00
521bd5071a Merge branch 'dev/dev_xp' into dev/dev
# Conflicts:
#	src/main/java/com/ai/da/mapper/primary/entity/DesignItemDetailPrint.java
#	src/main/java/com/ai/da/model/vo/DesignSinglePrint.java
#	src/main/java/com/ai/da/python/PythonService.java
#	src/main/java/com/ai/da/python/vo/DesignPythonItemElement.java
#	src/main/java/com/ai/da/python/vo/DesignPythonItemPrint.java
#	src/main/java/com/ai/da/service/impl/DesignServiceImpl.java
2025-02-10 11:21:52 +08:00
ab7e1705c4 修改print scale的数据结构 2025-02-10 11:18:04 +08:00
shahaibo
a2390a6ab2 BUGFIX:试用订单邮件 订单更新时间判断; 2025-02-10 10:34:01 +08:00
shahaibo
8dc5dcb1bd BUGFIX:试用订单邮件 订单更新时间判断; 2025-02-10 10:11:59 +08:00
shahaibo
5d010d2f77 BUGFIX:试用订单邮件 订单更新时间判断; 2025-02-10 10:08:48 +08:00
shahaibo
cec5544472 BUGFIX:试用订单邮件 订单更新时间判断; 2025-02-10 10:05:57 +08:00
shahaibo
5f79c3276a BUGFIX:试用订单邮件 订单更新时间判断; 2025-02-10 10:03:28 +08:00
aadb717c9f to dev 2025-02-07 15:03:24 +08:00
e2e9201fdd 修改印花scale数据类型为数组 2025-02-07 14:57:28 +08:00
shahaibo
9053bdf10c BUGFIX:试用注册; 2025-02-07 12:48:37 +08:00
shahaibo
b14297d1af Merge branch 'dev/dev' into release/3.0 2025-02-07 11:58:36 +08:00
shahaibo
e90979bbdc BUGFIX:试用注册; 2025-02-07 11:58:12 +08:00
shahaibo
e02c278e7a Merge remote-tracking branch 'origin/dev/dev' into dev/dev 2025-02-07 10:25:20 +08:00
shahaibo
e60d9483a3 BUGFIX:试用订单邮件信息; 2025-02-07 10:25:11 +08:00
shahaibo
ba49312fd5 BUGFIX:试用订单邮件信息; 2025-02-07 10:23:41 +08:00
ba3c98771f BUGFIX: 新建订阅时更新订阅不更新账号信息 2025-02-06 18:39:06 +08:00
4c738cc61d BUGFIX: 返回最新的订阅号 2025-02-06 17:35:35 +08:00
d648a79ec4 BUGFIX: 订阅付款失败时仍有新建订阅 2025-02-06 16:36:07 +08:00
c325927418 to prod 2025-02-06 14:46:50 +08:00
dba5625446 正式支付环境下区分生产分支与测试分支 2025-02-06 14:42:45 +08:00
91189968e9 在dev测试生产环境的Stripe支付功能 2025-02-06 14:37:06 +08:00
433d8a460e to dev 2025-02-06 14:22:27 +08:00
ec9857fe73 Merge branch 'dev/dev_xp' into dev/dev 2025-02-06 14:09:53 +08:00
a9b01566e1 优化积分购买 2025-02-06 14:09:15 +08:00
shahaibo
a384aba4df TASK:定时任务开启; 2025-02-06 10:04:30 +08:00
e587ad3ca1 1、支付环境切换为prod
2、邮件通知对象添加Kim
3、打开定时任务
2025-02-06 09:53:03 +08:00
shahaibo
6a7c8b3d28 Merge branch 'dev/dev' into release/3.0 2025-02-05 14:26:33 +08:00
shahaibo
6f52c956ec TASK:新的试用订单生成; 2025-02-05 14:20:22 +08:00
shahaibo
9e5d2f47e2 BUGFIX:绑定谷歌; 2025-02-05 13:38:10 +08:00
shahaibo
627f264ef3 BUGFIX:绑定谷歌; 2025-02-05 13:02:26 +08:00
shahaibo
464de4ee5a Merge remote-tracking branch 'origin/dev/dev' into dev/dev 2025-02-05 12:05:07 +08:00
shahaibo
cf76235123 TASK:谷歌微信快捷区分登录注册; 2025-02-05 12:04:53 +08:00
8d9f51f50f 不再清空游客的到期时间 2025-02-05 11:22:45 +08:00
d840185ec7 测试 code-create DB最大连接时长 2025-02-05 10:56:17 +08:00
9f4ab20b9d 测试 code-create DB最大连接时长 2025-02-05 10:49:10 +08:00
0877ff8f66 支付 测试 2025-02-05 10:05:23 +08:00
78046e8707 支付 测试 2025-02-04 15:29:22 +08:00
shahaibo
9fb8bc989d Merge remote-tracking branch 'origin/dev/dev' into dev/dev 2025-02-04 14:29:32 +08:00
shahaibo
3c89670dae BUGFIX:design重复回退; 2025-02-04 14:29:22 +08:00
21b73d55f7 Merge remote-tracking branch 'origin/dev/dev' into dev/dev 2025-02-04 14:04:17 +08:00
9199cdf7e2 支付 to prod 2025-02-04 14:04:01 +08:00
shahaibo
8589216a77 TASK:绑定邮箱; 2025-02-04 13:53:50 +08:00
shahaibo
87768c6b53 TASK:绑定邮箱、绑定微信; 2025-02-04 11:39:42 +08:00
shahaibo
ca320f4334 TASK:测试dev分支; 2025-02-04 11:00:31 +08:00
shahaibo
7697ab59fa BUGFIX:重复停止组装; 2025-02-04 10:58:35 +08:00
e5e6f360dc Merge branch 'dev/dev_xp' into dev/dev 2025-01-27 16:39:54 +08:00
68a9462714 交易记录下载 返回文件流改为返回文件下载地址 2025-01-27 16:39:19 +08:00
b185a94fcc Merge branch 'dev/dev_xp' into dev/dev 2025-01-27 11:00:10 +08:00
708280ca14 交易记录下载post请求改get请求 2025-01-27 10:58:35 +08:00
0ab1e7eef7 Merge branch 'dev/dev_xp' into dev/dev 2025-01-24 15:50:15 +08:00
c7b1d46b18 maven 依赖冲突解决 2025-01-24 15:49:34 +08:00
9357a62f0c Merge branch 'dev/dev_xp' into dev/dev 2025-01-24 14:28:54 +08:00
c5b25e9a16 优化 删除多余代码 2025-01-24 14:28:21 +08:00
a35d057146 优化 导出交易记录文件 2025-01-24 14:25:32 +08:00
7fc495eec9 Merge branch 'dev/dev_xp' into dev/dev 2025-01-24 13:27:50 +08:00
46f37942d2 将交易记录导出为excel文件 2025-01-24 13:26:53 +08:00
e75196c904 Merge branch 'dev/dev_xp' into dev/dev 2025-01-23 14:15:38 +08:00
bdfa249c2e token过期 日志打印优化 2025-01-23 14:15:12 +08:00
d0e5f7da61 Merge branch 'dev/dev_xp' into dev/dev 2025-01-23 13:57:26 +08:00
d8320ba83d 新增自定义异常 2025-01-23 13:56:48 +08:00
23460800d6 优化请求未携带token时的日志打印 2025-01-23 13:55:48 +08:00
58c8b644bc 佣金计算 打印日志 2025-01-22 16:41:40 +08:00
c4c04aecb6 affiliateIncome 添加字段paymentInfoId 2025-01-22 16:37:40 +08:00
bb7c98c094 affiliate 佣金计算统计 2025-01-22 15:32:09 +08:00
dcdb0d06c4 Merge branch 'dev/dev_xp' into dev/dev 2025-01-15 10:49:08 +08:00
b6a66bed41 查询交易记录 添加付款人字段 2025-01-15 10:45:51 +08:00
shahaibo
5f277ed815 BUGFIX:toproductimage 打光积分不足提示修改; 2025-01-13 15:12:54 +08:00
shahaibo
845a553097 BUGFIX:微信名解析、toproductimage 打光积分不足code码修改; 2025-01-13 14:11:03 +08:00
74f89c8b2d 只填写国家和职业(不发送验证码) 2025-01-13 11:15:31 +08:00
cff8227228 Merge branch 'dev/dev_xp' into dev/dev 2025-01-13 11:13:31 +08:00
51e2c9af02 只填写国家和职业(不发送验证码) 2025-01-13 11:11:01 +08:00
cd89a77189 漏传 2025-01-13 10:56:06 +08:00
ab303cfeef 绑定邮箱时添加国家、职业信息 2025-01-13 10:55:08 +08:00
shahaibo
07004a7415 TASK:去日志; 2025-01-13 10:20:14 +08:00
shahaibo
d2069a3e7f TASK:去日志; 2025-01-13 10:12:04 +08:00
shahaibo
501cee0057 TASK:去日志; 2025-01-13 10:05:38 +08:00
ac2454fd0e 绑定邮箱时添加国家、职业信息 2025-01-10 17:16:08 +08:00
931a4cf807 to dev 2025-01-10 17:01:59 +08:00
cb7099264e 绑定邮箱时需要填写国家和职业 2025-01-10 16:54:44 +08:00
e7aa951e89 漏传 2025-01-10 16:19:53 +08:00
ef70598180 修改查询交易记录接口
1、添加按id排序
2、添加查询所有国家
3、添加接口,更新用户国家、职业信息
2025-01-10 16:13:45 +08:00
698fca8787 查询各平台交易记录 2025-01-10 13:27:27 +08:00
2f86090f21 Merge branch 'dev/dev' into dev/dev_xp 2025-01-10 13:05:26 +08:00
2988a3b34e 修改code-create数据库 sql语句修改 2025-01-09 13:50:08 +08:00
shahaibo
4fe5f65867 TASK:AiDA design like sort 2025-01-08 16:56:02 +08:00
shahaibo
4bb1953d4a Merge remote-tracking branch 'origin/dev/dev' into dev/dev 2025-01-08 15:39:32 +08:00
shahaibo
57a8260f03 TASK:AiDA design like sort 2025-01-08 15:38:29 +08:00
e4936a23bc 编辑用户名,改为当前月允许修改5次 2025-01-08 14:20:12 +08:00
9f37cb3f8d Merge branch 'release/3.0' into dev/dev
# Conflicts:
#	src/main/java/com/ai/da/controller/ConvenientInquiryController.java
#	src/main/java/com/ai/da/model/dto/DesignCollectionDTO.java
#	src/main/java/com/ai/da/service/impl/DesignServiceImpl.java
2025-01-08 10:33:49 +08:00
b128b2436d 限制人员添加用户 2025-01-08 10:24:51 +08:00
66158e94dd 限制人员添加用户 2025-01-08 10:12:43 +08:00
f6b489d950 添加管理员页面访问者 2025-01-08 09:50:13 +08:00
30312caf82 添加管理员访问者 2025-01-07 17:27:29 +08:00
1d0dd65f5e Merge branch 'dev/dev_xp' into dev/dev 2025-01-07 17:21:54 +08:00
shahaibo
0b245f62af TASK:AiDA design like sort、moodboardPosition 2025-01-07 17:16:45 +08:00
50d90af3a5 添加管理员访问者 2025-01-07 17:15:22 +08:00
shahaibo
49b8585522 Merge remote-tracking branch 'origin/dev/dev' into dev/dev 2025-01-07 15:30:33 +08:00
shahaibo
b49f098a5e TASK:AiDA design like sort、moodboardPosition 2025-01-07 15:29:46 +08:00
e9a15b950e Merge branch 'dev/dev_xp' into dev/dev 2025-01-07 14:37:28 +08:00
ee676614f8 统一多种支付方式创建订单的入参 2025-01-07 14:31:43 +08:00
710abf2323 修改积分价格,for test 2025-01-07 11:47:33 +08:00
1a9f06d259 Merge remote-tracking branch 'origin/dev/dev' into dev/dev 2025-01-07 11:26:16 +08:00
shahaibo
eaaa99a946 Merge remote-tracking branch 'origin/dev/dev' into dev/dev 2025-01-07 11:16:14 +08:00
shahaibo
c8e4d624b7 TASK:AiDA design like sort 2025-01-07 11:15:25 +08:00
f08e36d100 Merge branch 'dev/dev_xp' into dev/dev 2025-01-07 11:12:30 +08:00
de73536d1c 解析所有发起购买的客户端ip地址 2025-01-07 11:09:22 +08:00
6a861305d6 解析所有发起购买的客户端ip地址 2025-01-07 11:07:49 +08:00
shahaibo
367fa130c0 BUGFIX:moodboard edit; 2025-01-07 10:58:57 +08:00
shahaibo
d04987a3e2 BUGFIX:moodboard edit; 2025-01-07 09:58:36 +08:00
b0fa185d36 更改积分刷新task 2025-01-06 14:58:46 +08:00
094718e67f Merge branch 'dev/dev_xp' into dev/dev 2025-01-06 14:47:40 +08:00
e4a8bf80e9 1、用户详细信息添加国家、职业、用户名修改剩余次数
2、积分不够 返回异常提示类型更改
3、添加根据ip解析地理位置测试接口
4、更新积分刷新机制(每月1号0点刷新年费用户积分)
2025-01-06 14:42:08 +08:00
shahaibo
c04b102a81 TASK:AiDA design like sort 2025-01-06 11:49:47 +08:00
shahaibo
da9b3a04b4 TASK:AiDA design like sort 2025-01-06 11:35:54 +08:00
shahaibo
234a030801 Merge remote-tracking branch 'origin/dev/dev' into dev/dev 2025-01-06 10:49:39 +08:00
shahaibo
5ea8e851d7 TASK:AiDA design like sort 2025-01-06 10:46:51 +08:00
shahaibo
afeeef4af7 TASK:试用订单接收名单添加; 2025-01-04 21:35:21 +08:00
ee1e2f8556 获取所有标签 2025-01-02 17:32:49 +08:00
1157b41730 积分购买 添加邮件通知 2024-12-31 11:38:12 +08:00
ca4d75c63f BUGFIX:用户订阅后更新用户身份和积分 2024-12-27 14:29:07 +08:00
f45bd7acc4 develop 环境webhook_secret变更 2024-12-27 10:46:52 +08:00
7bdd62d4a9 Merge remote-tracking branch 'origin/dev/dev' into dev/dev 2024-12-27 10:32:09 +08:00
b01ee9129b develop 环境webhook_secret变更 2024-12-27 10:31:27 +08:00
shahaibo
214c93923c Merge remote-tracking branch 'origin/dev/dev' into dev/dev 2024-12-24 14:01:34 +08:00
shahaibo
bfa1d67b5c BUGFIX:Collection not found 2024-12-24 14:00:44 +08:00
a0a1a1a06a Merge branch 'dev/dev_xp' into dev/dev 2024-12-23 17:31:53 +08:00
468ad385d7 用户登录时,不校验游客账号有效期 2024-12-23 17:29:48 +08:00
fa94667c0f 游客到期时间不置空 2024-12-23 16:07:05 +08:00
c997fbf1cb Merge branch 'dev/dev_xp' into dev/dev 2024-12-23 14:35:29 +08:00
7283ace072 getAffiliateList 添加返回用户名 2024-12-23 14:31:48 +08:00
shahaibo
69743d4ef0 BUGFIX:谷歌快捷登录 2024-12-23 10:27:01 +08:00
shahaibo
e033671ffb TASK:AiDA 2024-12-20 16:11:52 +08:00
shahaibo
15cde37af7 TASK:AiDA 2024-12-20 11:44:21 +08:00
shahaibo
7fb74bc7d8 TASK:AiDA 2024-12-19 17:52:14 +08:00
43968995ea generate去除额外prompt 2024-12-19 17:37:28 +08:00
0574180e4b generate去除额外prompt 2024-12-19 17:26:16 +08:00
5b653272ee 覆盖代码恢复-获取个人信息 2024-12-19 17:15:55 +08:00
d28a6051f1 Merge branch 'release/3.0' into dev/dev 2024-12-19 16:02:59 +08:00
f9063ad26e generate print翻译输入修改 2024-12-19 16:01:35 +08:00
2f4d060ca3 generate print翻译输入修改 2024-12-19 15:59:18 +08:00
fcd0cf4836 Merge branch 'release/3.0' into dev/dev 2024-12-19 15:32:10 +08:00
26f50c2acb generate print翻译输入修改 2024-12-19 15:26:27 +08:00
c3eb1fc78c Merge branch 'dev/dev_xp' into dev/dev 2024-12-19 14:04:28 +08:00
b15cc542e1 按id查询订单 2024-12-19 13:56:17 +08:00
shahaibo
ec094d7471 TASK:AiDA 2024-12-19 13:31:01 +08:00
shahaibo
3dc432131c TASK:AiDA 2024-12-19 11:13:30 +08:00
shahaibo
1a19604163 TASK:AiDA 2024-12-19 10:51:38 +08:00
fdebb2b215 Merge branch 'dev/dev_xp' into dev/dev
# Conflicts:
#	src/main/java/com/ai/da/model/vo/AccountLoginVO.java
#	src/main/java/com/ai/da/service/impl/AccountServiceImpl.java
2024-12-18 14:02:06 +08:00
7d8f047087 Affiliate功能-数据库表设计更新 2024-12-18 11:53:41 +08:00
bf8af41f3f 添加Affiliate功能 2024-12-16 10:26:02 +08:00
shahaibo
cdf29d2b0d TASK:AiDA 2024-12-13 16:07:21 +08:00
shahaibo
7194049127 TASK:prompt修改; 2024-12-13 11:32:42 +08:00
shahaibo
e34cec812f Merge remote-tracking branch 'origin/release/3.0' into release/3.0 2024-12-13 10:35:17 +08:00
shahaibo
11a5b53d2a BUGFIX:prompt重复拼接; 2024-12-13 10:34:14 +08:00
efe22de0a0 Merge branch 'refs/heads/dev/dev' into dev/dev_xp
# Conflicts:
#	src/main/java/com/ai/da/common/utils/SendEmailUtil.java
#	src/main/java/com/ai/da/mapper/primary/entity/Account.java
2024-12-11 16:52:16 +08:00
shahaibo
82f7571612 TASK:AiDA 2024-12-11 16:21:18 +08:00
shahaibo
2ac54a50ec TASK:AiDA 2024-12-11 14:21:29 +08:00
5dd1e10b61 to dev 2024-12-10 10:09:21 +08:00
e9e8e87719 Merge branch 'release/3.0' into dev/dev 2024-12-10 10:04:27 +08:00
3c0fa205d1 BUGFIX:code-create注册的新用户自动添加为aida的游客,去重bug修改 2024-12-09 18:17:09 +08:00
47ca7bde41 Affiliate-新增、查询、佣金计算等 2024-12-09 16:53:29 +08:00
shahaibo
9e28d579d1 Merge branch 'dev/dev' into dev/dev_shb
# Conflicts:
#	src/main/java/com/ai/da/controller/AccountController.java
#	src/main/java/com/ai/da/controller/SavedCollectionController.java
#	src/main/java/com/ai/da/service/AccountService.java
#	src/main/java/com/ai/da/service/UserLikeGroupService.java
#	src/main/java/com/ai/da/service/impl/AccountServiceImpl.java
2024-12-09 13:44:07 +08:00
shahaibo
1c96522447 TASK:AiDA 2024-12-09 13:31:30 +08:00
shahaibo
1a568621ca BUGFIX:重复申请试用; 2024-12-03 11:51:01 +08:00
eecefee674 Merge branch 'dev/dev' into release/3.0 2024-12-02 14:54:00 +08:00
ea0332851d Merge remote-tracking branch 'origin/dev/dev' into dev/dev 2024-12-02 14:35:20 +08:00
a25a7dc023 high || fast 生成次数修改 2024-12-02 14:34:10 +08:00
shahaibo
b4fe1ca199 TASK:toproductimage prompt; 2024-12-02 13:51:46 +08:00
shahaibo
b315ae5644 TASK:toproductimage prompt; 2024-12-02 12:02:19 +08:00
徐佩
f7113601f3 Merge branch 'dev/dev' into release/3.0 2024-12-01 20:27:58 +08:00
徐佩
8d6e3e9644 sketchboard-prompt 修改 2024-12-01 19:48:12 +08:00
徐佩
23b864d378 to prod 2024-12-01 17:37:52 +08:00
徐佩
be1119be6f bugfix : fast || high 2024-12-01 16:51:38 +08:00
徐佩
b836e7fd67 bugfix : fast || high 2024-12-01 16:32:51 +08:00
a237b4041d 模型选择 添加high || fast 2024-11-29 15:09:34 +08:00
ea4cd29723 to dev 2024-11-28 17:26:53 +08:00
13397fa1f7 to dev 2024-11-28 17:22:57 +08:00
2fab472150 to dev 2024-11-28 17:21:58 +08:00
8c71b4845a Merge branch 'release/3.0' into dev/dev
# Conflicts:
#	src/main/java/com/ai/da/service/impl/AccountServiceImpl.java
2024-11-28 17:19:40 +08:00
b70f909a32 优化-自动将Code-Create注册的新用户添加到AiDA 2024-11-28 17:14:11 +08:00
1b15aed6a2 支付优化-续订失败邮件通知 2024-11-28 10:43:06 +08:00
5019fbd3fc 支付优化 2024-11-25 10:53:09 +08:00
2ea19dcf03 Merge branch 'refs/heads/dev/dev' into dev/dev_xp 2024-11-19 17:09:36 +08:00
4d756d5624 支付优化 2024-11-19 17:08:16 +08:00
f6f759110f 支付优化--修改积分购买相应功能 2024-11-19 16:00:30 +08:00
8d27b5b51e 新增功能 -- 产品订阅 年度/月度 2024-11-18 16:20:25 +08:00
shahaibo
9f064609e7 TASK:谷歌登录 2024-11-13 15:45:40 +08:00
shahaibo
fd10d4dbc4 TASK:谷歌登录 2024-11-13 15:44:48 +08:00
shahaibo
fadb5faf0d TASK:谷歌登录 2024-11-12 15:34:43 +08:00
e5e514b522 ws优化 2024-11-11 17:31:55 +08:00
74e6d5a1da ws 联调修改 2024-11-11 17:24:49 +08:00
3cf0570912 ws 引入心跳 2024-11-11 16:34:55 +08:00
shahaibo
8da51a0a82 TASK:谷歌登录 2024-11-11 16:08:49 +08:00
shahaibo
37ff7fbb91 Merge remote-tracking branch 'origin/dev/dev' into dev/dev
# Conflicts:
#	src/main/java/com/ai/da/service/AccountService.java
2024-11-11 16:06:21 +08:00
shahaibo
8c20b51e13 TASK:谷歌登录 2024-11-11 16:04:26 +08:00
391a28d659 ws 2024-11-11 15:21:35 +08:00
4535fb7dfb ws 2024-11-11 15:07:02 +08:00
546d1b4c44 ws 设置session2分钟超时,以及心跳回复 2024-11-11 15:03:21 +08:00
5fe605c130 长连接 关闭日志打印 2024-11-11 10:45:57 +08:00
4408c0ecc6 to dev 2024-11-11 10:29:06 +08:00
49f08d1191 管理员系统优化-1 2024-11-06 17:51:51 +08:00
903bafb245 管理员系统优化 2024-11-06 17:27:16 +08:00
59b02b3f28 to prod 2024-11-04 10:49:29 +08:00
4a23e33080 BUGFIX:作品删除后,获取点赞详细报错 2024-11-04 10:42:35 +08:00
1e1b06fc48 chat-robot返回sketch图片地址变更 2024-10-29 16:53:17 +08:00
7c56d2bf4e to dev 2024-10-29 10:33:48 +08:00
4add0a806c 游客转试用用户,添加积分 2024-10-29 10:25:36 +08:00
c9bb7fe502 to prod 2024-10-29 10:03:21 +08:00
a8a7a129c9 Merge branch 'dev/dev' into release/3.0 2024-10-29 09:59:39 +08:00
c3c5532cb5 Merge branch 'dev/dev_xp' into dev/dev 2024-10-29 09:58:43 +08:00
78bfc16287 BUGFIX:imageToSketch 积分扣除校验 2024-10-29 09:57:34 +08:00
shahaibo
6c6162df74 BUGFIX:定时任务开启; 2024-10-23 08:54:00 +08:00
shahaibo
a837aff0fb BUGFIX:定时任务开启; 2024-10-22 10:06:12 +08:00
shahaibo
f673afc7fc TASK:配置 2024-10-21 10:59:50 +08:00
shahaibo
0ea96c728c BUGFIX:模特预览默认颜色添加; 2024-10-20 13:39:01 +08:00
shahaibo
77e71e3296 TASK:aida作品集查询; 2024-10-20 13:27:45 +08:00
shahaibo
ce870b9acf TASK:aida; 2024-10-20 11:50:52 +08:00
shahaibo
7f889b54e0 Merge remote-tracking branch 'origin/dev/dev' into dev/dev 2024-10-20 10:52:24 +08:00
shahaibo
ebd596d0d2 TASK:aida; 2024-10-20 10:52:14 +08:00
04ce95caa4 添加preview_submit字段to python 2024-10-15 10:44:26 +08:00
29bf172187 取消用户自定义mask的功能 2024-10-15 10:30:02 +08:00
shahaibo
41619febb9 Merge remote-tracking branch 'origin/dev/dev' into dev/dev 2024-10-14 11:18:30 +08:00
shahaibo
0f4b769d49 BUGFIX:moodboard合成图 裁剪; 2024-10-14 11:18:18 +08:00
66cd8217b9 更新undividedLayer临时访问地址缓存 2024-10-14 11:16:57 +08:00
e684c4e547 Merge branch 'release/3.0' into dev/dev
# Conflicts:
#	src/main/java/com/ai/da/common/constant/CommonConstant.java
#	src/main/java/com/ai/da/common/security/filter/AuthenticationFilter.java
#	src/main/java/com/ai/da/controller/PortfolioController.java
#	src/main/java/com/ai/da/model/dto/QueryPortfolioPageDTO.java
#	src/main/java/com/ai/da/service/PortfolioService.java
#	src/main/java/com/ai/da/service/impl/PortfolioServiceImpl.java
#	src/main/resources/messages_en.properties
#	src/main/resources/messages_zh.properties
2024-10-10 23:26:20 +08:00
c439f41d69 bugfix:参与活动作品为0时查询出错 2024-10-09 16:42:45 +08:00
823e96b014 发布准备 2024-10-09 15:47:29 +08:00
0cca24ee30 修改环境及打开监听 2024-10-09 15:44:47 +08:00
66cccd0867 添加校验,二创作品不能参与活动 2024-10-09 15:40:29 +08:00
463ddf3cb2 1、为发布的作品添加标签
2、修改标签
3、不允许用户重复参与活动
4、查询所有参与活动的作品
2024-10-09 13:51:16 +08:00
shahaibo
f0e0987f31 BUGFIX:发布作品返回作品ID; 2024-10-09 13:10:48 +08:00
shahaibo
16bea58ab5 BUGFIX:更新作品集作品名重复判断; 2024-10-09 11:43:05 +08:00
shahaibo
f2bbbaaeb6 BUGFIX:history retrieval返回新增portfolio信息; 2024-10-09 11:34:04 +08:00
shahaibo
5098f6f4a1 Merge remote-tracking branch 'origin/dev/dev' into dev/dev 2024-10-08 17:07:43 +08:00
shahaibo
bc1815ae1b TASK:pantone提示词; 2024-10-08 17:07:30 +08:00
6256c90958 bugfix:修改提取的sketch,图片后缀问题 2024-10-08 16:36:48 +08:00
f0bfe249e0 bugfix:修改提取的sketch,图片后缀问题 2024-10-08 16:17:45 +08:00
7bbfd7c506 Merge branch 'dev/dev_xp' into dev/dev 2024-10-08 15:49:39 +08:00
3c7cbe28a1 design single preview_submit 2024-10-08 15:48:53 +08:00
c834aacf3a Merge branch 'dev/dev_xp' into dev/dev 2024-10-08 15:44:36 +08:00
90b0ef41e3 bugfix:修改提取出的sketch 2024-10-08 15:44:01 +08:00
shahaibo
2aeeec4468 TASK:裁剪; 2024-10-08 14:05:13 +08:00
a7c5723e10 保存修改 2024-10-08 13:34:10 +08:00
shahaibo
ba595b9d2c Merge remote-tracking branch 'origin/dev/dev' into dev/dev 2024-10-08 13:18:12 +08:00
shahaibo
d9118aaf93 TASK:AiDA workshop活动; 2024-10-08 13:17:55 +08:00
1bdc71998b 按标签查询作品 2024-10-08 13:13:13 +08:00
a597f7a67a 为作品添加标签 2024-10-07 21:27:37 +08:00
195964ef5a 重新获取修改后的sketch的临时访问地址 2024-10-07 11:28:48 +08:00
shahaibo
c27ca77717 Merge remote-tracking branch 'origin/dev/dev' into dev/dev 2024-10-06 14:33:44 +08:00
shahaibo
7d0d460e5c bugfix:redesign bug; 2024-10-06 14:33:31 +08:00
5ac9df3056 Merge branch 'dev/dev_xp' into dev/dev 2024-10-06 14:28:18 +08:00
b8d64f1f28 获取指定用户的个人主页作品 2024-10-06 14:27:55 +08:00
c8dd9664be Merge branch 'dev/dev_xp' into dev/dev 2024-10-04 16:10:05 +08:00
8899a3a6bb SketchStyle 去除自定义风格 2024-10-04 11:45:00 +08:00
shahaibo
67f56f9b84 Merge remote-tracking branch 'origin/dev/dev' into dev/dev 2024-10-04 10:41:23 +08:00
shahaibo
fd12b9e571 TASK:male sketch style逻辑添加; 2024-10-04 10:40:32 +08:00
fb329c94aa Merge branch 'dev/dev_xp' into dev/dev 2024-10-03 16:49:03 +08:00
16d06582ee 重置designSingle返回的sketch在minio的临时访问凭证 2024-10-03 16:41:48 +08:00
shahaibo
6f98f111dd TASK:十月优惠邮件发送接口; 2024-10-03 12:15:55 +08:00
shahaibo
51a1c1d8e1 Merge remote-tracking branch 'origin/dev/dev' into dev/dev 2024-10-03 12:14:43 +08:00
shahaibo
8445c23984 TASK:十月优惠邮件发送接口; 2024-10-03 12:14:30 +08:00
961f8f874e 获取消息 按时间逆序 2024-10-01 16:08:40 +08:00
283b6244b1 消息推送连接关闭时避免报错 2024-10-01 10:29:06 +08:00
f19a15dbe8 Merge branch 'dev/dev_xp' into dev/dev 2024-09-30 17:16:11 +08:00
791d44df02 消息推送 bug修改 2024-09-30 17:15:11 +08:00
shahaibo
28e67db78d TASK:aida redesign不修改位置信息√接口修改; 2024-09-30 15:41:29 +08:00
shahaibo
63a120c652 Merge remote-tracking branch 'origin/dev/dev' into dev/dev 2024-09-30 14:49:05 +08:00
shahaibo
f60cabbbc0 TASK:aida design统计; 2024-09-30 14:48:44 +08:00
06db759749 my work bug修复 2024-09-30 11:28:53 +08:00
shahaibo
373608d989 TASK:aida design统计; 2024-09-29 18:32:06 +08:00
shahaibo
45e3dde03f Merge remote-tracking branch 'origin/dev/dev' into dev/dev 2024-09-29 17:59:00 +08:00
shahaibo
3625180a6e Merge branch 'release/3.0' into dev/dev
# Conflicts:
#	src/main/java/com/ai/da/common/security/filter/AuthenticationFilter.java
#	src/main/java/com/ai/da/controller/ThirdPartyController.java
#	src/main/java/com/ai/da/service/AccountService.java
#	src/main/java/com/ai/da/service/impl/AccountServiceImpl.java
2024-09-29 17:56:49 +08:00
aae1442a6f websocket获取关注数与粉丝数 2024-09-29 15:55:12 +08:00
08dcd03468 修改默认头像 2024-09-28 20:14:19 +08:00
shahaibo
deda511e32 TASK:aida; 2024-09-27 16:43:02 +08:00
shahaibo
9bcf615b4b TASK:aida; 2024-09-27 16:30:58 +08:00
shahaibo
70912c4c43 Merge remote-tracking branch 'origin/dev/dev' into dev/dev 2024-09-27 16:24:56 +08:00
shahaibo
fa013c1974 TASK:aida; 2024-09-27 16:24:45 +08:00
11fbeb1ed0 Merge branch 'dev/dev_xp' into dev/dev
# Conflicts:
#	src/main/java/com/ai/da/common/utils/RedisUtil.java
#	src/main/java/com/ai/da/service/AccountService.java
2024-09-27 15:43:48 +08:00
f432b8cce6 修改提取的sketch 2024-09-27 15:40:30 +08:00
shahaibo
05ddd33bcd TASK:aida; 2024-09-27 15:33:20 +08:00
shahaibo
9f5c901502 TASK:aida; 2024-09-27 14:42:30 +08:00
33d5d3a2ea 上传图片超时,邮件提醒开发相关人员 2024-09-26 11:46:23 +08:00
2668dd3c47 redis 添加key 2024-09-25 16:17:55 +08:00
2bc5fef175 1、修改用户名
2、更改账号绑定邮箱地址
2024-09-25 16:15:18 +08:00
ea92e1f20d to dev 2024-09-25 11:38:11 +08:00
9f1cf1d90e Merge branch 'dev/dev_xp' into dev/dev 2024-09-25 11:31:40 +08:00
b43f9baead 修改 imageToSketch 2024-09-25 11:30:51 +08:00
shahaibo
41ffe335fc TASK:mq配置 2024-09-24 15:43:37 +08:00
shahaibo
56d0dcd25f TASK:数据迁移 2024-09-24 15:20:24 +08:00
shahaibo
4304acbe6f BUGFIX:作品广场 2024-09-24 14:37:22 +08:00
2f1b22d423 Merge branch 'refs/heads/release/3.0' into dev/dev_xp
# Conflicts:
#	src/main/java/com/ai/da/common/utils/RedisUtil.java
#	src/main/java/com/ai/da/service/impl/AccountServiceImpl.java
#	src/main/java/com/ai/da/service/impl/PortfolioServiceImpl.java
2024-09-24 10:27:18 +08:00
3eb8626831 修改 imageToSketch 2024-09-24 10:20:08 +08:00
5a86f2e649 修改 imageToSketch 2024-09-23 11:13:44 +08:00
93e9c61943 1、新增 imageToSketch
2、删除无用代码
2024-09-20 11:32:09 +08:00
shahaibo
c5e9941adb BUGFIX:design colorboard元素混入sketchboard; 2024-09-20 11:31:48 +08:00
56679808e9 mask更新 从sketch分割 2024-09-19 09:50:56 +08:00
shahaibo
40f5705e7a TASK:凭证更新; 2024-09-13 11:24:14 +08:00
shahaibo
32975d9900 TASK:链接注册试用; 2024-09-13 11:16:17 +08:00
shahaibo
72db49e7f5 Merge remote-tracking branch 'origin/release/3.0' into release/3.0 2024-09-13 11:13:42 +08:00
shahaibo
472f5e65b4 TASK:凭证更新; 2024-09-13 11:13:23 +08:00
e2f8fb082c 广场用户注册修改 添加账户开始时间并设置积分为0 2024-09-13 10:43:28 +08:00
a47e53b19e mask 数据替换,代码暂存 2024-09-13 10:09:33 +08:00
c01acec9e6 Merge branch 'dev/dev_xp' into dev/dev 2024-09-09 10:50:14 +08:00
969d7586fc mask替换相关接口--未完善版,暂存 2024-09-06 12:34:36 +08:00
31a40ff7ca 关闭dev定时任务 2024-09-06 10:01:28 +08:00
afb9c99228 Merge branch 'dev/dev_xp' into dev/dev 2024-09-06 09:32:40 +08:00
8ee6a529a0 作品广场优化,将点赞前三和浏览量前三的作品放在第一页的最前面 2024-09-02 12:02:54 +08:00
cebc05d132 BUGFIX:管理员系统 添加新用户邮箱校验,相同的邮箱只能创建一个账号 2024-08-27 11:32:47 +08:00
d23ac82b1b TASK:code-create 注册用户添加为AiDA的游客
BUGFIX:0关注状态下获取动态
2024-08-27 11:27:05 +08:00
e86b576050 TASK:动态 2024-08-23 17:34:38 +08:00
8a774aa328 管理员系统 优化 按用户名或用户邮箱 查询用户design频率 2024-08-21 15:07:14 +08:00
c5da68dc47 1、获取关注、粉丝列表、消息详细 返回参数统一
2、管理员系统 按用户名或用户邮箱 查询用户design频率
2024-08-21 14:31:10 +08:00
28df672a7d 优化 获取关注、粉丝列表 2024-08-21 10:23:55 +08:00
203c88dd70 添加头像 2024-08-19 15:10:41 +08:00
fa86a2af45 添加关注、取消关注、获取关注列表、粉丝列表相关接口 2024-08-19 11:52:53 +08:00
ac28ba233c 消息通知系统-一键已读;反复点赞、关注及取消 数据存储处理, 2024-08-16 10:32:15 +08:00
shahaibo
47dc2bfc6e BUGFIX:二创变原创 2024-08-15 16:37:24 +08:00
085dac0630 消息通知系统 2024-08-15 16:25:44 +08:00
7b27b1362d Merge branch 'dev/dev_xp' into release/3.0
# Conflicts:
#	src/main/java/com/ai/da/service/impl/AccountServiceImpl.java
2024-08-12 09:54:28 +08:00
704e3c25bf BUG修复:用户更改套餐,积分/用户角色不变更问题 2024-08-12 09:51:39 +08:00
7e5b10aab3 通过邮箱查询账户,忽略邮箱大小写 2024-08-08 10:54:22 +08:00
3ccbd8f905 账号置为游客日志添加 2024-08-08 10:13:47 +08:00
89a234e77d to prod 2024-08-06 11:43:20 +08:00
388dd54bfa to prod 2024-08-06 11:41:48 +08:00
035c4412f1 Merge branch 'dev/dev' into release/3.0 2024-08-06 11:35:55 +08:00
d4eb7c846b to dev 2024-08-06 11:35:11 +08:00
fef50d7a37 Merge branch 'dev/dev_xp' into dev/dev 2024-08-06 11:30:02 +08:00
e5a95972a5 modify : 管理员系统 2024-08-06 11:29:33 +08:00
shahaibo
36a796b38b BUGFIX:多个印花 2024-08-05 17:44:53 +08:00
94927ae0a4 modify 2024-08-05 15:48:50 +08:00
4d7153661c Merge branch 'release/3.0' into dev/dev 2024-08-05 15:39:01 +08:00
76062136d6 Merge branch 'dev/dev_xp' into dev/dev 2024-08-05 15:38:05 +08:00
ea4ba74989 管理员系统功能添加 2024-08-05 15:19:02 +08:00
shahaibo
5a09d7a195 BUGFIX:过滤已废弃 2024-08-02 12:28:58 +08:00
shahaibo
e0332b9ddf BUGFIX:过滤已废弃 2024-08-02 12:21:30 +08:00
shahaibo
685ba09f7d BUGFIX:过滤已废弃 2024-08-02 12:13:32 +08:00
shahaibo
7aa1fc0342 BUGFIX:过滤已废弃 2024-08-02 11:56:17 +08:00
shahaibo
653264151a BUGFIX:过滤已废弃 2024-08-02 11:53:50 +08:00
shahaibo
fada00c738 BUGFIX:过滤已废弃 2024-08-02 11:36:58 +08:00
a10d30337a 支付切换为live 2024-08-01 10:30:44 +08:00
85ffed114b 语言适配 2024-08-01 10:07:24 +08:00
1093ac68b6 查询指定用户各功能使用情况 2024-08-01 10:00:26 +08:00
71e6abd816 to prod 2024-07-29 17:52:06 +08:00
00c948116e to prod 2024-07-29 17:50:40 +08:00
b6efd598bd to prod 2024-07-29 17:50:09 +08:00
bfe7ad4aa6 to prod 2024-07-29 17:49:16 +08:00
018ccef46a to prod 2024-07-29 17:47:09 +08:00
feb836f849 调查问卷 2024-07-29 17:36:32 +08:00
0106f21b86 Merge branch 'dev/dev_xp' into dev/dev 2024-07-29 17:31:21 +08:00
1b5f64785d 调查问卷查看 2024-07-29 17:24:14 +08:00
77a4aee88e 取消英文字母的正则匹配 2024-07-24 09:44:32 +08:00
shahaibo
ce1e2f3eab TASK:取消定时任务 2024-07-22 11:18:43 +08:00
shahaibo
75fbd2844b TASK:mq配置 2024-07-22 11:15:25 +08:00
shahaibo
832f331603 TASK:配置文件dev分支改为dev 2024-07-22 11:14:19 +08:00
9a2d58d922 正则匹配输入的英文文本 2024-07-22 09:46:11 +08:00
徐佩
34c4cd47ef Merge remote-tracking branch 'origin/release/3.0' into dev/dev
# Conflicts:
#	src/main/java/com/ai/da/common/task/AccountTask.java
2024-07-21 09:54:42 +08:00
c46f65600f 添加 开展活动接口 2024-07-19 15:40:54 +08:00
aa1eb7411e stripe 设置支付链接语言 2024-07-17 17:12:25 +08:00
490 changed files with 18576 additions and 6141 deletions

42
pom.xml
View File

@@ -151,9 +151,15 @@
<version>3.0.3</version> <version>3.0.3</version>
</dependency> </dependency>
<!-- /**发送邮件**/--> <!-- /**发送邮件**/-->
<!-- <dependency>-->
<!-- <groupId>com.tencentcloudapi</groupId>-->
<!-- <artifactId>tencentcloud-sdk-java-ses</artifactId>-->
<!-- <version>3.1.572</version>-->
<!-- </dependency>-->
<dependency> <dependency>
<groupId>com.tencentcloudapi</groupId> <groupId>com.tencentcloudapi</groupId>
<artifactId>tencentcloud-sdk-java-ses</artifactId> <artifactId>tencentcloud-sdk-java</artifactId>
<version>3.1.572</version> <version>3.1.572</version>
</dependency> </dependency>
@@ -276,6 +282,40 @@
<artifactId>gson</artifactId> <artifactId>gson</artifactId>
<version>2.10.1</version> <version>2.10.1</version>
</dependency> </dependency>
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>itextpdf</artifactId>
<version>5.5.13.2</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-websocket</artifactId>
</dependency>
<dependency>
<groupId>com.google.auth</groupId>
<artifactId>google-auth-library-oauth2-http</artifactId>
<version>1.8.0</version>
</dependency>
<dependency>
<groupId>com.google.api-client</groupId>
<artifactId>google-api-client</artifactId>
<version>1.32.1</version>
</dependency>
<dependency>
<groupId>com.google.oauth-client</groupId>
<artifactId>google-oauth-client</artifactId>
<version>1.32.1</version>
</dependency>
<dependency>
<groupId>com.google.http-client</groupId>
<artifactId>google-http-client-jackson2</artifactId>
<version>1.41.5</version>
</dependency>
</dependencies> </dependencies>
<build> <build>

View File

@@ -6,6 +6,7 @@ import com.ai.da.common.utils.RedisUtil;
import com.ai.da.model.dto.GenerateThroughImageTextDTO; import com.ai.da.model.dto.GenerateThroughImageTextDTO;
import com.ai.da.model.vo.GenerateResultVO; import com.ai.da.model.vo.GenerateResultVO;
import com.ai.da.service.GenerateService; import com.ai.da.service.GenerateService;
import com.ai.da.service.UserLikeGroupService;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.google.gson.Gson; import com.google.gson.Gson;
import com.rabbitmq.client.Channel; import com.rabbitmq.client.Channel;
@@ -14,8 +15,10 @@ import org.apache.tomcat.jni.Time;
import org.springframework.amqp.core.Message; import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitHandler; import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener; import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.io.IOException; import java.io.IOException;
@@ -30,6 +33,12 @@ public class GenerateConsumer {
@Resource @Resource
private GenerateService generateService; private GenerateService generateService;
@Resource
private UserLikeGroupService userLikeGroupService;
@Autowired
private RabbitMQProperties rabbitMQProperties;
@Resource @Resource
private RedisUtil redisUtil; private RedisUtil redisUtil;
@@ -163,6 +172,9 @@ public class GenerateConsumer {
String taskId = generateResult.get("tasks_id"); String taskId = generateResult.get("tasks_id");
String category = generateResult.get("category"); String category = generateResult.get("category");
generateService.processToProductImageResult(taskId, url, category); generateService.processToProductImageResult(taskId, url, category);
} else if (generateResult.get("status").equals("NO_FACE")) {
String taskId = generateResult.get("tasks_id");
userLikeGroupService.toProduct(taskId);
} else { } else {
// 修改redis中的数据状态为exception // 修改redis中的数据状态为exception
String key = toProductImageResultKey + ":" + generateResult.get("tasks_id"); String key = toProductImageResultKey + ":" + generateResult.get("tasks_id");
@@ -210,6 +222,9 @@ public class GenerateConsumer {
String taskId = generateResult.get("tasks_id"); String taskId = generateResult.get("tasks_id");
String category = generateResult.get("category"); String category = generateResult.get("category");
generateService.processRelightResult(taskId, url, category); generateService.processRelightResult(taskId, url, category);
} else if (generateResult.get("status").equals("NO_FACE")) {
String taskId = generateResult.get("tasks_id");
userLikeGroupService.relight(taskId);
} else { } else {
// 修改redis中的数据状态为exception // 修改redis中的数据状态为exception
String key = relightResultKey + ":" + generateResult.get("tasks_id"); String key = relightResultKey + ":" + generateResult.get("tasks_id");
@@ -243,73 +258,73 @@ public class GenerateConsumer {
log.info("============ProcessRelightResult End listening=========="); log.info("============ProcessRelightResult End listening==========");
} }
@RabbitListener(queues = MQConfig.GENERATE_QUEUE) @RabbitListener(queues = "#{rabbitMQProperties.queues.generate}")
@RabbitHandler @RabbitHandler
public void generateConsumer1(Message msg, Channel channel) { public void generateConsumer1(Message msg, Channel channel) {
generate(msg, channel, "consumer 1"); generate(msg, channel, "consumer 1");
} }
@RabbitListener(queues = MQConfig.GENERATE_QUEUE) @RabbitListener(queues = "#{rabbitMQProperties.queues.generate}")
@RabbitHandler @RabbitHandler
public void generateConsumer2(Message msg, Channel channel) { public void generateConsumer2(Message msg, Channel channel) {
generate(msg, channel, "consumer 2"); generate(msg, channel, "consumer 2");
} }
@RabbitListener(queues = MQConfig.GENERATE_QUEUE) @RabbitListener(queues = "#{rabbitMQProperties.queues.generate}")
@RabbitHandler @RabbitHandler
public void generateConsumer3(Message msg, Channel channel) { public void generateConsumer3(Message msg, Channel channel) {
generate(msg, channel, "consumer 3"); generate(msg, channel, "consumer 3");
} }
@RabbitListener(queues = MQConfig.GENERATE_QUEUE) @RabbitListener(queues = "#{rabbitMQProperties.queues.generate}")
@RabbitHandler @RabbitHandler
public void generateConsumer4(Message msg, Channel channel) { public void generateConsumer4(Message msg, Channel channel) {
generate(msg, channel, "consumer 4"); generate(msg, channel, "consumer 4");
} }
@RabbitListener(queues = MQConfig.GENERATE_QUEUE) @RabbitListener(queues = "#{rabbitMQProperties.queues.generate}")
@RabbitHandler @RabbitHandler
public void generateConsumer5(Message msg, Channel channel) { public void generateConsumer5(Message msg, Channel channel) {
generate(msg, channel, "consumer 5"); generate(msg, channel, "consumer 5");
} }
@RabbitListener(queues = MQConfig.GENERATE_QUEUE) @RabbitListener(queues = "#{rabbitMQProperties.queues.generate}")
@RabbitHandler @RabbitHandler
public void generateConsumer6(Message msg, Channel channel) { public void generateConsumer6(Message msg, Channel channel) {
generate(msg, channel, "consumer 6"); generate(msg, channel, "consumer 6");
} }
@RabbitListener(queues = MQConfig.GENERATE_QUEUE) @RabbitListener(queues = "#{rabbitMQProperties.queues.generate}")
@RabbitHandler @RabbitHandler
public void generateConsumer7(Message msg, Channel channel) { public void generateConsumer7(Message msg, Channel channel) {
generate(msg, channel, "consumer 7"); generate(msg, channel, "consumer 7");
} }
@RabbitListener(queues = MQConfig.GENERATE_QUEUE) @RabbitListener(queues = "#{rabbitMQProperties.queues.generate}")
@RabbitHandler @RabbitHandler
public void generateConsumer8(Message msg, Channel channel) { public void generateConsumer8(Message msg, Channel channel) {
generate(msg, channel, "consumer 8"); generate(msg, channel, "consumer 8");
} }
@RabbitListener(queues = MQConfig.GENERATE_QUEUE) @RabbitListener(queues = "#{rabbitMQProperties.queues.generate}")
@RabbitHandler @RabbitHandler
public void generateConsumer9(Message msg, Channel channel) { public void generateConsumer9(Message msg, Channel channel) {
generate(msg, channel, "consumer 9"); generate(msg, channel, "consumer 9");
} }
@RabbitListener(queues = MQConfig.GENERATE_RESULT_QUEUE) @RabbitListener(queues = "#{rabbitMQProperties.queues.generateResult}")
@RabbitHandler @RabbitHandler
public void getGenerateResult(Message msg, Channel channel) { public void getGenerateResult(Message msg, Channel channel) {
processGenerateResult(msg, channel); processGenerateResult(msg, channel);
} }
@RabbitListener(queues = MQConfig.TO_PRODUCT_IMAGE_RESULT_QUEUE) @RabbitListener(queues = "#{rabbitMQProperties.queues.toProductImageResult}")
@RabbitHandler @RabbitHandler
public void getToProductImageResult(Message msg, Channel channel) { public void getToProductImageResult(Message msg, Channel channel) {
processToProductImageResult(msg, channel); processToProductImageResult(msg, channel);
} }
@RabbitListener(queues = MQConfig.RELIGHT_RESULT_QUEUE) @RabbitListener(queues = "#{rabbitMQProperties.queues.relightResult}")
@RabbitHandler @RabbitHandler
public void getRelightResult(Message msg, Channel channel) { public void getRelightResult(Message msg, Channel channel) {
processRelightResult(msg, channel); processRelightResult(msg, channel);

View File

@@ -1,66 +1,43 @@
package com.ai.da.common.RabbitMQ; package com.ai.da.common.RabbitMQ;
import org.springframework.amqp.core.Queue; import org.springframework.amqp.core.Queue;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
@Configuration @Configuration
public class MQConfig { public class MQConfig {
public static final String GENERATE_EXCHANGE_FANOUT = "generate-exchange"; @Autowired
// public static final String GENERATE_QUEUE = "generate-queue-prod"; private RabbitMQProperties rabbitMQProperties;
// public static final String GENERATE_QUEUE = "generate-queue-test";
// ==================================================================
// public static final String GENERATE_QUEUE = "generate-queue-local";
// public static final String GENERATE_QUEUE = "generate-queue-dev";
public static final String GENERATE_QUEUE = "generate-queue-prod";
//
// public static final String SR_QUEUE = "SR-queue-local";
// public static final String SR_QUEUE = "SR-queue-dev";
public static final String SR_QUEUE = "SR-queue-prod";
//
// public static final String SR_RESULT_QUEUE = "SuperResolution-local";
// public static final String SR_RESULT_QUEUE = "SuperResolution-dev";
public static final String SR_RESULT_QUEUE = "SuperResolution-prod";
//
// public static final String GENERATE_RESULT_QUEUE = "GenerateImage-local";
public static final String GENERATE_RESULT_QUEUE = "GenerateImage-prod";
public static final String TO_PRODUCT_IMAGE_RESULT_QUEUE = "ToProductImage-prod";
public static final String RELIGHT_RESULT_QUEUE = "Relight-prod";
public MQConfig() {
}
// @Bean
// FanoutExchange fanoutRasaExchange() {
// return new FanoutExchange(GENERATE_EXCHANGE_FANOUT);
// }
/**
* 创建队列,使用工作模式,不用定义交换机
*/
@Bean @Bean
public Queue generateQueue() { public Queue generateQueue() {
return new Queue(GENERATE_QUEUE); return new Queue(rabbitMQProperties.getQueues().getGenerate());
} }
@Bean @Bean
public Queue SRQueue() { public Queue SRQueue() {
return new Queue(SR_QUEUE); return new Queue(rabbitMQProperties.getQueues().getSr());
} }
@Bean @Bean
public Queue SRResultQueue() { public Queue SRResultQueue() {
return new Queue(SR_RESULT_QUEUE); return new Queue(rabbitMQProperties.getQueues().getSrResult());
} }
/** @Bean
* 将队列绑定到交换机上【队列订阅交换机】 public Queue generateResultQueue() {
*/ return new Queue(rabbitMQProperties.getQueues().getGenerateResult());
// @Bean }
// Binding bindingExchangeRasa() {
// return BindingBuilder.bind(queueRasa()).to(fanoutRasaExchange());
// }
@Bean
public Queue toProductImageResultQueue() {
return new Queue(rabbitMQProperties.getQueues().getToProductImageResult());
}
@Bean
public Queue relightResultQueue() {
return new Queue(rabbitMQProperties.getQueues().getRelightResult());
}
} }

View File

@@ -2,6 +2,7 @@ package com.ai.da.common.RabbitMQ;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.AmqpTemplate; import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import javax.annotation.Resource; import javax.annotation.Resource;
@@ -10,19 +11,19 @@ import javax.annotation.Resource;
@Component @Component
public class MQPublisher { public class MQPublisher {
// private final String url = "http://localhost:15672/api/queues/%2f/generate-queue"; @Autowired
private RabbitMQProperties rabbitMQProperties;
@Resource @Autowired
private AmqpTemplate amqpTemplate; private AmqpTemplate amqpTemplate;
public void sendGenerateMessage(String mm) { public void sendGenerateMessage(String mm) {
log.info("send message:" + mm); log.info("send message: " + mm);
amqpTemplate.convertAndSend(MQConfig.GENERATE_QUEUE, mm); amqpTemplate.convertAndSend(rabbitMQProperties.getQueues().getGenerate(), mm);
} }
public void sendSRMessage(String mm) { public void sendSRMessage(String mm) {
log.info("send message:" + mm); log.info("send message: " + mm);
amqpTemplate.convertAndSend(MQConfig.SR_QUEUE, mm); amqpTemplate.convertAndSend(rabbitMQProperties.getQueues().getSr(), mm);
} }
} }

View File

@@ -0,0 +1,30 @@
package com.ai.da.common.RabbitMQ;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
@Component
@ConfigurationProperties(prefix = "rabbitmq")
@Data
public class RabbitMQProperties {
private Queues queues;
private Exchange exchange;
@Data
public static class Queues {
private String generate;
private String sr;
private String srResult;
private String generateResult;
private String toProductImageResult;
private String relightResult;
}
@Data
public static class Exchange {
private String generate;
}
}

View File

@@ -15,6 +15,7 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message; import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitHandler; import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener; import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
@@ -27,6 +28,9 @@ import java.util.HashMap;
@Component @Component
public class SRConsumer { public class SRConsumer {
@Autowired
private RabbitMQProperties rabbitMQProperties;
@Resource @Resource
private RedisUtil redisUtil; private RedisUtil redisUtil;
@@ -218,14 +222,13 @@ public class SRConsumer {
taskListService.updateTaskStatusOrOutputRedis(uniqueId, "fail", null); taskListService.updateTaskStatusOrOutputRedis(uniqueId, "fail", null);
} }
@RabbitListener(queues = MQConfig.SR_QUEUE) @RabbitListener(queues = "#{rabbitMQProperties.queues.sr}")
@RabbitHandler @RabbitHandler
public void SRConsumer1(Message msg, Channel channel) { public void SRConsumer1(Message msg, Channel channel) {
superResolution(msg, channel, "consumer 1"); superResolution(msg, channel, "consumer 1");
} }
@RabbitListener(queues = "#{rabbitMQProperties.queues.srResult}")
@RabbitListener(queues = MQConfig.SR_RESULT_QUEUE)
@RabbitHandler @RabbitHandler
public void SRResultConsumer1(Message msg, Channel channel) { public void SRResultConsumer1(Message msg, Channel channel) {
getSRResult(msg, channel, "consumer 1"); getSRResult(msg, channel, "consumer 1");

View File

@@ -6,7 +6,10 @@ import com.ai.da.common.utils.SendEmailUtil;
import com.ai.da.mapper.primary.*; import com.ai.da.mapper.primary.*;
import com.ai.da.mapper.primary.entity.*; import com.ai.da.mapper.primary.entity.*;
import com.ai.da.mapper.secondary.AttributeRetrievalMapper; import com.ai.da.mapper.secondary.AttributeRetrievalMapper;
import com.ai.da.model.enums.StyleEnum;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.usermodel.Row; import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.ss.usermodel.Sheet;
@@ -31,7 +34,7 @@ import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors; import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@Slf4j
@Component @Component
public class MyTaskScheduler { public class MyTaskScheduler {
@@ -39,6 +42,7 @@ public class MyTaskScheduler {
public void test() { public void test() {
// clearMinio(); // clearMinio();
// addSystemFileStyle(); // addSystemFileStyle();
// sendTrialOrderExcelToManagements();
} }
@Resource @Resource
@@ -83,10 +87,11 @@ public class MyTaskScheduler {
} }
} }
} }
@Scheduled(cron = "0 0 8 * * ?") @Scheduled(cron = "0 0 9 * * ?")
public void sendTrialOrderExcelToManagements() { public void sendTrialOrderExcelToManagements() {
// 获取前一天日期 // 获取前一天日期
LocalDate yesterday = LocalDate.now().minusDays(1); LocalDate yesterday = LocalDate.now().minusDays(1);
// LocalDate before = LocalDate.now().minusDays(4);
// 查询前一天的试用订单 // 查询前一天的试用订单
QueryWrapper<TrialOrder> qw = new QueryWrapper<>(); QueryWrapper<TrialOrder> qw = new QueryWrapper<>();
@@ -126,7 +131,9 @@ public class MyTaskScheduler {
row.createCell(6).setCellValue(trialOrder.getCountry()); row.createCell(6).setCellValue(trialOrder.getCountry());
row.createCell(7).setCellValue(trialOrder.getOccupation()); row.createCell(7).setCellValue(trialOrder.getOccupation());
row.createCell(8).setCellValue(trialOrder.getCreateTime().format(formatter)); row.createCell(8).setCellValue(trialOrder.getCreateTime().format(formatter));
if (!ObjectUtils.isEmpty(trialOrder.getUpdateTime())) {
row.createCell(9).setCellValue(trialOrder.getUpdateTime().format(formatter)); row.createCell(9).setCellValue(trialOrder.getUpdateTime().format(formatter));
}
row.createCell(10).setCellValue(trialOrder.getStatus()); row.createCell(10).setCellValue(trialOrder.getStatus());
} }
@@ -134,19 +141,27 @@ public class MyTaskScheduler {
String fileName = "trialOrder-" + yesterday.format(DateTimeFormatter.ofPattern("yyyyMMdd")) + ".xlsx"; String fileName = "trialOrder-" + yesterday.format(DateTimeFormatter.ofPattern("yyyyMMdd")) + ".xlsx";
try (FileOutputStream fileOut = new FileOutputStream(fileName)) { try (FileOutputStream fileOut = new FileOutputStream(fileName)) {
workbook.write(fileOut); workbook.write(fileOut);
SendEmailUtil.sendExcelEmail("1023316923@qq.com", null, Files.readAllBytes(Paths.get(fileName)), fileName); // SendEmailUtil.sendExcelEmail("1023316923@qq.com", null, Files.readAllBytes(Paths.get(fileName)), fileName);
SendEmailUtil.sendExcelEmail("calvinwong@aidlab.hk", null, Files.readAllBytes(Paths.get(fileName)), fileName); SendEmailUtil.sendExcelEmail("calvinwong@aidlab.hk", null, Files.readAllBytes(Paths.get(fileName)), fileName);
SendEmailUtil.sendExcelEmail("kaicpang.pang@connect.polyu.hk", null, Files.readAllBytes(Paths.get(fileName)), fileName); SendEmailUtil.sendExcelEmail("kaicpang.pang@connect.polyu.hk", null, Files.readAllBytes(Paths.get(fileName)), fileName);
SendEmailUtil.sendExcelEmail("kimwong@code-create.com.hk", null, Files.readAllBytes(Paths.get(fileName)), fileName); SendEmailUtil.sendExcelEmail("kimwong@code-create.com.hk", null, Files.readAllBytes(Paths.get(fileName)), fileName);
// SendEmailUtil.sendExcelEmail("ningning@code-create.com.hk", null, Files.readAllBytes(Paths.get(fileName)), fileName);
SendEmailUtil.sendExcelEmail("johnnyho@code-create.com.hk", null, Files.readAllBytes(Paths.get(fileName)), fileName);
SendEmailUtil.sendExcelEmail("ringolau@code-create.com.hk", null, Files.readAllBytes(Paths.get(fileName)), fileName);
SendEmailUtil.sendExcelEmail("chelseayu@code-create.com.hk", null, Files.readAllBytes(Paths.get(fileName)), fileName);
} }
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
} }
}else { }else {
SendEmailUtil.sendNoExcelEmail("1023316923@qq.com", null); // SendEmailUtil.sendNoExcelEmail("1023316923@qq.com", null);
SendEmailUtil.sendNoExcelEmail("calvinwong@aidlab.hk", null); SendEmailUtil.sendNoExcelEmail("calvinwong@aidlab.hk", null);
SendEmailUtil.sendNoExcelEmail("kaicpang.pang@connect.polyu.hk", null); SendEmailUtil.sendNoExcelEmail("kaicpang.pang@connect.polyu.hk", null);
SendEmailUtil.sendNoExcelEmail("kimwong@code-create.com.hk", null); SendEmailUtil.sendNoExcelEmail("kimwong@code-create.com.hk", null);
// SendEmailUtil.sendNoExcelEmail("ningning@code-create.com.hk", null);
SendEmailUtil.sendNoExcelEmail("johnnyho@code-create.com.hk", null);
SendEmailUtil.sendNoExcelEmail("ringolau@code-create.com.hk", null);
SendEmailUtil.sendNoExcelEmail("chelseayu@code-create.com.hk", null);
} }
} }
@@ -219,29 +234,47 @@ public class MyTaskScheduler {
private AttributeRetrievalMapper attributeRetrievalMapper; private AttributeRetrievalMapper attributeRetrievalMapper;
public void addSystemFileStyle() { public void addSystemFileStyle() {
ExecutorService executorService = Executors.newFixedThreadPool(5); // ExecutorService executorService = Executors.newFixedThreadPool(5);
try { // try {
// String[] filePaths = {
// "C:\\Users\\10233\\Downloads\\OneDrive_1_2024-10-3\\Mens bottom style output.xlsx",
// "C:\\Users\\10233\\Downloads\\OneDrive_1_2024-10-3\\Mens outer style output.xlsx",
// "C:\\Users\\10233\\Downloads\\OneDrive_1_2024-10-3\\Mens top style output.xlsx"
//// "/workspace/shb/Mens_bottom_style_output.xlsx",
//// "/workspace/shb/Mens_outer_style_output.xlsx",
//// "/workspace/shb/Mens_top_style_output.xlsx"
// };
//
// for (String filePath : filePaths) {
//// executorService.submit(() -> processExcelFile(filePath));
// processExcelFile(filePath);
// }
// }catch (Exception e) {
//
// }
// } finally {
// executorService.shutdown();
// try {
// if (!executorService.awaitTermination(60, TimeUnit.MINUTES)) {
// executorService.shutdownNow();
// }
// } catch (InterruptedException e) {
// executorService.shutdownNow();
// }
// }
String[] filePaths = { String[] filePaths = {
"C:\\Users\\10233\\Documents\\WeChat Files\\wxid_h7l9im0r8ql922\\FileStorage\\File\\2024-06\\style\\Blouse style output updated25.6.2024.xlsx", "C:\\Users\\10233\\Downloads\\OneDrive_1_2024-10-3\\Mens bottom style output.xlsx",
"C:\\Users\\10233\\Documents\\WeChat Files\\wxid_h7l9im0r8ql922\\FileStorage\\File\\2024-06\\style\\Dress style output updated25.6.2024.xlsx", "C:\\Users\\10233\\Downloads\\OneDrive_1_2024-10-3\\Mens outer style output.xlsx",
"C:\\Users\\10233\\Documents\\WeChat Files\\wxid_h7l9im0r8ql922\\FileStorage\\File\\2024-06\\style\\Outerwear style output.xlsx", "C:\\Users\\10233\\Downloads\\OneDrive_1_2024-10-3\\Mens top style output.xlsx"
"C:\\Users\\10233\\Documents\\WeChat Files\\wxid_h7l9im0r8ql922\\FileStorage\\File\\2024-06\\style\\Skirt style output .xlsx", // "/workspace/shb/Mens_bottom_style_output.xlsx",
"C:\\Users\\10233\\Documents\\WeChat Files\\wxid_h7l9im0r8ql922\\FileStorage\\File\\2024-06\\style\\Trousers style output.xlsx" // "/workspace/shb/Mens_outer_style_output.xlsx",
// "/workspace/shb/Mens_top_style_output.xlsx"
}; };
for (String filePath : filePaths) { for (String filePath : filePaths) {
executorService.submit(() -> processExcelFile(filePath)); // executorService.submit(() -> processExcelFile(filePath));
} processExcelFile(filePath);
} finally {
executorService.shutdown();
try {
if (!executorService.awaitTermination(60, TimeUnit.MINUTES)) {
executorService.shutdownNow();
}
} catch (InterruptedException e) {
executorService.shutdownNow();
}
} }
} }
@@ -263,6 +296,37 @@ public class MyTaskScheduler {
attributeRetrievalMapper.updateStyleByFileName("X", prefix + fileName, tableName); attributeRetrievalMapper.updateStyleByFileName("X", prefix + fileName, tableName);
System.out.println(fileName); System.out.println(fileName);
} else { } else {
// if (style.equals("Y2K 风")) {
// StyleEnum.COUNTRY_STYLE
// }else if (style.equals("")) {
//
// }else if (style.equals("")) {
//
// }else if (style.equals("")) {
//
// }else if (style.equals("")) {
//
// }else if (style.equals("")) {
//
// }else if (style.equals("")) {
//
// }else if (style.equals("")) {
//
// }else if (style.equals("")) {
//
// }else if (style.equals("")) {
//
// }else if (style.equals("")) {
//
// }else if (style.equals("")) {
//
// }else if (style.equals("")) {
//
// }else if (style.equals("")) {
//
// }else if (style.equals("")) {
//
// }
attributeRetrievalMapper.updateStyleByFileName(style, prefix + fileName, tableName); attributeRetrievalMapper.updateStyleByFileName(style, prefix + fileName, tableName);
System.out.println(fileName); System.out.println(fileName);
} }
@@ -284,6 +348,12 @@ public class MyTaskScheduler {
return "female_skirt"; return "female_skirt";
} else if (filePath.contains("Trousers")) { } else if (filePath.contains("Trousers")) {
return "female_pants"; return "female_pants";
} else if (filePath.contains("bottom")) {
return "male_bottom";
} else if (filePath.contains("outer")) {
return "male_outwear";
} else if (filePath.contains("top")) {
return "male_top";
} }
return ""; return "";
} }
@@ -299,6 +369,12 @@ public class MyTaskScheduler {
return "skirt/"; return "skirt/";
} else if (filePath.contains("Trousers")) { } else if (filePath.contains("Trousers")) {
return "trousers/"; return "trousers/";
} else if (filePath.contains("bottom")) {
return "bottom/";
} else if (filePath.contains("outer")) {
return "outer/";
} else if (filePath.contains("top")) {
return "top/";
} }
return ""; return "";
} }

View File

@@ -0,0 +1,12 @@
package com.ai.da.common.config.exception;
public class TokenMissingOrExpiredException extends RuntimeException {
public TokenMissingOrExpiredException(String message) {
super(message);
}
@Override
public Throwable fillInStackTrace() {
return this;
}
}

View File

@@ -1,5 +1,8 @@
package com.ai.da.common.constant; package com.ai.da.common.constant;
import java.util.Arrays;
import java.util.List;
public class CommonConstant { public class CommonConstant {
// 单位 秒 10分钟过期 // 单位 秒 10分钟过期
// public static final Long TASK_EXPIRE_TIME = 24 * 60 * 60L; // public static final Long TASK_EXPIRE_TIME = 24 * 60 * 60L;
@@ -10,6 +13,8 @@ public class CommonConstant {
public static final Integer MINIO_IMAGE_EXPIRE_TIME = 24 * 60; public static final Integer MINIO_IMAGE_EXPIRE_TIME = 24 * 60;
// 单位 秒 一天过期 in redis // 单位 秒 一天过期 in redis
public static final Long GENERATE_RESULT_EXPIRE_TIME = 24 * 60 * 60L; public static final Long GENERATE_RESULT_EXPIRE_TIME = 24 * 60 * 60L;
// 单位 秒 7天过期
public static final Long REDIS_SET_EXPIRE_TIME = 24 * 60 * 60 * 7L;
public static class Numbers{ public static class Numbers{
public static final Integer NUMBER_10 = 10; public static final Integer NUMBER_10 = 10;
@@ -31,6 +36,52 @@ public class CommonConstant {
public static final String PYTHON_PORT_9997 = "9997"; public static final String PYTHON_PORT_9997 = "9997";
public static final List<String> AGES_EN = Arrays.asList("Below 20", "20-30", "30-40", "40+");
public static final List<String> AGES_CN = Arrays.asList("20岁以下", "20-30岁", "30-40岁", "40+岁");
public static final List<String> IF_HELPFUL_EN = Arrays.asList("Easy to learn and use", "Easy to get trend information",
"Lots of creative design proposals","The AIGC functions for moodboard is helpful","The AIGC functions for design sketches is helpful",
"Easy to select the right color","The Chatbot function is helpful","The print position function is helpful",
"The drawing function is helpful","The export function is useful","Easy to edit the design","Others");
public static final List<String> IF_HELPFUL_CN = Arrays.asList("易于学习和使用", "容易获取趋势信息",
"提供大量创意设计方案","AIGC功能对灵感板有帮助","AIGC功能对设计草图有帮助",
"容易选择合适的颜色","聊天机器人功能有帮助","打印位置功能有帮助",
"绘图功能有帮助","导出功能有用","设计编辑简单","其他");
public static final List<String> IF_IMPROVE_EN = Arrays.asList("Proposed designs are boring, need more interesting designs",
"Difficult to make changes on design","Only 2D output, no 3D results","Difficult to apply keywords for AIGC generation",
"Clothing is not in the right proportion","Not compatible with pattern making solutions","Improved user interface for better navigation",
"Lack of responsive customer support","Insufficient tutorial or guidance for new users","Limited personalization options for designs","Others");
public static final List<String> IF_IMPROVE_CN = Arrays.asList("提供的设计很无聊,需要更多有趣的设计",
"设计修改困难","只有2D输出没有3D结果","难以选择合适的关键词应用于AIGC生成",
"服装比例不正确","与打版解决方案不兼容","改进用户界面以便更好导航",
"客户支持响应不及时","对新用户的教程或指导不足","设计个性化选项有限","其他");
public static final List<String> IS_SUBSCRIBE = Arrays.asList("yes", "no");
// public static final String DEFAULT_AVATAR = "aida-users/87/avatar/default.jpg";
public static final String DEFAULT_AVATAR = "aida-users/87/avatar/default.png";
/* 截止至2024/08/26在Code-Create DB中pmr_users表中最大的用户id */
public static final Long MAXIMUM_USER_ID = 704L;
// public static final Long MAXIMUM_USER_ID = 225L;
// 激活更改邮箱 链接有效期 毫秒 3天
public static final Long CHANGE_MAILBOX_LINK_VALIDITY = 259200000L;
public static final String RCA_WORKSHOP_TAG = "#RCAworkshop_2024";
public static final String PORTFOLIO_DELETED_EN = "Portfolio has been deleted";
public static final String PORTFOLIO_DELETED_CN = "作品已删除";
public static final String TIME_FORMAT_MMM_dd_yyyy_EEEE = "MMM. dd, yyyy, EEEE";
public static final String TIME_FORMAT_MMM_dd_yyyy = "MMM. dd, yyyy";
public static final String TIME_FORMAT_yyyy_MM_dd_HH_mm_ss = "yyyy-MM-dd HH:mm:ss";
public static final String AFFILIATE_LINK = "https://www.aida.com.hk?ref=";
} }

View File

@@ -23,7 +23,17 @@ public enum AuthenticationOperationTypeEnum {
/** /**
* 忘记密码 * 忘记密码
*/ */
FORGET_PWD; FORGET_PWD,
/**
* 更改邮箱
*/
CHANGE_MAILBOX,
/**
* 填写用户国家和职业
*/
UPDATE_USERINFO,
REGISTER;
public static AuthenticationOperationTypeEnum of(String name) { public static AuthenticationOperationTypeEnum of(String name) {
return Stream.of(AuthenticationOperationTypeEnum.values()).filter(v -> v.name().equals(name)).findFirst().orElse(null); return Stream.of(AuthenticationOperationTypeEnum.values()).filter(v -> v.name().equals(name)).findFirst().orElse(null);

View File

@@ -8,9 +8,11 @@ import lombok.Getter;
public enum CreditsEventsEnum { public enum CreditsEventsEnum {
PRICE("price","6"), PRICE("price","6"),
// PRICE("price","1"),// for test
// PRICE("price","0.1"), // PRICE("price","0.1"),
BUY_CREDITS("Buy Credits","60"), BUY_CREDITS("Buy Credits","60"),
// BUY_CREDITS("Buy Credits","10"),// for test
REFUND("Refund","60"), REFUND("Refund","60"),
// BUY_CREDITS("Buy Credits","10"), // BUY_CREDITS("Buy Credits","10"),
@@ -20,6 +22,7 @@ public enum CreditsEventsEnum {
INIT_MONTHLY("init_monthly", "5000"), INIT_MONTHLY("init_monthly", "5000"),
INIT_TRIAL("init_trial", "100"), INIT_TRIAL("init_trial", "100"),
INIT_WEEKLY("init_weekly","6000"), INIT_WEEKLY("init_weekly","6000"),
RESET_YEAR_CREDITS("reset_year_credits","6000"),
// SUPER_RESOLUTION("Super Resolution","30"), // SUPER_RESOLUTION("Super Resolution","30"),
SUPER_RESOLUTION("Super Resolution","10"), SUPER_RESOLUTION("Super Resolution","10"),
@@ -31,6 +34,7 @@ public enum CreditsEventsEnum {
TO_PRODUCT_IMAGE("ToProductImage","5"), TO_PRODUCT_IMAGE("ToProductImage","5"),
RELIGHT("Relight","5"), RELIGHT("Relight","5"),
QUESTIONNAIRE("Questionnaire","100"), QUESTIONNAIRE("Questionnaire","100"),
IMAGE_TO_SKETCH("ImageToSketch","5"),
OTHER("Other","5"); OTHER("Other","5");

View File

@@ -10,38 +10,34 @@ public enum OrderStatusEnum {
* 未支付 * 未支付
*/ */
NOT_PAY("未支付"), NOT_PAY("未支付"),
/** /**
* 支付成功 * 支付成功
*/ */
SUCCESS("支付成功"), SUCCESS("支付成功"),
/**
* 支付失败
*/
FAILURE("支付失败"),
/** /**
* 已关闭 * 已关闭
*/ */
TIMEOUT_CLOSED("超时已关闭"), TIMEOUT_CLOSED("超时已关闭"),
/** /**
* 已取消 * 已取消
*/ */
CANCEL("用户已取消"), CANCEL("用户已取消"),
/** /**
* 退款中 * 退款中
*/ */
REFUND_PROCESSING("退款中"), REFUND_PROCESSING("退款中"),
/** /**
* 已退款 * 已退款
*/ */
REFUND_SUCCESS("已退款"), REFUND_SUCCESS("已退款"),
/** /**
* 退款异常 * 退款异常
*/ */
REFUND_ABNORMAL("退款异常"), REFUND_ABNORMAL("退款异常"),
/** /**
* paypal订单状态为 APPROVED * paypal订单状态为 APPROVED
*/ */

View File

@@ -0,0 +1,25 @@
package com.ai.da.common.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
@Getter
@AllArgsConstructor
public enum ProductEnum {
// 积分购买
CreditsProduct("AiDA credits purchase", 6L),
// 年度订阅
AnnualSubscription("AiDA Annual Subscription", 5000L),
// 月度订阅
MonthlySubscription("AiDA Monthly Subscription", 500L),
// 测试
DailySubscription("AiDA Daily Subscription", 10L),
;
/**
* 类型
*/
private final String name;
private final Long price;
}

View File

@@ -0,0 +1,15 @@
package com.ai.da.common.response;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.math.BigDecimal;
@Data
@NoArgsConstructor
@ApiModel("交易记录分页响应结果")
public class TransactionPageResponse<T> extends PageBaseResponse<T> {
private BigDecimal totalAmount;
}

View File

@@ -1,6 +1,7 @@
package com.ai.da.common.security.filter; package com.ai.da.common.security.filter;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.ai.da.common.config.exception.TokenMissingOrExpiredException;
import com.ai.da.common.context.UserContext; import com.ai.da.common.context.UserContext;
import com.ai.da.common.security.config.SecurityProperties; import com.ai.da.common.security.config.SecurityProperties;
import com.ai.da.common.security.jwt.JWTTokenHelper; import com.ai.da.common.security.jwt.JWTTokenHelper;
@@ -46,11 +47,12 @@ public class AuthenticationFilter extends OncePerRequestFilter {
"/webjars/", "/swagger-resources", "/v2/api-docs", "api/account/resetPwd", "/webjars/", "/swagger-resources", "/v2/api-docs", "api/account/resetPwd",
"/api/python/saveGeneratePicture", "/api/python/getLibraryByUserId", "/api/python/saveGeneratePicture", "/api/python/getLibraryByUserId",
"/api/third/party/addUser","/api/third/party/addTrialUser", "/api/third/party/editUser", "/api/element/initDefaultSysFile", "/api/third/party/addUser","/api/third/party/addTrialUser", "/api/third/party/editUser", "/api/element/initDefaultSysFile",
"/api/third/party/addNoLoginRequiredNew","/api/third/party/deleteNoLoginRequiredNew", "/api/third/party/addNoLoginRequiredNew","/api/third/party/deleteNoLoginRequiredNew","/api/third/party/updateNoLoginRequiredNew",
"/api/third/party/existNoLoginRequired","/api/third/party/getRedirectUrl", "/api/third/party/existNoLoginRequired","/api/third/party/getRedirectUrl",
"/api/python/flush","/api/account/healthy","/api/ali-pay/trade/notify","/api/paypal/ipn/back","/api/alipay-hk/trade/notify", "/api/python/flush","/api/account/healthy","/api/ali-pay/trade/notify","/api/paypal/ipn/back","/api/alipay-hk/trade/notify",
"/api/portfolio/page", "/api/portfolio/detail", "/api/portfolio/commentPage", "/api/portfolio/viewsIncrease", "/api/portfolio/page", "/api/portfolio/detail", "/api/portfolio/commentPage", "/api/portfolio/viewsIncrease",
"/api/account/designWorksRegister","/api/account/questionnaire","/api/stripe/trade/notify" "/api/account/designWorksRegister","/api/account/questionnaire","/api/stripe/trade/notify",
"/notification","/api/account/activateNewEmail","/api/third/party/auth/google_callback","/api/third/party/parseGoogleCredential","/api/third/party/receiveDesignResults","/api/third/party/parseWeChatCode"
); );
@Override @Override
@@ -100,7 +102,8 @@ public class AuthenticationFilter extends OncePerRequestFilter {
if (StrUtil.isBlank(jwtToken)) { if (StrUtil.isBlank(jwtToken)) {
String ipAddress = RequestInfoUtil.getIpAddress(request); String ipAddress = RequestInfoUtil.getIpAddress(request);
log.info("本次请求的ip为 " + ipAddress); log.info("本次请求的ip为 " + ipAddress);
throw new RuntimeException("请传入token"); // throw new RuntimeException("请传入token");
throw new TokenMissingOrExpiredException("请传入token");
} }
if(jwtToken.equals("Bearer-eyJhbGciOiJIUzUxMiJ9.eyJqdGkiOiIyIiwic3ViIjoie1wiaWRcIjoyLFwidXNlcm5hbWVcIjpcImxpcnNcIn0iLCJpYXQiOjE2NjU3NDEwODcsImlzcyI6IkRXSiIsImF1dGhvcml0aWVzIjoiW10iLCJleHAiOjE2NzQzODEwODd9.ShM9R_NNFD7oo1OvxrEgg7PFeWinOuAKkuInUCMQupp66s64Hhv8tN0Wwr83nIN4rHPqtn95wmd4msWcvaFYJA")){ if(jwtToken.equals("Bearer-eyJhbGciOiJIUzUxMiJ9.eyJqdGkiOiIyIiwic3ViIjoie1wiaWRcIjoyLFwidXNlcm5hbWVcIjpcImxpcnNcIn0iLCJpYXQiOjE2NjU3NDEwODcsImlzcyI6IkRXSiIsImF1dGhvcml0aWVzIjoiW10iLCJleHAiOjE2NzQzODEwODd9.ShM9R_NNFD7oo1OvxrEgg7PFeWinOuAKkuInUCMQupp66s64Hhv8tN0Wwr83nIN4rHPqtn95wmd4msWcvaFYJA")){
//写死 暂时放行 //写死 暂时放行
@@ -111,7 +114,8 @@ public class AuthenticationFilter extends OncePerRequestFilter {
if (validate) { if (validate) {
AuthPrincipalVo principal = jwtTokenHelper.parserToUser(jwtToken); AuthPrincipalVo principal = jwtTokenHelper.parserToUser(jwtToken);
if (principal == null) { if (principal == null) {
throw new RuntimeException("TOKEN已过期请重新登录"); // throw new RuntimeException("TOKEN已过期请重新登录");
throw new TokenMissingOrExpiredException("TOKEN已过期请重新登录(token without userInfo)");
} }
//先清空当前线程变量,防止上一个线程遗留 //先清空当前线程变量,防止上一个线程遗留
UserContext.delete(); UserContext.delete();
@@ -121,10 +125,12 @@ public class AuthenticationFilter extends OncePerRequestFilter {
String cacheToken = LocalCacheUtils.getTokenCache(String.valueOf(principal.getId())); String cacheToken = LocalCacheUtils.getTokenCache(String.valueOf(principal.getId()));
if(StringUtils.isEmpty(cacheToken)){ if(StringUtils.isEmpty(cacheToken)){
throw new RuntimeException("TOKEN已过期请重新登录"); // throw new RuntimeException("TOKEN已过期请重新登录");
throw new TokenMissingOrExpiredException("TOKEN已过期请重新登录(local cache empty)");
} }
if(!cacheToken.equals(jwtToken) ){ if(!cacheToken.equals(jwtToken) ){
throw new RuntimeException("TOKEN已过期请重新登录"); // throw new RuntimeException("TOKEN已过期请重新登录");
throw new TokenMissingOrExpiredException("TOKEN已过期请重新登录(token not match local cache)");
} }
// UsernamePasswordAuthenticationToken authentication = new UsernamePasswordAuthenticationToken(null, null); // UsernamePasswordAuthenticationToken authentication = new UsernamePasswordAuthenticationToken(null, null);
// SecurityContextHolder.getContext().setAuthentication(authentication); // SecurityContextHolder.getContext().setAuthentication(authentication);

View File

@@ -2,6 +2,7 @@ package com.ai.da.common.security.jwt;
import cn.hutool.core.map.MapUtil; import cn.hutool.core.map.MapUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.ai.da.common.constant.CommonConstant;
import com.ai.da.common.security.config.SecurityProperties; import com.ai.da.common.security.config.SecurityProperties;
import com.ai.da.model.vo.AuthPrincipalVo; import com.ai.da.model.vo.AuthPrincipalVo;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
@@ -30,6 +31,7 @@ public class JWTTokenHelper {
private static final String ISSUER = "DWJ"; private static final String ISSUER = "DWJ";
private static final String AUTHORITIES = "authorities"; private static final String AUTHORITIES = "authorities";
private static final String CHANGE_MAILBOX = "changeMailbox";
public String createToken(AuthPrincipalVo principal) { public String createToken(AuthPrincipalVo principal) {
String token = Jwts.builder() String token = Jwts.builder()
@@ -65,4 +67,21 @@ public class JWTTokenHelper {
token = token.replaceAll(securityProperties.getJwtTokenPrefix(), ""); token = token.replaceAll(securityProperties.getJwtTokenPrefix(), "");
return Jwts.parser().setSigningKey(securityProperties.getJwtSecret()).parseClaimsJws(token).getBody(); return Jwts.parser().setSigningKey(securityProperties.getJwtSecret()).parseClaimsJws(token).getBody();
} }
public String createToken(Long userId, String userEmail){
String token = Jwts.builder()
.setId(String.valueOf(userId))
.setSubject(userEmail + "_" + userId)
.setIssuedAt(new Date())
.setIssuer(ISSUER)
.claim(CHANGE_MAILBOX, JSON.toJSONString(new ArrayList<>()))//自定义属性 权限
.setExpiration(new Date(System.currentTimeMillis() + CommonConstant.CHANGE_MAILBOX_LINK_VALIDITY))
.signWith(SignatureAlgorithm.HS256, securityProperties.getJwtSecret())
.compact();
return token;
}
public String parseToEmailAndId(String token) {
return parser(token).getSubject();
}
} }

View File

@@ -1,11 +1,14 @@
package com.ai.da.common.task; package com.ai.da.common.task;
import com.ai.da.common.utils.RedisUtil;
import com.ai.da.mapper.primary.entity.Account;
import com.ai.da.service.AccountService; import com.ai.da.service.AccountService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled; import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.List;
@Component @Component
@Slf4j @Slf4j
@@ -13,19 +16,68 @@ public class AccountTask {
@Resource @Resource
private AccountService accountService; private AccountService accountService;
@Resource
private RedisUtil redisUtil;
/** 每周日晚上刷新 年付用户、月付用户的积分 */ /**
@Scheduled(cron = "59 59 23 ? * SUN") * 每周日晚上刷新 年付用户、月付用户的积分
* 替换为
* 每个月月初只刷新年付用户的积分
*/
// @Scheduled(cron = "59 59 23 * * ?") // @Scheduled(cron = "59 59 23 * * ?")
public void refreshCreditsMonthly(){ @Scheduled(cron = "0 0 0 1 * ?")
log.info("每周日晚115959刷新付费用户积分为 6000"); public void refreshCreditsMonthly() {
log.info("每月1号0点 将年费用户积分重置为 6000");
accountService.refreshCreditsWeekly(); accountService.refreshCreditsWeekly();
} }
// todo 多久执行一次?
@Scheduled(cron = "0 */5 * * * *") // Run every 5 minutes @Scheduled(cron = "0 */5 * * * *") // Run every 5 minutes
public void getPaidUser(){ public void getPaidUser() {
// 获取code-create 表中 指定日期之后 订单状态为wc-processing的订单 // 获取code-create 表中 指定日期之后 订单状态为wc-processing的订单
accountService.extendValidityForCC(); accountService.extendValidityForCC();
} }
// 每天凌晨0点执行一次
@Scheduled(cron = "0 0 0 * * ?")
public void cancelActivityBenefits() {
// 1、查询当前所有参与了活动且过期的用户
List<Account> accountList = accountService.getExpiredUserBySystemUser(4);
// 2、将到期用户置为游客
for (Account account : accountList) {
log.info("参与活动的用户{} : {} 于 {} 账号有效期到期,置为游客", account.getId(), account.getUserEmail(), account.getValidEndTime());
accountService.toVisitor(account);
}
}
// 每天检测正式用户到期情况每天凌晨0点执行
@Scheduled(cron = "0 0 0 * * ?")
public void paidUserToVisitor() {
// 1、查询当前已过期正式用户或试用用户
List<Account> accountList = accountService.getExpiredUserBySystemUser(1);
accountList.addAll(accountService.getExpiredUserBySystemUser(2));
accountList.addAll(accountService.getExpiredUserBySystemUser(3));
// 2、将到期用户置为游客
for (Account account : accountList) {
log.info("用户{} : {} 于 {}账号有效期到期,置为游客", account.getId(), account.getUserEmail(), account.getValidEndTime());
accountService.toVisitor(account);
}
}
/**
* 关闭此定时器不再从Code-Create上默认创建AiDA游客
* 将Code-Create上注册的用户添加为AiDA的游客
*/
// @Scheduled(cron = "0 */5 * * * *") // Run every 5 minutes
public void registerUserToVisitor() {
accountService.registerUserToVisitor();
}
@Scheduled(cron = "0 0 0 1 * ?")
// 每月初刷新所有用户用户名剩余修改次数
public void resetUsernameModifyTimes(){
log.info("重置所有用户的用户名修改次数");
redisUtil.batchDeleteKeysWithSamePrefix(RedisUtil.NICKNAME_MODIFY_TIMES);
}
} }

View File

@@ -1,42 +0,0 @@
package com.ai.da.common.task;
import com.ai.da.mapper.primary.entity.OrderInfo;
import com.ai.da.common.enums.PayTypeEnum;
import com.ai.da.service.AliPayService;
import com.ai.da.service.OrderInfoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.List;
@Slf4j
@Component
public class AliPayTask {
@Resource
private OrderInfoService orderInfoService;
@Resource
private AliPayService aliPayService;
/**
* 从第0秒开始每隔30秒执行1次查询创建超过5分钟并且未支付的订单
*/
// @Scheduled(cron = "0/30 * * * * ?")
public void orderConfirm(){
// log.info("Alipay orderConfirm 被执行......");
List<OrderInfo> orderInfoList = orderInfoService.getNoPayOrderByDuration(5, PayTypeEnum.ALIPAY.getType());
for (OrderInfo orderInfo : orderInfoList) {
String orderNo = orderInfo.getOrderNo();
log.warn("超时订单 ===> {}", orderNo);
//核实订单状态:调用支付宝查单接口
aliPayService.checkOrderStatus(orderNo);
}
}
}

View File

@@ -1,21 +0,0 @@
package com.ai.da.common.task;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
@Component
@Slf4j
public class GenerateTask {
// @Scheduled(cron = "0 0 */1 * * ?")
public void generateScheduled(){
log.info("测试定时器generate");
try{
}catch(Exception e){
}
}
}

View File

@@ -0,0 +1,216 @@
//package com.ai.da.common.task;
//
//import com.ai.da.common.utils.CopyUtil;
//import com.ai.da.common.utils.ExcelReader;
//import com.ai.da.common.utils.MinioUtil;
//import com.ai.da.common.utils.SendEmailUtil;
//import com.ai.da.mapper.primary.*;
//import com.ai.da.mapper.primary.entity.*;
//import com.ai.da.mapper.secondary.AttributeRetrievalMapper;
//import com.ai.da.mapper.third.*;
//import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
//import org.apache.commons.lang3.StringUtils;
//import org.apache.poi.ss.usermodel.Row;
//import org.apache.poi.ss.usermodel.Sheet;
//import org.apache.poi.ss.usermodel.Workbook;
//import org.apache.poi.xssf.usermodel.XSSFWorkbook;
//import org.springframework.stereotype.Component;
//import org.springframework.util.CollectionUtils;
//
//import javax.annotation.PostConstruct;
//import javax.annotation.Resource;
//import java.io.FileOutputStream;
//import java.io.IOException;
//import java.nio.file.Files;
//import java.nio.file.Paths;
//import java.time.LocalDate;
//import java.time.format.DateTimeFormatter;
//import java.util.List;
//import java.util.concurrent.ExecutorService;
//import java.util.concurrent.Executors;
//import java.util.concurrent.TimeUnit;
//import java.util.stream.Collectors;
//
//@Component
//public class MoveDataScheduler {
//
// @PostConstruct
// public void test() {
// moveData();
// }
//
// @Resource
// private UserLikeGroupMapper userLikeGroupMapper;
// @Resource
// private UserLikeGroupZSMapper userLikeGroupZSMapper;
// @Resource
// private UserLikeMapper userLikeMapper;
// @Resource
// private UserLikeZSMapper userLikeZSMapper;
// @Resource
// private CollectionElementMapper collectionElementMapper;
// @Resource
// private CollectionElementZSMapper collectionElementZSMapper;
//
// @Resource
// private CollectionMapper collectionMapper;
//
// @Resource
// private CollectionZSMapper collectionZSMapper;
//
// @Resource
// private DesignMapper designMapper;
//
// @Resource
// private DesignZSMapper designZSMapper;
//
// @Resource
// private DesignItemMapper designItemMapper;
//
// @Resource
// private DesignItemZSMapper designItemZSMapper;
//
// @Resource
// private TDesignPythonOutfitMapper designPythonOutfitMapper;
//
// @Resource
// private TDesignPythonOutfitZSMapper designPythonOutfitZSMapper;
//
// @Resource
// private TDesignPythonOutfitDetailMapper designPythonOutfitDetailMapper;
//
// @Resource
// private TDesignPythonOutfitDetailZSMapper designPythonOutfitDetailZSMapper;
//
// @Resource
// private DesignItemDetailMapper designItemDetailMapper;
// @Resource
// private DesignItemZSDetailMapper designItemDetailZSMapper;
//
// @Resource
// private DesignItemDetailPrintMapper designItemDetailPrintMapper;
//
// @Resource
// private DesignItemDetailPrintZSMapper designItemDetailPrintZSMapper;
//
//
// private void moveData() {
// // 查询用户所有history记录
// QueryWrapper<UserLikeGroup> userLikeGroupQueryWrapper = new QueryWrapper<>();
// userLikeGroupQueryWrapper.lambda().eq(UserLikeGroup::getAccountId, 11411);
// List<UserLikeGroup> userLikeGroupList = userLikeGroupMapper.selectList(userLikeGroupQueryWrapper);
//
// for (UserLikeGroup userLikeGroup : userLikeGroupList) {
//
// com.ai.da.mapper.third.entity.UserLikeGroup userLikeGroupZS = CopyUtil.copyObject(userLikeGroup, com.ai.da.mapper.third.entity.UserLikeGroup.class);
// userLikeGroupZS.setAccountId(11420L);
// userLikeGroupZS.setId(null);
// Collection collection = collectionMapper.selectById(userLikeGroup.getCollectionId());
// com.ai.da.mapper.third.entity.Collection collectionZS = CopyUtil.copyObject(collection, com.ai.da.mapper.third.entity.Collection.class);
// collectionZS.setAccountId(11420L);
// collectionZS.setId(null);
//
// if (collection.getMoodTemplateId() != null) {
// CollectionElement element = collectionElementMapper.selectById(collection.getMoodTemplateId());
// com.ai.da.mapper.third.entity.CollectionElement collectionElementZS = CopyUtil.copyObject(element, com.ai.da.mapper.third.entity.CollectionElement.class);
// collectionElementZS.setAccountId(11420L);
// collectionElementZS.setId(null);
// collectionElementZSMapper.insert(collectionElementZS);
// collectionZS.setMoodTemplateId(String.valueOf(collectionElementZS.getId()));
// }
// collectionZSMapper.insert(collectionZS);
// userLikeGroupZS.setCollectionId(collectionZS.getId());
// userLikeGroupZSMapper.insert(userLikeGroupZS);
//
// // 生成元素
// QueryWrapper<CollectionElement> collectionElementQueryWrapper = new QueryWrapper<>();
// collectionElementQueryWrapper.lambda().eq(CollectionElement::getCollectionId, userLikeGroup.getCollectionId());
// List<CollectionElement> collectionElements = collectionElementMapper.selectList(collectionElementQueryWrapper);
//
// for (CollectionElement collectionElement : collectionElements) {
// com.ai.da.mapper.third.entity.CollectionElement collectionElementZS = CopyUtil.copyObject(collectionElement, com.ai.da.mapper.third.entity.CollectionElement.class);
// collectionElementZS.setId(null);
// collectionElementZS.setAccountId(11420L);
// collectionElementZS.setCollectionId(collectionZS.getId());
// collectionElementZSMapper.insert(collectionElementZS);
// }
//
// // 查询记录关联
// QueryWrapper<UserLike> userLikeQueryWrapper = new QueryWrapper<>();
// userLikeQueryWrapper.lambda().eq(UserLike::getUserLikeGroupId, userLikeGroup.getId());
// List<UserLike> userLikes = userLikeMapper.selectList(userLikeQueryWrapper);
// for (UserLike userLike : userLikes) {
// Design design = designMapper.selectById(userLike.getDesignId());
// com.ai.da.mapper.third.entity.Design designZS = CopyUtil.copyObject(design, com.ai.da.mapper.third.entity.Design.class);
// designZS.setId(null);
// designZS.setAccountId(11420L);
// designZS.setCollectionId(collectionZS.getId());
// designZSMapper.insert(designZS);
//
// com.ai.da.mapper.third.entity.UserLike userLikeZS = CopyUtil.copyObject(userLike, com.ai.da.mapper.third.entity.UserLike.class);
//// Design design = designMapper.selectById(userLike.getDesignId());
// userLikeZS.setId(null);
// DesignItem designItem = designItemMapper.selectById(userLike.getDesignItemId());
// com.ai.da.mapper.third.entity.DesignItem designItemZS = CopyUtil.copyObject(designItem, com.ai.da.mapper.third.entity.DesignItem.class);
// designItemZS.setId(null);
// designItemZS.setAccountId(11420L);
// designItemZS.setDesignId(designZS.getId());
// designItemZSMapper.insert(designItemZS);
//
// QueryWrapper<DesignItemDetail> designItemDetailQueryWrapper = new QueryWrapper<>();
// designItemDetailQueryWrapper.lambda().eq(DesignItemDetail::getDesignItemId, designItem.getId());
// List<DesignItemDetail> designItemDetails = designItemDetailMapper.selectList(designItemDetailQueryWrapper);
// for (DesignItemDetail designItemDetail : designItemDetails) {
// com.ai.da.mapper.third.entity.DesignItemDetail designItemDetailZS = CopyUtil.copyObject(designItemDetail, com.ai.da.mapper.third.entity.DesignItemDetail.class);
// designItemDetailZS.setId(null);
// designItemDetailZS.setDesignItemId(designItemZS.getId());
// designItemDetailZS.setAccountId(11420L);
// designItemDetailZS.setDesignId(designZS.getId());
// designItemDetailZSMapper.insert(designItemDetailZS);
//
// QueryWrapper<DesignItemDetailPrint> designItemDetailPrintQueryWrapper = new QueryWrapper<>();
// designItemDetailPrintQueryWrapper.lambda().eq(DesignItemDetailPrint::getDesignItemDetailId, designItemDetail.getId());
// List<DesignItemDetailPrint> designItemDetailPrintList = designItemDetailPrintMapper.selectList(designItemDetailPrintQueryWrapper);
// if (!CollectionUtils.isEmpty(designItemDetailPrintList)) {
// for (DesignItemDetailPrint designItemDetailPrint : designItemDetailPrintList) {
// com.ai.da.mapper.third.entity.DesignItemDetailPrint designItemDetailPrintZS = CopyUtil.copyObject(designItemDetailPrint, com.ai.da.mapper.third.entity.DesignItemDetailPrint.class);
// designItemDetailPrintZS.setId(null);
// designItemDetailPrintZS.setDesignItemDetailId(designItemDetailZS.getId());
// designItemDetailPrintZSMapper.insert(designItemDetailPrintZS);
// }
// }
// }
//
// userLikeZS.setDesignItemId(designItemZS.getId());
// TDesignPythonOutfit tDesignPythonOutfit = designPythonOutfitMapper.selectById(userLike.getDesignOutfitId());
// com.ai.da.mapper.third.entity.TDesignPythonOutfit tDesignPythonOutfitZS = CopyUtil.copyObject(tDesignPythonOutfit, com.ai.da.mapper.third.entity.TDesignPythonOutfit.class);
// tDesignPythonOutfitZS.setId(null);
// tDesignPythonOutfitZS.setDesignItemId(designItemZS.getId());
// tDesignPythonOutfitZS.setCollectionId(collectionZS.getId());
// tDesignPythonOutfitZS.setUserId(11420L);
// tDesignPythonOutfitZS.setDesignId(designZS.getId());
// designPythonOutfitZSMapper.insert(tDesignPythonOutfitZS);
//
// userLikeZS.setUserLikeGroupId(userLikeGroupZS.getId());
// userLikeZS.setDesignId(designZS.getId());
// userLikeZS.setDesignOutfitId(tDesignPythonOutfitZS.getId());
// userLikeZSMapper.insert(userLikeZS);
//
// QueryWrapper<TDesignPythonOutfitDetail> designPythonOutfitDetailQueryWrapper = new QueryWrapper<>();
// designPythonOutfitDetailQueryWrapper.lambda().eq(TDesignPythonOutfitDetail::getDesignPythonOutfitId, tDesignPythonOutfit.getId());
// List<TDesignPythonOutfitDetail> tDesignPythonOutfitDetails = designPythonOutfitDetailMapper.selectList(designPythonOutfitDetailQueryWrapper);
// for (TDesignPythonOutfitDetail tDesignPythonOutfitDetail : tDesignPythonOutfitDetails) {
// com.ai.da.mapper.third.entity.TDesignPythonOutfitDetail tDesignPythonOutfitDetailZS = CopyUtil.copyObject(tDesignPythonOutfitDetail, com.ai.da.mapper.third.entity.TDesignPythonOutfitDetail.class);
// tDesignPythonOutfitDetailZS.setDesignPythonOutfitId(tDesignPythonOutfitZS.getId());
// tDesignPythonOutfitDetailZS.setId(null);
// tDesignPythonOutfitDetailZS.setDesignId(designZS.getId());
// designPythonOutfitDetailZSMapper.insert(tDesignPythonOutfitDetailZS);
// }
// }
// }
//
//
// }
//
//
//}

View File

@@ -0,0 +1,123 @@
package com.ai.da.common.task;
import com.ai.da.common.enums.PayTypeEnum;
import com.ai.da.mapper.primary.entity.OrderInfo;
import com.ai.da.service.*;
import com.paypal.http.exceptions.SerializeException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.time.LocalDate;
import java.util.List;
@Slf4j
@Component
public class PaymentTask {
@Resource
private OrderInfoService orderInfoService;
@Resource
private StripeService stripeService;
@Resource
private AffiliateService affiliateService;
// 考虑删除该定时任务(原因:之后的订单列允许用户查看发票,发票未过期时仍可以支付,所以不需要手动使订单过期)
// @Scheduled(cron = "0/30 * * * * ?")
public void orderConfirmForStripe() throws SerializeException {
// 查看超过30分钟以上仍未支付的订单 置为超时订单
List<OrderInfo> orderInfoList = orderInfoService.getNoPayOrderByDuration(30, PayTypeEnum.STRIPE.getType());
for (OrderInfo orderInfo : orderInfoList) {
String orderNo = orderInfo.getOrderNo();
log.warn("超时订单 ===> {}", orderNo);
//核实订单状态:调用支付宝查单接口
stripeService.checkOrderStatus(orderNo);
}
}
@Resource
private PayPalCheckoutService payPalCheckoutService;
@Scheduled(cron = "0/30 * * * * ?")
public void orderConfirmForPaypal() throws SerializeException {
// log.info("PayPal orderConfirm 被执行......");
List<OrderInfo> orderInfoList = orderInfoService.getNoPayOrderByDuration(30, PayTypeEnum.PAYPAL.getType());
for (OrderInfo orderInfo : orderInfoList) {
String orderNo = orderInfo.getOrderNo();
log.warn("超时订单 ===> {}", orderNo);
//核实订单状态:调用支付宝查单接口
payPalCheckoutService.checkOrderStatus(orderNo);
}
}
@Resource
private AliPayService aliPayService;
/**
* 从第0秒开始每隔30秒执行1次查询创建超过5分钟并且未支付的订单
*/
// @Scheduled(cron = "0/30 * * * * ?")
public void orderConfirmForAlipay(){
/*
log.info("Alipay orderConfirm 被执行......");
List<OrderInfo> orderInfoList = orderInfoService.getNoPayOrderByDuration(5, PayTypeEnum.ALIPAY.getType());
for (OrderInfo orderInfo : orderInfoList) {
String orderNo = orderInfo.getOrderNo();
log.warn("超时订单 ===> {}", orderNo);
//核实订单状态:调用支付宝查单接口
aliPayService.checkOrderStatus(orderNo);
}*/
}
// !!关闭此定时器,改为提前三天站内信提醒!!
// 提前7天向用户发送提醒邮件,每天早上8点执行
// @Scheduled(cron = "0 0 8 * * ?")
public void subscriptionReminder(){
stripeService.subscriptionReminder();
}
// 如果有订阅已创建,但是没有发邮件通知的,需要主动获取回调信息并向用户发送邮件
public void checkSubscriptionPayment(){
//
}
@Scheduled(cron = "0 */5 * * * *") // Run every 5 minutes
public void updateAffiliateInfoWithPayment(){
// log.info("佣金计算定时器");
affiliateService.updateAffiliateInfoWithPayment();
}
@Scheduled(cron = "0 0 8 28-31 * ?")
public void commissionSummaryReminder(){
// 每个月末的最后一天的早上八点执行
LocalDate today = LocalDate.now();
// 判断是否为月底
if (today.plusDays(1).getDayOfMonth() == 1) {
log.info("今天是月底,执行佣金结算提醒任务!");
affiliateService.commissionCalculation(null, null);
}
}
@Scheduled(cron = "0 */5 * * * *") // Run every 5 minutes
public void calcCouponsCommission(){
// log.info("优惠券佣金计算定时器");
affiliateService.calcCouponsCommission();
}
}

View File

@@ -1,42 +0,0 @@
package com.ai.da.common.task;
import com.ai.da.common.enums.PayTypeEnum;
import com.ai.da.mapper.primary.entity.OrderInfo;
import com.ai.da.service.OrderInfoService;
import com.ai.da.service.PayPalCheckoutService;
import com.paypal.http.exceptions.SerializeException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
@Slf4j
@Component
public class PaypalTask {
@Resource
private OrderInfoService orderInfoService;
@Resource
private PayPalCheckoutService payPalCheckoutService;
@Scheduled(cron = "0/30 * * * * ?")
public void orderConfirm() throws SerializeException {
// log.info("PayPal orderConfirm 被执行......");
List<OrderInfo> orderInfoList = orderInfoService.getNoPayOrderByDuration(30, PayTypeEnum.PAYPAL.getType());
for (OrderInfo orderInfo : orderInfoList) {
String orderNo = orderInfo.getOrderNo();
log.warn("超时订单 ===> {}", orderNo);
//核实订单状态:调用支付宝查单接口
payPalCheckoutService.checkOrderStatus(orderNo);
}
}
}

View File

@@ -1,40 +0,0 @@
package com.ai.da.common.task;
import com.ai.da.common.enums.PayTypeEnum;
import com.ai.da.mapper.primary.entity.OrderInfo;
import com.ai.da.service.OrderInfoService;
import com.ai.da.service.StripeService;
import com.paypal.http.exceptions.SerializeException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.List;
@Slf4j
@Component
public class StripeTask {
@Resource
private OrderInfoService orderInfoService;
@Resource
private StripeService stripeService;
@Scheduled(cron = "0/30 * * * * ?")
public void orderConfirm() throws SerializeException {
// 查看超过30分钟以上仍未支付的订单 置为超时订单
List<OrderInfo> orderInfoList = orderInfoService.getNoPayOrderByDuration(30, PayTypeEnum.STRIPE.getType());
for (OrderInfo orderInfo : orderInfoList) {
String orderNo = orderInfo.getOrderNo();
log.warn("超时订单 ===> {}", orderNo);
//核实订单状态:调用支付宝查单接口
stripeService.checkOrderStatus(orderNo);
}
}
}

View File

@@ -0,0 +1,88 @@
package com.ai.da.common.utils;
import java.util.HashMap;
import java.util.Map;
public class ComprehensivePunctuationConverter {
private static final Map<Character, Character> FULL_TO_HALF_MAP = new HashMap<>();
static {
// 中文标点到英文标点的映射(扩展版)
FULL_TO_HALF_MAP.put('', ',');
FULL_TO_HALF_MAP.put('。', '.');
FULL_TO_HALF_MAP.put('', ';');
FULL_TO_HALF_MAP.put('', ':');
FULL_TO_HALF_MAP.put('', '?');
FULL_TO_HALF_MAP.put('', '!');
FULL_TO_HALF_MAP.put('', '(');
FULL_TO_HALF_MAP.put('', ')');
FULL_TO_HALF_MAP.put('【', '[');
FULL_TO_HALF_MAP.put('】', ']');
FULL_TO_HALF_MAP.put('「', '\'');
FULL_TO_HALF_MAP.put('」', '\'');
FULL_TO_HALF_MAP.put('『', '"');
FULL_TO_HALF_MAP.put('』', '"');
FULL_TO_HALF_MAP.put('、', '\\');
FULL_TO_HALF_MAP.put('', '~');
FULL_TO_HALF_MAP.put('—', '-');
FULL_TO_HALF_MAP.put('', '.');
FULL_TO_HALF_MAP.put('〈', '<');
FULL_TO_HALF_MAP.put('〉', '>');
FULL_TO_HALF_MAP.put('《', '«');
FULL_TO_HALF_MAP.put('》', '»');
FULL_TO_HALF_MAP.put('〝', '"');
FULL_TO_HALF_MAP.put('〞', '"');
FULL_TO_HALF_MAP.put('﹁', '"');
FULL_TO_HALF_MAP.put('﹂', '"');
FULL_TO_HALF_MAP.put('…', '.');
FULL_TO_HALF_MAP.put('', '_');
// 全角字母和数字
for (char c = ''; c <= ''; c++) {
FULL_TO_HALF_MAP.put(c, (char)(c - '' + 'A'));
}
for (char c = ''; c <= ''; c++) {
FULL_TO_HALF_MAP.put(c, (char)(c - '' + 'a'));
}
for (char c = ''; c <= ''; c++) {
FULL_TO_HALF_MAP.put(c, (char)(c - '' + '0'));
}
}
/**
* 将字符串中的全角字符(包括标点、字母、数字)转换为半角字符
*/
public static String convertToHalfWidth(String input) {
if (input == null || input.isEmpty()) {
return input;
}
StringBuilder result = new StringBuilder();
for (int i = 0; i < input.length(); i++) {
char c = input.charAt(i);
// 检查映射表
if (FULL_TO_HALF_MAP.containsKey(c)) {
result.append(FULL_TO_HALF_MAP.get(c));
}
// 处理全角空格Unicode 12288
else if (c == ' ') {
result.append(' ');
}
// 其他字符保持不变
else {
result.append(c);
}
}
return result.toString();
}
public static void main(String[] args) {
// String text = "这是一个全角示例,包含:中文标点、全角字母(ABC)、全角数字(123) 还有全角空格!";
String text = "birdsyellow";
String converted = convertToHalfWidth(text);
System.out.println("原始文本: " + text);
System.out.println("转换后: " + converted);
}
}

View File

@@ -1,5 +1,6 @@
package com.ai.da.common.utils; package com.ai.da.common.utils;
import com.ai.da.common.constant.CommonConstant;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import java.text.ParseException; import java.text.ParseException;
@@ -9,8 +10,8 @@ import java.time.LocalDate;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.ZoneId; import java.time.ZoneId;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.util.Calendar;
import java.util.Date; import java.util.Date;
import java.util.Locale;
import java.util.TimeZone; import java.util.TimeZone;
@Slf4j @Slf4j
@@ -18,6 +19,8 @@ public class DateUtil {
public static final String YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss"; public static final String YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss";
public static final String YYYYMM = "yyyyMM"; public static final String YYYYMM = "yyyyMM";
public static final String YYYY_MM_DD = "yyyyMMdd"; public static final String YYYY_MM_DD = "yyyyMMdd";
public static final String YYYY_MM_DD_HH = "yyyyMMddHH";
public static final String YYYY_MM_DD_hh_mm_ss = "yyyyMMddHHMMss";
/** /**
* LocalDate -> Date * LocalDate -> Date
@@ -81,4 +84,21 @@ public class DateUtil {
return String.valueOf(epochSecond).substring(0, 10); return String.valueOf(epochSecond).substring(0, 10);
} }
public static String changeTimeStampFormat(Long timeStamp, String type, String format){
// 将秒级时间戳转换为毫秒级
if (type.equals("seconds")){
timeStamp = timeStamp * 1000;
}
// 输出格式
SimpleDateFormat outputFormat = new SimpleDateFormat(format, Locale.ENGLISH);
// 创建Date对象
Date date = new Date(timeStamp);
// 格式化输出
return outputFormat.format(date);
}
public static String changeTimeStampFormat(LocalDateTime localDate){
return localDate.format(DateTimeFormatter.ofPattern(CommonConstant.TIME_FORMAT_MMM_dd_yyyy_EEEE, Locale.US));
}
} }

View File

@@ -1,6 +1,7 @@
package com.ai.da.common.utils; package com.ai.da.common.utils;
import lombok.Data; import lombok.Data;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row; import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.Workbook;
@@ -23,11 +24,30 @@ public class ExcelReader {
for (int i = 0; i < numberOfColumns; i++) { for (int i = 0; i < numberOfColumns; i++) {
List<String> columnData = new ArrayList<>(); List<String> columnData = new ArrayList<>();
for (Row row : sheet) { for (Row row : sheet) {
columnData.add(row.getCell(i).getStringCellValue()); Cell cell = row.getCell(i);
if (cell != null) {
switch (cell.getCellType()) {
case STRING:
columnData.add(cell.getStringCellValue());
break;
case NUMERIC:
columnData.add(String.valueOf(cell.getNumericCellValue()));
break;
case BOOLEAN:
columnData.add(String.valueOf(cell.getBooleanCellValue()));
break;
default:
// 跳过空单元格或其他类型(比如错误类型)
break;
} }
}
}
// 只有当这一列有数据时,才添加到结果列表中
if (!columnData.isEmpty()) {
data.add(columnData); data.add(columnData);
} }
} }
}
return data; return data;
} }
} }

View File

@@ -28,7 +28,7 @@ public final class LocalCacheUtils {
private static LoadingCache<String, String> loadTokenCache() { private static LoadingCache<String, String> loadTokenCache() {
LoadingCache<String, String> tokenCache = CacheBuilder.newBuilder() LoadingCache<String, String> tokenCache = CacheBuilder.newBuilder()
.concurrencyLevel(10) .concurrencyLevel(10)
.expireAfterWrite(24 * 100, TimeUnit.HOURS) .expireAfterWrite(24 * (7 - 1), TimeUnit.HOURS)
.initialCapacity(100) .initialCapacity(100)
.maximumSize(10000) .maximumSize(10000)
.recordStats() .recordStats()

View File

@@ -14,13 +14,12 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.*; import java.io.*;
import java.security.InvalidKeyException; import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException; import java.security.NoSuchAlgorithmException;
import java.util.ArrayList; import java.util.*;
import java.util.Base64;
import java.util.List;
import java.util.UUID;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@@ -441,6 +440,16 @@ public class MinioUtil {
return getPreSignedUrl(bucketName, String.valueOf(fileName), expiry); return getPreSignedUrl(bucketName, String.valueOf(fileName), expiry);
} }
public boolean doesObjectExist(String path) {
if (!path.contains("/")) {
throw new BusinessException("the.path.is.error");
}
int index = path.indexOf("/");
String bucketName = path.substring(0, index);
String objectName = path.substring(index + 1);
return doesObjectExist(bucketName, objectName);
}
public boolean doesObjectExist(String bucketName, String objectName) { public boolean doesObjectExist(String bucketName, String objectName) {
try { try {
minioClient.statObject( minioClient.statObject(
@@ -484,6 +493,83 @@ public class MinioUtil {
return null; // or throw an exception return null; // or throw an exception
} }
} }
/**
* 从 MinIO 下载对象到本地路径
*
* @param bucketName 存储桶名称
* @param objectName MinIO 上对象的名称
* @param localFilePath 本地文件路径
*/
public void downloadMinioObjectToLocal(String bucketName, String objectName, String localFilePath) {
File localFile = new File(localFilePath);
File parentDir = localFile.getParentFile();
if (parentDir != null) {
parentDir.mkdirs(); // 创建文件夹,确保路径结构与 MinIO 一致
}
try (InputStream stream = minioClient.getObject(
GetObjectArgs.builder().bucket(bucketName).object(objectName).build());
FileOutputStream out = new FileOutputStream(localFile)) {
byte[] buffer = new byte[1024];
int bytesRead;
while ((bytesRead = stream.read(buffer)) != -1) {
out.write(buffer, 0, bytesRead);
}
log.info("Downloaded object {} to {}", objectName, localFilePath);
} catch (Exception e) {
log.error("Error while downloading object {}: {}", objectName, e.getMessage());
}
}
/**
* 从路径中提取存储桶名称
*
* @param path MinIO 路径
* @return 存储桶名称
*/
public String getBucketNameFromPath(String path) {
int index = path.indexOf("/");
return path.substring(0, index); // 获取第一级路径作为 bucket 名称
}
/**
* 从路径中提取对象名称
*
* @param path MinIO 路径
* @return 对象名称
*/
public String getObjectNameFromPath(String path) {
int index = path.indexOf("/");
return path.substring(index + 1); // 获取路径的其余部分作为对象名称
}
public List<Integer> getImagesWidthAndHeight(String path){
int index = path.indexOf("/");
String bucketName = path.substring(0, index);
String objectName = path.substring(index + 1);
try {
// 从 MinIO 下载图片
GetObjectResponse response = minioClient.getObject(
GetObjectArgs.builder()
.bucket(bucketName)
.object(objectName)
.build()
);
BufferedImage image = ImageIO.read(response);
int width = image.getWidth();
int height = image.getHeight();
log.info("Image path {}, Width: {}, Height: {}", path, width, height);
response.close();
return Arrays.asList(width, height);
} catch (MinioException | IOException | NoSuchAlgorithmException | InvalidKeyException e) {
log.error("图片:{}, 获取宽高异常", path);
throw new BusinessException(e.getMessage());
}
}
} }

View File

@@ -28,4 +28,70 @@ public class PantoneUtils {
return new int[]{Math.round(hsv[0]), Math.round(hsv[1] * 100), Math.round(hsv[2] * 100)}; return new int[]{Math.round(hsv[0]), Math.round(hsv[1] * 100), Math.round(hsv[2] * 100)};
} }
public static int[] hsvToRgb(int h, int s, int v) {
// 确保 h 在 [0, 360) 范围内
h = h % 360;
if (h < 0) {
h += 360;
}
// 确保 s 和 v 在 [0, 100] 范围内
s = Math.max(0, Math.min(100, s));
v = Math.max(0, Math.min(100, v));
// 将 s 和 v 映射到 [0, 1] 范围
float sNorm = s / 100.0f;
float vNorm = v / 100.0f;
// 计算色相所在的区间
int hi = (h / 60) % 6;
float f = (h / 60.0f) - hi;
float p = vNorm * (1 - sNorm);
float q = vNorm * (1 - f * sNorm);
float t = vNorm * (1 - (1 - f) * sNorm);
float r, g, b;
switch (hi) {
case 0:
r = vNorm;
g = t;
b = p;
break;
case 1:
r = q;
g = vNorm;
b = p;
break;
case 2:
r = p;
g = vNorm;
b = t;
break;
case 3:
r = p;
g = q;
b = vNorm;
break;
case 4:
r = t;
g = p;
b = vNorm;
break;
case 5:
r = vNorm;
g = p;
b = q;
break;
default:
throw new RuntimeException("Invalid HSV values");
}
// 将 RGB 值从 [0, 1] 转换为 [0, 255]
int red = Math.round(r * 255);
int green = Math.round(g * 255);
int blue = Math.round(b * 255);
return new int[]{red, green, blue};
}
} }

View File

@@ -1,16 +1,14 @@
package com.ai.da.common.utils; package com.ai.da.common.utils;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.data.redis.core.HashOperations;
import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.ZSetOperations; import org.springframework.data.redis.core.ZSetOperations;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.ArrayList; import java.util.*;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@@ -86,8 +84,10 @@ public class RedisUtil {
/** /**
* 将数据放入set缓存 * 将数据放入set缓存
*/ */
public void addToSet(String key, String value) { public void addToSet(String key, String value, Long expiresIn) {
redisTemplate.opsForSet().add(key, value); redisTemplate.opsForSet().add(key, value);
// 设置过期时间
redisTemplate.expire(key, expiresIn, TimeUnit.SECONDS);
} }
/** /**
@@ -154,6 +154,8 @@ public class RedisUtil {
return redisTemplate.keys(key); return redisTemplate.keys(key);
} }
public Long getSize(String key){return redisTemplate.opsForSet().size(key);}
public List<String> getMultiValue(Set<String> keys){ public List<String> getMultiValue(Set<String> keys){
return redisTemplate.opsForValue().multiGet(keys); return redisTemplate.opsForValue().multiGet(keys);
} }
@@ -216,4 +218,91 @@ public class RedisUtil {
return redisTemplate.opsForValue().increment(key, 0); return redisTemplate.opsForValue().increment(key, 0);
} }
public Long getViewCount(String key) {
Object value = redisTemplate.opsForValue().get(key);
if (value instanceof Integer) {
return Long.valueOf((Integer) value);
} else if (value instanceof Long) {
return (Long) value;
} else if (value instanceof String) {
return Long.valueOf((String) value);
} else {
throw new IllegalArgumentException("Unexpected value type");
}
}
public final static String PERSONAL_HOMEPAGE_VIEW_KEY = "PersonalHomepage:view:";
public void increasePersonalHomepageViewCount(Long accountId) {
String key = PERSONAL_HOMEPAGE_VIEW_KEY + accountId;
redisTemplate.opsForValue().increment(key);
}
public Long getPersonalHomepageViewCount(Long accountId) {
String key = PERSONAL_HOMEPAGE_VIEW_KEY + accountId;
return redisTemplate.opsForValue().increment(key, 0);
}
public final static String MOODBOARD_POSITION_KEY = "moodboard:position:";
public void saveMoodboardPosition(Long id, String moodboardPosition) {
addToString(MOODBOARD_POSITION_KEY + id, moodboardPosition);
}
public String getMoodboardPosition(Long id) {
return getFromString(MOODBOARD_POSITION_KEY + id);
}
public final static String NICKNAME_MODIFY_TIMES = "NicknameModifyTimes:";
public void increaseCount(String key) {
redisTemplate.opsForValue().increment(key);
}
public Long getIncrementCount(String key) {
return redisTemplate.opsForValue().increment(key, 0);
}
public void setKeyExpire(String key, Long expire) {
redisTemplate.expire(key, expire, TimeUnit.DAYS);
}
public final static String CHANGE_MAILBOX = "ChangeMailbox:";
// 每天允许通知3次
public final static String UPLOAD_TIMEOUT_REMINDER_COUNTER = "UploadTimeoutReminderCounter";
public void addProcessId(String processId, int progress) {
// Redis 中的键,可以通过 processId 来唯一标识
String redisKey = "process:progress:" + processId;
// 将当前进度存储到 Redis
redisTemplate.opsForValue().set(redisKey, String.valueOf(progress));
// 设置过期时间为 5 分钟300 秒)
redisTemplate.expire(redisKey, 5, TimeUnit.MINUTES);
}
public final static String PAYMENT_INFO_LAST_SCAN_TIME = "PaymentInfoLastScanTime";
public final static String AFFILIATE_LINK_VIEW_KEY = "AffiliateLink:view:";
public void increaseAffiliateLinkViewCount(Long accountId) {
String key = AFFILIATE_LINK_VIEW_KEY + accountId;
redisTemplate.opsForValue().increment(key);
}
public Long getAffiliateLinkViewCount(Long accountId) {
String key = AFFILIATE_LINK_VIEW_KEY + accountId;
return redisTemplate.opsForValue().increment(key, 0);
}
public void batchDeleteKeysWithSamePrefix(String prefix){
Set<String> keys = redisTemplate.keys(prefix + "*");
assert keys != null;
if (!keys.isEmpty()){
redisTemplate.delete(keys);
}
}
public final static String STRIPE_EXCEPTION_LOG = "StripeException:";
public final static String SUBSCRIPTION_SENT_EMAIL_TYPE = "SubscriptionEmailSentType:";
} }

View File

@@ -1,7 +1,16 @@
package com.ai.da.common.utils; package com.ai.da.common.utils;
import javax.servlet.http.HttpServletRequest; import com.alibaba.fastjson.JSONObject;
import lombok.extern.slf4j.Slf4j;
import javax.servlet.http.HttpServletRequest;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.Map;
@Slf4j
public class RequestInfoUtil { public class RequestInfoUtil {
/** /**
@@ -45,4 +54,58 @@ public class RequestInfoUtil {
return ip; return ip;
} }
/**
* 免费 API 服务可能有请求频率限制,如果你需要处理大量 IP 地址,可能需要考虑使用付费服务或购买 IP 地理位置数据库。此外,始终要遵守 API 提供商的使用条款和隐私政策
* @param ip https://ip-api.com/docs/api:json 使用的接口api
* @return
* {
* "query": "24.48.0.1",
* "status": "success",
* "country": "Canada",
* "countryCode": "CA",
* "region": "QC",
* "regionName": "Quebec",
* "city": "Montreal",
* "zip": "H1L",
* "lat": 45.6026,
* "lon": -73.5167,
* "timezone": "America/Toronto",
* "isp": "Le Groupe Videotron Ltee",
* "org": "Videotron Ltee",
* "as": "AS5769 Videotron Ltee"
* }
*/
public static Map getIPLocation(String ip) {
// String ip = "117.143.125.1"; // 替换为你想查询的 IP 地址
// String ip = "194.5.48.180"; // 替换为你想查询的 IP 地址
String apiURL = "http://ip-api.com/json/" + ip;
try {
URL url = new URL(apiURL);
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("GET");
conn.setRequestProperty("Accept", "application/json");
if (conn.getResponseCode() != 200) {
throw new RuntimeException("Failed : HTTP error code : " + conn.getResponseCode());
}
BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream()));
String output;
StringBuilder outputBuilder = new StringBuilder();
// System.out.println("Output from Server .... \n");
while ((output = br.readLine()) != null) {
outputBuilder.append(output);
System.out.println(output);
}
conn.disconnect();
Map map = JSONObject.parseObject(outputBuilder.toString(), Map.class);
log.info("map: {}", map);
return map;
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
} }

View File

@@ -255,6 +255,22 @@ public class S3Util {
} }
} }
public String getPreSignedUrl(String path, int expiry, boolean resetCache) {
if (resetCache || LocalCacheUtils.getPresignedUrlCache(path) == null) {
if (!path.contains("/")) {
throw new BusinessException("The path is error!");
}
int index = path.indexOf("/");
String bucketName = path.substring(0, index);
String fileName = path.substring(index + 1);
String presignedUrl = getPreSignatureUrl(bucketName, fileName, expiry);
LocalCacheUtils.setPresignedUrlCache(path, presignedUrl);
return presignedUrl;
} else {
return LocalCacheUtils.getPresignedUrlCache(path);
}
}
/** /**
* @param keyName key名称: test/2022/06/123.pdf * @param keyName key名称: test/2022/06/123.pdf
* @param signatureDurationTime 有效期 单位:秒 * @param signatureDurationTime 有效期 单位:秒

View File

@@ -2,8 +2,11 @@ package com.ai.da.common.utils;
import com.ai.da.mapper.primary.entity.Account; import com.ai.da.mapper.primary.entity.Account;
import com.ai.da.mapper.primary.entity.TrialOrder; import com.ai.da.mapper.primary.entity.TrialOrder;
import com.ai.da.model.dto.AffiliateEmailParamsDTO;
import com.ai.da.model.dto.SubscriptionEmailParamsDTO;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.ai.da.common.config.exception.BusinessException; import com.ai.da.common.config.exception.BusinessException;
import com.alibaba.fastjson2.JSON;
import com.tencentcloudapi.common.Credential; import com.tencentcloudapi.common.Credential;
import com.tencentcloudapi.common.exception.TencentCloudSDKException; import com.tencentcloudapi.common.exception.TencentCloudSDKException;
import com.tencentcloudapi.common.profile.ClientProfile; import com.tencentcloudapi.common.profile.ClientProfile;
@@ -53,6 +56,7 @@ public class SendEmailUtil {
* 绑定邮箱 * 绑定邮箱
*/ */
public static String BIND_MAILBOX_SUBJECT = "绑定邮箱"; public static String BIND_MAILBOX_SUBJECT = "绑定邮箱";
public static String CHANGE_MAILBOX_SUBJECT = "Change Mailbox";
/** /**
* 登入模板id * 登入模板id
*/ */
@@ -69,7 +73,10 @@ public class SendEmailUtil {
/** /**
* 绑定邮箱模板id * 绑定邮箱模板id
*/ */
public static Long BIND_MAILBOX_TEMPLATE_ID = 45619L; // public static Long BIND_MAILBOX_TEMPLATE_ID = 45619L;
public static Long BIND_MAILBOX_TEMPLATE_ID = 132754L;
public static Long CHANGE_MAILBOX_TEMPLATE_ID = 128210L;
public static Boolean send(String receiverAddress, String ip, Long templateId, String verifyCode) { public static Boolean send(String receiverAddress, String ip, Long templateId, String verifyCode) {
@@ -92,7 +99,8 @@ public class SendEmailUtil {
req.setDestination(new String[]{receiverAddress}); req.setDestination(new String[]{receiverAddress});
String subject = templateId == LOGIN_TEMPLATE_ID ? LOGIN_SUBJECT : String subject = templateId == LOGIN_TEMPLATE_ID ? LOGIN_SUBJECT :
templateId == UPDATE_PWD_TEMPLATE_ID ? FORGET_PWD_SUBJECT : templateId == UPDATE_PWD_TEMPLATE_ID ? FORGET_PWD_SUBJECT :
templateId == EXCEPTION_ID_TEMPLATE_ID ? EXCEPTION_ID_SUBJECT : BIND_MAILBOX_SUBJECT; templateId == EXCEPTION_ID_TEMPLATE_ID ? EXCEPTION_ID_SUBJECT :
templateId == CHANGE_MAILBOX_TEMPLATE_ID ? CHANGE_MAILBOX_SUBJECT : BIND_MAILBOX_SUBJECT;
req.setSubject(subject); req.setSubject(subject);
req.setTemplate(contractTemplate(templateId, verifyCode, ip)); req.setTemplate(contractTemplate(templateId, verifyCode, ip));
@@ -171,7 +179,7 @@ public class SendEmailUtil {
subject = "Approval Confirmation for AiDA System Trial Access"; subject = "Approval Confirmation for AiDA System Trial Access";
if (country.equals("China")) { if (country.equals("China")) {
template.setTemplateID(NOTIFICATION_CHINESE_TEMPLATE_ID); template.setTemplateID(NOTIFICATION_CHINESE_TEMPLATE_ID);
}else { } else {
template.setTemplateID(NOTIFICATION_TEMPLATE_ID); template.setTemplateID(NOTIFICATION_TEMPLATE_ID);
} }
template.setTemplateData(buildNotificationData(trialOrder, link)); template.setTemplateData(buildNotificationData(trialOrder, link));
@@ -221,7 +229,7 @@ public class SendEmailUtil {
attachment.setFileName(fileName); // 设置附件文件名 attachment.setFileName(fileName); // 设置附件文件名
// 设置附件内容 // 设置附件内容
attachment.setContent(Base64.getEncoder().encodeToString(fileContent)); attachment.setContent(Base64.getEncoder().encodeToString(fileContent));
req.setAttachments(new Attachment[] {attachment}); req.setAttachments(new Attachment[]{attachment});
// 发送邮件 // 发送邮件
SendEmailResponse resp = client.SendEmail(req); SendEmailResponse resp = client.SendEmail(req);
log.info("短信发送结果res###{}", SendEmailResponse.toJsonString(resp)); log.info("短信发送结果res###{}", SendEmailResponse.toJsonString(resp));
@@ -264,7 +272,9 @@ public class SendEmailUtil {
throw new BusinessException("failed.to.send.mail"); throw new BusinessException("failed.to.send.mail");
} }
} }
private final static Long WILLBEEXPIRED_TEMPLATE_ID = 118178L; private final static Long WILLBEEXPIRED_TEMPLATE_ID = 118178L;
public static void sendWillBeExpiredEmail(Account account, String senderAddress) { public static void sendWillBeExpiredEmail(Account account, String senderAddress) {
try { try {
// 实例化一个认证对象 // 实例化一个认证对象
@@ -356,7 +366,7 @@ public class SendEmailUtil {
jsonObject.put("email", trialOrder.getEmail()); jsonObject.put("email", trialOrder.getEmail());
if (link) { if (link) {
jsonObject.put("days", 14); jsonObject.put("days", 14);
}else { } else {
jsonObject.put("days", 5); jsonObject.put("days", 5);
} }
return jsonObject.toJSONString(); return jsonObject.toJSONString();
@@ -366,6 +376,7 @@ public class SendEmailUtil {
private final static Long UPGRADE_SUCCESS_NOTIFICATION_ID = 118856L; private final static Long UPGRADE_SUCCESS_NOTIFICATION_ID = 118856L;
private final static Long UPGRADE_NOTIFICATION_ID_CHINESE = 122898L; private final static Long UPGRADE_NOTIFICATION_ID_CHINESE = 122898L;
private final static Long UPGRADE_SUCCESS_NOTIFICATION_ID_CHINESE = 122899L; private final static Long UPGRADE_SUCCESS_NOTIFICATION_ID_CHINESE = 122899L;
public static void sendUpgradeNotification(Account account, String senderAddress, Integer type) { public static void sendUpgradeNotification(Account account, String senderAddress, Integer type) {
try { try {
// 实例化一个认证对象 // 实例化一个认证对象
@@ -406,15 +417,18 @@ public class SendEmailUtil {
// 发送邮件 // 发送邮件
SendEmailResponse resp = client.SendEmail(req); SendEmailResponse resp = client.SendEmail(req);
log.info(senderAddress);
log.info("短信发送结果res###{}", SendEmailResponse.toJsonString(resp)); log.info("短信发送结果res###{}", SendEmailResponse.toJsonString(resp));
} catch (TencentCloudSDKException e) { } catch (TencentCloudSDKException e) {
log.info(senderAddress);
log.info("邮件发送失败###{}", e.toString()); log.info("邮件发送失败###{}", e.toString());
throw new BusinessException("failed.to.send.mail"); throw new BusinessException("failed.to.send.mail");
} }
} }
private final static Long GENERATE_EXCEPTION_WARNING_ID = 122589L; private final static Long GENERATE_EXCEPTION_WARNING_ID = 122589L;
public static void sendGenerateExceptionWarning(String message){
public static void sendGenerateExceptionWarning(String message) {
try { try {
// 实例化一个认证对象 // 实例化一个认证对象
Credential cred = new Credential(SECRET_ID, SECRET_KEy); Credential cred = new Credential(SECRET_ID, SECRET_KEy);
@@ -453,7 +467,8 @@ public class SendEmailUtil {
private final static Long QUESTIONNAIRE_FEEDBACK_EN_ID = 124151L; private final static Long QUESTIONNAIRE_FEEDBACK_EN_ID = 124151L;
private final static Long QUESTIONNAIRE_FEEDBACK_CN_ID = 124156L; private final static Long QUESTIONNAIRE_FEEDBACK_CN_ID = 124156L;
public static void questionnaireRelatedNotify(String userName, String email, String language){
public static void questionnaireRelatedNotify(String userName, String email, String language) {
try { try {
// 实例化一个认证对象 // 实例化一个认证对象
Credential cred = new Credential(SECRET_ID, SECRET_KEy); Credential cred = new Credential(SECRET_ID, SECRET_KEy);
@@ -498,7 +513,7 @@ public class SendEmailUtil {
private final static Long RENEWAL_NOTIFICATION_FOR_OLD_USER_EN = 124892L; private final static Long RENEWAL_NOTIFICATION_FOR_OLD_USER_EN = 124892L;
private final static Long RENEWAL_NOTIFICATION_FOR_OLD_USER_CN = 124891L; private final static Long RENEWAL_NOTIFICATION_FOR_OLD_USER_CN = 124891L;
public static void notificationForPaidUser(String receiverAddress, int emailType, String country, String userName, String date){ public static void notificationForPaidUser(String receiverAddress, int emailType, String country, String userName, String date) {
try { try {
// 实例化一个认证对象 // 实例化一个认证对象
Credential cred = new Credential(SECRET_ID, SECRET_KEy); Credential cred = new Credential(SECRET_ID, SECRET_KEy);
@@ -521,7 +536,7 @@ public class SendEmailUtil {
subject = "Welcome to AiDA!"; subject = "Welcome to AiDA!";
if (country.equals("China")) { if (country.equals("China")) {
template.setTemplateID(NEW_USER_PAYMENT_NOTIFICATION_CN); template.setTemplateID(NEW_USER_PAYMENT_NOTIFICATION_CN);
}else { } else {
template.setTemplateID(NEW_USER_PAYMENT_NOTIFICATION_EN); template.setTemplateID(NEW_USER_PAYMENT_NOTIFICATION_EN);
} }
parameter.put("userName", userName); parameter.put("userName", userName);
@@ -532,7 +547,7 @@ public class SendEmailUtil {
subject = "Account renewal notification"; subject = "Account renewal notification";
if (country.equals("China")) { if (country.equals("China")) {
template.setTemplateID(RENEWAL_NOTIFICATION_FOR_OLD_USER_CN); template.setTemplateID(RENEWAL_NOTIFICATION_FOR_OLD_USER_CN);
}else { } else {
template.setTemplateID(RENEWAL_NOTIFICATION_FOR_OLD_USER_EN); template.setTemplateID(RENEWAL_NOTIFICATION_FOR_OLD_USER_EN);
} }
break; break;
@@ -590,4 +605,475 @@ public class SendEmailUtil {
throw new BusinessException("failed.to.send.mail"); throw new BusinessException("failed.to.send.mail");
} }
} }
private final static Long NEW_USER_REGISTER_NOTIFICATION_EN = 126919L;
public static void notificationForRegisterUser(String receiverAddress) {
try {
// 实例化一个认证对象,入参需要传入腾讯云账户 SecretId 和 SecretKey此处还需注意密钥对的保密
// 代码泄露可能会导致 SecretId 和 SecretKey 泄露并威胁账号下所有资源的安全性。以下代码示例仅供参考建议采用更安全的方式来使用密钥请参见https://cloud.tencent.com/document/product/1278/85305
// 密钥可前往官网控制台 https://console.cloud.tencent.com/cam/capi 进行获取
Credential cred = new Credential(SECRET_ID, SECRET_KEy);
// 实例化一个http选项可选的没有特殊需求可以跳过
HttpProfile httpProfile = new HttpProfile();
httpProfile.setEndpoint("ses.tencentcloudapi.com");
// 实例化一个client选项可选的没有特殊需求可以跳过
ClientProfile clientProfile = new ClientProfile();
clientProfile.setHttpProfile(httpProfile);
// 实例化要请求产品的client对象,clientProfile是可选的
SesClient client = new SesClient(cred, "ap-hongkong", clientProfile);
// 实例化一个请求对象,每个接口都会对应一个request对象
SendEmailRequest req = new SendEmailRequest();
req.setFromEmailAddress(SEND_ADDRESS);
req.setDestination(new String[]{receiverAddress});
req.setSubject("Welcome to AiDa");
Template template = new Template();
template.setTemplateID(NEW_USER_REGISTER_NOTIFICATION_EN);
template.setTemplateData("{\"email\":\" " + receiverAddress + "\"}");
req.setTemplate(template);
// 返回的resp是一个SendEmailResponse的实例与请求对象对应
SendEmailResponse resp = client.SendEmail(req);
log.info("短信发送结果res###{}", SendEmailResponse.toJsonString(resp));
} catch (TencentCloudSDKException e) {
log.info("邮件发送至{} 发送失败###{}", receiverAddress, e.toString());
log.error(e.getMessage());
// 这里不再抛出异常 失败就不发,保证后续正常运行
// throw new BusinessException("failed.to.send.mail");
}
}
private final static Long CHANGE_MAILBOX_CONFIRM_CN = 128278L;
private final static Long CHANGE_MAILBOX_CONFIRM_EN = 128277L;
public static void changeMailboxConfirm(String receiverAddress, String language, String name, String link) {
try {
// 实例化一个认证对象,入参需要传入腾讯云账户 SecretId 和 SecretKey此处还需注意密钥对的保密
// 代码泄露可能会导致 SecretId 和 SecretKey 泄露并威胁账号下所有资源的安全性。以下代码示例仅供参考建议采用更安全的方式来使用密钥请参见https://cloud.tencent.com/document/product/1278/85305
// 密钥可前往官网控制台 https://console.cloud.tencent.com/cam/capi 进行获取
Credential cred = new Credential(SECRET_ID, SECRET_KEy);
// 实例化一个http选项可选的没有特殊需求可以跳过
HttpProfile httpProfile = new HttpProfile();
httpProfile.setEndpoint("ses.tencentcloudapi.com");
// 实例化一个client选项可选的没有特殊需求可以跳过
ClientProfile clientProfile = new ClientProfile();
clientProfile.setHttpProfile(httpProfile);
// 实例化要请求产品的client对象,clientProfile是可选的
SesClient client = new SesClient(cred, "ap-hongkong", clientProfile);
// 实例化一个请求对象,每个接口都会对应一个request对象
SendEmailRequest req = new SendEmailRequest();
req.setFromEmailAddress(SEND_ADDRESS);
req.setDestination(new String[]{receiverAddress});
Template template = new Template();
if (language.equals("ENGLISH")) {
req.setSubject("Change the email address bound to the AiDA account");
template.setTemplateID(CHANGE_MAILBOX_CONFIRM_EN);
} else {
req.setSubject("更换AiDA账号绑定的邮箱地址");
template.setTemplateID(CHANGE_MAILBOX_CONFIRM_CN);
}
JSONObject param = new JSONObject();
param.put("userName", name);
param.put("link", link);
template.setTemplateData(param.toJSONString());
req.setTemplate(template);
// 返回的resp是一个SendEmailResponse的实例与请求对象对应
SendEmailResponse resp = client.SendEmail(req);
log.info("短信发送结果res###{}", SendEmailResponse.toJsonString(resp));
} catch (TencentCloudSDKException e) {
log.info("邮件发送失败###{}", e.toString());
throw new BusinessException("failed.to.send.mail");
}
}
private final static Long UPLOAD_TIMEOUT_REMINDER = 128324L;
public static void uploadTimeoutReminder(String userName, String time) {
String xp = "xupei3360@163.com";
String wxd = "X1627315083@163.com";
String pkc = "kaicpang.pang@connect.polyu.hk";
try {
// 实例化一个认证对象,入参需要传入腾讯云账户 SecretId 和 SecretKey此处还需注意密钥对的保密
// 代码泄露可能会导致 SecretId 和 SecretKey 泄露并威胁账号下所有资源的安全性。以下代码示例仅供参考建议采用更安全的方式来使用密钥请参见https://cloud.tencent.com/document/product/1278/85305
// 密钥可前往官网控制台 https://console.cloud.tencent.com/cam/capi 进行获取
Credential cred = new Credential(SECRET_ID, SECRET_KEy);
// 实例化一个http选项可选的没有特殊需求可以跳过
HttpProfile httpProfile = new HttpProfile();
httpProfile.setEndpoint("ses.tencentcloudapi.com");
// 实例化一个client选项可选的没有特殊需求可以跳过
ClientProfile clientProfile = new ClientProfile();
clientProfile.setHttpProfile(httpProfile);
// 实例化要请求产品的client对象,clientProfile是可选的
SesClient client = new SesClient(cred, "ap-hongkong", clientProfile);
// 实例化一个请求对象,每个接口都会对应一个request对象
SendEmailRequest req = new SendEmailRequest();
req.setFromEmailAddress(SEND_ADDRESS);
req.setDestination(new String[]{xp, wxd, pkc});
Template template = new Template();
req.setSubject("上传图片超时提醒");
template.setTemplateID(UPLOAD_TIMEOUT_REMINDER);
JSONObject param = new JSONObject();
param.put("userName", userName);
param.put("time", time);
template.setTemplateData(param.toJSONString());
req.setTemplate(template);
// 返回的resp是一个SendEmailResponse的实例与请求对象对应
SendEmailResponse resp = client.SendEmail(req);
log.info("短信发送结果res###{}", SendEmailResponse.toJsonString(resp));
} catch (TencentCloudSDKException e) {
log.info("邮件发送失败###{}", e.toString());
throw new BusinessException("failed.to.send.mail");
}
}
private final static Long HALFPRICEPROMOTION_CN_ID = 128582L;
private final static Long HALFPRICEPROMOTION_EN_ID = 128583L;
public static void halfPricePromotion(Account account, String senderAddress, int type) {
try {
// 实例化一个认证对象
Credential cred = new Credential(SECRET_ID, SECRET_KEy);
HttpProfile httpProfile = new HttpProfile();
httpProfile.setEndpoint("ses.tencentcloudapi.com");
ClientProfile clientProfile = new ClientProfile();
clientProfile.setHttpProfile(httpProfile);
SesClient client = new SesClient(cred, "ap-hongkong", clientProfile);
SendEmailRequest req = new SendEmailRequest();
if (StringUtils.isEmpty(senderAddress)) {
senderAddress = CODE_CREATE_SEND_ADDRESS;
}
req.setFromEmailAddress(senderAddress);
req.setDestination(new String[]{account.getUserEmail()});
// 根据邮件类型设置不同的主题和模板
String subject = "";
Template template = new Template();
// if (type == 1) {
// subject = "Upcoming System Upgrade for AiDA 3.0";
// template.setTemplateID(UPGRADE_NOTIFICATION_ID);
// }else {
// subject = "即将到来的AiDA 3.0系统升级";
// template.setTemplateID(UPGRADE_NOTIFICATION_ID_CHINESE);
// }
if (type == 1) {
subject = "AiDA workshop - Win a trip to Hong Kong";
template.setTemplateID(HALFPRICEPROMOTION_EN_ID);
} else {
subject = "AiDA workshop - 赢取香港之旅";
template.setTemplateID(HALFPRICEPROMOTION_CN_ID);
}
template.setTemplateData(buildAccountData(account));
req.setSubject(subject);
req.setTemplate(template);
// 发送邮件
SendEmailResponse resp = client.SendEmail(req);
log.info("短信发送结果res###{}", SendEmailResponse.toJsonString(resp));
} catch (TencentCloudSDKException e) {
log.info("邮件发送失败###{}", e.toString());
throw new BusinessException("failed.to.send.mail");
}
}
private final static Long SYSTEM_UPGRADE_CN_ID = 131743L;
private final static Long SYSTEM_UPGRADE_EN_ID = 131744L;
public static void temporaryUpgrade(Account account, String senderAddress, int type) {
try {
// 实例化一个认证对象
Credential cred = new Credential(SECRET_ID, SECRET_KEy);
HttpProfile httpProfile = new HttpProfile();
httpProfile.setEndpoint("ses.tencentcloudapi.com");
ClientProfile clientProfile = new ClientProfile();
clientProfile.setHttpProfile(httpProfile);
SesClient client = new SesClient(cred, "ap-hongkong", clientProfile);
SendEmailRequest req = new SendEmailRequest();
if (StringUtils.isEmpty(senderAddress)) {
senderAddress = CODE_CREATE_SEND_ADDRESS;
}
req.setFromEmailAddress(senderAddress);
req.setDestination(new String[]{account.getUserEmail()});
// 根据邮件类型设置不同的主题和模板
String subject = "";
Template template = new Template();
if (type == 1) {
subject = "AiDA system upgrade completed";
template.setTemplateID(SYSTEM_UPGRADE_EN_ID);
}else {
subject = "AiDA系统升级完成";
template.setTemplateID(SYSTEM_UPGRADE_CN_ID);
}
template.setTemplateData(buildAccountData(account));
req.setSubject(subject);
req.setTemplate(template);
// 发送邮件
SendEmailResponse resp = client.SendEmail(req);
log.info("短信发送结果res###{}", SendEmailResponse.toJsonString(resp));
} catch (TencentCloudSDKException e) {
log.info("邮件发送失败###{}", e.toString());
throw new BusinessException("failed.to.send.mail");
}
}
private final static Long CANCEL_MERCHANT_EN = 130720L;
// private final static Long NEW_MERCHANT_EN = 130721L;
// private final static Long NEW_USER_EN = 130722L;
// private final static Long NEW_USER_CN = 130723L;
private final static Long NEW_MERCHANT_EN = 140335L;
// private final static Long NEW_MERCHANT_EN = 135190L;
// private final static Long NEW_USER_EN = 135189L;
// private final static Long NEW_USER_CN = 135186L;
private final static Long NEW_USER_EN = 140316L;
private final static Long NEW_USER_CN = 140317L;
private final static Long RENEWAL_MERCHANT_EN = 130724L;
private final static Long RENEWAL_USER_EN = 130725L;
private final static Long RENEWAL_USER_CN = 130726L;
private final static Long RENEWAL_REMINDER_USER_EN = 130727L;
private final static Long RENEWAL_REMINDER_USER_CN = 130728L;
private final static Long PAYMENT_FAILED_NEW_MERCHANT_EN = 131230L;
private final static Long PAYMENT_FAILED_RENEWAL_MERCHANT_EN = 131225L;
private final static Long PAYMENT_FAILED_RENEWAL_USER_EN = 131563L;
private final static Long PAYMENT_FAILED_RENEWAL_USER_CN = 131564L;
public static boolean subscriptionEmailReminder(String type, SubscriptionEmailParamsDTO subscriptionEmailParamsDTO, String language, String receiverAddress) {
try {
String merchantEmail = "kimwong@code-create.com.hk";
String developer = "xupei3360@163.com";
String[] receiverEmail = {merchantEmail, developer};
Credential cred = new Credential(SECRET_ID, SECRET_KEy);
// 实例化一个http选项可选的没有特殊需求可以跳过
HttpProfile httpProfile = new HttpProfile();
httpProfile.setEndpoint("ses.tencentcloudapi.com");
// 实例化一个client选项可选的没有特殊需求可以跳过
ClientProfile clientProfile = new ClientProfile();
clientProfile.setHttpProfile(httpProfile);
// 实例化要请求产品的client对象,clientProfile是可选的
SesClient client = new SesClient(cred, "ap-hongkong", clientProfile);
// 实例化一个请求对象,每个接口都会对应一个request对象
SendEmailRequest user = new SendEmailRequest();
user.setFromEmailAddress(SEND_ADDRESS);
user.setDestination(new String[]{receiverAddress});
SendEmailRequest merchant = new SendEmailRequest();
merchant.setFromEmailAddress(SEND_ADDRESS);
merchant.setDestination(receiverEmail);
Template templateUser = new Template();
Template templateMerchant = new Template();
switch (type) {
case "cancel":
merchant.setSubject("[Code-Create] Subscription Cancelled");
templateMerchant.setTemplateID(CANCEL_MERCHANT_EN);
break;
case "fail_new":
merchant.setSubject("[Code-Create] Payment Failed : New Order (" + subscriptionEmailParamsDTO.getOrderId() + ")");
templateMerchant.setTemplateID(PAYMENT_FAILED_NEW_MERCHANT_EN);
break;
case "fail_renewal":
merchant.setSubject("[Code-Create] Payment Failed : Renewal Order (" + subscriptionEmailParamsDTO.getOrderId() + ")");
templateMerchant.setTemplateID(PAYMENT_FAILED_RENEWAL_MERCHANT_EN);
// todo to user
if (language.equals("ENGLISH")) {
user.setSubject("[Code-Create] Payment Failed : Renewal Order (" + subscriptionEmailParamsDTO.getOrderId() + ")");
templateUser.setTemplateID(PAYMENT_FAILED_RENEWAL_USER_EN);
} else {
user.setSubject("[Code-Create] 自动续费失败 (" + subscriptionEmailParamsDTO.getOrderId() + ")");
templateUser.setTemplateID(PAYMENT_FAILED_RENEWAL_USER_CN);
}
break;
case "new":
merchant.setSubject("[Code-Create] New Order(" + subscriptionEmailParamsDTO.getOrderId() + ")");
templateMerchant.setTemplateID(NEW_MERCHANT_EN);
if (language.equals("ENGLISH")) {
user.setSubject("[Code-Create] You have successfully subscribed to AiDA");
templateUser.setTemplateID(NEW_USER_EN);
} else {
user.setSubject("[Code-Create] 您已成功订阅AiDA");
templateUser.setTemplateID(NEW_USER_CN);
}
break;
case "renewal":
merchant.setSubject("[Code-Create] New subscription renewal order (" + subscriptionEmailParamsDTO.getOrderId() + ")");
templateMerchant.setTemplateID(RENEWAL_MERCHANT_EN);
if (language.equals("ENGLISH")) {
user.setSubject("[Code-Create] AiDA Renewal Successful");
templateUser.setTemplateID(RENEWAL_USER_EN);
} else {
user.setSubject("[Code-Create] AiDA续订成功");
templateUser.setTemplateID(RENEWAL_USER_CN);
}
break;
case "reminder":
if (language.equals("ENGLISH")) {
user.setSubject("[Code-Create] AiDA Subscription Renewal Reminder");
templateUser.setTemplateID(RENEWAL_REMINDER_USER_EN);
} else {
user.setSubject("[Code-Create] AiDA续订提醒");
templateUser.setTemplateID(RENEWAL_REMINDER_USER_CN);
}
break;
default:
log.error("unknown subscription email type");
return false;
// throw new BusinessException("unknown subscription email type");
}
templateUser.setTemplateData(JSON.toJSONString(subscriptionEmailParamsDTO));
user.setTemplate(templateUser);
templateMerchant.setTemplateData(JSON.toJSONString(subscriptionEmailParamsDTO));
merchant.setTemplate(templateMerchant);
if (!type.equals("cancel") && !type.equals("fail_new")) {
// 返回的resp是一个SendEmailResponse的实例与请求对象对应
SendEmailResponse respUser = client.SendEmail(user);
log.info("邮件主题:{}发送结果toUser###{}", user.getSubject(), SendEmailResponse.toJsonString(respUser));
}
if (!type.equals("reminder")) {
SendEmailResponse respMerchant = client.SendEmail(merchant);
log.info("邮件主题:{}发送结果toMerchant###{}", merchant.getSubject(), SendEmailResponse.toJsonString(respMerchant));
}
return true;
} catch (TencentCloudSDKException e) {
log.info("邮件发送失败###{}", e.toString());
return false;
// throw new BusinessException("failed.to.send.mail");
}
}
private final static Long NEW_REGISTRATION = 132123L;
private final static Long AFFILIATE_ACCEPTED = 132124L;
private final static Long AFFILIATE_REFUSED = 132125L;
private final static Long AFFILIATE_MONTHLY_SUMMARY = 132126L;
public static void affiliateEmailReminder(String[] receiverAddress, AffiliateEmailParamsDTO paramsDTO, String type) {
try {
Credential cred = new Credential(SECRET_ID, SECRET_KEy);
// 实例化一个http选项可选的没有特殊需求可以跳过
HttpProfile httpProfile = new HttpProfile();
httpProfile.setEndpoint("ses.tencentcloudapi.com");
// 实例化一个client选项可选的没有特殊需求可以跳过
ClientProfile clientProfile = new ClientProfile();
clientProfile.setHttpProfile(httpProfile);
// 实例化要请求产品的client对象,clientProfile是可选的
SesClient client = new SesClient(cred, "ap-hongkong", clientProfile);
// 实例化一个请求对象,每个接口都会对应一个request对象
SendEmailRequest req = new SendEmailRequest();
req.setFromEmailAddress(SEND_ADDRESS);
req.setDestination(receiverAddress);
Template template = new Template();
switch (type) {
case "new":
req.setSubject("New Affiliate Registration");
template.setTemplateID(NEW_REGISTRATION);
break;
case "accepted":
req.setSubject("Affiliate Application Accepted");
template.setTemplateID(AFFILIATE_ACCEPTED);
break;
case "refused":
req.setSubject("Affiliate Application Refused");
template.setTemplateID(AFFILIATE_REFUSED);
break;
case "summary":
req.setSubject("Your Monthly AffiliateWP Summary for AiDA");
template.setTemplateID(AFFILIATE_MONTHLY_SUMMARY);
break;
}
template.setTemplateData(JSON.toJSONString(paramsDTO));
req.setTemplate(template);
// 返回的resp是一个SendEmailResponse的实例与请求对象对应
SendEmailResponse resp = client.SendEmail(req);
log.info("短信发送结果res###{}", SendEmailResponse.toJsonString(resp));
} catch (TencentCloudSDKException e) {
log.info("邮件发送失败###{}", e.toString());
throw new BusinessException("failed.to.send.mail");
}
}
private final static Long CREDITS_PURCHASE_MERCHANT = 133275L;
public static void creditsPurchaseReminder(String username, String quantity, String amount) {
try {
Credential cred = new Credential(SECRET_ID, SECRET_KEy);
// 实例化一个http选项可选的没有特殊需求可以跳过
HttpProfile httpProfile = new HttpProfile();
httpProfile.setEndpoint("ses.tencentcloudapi.com");
// 实例化一个client选项可选的没有特殊需求可以跳过
ClientProfile clientProfile = new ClientProfile();
clientProfile.setHttpProfile(httpProfile);
// 实例化要请求产品的client对象,clientProfile是可选的
SesClient client = new SesClient(cred, "ap-hongkong", clientProfile);
// 实例化一个请求对象,每个接口都会对应一个request对象
SendEmailRequest req = new SendEmailRequest();
req.setFromEmailAddress(SEND_ADDRESS);
String merchantEmail = "kimwong@code-create.com.hk";
String developerEmail = "xupei@code-create.com.hk";
req.setDestination(new String[]{merchantEmail, developerEmail});
Template template = new Template();
req.setSubject("New Credit Purchase Order");
template.setTemplateID(CREDITS_PURCHASE_MERCHANT);
JSONObject jsonObject = new JSONObject();
// 设置试用订单相关数据
jsonObject.put("username", username);
jsonObject.put("quantity", quantity);
jsonObject.put("totalFee", amount);
template.setTemplateData(JSON.toJSONString(jsonObject));
req.setTemplate(template);
// 返回的resp是一个SendEmailResponse的实例与请求对象对应
SendEmailResponse resp = client.SendEmail(req);
log.info("短信发送结果res###{}", SendEmailResponse.toJsonString(resp));
} catch (TencentCloudSDKException e) {
log.info("邮件发送失败###{}", e.toString());
throw new BusinessException("failed.to.send.mail");
}
}
private final static Long COMMON_EXCEPTION_REMINDER = 135279L;
public static void commonExceptionReminder(String functionName, String[] destination) {
try {
// 实例化一个认证对象,入参需要传入腾讯云账户 SecretId 和 SecretKey此处还需注意密钥对的保密
// 代码泄露可能会导致 SecretId 和 SecretKey 泄露并威胁账号下所有资源的安全性。以下代码示例仅供参考建议采用更安全的方式来使用密钥请参见https://cloud.tencent.com/document/product/1278/85305
// 密钥可前往官网控制台 https://console.cloud.tencent.com/cam/capi 进行获取
Credential cred = new Credential(SECRET_ID, SECRET_KEy);
// 实例化一个http选项可选的没有特殊需求可以跳过
HttpProfile httpProfile = new HttpProfile();
httpProfile.setEndpoint("ses.tencentcloudapi.com");
// 实例化一个client选项可选的没有特殊需求可以跳过
ClientProfile clientProfile = new ClientProfile();
clientProfile.setHttpProfile(httpProfile);
// 实例化要请求产品的client对象,clientProfile是可选的
SesClient client = new SesClient(cred, "ap-hongkong", clientProfile);
// 实例化一个请求对象,每个接口都会对应一个request对象
SendEmailRequest req = new SendEmailRequest();
req.setFromEmailAddress(SEND_ADDRESS);
req.setDestination(destination);
Template template = new Template();
req.setSubject("AiDA发生异常请及时处理");
template.setTemplateID(COMMON_EXCEPTION_REMINDER);
JSONObject param = new JSONObject();
param.put("function", functionName);
// 邮件内容 {{function}}处理异常,请及时查看
template.setTemplateData(param.toJSONString());
req.setTemplate(template);
// 返回的resp是一个SendEmailResponse的实例与请求对象对应
SendEmailResponse resp = client.SendEmail(req);
log.info("邮件发送结果res###{}", SendEmailResponse.toJsonString(resp));
} catch (TencentCloudSDKException e) {
log.info("邮件发送失败###{}", e.toString());
throw new BusinessException("failed.to.send.mail");
}
}
} }

View File

@@ -0,0 +1,115 @@
package com.ai.da.common.websocket;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson2.JSON;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestParam;
import javax.websocket.*;
import javax.websocket.server.PathParam;
import javax.websocket.server.ServerEndpoint;
import java.io.IOException;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
@ServerEndpoint(value = "/notification/{id}")
@Component
@Slf4j
public class NotificationConnection {
//连接超时
public static final long MAX_TIME_OUT = 3 * 60 * 1000;
private Session session;
private Long userId;
// 这里用ConcurrentHashMap 因为他是一个线程安全的Map
private static ConcurrentHashMap<Long, NotificationConnection> websockets = new ConcurrentHashMap<>();
@OnOpen
public void onOpen(Session session, @PathParam("id") String id) { // 接收到前端传来的用户ID
this.session = session;
this.userId = Long.valueOf(id);
this.session.setMaxIdleTimeout(MAX_TIME_OUT);
websockets.put(Long.parseLong(id), this); //将ID作为key当前的对象作为Value
log.info("【建立连接】 用户为:{}", this.session);
log.info("【建立连接】 用户Id为{}", id);
log.info("【当前连接总数】 为:{}", websockets.size());
}
@OnClose
public void onClose(CloseReason reason) {
log.info("【连接断开】 用户为:{}, sessionId: {}, 原因为{}", this.userId, this.session.getId(), reason);
log.info("【当前连接总数】 为:{}", websockets.size());
websockets.remove(this.userId); // 将当前的对象从集合中删除
}
/**
* 错误时调用
* @param throwable 异常
*/
@OnError
public void onError(Throwable throwable) {
log.info("【连接异常】 用户为:{} , sessionId: {}", this.userId, this.session.getId(), throwable);
websockets.remove(this.userId); // 将当前的对象从集合中删除
log.info("【当前连接总数】 为:{}", websockets.size());
}
//收到了客户端消息执行的操作
@OnMessage
public void onMessage(@RequestParam String text){
Map<String, String> textMap = JSONObject.parseObject(text, Map.class);
log.info("收到了一条来自 {} 的消息:{} sessionId{}", this.userId, textMap.get("text"), this.session.getId());
// return "已收到你的消息";
if (textMap.get("text").equals("PING")){
sendMsg(JSON.toJSONString("PONG"), this.userId);
}
}
public void sendMsg(String message, Long userId) {
if (userId == null) { // 如果等于null则证明是群发
// 获取当前Map的一个迭代器遍历Map的方式有很多种看着来
// 这个就是遍历这个集合的过程....
for (Map.Entry<Long, NotificationConnection> entry : websockets.entrySet()) {
// 获取每一个Entry实例
// 获取每一个Value而这个Value就是WebSocket的实例
NotificationConnection webSocket = entry.getValue();
// 接下来就是遍历群发
log.info("广播消息 【给用户】 {}发送消息【{}】", webSocket, message);
try {
webSocket.session.getBasicRemote().sendText(message); // 发送!!!!!!!!!
} catch (IOException e) {
log.error("Failed to send message to session {}: {}", webSocket.session.getId(), e.getMessage());
}
}
} else { // 如果不是群发则判断ID其余步骤一致
// 获取当前Map的一个迭代器遍历Map的方式有很多种看着来
// 这个就是遍历这个集合的过程....
for (Map.Entry<Long, NotificationConnection> entry : websockets.entrySet()) {
// 获取每一个Entry实例
// 获取每一个Value而这个Value就是WebSocket的实例
NotificationConnection webSocket = entry.getValue();
// 获取每一个Key这个Key就是用户ID
Long key = entry.getKey();
// 判断用户ID与当前的Key相等
if (userId.equals(key)) {
log.info("私发消息 【给用户】 {}发送消息【{}】", key, message); // 打印
if (webSocket.session.isOpen()){
// 避免因为网络问题或其他原因导致连接突然关闭而报错
try {
webSocket.session.getBasicRemote().sendText(message); // 则发送给当前的用户即可
} catch (IOException e) {
log.error("Failed to send message to session {}: {}", webSocket.session.getId(), e.getMessage());
// 这里可以选择移除关闭的 session
websockets.remove(entry.getKey());
}
}else {
log.info("连接已关闭sessionId:{}, userId:{}", webSocket.session.getId(), key);
websockets.remove(entry.getKey());
}
}
}
}
}
}

View File

@@ -0,0 +1,16 @@
package com.ai.da.common.websocket.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.socket.server.standard.ServerEndpointExporter;
/**
* Configuration of WebSocket
*/
@Configuration
public class WebSocketConfig {
@Bean
public ServerEndpointExporter serverEndpointExporter() {
return new ServerEndpointExporter();
}
}

View File

@@ -1,17 +1,24 @@
package com.ai.da.controller; package com.ai.da.controller;
import com.ai.da.common.config.exception.BusinessException;
import com.ai.da.common.response.PageBaseResponse; import com.ai.da.common.response.PageBaseResponse;
import com.ai.da.common.response.Response; import com.ai.da.common.response.Response;
import com.ai.da.mapper.primary.entity.Account;
import com.ai.da.mapper.primary.entity.AccountExtend;
import com.ai.da.mapper.primary.entity.TrialOrder; import com.ai.da.mapper.primary.entity.TrialOrder;
import com.ai.da.model.dto.*; import com.ai.da.model.dto.*;
import com.ai.da.model.vo.AccountLoginVO; import com.ai.da.model.vo.AccountLoginVO;
import com.ai.da.model.vo.AccountPreLoginVO; import com.ai.da.model.vo.AccountPreLoginVO;
import com.ai.da.model.vo.BindEmailVO;
import com.ai.da.model.vo.PersonalHomepageVO;
import com.ai.da.service.AccountService; import com.ai.da.service.AccountService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
@@ -44,8 +51,8 @@ public class AccountController {
@ApiOperation(value = "绑定邮箱") @ApiOperation(value = "绑定邮箱")
@PostMapping("/bindEmail") @PostMapping("/bindEmail")
public Response<Boolean> bindEmail(@Valid @RequestBody AccountBindEmailDTO accountBindEmailDTO) { public Response<BindEmailVO> bindEmail(@Valid @RequestBody AccountBindEmailDTO accountBindEmailDTO, HttpServletRequest request) {
return Response.success(accountService.bindEmail(accountBindEmailDTO)); return Response.success(accountService.bindEmail(accountBindEmailDTO, request));
} }
@ApiOperation(value = "忘记密码") @ApiOperation(value = "忘记密码")
@@ -177,4 +184,168 @@ public class AccountController {
public Response<Boolean> questionnaire(@Valid @RequestBody String questionnaireInfo){ public Response<Boolean> questionnaire(@Valid @RequestBody String questionnaireInfo){
return Response.success(accountService.collectQuestionnaires(questionnaireInfo)); return Response.success(accountService.collectQuestionnaires(questionnaireInfo));
} }
/**
* 参与活动 获取福利
* @return
*/
@ApiOperation(value = "参与活动 获取福利")
@GetMapping("/activity")
public Response<String> getActivityBenefits(){
return Response.success(accountService.getActivityBenefits());
}
@ApiOperation(value = "将用户账号过期时间设置为过期当天的235959")
@GetMapping("/setUserValidToDayEnd")
public Response<List<Long>> setUserValidToDayEnd(){
return Response.success(accountService.setUserValidToDayEnd());
}
// 用户上传头像
@ApiOperation(value = "上传头像")
@PostMapping(path = "/uploadAvatar")
public Response<String> uploadAvatar(@RequestParam("file") MultipartFile file) {
if (null == file || StringUtils.isEmpty(file.getOriginalFilename())) {
throw new BusinessException("file.cannot.be.empty");
}
return Response.success(accountService.uploadAvatar(file));
}
@ApiOperation(value = "个人主页浏览量增加")
@GetMapping("/viewsIncrease")
public Response<Boolean> viewsGet(@RequestParam("id") Long id) {
return Response.success(accountService.viewsIncrease(id));
}
@ApiOperation(value = "获取个人主页信息")
@GetMapping("/personalHomepage")
public Response<PersonalHomepageVO> getPersonalHomepage(@RequestParam("id") Long id){
return Response.success(accountService.getPersonalHomepage(id));
}
@ApiOperation(value = "getUsernameModifyTimes")
@GetMapping("/getNicknameModifyTimes")
public Response<Long> getNicknameModifyTimes(){
return Response.success(accountService.getNicknameModifyTimes());
}
@ApiOperation(value = "editUserName")
@GetMapping("/editUserName")
public Response<String> editUserName(@RequestParam("newUserName") String newUserName){
accountService.editUserName(newUserName);
return Response.success("success");
}
/*@ApiOperation(value = "verifyUserEmail")
@GetMapping("/verifyUserEmail")
public Response<String> verifyUserEmail(@RequestParam("verifyCode") String verifyCode){
accountService.verifyUserEmail(verifyCode);
return Response.success("success");
}
@ApiOperation(value = "changeUserEmail")
@GetMapping("/changeUserEmail")
public Response<String> changeUserEmail(@RequestParam("newMailbox") String newMailbox){
accountService.changeUserEmail(newMailbox);
return Response.success("success");
}
@ApiOperation(value = "activateNewEmail")
@GetMapping("/activateNewEmail")
public Response<String> activateNewEmail(@RequestParam("token") String token){
accountService.activateNewEmail(token);
return Response.success("success");
}*/
@PostMapping("halfPricePromotion")
@ApiOperation(value = "十月半价活动")
public Response<Boolean> halfPricePromotion() {
accountService.halfPricePromotion();
return Response.success(true);
}
@PostMapping("temporaryUpgrade")
@ApiOperation(value = "临时升级")
public Response<Boolean> temporaryUpgrade() {
accountService.temporaryUpgrade();
return Response.success(true);
}
@PostMapping("enterpriseLogin")
@ApiOperation(value = "企业登录")
public Response<AccountLoginVO> enterpriseLogin(@Valid @RequestBody AccountLoginDTO accountDTO) {
return Response.success(accountService.enterpriseLogin(accountDTO));
}
@PostMapping("schoolLogin")
@ApiOperation(value = "学校登录")
public Response<AccountLoginVO> schoolLogin(@Valid @RequestBody AccountLoginDTO accountDTO) {
return Response.success(accountService.schoolLogin(accountDTO));
}
@PostMapping("addOrUpdateSubAccount")
@ApiOperation(value = "子账号新增")
public Response<Boolean> addSubAccount(@Valid @RequestBody AddSubAccountDTO addSubAccountDTO) {
return Response.success(accountService.addSubAccount(addSubAccountDTO));
}
@PostMapping("deleteSubAccount")
@ApiOperation(value = "子账号删除")
public Response<Boolean> deleteSubAccount(@Valid @RequestBody AddSubAccountDTO addSubAccountDTO) {
return Response.success(accountService.deleteSubAccount(addSubAccountDTO));
}
@PostMapping("subAccountList")
@ApiOperation(value = "子账号查询")
public Response<PageBaseResponse<Account>> subAccountList(@Valid @RequestBody SubAccountPageDTO subAccountPageDTO) {
return Response.success(accountService.subAccountList(subAccountPageDTO));
}
@GetMapping("accountDetail")
@ApiOperation(value = "账号详情")
public Response<Account> accountDetail(@RequestParam("id") Long id) {
return Response.success(accountService.accountDetail(id));
}
@PostMapping("getAccountDetail")
@ApiOperation(value = "获取账户信息")
public Response<AccountLoginVO> getAccountDetail() {
return Response.success(accountService.getAccountDetail());
}
@GetMapping("/bindGoogle")
@ApiOperation(value = "绑定谷歌")
public Response<AccountExtend> bindGoogle(@RequestParam("credential") String credential) {
return Response.success(accountService.bindGoogle(credential));
}
@GetMapping("/bindWeChat")
@ApiOperation(value = "绑定微信")
public Response<AccountExtend> bindWeChat(@RequestParam("code") String code) {
return Response.success(accountService.bindWeChat(code));
}
@GetMapping("/bindEmail")
@ApiOperation(value = "绑定邮箱")
public Response<BindEmailVO> bindEmail(@RequestParam("email") String email) {
return Response.success(accountService.bindEmail(email));
}
@GetMapping("/unbindWeChat")
@ApiOperation(value = "解除绑定微信")
public Response<Boolean> unbindWeChat() {
return Response.success(accountService.unbindWeChat());
}
@GetMapping("/unbindGoogle")
@ApiOperation(value = "解除绑定谷歌")
public Response<Boolean> unbindGoogle() {
return Response.success(accountService.unbindGoogle());
}
@PostMapping("/updateUserInfo")
@ApiOperation(value = "更新用户国家、职业信息")
public Response<Boolean> updateUserInfo(@Valid @RequestBody UpdateUserInfoDTO updateUserInfoDTO) {
return Response.success(accountService.updateUserInfo(updateUserInfoDTO));
}
} }

View File

@@ -0,0 +1,94 @@
package com.ai.da.controller;
import com.ai.da.common.response.PageBaseResponse;
import com.ai.da.common.response.Response;
import com.ai.da.model.dto.AffiliateQueryDTO;
import com.ai.da.model.vo.AffiliateInvitationDetailsVO;
import com.ai.da.model.vo.AffiliateVO;
import com.ai.da.service.AffiliateService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.validation.Valid;
@Slf4j
@RestController
@RequestMapping("/api/affiliate")
@Api(tags = "Affiliate模块")
public class AffiliateController {
@Resource
private AffiliateService affiliateService;
@ApiOperation(value = "注册成为affiliate")
@GetMapping("/registration")
public Response<Boolean> completeGuidance(@RequestParam(value = "promotionMethod", required = false) String promotionMethod) {
return Response.success(affiliateService.registerAsAnAffiliate(promotionMethod));
}
@ApiOperation(value = "获取affiliate列表")
@PostMapping("/list")
public Response<PageBaseResponse<AffiliateVO>> getAffiliateList(@Valid @RequestBody AffiliateQueryDTO affiliateQueryDTO) {
return Response.success(affiliateService.getAffiliateList(affiliateQueryDTO));
}
@ApiOperation(value = "获取affiliate个人中心")
@GetMapping("/personalCenter")
public Response<AffiliateVO> personalAffiliateCenter() {
return Response.success(affiliateService.personalAffiliateCenter());
}
@ApiOperation(value = "获取个人佣金图表数据")
@GetMapping("/getPersonalMonthlyIncome")
public Response<double[]> getPersonalMonthlyIncome(@RequestParam("year")int year) {
return Response.success(affiliateService.getPersonalMonthlyIncome(year));
}
@ApiOperation(value = "审批affiliate申请")
@GetMapping("/approval")
public Response<Boolean> applicationApproval(@RequestParam("id") Long id,
@RequestParam("isApproved")Boolean isApproved,
@RequestParam("commission") Float commission) {
return Response.success(affiliateService.applicationApproval(id, isApproved, commission));
}
@ApiOperation(value = "更新佣金比例")
@GetMapping("/updateCommission")
public Response<String> updateCommissionPercentage(@RequestParam("id") Long id, @RequestParam("commission") Float commission) {
affiliateService.updateCommissionPercentage(id, commission);
return Response.success("success");
}
/*@ApiOperation(value = "定时计算佣金")
@GetMapping("/testTask")
public Response<String> testTask() {
affiliateService.updateAffiliateInfoWithPayment();
return Response.success("success ");
}*/
/*@ApiOperation(value = "每月发送结算邮件")
@GetMapping("/commissionCalculation")
public Response<String> commissionCalculation(@RequestParam("year") Integer year, @RequestParam("month") Integer month) {
affiliateService.commissionCalculation(year, month);
return Response.success("success ");
}*/
@ApiOperation(value = "affiliate链接浏览量增加")
@GetMapping("/viewsIncrease")
public Response<Boolean> viewsGet(@RequestParam("id") Long id) {
return Response.success(affiliateService.affiliateLinkViewsIncrease(id));
}
@ApiOperation(value = "获取每个affiliate产生的收入")
@PostMapping("/getEachAffiliateGeneratedRevenue")
public Response<IPage<AffiliateInvitationDetailsVO>> getEachAffiliateGeneratedRevenue(@RequestBody AffiliateQueryDTO affiliateQueryDTO) {
return Response.success(affiliateService.getEachAffiliateGeneratedRevenue(affiliateQueryDTO));
}
}

View File

@@ -1,6 +1,7 @@
package com.ai.da.controller; package com.ai.da.controller;
import com.ai.da.common.response.Response; import com.ai.da.common.response.Response;
import com.ai.da.model.dto.ProductPurchaseDTO;
import com.ai.da.service.AliPayService; import com.ai.da.service.AliPayService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
@@ -8,6 +9,8 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid;
import java.util.Map; import java.util.Map;
@CrossOrigin @CrossOrigin
@@ -21,12 +24,12 @@ public class AliPayController {
private AliPayService aliPayService; private AliPayService aliPayService;
@ApiOperation("统一收单下单并支付页面接口的调用") @ApiOperation("统一收单下单并支付页面接口的调用")
@PostMapping("/trade/page/pay/{amount}") @PostMapping("/trade/page/pay")
public Response<String> tradePagePay(@PathVariable Integer amount, @RequestParam String returnUrl){ public Response<String> tradePagePay(@Valid @RequestBody ProductPurchaseDTO productPurchaseDTO, HttpServletRequest request){
log.info("统一收单下单并支付页面接口的调用"); log.info("统一收单下单并支付页面接口的调用");
//支付宝开放平台接受 request 请求对象后 //支付宝开放平台接受 request 请求对象后
// 会为开发者生成一个html 形式的 form表单包含自动提交的脚本 // 会为开发者生成一个html 形式的 form表单包含自动提交的脚本
String formStr = aliPayService.tradeCreate(amount, returnUrl); String formStr = aliPayService.tradeCreate(productPurchaseDTO, request);
//我们将form表单字符串返回给前端程序之后前端将会调用自动提交脚本进行表单的提交 //我们将form表单字符串返回给前端程序之后前端将会调用自动提交脚本进行表单的提交
//此时表单会自动提交到action属性所指向的支付宝开放平台中从而为用户展示一个支付页面 //此时表单会自动提交到action属性所指向的支付宝开放平台中从而为用户展示一个支付页面
return Response.success(formStr); return Response.success(formStr);

View File

@@ -1,6 +1,7 @@
package com.ai.da.controller; package com.ai.da.controller;
import com.ai.da.common.response.Response; import com.ai.da.common.response.Response;
import com.ai.da.model.dto.ProductPurchaseDTO;
import com.ai.da.service.AlipayHKService; import com.ai.da.service.AlipayHKService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
@@ -8,6 +9,8 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid;
@CrossOrigin @CrossOrigin
@RestController @RestController
@@ -20,9 +23,9 @@ public class AlipayHKController {
private AlipayHKService alipayHKService; private AlipayHKService alipayHKService;
@ApiOperation(value = "创建订单") @ApiOperation(value = "创建订单")
@PostMapping(value = "/createOrder/{wallet}/{amount}") @PostMapping(value = "/createOrder")
public Response<String> createOrder(@PathVariable Integer amount, @PathVariable String wallet) { public Response<String> createOrder(@Valid @RequestBody ProductPurchaseDTO productPurchaseDTO, HttpServletRequest request) {
String order = alipayHKService.createOrder(amount, wallet); String order = alipayHKService.createOrder(productPurchaseDTO, request);
return Response.success(order); return Response.success(order);
} }

View File

@@ -2,62 +2,223 @@ package com.ai.da.controller;
import com.ai.da.common.context.UserContext; import com.ai.da.common.context.UserContext;
import com.ai.da.common.response.PageBaseResponse;
import com.ai.da.common.response.Response; import com.ai.da.common.response.Response;
import com.ai.da.mapper.primary.DesignMapper; import com.ai.da.mapper.primary.DesignMapper;
import com.ai.da.mapper.primary.TrialOrderMapper; import com.ai.da.mapper.primary.entity.Account;
import com.ai.da.mapper.primary.entity.TrialOrder; import com.ai.da.mapper.primary.entity.TrialOrder;
import com.ai.da.model.dto.AccountAddDTO;
import com.ai.da.model.dto.QueryPaymentInfoDTO;
import com.ai.da.model.dto.UserDesignStatisticDTO; import com.ai.da.model.dto.UserDesignStatisticDTO;
import com.ai.da.model.vo.PaymentInfoVO;
import com.ai.da.model.vo.QuestionnaireFeedbackVO;
import com.ai.da.model.vo.QuestionnaireVO;
import com.ai.da.model.vo.QueryUserConditionsVO;
import com.ai.da.service.AccountService;
import com.ai.da.service.ConvenientInquiryService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import io.netty.util.internal.StringUtil; import io.netty.util.internal.StringUtil;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.annotation.Nullable;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Date; import java.util.*;
import java.util.List;
@Api(tags = "便利查询") @Api(tags = "便利查询")
@Slf4j @Slf4j
@RestController @RestController
@RequestMapping("/api/inquiry") @RequestMapping("/api/inquiry")
public class ConvenientInquiryController { public class ConvenientInquiryController {
@Resource
private TrialOrderMapper trialOrderMapper;
@Resource @Resource
private DesignMapper designMapper; private DesignMapper designMapper;
@Resource
private ConvenientInquiryService convenientInquiryService;
@Resource
private AccountService accountService;
@ApiOperation("获取当前所有试用用户") @ApiOperation("获取当前所有试用用户")
@GetMapping("/getTrial") @PostMapping("/getTrial")
public Response<List<TrialOrder>> getTrial(){ public Response<IPage<TrialOrder>> getTrial(@Valid @RequestBody QueryUserConditionsVO queryUserConditionsVO) {
Long accountId = UserContext.getUserHolder().getId(); Long accountId = UserContext.getUserHolder().getId();
if (accountId.equals(31L) || accountId.equals(87L) || accountId.equals(83L) || accountId.equals(6L) || accountId.equals(4L) || accountId.equals(73L)){ String userEmail = accountService.getById(accountId).getUserEmail();
List<TrialOrder> trialOrders = trialOrderMapper.selectList(null); if (accountId.equals(31L) || accountId.equals(87L) || accountId.equals(83L)
return Response.success(trialOrders); || accountId.equals(6L) || accountId.equals(4L) || accountId.equals(73L)
}else { || userEmail.equals("joho8228@hotmail.com")
|| userEmail.equals("chelseayu@code-create.com.hk")
|| userEmail.equals("cheungzt007@gmail.com")
) {
return Response.success(convenientInquiryService.getTrial(queryUserConditionsVO));
} else {
return Response.fail("Sorry, you don't have permission"); return Response.fail("Sorry, you don't have permission");
} }
} }
@ApiOperation("获取指定时间区间内所有用户design的使用情况") @ApiOperation("获取指定时间区间内所有用户design的使用情况")
@GetMapping("/getDesignStatistic") @GetMapping("/getDesignStatistic")
public Response<List<UserDesignStatisticDTO>> getDesignStatistic(@RequestParam String startTime,@RequestParam String endTime){ public Response<List<UserDesignStatisticDTO>> getDesignStatistic(@RequestParam(required = false) String startTime, @RequestParam(required = false) String endTime,
@RequestParam(required = false) List<Long> ids, @RequestParam(required = false) String email) {
Long accountId = UserContext.getUserHolder().getId(); Long accountId = UserContext.getUserHolder().getId();
if (accountId.equals(31L) || accountId.equals(87L) || accountId.equals(83L) || accountId.equals(6L) || accountId.equals(4L) || accountId.equals(73L)){ String userEmail = accountService.getById(accountId).getUserEmail();
if (accountId.equals(31L) || accountId.equals(87L) || accountId.equals(83L)
|| accountId.equals(6L) || accountId.equals(4L) || accountId.equals(73L)
|| userEmail.equals("joho8228@hotmail.com")
|| userEmail.equals("chelseayu@code-create.com.hk")
|| userEmail.equals("cheungzt007@gmail.com")
) {
if (StringUtil.isNullOrEmpty(startTime)) startTime = "2024-02-01 00:00:00"; if (StringUtil.isNullOrEmpty(startTime)) startTime = "2024-02-01 00:00:00";
if (StringUtil.isNullOrEmpty(endTime)){ if (StringUtil.isNullOrEmpty(endTime)) {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
Date date = new Date(); Date date = new Date();
endTime = simpleDateFormat.format(date); endTime = simpleDateFormat.format(date);
} }
List<UserDesignStatisticDTO> designStatistic = designMapper.getDesignStatistic(startTime, endTime); if (!StringUtil.isNullOrEmpty(email)){
email = email.trim();
}
List<UserDesignStatisticDTO> designStatistic = designMapper.getDesignStatistic(startTime, endTime, ids, email);
return Response.success(designStatistic); return Response.success(designStatistic);
}else { } else {
return Response.fail("Sorry, you don't have permission"); return Response.fail("Sorry, you don't have permission");
} }
} }
//调查问卷
@ApiOperation("获取调查问卷统计详情")
@GetMapping("/getQuestionnaireStatistic")
public Response<QuestionnaireFeedbackVO> getQuestionnaire() {
return Response.success(convenientInquiryService.getQuestionnaireInfo());
}
@ApiOperation("获取所有调查问卷")
@GetMapping("/getAllQuestionnaire")
public Response<List<QuestionnaireVO>> getAllQuestionnaire() {
return Response.success(convenientInquiryService.getAllQuestionnaire());
}
@ApiOperation("获取近期新用户")
@PostMapping("/recentNewUser")
public Response<IPage<Account>> recentNewUser(@Valid @RequestBody QueryUserConditionsVO queryUserConditionsVO) {
return Response.success(convenientInquiryService.recentNewUser(queryUserConditionsVO));
}
@ApiOperation("获取近期新用户图表数据")
@GetMapping("/recentNewUserChart")
public Response<Map<String, Object>> recentNewUserChart(@ApiParam(value = "startTime") @RequestParam @Nullable String startTime,
@ApiParam(value = "endTime") @RequestParam @Nullable String endTime,
@ApiParam("userType") @RequestParam Integer userType) {
return Response.success(convenientInquiryService.recentNewUserChart(startTime, endTime, userType));
}
@ApiOperation("获取近期活跃用户")
@PostMapping("/recentActiveUser")
public Response<IPage<Account>> recentActiveUser(@Valid @RequestBody QueryUserConditionsVO queryUserConditionsVO) {
return Response.success(convenientInquiryService.recentActiveUser(queryUserConditionsVO));
}
@ApiOperation("获取近期活跃用户图表数据")
@GetMapping("/recentActiveUserChart")
public Response<Integer> recentActiveUserChart(@ApiParam(value = "startTime") @RequestParam @Nullable String startTime,
@ApiParam(value = "endTime") @RequestParam @Nullable String endTime) {
return Response.success(convenientInquiryService.recentActiveUserChart(startTime, endTime));
}
@ApiOperation("获取用户的各模块功能使用详情")
@GetMapping("/getActiveUserFunc")
public Response<Map<String, List<Object>>> getActiveUserFunc(@ApiParam(value = "startTime") @RequestParam @Nullable String startTime,
@ApiParam(value = "endTime") @RequestParam @Nullable String endTime,
@ApiParam("userIdList") @RequestParam @Nullable List<Long> userIdList) {
return Response.success(convenientInquiryService.getActiveUserFunc(startTime, endTime, userIdList));
}
@ApiOperation("试用用户到正式用户的转化率")
@GetMapping("/conversionRate")
public Response<Map<String, Object>> conversionRate(@ApiParam(value = "startTime") @RequestParam(required = false) @Nullable String startTime,
@ApiParam(value = "endTime") @RequestParam(required = false) @Nullable String endTime) {
return Response.success(convenientInquiryService.conversionRate(startTime, endTime));
}
@ApiOperation("试用用户国家/城市分布")
@GetMapping("/trialUserCountry")
public Response<Map<String, List<Object>>> trialUserCountry(@ApiParam(value = "startTime") @RequestParam(required = false) @Nullable String startTime,
@ApiParam(value = "endTime") @RequestParam(required = false) @Nullable String endTime) {
return Response.success(convenientInquiryService.trialUserCountry(startTime, endTime));
}
@ApiOperation("添加用户")
@PostMapping("/addUser")
public Response<Boolean> addUser(@Valid @RequestBody AccountAddDTO accountAddDTO) {
Long userAccountId = UserContext.getUserHolder().getId();
if (userAccountId.equals(31L) || userAccountId.equals(87L) || userAccountId.equals(83L)
|| userAccountId.equals(6L) || userAccountId.equals(4L) || userAccountId.equals(73L)
) {
return Response.success(convenientInquiryService.addUser(accountAddDTO));
} else {
return Response.fail("Sorry, you don't have permission");
}
}
@ApiOperation("修改用户信息")
@PostMapping("/modifyUser")
public Response<Boolean> modifyUser(@ApiParam(value = "用户id") @RequestParam @Nullable Long accountId,
@ApiParam(value = "有效期截止时间的毫秒级unix格式") @RequestParam @Nullable Long validEndTime,
@ApiParam(value = "用户类型 1/2/3/0 -> yearly/monthly/trial/visitor") @RequestParam @Nullable Integer systemUser,
@ApiParam("积分") @RequestParam @Nullable Long credits) {
Long userAccountId = UserContext.getUserHolder().getId();
if (userAccountId.equals(31L) || userAccountId.equals(87L) || userAccountId.equals(83L)
|| userAccountId.equals(6L) || userAccountId.equals(4L) || userAccountId.equals(73L)
) {
return Response.success(convenientInquiryService.modifyUser(accountId, validEndTime, systemUser, credits));
} else {
return Response.fail("Sorry, you don't have permission");
}
}
@ApiOperation("获取用户信息")
@PostMapping("/getUserInfo")
public Response<IPage<Account>> getUserInfo(@Valid @RequestBody QueryUserConditionsVO queryUserConditionsVO) {
Long accountId = UserContext.getUserHolder().getId();
String userEmail = accountService.getById(accountId).getUserEmail();
if (accountId.equals(31L) || accountId.equals(87L) || accountId.equals(83L)
|| accountId.equals(6L) || accountId.equals(4L) || accountId.equals(73L)
|| userEmail.equals("joho8228@hotmail.com")
|| userEmail.equals("chelseayu@code-create.com.hk")
|| userEmail.equals("cheungzt007@gmail.com")
) {
return Response.success(convenientInquiryService.getUserInfo(queryUserConditionsVO));
} else {
return Response.fail("Sorry, you don't have permission");
}
}
@ApiOperation("获取所有用户id")
@GetMapping("/getAllUserId")
public Response<List<Map<String, Object>>> getAllUsrIdList() {
return Response.success(convenientInquiryService.getAllUserIdList());
}
@ApiOperation("获取所有交易信息")
@PostMapping("/queryTransaction")
public Response<PageBaseResponse<PaymentInfoVO>> queryTransactionRecords(@Valid @RequestBody QueryPaymentInfoDTO queryPaymentInfoDTO){
return Response.success(convenientInquiryService.queryTransactionRecords(queryPaymentInfoDTO));
}
@ApiOperation("获取所有国家、城市")
@GetMapping("/getCities")
public Response<Map<String, List<String>>> getCities(){
return Response.success(convenientInquiryService.getCities());
}
@ApiOperation("下载交易记录")
@PostMapping("/queryTransaction/download")
public Response<String> exportTransactionRecords(@Valid @RequestBody QueryPaymentInfoDTO queryPaymentInfoDTO, HttpServletResponse response){
return Response.success(convenientInquiryService.exportTransactionRecords(queryPaymentInfoDTO, response));
}
} }

View File

@@ -31,7 +31,7 @@ public class DesignController {
@ApiOperation(value = "设计 Conllection") @ApiOperation(value = "设计 Conllection")
@PostMapping("/designCollection") @PostMapping("/designCollection")
@CrossOrigin @CrossOrigin
public Response<DesignCollectionVO> designCollection(@Valid @RequestBody DesignCollectionDTO designDTO) { public Response<String> designCollection(@Valid @RequestBody DesignCollectionDTO designDTO) {
return Response.success(designService.designCollection(designDTO)); return Response.success(designService.designCollection(designDTO));
} }
@@ -43,7 +43,7 @@ public class DesignController {
@ApiOperation(value = "重新设计 Collection") @ApiOperation(value = "重新设计 Collection")
@PostMapping("/reDesignCollection") @PostMapping("/reDesignCollection")
public Response<DesignCollectionVO> reDesignCollection(@Valid @RequestBody ReDesignCollectionDTO reDesignDTO) { public Response<String> reDesignCollection(@Valid @RequestBody ReDesignCollectionDTO reDesignDTO) {
return Response.success(designService.reDesignCollection(reDesignDTO)); return Response.success(designService.reDesignCollection(reDesignDTO));
} }
@@ -71,10 +71,16 @@ public class DesignController {
return Response.success(designService.dislike(disDesignLikeDTO)); return Response.success(designService.dislike(disDesignLikeDTO));
} }
@ApiOperation(value = "Design sort")
@PostMapping("/sort")
public Response<Boolean> sort(@Valid @RequestBody UserLikeSortDTO userLikeSortDTO) {
return Response.success(designService.sort(userLikeSortDTO));
}
@ApiOperation(value = "sketchBoard upload generate design前裁剪") @ApiOperation(value = "sketchBoard upload generate design前裁剪")
@PostMapping("/sketchBoardsBoundingBox") @PostMapping("/sketchBoardsBoundingBox")
public Response<List<CollectionSketchVO>> sketchesBoundingBox(@Valid @RequestBody SketchesBoundingBoxDTO sketchesBoundingBoxDTO) { public Response<List<CollectionSketchVO>> sketchesBoundingBox(@Valid @RequestBody ReDesignCollectionDTO reDesignCollectionDTO) {
return Response.success(designService.sketchesBoundingBox(sketchesBoundingBoxDTO)); return Response.success(designService.sketchesBoundingBox(reDesignCollectionDTO));
} }
@ApiOperation(value = "通过designItemId获取模特图") @ApiOperation(value = "通过designItemId获取模特图")
@@ -83,4 +89,16 @@ public class DesignController {
return Response.success(designService.getModel(designItemIdList)); return Response.success(designService.getModel(designItemIdList));
} }
@ApiOperation(value = "获取design结果")
@GetMapping("/getDesignResult")
public Response<DesignCollectionVO> getDesignResult(@RequestParam("requestId") String requestId, @RequestParam("objectSignList") List<String> objectSignList){
return Response.success(designService.getDesignResult(requestId, objectSignList));
}
@ApiOperation(value = "云生成")
@PostMapping("/designCloud")
@CrossOrigin
public Response<String> designCloud(@Valid @RequestBody DesignCollectionDTO designDTO) {
return Response.success(designService.designCloud(designDTO));
}
} }

View File

@@ -77,4 +77,18 @@ public class DesignDetailController {
public Response<ComposeLayersVO> editPositionAndScale(@Valid @RequestBody EditLayersPositionAndScaleVO positionAndScaleVO) throws IOException { public Response<ComposeLayersVO> editPositionAndScale(@Valid @RequestBody EditLayersPositionAndScaleVO positionAndScaleVO) throws IOException {
return Response.success(designItemService.editLayersPositionAndScale(positionAndScaleVO)); return Response.success(designItemService.editLayersPositionAndScale(positionAndScaleVO));
} }
@ApiOperation(value = "mask数据兼容")
@GetMapping("/convertWithoutGradient")
public Response<String> convertHistoryMaskWithoutGradient(){
designItemService.convertHistoryMaskWithoutGradient();
return Response.success("success");
}
@ApiOperation(value = "mask数据库路径更新")
@GetMapping("/updateMaskUrl")
public Response<String> updateMaskUrl(){
designItemService.updateMaskUrl();
return Response.success("success");
}
} }

View File

@@ -66,6 +66,8 @@ public class ElementController {
return Response.success(); return Response.success();
} }
/** 该功能已删除 */
@Deprecated
@ApiOperation(value = "生成印花") @ApiOperation(value = "生成印花")
@PostMapping("/generatePrint") @PostMapping("/generatePrint")
public Response<GenerateCollectionItemVO> generatePrint(@Valid @RequestBody CollectionGeneratePrintDTO generatePrintDTO) { public Response<GenerateCollectionItemVO> generatePrint(@Valid @RequestBody CollectionGeneratePrintDTO generatePrintDTO) {

View File

@@ -2,7 +2,9 @@ package com.ai.da.controller;
import com.ai.da.common.response.Response; import com.ai.da.common.response.Response;
import com.ai.da.model.dto.GenerateLikeDTO; import com.ai.da.model.dto.GenerateLikeDTO;
import com.ai.da.model.dto.GenerateModifyDTO;
import com.ai.da.model.dto.GenerateThroughImageTextDTO; import com.ai.da.model.dto.GenerateThroughImageTextDTO;
import com.ai.da.model.dto.ImageToSketchDTO;
import com.ai.da.model.vo.*; import com.ai.da.model.vo.*;
import com.ai.da.service.GenerateService; import com.ai.da.service.GenerateService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
@@ -83,5 +85,17 @@ public class GenerateController {
return Response.success(generateResult); return Response.success(generateResult);
} }
@ApiOperation(value = "imageToSketch")
@PostMapping("/imageToSketch")
public Response<GenerateResultVO> imageToSketch(@Valid @RequestBody ImageToSketchDTO imageToSketchDTO) {
return Response.success(generateService.imageToSketch(imageToSketchDTO));
}
// modifySketch
@ApiOperation(value = "modifySketch")
@PostMapping("/modifySketch")
public Response<GenerateResultVO> modifySketch(@Valid @RequestBody GenerateModifyDTO generateModifyDTO) {
return Response.success(generateService.modifySketch(generateModifyDTO));
}
} }

View File

@@ -0,0 +1,63 @@
package com.ai.da.controller;
import com.ai.da.common.response.PageBaseResponse;
import com.ai.da.common.response.Response;
import com.ai.da.model.dto.GetNotificationDTO;
import com.ai.da.model.vo.NotificationVO;
import com.ai.da.model.dto.PublishSysNotificationDTO;
import com.ai.da.service.MessageCenterService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.List;
import java.util.Map;
@Api(tags = "消息中心模块")
@Slf4j
@RestController
@RequestMapping("/api/message")
public class MessageCenterController {
@Resource
private MessageCenterService messageCenterService;
// 获取未读消息总数
@ApiOperation(value = "获取未读消息数")
@GetMapping("/getUnreadCount")
public Response<Map<String, Long>> getUnreadMessage(){
return Response.success(messageCenterService.getAllTypeMessageUnreadCount());
}
// 获取历史消息
@ApiOperation(value = "获取历史消息")
@PostMapping("/getHistoryNotification")
public Response<PageBaseResponse<NotificationVO>> getHistoryNotification(@Valid @RequestBody GetNotificationDTO getNotificationDTO) {
return Response.success(messageCenterService.getHistoryNotification(getNotificationDTO));
}
// 已读消息
@ApiOperation(value = "设置消息状态为已读")
@PostMapping("/setReadStatus")
public Response<Boolean> setReadStatus(@RequestParam("notificationIdList") List<Long> notificationIdList, @RequestParam("type") String type) {
return Response.success(messageCenterService.setReadStatus(notificationIdList, type));
}
// 发布系统消息
@ApiOperation(value = "发布系统消息")
@PostMapping("/publishSysMessage")
public Response<String> publishSysMessage(@Valid @RequestBody PublishSysNotificationDTO message) {
messageCenterService.publishSystemNotification(message);
return Response.success("success");
}
@ApiOperation(value = "一键已读")
@PostMapping("/oneClickRead")
public Response<String> setReadAll(@RequestParam("type") String type) {
messageCenterService.setReadAll(type);
return Response.success("success");
}
}

View File

@@ -3,9 +3,10 @@ package com.ai.da.controller;
import com.ai.da.common.enums.OrderStatusEnum; import com.ai.da.common.enums.OrderStatusEnum;
import com.ai.da.common.response.PageBaseResponse; import com.ai.da.common.response.PageBaseResponse;
import com.ai.da.common.response.Response; import com.ai.da.common.response.Response;
import com.ai.da.mapper.primary.entity.OrderInfo;
import com.ai.da.model.dto.QueryPageByTimeDTO; import com.ai.da.model.dto.QueryPageByTimeDTO;
import com.ai.da.model.vo.OrderListVO;
import com.ai.da.service.OrderInfoService; import com.ai.da.service.OrderInfoService;
import com.ai.da.service.PaymentInfoService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@@ -22,10 +23,13 @@ public class OrderInfoController {
@Resource @Resource
private OrderInfoService orderInfoService; private OrderInfoService orderInfoService;
@Resource
private PaymentInfoService paymentInfoService;
@ApiOperation("订单列表") @ApiOperation("订单列表")
@PostMapping("/list") @PostMapping("/list")
public Response<PageBaseResponse<OrderInfo>> list(@Valid @RequestBody QueryPageByTimeDTO queryPageByTimeDTO){ public Response<PageBaseResponse<OrderListVO>> list(@Valid @RequestBody QueryPageByTimeDTO queryPageByTimeDTO){
PageBaseResponse<OrderInfo> orderByAccountId = orderInfoService.getOrderByPage(queryPageByTimeDTO); PageBaseResponse<OrderListVO> orderByAccountId = paymentInfoService.getPaymentInfo(queryPageByTimeDTO);
// List<OrderInfo> list = orderInfoService.listOrderByCreateTimeDesc(); // List<OrderInfo> list = orderInfoService.listOrderByCreateTimeDesc();
return Response.success(orderByAccountId); return Response.success(orderByAccountId);
} }

View File

@@ -1,6 +1,7 @@
package com.ai.da.controller; package com.ai.da.controller;
import com.ai.da.common.response.Response; import com.ai.da.common.response.Response;
import com.ai.da.model.dto.ProductPurchaseDTO;
import com.ai.da.service.PayPalCheckoutService; import com.ai.da.service.PayPalCheckoutService;
import com.paypal.http.HttpResponse; import com.paypal.http.HttpResponse;
import com.paypal.http.exceptions.SerializeException; import com.paypal.http.exceptions.SerializeException;
@@ -14,6 +15,7 @@ import javax.annotation.Resource;
import javax.servlet.ServletException; import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.io.IOException; import java.io.IOException;
import java.util.HashMap; import java.util.HashMap;
@@ -26,9 +28,9 @@ public class PayPalCheckoutController {
private PayPalCheckoutService payPalCheckoutService; private PayPalCheckoutService payPalCheckoutService;
@ApiOperation(value = "创建订单") @ApiOperation(value = "创建订单")
@PostMapping(value = "/trade/{amount}") @PostMapping(value = "/trade")
public Response<HashMap<String, String>> createOrder(@PathVariable Integer amount, @RequestParam String returnUrl) throws SerializeException { public Response<HashMap<String, String>> createOrder(@Valid @RequestBody ProductPurchaseDTO productPurchaseDTO, HttpServletRequest request) throws SerializeException {
HashMap<String, String> approvalUrl = payPalCheckoutService.createOrder(amount,returnUrl); HashMap<String, String> approvalUrl = payPalCheckoutService.createOrder(productPurchaseDTO, request);
return Response.success(approvalUrl); return Response.success(approvalUrl);
} }

View File

@@ -1,12 +1,14 @@
package com.ai.da.controller; package com.ai.da.controller;
import com.ai.da.common.config.exception.BusinessException;
import com.ai.da.common.response.PageBaseResponse; import com.ai.da.common.response.PageBaseResponse;
import com.ai.da.common.response.Response; import com.ai.da.common.response.Response;
import com.ai.da.mapper.primary.entity.Account;
import com.ai.da.model.dto.*; import com.ai.da.model.dto.*;
import com.ai.da.model.vo.*;
import com.ai.da.model.vo.CommentVO; import com.ai.da.model.vo.CommentVO;
import com.ai.da.model.vo.PortfolioVO; import com.ai.da.model.vo.PortfolioVO;
import com.ai.da.model.vo.UserLikeChooseVO; import com.ai.da.model.vo.UserLikeChooseVO;
import com.ai.da.model.vo.UserLikeGroupVO;
import com.ai.da.service.PortfolioService; import com.ai.da.service.PortfolioService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
@@ -16,6 +18,7 @@ import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.validation.Valid; import javax.validation.Valid;
import java.util.List;
@Api(tags = "Portfolio模块") @Api(tags = "Portfolio模块")
@Slf4j @Slf4j
@@ -28,7 +31,7 @@ public class PortfolioController {
@ApiOperation(value = "发布作品集") @ApiOperation(value = "发布作品集")
@PostMapping("/publish") @PostMapping("/publish")
public Response<Boolean> preLogin(@RequestParam("file") MultipartFile canvas, @RequestParam("data") String data) { public Response<Long> preLogin(@RequestParam("file") MultipartFile canvas, @RequestParam("data") String data) {
return Response.success(portfolioService.publish(canvas, data)); return Response.success(portfolioService.publish(canvas, data));
} }
@@ -117,4 +120,38 @@ public class PortfolioController {
public Response<Boolean> commentDelete(@Valid @RequestBody CommentDTO commentDTO) { public Response<Boolean> commentDelete(@Valid @RequestBody CommentDTO commentDTO) {
return Response.success(portfolioService.commentDelete(commentDTO)); return Response.success(portfolioService.commentDelete(commentDTO));
} }
@ApiOperation(value = "关注")
@GetMapping("/follow")
public Response<String> follow(@RequestParam("followeeId") Long followeeId) {
portfolioService.follow(followeeId);
return Response.success(BusinessException.getMessageFromResource("subscription.success"));
}
@ApiOperation(value = "取消关注")
@GetMapping("/cancelFollow")
public Response<String> cancelFollow(@RequestParam("followeeId") Long followeeId) {
portfolioService.cancelFollow(followeeId);
return Response.success(BusinessException.getMessageFromResource("unsubscribe.success"));
}
@ApiOperation(value = "获取关注列表")
@PostMapping("/getFolloweeList")
public Response<List<AccountFollowVO>> getFolloweeList(@Valid @RequestBody GetFollowListDTO getFollowListDTO) {
return Response.success(portfolioService.getFolloweeList(getFollowListDTO));
}
@ApiOperation(value = "获取粉丝列表")
@PostMapping("/getFollowerList")
public Response<List<AccountFollowVO>> getFollowerList(@Valid @RequestBody GetFollowListDTO getFollowListDTO) {
return Response.success(portfolioService.getFollowerList(getFollowListDTO));
}
/* @ApiOperation(value = "按标签名查询作品")
@GetMapping("/queryPortfolioByTag")
public Response<List<PortfolioVO>> queryPortfolioByTag(@RequestParam(value = "tagName", required = false) String tagName,
@RequestParam(value = "tagId", required = false) Long tagId) {
return Response.success(portfolioService.queryPortfolioByTag(tagName, tagId));
}*/
} }

View File

@@ -104,9 +104,9 @@ public class SavedCollectionController {
} }
List<Long> groupIds = page.getRecords().stream().map(UserLikeGroup::getId).collect(Collectors.toList()); List<Long> groupIds = page.getRecords().stream().map(UserLikeGroup::getId).collect(Collectors.toList());
List<UserLikeVO> groupDetails = userLikeService.getGroupDetails(groupIds); List<UserLikeVO> groupDetails = userLikeService.getGroupDetails(groupIds);
if (CollectionUtils.isEmpty(groupDetails)) { // if (CollectionUtils.isEmpty(groupDetails)) {
throw new BusinessException("groupDetails.not.found"); // throw new BusinessException("groupDetails.not.found");
} // }
Map<Long, List<UserLikeVO>> groupDetailMap = groupDetails.stream() Map<Long, List<UserLikeVO>> groupDetailMap = groupDetails.stream()
.collect(Collectors.groupingBy(UserLikeVO::getUserLikeGroupId)); .collect(Collectors.groupingBy(UserLikeVO::getUserLikeGroupId));
@@ -117,6 +117,7 @@ public class SavedCollectionController {
userLikeGroupVO.setUpdateDate(group.getUpdateDate().getTime()); userLikeGroupVO.setUpdateDate(group.getUpdateDate().getTime());
userLikeGroupVO.setAuthor(account.getUserName()); userLikeGroupVO.setAuthor(account.getUserName());
//count 和detail //count 和detail
if (groupDetailMap.keySet().contains(group.getId())) {
List<UserLikeVO> details = groupDetailMap.get(group.getId()); List<UserLikeVO> details = groupDetailMap.get(group.getId());
for (UserLikeVO detail : details) { for (UserLikeVO detail : details) {
TDesignPythonOutfit tDesignPythonOutfit = designPythonOutfitMapper.selectById(detail.getDesignOutfitId()); TDesignPythonOutfit tDesignPythonOutfit = designPythonOutfitMapper.selectById(detail.getDesignOutfitId());
@@ -124,6 +125,9 @@ public class SavedCollectionController {
} }
userLikeGroupVO.setGroupDetails(details); userLikeGroupVO.setGroupDetails(details);
userLikeGroupVO.setSketchCount(CollectionUtils.isEmpty(details) ? 0 : details.size()); userLikeGroupVO.setSketchCount(CollectionUtils.isEmpty(details) ? 0 : details.size());
}else {
userLikeGroupVO.setSketchCount(0);
}
if (userLikeGroupVO.getOriginal() == 0) { if (userLikeGroupVO.getOriginal() == 0) {
userLikeGroupVO.setOriginalAccountName(accountService.getById(userLikeGroupVO.getOriginalAccountId()).getUserName()); userLikeGroupVO.setOriginalAccountName(accountService.getById(userLikeGroupVO.getOriginalAccountId()).getUserName());
Portfolio byId = portfolioService.getByIdAll(userLikeGroupVO.getOriginalPortfolioId()); Portfolio byId = portfolioService.getByIdAll(userLikeGroupVO.getOriginalPortfolioId());
@@ -235,4 +239,22 @@ public class SavedCollectionController {
List<MagicToolResultVO> magicToolResultVOList = userLikeGroupService.getRelightResult(taskIdList); List<MagicToolResultVO> magicToolResultVOList = userLikeGroupService.getRelightResult(taskIdList);
return Response.success(magicToolResultVOList); return Response.success(magicToolResultVOList);
} }
@ApiOperation(value = "likeHistoryRelSketch")
@PostMapping("/likeHistoryRelSketch")
public Response<String> likeHistoryRelSketch() {
return Response.success(userLikeGroupService.likeHistoryRelSketch());
}
@ApiOperation(value = "download")
@PostMapping("/download")
public Response<String> download() {
return Response.success(userLikeGroupService.download());
}
@ApiOperation(value = "productImageInitialize")
@PostMapping("/productImageInitialize")
public Response<Boolean> productImageUpload(@Valid @RequestBody ProductImageInitializeDTO productImageInitializeDTO) {
return Response.success(userLikeGroupService.productImageInitialize(productImageInitializeDTO));
}
} }

View File

@@ -1,47 +1,84 @@
package com.ai.da.controller; package com.ai.da.controller;
import com.ai.da.common.response.Response; import com.ai.da.common.response.Response;
import com.ai.da.common.utils.DateUtil;
import com.ai.da.common.utils.RedisUtil;
import com.ai.da.common.utils.SendEmailUtil;
import com.ai.da.mapper.primary.entity.ProductCoupons;
import com.ai.da.model.dto.CreateCouponDTO;
import com.ai.da.model.dto.ProductPurchaseDTO;
import com.ai.da.model.dto.QueryCouponsPageDTO;
import com.ai.da.model.vo.CheckCouponsVO;
import com.ai.da.service.StripeService; import com.ai.da.service.StripeService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.paypal.http.HttpResponse; import com.paypal.http.HttpResponse;
import com.paypal.payments.Refund; import com.paypal.payments.Refund;
import com.stripe.exception.StripeException;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.ServletException; import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.io.IOException; import java.io.IOException;
import java.util.Date;
import java.util.List;
@Api(tags = "Stripe模块") @Api(tags = "Stripe模块")
@Slf4j @Slf4j
@RestController @RestController
@RequestMapping("/api/stripe") @RequestMapping("/api/stripe")
@ApiIgnore
public class StripeController { public class StripeController {
@Resource @Resource
private StripeService stripeService; private StripeService stripeService;
@Resource
private RedisUtil redisUtil;
@ApiOperation("创建支付链接") @ApiOperation("创建支付链接")
@PostMapping("/createOrder/{amount}") @PostMapping("/createOrder")
public Response<String> pay(@PathVariable Integer amount, @RequestParam String returnUrl) { public Response<String> pay(@Valid @RequestBody ProductPurchaseDTO productPurchaseDTO, HttpServletRequest request) {
return Response.success(stripeService.pay(amount, returnUrl)); return Response.success(stripeService.pay(productPurchaseDTO, request));
} }
@Value("${stripe.webhook.fail.reminder}")
private String webhookReminderFlag;
@ApiOperation("支付通知") @ApiOperation("支付通知")
@PostMapping("/trade/notify") @PostMapping("/trade/notify")
public Response<String> callback(HttpServletRequest request) throws ServletException, IOException { public void callback(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
try{
Boolean result = stripeService.notify(request); Boolean result = stripeService.notify(request);
if (result){ if (result){
return Response.success(200,"success"); response.setStatus(HttpServletResponse.SC_OK);
}else { }else {
return Response.fail(400,"failure"); response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
}
}catch (Exception e){
log.error("Stripe Controller层异常捕捉, {}", e.getMessage());
e.printStackTrace();
String key_1 = RedisUtil.STRIPE_EXCEPTION_LOG + DateUtil.dateToStr(new Date(), DateUtil.YYYY_MM_DD_HH);
String key_2 = key_1 + ":" + DateUtil.dateToStr(new Date(), DateUtil.YYYY_MM_DD_hh_mm_ss);
String stackTrace = stripeService.getStackTrace(e, 10);
redisUtil.addToString(key_2, stackTrace);
Long size = redisUtil.getSize(key_1);
// 给我发送邮件
if (webhookReminderFlag.equals("1") && size == 3){
SendEmailUtil.commonExceptionReminder("Stripe Webhook 回调", new String[]{"xupei3360@163.com"});
}
response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
} }
} }
@ApiOperation("申请退款") @ApiOperation("申请退款")
@PostMapping("/trade/refund/{orderNo}/{reason}") @GetMapping("/trade/refund/{orderNo}/{reason}")
public Response<HttpResponse<Refund>> refund(@PathVariable String orderNo, @PathVariable String reason) throws IOException { public Response<HttpResponse<Refund>> refund(@PathVariable String orderNo, @PathVariable String reason) throws IOException {
String response = stripeService.refund(null,orderNo,reason); String response = stripeService.refund(null,orderNo,reason);
if (response.equals("退款成功")){ if (response.equals("退款成功")){
@@ -51,4 +88,105 @@ public class StripeController {
} }
} }
@ApiOperation("获取订阅")
@GetMapping("/getSubscription")
public Response<List<String>> getSubscription(@RequestParam String name, @RequestParam String email) {
try {
return Response.success(stripeService.getSubscriptionIds(name, email));
} catch (StripeException e) {
throw new RuntimeException(e);
}
}
@ApiOperation("取消订阅")
@GetMapping("/cancelSubscription")
public Response<String> cancelSubscription(@RequestParam String subscriptionId, @RequestParam(required = false) String reason) {
stripeService.cancelSubscription(subscriptionId, reason);
return Response.success("success");
}
@ApiOperation("创建推广码")
@PostMapping("/createCoupon")
public Response<String> createCoupon(@Valid @RequestBody CreateCouponDTO createCouponDTO){
return Response.success(stripeService.createCoupon(createCouponDTO));
}
@ApiOperation("检查推广码")
@GetMapping("/checkCoupon")
public Response<CheckCouponsVO> checkCoupon(@RequestParam String promotionCode, @RequestParam Long price){
return Response.success(stripeService.checkProductCoupon(promotionCode, price));
}
@ApiOperation("获取所有推广码")
@PostMapping("/getAllCoupons")
public Response<IPage<ProductCoupons>> getAllCoupons(@RequestBody QueryCouponsPageDTO queryCouponsPageDTO){
return Response.success(stripeService.getAllCoupons(queryCouponsPageDTO));
}
@ApiOperation("检索优惠券")
@GetMapping("/retrieveCoupon")
public Response<String> retrieveCoupon(@RequestParam String couponId){
return Response.success(stripeService.retrieveCoupon(couponId));
}
@ApiOperation("检索推广码")
@GetMapping("/retrievePromotionCode")
public Response<String> retrievePromotionCode(@RequestParam String retrievePromotionCode){
return Response.success(stripeService.retrievePromotionCode(retrievePromotionCode));
}
@ApiOperation("更新推广码信息")
@GetMapping("/updatePromCodeInfo")
public Response<ProductCoupons> updateCouponsInfo(@RequestParam Long id, @RequestParam(required = false) String paidCommission,
@RequestParam(required = false) String cooperator,
@RequestParam(required = false) String remark,
@RequestParam(required = false) Long startTime){
return Response.success(stripeService.updateCouponsInfo(id, paidCommission, cooperator, remark, startTime));
}
@ApiOperation("删除推广码")
@GetMapping("/deletePromCode")
public Response<String> deleteCoupon(@RequestParam Long id){
stripeService.deleteCoupon(id);
return Response.success("success");
}
/*@ApiOperation("临时 取消订阅")
@GetMapping("/cancelSubscriptionTemp")
public Response<String> cancelSubscriptionTemp(@RequestParam String subscriptionId) {
stripeService.cancelSubscriptionTemp(subscriptionId);
return Response.success("success");
}
@ApiOperation("创建订阅 临时")
@GetMapping("/createSubscriptionTemp")
public Response<String> createSubscriptionTemp(@RequestParam String name, @RequestParam String email) {
return Response.success(stripeService.createSubscriptionTemp(name, email));
}
@ApiOperation("修改用户默认支付方式 临时")
@GetMapping("/changeCustomerPayment")
public Response<String> changeCustomerPayment(@RequestParam String name, @RequestParam String email) {
return Response.success(stripeService.changeCustomerPayment(name, email));
}
@ApiOperation("临时 发送续订失败邮件")
@GetMapping("/sendRenewalFailEmail")
public Response<Boolean> sendRenewalFailEmail(@RequestParam String invoiceId, @RequestParam String subscriptionId, @RequestParam String orderNo) {
return Response.success(stripeService.sendRenewalFailEmail(invoiceId, subscriptionId,orderNo));
}
@ApiOperation("临时 查询指定用户绑定的付款方式")
@GetMapping("/getCustomerPaymentMethod")
public Response<List<Map<String,String>>> getCustomerPaymentMethod(@RequestParam String name, @RequestParam String email) {
return Response.success(stripeService.getCustomerPaymentMethod(name, email));
}
@ApiOperation("临时 解绑指定用户绑定的所有付款方式")
@GetMapping("/detachCustomerAllPaymentMethod")
public Response<String> detachCustomerAllPaymentMethod(@RequestParam String name, @RequestParam String email) {
return Response.success(stripeService.detachCustomerAllPaymentMethod(name, email));
}*/
} }

View File

@@ -0,0 +1,31 @@
package com.ai.da.controller;
import com.ai.da.common.response.Response;
import com.ai.da.mapper.primary.entity.Product;
import com.ai.da.mapper.primary.entity.Tags;
import com.ai.da.service.ProductService;
import com.ai.da.service.TagsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
@CrossOrigin //开放前端的跨域访问
@Api(tags = "标签管理")
@RestController
@RequestMapping("/api/tags")
public class TagsController {
@Resource
private TagsService tagsService;
@ApiOperation("获取标签")
@GetMapping("/getTags")
public Response<List<Tags>> getTags(@RequestParam(value = "userInput", required = false) String userInput) {
return Response.success(tagsService.getTags(userInput));
}
}

View File

@@ -1,9 +1,13 @@
package com.ai.da.controller; package com.ai.da.controller;
import com.ai.da.common.response.Response; import com.ai.da.common.response.Response;
import com.ai.da.mapper.primary.entity.GoogleUser;
import com.ai.da.model.dto.*; import com.ai.da.model.dto.*;
import com.ai.da.model.vo.AccountLoginVO; import com.ai.da.model.vo.AccountLoginVO;
import com.ai.da.model.vo.DesignCollectionVO;
import com.ai.da.service.AccountService; import com.ai.da.service.AccountService;
import com.ai.da.service.DesignService;
import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@@ -14,6 +18,7 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import javax.validation.Valid; import javax.validation.Valid;
import java.security.cert.X509Certificate; import java.security.cert.X509Certificate;
@@ -27,6 +32,9 @@ public class ThirdPartyController {
@Resource @Resource
private AccountService accountService; private AccountService accountService;
@Resource
private DesignService designService;
/*@ApiOperation(value = "Add user information") /*@ApiOperation(value = "Add user information")
@PostMapping("/addUser") @PostMapping("/addUser")
public Response<Boolean> addUser(@Valid @RequestBody AccountAddDTO accountAddDTO) { public Response<Boolean> addUser(@Valid @RequestBody AccountAddDTO accountAddDTO) {
@@ -107,4 +115,35 @@ public class ThirdPartyController {
public Response<String> getRedirectUrl() { public Response<String> getRedirectUrl() {
return Response.success(REDIRECT_URL); return Response.success(REDIRECT_URL);
} }
@CrossOrigin
@ApiOperation(value = "updateNoLoginRequiredNew")
@PostMapping("/updateNoLoginRequiredNew")
public Response<String> updateNoLoginRequiredNew(@RequestBody NoLoginRequiredDTO noLoginRequiredDTO, HttpServletRequest request) {
return Response.success(accountService.updateNoLoginRequiredNew(noLoginRequiredDTO, request));
}
@CrossOrigin
@GetMapping("/auth/google_callback")
public Response<String> googleCallback(@RequestParam("code") String code, HttpSession session) {
return Response.success(accountService.googleCallback(code, session));
}
@CrossOrigin
@GetMapping("/parseGoogleCredential")
public Response<AccountLoginVO> parseGoogleCredential(@RequestParam("credential") String credential, @RequestParam("type") Integer type) {
return Response.success(accountService.parseGoogleCredential(credential, type));
}
@CrossOrigin
@GetMapping("/parseWeChatCode")
public Response<AccountLoginVO> parseWeChatCode(@RequestParam("code") String code, @RequestParam("type") Integer type) {
return Response.success(accountService.parseWeChatCode(code, type));
}
@ApiOperation(value = "接收Design结果")
@PostMapping("/receiveDesignResults")
@CrossOrigin
public Response<Boolean> receiveDesignResults(@Valid @RequestBody JSONObject responseObject) {
return Response.success(designService.receiveDesignResults(responseObject));
}
} }

View File

@@ -0,0 +1,18 @@
package com.ai.da.mapper.primary;
import com.ai.da.common.config.mybatis.plus.CommonMapper;
import com.ai.da.mapper.primary.entity.AccountExtend;
import java.util.Date;
import java.util.List;
/**
* Mapper 接口
*
* @author easy-generator
* @since 2022-06-13
*/
public interface AccountExtendMapper extends CommonMapper<AccountExtend> {
}

View File

@@ -3,6 +3,7 @@ package com.ai.da.mapper.primary;
import com.ai.da.common.config.mybatis.plus.CommonMapper; import com.ai.da.common.config.mybatis.plus.CommonMapper;
import com.ai.da.mapper.primary.entity.Account; import com.ai.da.mapper.primary.entity.Account;
import java.util.Date;
import java.util.List; import java.util.List;
/** /**
@@ -29,4 +30,6 @@ public interface AccountMapper extends CommonMapper<Account> {
*/ */
// Account findById(String id); // Account findById(String id);
void toVisitor(Long id);
} }

View File

@@ -0,0 +1,14 @@
package com.ai.da.mapper.primary;
import com.ai.da.mapper.primary.entity.AffiliateIncome;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import java.util.List;
import java.util.Map;
public interface AffiliateIncomeMapper extends BaseMapper<AffiliateIncome> {
List<Map<String, Object>> getPersonalMonthlyIncome(Long affiliateAccountId, int year);
List<Map<String, Object>> getMonthlyAffiliateIncome(int year, int month);
}

View File

@@ -0,0 +1,19 @@
package com.ai.da.mapper.primary;
import com.ai.da.mapper.primary.entity.Affiliate;
import com.ai.da.model.vo.AffiliateVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import java.util.List;
import java.util.Map;
public interface AffiliateMapper extends BaseMapper<Affiliate> {
Map<String, Long> getMonthlyApprovedAffiliate(int year, int month);
List<AffiliateVO> getAffiliateList(String status, String startTime, String endTime,
String order, Long affiliateId, int size, int offset);
int queryAffiliateTotalCount(String status, String startTime, String endTime, Long affiliateId);
}

View File

@@ -0,0 +1,16 @@
package com.ai.da.mapper.primary;
import com.ai.da.common.config.mybatis.plus.CommonMapper;
import com.ai.da.mapper.primary.entity.AccountExtend;
import com.ai.da.mapper.primary.entity.DesignBatch;
/**
* Mapper 接口
*
* @author easy-generator
* @since 2022-06-13
*/
public interface DesignBatchMapper extends CommonMapper<DesignBatch> {
}

View File

@@ -18,5 +18,5 @@ public interface DesignMapper extends CommonMapper<Design> {
//返回插入数据后生成的主键 //返回插入数据后生成的主键
Long insertDesign(Design design); Long insertDesign(Design design);
List<UserDesignStatisticDTO> getDesignStatistic(String startTime, String endTime); List<UserDesignStatisticDTO> getDesignStatistic(String startTime, String endTime, List<Long> ids, String email);
} }

View File

@@ -3,5 +3,10 @@ package com.ai.da.mapper.primary;
import com.ai.da.common.config.mybatis.plus.CommonMapper; import com.ai.da.common.config.mybatis.plus.CommonMapper;
import com.ai.da.mapper.primary.entity.Generate; import com.ai.da.mapper.primary.entity.Generate;
import java.util.List;
import java.util.Map;
public interface GenerateMapper extends CommonMapper<Generate> { public interface GenerateMapper extends CommonMapper<Generate> {
List<Map<String, Object>> getByTypeAndTime(String startTime, String endTime, List<Long> accountIdList);
} }

View File

@@ -0,0 +1,7 @@
package com.ai.da.mapper.primary;
import com.ai.da.common.config.mybatis.plus.CommonMapper;
import com.ai.da.mapper.primary.entity.MoodboardPosition;
public interface MoodboardPositionMapper extends CommonMapper<MoodboardPosition> {
}

View File

@@ -0,0 +1,24 @@
package com.ai.da.mapper.primary;
import com.ai.da.common.config.mybatis.plus.CommonMapper;
import com.ai.da.mapper.primary.entity.Notification;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;
public interface NotificationMapper extends CommonMapper<Notification> {
List<Map<String, Object>> getTypeCount(Long receiverId);
/** 解决mybatis-plus自动过滤 is_deleted为1的数据 问题 */
Notification getUniqueLikeAndFollow(String type, Long senderId, Long receiverId, Long portfolioId);
void updateUniqueLikeAndFollow(Long id, LocalDateTime time);
void deleteNotification(Long id, LocalDateTime time);
void setPersonalNotificationAllRead(String type, Long receiverId, LocalDateTime time);
List<Long> getUnreadSysNotification(Long accountId);
}

View File

@@ -1,7 +1,39 @@
package com.ai.da.mapper.primary; package com.ai.da.mapper.primary;
import com.ai.da.mapper.primary.entity.PaymentInfo; import com.ai.da.mapper.primary.entity.PaymentInfo;
import com.ai.da.model.vo.OrderListVO;
import com.ai.da.model.vo.PaymentInfoVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
public interface PaymentInfoMapper extends BaseMapper<PaymentInfo> { public interface PaymentInfoMapper extends BaseMapper<PaymentInfo> {
List<OrderListVO> selectPageOrderList(Long accountId, String startTime, String endTime, int offset, int pageSize, Long id);
int queryOrderListTotalCount(Long accountId, String startTime, String endTime, Long id);
List<PaymentInfoVO> queryPaymentInfo(String paymentType,String payerTotal, String type, String status,
String country, String city, String startTime, String endTime,
int limit, int offset, String order, String payer
);
Long queryPaymentInfoCount(String paymentType,String payerTotal, String type, String status,
String country, String city, String startTime, String endTime, String payer
);
BigDecimal queryTotalPaymentAmount(String paymentType,String payerTotal, String type, String status,
String country, String city, String startTime, String endTime, String payer
);
List<Map<String, String>> getCities();
List<Map<String, String>> getCountries();
int insertIgnore(@Param("paymentInfo")PaymentInfo paymentInfo);
List<PaymentInfo> selectPaidPaymentsByAccountAndPromotion(Long accountId, String promotionCode);
} }

View File

@@ -3,6 +3,10 @@ package com.ai.da.mapper.primary;
import com.ai.da.common.config.mybatis.plus.CommonMapper; import com.ai.da.common.config.mybatis.plus.CommonMapper;
import com.ai.da.mapper.primary.entity.Portfolio; import com.ai.da.mapper.primary.entity.Portfolio;
import java.util.List;
public interface PortfolioMapper extends CommonMapper<Portfolio> { public interface PortfolioMapper extends CommonMapper<Portfolio> {
Portfolio getByIdAll(Long originalPortfolioId); Portfolio getByIdAll(Long originalPortfolioId);
List<Portfolio> getByTag(Long accountId, String tagName);
} }

View File

@@ -0,0 +1,15 @@
package com.ai.da.mapper.primary;
import com.ai.da.common.config.mybatis.plus.CommonMapper;
import com.ai.da.mapper.primary.entity.PortfolioTags;
import java.time.LocalDateTime;
public interface PortfolioTagsMapper extends CommonMapper<PortfolioTags> {
void deleteByPortfolioId(Long portfolioId);
// portfolioId与tagId建立唯一约束 如果组合 portfolio_id 和 tag_id 已经存在,插入操作会被忽略。
void insertIgnore(Long portfolioId, Long tagId, LocalDateTime time);
}

View File

@@ -0,0 +1,8 @@
package com.ai.da.mapper.primary;
import com.ai.da.common.config.mybatis.plus.CommonMapper;
import com.ai.da.mapper.primary.entity.ProductCoupons;
public interface ProductCouponsMapper extends CommonMapper<ProductCoupons> {
}

View File

@@ -0,0 +1,7 @@
package com.ai.da.mapper.primary;
import com.ai.da.common.config.mybatis.plus.CommonMapper;
import com.ai.da.mapper.primary.entity.ProductImageAttribute;
public interface ProductImageAttributeMapper extends CommonMapper<ProductImageAttribute> {
}

View File

@@ -0,0 +1,9 @@
package com.ai.da.mapper.primary;
import com.ai.da.mapper.primary.entity.SubscriptionInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
public interface SubscriptionInfoMapper extends BaseMapper<SubscriptionInfo> {
int insertIgnore(@Param("subscriptionInfo") SubscriptionInfo subscriptionInfo);
}

View File

@@ -0,0 +1,7 @@
package com.ai.da.mapper.primary;
import com.ai.da.common.config.mybatis.plus.CommonMapper;
import com.ai.da.mapper.primary.entity.SysNotificationReadStatus;
public interface SysNotificationReadStatusMapper extends CommonMapper<SysNotificationReadStatus> {
}

View File

@@ -4,6 +4,8 @@ import com.ai.da.common.config.mybatis.plus.CommonMapper;
import com.ai.da.mapper.primary.entity.TDesignPythonOutfitDetail; import com.ai.da.mapper.primary.entity.TDesignPythonOutfitDetail;
import com.ai.da.model.vo.TDesignPythonOutfitDetailVO; import com.ai.da.model.vo.TDesignPythonOutfitDetailVO;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import io.lettuce.core.dynamic.annotation.Param;
import org.apache.ibatis.annotations.Delete;
import java.util.List; import java.util.List;
@@ -24,4 +26,7 @@ public interface TDesignPythonOutfitDetailMapper extends CommonMapper<TDesignPyt
*/ */
List<TDesignPythonOutfitDetailVO> selectTDesignPythonOutfitDetailPage(IPage page, TDesignPythonOutfitDetailVO tDesignPythonOutfitDetail); List<TDesignPythonOutfitDetailVO> selectTDesignPythonOutfitDetailPage(IPage page, TDesignPythonOutfitDetailVO tDesignPythonOutfitDetail);
@Delete("DELETE FROM t_design_python_outfit_detail WHERE design_python_outfit_id = #{designPythonOutfitId}")
void deleteByDesignPythonOutfitIdPhysical(@Param("designPythonOutfitId") Long designPythonOutfitId);
} }

View File

@@ -0,0 +1,17 @@
package com.ai.da.mapper.primary;
import com.ai.da.common.config.mybatis.plus.CommonMapper;
import com.ai.da.mapper.primary.entity.Tags;
import com.ai.da.model.dto.TagsDTO;
import java.util.List;
import java.util.Map;
public interface TagsMapper extends CommonMapper<Tags> {
List<Map<String, String>> getMatchingTags(String userInput);
List<TagsDTO> getTagByPortfolioId(Long portfolioId);
}

View File

@@ -3,5 +3,10 @@ package com.ai.da.mapper.primary;
import com.ai.da.common.config.mybatis.plus.CommonMapper; import com.ai.da.common.config.mybatis.plus.CommonMapper;
import com.ai.da.mapper.primary.entity.ToProductImageResult; import com.ai.da.mapper.primary.entity.ToProductImageResult;
import java.util.List;
import java.util.Map;
public interface ToProductImageResultMapper extends CommonMapper<ToProductImageResult> { public interface ToProductImageResultMapper extends CommonMapper<ToProductImageResult> {
List<Map<String, Object>> getByTypeAndTime(String startTime, String endTime, List<Long> accountIdList);
} }

View File

@@ -3,6 +3,9 @@ package com.ai.da.mapper.primary;
import com.ai.da.common.config.mybatis.plus.CommonMapper; import com.ai.da.common.config.mybatis.plus.CommonMapper;
import com.ai.da.mapper.primary.entity.TrialOrder; import com.ai.da.mapper.primary.entity.TrialOrder;
import java.util.List;
import java.util.Map;
/** /**
* Mapper 接口 * Mapper 接口
* *
@@ -11,6 +14,6 @@ import com.ai.da.mapper.primary.entity.TrialOrder;
*/ */
public interface TrialOrderMapper extends CommonMapper<TrialOrder> { public interface TrialOrderMapper extends CommonMapper<TrialOrder> {
Map<String, Long> countOfficialUser();
} }

View File

@@ -0,0 +1,19 @@
package com.ai.da.mapper.primary;
import com.ai.da.common.config.mybatis.plus.CommonMapper;
import com.ai.da.mapper.primary.entity.UserFollow;
import com.ai.da.model.vo.AccountFollowVO;
import java.util.List;
public interface UserFollowMapper extends CommonMapper<UserFollow> {
List<AccountFollowVO> getFolloweeListByFollower(Long followerAccountId, Integer limit, Integer offset, String order);
List<AccountFollowVO> getFollowerListByFollowee(Long followeeAccountId, Integer limit, Integer offset, String order);
List<AccountFollowVO> getFolloweeListByName(String name, Long followerId);
List<AccountFollowVO> getFollowerListByName(String name, Long followeeId);
}

View File

@@ -3,6 +3,9 @@ package com.ai.da.mapper.primary;
import com.ai.da.common.config.mybatis.plus.CommonMapper; import com.ai.da.common.config.mybatis.plus.CommonMapper;
import com.ai.da.mapper.primary.entity.UserLike; import com.ai.da.mapper.primary.entity.UserLike;
import java.util.List;
import java.util.Map;
/** /**
* Mapper 接口 * Mapper 接口
* *

View File

@@ -0,0 +1,7 @@
package com.ai.da.mapper.primary;
import com.ai.da.common.config.mybatis.plus.CommonMapper;
import com.ai.da.mapper.primary.entity.UserLikeSort;
public interface UserLikeSortMapper extends CommonMapper<UserLikeSort> {
}

View File

@@ -3,6 +3,8 @@ package com.ai.da.mapper.primary.entity;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
@@ -56,6 +58,11 @@ public class Account implements Serializable {
*/ */
private String country; private String country;
/**
* 职业
*/
private String occupation;
/** /**
* 账户有效期开始时间 * 账户有效期开始时间
*/ */
@@ -69,11 +76,13 @@ public class Account implements Serializable {
/** /**
* 创建时间 * 创建时间
*/ */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
private Date createDate; private Date createDate;
/** /**
* 更新时间 * 更新时间
*/ */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
private Date updateDate; private Date updateDate;
private Integer isTrial; private Integer isTrial;
@@ -93,6 +102,37 @@ public class Account implements Serializable {
* 1 年付用户 * 1 年付用户
* 2 月付用户 * 2 月付用户
* 3 试用用户 * 3 试用用户
* 4 参加活动获取30天有效期和6000个积分的用户
* 5 企业管理员账号
* 6 企业子账号
* 7 学校管理员
* 8 学校子账号
*/ */
private Integer systemUser; private Integer systemUser;
/**
* 头像
*/
private String avatar;
private String organizationName;
private Long parentId;
private Integer isAdmin;
private BigDecimal shareCredits;
private Integer subAccountNum;
private String invitationCode;
@ApiModelProperty("title")
private String title;
@ApiModelProperty("surname")
private String surname;
@ApiModelProperty("givenName")
private String givenName;
} }

View File

@@ -0,0 +1,35 @@
package com.ai.da.mapper.primary.entity;
import com.ai.da.common.response.PageResponse;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serializable;
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("account_extend")
public class AccountExtend implements Serializable {
private static final long serialVersionUID = 1L;
/**
* ID
*/
@TableId(value = "id", type = IdType.AUTO)
private Long id;
private Long accountId;
private String authType;
private String headImgUrl;
private String name;
private String auth;
}

View File

@@ -0,0 +1,32 @@
package com.ai.da.mapper.primary.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
@EqualsAndHashCode(callSuper = true)
@Data
@TableName("t_affiliate")
public class Affiliate extends BaseEntity{
private Long accountId;
// Active活跃 || Inactive过期 || Pending待审批 || Refused(拒绝)
private String status;
private Float commissionPercent;
private Float totalEarnings = 0.00F;
private Float monthlyEarnings = 0.00F;
private Float unpaidEarnings = 0.00F;
private Integer visits = 0;
private Boolean approved = false;
private String link;
private String promotionMethod;
}

View File

@@ -0,0 +1,28 @@
package com.ai.da.mapper.primary.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.time.LocalDateTime;
@EqualsAndHashCode(callSuper = true)
@Data
@TableName("t_affiliate_income")
public class AffiliateIncome extends BaseEntity {
private Long affiliateId;
private Long affiliateAccountId;
private Long inviteeAccountId;
private Float amount;
private Long paymentInfoId;
private LocalDateTime paymentTime;
private Float commission;
}

View File

@@ -40,6 +40,8 @@ public class Collection implements Serializable {
*/ */
private String moodTemplateId; private String moodTemplateId;
private String moodboardPosition;
/** /**
* 创建时间 * 创建时间
*/ */

View File

@@ -0,0 +1,44 @@
package com.ai.da.mapper.primary.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.models.auth.In;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.time.LocalDateTime;
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("design_batch")
public class DesignBatch implements Serializable {
private static final long serialVersionUID = 1L;
/**
* ID
*/
@TableId(value = "id", type = IdType.AUTO)
private Long id;
private Long accountId; // account_id
private Long designId; // design_id
private Long collectionId; // collection_id
private Integer status; // status
private LocalDateTime createTime; // create_time
private LocalDateTime updateTime; // update_time
private String taskId; // task_id
private Integer totalNum; // total_num
private Integer completedNum; // completed_num
}

View File

@@ -41,7 +41,7 @@ public class DesignItemDetailPrint {
/** /**
* 印花缩放比例 * 印花缩放比例
*/ */
private Double scale; private String scale;
/** /**
* 印花旋转角度 * 印花旋转角度
*/ */

View File

@@ -72,6 +72,19 @@ public class Generate {
*/ */
private String seed; private String seed;
/**
* 1 -> 粗
* 2 -> 中
* 3 -> 细
* custom -> 自定义
*/
private String sketchStyle;
/**
* sketch 风格参考图的collection_element_id
*/
private Long styleImageElementId;
/** /**
* 创建时间 * 创建时间
*/ */

View File

@@ -0,0 +1,14 @@
package com.ai.da.mapper.primary.entity;
import lombok.Data;
@Data
public class GoogleUser {
private String sub; // 用户唯一标识
private String email;
private String name;
private String picture;
private boolean emailVerified;
private String givenName;
private String familyName;
}

View File

@@ -80,4 +80,18 @@ public class Library implements Serializable {
private Date updateDate; private Date updateDate;
// private Integer isCopy; // private Integer isCopy;
public Library() {
}
public Library(Long accountId, String level1Type, String level2Type, String level3Type, String url, String md5, Date createDate) {
this.accountId = accountId;
this.level1Type = level1Type;
this.level2Type = level2Type;
this.level3Type = level3Type;
this.url = url;
this.md5 = md5;
this.createDate = createDate;
}
} }

View File

@@ -0,0 +1,29 @@
package com.ai.da.mapper.primary.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.time.LocalDateTime;
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("moodboard_position")
public class MoodboardPosition implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Long id;
private Long moodboardId;
private Long collectionId;
private String type;
private String styleData;
private Integer sequence;
private LocalDateTime createTime;
private LocalDateTime updateTime;
}

View File

@@ -0,0 +1,73 @@
package com.ai.da.mapper.primary.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
@EqualsAndHashCode(callSuper = true)
@TableName("t_notification")
@Data
public class Notification extends BaseEntity{
/**
* 操作类型 system/like/comment/follow
*/
private String type;
/**
* 发起操作者用户id
*/
private Long senderId;
/**
* 被操作对象用户id
*/
private Long receiverId;
/**
* 点赞评论时的作品id
*/
private Long portfolioId;
/**
* 消息内容
*/
private String content;
/**
* 评论id
*/
private Long commentId;
/**
* 个人消息已读状态
*/
private Integer isRead;
/**
* 系统消息发布状态
*/
private Integer publishFlag;
/**
* 是否被删除
*/
private Integer isDeleted;
public Notification() {
}
public Notification(String type, Long senderId, Long receiverId) {
this.type = type;
this.senderId = senderId;
this.receiverId = receiverId;
}
public Notification(String type, Long senderId, Long receiverId, Long portfolioId) {
this.type = type;
this.senderId = senderId;
this.receiverId = receiverId;
this.portfolioId = portfolioId;
}
public Notification(String type, Long senderId, Long receiverId, Long portfolioId, String content, Long commentId) {
this.type = type;
this.senderId = senderId;
this.receiverId = receiverId;
this.portfolioId = portfolioId;
this.content = content;
this.commentId = commentId;
}
}

View File

@@ -21,5 +21,20 @@ public class OrderInfo extends BaseEntity{
private String orderStatus;//订单状态 private String orderStatus;//订单状态
private String note;
private byte autoRenewal;
private String paymentType;//支付方式 private String paymentType;//支付方式
// 可用于标记用户订单是否首次订阅
private byte isFirstSubscription = 0;
private byte isCommissionCalculated = 0;
private String ipAddress;
private String country;
private String city;
} }

View File

@@ -2,7 +2,9 @@ package com.ai.da.mapper.primary.entity;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode;
@EqualsAndHashCode(callSuper = true)
@Data @Data
@TableName("t_payment_info") @TableName("t_payment_info")
public class PaymentInfo extends BaseEntity{ public class PaymentInfo extends BaseEntity{
@@ -13,11 +15,38 @@ public class PaymentInfo extends BaseEntity{
private String paymentType;//支付类型 private String paymentType;//支付类型
private String tradeType;//交易类型 /**
* PayPal 订单状态CREATED/SAVED/APPROVED/VOIDED/COMPLETED/PAYER_ACTION_REQUIRED
* Stripe 订单状态: 原 session 状态open/completed/expired ; 现 invoice 状态draft/open/paid/uncollectible/void
* Alipay-HK 订单状态wait, paid, expired, liquidated
* paid and liquidated means the refund request has been executed.
* expired means the request has been rejected.
* wait means the request is still under processing.
*/
private String tradeState;//交易状态 private String tradeState;//交易状态
private Float payerTotal;//支付金额(元) private Float payerTotal;//支付金额(元)
private String content;//通知参数 private String content;//通知参数
// 支付类型 new || renewal || credits
private String type;
// 当前支付是否已邮件通知 0 || 1
private Integer notified;
private String paymentMethod;
private String last4;
// 发票托管页面
private String hostedInvoiceUrl;
private String ipAddress;
private String country;
private String city;
private String promotionCode;
} }

View File

@@ -0,0 +1,14 @@
package com.ai.da.mapper.primary.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
@EqualsAndHashCode(callSuper = true)
@TableName("t_portfolio_tags")
@Data
public class PortfolioTags extends BaseEntity{
private Long portfolioId;
private Long tagId;
}

View File

@@ -0,0 +1,60 @@
package com.ai.da.mapper.primary.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import java.math.BigDecimal;
@EqualsAndHashCode(callSuper = true)
@Data
@TableName("t_product_coupons")
@NoArgsConstructor
public class ProductCoupons extends BaseEntity{
// 优惠券id
private String couponId;
// 优惠券有效期的截止日期
private Long redeemBy;
// 绑定的推广码id
private String promotionCodeId;
// 对应的推广码
private String promotionCode;
// 优惠券有效期开始时间
private Long startTime;
// 最大兑换次数
private Long maxRedemptions;
// 优惠券的折扣
private float percentOff;
// 佣金比例
private float commissionRate;
// 合作者
private String cooperator;
// 使用了该优惠券支付的总金额
private BigDecimal totalEarnings = BigDecimal.ZERO;
// 佣金
private BigDecimal commission = BigDecimal.ZERO;
// 已付佣金
private BigDecimal paidCommission = BigDecimal.ZERO;
// 未付佣金
private BigDecimal unpaidCommission = BigDecimal.ZERO;
// 备注
private String remark;
@TableLogic
private Integer isDeleted;
public ProductCoupons(String couponId, Long redeemBy, String promotionCodeId, String promotionCode, Long maxRedemptions, float percentOff, float commissionRate, String cooperator, String remark) {
this.couponId = couponId;
this.redeemBy = redeemBy;
this.promotionCodeId = promotionCodeId;
this.promotionCode = promotionCode;
this.maxRedemptions = maxRedemptions;
this.percentOff = percentOff;
this.cooperator = cooperator;
this.remark = remark;
this.commissionRate = commissionRate;
}
}

View File

@@ -0,0 +1,35 @@
package com.ai.da.mapper.primary.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serializable;
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("product_image_attribute")
public class ProductImageAttribute implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Long id;
private String imgName;
private String length;
private String sleeveLength;
private String sleeveShape;
private String sleeveShoulder;
private String neckline;
private String collar;
private String design;
private String silhouette;
private String type;
private String openingType;
private String subtype;
private String style;
}

View File

@@ -0,0 +1,39 @@
package com.ai.da.mapper.primary.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
@EqualsAndHashCode(callSuper = true)
@Data
@TableName("t_subscription_info")
public class SubscriptionInfo extends BaseEntity{
private Long accountId;
private String orderNo;
// stripe || paypal 平台生成的id
private String subscriptionId;
// month || year
private String type;
// active || canceled
private String status = "active";
private byte cancelNotified = (byte)0;
// 续订的下一个付款日
private String nextPayDate;
// 当前订阅订单有效期开始时间
private Long currentPeriodStart;
// 当前订阅订单有效期结束时间
private Long currentPeriodEnd;
// 取消订阅原因
private String cancelReason;
}

View File

@@ -0,0 +1,26 @@
package com.ai.da.mapper.primary.entity;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
@EqualsAndHashCode(callSuper = true)
@TableName("t_sys_notification_read_status")
@Data
@NoArgsConstructor
@AllArgsConstructor
public class SysNotificationReadStatus extends BaseEntity{
/**
* 系统消息id
*/
private Long system_notification_id;
/**
* 已读当前消息的用户id将被存储
*/
private Long account_id;
}

View File

@@ -0,0 +1,16 @@
package com.ai.da.mapper.primary.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
@EqualsAndHashCode(callSuper = true)
@TableName("t_tags")
@Data
public class Tags extends BaseEntity{
private String tagName;
// 表示标签是否正在活动中 0->不在活动中 1->在活动中
private byte active = (byte)0;
}

View File

@@ -6,6 +6,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime; import java.time.LocalDateTime;
@Data @Data
@@ -42,4 +43,10 @@ public class ToProductImageResult implements Serializable {
@ApiModelProperty(value = "generate 结果类型") @ApiModelProperty(value = "generate 结果类型")
private String resultType; private String resultType;
private Double brightenValue;
private BigDecimal imageStrength;
private String direction;
} }

View File

@@ -3,6 +3,7 @@ package com.ai.da.mapper.primary.entity;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
@@ -49,11 +50,13 @@ public class TrialOrder implements Serializable {
/** /**
* 创建时间 * 创建时间
*/ */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
private LocalDateTime createTime; private LocalDateTime createTime;
/** /**
* 更新时间 * 更新时间
*/ */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
private LocalDateTime updateTime; private LocalDateTime updateTime;

View File

@@ -0,0 +1,26 @@
package com.ai.da.mapper.primary.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
@EqualsAndHashCode(callSuper = true)
@TableName("t_user_follow")
@Data
@AllArgsConstructor
@NoArgsConstructor
public class UserFollow extends BaseEntity{
/**
* 被关注者用户id
*/
private Long followeeId;
/**
* 关注者用户id
*/
private Long followerId;
}

View File

@@ -59,4 +59,9 @@ public class UserLike implements Serializable {
* 更新时间 * 更新时间
*/ */
private Date updateDate; private Date updateDate;
/**
* design对应的mask是否已替换为最新的
*/
private Integer converted;
} }

View File

@@ -0,0 +1,24 @@
package com.ai.da.mapper.primary.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.Date;
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("user_like_sort")
public class UserLikeSort implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Long id;
private Long userLikeGroupId;
private Long userLikeId;
private Integer sort;
}

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