Compare commits
10
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8af444b7ee | ||
|
|
bdcd3b2bf0 | ||
|
|
544ddeec5a | ||
|
|
2f070e6b44 | ||
|
|
de01a39848 | ||
|
|
03991319fd | ||
|
|
a8c7a4061e | ||
|
|
0d2ed2aba5 | ||
|
|
906512f294 | ||
|
|
a7f699a8b4 |
@@ -0,0 +1,272 @@
|
|||||||
|
# V10 团课预约业务场景测试数据
|
||||||
|
|
||||||
|
## 概述
|
||||||
|
|
||||||
|
本文档描述了 V10 版本新增的团课预约功能测试数据,覆盖了7种典型的预约业务场景,用于验证系统在不同会员卡状态下的正确处理逻辑。
|
||||||
|
|
||||||
|
**当前日期**: 2026-06-02
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 一、测试场景总览
|
||||||
|
|
||||||
|
| 场景 | 会员 | 会员卡状态 | 预约课程 | 预期结果 |
|
||||||
|
|-----|------|----------|---------|---------|
|
||||||
|
| 1 | 用户A | 无会员卡 | 次数卡团课 | 提示无可用会员卡 |
|
||||||
|
| 2 | 用户B | 时长卡已过期 | 次数卡团课 | 提示会员卡已过期 |
|
||||||
|
| 3 | 会员C | 时长卡有效 | 次数卡团课 | 预约成功 |
|
||||||
|
| 4 | 会员D | 次数卡次数=0 | 次数卡团课 | 提示剩余次数不足 |
|
||||||
|
| 5 | 会员E | 次数卡次数=5 | 次数卡团课 | 预约成功 |
|
||||||
|
| 6 | 会员F | 储值卡余额=30元 | 储值卡团课(需50元) | 提示余额不足 |
|
||||||
|
| 7 | 会员G | 储值卡余额=200元 | 储值卡团课(需50元) | 预约成功 |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 二、测试会员数据
|
||||||
|
|
||||||
|
### 2.1 会员列表
|
||||||
|
|
||||||
|
| 会员编号 | 昵称 | 手机号 | 性别 | 创建时间 |
|
||||||
|
|---------|------|--------|------|---------|
|
||||||
|
| MEM_TEST_A | 用户A_无卡新用户 | 13800001001 | 男 | 2026-06-02 10:00:00 |
|
||||||
|
| MEM_TEST_B | 用户B_过期时长卡 | 13800001002 | 男 | 2026-05-01 10:00:00 |
|
||||||
|
| MEM_TEST_C | 会员C_有效时长卡 | 13800001003 | 女 | 2026-05-01 10:00:00 |
|
||||||
|
| MEM_TEST_D | 会员D_次数用尽 | 13800001004 | 男 | 2026-05-01 10:00:00 |
|
||||||
|
| MEM_TEST_E | 会员E_次数充足 | 13800001005 | 女 | 2026-05-01 10:00:00 |
|
||||||
|
| MEM_TEST_F | 会员F_储值卡余额不足 | 13800001006 | 男 | 2026-05-01 10:00:00 |
|
||||||
|
| MEM_TEST_G | 会员G_储值卡余额充足 | 13800001007 | 女 | 2026-05-01 10:00:00 |
|
||||||
|
|
||||||
|
### 2.2 会员场景说明
|
||||||
|
|
||||||
|
#### 场景1: 用户A - 无会员卡新用户
|
||||||
|
- **会员编号**: MEM_TEST_A
|
||||||
|
- **状态**: 2026-06-02 刚注册,尚未购买任何会员卡
|
||||||
|
- **测试目标**: 验证无会员卡用户申请团课预约时的错误提示
|
||||||
|
|
||||||
|
#### 场景2: 用户B - 时长卡已过期
|
||||||
|
- **会员编号**: MEM_TEST_B
|
||||||
|
- **状态**: 持有30天时长卡,于 2026-05-31 23:59:59 到期
|
||||||
|
- **测试目标**: 验证会员卡过期后的预约行为
|
||||||
|
|
||||||
|
#### 场景3: 会员C - 时长卡有效
|
||||||
|
- **会员编号**: MEM_TEST_C
|
||||||
|
- **状态**: 持有30天时长卡,到期时间 2026-07-02
|
||||||
|
- **测试目标**: 验证有效期内的时长卡可以正常预约次数卡团课
|
||||||
|
|
||||||
|
#### 场景4: 会员D - 次数卡耗尽
|
||||||
|
- **会员编号**: MEM_TEST_D
|
||||||
|
- **状态**: 持有10次卡,剩余次数 = 0
|
||||||
|
- **测试目标**: 验证次数耗尽后无法预约团课
|
||||||
|
|
||||||
|
#### 场景5: 会员E - 次数卡充足
|
||||||
|
- **会员编号**: MEM_TEST_E
|
||||||
|
- **状态**: 持有10次卡,剩余次数 = 5
|
||||||
|
- **测试目标**: 验证次数充足时正常预约
|
||||||
|
|
||||||
|
#### 场景6: 会员F - 储值卡余额不足
|
||||||
|
- **会员编号**: MEM_TEST_F
|
||||||
|
- **状态**: 持有储值卡,余额 = 30.00 元
|
||||||
|
- **测试目标**: 验证预约储值卡团课(需50元)时提示余额不足
|
||||||
|
|
||||||
|
#### 场景7: 会员G - 储值卡余额充足
|
||||||
|
- **会员编号**: MEM_TEST_G
|
||||||
|
- **状态**: 持有储值卡,余额 = 200.00 元
|
||||||
|
- **测试目标**: 验证余额充足时正常预约储值卡团课
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 三、团课课程数据
|
||||||
|
|
||||||
|
### 3.1 团课列表
|
||||||
|
|
||||||
|
| 课程名称 | 教练ID | 课程类型 | 开始时间 | 结束时间 | 最大人数 | 当前人数 | 状态 | 点卡额度 | 储值额度 |
|
||||||
|
|---------|-------|---------|---------|---------|---------|---------|------|---------|---------|
|
||||||
|
| 燃脂搏击_次数卡课程 | 102 | 2 | 2026-06-10 19:30:00 | 2026-06-10 20:30:00 | 20 | 0 | 正常 | 1 | 0.00 |
|
||||||
|
| 高端普拉提_储值卡课程 | 103 | 1 | 2026-06-11 19:00:00 | 2026-06-11 20:00:00 | 15 | 0 | 正常 | 0 | 50.00 |
|
||||||
|
|
||||||
|
### 3.2 课程说明
|
||||||
|
|
||||||
|
**燃脂搏击_次数卡课程**
|
||||||
|
- **收费类型**: 次数卡
|
||||||
|
- **消耗点数**: 1次
|
||||||
|
- **适用会员**: 时长卡、次数卡用户
|
||||||
|
- **课程描述**: 高强度间歇训练,配合音乐快速燃脂
|
||||||
|
|
||||||
|
**高端普拉提_储值卡课程**
|
||||||
|
- **收费类型**: 储值卡
|
||||||
|
- **消耗金额**: 50.00 元
|
||||||
|
- **适用会员**: 储值卡用户
|
||||||
|
- **课程描述**: 精准训练核心肌群
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 四、会员卡类型数据
|
||||||
|
|
||||||
|
| 卡名称 | 卡类型 | 价格 | 有效天数 | 总次数 | 面额 | 状态 |
|
||||||
|
|-------|-------|------|---------|-------|------|------|
|
||||||
|
| 30天时长卡 | TIME_CARD | 299.00 | 30 | - | - | 上架 |
|
||||||
|
| 10次卡 | COUNT_CARD | 499.00 | - | 10 | - | 上架 |
|
||||||
|
| 储值卡500 | STORED_VALUE_CARD | 500.00 | - | - | 500.00 | 上架 |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 五、会员卡记录数据
|
||||||
|
|
||||||
|
### 5.1 记录列表
|
||||||
|
|
||||||
|
| 会员编号 | 卡名称 | 状态 | 剩余次数 | 剩余金额 | 过期时间 | 购买时间 |
|
||||||
|
|---------|-------|------|---------|---------|---------|---------|
|
||||||
|
| MEM_TEST_B | 30天时长卡 | EXPIRED | 0 | 0.00 | 2026-05-31 | 2026-05-01 |
|
||||||
|
| MEM_TEST_C | 30天时长卡 | ACTIVE | 0 | 0.00 | 2026-07-02 | 2026-06-02 |
|
||||||
|
| MEM_TEST_D | 10次卡 | ACTIVE | 0 | 0.00 | 2026-12-31 | 2026-05-01 |
|
||||||
|
| MEM_TEST_E | 10次卡 | ACTIVE | 5 | 0.00 | 2026-12-31 | 2026-05-01 |
|
||||||
|
| MEM_TEST_F | 储值卡500 | ACTIVE | 0 | 30.00 | 2027-06-02 | 2026-05-01 |
|
||||||
|
| MEM_TEST_G | 储值卡500 | ACTIVE | 0 | 200.00 | 2027-06-02 | 2026-05-01 |
|
||||||
|
|
||||||
|
### 5.2 详细说明
|
||||||
|
|
||||||
|
**用户B - 时长卡已过期**
|
||||||
|
```
|
||||||
|
会员ID: MEM_TEST_B
|
||||||
|
卡名称: 30天时长卡
|
||||||
|
状态: EXPIRED (已过期)
|
||||||
|
有效期: 2026-05-01 至 2026-05-31
|
||||||
|
剩余次数: 0
|
||||||
|
剩余金额: 0.00
|
||||||
|
```
|
||||||
|
|
||||||
|
**会员C - 时长卡有效**
|
||||||
|
```
|
||||||
|
会员ID: MEM_TEST_C
|
||||||
|
卡名称: 30天时长卡
|
||||||
|
状态: ACTIVE (有效)
|
||||||
|
有效期: 2026-06-02 至 2026-07-02
|
||||||
|
剩余次数: 0
|
||||||
|
剩余金额: 0.00
|
||||||
|
```
|
||||||
|
|
||||||
|
**会员D - 次数卡耗尽**
|
||||||
|
```
|
||||||
|
会员ID: MEM_TEST_D
|
||||||
|
卡名称: 10次卡
|
||||||
|
状态: ACTIVE (有效)
|
||||||
|
有效期: 2026-05-01 至 2026-12-31
|
||||||
|
剩余次数: 0 (已用尽)
|
||||||
|
剩余金额: 0.00
|
||||||
|
```
|
||||||
|
|
||||||
|
**会员E - 次数卡充足**
|
||||||
|
```
|
||||||
|
会员ID: MEM_TEST_E
|
||||||
|
卡名称: 10次卡
|
||||||
|
状态: ACTIVE (有效)
|
||||||
|
有效期: 2026-05-01 至 2026-12-31
|
||||||
|
剩余次数: 5
|
||||||
|
剩余金额: 0.00
|
||||||
|
```
|
||||||
|
|
||||||
|
**会员F - 储值卡余额不足**
|
||||||
|
```
|
||||||
|
会员ID: MEM_TEST_F
|
||||||
|
卡名称: 储值卡500
|
||||||
|
状态: ACTIVE (有效)
|
||||||
|
有效期: 2026-05-01 至 2027-06-02
|
||||||
|
剩余次数: 0
|
||||||
|
剩余金额: 30.00 (不足50.00)
|
||||||
|
```
|
||||||
|
|
||||||
|
**会员G - 储值卡余额充足**
|
||||||
|
```
|
||||||
|
会员ID: MEM_TEST_G
|
||||||
|
卡名称: 储值卡500
|
||||||
|
状态: ACTIVE (有效)
|
||||||
|
有效期: 2026-05-01 至 2027-06-02
|
||||||
|
剩余次数: 0
|
||||||
|
剩余金额: 200.00 (充足)
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 六、SQL数据插入顺序
|
||||||
|
|
||||||
|
```sql
|
||||||
|
-- 1. 先插入会员用户 (A-G)
|
||||||
|
INSERT INTO member_user (member_no, nickname, phone, gender, is_deleted, created_at, updated_at) VALUES
|
||||||
|
('MEM_TEST_A', '用户A_无卡新用户', '13800001001', 1, false, '2026-06-02 10:00:00', '2026-06-02 10:00:00'),
|
||||||
|
('MEM_TEST_B', '用户B_过期时长卡', '13800001002', 1, false, '2026-05-01 10:00:00', '2026-05-01 10:00:00'),
|
||||||
|
('MEM_TEST_C', '会员C_有效时长卡', '13800001003', 2, false, '2026-05-01 10:00:00', '2026-05-01 10:00:00'),
|
||||||
|
('MEM_TEST_D', '会员D_次数用尽', '13800001004', 1, false, '2026-05-01 10:00:00', '2026-05-01 10:00:00'),
|
||||||
|
('MEM_TEST_E', '会员E_次数充足', '13800001005', 2, false, '2026-05-01 10:00:00', '2026-05-01 10:00:00'),
|
||||||
|
('MEM_TEST_F', '会员F_储值卡余额不足', '13800001006', 1, false, '2026-05-01 10:00:00', '2026-05-01 10:00:00'),
|
||||||
|
('MEM_TEST_G', '会员G_储值卡余额充足', '13800001007', 2, false, '2026-05-01 10:00:00', '2026-05-01 10:00:00');
|
||||||
|
|
||||||
|
-- 2. 插入团课课程
|
||||||
|
INSERT INTO group_course (course_name, coach_id, course_type, start_time, end_time, max_members, current_members, status, location, description, point_card_amount, stored_value_amount, create_by, created_at, updated_at) VALUES
|
||||||
|
('燃脂搏击_次数卡课程', 102, 2, '2026-06-10 19:30:00', '2026-06-10 20:30:00', 20, 0, '0', '综合训练区', '高强度间歇训练,配合音乐快速燃脂,消耗1次', 1, 0.00, 'admin', '2026-06-01 10:00:00', '2026-06-01 10:00:00');
|
||||||
|
|
||||||
|
INSERT INTO group_course (course_name, coach_id, course_type, start_time, end_time, max_members, current_members, status, location, description, point_card_amount, stored_value_amount, create_by, created_at, updated_at) VALUES
|
||||||
|
('高端普拉提_储值卡课程', 103, 1, '2026-06-11 19:00:00', '2026-06-11 20:00:00', 15, 0, '0', '普拉提教室', '精准训练核心肌群,消耗储值50元', 0, 50.00, 'admin', '2026-06-01 10:00:00', '2026-06-01 10:00:00');
|
||||||
|
|
||||||
|
-- 3. 插入会员卡类型
|
||||||
|
INSERT INTO member_card (member_card_name, member_card_type, member_card_price, member_card_validity_days, member_card_total_times, member_card_amount, member_card_status, extra_config, created_at, updated_at) VALUES
|
||||||
|
('30天时长卡', 'TIME_CARD', 299.00, 30, NULL, NULL, 1, '{}', '2026-01-01 00:00:00', '2026-01-01 00:00:00'),
|
||||||
|
('10次卡', 'COUNT_CARD', 499.00, NULL, 10, NULL, 1, '{}', '2026-01-01 00:00:00', '2026-01-01 00:00:00'),
|
||||||
|
('储值卡500', 'STORED_VALUE_CARD', 500.00, NULL, NULL, 500.00, 1, '{}', '2026-01-01 00:00:00', '2026-01-01 00:00:00');
|
||||||
|
|
||||||
|
-- 4. 插入会员卡记录
|
||||||
|
INSERT INTO member_card_record (member_id, member_card_id, status, remaining_times, remaining_amount, expire_time, purchase_time, version, card_composition, created_at, updated_at) VALUES
|
||||||
|
((SELECT id FROM member_user WHERE member_no = 'MEM_TEST_B'), (SELECT member_card_id FROM member_card WHERE member_card_name = '30天时长卡'), 'EXPIRED', 0, 0.00, '2026-05-31 23:59:59', '2026-05-01 10:00:00', 0, '{}', '2026-05-01 10:00:00', '2026-06-02 10:00:00');
|
||||||
|
|
||||||
|
INSERT INTO member_card_record (member_id, member_card_id, status, remaining_times, remaining_amount, expire_time, purchase_time, version, card_composition, created_at, updated_at) VALUES
|
||||||
|
((SELECT id FROM member_user WHERE member_no = 'MEM_TEST_C'), (SELECT member_card_id FROM member_card WHERE member_card_name = '30天时长卡'), 'ACTIVE', 0, 0.00, '2026-07-02 23:59:59', '2026-06-02 10:00:00', 0, '{}', '2026-06-02 10:00:00', '2026-06-02 10:00:00');
|
||||||
|
|
||||||
|
INSERT INTO member_card_record (member_id, member_card_id, status, remaining_times, remaining_amount, expire_time, purchase_time, version, card_composition, created_at, updated_at) VALUES
|
||||||
|
((SELECT id FROM member_user WHERE member_no = 'MEM_TEST_D'), (SELECT member_card_id FROM member_card WHERE member_card_name = '10次卡'), 'ACTIVE', 0, 0.00, '2026-12-31 23:59:59', '2026-05-01 10:00:00', 0, '{}', '2026-05-01 10:00:00', '2026-06-02 10:00:00');
|
||||||
|
|
||||||
|
INSERT INTO member_card_record (member_id, member_card_id, status, remaining_times, remaining_amount, expire_time, purchase_time, version, card_composition, created_at, updated_at) VALUES
|
||||||
|
((SELECT id FROM member_user WHERE member_no = 'MEM_TEST_E'), (SELECT member_card_id FROM member_card WHERE member_card_name = '10次卡'), 'ACTIVE', 5, 0.00, '2026-12-31 23:59:59', '2026-05-01 10:00:00', 0, '{}', '2026-05-01 10:00:00', '2026-06-02 10:00:00');
|
||||||
|
|
||||||
|
INSERT INTO member_card_record (member_id, member_card_id, status, remaining_times, remaining_amount, expire_time, purchase_time, version, card_composition, created_at, updated_at) VALUES
|
||||||
|
((SELECT id FROM member_user WHERE member_no = 'MEM_TEST_F'), (SELECT member_card_id FROM member_card WHERE member_card_name = '储值卡500'), 'ACTIVE', 0, 30.00, '2027-06-02 23:59:59', '2026-05-01 10:00:00', 0, '{}', '2026-05-01 10:00:00', '2026-06-02 10:00:00');
|
||||||
|
|
||||||
|
INSERT INTO member_card_record (member_id, member_card_id, status, remaining_times, remaining_amount, expire_time, purchase_time, version, card_composition, created_at, updated_at) VALUES
|
||||||
|
((SELECT id FROM member_user WHERE member_no = 'MEM_TEST_G'), (SELECT member_card_id FROM member_card WHERE member_card_name = '储值卡500'), 'ACTIVE', 0, 200.00, '2027-06-02 23:59:59', '2026-05-01 10:00:00', 0, '{}', '2026-05-01 10:00:00', '2026-06-02 10:00:00');
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 七、预期测试结果
|
||||||
|
|
||||||
|
### 7.1 成功场景
|
||||||
|
|
||||||
|
| 场景 | 会员 | 操作 | 预期结果 |
|
||||||
|
|-----|------|-----|---------|
|
||||||
|
| 3 | 会员C | 预约次数卡团课 | 预约成功,消耗时长卡1次 |
|
||||||
|
| 5 | 会员E | 预约次数卡团课 | 预约成功,次数减1 (5→4) |
|
||||||
|
| 7 | 会员G | 预约储值卡团课 | 预约成功,余额减50 (200→150) |
|
||||||
|
|
||||||
|
### 7.2 失败场景
|
||||||
|
|
||||||
|
| 场景 | 会员 | 操作 | 预期错误码 | 预期提示信息 |
|
||||||
|
|-----|------|-----|----------|------------|
|
||||||
|
| 1 | 用户A | 预约次数卡团课 | NO_CARD | 无可用会员卡 |
|
||||||
|
| 2 | 用户B | 预约次数卡团课 | CARD_EXPIRED | 会员卡已过期 |
|
||||||
|
| 4 | 会员D | 预约次数卡团课 | INSUFFICIENT_TIMES | 剩余次数不足 |
|
||||||
|
| 6 | 会员F | 预约储值卡团课 | INSUFFICIENT_BALANCE | 余额不足,当前余额30.00元,需50.00元 |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 八、数据清理
|
||||||
|
|
||||||
|
测试完成后,可通过以下 SQL 清理测试数据:
|
||||||
|
|
||||||
|
```sql
|
||||||
|
-- 删除测试会员(会级联删除相关会员卡记录)
|
||||||
|
DELETE FROM member_user WHERE member_no LIKE 'MEM_TEST_%';
|
||||||
|
|
||||||
|
-- 删除测试团课
|
||||||
|
DELETE FROM group_course WHERE course_name LIKE '%_次数卡课程' OR course_name LIKE '%_储值卡课程';
|
||||||
|
|
||||||
|
-- 删除测试会员卡类型
|
||||||
|
DELETE FROM member_card WHERE member_card_name IN ('30天时长卡', '10次卡', '储值卡500');
|
||||||
|
```
|
||||||
@@ -0,0 +1,204 @@
|
|||||||
|
# V11 团课预约取消测试数据文档
|
||||||
|
|
||||||
|
## 文档说明
|
||||||
|
|
||||||
|
本文档描述了用于测试团课预约取消功能的测试数据,包含三种会员卡类型的取消预约场景。
|
||||||
|
|
||||||
|
## 测试场景概览
|
||||||
|
|
||||||
|
| 序号 | 场景描述 | 用户 | 会员卡类型 |
|
||||||
|
| :--- | :--- | :--- | :--- |
|
||||||
|
| 1 | 使用时长卡预约后取消 | 张三 | 时长卡(30天) |
|
||||||
|
| 2 | 使用次数卡预约后取消 | 李四 | 次数卡(10次) |
|
||||||
|
| 3 | 使用储值卡预约后取消 | 王五 | 储值卡(500元) |
|
||||||
|
|
||||||
|
## 测试用户数据
|
||||||
|
|
||||||
|
### 1. 张三(时长卡用户)
|
||||||
|
|
||||||
|
| 字段 | 值 |
|
||||||
|
| :--- | :--- |
|
||||||
|
| 会员编号 | `MEM_TEST_ZHANG` |
|
||||||
|
| 昵称 | 张三_时长卡用户 |
|
||||||
|
| 手机号 | 13800002001 |
|
||||||
|
| 性别 | 男(1) |
|
||||||
|
|
||||||
|
#### 会员卡信息
|
||||||
|
|
||||||
|
| 字段 | 值 |
|
||||||
|
| :--- | :--- |
|
||||||
|
| 卡类型 | 时长卡(TIME_CARD) |
|
||||||
|
| 卡名称 | 30天时长卡 |
|
||||||
|
| 状态 | ACTIVE(有效) |
|
||||||
|
| 到期时间 | 2026-07-02 23:59:59 |
|
||||||
|
| 购买时间 | 2026-06-02 10:00:00 |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 2. 李四(次数卡用户)
|
||||||
|
|
||||||
|
| 字段 | 值 |
|
||||||
|
| :--- | :--- |
|
||||||
|
| 会员编号 | `MEM_TEST_LI` |
|
||||||
|
| 昵称 | 李四_次数卡用户 |
|
||||||
|
| 手机号 | 13800002002 |
|
||||||
|
| 性别 | 男(1) |
|
||||||
|
|
||||||
|
#### 会员卡信息
|
||||||
|
|
||||||
|
| 字段 | 值 |
|
||||||
|
| :--- | :--- |
|
||||||
|
| 卡类型 | 次数卡(COUNT_CARD) |
|
||||||
|
| 卡名称 | 10次卡 |
|
||||||
|
| 状态 | ACTIVE(有效) |
|
||||||
|
| 剩余次数 | 5次 |
|
||||||
|
| 到期时间 | 2026-12-31 23:59:59 |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 3. 王五(储值卡用户)
|
||||||
|
|
||||||
|
| 字段 | 值 |
|
||||||
|
| :--- | :--- |
|
||||||
|
| 会员编号 | `MEM_TEST_WANG` |
|
||||||
|
| 昵称 | 王五_储值卡用户 |
|
||||||
|
| 手机号 | 13800002003 |
|
||||||
|
| 性别 | 女(2) |
|
||||||
|
|
||||||
|
#### 会员卡信息
|
||||||
|
|
||||||
|
| 字段 | 值 |
|
||||||
|
| :--- | :--- |
|
||||||
|
| 卡类型 | 储值卡(STORED_VALUE_CARD) |
|
||||||
|
| 卡名称 | 储值卡500 |
|
||||||
|
| 状态 | ACTIVE(有效) |
|
||||||
|
| 剩余金额 | 200.00元 |
|
||||||
|
| 到期时间 | 2027-06-02 23:59:59 |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 测试课程数据
|
||||||
|
|
||||||
|
### 晚间瑜伽_取消测试
|
||||||
|
|
||||||
|
| 字段 | 值 |
|
||||||
|
| :--- | :--- |
|
||||||
|
| 课程名称 | 晚间瑜伽_取消测试 |
|
||||||
|
| 教练ID | 101 |
|
||||||
|
| 课程类型 | 1 |
|
||||||
|
| 开始时间 | 2026-06-15 19:00:00 |
|
||||||
|
| 结束时间 | 2026-06-15 20:00:00 |
|
||||||
|
| 上课地点 | 瑜伽教室 |
|
||||||
|
| 最大人数 | 20人 |
|
||||||
|
| 当前人数 | 3人(三位测试用户) |
|
||||||
|
| 状态 | 0(正常) |
|
||||||
|
| 次数消耗 | 1次 |
|
||||||
|
| 储值消耗 | 30.00元 |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 预约记录数据
|
||||||
|
|
||||||
|
### 预约状态说明
|
||||||
|
|
||||||
|
| 状态码 | 含义 |
|
||||||
|
| :--- | :--- |
|
||||||
|
| `0` | 已预约(等待取消) |
|
||||||
|
| `1` | 已取消 |
|
||||||
|
| `2` | 已出席 |
|
||||||
|
| `3` | 缺席 |
|
||||||
|
|
||||||
|
### 预约记录详情
|
||||||
|
|
||||||
|
| 用户 | 预约时间 | 状态 | 课程名称 |
|
||||||
|
| :--- | :--- | :--- | :--- |
|
||||||
|
| 张三 | 2026-06-02 11:00:00 | 0(已预约) | 晚间瑜伽_取消测试 |
|
||||||
|
| 李四 | 2026-06-02 11:30:00 | 0(已预约) | 晚间瑜伽_取消测试 |
|
||||||
|
| 王五 | 2026-06-02 12:00:00 | 0(已预约) | 晚间瑜伽_取消测试 |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 测试用例设计
|
||||||
|
|
||||||
|
### 场景1:时长卡用户取消预约
|
||||||
|
|
||||||
|
**前置条件:**
|
||||||
|
- 张三持有有效时长卡
|
||||||
|
- 张三已成功预约课程
|
||||||
|
- 当前时间 < 课程开始时间
|
||||||
|
|
||||||
|
**测试步骤:**
|
||||||
|
1. 调用取消预约接口,传入张三的预约记录ID
|
||||||
|
2. 验证预约状态变为 `1`(已取消)
|
||||||
|
3. 验证课程当前人数减1
|
||||||
|
4. 验证时长卡状态保持不变(时长卡取消预约不影响卡状态)
|
||||||
|
|
||||||
|
**预期结果:**
|
||||||
|
- 预约记录状态更新为已取消
|
||||||
|
- 课程剩余名额增加1
|
||||||
|
- 时长卡有效期不受影响
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 场景2:次数卡用户取消预约
|
||||||
|
|
||||||
|
**前置条件:**
|
||||||
|
- 李四持有次数卡,剩余5次
|
||||||
|
- 李四已成功预约课程(已扣除1次)
|
||||||
|
- 当前时间 < 课程开始时间
|
||||||
|
|
||||||
|
**测试步骤:**
|
||||||
|
1. 调用取消预约接口,传入李四的预约记录ID
|
||||||
|
2. 验证预约状态变为 `1`(已取消)
|
||||||
|
3. 验证课程当前人数减1
|
||||||
|
4. 验证次数卡剩余次数恢复为5次(返还1次)
|
||||||
|
|
||||||
|
**预期结果:**
|
||||||
|
- 预约记录状态更新为已取消
|
||||||
|
- 课程剩余名额增加1
|
||||||
|
- 次数卡返还1次,剩余次数恢复为5次
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 场景3:储值卡用户取消预约
|
||||||
|
|
||||||
|
**前置条件:**
|
||||||
|
- 王五持有储值卡,余额200元
|
||||||
|
- 王五已成功预约课程(已扣除30元)
|
||||||
|
- 当前时间 < 课程开始时间
|
||||||
|
|
||||||
|
**测试步骤:**
|
||||||
|
1. 调用取消预约接口,传入王五的预约记录ID
|
||||||
|
2. 验证预约状态变为 `1`(已取消)
|
||||||
|
3. 验证课程当前人数减1
|
||||||
|
4. 验证储值卡余额恢复为200元(返还30元)
|
||||||
|
|
||||||
|
**预期结果:**
|
||||||
|
- 预约记录状态更新为已取消
|
||||||
|
- 课程剩余名额增加1
|
||||||
|
- 储值卡返还30元,余额恢复为200元
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 数据文件位置
|
||||||
|
|
||||||
|
```
|
||||||
|
manage-db/src/main/resources/db/migration/V11__Insert_Cancel_Booking_Test_Data.sql
|
||||||
|
```
|
||||||
|
|
||||||
|
## 数据依赖
|
||||||
|
|
||||||
|
| 依赖文件 | 说明 |
|
||||||
|
| :--- | :--- |
|
||||||
|
| `V6__Create_GroupCourse_table.sql` | 团课相关表结构 |
|
||||||
|
| `V8__Create_Member_And_MemberCard.sql` | 会员和会员卡表结构 |
|
||||||
|
| `V9__Add_GroupCourse_Booking_Snapshot_Fields.sql` | 预约快照字段 |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 注意事项
|
||||||
|
|
||||||
|
1. 测试数据中使用的日期均为未来日期,确保测试时课程尚未开始
|
||||||
|
2. 会员卡状态均为 ACTIVE,确保可以正常预约
|
||||||
|
3. 取消预约功能应在课程开始前24小时内允许操作(具体时间限制由业务逻辑决定)
|
||||||
|
4. 取消预约后应记录操作日志和交易流水
|
||||||
@@ -0,0 +1,400 @@
|
|||||||
|
# 团课预约场景测试数据文档
|
||||||
|
|
||||||
|
## 概述
|
||||||
|
|
||||||
|
本文档描述了团课预约功能的测试数据,覆盖了各种预约场景,用于验证系统在不同业务条件下的正确性和健壮性。
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 一、测试数据概览
|
||||||
|
|
||||||
|
| 数据类别 | 数量 | 说明 |
|
||||||
|
|---------|------|------|
|
||||||
|
| 测试会员 | 5个 | 覆盖不同会员卡状态 |
|
||||||
|
| 会员卡类型 | 8种 | 次卡/时长卡/储值卡 |
|
||||||
|
| 会员卡记录 | 5条 | 会员持有的实际卡 |
|
||||||
|
| 团课预约记录 | 4条 | 不同状态的预约 |
|
||||||
|
| 交易流水 | 27条 | 完整的消费记录 |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 二、会员测试数据
|
||||||
|
|
||||||
|
### 2.1 会员列表
|
||||||
|
|
||||||
|
| 会员ID | 会员编号 | 昵称 | 手机号 | 性别 | 会员卡状态 |
|
||||||
|
|--------|---------|------|--------|------|-----------|
|
||||||
|
| 1001 | MEM202606001 | 新用户小张 | 13800138001 | 男 | 无会员卡 |
|
||||||
|
| 1002 | MEM202606002 | 额度耗尽用户 | 13800138002 | 女 | 次卡已用完 |
|
||||||
|
| 1003 | MEM202606003 | 额度充足用户 | 13800138003 | 男 | 次卡剩余8次 |
|
||||||
|
| 1004 | MEM202606004 | 过期卡用户 | 13800138004 | 女 | 月卡已过期 |
|
||||||
|
| 1005 | MEM202606005 | 多卡用户小李 | 13800138005 | 男 | 次卡+储值卡 |
|
||||||
|
|
||||||
|
### 2.2 会员详情
|
||||||
|
|
||||||
|
**会员1001 - 新用户小张**
|
||||||
|
- 状态:新注册用户,尚未购买任何会员卡
|
||||||
|
- 用途:测试无会员卡情况下的预约行为
|
||||||
|
|
||||||
|
**会员1002 - 额度耗尽用户**
|
||||||
|
- 状态:持有10次团课卡,已全部用完
|
||||||
|
- 用途:测试会员卡额度耗尽时的预约行为
|
||||||
|
|
||||||
|
**会员1003 - 额度充足用户**
|
||||||
|
- 状态:持有20次团课卡,剩余8次
|
||||||
|
- 用途:测试正常预约流程
|
||||||
|
|
||||||
|
**会员1004 - 过期卡用户**
|
||||||
|
- 状态:持有月卡,已于2026-05-31过期
|
||||||
|
- 用途:测试过期会员卡的预约行为
|
||||||
|
|
||||||
|
**会员1005 - 多卡用户小李**
|
||||||
|
- 状态:持有50次团课卡(剩余45次) + 500元储值卡(剩余350元)
|
||||||
|
- 用途:测试多会员卡用户选择支付方式的场景
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 三、会员卡类型数据
|
||||||
|
|
||||||
|
### 3.1 次卡类型
|
||||||
|
|
||||||
|
| 卡类型ID | 卡名称 | 类型 | 价格 | 有效天数 | 总次数 | 状态 |
|
||||||
|
|---------|-------|------|------|---------|-------|------|
|
||||||
|
| 101 | 10次团课卡 | COUNT_CARD | 299.00 | 90 | 10 | 上架 |
|
||||||
|
| 102 | 20次团课卡 | COUNT_CARD | 499.00 | 180 | 20 | 上架 |
|
||||||
|
| 103 | 50次团课卡 | COUNT_CARD | 999.00 | 365 | 50 | 上架 |
|
||||||
|
|
||||||
|
### 3.2 时长卡类型
|
||||||
|
|
||||||
|
| 卡类型ID | 卡名称 | 类型 | 价格 | 有效天数 | 状态 |
|
||||||
|
|---------|-------|------|------|---------|------|
|
||||||
|
| 201 | 月卡 | TIME_CARD | 399.00 | 30 | 上架 |
|
||||||
|
| 202 | 季卡 | TIME_CARD | 899.00 | 90 | 上架 |
|
||||||
|
| 203 | 年卡 | TIME_CARD | 2999.00 | 365 | 上架 |
|
||||||
|
|
||||||
|
### 3.3 储值卡类型
|
||||||
|
|
||||||
|
| 卡类型ID | 卡名称 | 类型 | 价格 | 面额 | 有效天数 | 状态 |
|
||||||
|
|---------|-------|------|------|------|---------|------|
|
||||||
|
| 301 | 500元储值卡 | STORED_VALUE_CARD | 500.00 | 500.00 | 365 | 上架 |
|
||||||
|
| 302 | 1000元储值卡 | STORED_VALUE_CARD | 1000.00 | 1000.00 | 365 | 上架 |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 四、会员卡记录数据(会员持有的卡)
|
||||||
|
|
||||||
|
| 记录ID | 会员ID | 卡类型ID | 状态 | 剩余次数 | 剩余金额 | 到期时间 | 购买时间 |
|
||||||
|
|-------|--------|---------|------|---------|---------|---------|---------|
|
||||||
|
| 2001 | 1002 | 101 | USED_UP | 0 | 0.00 | 2026-09-01 | 2026-06-01 |
|
||||||
|
| 2002 | 1003 | 102 | ACTIVE | 8 | 0.00 | 2026-12-01 | 2026-06-01 |
|
||||||
|
| 2003 | 1004 | 201 | EXPIRED | 0 | 0.00 | 2026-05-31 | 2026-05-01 |
|
||||||
|
| 2004 | 1005 | 103 | ACTIVE | 45 | 0.00 | 2027-06-01 | 2026-06-01 |
|
||||||
|
| 2005 | 1005 | 301 | ACTIVE | 0 | 350.00 | 2027-06-01 | 2026-05-15 |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 五、团课预约记录数据
|
||||||
|
|
||||||
|
| 预约ID | 课程ID | 会员ID | 会员卡记录ID | 预约时间 | 状态 | 课程名称 |
|
||||||
|
|-------|-------|--------|-------------|---------|------|---------|
|
||||||
|
| 3001 | 1 | 1003 | 2002 | 2026-06-01 15:30 | 已预约(0) | 极速燃脂单车 |
|
||||||
|
| 3002 | 2 | 1003 | 2002 | 2026-06-01 10:00 | 已取消(1) | 清晨流瑜伽 |
|
||||||
|
| 3003 | 6 | 1003 | 2002 | 2026-05-28 19:00 | 已出席(2) | 蜜桃臀塑造 |
|
||||||
|
| 3004 | 7 | 1002 | 2001 | 2026-05-30 10:00 | 缺席(3) | 午间冥想放松 |
|
||||||
|
|
||||||
|
### 状态说明
|
||||||
|
|
||||||
|
| 状态码 | 状态名称 | 说明 |
|
||||||
|
|-------|---------|------|
|
||||||
|
| 0 | 已预约 | 用户已成功预约,等待上课 |
|
||||||
|
| 1 | 已取消 | 用户主动取消预约 |
|
||||||
|
| 2 | 已出席 | 用户已按时参加课程 |
|
||||||
|
| 3 | 缺席 | 用户预约后未出席 |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 六、测试场景详解
|
||||||
|
|
||||||
|
### 场景1:新注册用户无会员卡预约
|
||||||
|
|
||||||
|
**测试目标**:验证系统对无会员卡用户的预约拦截
|
||||||
|
|
||||||
|
**测试数据**:
|
||||||
|
- 用户ID:1001(新用户小张)
|
||||||
|
- 目标课程:任意课程
|
||||||
|
|
||||||
|
**预期结果**:
|
||||||
|
- 返回错误信息:"未绑定会员卡,请先购买会员卡"
|
||||||
|
- HTTP状态码:400 Bad Request
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 场景2:会员卡额度耗尽预约
|
||||||
|
|
||||||
|
**测试目标**:验证系统对额度耗尽会员卡的预约拦截
|
||||||
|
|
||||||
|
**测试数据**:
|
||||||
|
- 用户ID:1002(额度耗尽用户)
|
||||||
|
- 会员卡记录ID:2001
|
||||||
|
- 剩余次数:0
|
||||||
|
|
||||||
|
**预期结果**:
|
||||||
|
- 返回错误信息:"会员卡余额不足"
|
||||||
|
- HTTP状态码:400 Bad Request
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 场景3:会员卡额度充足预约
|
||||||
|
|
||||||
|
**测试目标**:验证正常预约流程
|
||||||
|
|
||||||
|
**测试数据**:
|
||||||
|
- 用户ID:1003(额度充足用户)
|
||||||
|
- 会员卡记录ID:2002
|
||||||
|
- 剩余次数:8
|
||||||
|
- 目标课程:课程ID=1(极速燃脂单车)
|
||||||
|
|
||||||
|
**预期结果**:
|
||||||
|
- 预约成功
|
||||||
|
- 会员卡剩余次数减1(变为7次)
|
||||||
|
- 生成预约记录
|
||||||
|
- HTTP状态码:200 OK
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 场景4:会员卡已过期预约
|
||||||
|
|
||||||
|
**测试目标**:验证系统对过期会员卡的预约拦截
|
||||||
|
|
||||||
|
**测试数据**:
|
||||||
|
- 用户ID:1004(过期卡用户)
|
||||||
|
- 会员卡记录ID:2003
|
||||||
|
- 状态:EXPIRED
|
||||||
|
- 到期时间:2026-05-31
|
||||||
|
|
||||||
|
**预期结果**:
|
||||||
|
- 返回错误信息:"会员卡已过期"
|
||||||
|
- HTTP状态码:400 Bad Request
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 场景5:课程已满员预约---------------
|
||||||
|
|
||||||
|
**测试目标**:验证系统对满员课程的预约拦截
|
||||||
|
|
||||||
|
**测试数据**:
|
||||||
|
- 课程ID:3(燃脂搏击)
|
||||||
|
- 当前人数:20/20
|
||||||
|
|
||||||
|
**预期结果**:
|
||||||
|
- 返回错误信息:"课程已满员"
|
||||||
|
- HTTP状态码:400 Bad Request
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 场景6:课程已取消预约
|
||||||
|
|
||||||
|
**测试目标**:验证系统对已取消课程的预约拦截
|
||||||
|
|
||||||
|
**测试数据**:
|
||||||
|
- 课程ID:5(周末冥想修复)
|
||||||
|
- 状态:1(已取消)
|
||||||
|
|
||||||
|
**预期结果**:
|
||||||
|
- 返回错误信息:"课程已取消"
|
||||||
|
- HTTP状态码:400 Bad Request
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 场景7:课程已结束预约
|
||||||
|
|
||||||
|
**测试目标**:验证系统对已结束课程的预约拦截
|
||||||
|
|
||||||
|
**测试数据**:
|
||||||
|
- 课程ID:6(蜜桃臀塑造)或 7(午间冥想放松)
|
||||||
|
- 状态:2(已结束)
|
||||||
|
|
||||||
|
**预期结果**:
|
||||||
|
- 返回错误信息:"课程已结束"
|
||||||
|
- HTTP状态码:400 Bad Request
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 场景8:超出预约时间预约
|
||||||
|
|
||||||
|
**测试目标**:验证系统对预约时间窗口的控制
|
||||||
|
|
||||||
|
**测试数据**:
|
||||||
|
- 课程ID:4(哈他瑜伽)
|
||||||
|
- 开始时间:2026-06-01 15:20:00
|
||||||
|
- 测试时间:课程开始前30分钟内
|
||||||
|
|
||||||
|
**预期结果**:
|
||||||
|
- 返回错误信息:"已过预约时间"
|
||||||
|
- HTTP状态码:400 Bad Request
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 场景9:重复预约同一课程
|
||||||
|
|
||||||
|
**测试目标**:验证系统对重复预约的拦截
|
||||||
|
|
||||||
|
**测试数据**:
|
||||||
|
- 用户ID:1003(额度充足用户)
|
||||||
|
- 课程ID:1(极速燃脂单车)
|
||||||
|
- 已有预约记录:booking_id=3001
|
||||||
|
|
||||||
|
**预期结果**:
|
||||||
|
- 返回错误信息:"已预约该课程"
|
||||||
|
- HTTP状态码:400 Bad Request
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 场景10:多会员卡用户选择支付方式
|
||||||
|
|
||||||
|
**测试目标**:验证多卡用户的支付方式选择功能
|
||||||
|
|
||||||
|
**测试数据**:
|
||||||
|
- 用户ID:1005(多卡用户小李)
|
||||||
|
- 可用卡1:次卡(记录ID=2004,剩余45次)
|
||||||
|
- 可用卡2:储值卡(记录ID=2005,剩余350元)
|
||||||
|
|
||||||
|
**预期结果**:
|
||||||
|
- 系统列出用户所有可用会员卡
|
||||||
|
- 用户可选择使用次卡或储值卡支付
|
||||||
|
- 根据选择的卡类型扣减相应额度
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 七、交易流水说明
|
||||||
|
|
||||||
|
### 7.1 会员1002(额度耗尽用户)消费记录
|
||||||
|
|
||||||
|
| 操作顺序 | 操作类型 | 变动次数 | 剩余次数 | 备注 |
|
||||||
|
|---------|---------|---------|---------|------|
|
||||||
|
| 1 | PURCHASE | +10 | 10 | 购买10次团课卡 |
|
||||||
|
| 2-11 | DEDUCT | -1×10 | 0 | 10次课程消费 |
|
||||||
|
|
||||||
|
### 7.2 会员1003(额度充足用户)消费记录
|
||||||
|
|
||||||
|
| 操作顺序 | 操作类型 | 变动次数 | 剩余次数 | 备注 |
|
||||||
|
|---------|---------|---------|---------|------|
|
||||||
|
| 1 | PURCHASE | +20 | 20 | 购买20次团课卡 |
|
||||||
|
| 2-12 | DEDUCT | -12 | 8 | 12次课程消费 |
|
||||||
|
|
||||||
|
### 7.3 会员1005(多卡用户)消费记录
|
||||||
|
|
||||||
|
| 会员卡记录ID | 操作类型 | 变动次数 | 变动金额 | 备注 |
|
||||||
|
|-------------|---------|---------|---------|------|
|
||||||
|
| 2004 | PURCHASE | +50 | 0 | 购买50次团课卡 |
|
||||||
|
| 2004 | DEDUCT | -5 | 0 | 预约5节课程 |
|
||||||
|
| 2005 | PURCHASE | 0 | +500 | 购买500元储值卡 |
|
||||||
|
| 2005 | DEDUCT | 0 | -150 | 私教课消费150元 |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 八、API测试示例
|
||||||
|
|
||||||
|
### 8.1 预约接口
|
||||||
|
|
||||||
|
```http
|
||||||
|
POST /api/group-course/bookings
|
||||||
|
Content-Type: application/json
|
||||||
|
|
||||||
|
{
|
||||||
|
"courseId": 1,
|
||||||
|
"memberCardRecordId": 2002
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### 8.2 取消预约接口
|
||||||
|
|
||||||
|
```http
|
||||||
|
PUT /api/group-course/bookings/{bookingId}/cancel
|
||||||
|
Content-Type: application/json
|
||||||
|
|
||||||
|
{
|
||||||
|
"reason": "临时有事无法参加"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### 8.3 查询用户预约列表
|
||||||
|
|
||||||
|
```http
|
||||||
|
GET /api/group-course/bookings?memberId=1003
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 九、测试数据对应关系图
|
||||||
|
|
||||||
|
```
|
||||||
|
会员表 (member_user)
|
||||||
|
│
|
||||||
|
├── 1001 ──→ (无会员卡)
|
||||||
|
├── 1002 ──→ 会员卡记录 2001 (USED_UP)
|
||||||
|
├── 1003 ──→ 会员卡记录 2002 (ACTIVE, 8次)
|
||||||
|
├── 1004 ──→ 会员卡记录 2003 (EXPIRED)
|
||||||
|
└── 1005 ──→ 会员卡记录 2004 (ACTIVE, 45次)
|
||||||
|
└── 会员卡记录 2005 (ACTIVE, 350元)
|
||||||
|
│
|
||||||
|
↓
|
||||||
|
预约记录表 (group_course_booking)
|
||||||
|
│
|
||||||
|
├── 3001: 已预约
|
||||||
|
├── 3002: 已取消
|
||||||
|
├── 3003: 已出席
|
||||||
|
└── 3004: 缺席
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 十、数据初始化
|
||||||
|
|
||||||
|
测试数据通过 Flyway 迁移脚本 `V10__Insert_Booking_Test_Data.sql` 初始化,需在数据库初始化时执行。
|
||||||
|
|
||||||
|
**执行顺序**:
|
||||||
|
1. V1__Create_all_tables.sql - 创建基础表结构
|
||||||
|
2. V2__Insert_initial_data.sql - 插入初始数据
|
||||||
|
3. V6__Create_GroupCourse_table.sql - 创建团课表
|
||||||
|
4. V7__Insert_GroupCourse_test_data.sql - 插入团课测试数据
|
||||||
|
5. V8__Create_Member_And_MemberCard.sql - 创建会员和会员卡表
|
||||||
|
6. V9__Add_GroupCourse_Booking_Snapshot_Fields.sql - 添加冗余字段
|
||||||
|
7. V10__Insert_Booking_Test_Data.sql - 插入预约测试数据(本文件)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**文档版本**: v1.1
|
||||||
|
**创建时间**: 2026-06-02
|
||||||
|
**更新时间**: 2026-06-02
|
||||||
|
**适用场景**: 团课预约功能测试
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 十一、重要说明
|
||||||
|
|
||||||
|
### 11.1 字段说明
|
||||||
|
|
||||||
|
`member_card_record` 表包含两个ID字段:
|
||||||
|
- `id` - 数据库主键(BIGSERIAL PRIMARY KEY)
|
||||||
|
- `member_card_record_id` - 业务ID(BIGSERIAL),代码中使用此字段作为查询和更新条件
|
||||||
|
|
||||||
|
### 11.2 测试数据修复记录
|
||||||
|
|
||||||
|
**v1.1 修复内容**:
|
||||||
|
- 修复了 `member_card_record` 表测试数据缺失 `member_card_record_id` 字段的问题
|
||||||
|
- 原问题:测试数据只插入了 `id` 字段,导致 `member_card_record_id` 为 NULL
|
||||||
|
- 影响:代码使用 `member_card_record_id` 作为WHERE条件时无法匹配到记录,导致扣减权益失败
|
||||||
|
- 解决:在INSERT语句中添加 `member_card_record_id` 字段,值与 `id` 相同
|
||||||
|
|
||||||
|
**修复前**:
|
||||||
|
```sql
|
||||||
|
INSERT INTO member_card_record (id, member_id, member_card_id, ...) VALUES
|
||||||
|
(2001, 1002, 101, ...);
|
||||||
|
```
|
||||||
|
|
||||||
|
**修复后**:
|
||||||
|
```sql
|
||||||
|
INSERT INTO member_card_record (id, member_card_record_id, member_id, member_card_id, ...) VALUES
|
||||||
|
(2001, 2001, 1002, 101, ...);
|
||||||
|
```
|
||||||
@@ -0,0 +1,728 @@
|
|||||||
|
# 团课管理模块 API 文档
|
||||||
|
|
||||||
|
> **文档版本**: v1.0
|
||||||
|
> **创建日期**: 2026-06-02
|
||||||
|
> **作者**: 张翔
|
||||||
|
> **状态**: 正式发布
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📋 目录
|
||||||
|
|
||||||
|
1. [概述](#概述)
|
||||||
|
2. [基础路径](#基础路径)
|
||||||
|
3. [团课管理接口](#团课管理接口)
|
||||||
|
- [获取所有团课](#获取所有团课)
|
||||||
|
- [分页获取团课](#分页获取团课)
|
||||||
|
- [根据ID获取团课详情](#根据ID获取团课详情)
|
||||||
|
- [创建团课](#创建团课)
|
||||||
|
- [更新团课](#更新团课)
|
||||||
|
- [取消团课](#取消团课)
|
||||||
|
- [团课签到](#团课签到)
|
||||||
|
- [删除团课](#删除团课)
|
||||||
|
4. [团课预约接口](#团课预约接口)
|
||||||
|
- [预约团课](#预约团课)
|
||||||
|
- [取消预约](#取消预约)
|
||||||
|
- [查询会员预约记录](#查询会员预约记录)
|
||||||
|
- [查询预约详情](#查询预约详情)
|
||||||
|
- [查询课程预约记录](#查询课程预约记录)
|
||||||
|
5. [数据模型](#数据模型)
|
||||||
|
- [GroupCourse(团课)](#GroupCourse团课)
|
||||||
|
- [GroupCourseBooking(团课预约)](#GroupCourseBooking团课预约)
|
||||||
|
6. [状态码说明](#状态码说明)
|
||||||
|
7. [业务规则](#业务规则)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 概述
|
||||||
|
|
||||||
|
团课管理模块提供团课的创建、编辑、查询、取消和签到功能,以及团课预约相关操作。采用 Spring WebFlux 响应式编程,支持高并发场景。
|
||||||
|
|
||||||
|
## 基础路径
|
||||||
|
|
||||||
|
所有接口的基础路径为: `http://{host}:{port}/api/groupCourse`
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 团课管理接口
|
||||||
|
|
||||||
|
### 获取所有团课
|
||||||
|
|
||||||
|
| 属性 | 值 |
|
||||||
|
|------|-----|
|
||||||
|
| **HTTP方法** | GET |
|
||||||
|
| **接口路径** | `/api/groupCourse/list` |
|
||||||
|
| **所属文件** | `GroupCourseHandler.java` |
|
||||||
|
|
||||||
|
**请求参数**:
|
||||||
|
|
||||||
|
| 参数名 | 类型 | 必填 | 默认值 | 说明 |
|
||||||
|
|--------|------|------|--------|------|
|
||||||
|
| includeDeleted | boolean | 否 | false | 是否包含已删除的团课 |
|
||||||
|
|
||||||
|
**成功响应** (200 OK):
|
||||||
|
|
||||||
|
```json
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"id": 1,
|
||||||
|
"courseName": "瑜伽入门",
|
||||||
|
"coachId": 1,
|
||||||
|
"courseType": 1,
|
||||||
|
"startTime": "2026-06-02T09:00:00",
|
||||||
|
"endTime": "2026-06-02T10:00:00",
|
||||||
|
"maxMembers": 20,
|
||||||
|
"currentMembers": 15,
|
||||||
|
"status": 0,
|
||||||
|
"location": "健身房A区",
|
||||||
|
"coverImage": "https://example.com/yoga.jpg",
|
||||||
|
"description": "适合初学者的瑜伽课程",
|
||||||
|
"createdAt": "2026-06-01T10:00:00",
|
||||||
|
"updatedAt": "2026-06-01T10:00:00"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 分页获取团课
|
||||||
|
|
||||||
|
| 属性 | 值 |
|
||||||
|
|------|-----|
|
||||||
|
| **HTTP方法** | POST |
|
||||||
|
| **接口路径** | `/api/groupCourse/page` |
|
||||||
|
| **所属文件** | `GroupCourseHandler.java` |
|
||||||
|
|
||||||
|
**请求体**:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"page": 0,
|
||||||
|
"size": 10,
|
||||||
|
"sort": "id",
|
||||||
|
"order": "asc",
|
||||||
|
"keyword": "瑜伽"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
| 参数名 | 类型 | 必填 | 默认值 | 说明 |
|
||||||
|
|--------|------|------|--------|------|
|
||||||
|
| page | int | 否 | 0 | 页码,从0开始 |
|
||||||
|
| size | int | 否 | 10 | 每页数量,最大100 |
|
||||||
|
| sort | string | 否 | id | 排序字段 |
|
||||||
|
| order | string | 否 | asc | 排序方式(asc/desc) |
|
||||||
|
| keyword | string | 否 | - | 搜索关键词 |
|
||||||
|
|
||||||
|
**请求参数**:
|
||||||
|
|
||||||
|
| 参数名 | 类型 | 必填 | 默认值 | 说明 |
|
||||||
|
|--------|------|------|--------|------|
|
||||||
|
| includeDeleted | boolean | 否 | false | 是否包含已删除的团课 |
|
||||||
|
|
||||||
|
**成功响应** (200 OK):
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"data": [...],
|
||||||
|
"totalPages": 5,
|
||||||
|
"totalElements": 45,
|
||||||
|
"page": 0,
|
||||||
|
"size": 10
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 根据ID获取团课详情
|
||||||
|
|
||||||
|
| 属性 | 值 |
|
||||||
|
|------|-----|
|
||||||
|
| **HTTP方法** | GET |
|
||||||
|
| **接口路径** | `/api/groupCourse/{id}` |
|
||||||
|
| **所属文件** | `GroupCourseHandler.java` |
|
||||||
|
|
||||||
|
**路径参数**:
|
||||||
|
|
||||||
|
| 参数名 | 类型 | 必填 | 说明 |
|
||||||
|
|--------|------|------|------|
|
||||||
|
| id | Long | 是 | 团课ID |
|
||||||
|
|
||||||
|
**成功响应** (200 OK):
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"id": 1,
|
||||||
|
"courseName": "瑜伽入门",
|
||||||
|
"coachId": 1,
|
||||||
|
"courseType": 1,
|
||||||
|
"startTime": "2026-06-02T09:00:00",
|
||||||
|
"endTime": "2026-06-02T10:00:00",
|
||||||
|
"maxMembers": 20,
|
||||||
|
"currentMembers": 15,
|
||||||
|
"status": 0,
|
||||||
|
"location": "健身房A区",
|
||||||
|
"coverImage": "https://example.com/yoga.jpg",
|
||||||
|
"description": "适合初学者的瑜伽课程",
|
||||||
|
"pointCardAmount": 1,
|
||||||
|
"storedValueAmount": 50.00,
|
||||||
|
"createdAt": "2026-06-01T10:00:00",
|
||||||
|
"updatedAt": "2026-06-01T10:00:00"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
**失败响应** (404 Not Found):
|
||||||
|
|
||||||
|
```json
|
||||||
|
{}
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 创建团课
|
||||||
|
|
||||||
|
| 属性 | 值 |
|
||||||
|
|------|-----|
|
||||||
|
| **HTTP方法** | POST |
|
||||||
|
| **接口路径** | `/api/groupCourse` |
|
||||||
|
| **所属文件** | `GroupCourseHandler.java` |
|
||||||
|
|
||||||
|
**请求体**:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"courseName": "动感单车",
|
||||||
|
"coachId": 2,
|
||||||
|
"courseType": 2,
|
||||||
|
"startTime": "2026-06-05T18:00:00",
|
||||||
|
"endTime": "2026-06-05T19:00:00",
|
||||||
|
"maxMembers": 25,
|
||||||
|
"location": "健身房B区",
|
||||||
|
"coverImage": "https://example.com/spinning.jpg",
|
||||||
|
"description": "高强度有氧运动课程",
|
||||||
|
"pointCardAmount": 1,
|
||||||
|
"storedValueAmount": 50.00
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
| 参数名 | 类型 | 必填 | 说明 |
|
||||||
|
|--------|------|------|------|
|
||||||
|
| courseName | String | **是** | 课程名称 |
|
||||||
|
| coachId | Long | 否 | 教练ID |
|
||||||
|
| courseType | Long | 否 | 课程类型 |
|
||||||
|
| startTime | LocalDateTime | 否 | 开始时间 |
|
||||||
|
| endTime | LocalDateTime | 否 | 结束时间 |
|
||||||
|
| maxMembers | Integer | 否 | 最大参与人数,默认20 |
|
||||||
|
| location | String | 否 | 上课地点 |
|
||||||
|
| coverImage | String | 否 | 封面图URL |
|
||||||
|
| description | String | 否 | 课程描述 |
|
||||||
|
| pointCardAmount | Integer | 否 | 点卡额度(消耗次数),默认1 |
|
||||||
|
| storedValueAmount | BigDecimal | 否 | 储值卡额度(消耗金额),默认0 |
|
||||||
|
|
||||||
|
**成功响应** (200 OK):
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"success": true,
|
||||||
|
"message": "团课创建成功",
|
||||||
|
"data": {
|
||||||
|
"id": 2,
|
||||||
|
"courseName": "动感单车",
|
||||||
|
"coachId": 2,
|
||||||
|
"courseType": 2,
|
||||||
|
"startTime": "2026-06-05T18:00:00",
|
||||||
|
"endTime": "2026-06-05T19:00:00",
|
||||||
|
"maxMembers": 25,
|
||||||
|
"currentMembers": 0,
|
||||||
|
"status": 0,
|
||||||
|
"location": "健身房B区",
|
||||||
|
"coverImage": "https://example.com/spinning.jpg",
|
||||||
|
"description": "高强度有氧运动课程",
|
||||||
|
"pointCardAmount": 1,
|
||||||
|
"storedValueAmount": 50.00
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
**失败响应** (400 Bad Request):
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"success": false,
|
||||||
|
"message": "课程名称不能为空"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 更新团课
|
||||||
|
|
||||||
|
| 属性 | 值 |
|
||||||
|
|------|-----|
|
||||||
|
| **HTTP方法** | PUT |
|
||||||
|
| **接口路径** | `/api/groupCourse/{id}` |
|
||||||
|
| **所属文件** | `GroupCourseHandler.java` |
|
||||||
|
|
||||||
|
**路径参数**:
|
||||||
|
|
||||||
|
| 参数名 | 类型 | 必填 | 说明 |
|
||||||
|
|--------|------|------|------|
|
||||||
|
| id | Long | 是 | 团课ID |
|
||||||
|
|
||||||
|
**请求体**:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"courseName": "动感单车升级版",
|
||||||
|
"coachId": 2,
|
||||||
|
"maxMembers": 30,
|
||||||
|
"description": "升级版高强度有氧运动课程",
|
||||||
|
"pointCardAmount": 2,
|
||||||
|
"storedValueAmount": 80.00
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
| 参数名 | 类型 | 必填 | 说明 |
|
||||||
|
|--------|------|------|------|
|
||||||
|
| courseName | String | 否 | 课程名称 |
|
||||||
|
| coachId | Long | 否 | 教练ID |
|
||||||
|
| courseType | Long | 否 | 课程类型 |
|
||||||
|
| startTime | LocalDateTime | 否 | 开始时间 |
|
||||||
|
| endTime | LocalDateTime | 否 | 结束时间 |
|
||||||
|
| maxMembers | Integer | 否 | 最大参与人数 |
|
||||||
|
| location | String | 否 | 上课地点 |
|
||||||
|
| coverImage | String | 否 | 封面图URL |
|
||||||
|
| description | String | 否 | 课程描述 |
|
||||||
|
| pointCardAmount | Integer | 否 | 点卡额度(消耗次数) |
|
||||||
|
| storedValueAmount | BigDecimal | 否 | 储值卡额度(消耗金额) |
|
||||||
|
|
||||||
|
**成功响应** (200 OK):
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"success": true,
|
||||||
|
"message": "团课更新成功",
|
||||||
|
"data": {
|
||||||
|
"id": 2,
|
||||||
|
"courseName": "动感单车升级版",
|
||||||
|
"coachId": 2,
|
||||||
|
"maxMembers": 30,
|
||||||
|
"description": "升级版高强度有氧运动课程",
|
||||||
|
"pointCardAmount": 2,
|
||||||
|
"storedValueAmount": 80.00
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
**失败响应** (400 Bad Request):
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"success": false,
|
||||||
|
"message": "团课不存在"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 取消团课
|
||||||
|
|
||||||
|
| 属性 | 值 |
|
||||||
|
|------|-----|
|
||||||
|
| **HTTP方法** | POST |
|
||||||
|
| **接口路径** | `/api/groupCourse/{id}/cancel` |
|
||||||
|
| **所属文件** | `GroupCourseHandler.java` |
|
||||||
|
|
||||||
|
**路径参数**:
|
||||||
|
|
||||||
|
| 参数名 | 类型 | 必填 | 说明 |
|
||||||
|
|--------|------|------|------|
|
||||||
|
| id | Long | 是 | 团课ID |
|
||||||
|
|
||||||
|
**成功响应** (200 OK):
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"success": true,
|
||||||
|
"message": "团课取消成功",
|
||||||
|
"data": {
|
||||||
|
"id": 2,
|
||||||
|
"status": 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
**失败响应** (400 Bad Request):
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"success": false,
|
||||||
|
"message": "课程取消需提前24小时"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 团课签到
|
||||||
|
|
||||||
|
| 属性 | 值 |
|
||||||
|
|------|-----|
|
||||||
|
| **HTTP方法** | POST |
|
||||||
|
| **接口路径** | `/api/groupCourse/{courseId}/signin` |
|
||||||
|
| **所属文件** | `GroupCourseHandler.java` |
|
||||||
|
|
||||||
|
**路径参数**:
|
||||||
|
|
||||||
|
| 参数名 | 类型 | 必填 | 说明 |
|
||||||
|
|--------|------|------|------|
|
||||||
|
| courseId | Long | 是 | 团课ID |
|
||||||
|
|
||||||
|
**请求体**:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"memberId": 1001
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
| 参数名 | 类型 | 必填 | 说明 |
|
||||||
|
|--------|------|------|------|
|
||||||
|
| memberId | Long | **是** | 会员ID |
|
||||||
|
|
||||||
|
**成功响应** (200 OK):
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"success": true,
|
||||||
|
"message": "签到成功",
|
||||||
|
"data": {
|
||||||
|
"id": 2,
|
||||||
|
"currentMembers": 16
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
**失败响应** (400 Bad Request):
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"success": false,
|
||||||
|
"message": "课程已满员"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 删除团课
|
||||||
|
|
||||||
|
| 属性 | 值 |
|
||||||
|
|------|-----|
|
||||||
|
| **HTTP方法** | DELETE |
|
||||||
|
| **接口路径** | `/api/groupCourse/{id}` |
|
||||||
|
| **所属文件** | `GroupCourseHandler.java` |
|
||||||
|
|
||||||
|
**路径参数**:
|
||||||
|
|
||||||
|
| 参数名 | 类型 | 必填 | 说明 |
|
||||||
|
|--------|------|------|------|
|
||||||
|
| id | Long | 是 | 团课ID |
|
||||||
|
|
||||||
|
**成功响应** (200 OK):
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"success": true,
|
||||||
|
"message": "团课删除成功"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 团课预约接口
|
||||||
|
|
||||||
|
### 预约团课
|
||||||
|
|
||||||
|
| 属性 | 值 |
|
||||||
|
|------|-----|
|
||||||
|
| **HTTP方法** | POST |
|
||||||
|
| **接口路径** | `/api/groupCourse/book` |
|
||||||
|
| **所属文件** | `GroupCourseBookingHandler.java` |
|
||||||
|
|
||||||
|
**请求体**:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"courseId": 1,
|
||||||
|
"memberId": 1001,
|
||||||
|
"memberCardRecordId": 5001
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
| 参数名 | 类型 | 必填 | 说明 |
|
||||||
|
|--------|------|------|------|
|
||||||
|
| courseId | Long | **是** | 团课ID |
|
||||||
|
| memberId | Long | **是** | 会员ID |
|
||||||
|
| memberCardRecordId | Long | **是** | 会员卡记录ID |
|
||||||
|
|
||||||
|
**成功响应** (200 OK):
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"success": true,
|
||||||
|
"message": "预约成功",
|
||||||
|
"data": {
|
||||||
|
"id": 100,
|
||||||
|
"courseId": 1,
|
||||||
|
"memberId": 1001,
|
||||||
|
"memberCardRecordId": 5001,
|
||||||
|
"bookingTime": "2026-06-02T08:00:00",
|
||||||
|
"status": "0"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 取消预约
|
||||||
|
|
||||||
|
| 属性 | 值 |
|
||||||
|
|------|-----|
|
||||||
|
| **HTTP方法** | POST |
|
||||||
|
| **接口路径** | `/api/groupCourse/booking/{bookingId}/cancel` |
|
||||||
|
| **所属文件** | `GroupCourseBookingHandler.java` |
|
||||||
|
|
||||||
|
**路径参数**:
|
||||||
|
|
||||||
|
| 参数名 | 类型 | 必填 | 说明 |
|
||||||
|
|--------|------|------|------|
|
||||||
|
| bookingId | Long | 是 | 预约ID |
|
||||||
|
|
||||||
|
**请求体**:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"memberId": 1001
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
| 参数名 | 类型 | 必填 | 说明 |
|
||||||
|
|--------|------|------|------|
|
||||||
|
| memberId | Long | **是** | 会员ID |
|
||||||
|
|
||||||
|
**成功响应** (200 OK):
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"success": true,
|
||||||
|
"message": "取消成功",
|
||||||
|
"data": {
|
||||||
|
"id": 100,
|
||||||
|
"status": "1",
|
||||||
|
"cancelTime": "2026-06-02T09:00:00"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 查询会员预约记录
|
||||||
|
|
||||||
|
| 属性 | 值 |
|
||||||
|
|------|-----|
|
||||||
|
| **HTTP方法** | GET |
|
||||||
|
| **接口路径** | `/api/groupCourse/bookings/member/{memberId}` |
|
||||||
|
| **所属文件** | `GroupCourseBookingHandler.java` |
|
||||||
|
|
||||||
|
**路径参数**:
|
||||||
|
|
||||||
|
| 参数名 | 类型 | 必填 | 说明 |
|
||||||
|
|--------|------|------|------|
|
||||||
|
| memberId | Long | 是 | 会员ID |
|
||||||
|
|
||||||
|
**成功响应** (200 OK):
|
||||||
|
|
||||||
|
```json
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"id": 100,
|
||||||
|
"courseId": 1,
|
||||||
|
"courseName": "瑜伽入门",
|
||||||
|
"memberId": 1001,
|
||||||
|
"memberCardRecordId": 5001,
|
||||||
|
"bookingTime": "2026-06-02T08:00:00",
|
||||||
|
"status": "0",
|
||||||
|
"courseStartTime": "2026-06-02T09:00:00",
|
||||||
|
"location": "健身房A区"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 查询预约详情
|
||||||
|
|
||||||
|
| 属性 | 值 |
|
||||||
|
|------|-----|
|
||||||
|
| **HTTP方法** | GET |
|
||||||
|
| **接口路径** | `/api/groupCourse/bookings/{bookingId}` |
|
||||||
|
| **所属文件** | `GroupCourseBookingHandler.java` |
|
||||||
|
|
||||||
|
**路径参数**:
|
||||||
|
|
||||||
|
| 参数名 | 类型 | 必填 | 说明 |
|
||||||
|
|--------|------|------|------|
|
||||||
|
| bookingId | Long | 是 | 预约ID |
|
||||||
|
|
||||||
|
**成功响应** (200 OK):
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"id": 100,
|
||||||
|
"courseId": 1,
|
||||||
|
"courseName": "瑜伽入门",
|
||||||
|
"memberId": 1001,
|
||||||
|
"memberCardRecordId": 5001,
|
||||||
|
"bookingTime": "2026-06-02T08:00:00",
|
||||||
|
"status": "0",
|
||||||
|
"courseStartTime": "2026-06-02T09:00:00",
|
||||||
|
"courseEndTime": "2026-06-02T10:00:00",
|
||||||
|
"location": "健身房A区"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
**失败响应** (404 Not Found):
|
||||||
|
|
||||||
|
```json
|
||||||
|
{}
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 查询课程预约记录
|
||||||
|
|
||||||
|
| 属性 | 值 |
|
||||||
|
|------|-----|
|
||||||
|
| **HTTP方法** | GET |
|
||||||
|
| **接口路径** | `/api/groupCourse/bookings/course/{courseId}` |
|
||||||
|
| **所属文件** | `GroupCourseBookingHandler.java` |
|
||||||
|
|
||||||
|
**路径参数**:
|
||||||
|
|
||||||
|
| 参数名 | 类型 | 必填 | 说明 |
|
||||||
|
|--------|------|------|------|
|
||||||
|
| courseId | Long | 是 | 团课ID |
|
||||||
|
|
||||||
|
**成功响应** (200 OK):
|
||||||
|
|
||||||
|
```json
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"id": 100,
|
||||||
|
"courseId": 1,
|
||||||
|
"courseName": "瑜伽入门",
|
||||||
|
"memberId": 1001,
|
||||||
|
"bookingTime": "2026-06-02T08:00:00",
|
||||||
|
"status": "0"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 数据模型
|
||||||
|
|
||||||
|
### GroupCourse(团课)
|
||||||
|
|
||||||
|
| 字段名 | 类型 | 说明 |
|
||||||
|
|--------|------|------|
|
||||||
|
| id | Long | 主键ID |
|
||||||
|
| courseName | String | 课程名称 |
|
||||||
|
| coachId | Long | 教练ID |
|
||||||
|
| courseType | Long | 课程类型 |
|
||||||
|
| startTime | LocalDateTime | 开始时间 |
|
||||||
|
| endTime | LocalDateTime | 结束时间 |
|
||||||
|
| maxMembers | Integer | 最大参与人数 |
|
||||||
|
| currentMembers | Integer | 当前参与人数 |
|
||||||
|
| status | Long | 状态(0-正常,1-已取消,2-已结束) |
|
||||||
|
| location | String | 上课地点 |
|
||||||
|
| coverImage | String | 封面图URL |
|
||||||
|
| description | String | 课程描述 |
|
||||||
|
| pointCardAmount | Integer | 点卡额度(消耗次数),默认1 |
|
||||||
|
| storedValueAmount | BigDecimal | 储值卡额度(消耗金额),默认0 |
|
||||||
|
| createdBy | String | 创建人 |
|
||||||
|
| updatedBy | String | 更新人 |
|
||||||
|
| createdAt | LocalDateTime | 创建时间 |
|
||||||
|
| updatedAt | LocalDateTime | 更新时间 |
|
||||||
|
| deletedAt | LocalDateTime | 删除时间(软删除) |
|
||||||
|
|
||||||
|
### GroupCourseBooking(团课预约)
|
||||||
|
|
||||||
|
| 字段名 | 类型 | 说明 |
|
||||||
|
|--------|------|------|
|
||||||
|
| id | Long | 主键ID |
|
||||||
|
| courseId | Long | 团课ID |
|
||||||
|
| courseName | String | 团课名称 |
|
||||||
|
| memberId | Long | 会员ID |
|
||||||
|
| memberCardRecordId | Long | 会员卡记录ID |
|
||||||
|
| bookingTime | LocalDateTime | 预约时间 |
|
||||||
|
| status | String | 状态(0-已预约,1-已取消,2-已出席,3-缺席) |
|
||||||
|
| cancelTime | LocalDateTime | 取消时间 |
|
||||||
|
| courseStartTime | LocalDateTime | 课程开始时间 |
|
||||||
|
| courseEndTime | LocalDateTime | 课程结束时间 |
|
||||||
|
| location | String | 上课地点 |
|
||||||
|
| createdBy | String | 创建人 |
|
||||||
|
| updatedBy | String | 更新人 |
|
||||||
|
| createdAt | LocalDateTime | 创建时间 |
|
||||||
|
| updatedAt | LocalDateTime | 更新时间 |
|
||||||
|
| deletedAt | LocalDateTime | 删除时间(软删除) |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 状态码说明
|
||||||
|
|
||||||
|
### 团课状态
|
||||||
|
|
||||||
|
| 状态码 | 含义 |
|
||||||
|
|--------|------|
|
||||||
|
| 0 | 正常 |
|
||||||
|
| 1 | 已取消 |
|
||||||
|
| 2 | 已结束 |
|
||||||
|
|
||||||
|
### 预约状态
|
||||||
|
|
||||||
|
| 状态码 | 含义 |
|
||||||
|
|--------|------|
|
||||||
|
| 0 | 已预约 |
|
||||||
|
| 1 | 已取消 |
|
||||||
|
| 2 | 已出席 |
|
||||||
|
| 3 | 缺席 |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 业务规则
|
||||||
|
|
||||||
|
### 团课管理
|
||||||
|
1. **创建团课**:课程名称为必填项
|
||||||
|
2. **取消团课**:需提前24小时通知,否则拒绝操作
|
||||||
|
3. **团课签到**:验证课程状态必须为正常,且未达最大人数限制
|
||||||
|
4. **删除团课**:采用软删除机制,数据保留可恢复
|
||||||
|
|
||||||
|
### 团课预约
|
||||||
|
1. **预约团课**:需验证会员卡有效性和课程名额
|
||||||
|
2. **取消预约**:需在课程开始前至少2小时取消
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 附录:错误响应格式
|
||||||
|
|
||||||
|
所有接口的错误响应统一格式:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"success": false,
|
||||||
|
"message": "错误描述信息"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
*文档结束*
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
wrapperVersion=3.3.4
|
||||||
|
distributionType=only-script
|
||||||
|
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.15/apache-maven-3.9.15-bin.zip
|
||||||
@@ -0,0 +1,95 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>cn.novalon.gym.manage</groupId>
|
||||||
|
<artifactId>gym-manage-api</artifactId>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
<relativePath>../pom.xml</relativePath>
|
||||||
|
</parent>
|
||||||
|
<groupId>cn.novalon.gym.manage</groupId>
|
||||||
|
<artifactId>gym-groupCourse</artifactId>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
<name>gym-groupCourse</name>
|
||||||
|
<description>Group Course Management Module</description>
|
||||||
|
<url/>
|
||||||
|
<licenses>
|
||||||
|
<license/>
|
||||||
|
</licenses>
|
||||||
|
<developers>
|
||||||
|
<developer/>
|
||||||
|
</developers>
|
||||||
|
<scm>
|
||||||
|
<connection/>
|
||||||
|
<developerConnection/>
|
||||||
|
<tag/>
|
||||||
|
<url/>
|
||||||
|
</scm>
|
||||||
|
<properties>
|
||||||
|
<java.version>21</java.version>
|
||||||
|
</properties>
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.novalon.gym.manage</groupId>
|
||||||
|
<artifactId>manage-common</artifactId>
|
||||||
|
<version>${project.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.novalon.gym.manage</groupId>
|
||||||
|
<artifactId>manage-db</artifactId>
|
||||||
|
<version>${project.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-webflux</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-data-r2dbc</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-validation</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springdoc</groupId>
|
||||||
|
<artifactId>springdoc-openapi-starter-webflux-ui</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-test</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.swagger.core.v3</groupId>
|
||||||
|
<artifactId>swagger-annotations-jakarta</artifactId>
|
||||||
|
<version>2.2.43</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Redis依赖-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-data-redis</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 会员模块依赖 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.novalon.gym.manage</groupId>
|
||||||
|
<artifactId>gym-member</artifactId>
|
||||||
|
<version>${project.version}</version>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
|
||||||
|
</project>
|
||||||
+127
@@ -0,0 +1,127 @@
|
|||||||
|
|
||||||
|
package cn.novalon.gym.manage.groupcourse.converter;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import cn.novalon.gym.manage.groupcourse.domain.GroupCourse;
|
||||||
|
import cn.novalon.gym.manage.groupcourse.domain.GroupCourseBooking;
|
||||||
|
import cn.novalon.gym.manage.groupcourse.entity.GroupCourseBookingEntity;
|
||||||
|
import cn.novalon.gym.manage.groupcourse.entity.GroupCourseEntity;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 团课相关转换器
|
||||||
|
*
|
||||||
|
* @author 张翔
|
||||||
|
* @date 2026-06-01
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
@Slf4j
|
||||||
|
public class GroupCourseConverter {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将团课实体转换为领域模型
|
||||||
|
*/
|
||||||
|
public GroupCourse toDomain(GroupCourseEntity entity){
|
||||||
|
if(entity == null){
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
GroupCourse groupCourse = new GroupCourse();
|
||||||
|
BeanUtil.copyProperties(entity,groupCourse);
|
||||||
|
log.info("转换bean,entity-domain:",groupCourse);
|
||||||
|
return groupCourse;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将团课领域模型转换为实体
|
||||||
|
*/
|
||||||
|
public GroupCourseEntity toEntity(GroupCourse domain){
|
||||||
|
if(domain == null){
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
GroupCourseEntity entity = new GroupCourseEntity();
|
||||||
|
BeanUtil.copyProperties(domain,entity);
|
||||||
|
log.info("转换bean,domain-entity:",entity);
|
||||||
|
return entity;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将团课实体列表转换为领域模型列表
|
||||||
|
*/
|
||||||
|
public List<GroupCourse> toDomainList(List<GroupCourseEntity> entities){
|
||||||
|
if (entities == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return entities.stream()
|
||||||
|
.map(this::toDomain)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将团课领域模型列表转换为实体列表
|
||||||
|
*/
|
||||||
|
public List<GroupCourseEntity> toEntityList(List<GroupCourse> domains){
|
||||||
|
if (domains == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return domains.stream()
|
||||||
|
.map(this::toEntity)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将团课预约实体转换为领域模型
|
||||||
|
*/
|
||||||
|
public GroupCourseBooking toBookingDomain(GroupCourseBookingEntity entity){
|
||||||
|
if(entity == null){
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
GroupCourseBooking booking = new GroupCourseBooking();
|
||||||
|
BeanUtil.copyProperties(entity, booking);
|
||||||
|
log.debug("转换预约记录实体到领域模型:bookingId={}", entity.getId());
|
||||||
|
return booking;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将团课预约领域模型转换为实体
|
||||||
|
*/
|
||||||
|
public GroupCourseBookingEntity toBookingEntity(GroupCourseBooking domain){
|
||||||
|
if(domain == null){
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
GroupCourseBookingEntity entity = new GroupCourseBookingEntity();
|
||||||
|
BeanUtil.copyProperties(domain, entity);
|
||||||
|
if (domain.getId() != null) {
|
||||||
|
entity.markNotNew();
|
||||||
|
}
|
||||||
|
log.debug("转换预约记录领域模型到实体:bookingId={}", domain.getId());
|
||||||
|
return entity;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将团课预约实体列表转换为领域模型列表
|
||||||
|
*/
|
||||||
|
public List<GroupCourseBooking> toBookingDomainList(List<GroupCourseBookingEntity> entities){
|
||||||
|
if (entities == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return entities.stream()
|
||||||
|
.map(this::toBookingDomain)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将团课预约领域模型列表转换为实体列表
|
||||||
|
*/
|
||||||
|
public List<GroupCourseBookingEntity> toBookingEntityList(List<GroupCourseBooking> domains){
|
||||||
|
if (domains == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return domains.stream()
|
||||||
|
.map(this::toBookingEntity)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
}
|
||||||
+111
@@ -0,0 +1,111 @@
|
|||||||
|
package cn.novalon.gym.manage.groupcourse.dao;
|
||||||
|
|
||||||
|
import cn.novalon.gym.manage.groupcourse.entity.GroupCourseBookingEntity;
|
||||||
|
import org.springframework.data.domain.Sort;
|
||||||
|
import org.springframework.data.r2dbc.repository.R2dbcRepository;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
import reactor.core.publisher.Flux;
|
||||||
|
import reactor.core.publisher.Mono;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 团课预约记录DAO接口
|
||||||
|
*
|
||||||
|
* @author 张翔
|
||||||
|
* @date 2026-06-01
|
||||||
|
*/
|
||||||
|
@Repository
|
||||||
|
public interface GroupCourseBookingDao extends R2dbcRepository<GroupCourseBookingEntity, Long> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据ID查询未删除的预约记录
|
||||||
|
*/
|
||||||
|
Mono<GroupCourseBookingEntity> findByIdIsAndDeletedAtIsNull(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据会员ID查询所有预约记录
|
||||||
|
*/
|
||||||
|
Flux<GroupCourseBookingEntity> findByMemberIdAndDeletedAtIsNull(Long memberId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据会员ID查询所有预约记录(带排序)
|
||||||
|
*/
|
||||||
|
Flux<GroupCourseBookingEntity> findByMemberIdAndDeletedAtIsNull(Long memberId, Sort sort);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据团课ID查询所有预约记录
|
||||||
|
*/
|
||||||
|
Flux<GroupCourseBookingEntity> findByCourseIdAndDeletedAtIsNull(Long courseId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据团课ID和会员ID查询预约记录
|
||||||
|
*/
|
||||||
|
Mono<GroupCourseBookingEntity> findByCourseIdAndMemberIdAndDeletedAtIsNull(Long courseId, Long memberId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据团课ID和状态查询预约记录
|
||||||
|
*/
|
||||||
|
Flux<GroupCourseBookingEntity> findByCourseIdAndStatusAndDeletedAtIsNull(Long courseId, String status);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询会员在指定课程的有效预约(状态为已预约且未取消)
|
||||||
|
*/
|
||||||
|
Mono<GroupCourseBookingEntity> findByCourseIdAndMemberIdAndStatusAndDeletedAtIsNull(Long courseId, Long memberId, String status);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据会员卡记录ID查询预约记录
|
||||||
|
*/
|
||||||
|
Flux<GroupCourseBookingEntity> findByMemberCardRecordIdAndDeletedAtIsNull(Long memberCardRecordId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 统计团课已预约人数
|
||||||
|
*/
|
||||||
|
Mono<Long> countByCourseIdAndStatusAndDeletedAtIsNull(Long courseId, String status);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询会员是否有时间冲突的预约(状态为已预约且未取消)
|
||||||
|
* 时间冲突条件:新课程的开始时间 < 已预约课程的结束时间 且 新课程的结束时间 > 已预约课程的开始时间
|
||||||
|
*/
|
||||||
|
@org.springframework.data.r2dbc.repository.Query("SELECT * FROM group_course_booking b " +
|
||||||
|
"JOIN group_course c ON b.course_id = c.id " +
|
||||||
|
"WHERE b.member_id = :memberId " +
|
||||||
|
"AND b.status = '0' " +
|
||||||
|
"AND b.deleted_at IS NULL " +
|
||||||
|
"AND c.deleted_at IS NULL " +
|
||||||
|
"AND :newStartTime < c.end_time " +
|
||||||
|
"AND :newEndTime > c.start_time")
|
||||||
|
Flux<GroupCourseBookingEntity> findConflictingBookings(Long memberId, java.time.LocalDateTime newStartTime, java.time.LocalDateTime newEndTime);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新预约状态
|
||||||
|
*/
|
||||||
|
@org.springframework.data.r2dbc.repository.Modifying
|
||||||
|
@org.springframework.data.r2dbc.repository.Query("UPDATE group_course_booking SET status = :status, cancel_time = :cancelTime, updated_at = :updatedAt WHERE id = :id AND deleted_at IS NULL")
|
||||||
|
Mono<Integer> updateStatus(Long id, String status, java.time.LocalDateTime cancelTime, java.time.LocalDateTime updatedAt);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 软删除预约记录
|
||||||
|
*/
|
||||||
|
@org.springframework.data.r2dbc.repository.Modifying
|
||||||
|
@org.springframework.data.r2dbc.repository.Query("UPDATE group_course_booking SET deleted_at = :deletedAt WHERE id = :id")
|
||||||
|
Mono<Integer> softDelete(Long id, java.time.LocalDateTime deletedAt);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询已开始课程但未到场会员的预约记录
|
||||||
|
* 条件:课程开始时间早于当前时间,预约状态为已预约(0)
|
||||||
|
*/
|
||||||
|
@org.springframework.data.r2dbc.repository.Query("SELECT b.* FROM group_course_booking b " +
|
||||||
|
"JOIN group_course c ON b.course_id = c.id " +
|
||||||
|
"WHERE b.status = '0' " +
|
||||||
|
"AND b.deleted_at IS NULL " +
|
||||||
|
"AND c.deleted_at IS NULL " +
|
||||||
|
"AND c.status = '0' " +
|
||||||
|
"AND c.start_time < CURRENT_TIMESTAMP")
|
||||||
|
Flux<GroupCourseBookingEntity> findAbsentMembers();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量更新预约状态为缺席
|
||||||
|
*/
|
||||||
|
@org.springframework.data.r2dbc.repository.Modifying
|
||||||
|
@org.springframework.data.r2dbc.repository.Query("UPDATE group_course_booking SET status = '3', updated_at = :updatedAt WHERE id = :id AND deleted_at IS NULL")
|
||||||
|
Mono<Integer> updateToAbsent(Long id, java.time.LocalDateTime updatedAt);
|
||||||
|
}
|
||||||
+39
@@ -0,0 +1,39 @@
|
|||||||
|
|
||||||
|
package cn.novalon.gym.manage.groupcourse.dao;
|
||||||
|
|
||||||
|
import cn.novalon.gym.manage.groupcourse.entity.GroupCourseEntity;
|
||||||
|
import org.springframework.data.domain.Sort;
|
||||||
|
import org.springframework.data.r2dbc.repository.Modifying;
|
||||||
|
import org.springframework.data.r2dbc.repository.Query;
|
||||||
|
import org.springframework.data.r2dbc.repository.R2dbcRepository;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
import reactor.core.publisher.Flux;
|
||||||
|
import reactor.core.publisher.Mono;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public interface GroupCourseDao extends R2dbcRepository<GroupCourseEntity, Long> {
|
||||||
|
|
||||||
|
Mono<GroupCourseEntity> findByIdIsAndDeletedAtIsNull(Long id);
|
||||||
|
|
||||||
|
Flux<GroupCourseEntity> findAll();
|
||||||
|
|
||||||
|
Flux<GroupCourseEntity> findAll(Sort sort);
|
||||||
|
|
||||||
|
Flux<GroupCourseEntity> findAllByDeletedAtIsNull();
|
||||||
|
|
||||||
|
Flux<GroupCourseEntity> findAllByDeletedAtIsNull(Sort sort);
|
||||||
|
|
||||||
|
@Modifying
|
||||||
|
@Query("UPDATE group_course SET status = '1', updated_at = :updatedAt WHERE id = :id AND deleted_at IS NULL")
|
||||||
|
Mono<Integer> cancelCourse(Long id, LocalDateTime updatedAt);
|
||||||
|
|
||||||
|
@Modifying
|
||||||
|
@Query("UPDATE group_course SET current_members = current_members + :delta, updated_at = :updatedAt WHERE id = :id AND deleted_at IS NULL")
|
||||||
|
Mono<Integer> updateCurrentMembers(Long id, Integer delta, LocalDateTime updatedAt);
|
||||||
|
|
||||||
|
@Modifying
|
||||||
|
@Query("UPDATE group_course SET deleted_at = :deletedAt WHERE id = :id")
|
||||||
|
Mono<Integer> softDelete(Long id, LocalDateTime deletedAt);
|
||||||
|
}
|
||||||
+166
@@ -0,0 +1,166 @@
|
|||||||
|
|
||||||
|
package cn.novalon.gym.manage.groupcourse.domain;
|
||||||
|
|
||||||
|
import cn.novalon.gym.manage.sys.core.domain.BaseDomain;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
public class GroupCourse extends BaseDomain{
|
||||||
|
|
||||||
|
//课程名称
|
||||||
|
@Schema(description = "团课名", example = "Push-up")
|
||||||
|
private String courseName;
|
||||||
|
|
||||||
|
//教练id
|
||||||
|
@Schema(description = "教练id", example = "1")
|
||||||
|
private Long coachId;
|
||||||
|
|
||||||
|
//课程类型
|
||||||
|
@Schema(description = "课程类型", example = "1")
|
||||||
|
private Long courseType;
|
||||||
|
|
||||||
|
//开始时间
|
||||||
|
@Schema(description = "开始时间", example = "2026-01-01")
|
||||||
|
private LocalDateTime startTime;
|
||||||
|
|
||||||
|
//结束时间
|
||||||
|
@Schema(description = "结束时间", example = "2026-01-02")
|
||||||
|
private LocalDateTime endTime;
|
||||||
|
|
||||||
|
//最大参与人数
|
||||||
|
@Schema(description = "最大参与人数", example = "20")
|
||||||
|
private Integer maxMembers;
|
||||||
|
|
||||||
|
//当前参与人数
|
||||||
|
@Schema(description = "当前参与人数", example = "2")
|
||||||
|
private Integer currentMembers;
|
||||||
|
|
||||||
|
//课程状态:0-正常,1-已取消,2-已结束
|
||||||
|
@Schema(description = "课程状态", example = "0")
|
||||||
|
private Long status;
|
||||||
|
|
||||||
|
//上课地点
|
||||||
|
@Schema(description = "上课地点", example = "龙泉驿区幸福路")
|
||||||
|
private String location;
|
||||||
|
|
||||||
|
//封面图URL
|
||||||
|
@Schema(description = "封面图URL", example = "https://12345.com")
|
||||||
|
private String coverImage;
|
||||||
|
|
||||||
|
//课程描述
|
||||||
|
@Schema(description = "课程描述", example = "从入门到入土")
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
//点卡额度(消耗次数)
|
||||||
|
@Schema(description = "点卡额度(消耗次数)", example = "1")
|
||||||
|
private Integer pointCardAmount;
|
||||||
|
|
||||||
|
//储值卡额度(消耗金额)
|
||||||
|
@Schema(description = "储值卡额度(消耗金额)", example = "50.00")
|
||||||
|
private java.math.BigDecimal storedValueAmount;
|
||||||
|
|
||||||
|
public String getCourseName() {
|
||||||
|
return courseName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCourseName(String courseName) {
|
||||||
|
this.courseName = courseName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getCoachId() {
|
||||||
|
return coachId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCoachId(Long coachId) {
|
||||||
|
this.coachId = coachId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getCourseType() {
|
||||||
|
return courseType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCourseType(Long courseType) {
|
||||||
|
this.courseType = courseType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LocalDateTime getStartTime() {
|
||||||
|
return startTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStartTime(LocalDateTime startTime) {
|
||||||
|
this.startTime = startTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LocalDateTime getEndTime() {
|
||||||
|
return endTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEndTime(LocalDateTime endTime) {
|
||||||
|
this.endTime = endTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getMaxMembers() {
|
||||||
|
return maxMembers;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMaxMembers(Integer maxMembers) {
|
||||||
|
this.maxMembers = maxMembers;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getCurrentMembers() {
|
||||||
|
return currentMembers;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCurrentMembers(Integer currentMembers) {
|
||||||
|
this.currentMembers = currentMembers;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getStatus() {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStatus(Long status) {
|
||||||
|
this.status = status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLocation() {
|
||||||
|
return location;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLocation(String location) {
|
||||||
|
this.location = location;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCoverImage() {
|
||||||
|
return coverImage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCoverImage(String coverImage) {
|
||||||
|
this.coverImage = coverImage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescription() {
|
||||||
|
return description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDescription(String description) {
|
||||||
|
this.description = description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getPointCardAmount() {
|
||||||
|
return pointCardAmount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPointCardAmount(Integer pointCardAmount) {
|
||||||
|
this.pointCardAmount = pointCardAmount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public java.math.BigDecimal getStoredValueAmount() {
|
||||||
|
return storedValueAmount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStoredValueAmount(java.math.BigDecimal storedValueAmount) {
|
||||||
|
this.storedValueAmount = storedValueAmount;
|
||||||
|
}
|
||||||
|
}
|
||||||
+135
@@ -0,0 +1,135 @@
|
|||||||
|
package cn.novalon.gym.manage.groupcourse.domain;
|
||||||
|
|
||||||
|
import cn.novalon.gym.manage.sys.core.domain.BaseDomain;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 团课预约记录领域模型
|
||||||
|
*
|
||||||
|
* @author 张翔
|
||||||
|
* @date 2026-06-01
|
||||||
|
*/
|
||||||
|
public class GroupCourseBooking extends BaseDomain {
|
||||||
|
|
||||||
|
//团课ID
|
||||||
|
@Schema(description = "团课ID", example = "1")
|
||||||
|
private Long courseId;
|
||||||
|
|
||||||
|
//团课名称(关联查询)
|
||||||
|
@Schema(description = "团课名称", example = "瑜伽入门")
|
||||||
|
private String courseName;
|
||||||
|
|
||||||
|
//会员ID
|
||||||
|
@Schema(description = "会员ID", example = "1")
|
||||||
|
private Long memberId;
|
||||||
|
|
||||||
|
//会员卡记录ID
|
||||||
|
@Schema(description = "会员卡记录ID", example = "1")
|
||||||
|
private Long memberCardRecordId;
|
||||||
|
|
||||||
|
//预约时间
|
||||||
|
@Schema(description = "预约时间", example = "2026-06-01 10:00:00")
|
||||||
|
private LocalDateTime bookingTime;
|
||||||
|
|
||||||
|
//状态:0-已预约,1-已取消,2-已出席,3-缺席
|
||||||
|
@Schema(description = "状态:0-已预约,1-已取消,2-已出席,3-缺席", example = "0")
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
//取消时间
|
||||||
|
@Schema(description = "取消时间", example = "2026-06-01 11:00:00")
|
||||||
|
private LocalDateTime cancelTime;
|
||||||
|
|
||||||
|
//课程开始时间
|
||||||
|
@Schema(description = "课程开始时间", example = "2026-06-02 09:00:00")
|
||||||
|
private LocalDateTime courseStartTime;
|
||||||
|
|
||||||
|
//课程结束时间
|
||||||
|
@Schema(description = "课程结束时间", example = "2026-06-02 10:00:00")
|
||||||
|
private LocalDateTime courseEndTime;
|
||||||
|
|
||||||
|
//上课地点
|
||||||
|
@Schema(description = "上课地点", example = "健身房A区")
|
||||||
|
private String location;
|
||||||
|
|
||||||
|
public Long getCourseId() {
|
||||||
|
return courseId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCourseId(Long courseId) {
|
||||||
|
this.courseId = courseId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCourseName() {
|
||||||
|
return courseName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCourseName(String courseName) {
|
||||||
|
this.courseName = courseName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getMemberId() {
|
||||||
|
return memberId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMemberId(Long memberId) {
|
||||||
|
this.memberId = memberId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getMemberCardRecordId() {
|
||||||
|
return memberCardRecordId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMemberCardRecordId(Long memberCardRecordId) {
|
||||||
|
this.memberCardRecordId = memberCardRecordId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LocalDateTime getBookingTime() {
|
||||||
|
return bookingTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBookingTime(LocalDateTime bookingTime) {
|
||||||
|
this.bookingTime = bookingTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStatus() {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStatus(String status) {
|
||||||
|
this.status = status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LocalDateTime getCancelTime() {
|
||||||
|
return cancelTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCancelTime(LocalDateTime cancelTime) {
|
||||||
|
this.cancelTime = cancelTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LocalDateTime getCourseStartTime() {
|
||||||
|
return courseStartTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCourseStartTime(LocalDateTime courseStartTime) {
|
||||||
|
this.courseStartTime = courseStartTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LocalDateTime getCourseEndTime() {
|
||||||
|
return courseEndTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCourseEndTime(LocalDateTime courseEndTime) {
|
||||||
|
this.courseEndTime = courseEndTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLocation() {
|
||||||
|
return location;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLocation(String location) {
|
||||||
|
this.location = location;
|
||||||
|
}
|
||||||
|
}
|
||||||
+137
@@ -0,0 +1,137 @@
|
|||||||
|
package cn.novalon.gym.manage.groupcourse.entity;
|
||||||
|
|
||||||
|
import cn.novalon.gym.manage.db.entity.BaseEntity;
|
||||||
|
import org.springframework.data.relational.core.mapping.Column;
|
||||||
|
import org.springframework.data.relational.core.mapping.Table;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 团课预约记录实体类 - 对应 group_course_booking 表
|
||||||
|
*
|
||||||
|
* @author 张翔
|
||||||
|
* @date 2026-06-01
|
||||||
|
*/
|
||||||
|
@Table("group_course_booking")
|
||||||
|
public class GroupCourseBookingEntity extends BaseEntity {
|
||||||
|
|
||||||
|
//团课ID
|
||||||
|
@Column("course_id")
|
||||||
|
private Long courseId;
|
||||||
|
|
||||||
|
//会员ID
|
||||||
|
@Column("member_id")
|
||||||
|
private Long memberId;
|
||||||
|
|
||||||
|
//会员卡记录ID
|
||||||
|
@Column("member_card_id")
|
||||||
|
private Long memberCardRecordId;
|
||||||
|
|
||||||
|
//预约时间
|
||||||
|
@Column("booking_time")
|
||||||
|
private LocalDateTime bookingTime;
|
||||||
|
|
||||||
|
//状态:0-已预约,1-已取消,2-已出席,3-缺席
|
||||||
|
@Column("status")
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
//取消时间
|
||||||
|
@Column("cancel_time")
|
||||||
|
private LocalDateTime cancelTime;
|
||||||
|
|
||||||
|
//课程名称(冗余字段,保存预约时的课程快照)
|
||||||
|
@Column("course_name")
|
||||||
|
private String courseName;
|
||||||
|
|
||||||
|
//课程开始时间(冗余字段,保存预约时的课程快照)
|
||||||
|
@Column("course_start_time")
|
||||||
|
private LocalDateTime courseStartTime;
|
||||||
|
|
||||||
|
//课程结束时间(冗余字段,保存预约时的课程快照)
|
||||||
|
@Column("course_end_time")
|
||||||
|
private LocalDateTime courseEndTime;
|
||||||
|
|
||||||
|
//上课地点(冗余字段,保存预约时的课程快照)
|
||||||
|
@Column("location")
|
||||||
|
private String location;
|
||||||
|
|
||||||
|
public Long getCourseId() {
|
||||||
|
return courseId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCourseId(Long courseId) {
|
||||||
|
this.courseId = courseId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getMemberId() {
|
||||||
|
return memberId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMemberId(Long memberId) {
|
||||||
|
this.memberId = memberId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getMemberCardRecordId() {
|
||||||
|
return memberCardRecordId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMemberCardRecordId(Long memberCardRecordId) {
|
||||||
|
this.memberCardRecordId = memberCardRecordId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LocalDateTime getBookingTime() {
|
||||||
|
return bookingTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBookingTime(LocalDateTime bookingTime) {
|
||||||
|
this.bookingTime = bookingTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStatus() {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStatus(String status) {
|
||||||
|
this.status = status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LocalDateTime getCancelTime() {
|
||||||
|
return cancelTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCancelTime(LocalDateTime cancelTime) {
|
||||||
|
this.cancelTime = cancelTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCourseName() {
|
||||||
|
return courseName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCourseName(String courseName) {
|
||||||
|
this.courseName = courseName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LocalDateTime getCourseStartTime() {
|
||||||
|
return courseStartTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCourseStartTime(LocalDateTime courseStartTime) {
|
||||||
|
this.courseStartTime = courseStartTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LocalDateTime getCourseEndTime() {
|
||||||
|
return courseEndTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCourseEndTime(LocalDateTime courseEndTime) {
|
||||||
|
this.courseEndTime = courseEndTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLocation() {
|
||||||
|
return location;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLocation(String location) {
|
||||||
|
this.location = location;
|
||||||
|
}
|
||||||
|
}
|
||||||
+168
@@ -0,0 +1,168 @@
|
|||||||
|
|
||||||
|
package cn.novalon.gym.manage.groupcourse.entity;
|
||||||
|
|
||||||
|
import cn.novalon.gym.manage.db.entity.BaseEntity;
|
||||||
|
import org.springframework.data.relational.core.mapping.Column;
|
||||||
|
import org.springframework.data.relational.core.mapping.Table;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
@Table("group_course")
|
||||||
|
public class GroupCourseEntity extends BaseEntity {
|
||||||
|
|
||||||
|
//课程名称
|
||||||
|
@Column("course_name")
|
||||||
|
private String courseName;
|
||||||
|
|
||||||
|
//教练id
|
||||||
|
@Column("coach_id")
|
||||||
|
private Long coachId;
|
||||||
|
|
||||||
|
//课程类型
|
||||||
|
@Column("course_type")
|
||||||
|
private Long courseType;
|
||||||
|
|
||||||
|
//开始时间
|
||||||
|
@Column("start_time")
|
||||||
|
private LocalDateTime startTime;
|
||||||
|
|
||||||
|
//结束时间
|
||||||
|
@Column("end_time")
|
||||||
|
private LocalDateTime endTime;
|
||||||
|
|
||||||
|
//最大参与人数
|
||||||
|
@Column("max_members")
|
||||||
|
private Integer maxMembers;
|
||||||
|
|
||||||
|
//当前参与人数
|
||||||
|
@Column("current_members")
|
||||||
|
private Integer currentMembers;
|
||||||
|
|
||||||
|
//课程状态:0-正常,1-已取消,2-已结束
|
||||||
|
@Column("status")
|
||||||
|
private Long status;
|
||||||
|
|
||||||
|
//上课地点
|
||||||
|
@Column("location")
|
||||||
|
private String location;
|
||||||
|
|
||||||
|
//封面图URL
|
||||||
|
@Column("cover_image")
|
||||||
|
private String coverImage;
|
||||||
|
|
||||||
|
//课程描述
|
||||||
|
@Column("description")
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
//点卡额度(消耗次数)
|
||||||
|
@Column("point_card_amount")
|
||||||
|
private Integer pointCardAmount;
|
||||||
|
|
||||||
|
//储值卡额度(消耗金额)
|
||||||
|
@Column("stored_value_amount")
|
||||||
|
private java.math.BigDecimal storedValueAmount;
|
||||||
|
|
||||||
|
public String getCourseName() {
|
||||||
|
return courseName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCourseName(String courseName) {
|
||||||
|
this.courseName = courseName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getCoachId() {
|
||||||
|
return coachId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCoachId(Long coachId) {
|
||||||
|
this.coachId = coachId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getCourseType() {
|
||||||
|
return courseType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCourseType(Long courseType) {
|
||||||
|
this.courseType = courseType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LocalDateTime getStartTime() {
|
||||||
|
return startTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStartTime(LocalDateTime startTime) {
|
||||||
|
this.startTime = startTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LocalDateTime getEndTime() {
|
||||||
|
return endTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEndTime(LocalDateTime endTime) {
|
||||||
|
this.endTime = endTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getMaxMembers() {
|
||||||
|
return maxMembers;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMaxMembers(Integer maxMembers) {
|
||||||
|
this.maxMembers = maxMembers;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getCurrentMembers() {
|
||||||
|
return currentMembers;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCurrentMembers(Integer currentMembers) {
|
||||||
|
this.currentMembers = currentMembers;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getStatus() {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStatus(Long status) {
|
||||||
|
this.status = status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLocation() {
|
||||||
|
return location;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLocation(String location) {
|
||||||
|
this.location = location;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCoverImage() {
|
||||||
|
return coverImage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCoverImage(String coverImage) {
|
||||||
|
this.coverImage = coverImage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescription() {
|
||||||
|
return description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDescription(String description) {
|
||||||
|
this.description = description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getPointCardAmount() {
|
||||||
|
return pointCardAmount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPointCardAmount(Integer pointCardAmount) {
|
||||||
|
this.pointCardAmount = pointCardAmount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public java.math.BigDecimal getStoredValueAmount() {
|
||||||
|
return storedValueAmount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStoredValueAmount(java.math.BigDecimal storedValueAmount) {
|
||||||
|
this.storedValueAmount = storedValueAmount;
|
||||||
|
}
|
||||||
|
}
|
||||||
+24
@@ -0,0 +1,24 @@
|
|||||||
|
package cn.novalon.gym.manage.groupcourse.enums;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 团课状态机事件枚举
|
||||||
|
*
|
||||||
|
* @author 张翔
|
||||||
|
* @date 2026-06-02
|
||||||
|
*/
|
||||||
|
public enum CourseEvent {
|
||||||
|
|
||||||
|
CANCEL("取消课程"),
|
||||||
|
END("结束课程"),
|
||||||
|
START("开始课程");
|
||||||
|
|
||||||
|
private final String desc;
|
||||||
|
|
||||||
|
CourseEvent(String desc) {
|
||||||
|
this.desc = desc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDesc() {
|
||||||
|
return desc;
|
||||||
|
}
|
||||||
|
}
|
||||||
+43
@@ -0,0 +1,43 @@
|
|||||||
|
package cn.novalon.gym.manage.groupcourse.enums;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 团课状态枚举
|
||||||
|
*
|
||||||
|
* @author 张翔
|
||||||
|
* @date 2026-06-02
|
||||||
|
*/
|
||||||
|
public enum CourseStatus {
|
||||||
|
|
||||||
|
NORMAL(0L, "正常"),
|
||||||
|
CANCELLED(1L, "已取消"),
|
||||||
|
ENDED(2L, "已结束"),
|
||||||
|
IN_PROGRESS(3L, "进行中");
|
||||||
|
|
||||||
|
private final Long value;
|
||||||
|
private final String desc;
|
||||||
|
|
||||||
|
CourseStatus(Long value, String desc) {
|
||||||
|
this.value = value;
|
||||||
|
this.desc = desc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getValue() {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDesc() {
|
||||||
|
return desc;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据值获取枚举
|
||||||
|
*/
|
||||||
|
public static CourseStatus fromValue(Long value) {
|
||||||
|
for (CourseStatus status : values()) {
|
||||||
|
if (status.value.equals(value)) {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return NORMAL;
|
||||||
|
}
|
||||||
|
}
|
||||||
+57
@@ -0,0 +1,57 @@
|
|||||||
|
package cn.novalon.gym.manage.groupcourse.event;
|
||||||
|
|
||||||
|
import org.springframework.context.ApplicationEvent;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预约提醒事件
|
||||||
|
*
|
||||||
|
* @author 张翔
|
||||||
|
* @date 2026-06-01
|
||||||
|
*/
|
||||||
|
public class BookingReminderEvent extends ApplicationEvent {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 消息类型枚举
|
||||||
|
*/
|
||||||
|
public enum ReminderType {
|
||||||
|
BOOKING_SUCCESS, // 预约成功
|
||||||
|
COURSE_REMINDER, // 课程即将开始提醒
|
||||||
|
BOOKING_CANCEL // 预约取消
|
||||||
|
}
|
||||||
|
|
||||||
|
private final Long bookingId;
|
||||||
|
private final Long memberId;
|
||||||
|
private final String courseName;
|
||||||
|
private final String courseTime;
|
||||||
|
private final ReminderType type;
|
||||||
|
|
||||||
|
public BookingReminderEvent(Object source, Long bookingId, Long memberId,
|
||||||
|
String courseName, String courseTime, ReminderType type) {
|
||||||
|
super(source);
|
||||||
|
this.bookingId = bookingId;
|
||||||
|
this.memberId = memberId;
|
||||||
|
this.courseName = courseName;
|
||||||
|
this.courseTime = courseTime;
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getBookingId() {
|
||||||
|
return bookingId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getMemberId() {
|
||||||
|
return memberId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCourseName() {
|
||||||
|
return courseName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCourseTime() {
|
||||||
|
return courseTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ReminderType getType() {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
}
|
||||||
+98
@@ -0,0 +1,98 @@
|
|||||||
|
package cn.novalon.gym.manage.groupcourse.event;
|
||||||
|
|
||||||
|
import cn.novalon.gym.manage.groupcourse.event.BookingReminderEvent.ReminderType;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.context.event.EventListener;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预约提醒事件监听器
|
||||||
|
*
|
||||||
|
* 监听预约相关事件,处理提醒业务
|
||||||
|
*
|
||||||
|
* @author 张翔
|
||||||
|
* @date 2026-06-01
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
public class BookingReminderEventListener {
|
||||||
|
|
||||||
|
private static final Logger logger = LoggerFactory.getLogger(BookingReminderEventListener.class);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处理预约提醒事件
|
||||||
|
*
|
||||||
|
* @param event 预约提醒事件
|
||||||
|
*/
|
||||||
|
@EventListener
|
||||||
|
public void handleBookingReminderEvent(BookingReminderEvent event) {
|
||||||
|
logger.info("收到预约提醒事件:type={}, bookingId={}, memberId={}",
|
||||||
|
event.getType(), event.getBookingId(), event.getMemberId());
|
||||||
|
|
||||||
|
try {
|
||||||
|
processReminderEvent(event);
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("处理预约提醒事件失败:bookingId={}, error={}",
|
||||||
|
event.getBookingId(), e.getMessage(), e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处理提醒事件
|
||||||
|
*
|
||||||
|
* 根据事件类型执行不同的提醒逻辑
|
||||||
|
*/
|
||||||
|
private void processReminderEvent(BookingReminderEvent event) {
|
||||||
|
switch (event.getType()) {
|
||||||
|
case BOOKING_SUCCESS:
|
||||||
|
handleBookingSuccess(event);
|
||||||
|
break;
|
||||||
|
case COURSE_REMINDER:
|
||||||
|
handleCourseReminder(event);
|
||||||
|
break;
|
||||||
|
case BOOKING_CANCEL:
|
||||||
|
handleBookingCancel(event);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
logger.warn("未知的提醒事件类型:{}", event.getType());
|
||||||
|
}
|
||||||
|
|
||||||
|
logger.info("预约提醒事件处理完成:bookingId={}", event.getBookingId());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处理预约成功事件
|
||||||
|
*/
|
||||||
|
private void handleBookingSuccess(BookingReminderEvent event) {
|
||||||
|
logger.info("处理预约成功提醒:会员ID={}, 课程={}, 时间={}",
|
||||||
|
event.getMemberId(), event.getCourseName(), event.getCourseTime());
|
||||||
|
|
||||||
|
// 实际业务中会调用通知服务发送短信、APP推送等
|
||||||
|
// sendNotification(event.getMemberId(), "预约成功",
|
||||||
|
// "您已成功预约课程:" + event.getCourseName() + ",时间:" + event.getCourseTime());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处理课程即将开始提醒事件
|
||||||
|
*/
|
||||||
|
private void handleCourseReminder(BookingReminderEvent event) {
|
||||||
|
logger.info("处理课程提醒:会员ID={}, 课程={}, 时间={}",
|
||||||
|
event.getMemberId(), event.getCourseName(), event.getCourseTime());
|
||||||
|
|
||||||
|
// 实际业务中会调用通知服务发送课程开始前提醒
|
||||||
|
// sendNotification(event.getMemberId(), "课程提醒",
|
||||||
|
// "您预约的课程" + event.getCourseName() + "即将开始,时间:" + event.getCourseTime());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处理预约取消事件
|
||||||
|
*/
|
||||||
|
private void handleBookingCancel(BookingReminderEvent event) {
|
||||||
|
logger.info("处理预约取消提醒:会员ID={}, 课程={}",
|
||||||
|
event.getMemberId(), event.getCourseName());
|
||||||
|
|
||||||
|
// 实际业务中会调用通知服务发送预约取消通知
|
||||||
|
// sendNotification(event.getMemberId(), "预约取消",
|
||||||
|
// "您已取消课程:" + event.getCourseName() + "的预约");
|
||||||
|
}
|
||||||
|
}
|
||||||
+74
@@ -0,0 +1,74 @@
|
|||||||
|
package cn.novalon.gym.manage.groupcourse.event;
|
||||||
|
|
||||||
|
import cn.novalon.gym.manage.groupcourse.event.BookingReminderEvent.ReminderType;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.context.ApplicationEventPublisher;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预约提醒事件发布器
|
||||||
|
*
|
||||||
|
* 使用Spring事件机制发布预约相关事件
|
||||||
|
*
|
||||||
|
* @author 张翔
|
||||||
|
* @date 2026-06-01
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
public class BookingReminderEventPublisher {
|
||||||
|
|
||||||
|
private static final Logger logger = LoggerFactory.getLogger(BookingReminderEventPublisher.class);
|
||||||
|
|
||||||
|
private final ApplicationEventPublisher eventPublisher;
|
||||||
|
|
||||||
|
public BookingReminderEventPublisher(ApplicationEventPublisher eventPublisher) {
|
||||||
|
this.eventPublisher = eventPublisher;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发布预约成功事件
|
||||||
|
*
|
||||||
|
* @param bookingId 预约ID
|
||||||
|
* @param memberId 会员ID
|
||||||
|
* @param courseName 课程名称
|
||||||
|
* @param courseTime 课程时间
|
||||||
|
*/
|
||||||
|
public void publishBookingSuccessEvent(Long bookingId, Long memberId, String courseName, String courseTime) {
|
||||||
|
BookingReminderEvent event = new BookingReminderEvent(
|
||||||
|
this, bookingId, memberId, courseName, courseTime, ReminderType.BOOKING_SUCCESS);
|
||||||
|
|
||||||
|
logger.info("发布预约成功事件:bookingId={}, memberId={}", bookingId, memberId);
|
||||||
|
eventPublisher.publishEvent(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发布课程即将开始提醒事件
|
||||||
|
*
|
||||||
|
* @param bookingId 预约ID
|
||||||
|
* @param memberId 会员ID
|
||||||
|
* @param courseName 课程名称
|
||||||
|
* @param courseTime 课程时间
|
||||||
|
*/
|
||||||
|
public void publishCourseReminderEvent(Long bookingId, Long memberId, String courseName, String courseTime) {
|
||||||
|
BookingReminderEvent event = new BookingReminderEvent(
|
||||||
|
this, bookingId, memberId, courseName, courseTime, ReminderType.COURSE_REMINDER);
|
||||||
|
|
||||||
|
logger.info("发布课程提醒事件:bookingId={}, memberId={}", bookingId, memberId);
|
||||||
|
eventPublisher.publishEvent(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发布预约取消事件
|
||||||
|
*
|
||||||
|
* @param bookingId 预约ID
|
||||||
|
* @param memberId 会员ID
|
||||||
|
* @param courseName 课程名称
|
||||||
|
*/
|
||||||
|
public void publishBookingCancelEvent(Long bookingId, Long memberId, String courseName) {
|
||||||
|
BookingReminderEvent event = new BookingReminderEvent(
|
||||||
|
this, bookingId, memberId, courseName, null, ReminderType.BOOKING_CANCEL);
|
||||||
|
|
||||||
|
logger.info("发布预约取消事件:bookingId={}, memberId={}", bookingId, memberId);
|
||||||
|
eventPublisher.publishEvent(event);
|
||||||
|
}
|
||||||
|
}
|
||||||
+369
@@ -0,0 +1,369 @@
|
|||||||
|
package cn.novalon.gym.manage.groupcourse.handler;
|
||||||
|
|
||||||
|
import cn.novalon.gym.manage.groupcourse.domain.GroupCourseBooking;
|
||||||
|
import cn.novalon.gym.manage.groupcourse.repository.IGroupCourseBookingRepository;
|
||||||
|
import cn.novalon.gym.manage.groupcourse.repository.IGroupCourseRepository;
|
||||||
|
import cn.novalon.gym.manage.groupcourse.service.impl.GroupCourseRedisService;
|
||||||
|
import cn.novalon.gym.manage.member.entity.MemberCard;
|
||||||
|
import cn.novalon.gym.manage.member.entity.MemberCardRecord;
|
||||||
|
import cn.novalon.gym.manage.member.enums.MemberCardType;
|
||||||
|
import cn.novalon.gym.manage.member.repository.MemberCardRepository;
|
||||||
|
import cn.novalon.gym.manage.member.service.IMemberCardRecordService;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import reactor.core.publisher.Mono;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预约 Saga 处理器
|
||||||
|
*
|
||||||
|
* 实现预约和取消预约的分布式事务处理
|
||||||
|
*
|
||||||
|
* @author 张翔
|
||||||
|
* @date 2026-06-02
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Component
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class BookingSagaHandler {
|
||||||
|
|
||||||
|
private final IGroupCourseBookingRepository bookingRepository;
|
||||||
|
private final IGroupCourseRepository courseRepository;
|
||||||
|
private final IMemberCardRecordService memberCardRecordService;
|
||||||
|
private final MemberCardRepository memberCardRepository;
|
||||||
|
private final GroupCourseRedisService redisService;
|
||||||
|
|
||||||
|
private static final double DEFAULT_GROUP_COURSE_PRICE = 50.0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 执行预约事务
|
||||||
|
*
|
||||||
|
* 步骤:
|
||||||
|
* 1. 保存预约记录
|
||||||
|
* 2. 扣减会员卡权益
|
||||||
|
* 3. 更新课程当前人数
|
||||||
|
*/
|
||||||
|
public Mono<GroupCourseBooking> executeBooking(GroupCourseBooking booking, Long recordId) {
|
||||||
|
List<SagaStep> steps = new ArrayList<>();
|
||||||
|
List<SagaStep> rollbackSteps = new ArrayList<>();
|
||||||
|
|
||||||
|
// 步骤1:保存预约记录
|
||||||
|
SagaStep step1 = new SagaStep(
|
||||||
|
"保存预约记录",
|
||||||
|
saveBooking(booking),
|
||||||
|
Mono.defer(() -> deleteBooking(booking.getId()))
|
||||||
|
);
|
||||||
|
steps.add(step1);
|
||||||
|
rollbackSteps.add(0, step1);
|
||||||
|
|
||||||
|
// 步骤2:扣减会员卡权益(根据卡类型决定扣除次数还是金额)
|
||||||
|
SagaStep step2 = new SagaStep(
|
||||||
|
"扣减会员卡权益",
|
||||||
|
deductCardUsageByCardType(booking.getMemberId(), recordId),
|
||||||
|
Mono.defer(() -> restoreCardUsageByCardType(booking.getMemberId(), recordId))
|
||||||
|
);
|
||||||
|
steps.add(step2);
|
||||||
|
rollbackSteps.add(0, step2);
|
||||||
|
|
||||||
|
// 步骤3:更新课程当前人数
|
||||||
|
SagaStep step3 = new SagaStep(
|
||||||
|
"更新课程当前人数",
|
||||||
|
incrementCourseCurrentMembers(booking.getCourseId()),
|
||||||
|
Mono.defer(() -> decrementCourseCurrentMembers(booking.getCourseId()))
|
||||||
|
);
|
||||||
|
steps.add(step3);
|
||||||
|
rollbackSteps.add(0, step3);
|
||||||
|
|
||||||
|
// 步骤4:更新Redis预约计数
|
||||||
|
SagaStep step4 = new SagaStep(
|
||||||
|
"更新Redis预约计数",
|
||||||
|
incrementRedisBookingCount(booking.getCourseId()),
|
||||||
|
Mono.defer(() -> decrementRedisBookingCount(booking.getCourseId()))
|
||||||
|
);
|
||||||
|
steps.add(step4);
|
||||||
|
rollbackSteps.add(0, step4);
|
||||||
|
|
||||||
|
return executeSaga(steps, rollbackSteps)
|
||||||
|
.then(Mono.just(booking));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据会员卡类型扣减权益
|
||||||
|
*/
|
||||||
|
private Mono<Void> deductCardUsageByCardType(Long memberId, Long recordId) {
|
||||||
|
return memberCardRecordService.findById(recordId)
|
||||||
|
.switchIfEmpty(Mono.error(new RuntimeException("会员卡记录不存在")))
|
||||||
|
.flatMap(record -> {
|
||||||
|
// 验证会员卡归属
|
||||||
|
if (!record.getMemberId().equals(memberId)) {
|
||||||
|
return Mono.error(new RuntimeException("会员卡不归属当前用户"));
|
||||||
|
}
|
||||||
|
|
||||||
|
return memberCardRepository.findById(record.getMemberCardId())
|
||||||
|
.flatMap(card -> {
|
||||||
|
MemberCardType cardType = MemberCardType.valueOf(card.getMemberCardType());
|
||||||
|
|
||||||
|
switch (cardType) {
|
||||||
|
case COUNT_CARD:
|
||||||
|
// 次卡扣除次数
|
||||||
|
return deductCardUsage(recordId, 1, 0.0);
|
||||||
|
case STORED_VALUE_CARD:
|
||||||
|
// 储值卡扣除金额
|
||||||
|
return deductCardUsage(recordId, 0, DEFAULT_GROUP_COURSE_PRICE);
|
||||||
|
case TIME_CARD:
|
||||||
|
// 时长卡不扣除,但需验证有效期
|
||||||
|
return validateTimeCard(record);
|
||||||
|
default:
|
||||||
|
return Mono.error(new RuntimeException("不支持的会员卡类型: " + cardType));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 验证时长卡有效期
|
||||||
|
*
|
||||||
|
* @param record 会员卡记录
|
||||||
|
* @return 验证通过返回Mono.empty(),否则返回Mono.error()
|
||||||
|
*/
|
||||||
|
private Mono<Void> validateTimeCard(MemberCardRecord record) {
|
||||||
|
// 验证会员卡状态
|
||||||
|
cn.novalon.gym.manage.member.enums.MemberCardRecordStatus status = record.getStatus();
|
||||||
|
if (status != cn.novalon.gym.manage.member.enums.MemberCardRecordStatus.ACTIVE) {
|
||||||
|
return Mono.error(new RuntimeException("会员卡状态无效,当前状态: " + (status != null ? status.getDesc() : "未知")));
|
||||||
|
}
|
||||||
|
|
||||||
|
// 验证有效期
|
||||||
|
java.time.LocalDateTime expireTime = record.getExpireTime();
|
||||||
|
if (expireTime == null) {
|
||||||
|
return Mono.error(new RuntimeException("会员卡有效期未设置"));
|
||||||
|
}
|
||||||
|
if (expireTime.isBefore(java.time.LocalDateTime.now())) {
|
||||||
|
return Mono.error(new RuntimeException("会员卡已过期,有效期至: " + expireTime));
|
||||||
|
}
|
||||||
|
|
||||||
|
log.debug("时长卡验证通过: recordId={}, expireTime={}", record.getId(), expireTime);
|
||||||
|
return Mono.empty();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据会员卡类型恢复权益
|
||||||
|
*/
|
||||||
|
private Mono<Void> restoreCardUsageByCardType(Long memberId, Long recordId) {
|
||||||
|
return memberCardRecordService.findById(recordId)
|
||||||
|
.switchIfEmpty(Mono.error(new RuntimeException("会员卡记录不存在,无法恢复权益")))
|
||||||
|
.flatMap(record -> {
|
||||||
|
// 验证会员卡归属(memberId为null时跳过验证)
|
||||||
|
if (memberId != null && !record.getMemberId().equals(memberId)) {
|
||||||
|
return Mono.error(new RuntimeException("会员卡不归属当前用户"));
|
||||||
|
}
|
||||||
|
|
||||||
|
return memberCardRepository.findById(record.getMemberCardId())
|
||||||
|
.flatMap(card -> {
|
||||||
|
MemberCardType cardType = MemberCardType.valueOf(card.getMemberCardType());
|
||||||
|
|
||||||
|
switch (cardType) {
|
||||||
|
case COUNT_CARD:
|
||||||
|
return restoreCardUsage(recordId, 1, 0.0);
|
||||||
|
case STORED_VALUE_CARD:
|
||||||
|
return restoreCardUsage(recordId, 0, DEFAULT_GROUP_COURSE_PRICE);
|
||||||
|
case TIME_CARD:
|
||||||
|
return Mono.empty();
|
||||||
|
default:
|
||||||
|
return Mono.error(new RuntimeException("不支持的会员卡类型: " + cardType));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 执行取消预约事务
|
||||||
|
*/
|
||||||
|
public Mono<GroupCourseBooking> executeCancelBooking(Long bookingId, Long courseId, Long recordId, Long memberId) {
|
||||||
|
List<SagaStep> steps = new ArrayList<>();
|
||||||
|
List<SagaStep> rollbackSteps = new ArrayList<>();
|
||||||
|
|
||||||
|
// 步骤1:更新预约状态为已取消
|
||||||
|
SagaStep step1 = new SagaStep(
|
||||||
|
"更新预约状态为已取消",
|
||||||
|
updateBookingStatus(bookingId, "1"),
|
||||||
|
Mono.defer(() -> updateBookingStatus(bookingId, "0"))
|
||||||
|
);
|
||||||
|
steps.add(step1);
|
||||||
|
rollbackSteps.add(0, step1);
|
||||||
|
|
||||||
|
// 步骤2:恢复会员卡权益
|
||||||
|
SagaStep step2 = new SagaStep(
|
||||||
|
"恢复会员卡权益",
|
||||||
|
restoreCardUsageByCardType(memberId, recordId),
|
||||||
|
Mono.defer(() -> deductCardUsageByCardType(memberId, recordId))
|
||||||
|
);
|
||||||
|
steps.add(step2);
|
||||||
|
rollbackSteps.add(0, step2);
|
||||||
|
|
||||||
|
// 步骤3:减少课程当前人数
|
||||||
|
SagaStep step3 = new SagaStep(
|
||||||
|
"减少课程当前人数",
|
||||||
|
decrementCourseCurrentMembers(courseId),
|
||||||
|
Mono.defer(() -> incrementCourseCurrentMembers(courseId))
|
||||||
|
);
|
||||||
|
steps.add(step3);
|
||||||
|
rollbackSteps.add(0, step3);
|
||||||
|
|
||||||
|
// 步骤4:更新Redis预约计数
|
||||||
|
SagaStep step4 = new SagaStep(
|
||||||
|
"更新Redis预约计数",
|
||||||
|
decrementRedisBookingCount(courseId),
|
||||||
|
Mono.defer(() -> incrementRedisBookingCount(courseId))
|
||||||
|
);
|
||||||
|
steps.add(step4);
|
||||||
|
rollbackSteps.add(0, step4);
|
||||||
|
|
||||||
|
return executeSaga(steps, rollbackSteps)
|
||||||
|
.then(bookingRepository.findById(bookingId));
|
||||||
|
}
|
||||||
|
|
||||||
|
private Mono<Void> updateBookingStatus(Long bookingId, String status) {
|
||||||
|
return bookingRepository.updateStatus(bookingId, status)
|
||||||
|
.flatMap(rows -> {
|
||||||
|
if (rows == 0) {
|
||||||
|
return Mono.error(new RuntimeException("更新预约状态失败"));
|
||||||
|
}
|
||||||
|
return Mono.empty();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private Mono<Void> saveBooking(GroupCourseBooking booking) {
|
||||||
|
return bookingRepository.save(booking)
|
||||||
|
.flatMap(saved -> {
|
||||||
|
if (saved.getId() == null) {
|
||||||
|
return Mono.error(new RuntimeException("保存预约记录失败"));
|
||||||
|
}
|
||||||
|
booking.setId(saved.getId());
|
||||||
|
return Mono.empty();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private Mono<Void> deleteBooking(Long bookingId) {
|
||||||
|
return bookingRepository.deleteById(bookingId);
|
||||||
|
}
|
||||||
|
|
||||||
|
private Mono<Void> deductCardUsage(Long recordId, Integer deductTimes, Double deductAmount) {
|
||||||
|
if (deductTimes == 0 && deductAmount == 0.0) {
|
||||||
|
return Mono.empty();
|
||||||
|
}
|
||||||
|
|
||||||
|
return memberCardRecordService.findById(recordId)
|
||||||
|
.switchIfEmpty(Mono.error(new RuntimeException("会员卡记录不存在")))
|
||||||
|
.flatMap(record -> {
|
||||||
|
cn.novalon.gym.manage.member.enums.MemberCardRecordStatus status = record.getStatus();
|
||||||
|
if (status != cn.novalon.gym.manage.member.enums.MemberCardRecordStatus.ACTIVE) {
|
||||||
|
return Mono.error(new RuntimeException("会员卡状态无效,当前状态: " + (status != null ? status.getDesc() : "未知")));
|
||||||
|
}
|
||||||
|
java.time.LocalDateTime expireTime = record.getExpireTime();
|
||||||
|
if (expireTime != null && expireTime.isBefore(java.time.LocalDateTime.now())) {
|
||||||
|
return Mono.error(new RuntimeException("会员卡已过期"));
|
||||||
|
}
|
||||||
|
if (record.getRemainingTimes() != null && deductTimes > 0 && record.getRemainingTimes() < deductTimes) {
|
||||||
|
return Mono.error(new RuntimeException("会员卡剩余次数不足,当前剩余: " + record.getRemainingTimes() + "次"));
|
||||||
|
}
|
||||||
|
if (record.getRemainingAmount() != null && deductAmount > 0 && record.getRemainingAmount() < deductAmount) {
|
||||||
|
return Mono.error(new RuntimeException("会员卡余额不足,当前剩余: " + record.getRemainingAmount()));
|
||||||
|
}
|
||||||
|
return memberCardRecordService.deductUsage(recordId, deductTimes, deductAmount)
|
||||||
|
.flatMap(rows -> {
|
||||||
|
if (rows == 0) {
|
||||||
|
return Mono.error(new RuntimeException("扣减会员卡权益失败,请重试"));
|
||||||
|
}
|
||||||
|
return Mono.empty();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private Mono<Void> restoreCardUsage(Long recordId, Integer addTimes, Double addAmount) {
|
||||||
|
if (addTimes == 0 && addAmount == 0.0) {
|
||||||
|
return Mono.empty();
|
||||||
|
}
|
||||||
|
|
||||||
|
return memberCardRecordService.findById(recordId)
|
||||||
|
.switchIfEmpty(Mono.error(new RuntimeException("会员卡记录不存在,无法恢复权益")))
|
||||||
|
.flatMap(record -> {
|
||||||
|
// 使用当前记录的过期时间,避免清空过期时间
|
||||||
|
return memberCardRecordService.renewCard(recordId, addTimes, addAmount, record.getExpireTime())
|
||||||
|
.flatMap(rows -> {
|
||||||
|
if (rows == 0) {
|
||||||
|
return Mono.error(new RuntimeException("恢复会员卡权益失败,请重试"));
|
||||||
|
}
|
||||||
|
return Mono.empty();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private Mono<Void> incrementCourseCurrentMembers(Long courseId) {
|
||||||
|
return courseRepository.updateCurrentMembers(courseId, 1).then();
|
||||||
|
}
|
||||||
|
|
||||||
|
private Mono<Void> decrementCourseCurrentMembers(Long courseId) {
|
||||||
|
return courseRepository.updateCurrentMembers(courseId, -1).then();
|
||||||
|
}
|
||||||
|
|
||||||
|
private Mono<Void> incrementRedisBookingCount(Long courseId) {
|
||||||
|
return redisService.incrementBookingCount(courseId).then();
|
||||||
|
}
|
||||||
|
|
||||||
|
private Mono<Void> decrementRedisBookingCount(Long courseId) {
|
||||||
|
return redisService.decrementBookingCount(courseId).then();
|
||||||
|
}
|
||||||
|
|
||||||
|
private Mono<Void> executeSaga(List<SagaStep> steps, List<SagaStep> rollbackSteps) {
|
||||||
|
List<SagaStep> completedSteps = new ArrayList<>();
|
||||||
|
return executeStep(steps, 0, completedSteps);
|
||||||
|
}
|
||||||
|
|
||||||
|
private Mono<Void> executeStep(List<SagaStep> steps, int index, List<SagaStep> completedSteps) {
|
||||||
|
if (index >= steps.size()) {
|
||||||
|
return Mono.empty();
|
||||||
|
}
|
||||||
|
|
||||||
|
SagaStep currentStep = steps.get(index);
|
||||||
|
|
||||||
|
return currentStep.operation()
|
||||||
|
.doOnSuccess(unused -> completedSteps.add(currentStep))
|
||||||
|
.then(Mono.defer(() -> executeStep(steps, index + 1, completedSteps)))
|
||||||
|
.onErrorResume(error -> {
|
||||||
|
log.error("Saga步骤执行失败: step={}, error={}", currentStep.description(), error.getMessage());
|
||||||
|
return rollbackCompletedSteps(completedSteps).then(Mono.error(error));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private Mono<Void> rollbackCompletedSteps(List<SagaStep> completedSteps) {
|
||||||
|
if (completedSteps.isEmpty()) {
|
||||||
|
return Mono.empty();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 反转已完成的步骤,按逆序回滚
|
||||||
|
List<SagaStep> reversed = new ArrayList<>(completedSteps);
|
||||||
|
Collections.reverse(reversed);
|
||||||
|
|
||||||
|
return rollbackSteps(reversed, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
private Mono<Void> rollbackSteps(List<SagaStep> rollbackSteps, int index) {
|
||||||
|
if (index >= rollbackSteps.size()) {
|
||||||
|
return Mono.empty();
|
||||||
|
}
|
||||||
|
|
||||||
|
SagaStep currentStep = rollbackSteps.get(index);
|
||||||
|
|
||||||
|
return currentStep.rollbackOperation()
|
||||||
|
.then(Mono.defer(() -> rollbackSteps(rollbackSteps, index + 1)))
|
||||||
|
.doOnError(error -> log.error("Saga回滚失败: step={}, error={}", currentStep.description(), error.getMessage()))
|
||||||
|
.onErrorResume(e -> Mono.empty());
|
||||||
|
}
|
||||||
|
|
||||||
|
private record SagaStep(String description, Mono<Void> operation, Mono<Void> rollbackOperation) {}
|
||||||
|
}
|
||||||
+141
@@ -0,0 +1,141 @@
|
|||||||
|
package cn.novalon.gym.manage.groupcourse.handler;
|
||||||
|
|
||||||
|
import cn.novalon.gym.manage.groupcourse.domain.GroupCourseBooking;
|
||||||
|
import cn.novalon.gym.manage.groupcourse.service.IGroupCourseBookingService;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.web.reactive.function.server.ServerRequest;
|
||||||
|
import org.springframework.web.reactive.function.server.ServerResponse;
|
||||||
|
import reactor.core.publisher.Mono;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 团课预约Handler
|
||||||
|
*
|
||||||
|
* @author 张翔
|
||||||
|
* @date 2026-06-01
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
@Tag(name = "团课预约", description = "团课预约相关操作")
|
||||||
|
public class GroupCourseBookingHandler {
|
||||||
|
|
||||||
|
private final IGroupCourseBookingService bookingService;
|
||||||
|
|
||||||
|
public GroupCourseBookingHandler(IGroupCourseBookingService bookingService) {
|
||||||
|
this.bookingService = bookingService;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预约团课
|
||||||
|
*/
|
||||||
|
@Operation(summary = "预约团课", description = "会员预约指定团课")
|
||||||
|
public Mono<ServerResponse> bookCourse(ServerRequest request) {
|
||||||
|
return request.bodyToMono(Map.class)
|
||||||
|
.flatMap(body -> {
|
||||||
|
// 验证必填参数
|
||||||
|
if (body.get("courseId") == null) {
|
||||||
|
return buildErrorResponse("请提供课程ID");
|
||||||
|
}
|
||||||
|
if (body.get("memberId") == null) {
|
||||||
|
return buildErrorResponse("请提供会员ID");
|
||||||
|
}
|
||||||
|
if (body.get("memberCardRecordId") == null) {
|
||||||
|
return buildErrorResponse("请提供会员卡记录ID");
|
||||||
|
}
|
||||||
|
|
||||||
|
Long courseId = ((Number) body.get("courseId")).longValue();
|
||||||
|
Long memberId = ((Number) body.get("memberId")).longValue();
|
||||||
|
Long memberCardRecordId = ((Number) body.get("memberCardRecordId")).longValue();
|
||||||
|
|
||||||
|
return bookingService.bookCourse(courseId, memberId, memberCardRecordId)
|
||||||
|
.flatMap(booking -> {
|
||||||
|
Map<String, Object> response = new HashMap<>();
|
||||||
|
response.put("success", true);
|
||||||
|
response.put("message", "预约成功");
|
||||||
|
response.put("data", booking);
|
||||||
|
return ServerResponse.ok().bodyValue(response);
|
||||||
|
})
|
||||||
|
.onErrorResume(error -> {
|
||||||
|
Map<String, Object> response = new HashMap<>();
|
||||||
|
response.put("success", false);
|
||||||
|
response.put("message", error.getMessage());
|
||||||
|
return ServerResponse.badRequest().bodyValue(response);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 取消预约
|
||||||
|
*/
|
||||||
|
@Operation(summary = "取消预约", description = "会员取消已预约的团课")
|
||||||
|
public Mono<ServerResponse> cancelBooking(ServerRequest request) {
|
||||||
|
Long bookingId = Long.valueOf(request.pathVariable("bookingId"));
|
||||||
|
|
||||||
|
return request.bodyToMono(Map.class)
|
||||||
|
.flatMap(body -> {
|
||||||
|
Long memberId = ((Number) body.get("memberId")).longValue();
|
||||||
|
|
||||||
|
return bookingService.cancelBooking(bookingId, memberId)
|
||||||
|
.flatMap(booking -> {
|
||||||
|
Map<String, Object> response = new HashMap<>();
|
||||||
|
response.put("success", true);
|
||||||
|
response.put("message", "取消成功");
|
||||||
|
response.put("data", booking);
|
||||||
|
return ServerResponse.ok().bodyValue(response);
|
||||||
|
})
|
||||||
|
.onErrorResume(error -> {
|
||||||
|
Map<String, Object> response = new HashMap<>();
|
||||||
|
response.put("success", false);
|
||||||
|
response.put("message", error.getMessage());
|
||||||
|
return ServerResponse.badRequest().bodyValue(response);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询会员预约记录
|
||||||
|
*/
|
||||||
|
@Operation(summary = "查询会员预约记录", description = "根据会员ID查询所有预约记录")
|
||||||
|
public Mono<ServerResponse> getBookingsByMemberId(ServerRequest request) {
|
||||||
|
Long memberId = Long.valueOf(request.pathVariable("memberId"));
|
||||||
|
|
||||||
|
return ServerResponse.ok()
|
||||||
|
.body(bookingService.getBookingsByMemberId(memberId), GroupCourseBooking.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询预约详情
|
||||||
|
*/
|
||||||
|
@Operation(summary = "查询预约详情", description = "根据预约ID查询预约详情")
|
||||||
|
public Mono<ServerResponse> getBookingById(ServerRequest request) {
|
||||||
|
Long bookingId = Long.valueOf(request.pathVariable("bookingId"));
|
||||||
|
|
||||||
|
return bookingService.getBookingById(bookingId)
|
||||||
|
.flatMap(booking -> ServerResponse.ok().bodyValue(booking))
|
||||||
|
.switchIfEmpty(ServerResponse.notFound().build());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询课程预约记录
|
||||||
|
*/
|
||||||
|
@Operation(summary = "查询课程预约记录", description = "根据团课ID查询所有预约记录")
|
||||||
|
public Mono<ServerResponse> getBookingsByCourseId(ServerRequest request) {
|
||||||
|
Long courseId = Long.valueOf(request.pathVariable("courseId"));
|
||||||
|
|
||||||
|
return ServerResponse.ok()
|
||||||
|
.body(bookingService.getBookingsByCourseId(courseId), GroupCourseBooking.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 构建错误响应
|
||||||
|
*/
|
||||||
|
private Mono<ServerResponse> buildErrorResponse(String message) {
|
||||||
|
Map<String, Object> response = new HashMap<>();
|
||||||
|
response.put("success", false);
|
||||||
|
response.put("message", message);
|
||||||
|
return ServerResponse.badRequest().bodyValue(response);
|
||||||
|
}
|
||||||
|
}
|
||||||
+261
@@ -0,0 +1,261 @@
|
|||||||
|
|
||||||
|
package cn.novalon.gym.manage.groupcourse.handler;
|
||||||
|
|
||||||
|
import cn.novalon.gym.manage.common.dto.PageRequest;
|
||||||
|
import cn.novalon.gym.manage.common.util.RedisUtil;
|
||||||
|
import cn.novalon.gym.manage.groupcourse.domain.GroupCourse;
|
||||||
|
import cn.novalon.gym.manage.groupcourse.service.IGroupCourseService;
|
||||||
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import jakarta.validation.Validator;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.web.reactive.function.server.ServerRequest;
|
||||||
|
import org.springframework.web.reactive.function.server.ServerResponse;
|
||||||
|
import reactor.core.publisher.Mono;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
@Tag(name="团课管理",description = "团课相关操作")
|
||||||
|
public class GroupCourseHandler {
|
||||||
|
private final IGroupCourseService groupCourseService;
|
||||||
|
private final Validator validator;
|
||||||
|
private final RedisUtil redisUtil;
|
||||||
|
private final ObjectMapper objectMapper;
|
||||||
|
|
||||||
|
public GroupCourseHandler(IGroupCourseService groupCourseService,
|
||||||
|
Validator validator,
|
||||||
|
RedisUtil redisUtil,
|
||||||
|
ObjectMapper objectMapper){
|
||||||
|
this.groupCourseService = groupCourseService;
|
||||||
|
this.validator = validator;
|
||||||
|
this.redisUtil = redisUtil;
|
||||||
|
this.objectMapper = objectMapper;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "获取所有团课", description = "获取系统中所有团课列表")
|
||||||
|
public Mono<ServerResponse> getAllGroupCourse(ServerRequest request){
|
||||||
|
boolean includeDeleted = Boolean.valueOf(request.queryParam("includeDeleted").orElse("false"));
|
||||||
|
return ServerResponse.ok()
|
||||||
|
.body(groupCourseService.findAll(includeDeleted), GroupCourse.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "分页获取团课", description = "根据分页参数获取团课列表")
|
||||||
|
public Mono<ServerResponse> getGroupCoursesByPage(ServerRequest request) {
|
||||||
|
return request.bodyToMono(PageRequest.class)
|
||||||
|
.flatMap(pageRequest -> {
|
||||||
|
boolean includeDeleted = request.queryParam("includeDeleted")
|
||||||
|
.map(Boolean::parseBoolean)
|
||||||
|
.orElse(false);
|
||||||
|
|
||||||
|
if (pageRequest.getPage() < 0) {
|
||||||
|
pageRequest.setPage(0);
|
||||||
|
}
|
||||||
|
if (pageRequest.getSize() <= 0 || pageRequest.getSize() > 100) {
|
||||||
|
pageRequest.setSize(10);
|
||||||
|
}
|
||||||
|
if (pageRequest.getSort() == null || pageRequest.getSort().isEmpty()) {
|
||||||
|
pageRequest.setSort("id");
|
||||||
|
}
|
||||||
|
if (pageRequest.getOrder() == null || pageRequest.getOrder().isEmpty()) {
|
||||||
|
pageRequest.setOrder("asc");
|
||||||
|
}
|
||||||
|
|
||||||
|
return groupCourseService.findByPage(pageRequest, includeDeleted)
|
||||||
|
.flatMap(response -> ServerResponse.ok().bodyValue(response));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "根据ID获取团课", description = "根据ID获取团课详情")
|
||||||
|
public Mono<ServerResponse> getGroupCourseById(ServerRequest request){
|
||||||
|
Long id = Long.valueOf(request.pathVariable("id"));
|
||||||
|
return groupCourseService.findById(id)
|
||||||
|
.flatMap(course -> ServerResponse.ok().bodyValue(course))
|
||||||
|
.switchIfEmpty(ServerResponse.notFound().build());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "创建团课", description = "创建新的团课")
|
||||||
|
public Mono<ServerResponse> createGroupCourse(ServerRequest request) {
|
||||||
|
return request.bodyToMono(GroupCourse.class)
|
||||||
|
.flatMap(groupCourse -> {
|
||||||
|
if (groupCourse.getCourseName() == null || groupCourse.getCourseName().isEmpty()) {
|
||||||
|
Map<String, Object> error = new HashMap<>();
|
||||||
|
error.put("success", false);
|
||||||
|
error.put("message", "课程名称不能为空");
|
||||||
|
return ServerResponse.badRequest().bodyValue(error);
|
||||||
|
}
|
||||||
|
|
||||||
|
return groupCourseService.create(groupCourse)
|
||||||
|
.flatMap(course -> {
|
||||||
|
Map<String, Object> response = new HashMap<>();
|
||||||
|
response.put("success", true);
|
||||||
|
response.put("message", "团课创建成功");
|
||||||
|
response.put("data", course);
|
||||||
|
return ServerResponse.ok().bodyValue(response);
|
||||||
|
})
|
||||||
|
.onErrorResume(error -> {
|
||||||
|
Map<String, Object> response = new HashMap<>();
|
||||||
|
response.put("success", false);
|
||||||
|
response.put("message", error.getMessage());
|
||||||
|
return ServerResponse.badRequest().bodyValue(response);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "更新团课", description = "更新指定团课信息")
|
||||||
|
public Mono<ServerResponse> updateGroupCourse(ServerRequest request) {
|
||||||
|
Long id = Long.valueOf(request.pathVariable("id"));
|
||||||
|
|
||||||
|
return request.bodyToMono(GroupCourse.class)
|
||||||
|
.flatMap(groupCourse -> {
|
||||||
|
return groupCourseService.update(id, groupCourse)
|
||||||
|
.flatMap(course -> {
|
||||||
|
Map<String, Object> response = new HashMap<>();
|
||||||
|
response.put("success", true);
|
||||||
|
response.put("message", "团课更新成功");
|
||||||
|
response.put("data", course);
|
||||||
|
return ServerResponse.ok().bodyValue(response);
|
||||||
|
})
|
||||||
|
.onErrorResume(error -> {
|
||||||
|
Map<String, Object> response = new HashMap<>();
|
||||||
|
response.put("success", false);
|
||||||
|
response.put("message", error.getMessage());
|
||||||
|
return ServerResponse.badRequest().bodyValue(response);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "取消团课", description = "取消指定团课(需提前24小时)")
|
||||||
|
public Mono<ServerResponse> cancelGroupCourse(ServerRequest request) {
|
||||||
|
Long id = Long.valueOf(request.pathVariable("id"));
|
||||||
|
|
||||||
|
return groupCourseService.cancel(id)
|
||||||
|
.flatMap(course -> {
|
||||||
|
Map<String, Object> response = new HashMap<>();
|
||||||
|
response.put("success", true);
|
||||||
|
response.put("message", "团课取消成功");
|
||||||
|
response.put("data", course);
|
||||||
|
return ServerResponse.ok().bodyValue(response);
|
||||||
|
})
|
||||||
|
.onErrorResume(error -> {
|
||||||
|
Map<String, Object> response = new HashMap<>();
|
||||||
|
response.put("success", false);
|
||||||
|
response.put("message", error.getMessage());
|
||||||
|
return ServerResponse.badRequest().bodyValue(response);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "团课签到", description = "会员签到参加团课")
|
||||||
|
public Mono<ServerResponse> signIn(ServerRequest request) {
|
||||||
|
Long courseId = Long.valueOf(request.pathVariable("courseId"));
|
||||||
|
|
||||||
|
return request.bodyToMono(Map.class)
|
||||||
|
.flatMap(body -> {
|
||||||
|
if (body == null || body.isEmpty()) {
|
||||||
|
Map<String, Object> response = new HashMap<>();
|
||||||
|
response.put("success", false);
|
||||||
|
response.put("message", "请求体不能为空");
|
||||||
|
return ServerResponse.badRequest().bodyValue(response);
|
||||||
|
}
|
||||||
|
|
||||||
|
Object memberIdObj = body.get("memberId");
|
||||||
|
if (memberIdObj == null) {
|
||||||
|
Map<String, Object> response = new HashMap<>();
|
||||||
|
response.put("success", false);
|
||||||
|
response.put("message", "memberId不能为空");
|
||||||
|
return ServerResponse.badRequest().bodyValue(response);
|
||||||
|
}
|
||||||
|
|
||||||
|
Long memberId = ((Number) memberIdObj).longValue();
|
||||||
|
|
||||||
|
return groupCourseService.signIn(courseId, memberId)
|
||||||
|
.flatMap(course -> {
|
||||||
|
Map<String, Object> response = new HashMap<>();
|
||||||
|
response.put("success", true);
|
||||||
|
response.put("message", "签到成功");
|
||||||
|
response.put("data", course);
|
||||||
|
return ServerResponse.ok().bodyValue(response);
|
||||||
|
})
|
||||||
|
.onErrorResume(error -> {
|
||||||
|
Map<String, Object> response = new HashMap<>();
|
||||||
|
response.put("success", false);
|
||||||
|
response.put("message", error.getMessage());
|
||||||
|
return ServerResponse.badRequest().bodyValue(response);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "删除团课", description = "删除指定团课(软删除)")
|
||||||
|
public Mono<ServerResponse> deleteGroupCourse(ServerRequest request) {
|
||||||
|
Long id = Long.valueOf(request.pathVariable("id"));
|
||||||
|
|
||||||
|
return groupCourseService.delete(id)
|
||||||
|
.then(Mono.defer(() -> {
|
||||||
|
Map<String, Object> response = new HashMap<>();
|
||||||
|
response.put("success", true);
|
||||||
|
response.put("message", "团课删除成功");
|
||||||
|
return ServerResponse.ok().bodyValue(response);
|
||||||
|
}))
|
||||||
|
.onErrorResume(error -> {
|
||||||
|
Map<String, Object> response = new HashMap<>();
|
||||||
|
response.put("success", false);
|
||||||
|
response.put("message", error.getMessage());
|
||||||
|
return ServerResponse.badRequest().bodyValue(response);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "测试-根据Key获取Redis缓存", description = "测试接口:根据传入的key值获取Redis中缓存的数据")
|
||||||
|
public Mono<ServerResponse> getCacheByKey(ServerRequest request) {
|
||||||
|
return request.bodyToMono(Map.class)
|
||||||
|
.flatMap(body -> {
|
||||||
|
String key = (String) body.get("key");
|
||||||
|
|
||||||
|
if (key == null || key.isEmpty()) {
|
||||||
|
Map<String, Object> error = new HashMap<>();
|
||||||
|
error.put("success", false);
|
||||||
|
error.put("message", "key参数不能为空");
|
||||||
|
return ServerResponse.badRequest().bodyValue(error);
|
||||||
|
}
|
||||||
|
|
||||||
|
return redisUtil.get(key)
|
||||||
|
.map(cachedValue -> {
|
||||||
|
Map<String, Object> result = new HashMap<>();
|
||||||
|
if (cachedValue != null) {
|
||||||
|
result.put("success", true);
|
||||||
|
result.put("key", key);
|
||||||
|
result.put("value", cachedValue);
|
||||||
|
result.put("message", "缓存命中");
|
||||||
|
|
||||||
|
try {
|
||||||
|
if (cachedValue instanceof String) {
|
||||||
|
Object jsonObject = objectMapper.readValue((String) cachedValue, Object.class);
|
||||||
|
result.put("parsedValue", jsonObject);
|
||||||
|
result.put("valueType", "JSON字符串");
|
||||||
|
} else {
|
||||||
|
result.put("valueType", cachedValue.getClass().getSimpleName());
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
result.put("parsedValue", null);
|
||||||
|
result.put("valueType", "无法解析");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
result.put("success", false);
|
||||||
|
result.put("key", key);
|
||||||
|
result.put("value", null);
|
||||||
|
result.put("message", "缓存未命中");
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
})
|
||||||
|
.flatMap(result -> ServerResponse.ok().bodyValue(result))
|
||||||
|
.onErrorResume(error -> {
|
||||||
|
Map<String, Object> errorResponse = new HashMap<>();
|
||||||
|
errorResponse.put("success", false);
|
||||||
|
errorResponse.put("message", "请求处理失败: " + error.getMessage());
|
||||||
|
return ServerResponse.status(500).bodyValue(errorResponse);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
+139
@@ -0,0 +1,139 @@
|
|||||||
|
package cn.novalon.gym.manage.groupcourse.handler;
|
||||||
|
|
||||||
|
import cn.novalon.gym.manage.groupcourse.domain.GroupCourse;
|
||||||
|
import cn.novalon.gym.manage.groupcourse.enums.CourseEvent;
|
||||||
|
import cn.novalon.gym.manage.groupcourse.enums.CourseStatus;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import reactor.core.publisher.Mono;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 团课状态机处理器
|
||||||
|
*
|
||||||
|
* 管理团课的状态转换逻辑
|
||||||
|
*
|
||||||
|
* @author 张翔
|
||||||
|
* @date 2026-06-02
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Component
|
||||||
|
public class GroupCourseStateMachine {
|
||||||
|
|
||||||
|
private final Map<CourseStatus, Map<CourseEvent, CourseStatus>> stateTransitionMap;
|
||||||
|
|
||||||
|
public GroupCourseStateMachine() {
|
||||||
|
this.stateTransitionMap = buildStateTransitionMap();
|
||||||
|
}
|
||||||
|
|
||||||
|
private Map<CourseStatus, Map<CourseEvent, CourseStatus>> buildStateTransitionMap() {
|
||||||
|
Map<CourseStatus, Map<CourseEvent, CourseStatus>> map = new HashMap<>();
|
||||||
|
|
||||||
|
// NORMAL 状态可以转换的事件
|
||||||
|
Map<CourseEvent, CourseStatus> normalTransitions = new HashMap<>();
|
||||||
|
normalTransitions.put(CourseEvent.CANCEL, CourseStatus.CANCELLED);
|
||||||
|
normalTransitions.put(CourseEvent.END, CourseStatus.ENDED);
|
||||||
|
normalTransitions.put(CourseEvent.START, CourseStatus.IN_PROGRESS);
|
||||||
|
map.put(CourseStatus.NORMAL, normalTransitions);
|
||||||
|
|
||||||
|
// IN_PROGRESS 状态可以转换的事件
|
||||||
|
Map<CourseEvent, CourseStatus> inProgressTransitions = new HashMap<>();
|
||||||
|
inProgressTransitions.put(CourseEvent.END, CourseStatus.ENDED);
|
||||||
|
map.put(CourseStatus.IN_PROGRESS, inProgressTransitions);
|
||||||
|
|
||||||
|
// CANCELLED 状态是终态,不允许任何转换
|
||||||
|
|
||||||
|
// ENDED 状态是终态,不允许任何转换
|
||||||
|
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检查是否可以转换状态
|
||||||
|
*/
|
||||||
|
public Mono<Boolean> canTransition(CourseStatus currentState, CourseEvent event) {
|
||||||
|
return Mono.fromSupplier(() -> {
|
||||||
|
Map<CourseEvent, CourseStatus> transitions = stateTransitionMap.get(currentState);
|
||||||
|
if (transitions == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return transitions.containsKey(event);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 执行状态转换
|
||||||
|
*/
|
||||||
|
public Mono<CourseStatus> transition(CourseStatus currentState, CourseEvent event) {
|
||||||
|
return Mono.fromSupplier(() -> {
|
||||||
|
Map<CourseEvent, CourseStatus> transitions = stateTransitionMap.get(currentState);
|
||||||
|
if (transitions == null || !transitions.containsKey(event)) {
|
||||||
|
log.error("Invalid state transition: currentState={}, event={}", currentState, event);
|
||||||
|
throw new IllegalStateException(
|
||||||
|
String.format("不允许的状态转换: 当前状态=%s, 事件=%s", currentState, event));
|
||||||
|
}
|
||||||
|
CourseStatus newState = transitions.get(event);
|
||||||
|
log.info("State transition: {} --({})--> {}", currentState, event, newState);
|
||||||
|
return newState;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 验证状态转换是否允许
|
||||||
|
*/
|
||||||
|
public Mono<Void> validateTransition(GroupCourse course, CourseEvent event) {
|
||||||
|
Long statusValue = course.getStatus();
|
||||||
|
CourseStatus currentState = CourseStatus.fromValue(statusValue != null ? statusValue : 0L);
|
||||||
|
|
||||||
|
return canTransition(currentState, event)
|
||||||
|
.flatMap(canTransition -> {
|
||||||
|
if (!canTransition) {
|
||||||
|
String errorMessage = buildErrorMessage(course.getId(), currentState, event);
|
||||||
|
return Mono.error(new IllegalStateException(errorMessage));
|
||||||
|
}
|
||||||
|
return Mono.empty();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 构建状态转换错误信息
|
||||||
|
*/
|
||||||
|
private String buildErrorMessage(Long courseId, CourseStatus currentState, CourseEvent event) {
|
||||||
|
String currentStateDesc = currentState.getDesc();
|
||||||
|
String eventDesc = event.getDesc();
|
||||||
|
|
||||||
|
String advice = "";
|
||||||
|
switch (currentState) {
|
||||||
|
case CANCELLED:
|
||||||
|
advice = "(课程已取消,无法进行此操作)";
|
||||||
|
break;
|
||||||
|
case ENDED:
|
||||||
|
advice = "(课程已结束,无法进行此操作)";
|
||||||
|
break;
|
||||||
|
case IN_PROGRESS:
|
||||||
|
if (event == CourseEvent.CANCEL) {
|
||||||
|
advice = "(课程正在进行中,无法取消)";
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return String.format("团课ID=%d 不允许的状态转换: 当前状态=%s(%s), 操作=%s%s",
|
||||||
|
courseId, currentState, currentStateDesc, eventDesc, advice);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 执行状态转换并更新课程对象
|
||||||
|
*/
|
||||||
|
public Mono<GroupCourse> applyTransition(GroupCourse course, CourseEvent event) {
|
||||||
|
return validateTransition(course, event)
|
||||||
|
.then(transition(CourseStatus.fromValue(course.getStatus()), event))
|
||||||
|
.map(newStatus -> {
|
||||||
|
course.setStatus(newStatus.getValue());
|
||||||
|
return course;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
+92
@@ -0,0 +1,92 @@
|
|||||||
|
package cn.novalon.gym.manage.groupcourse.repository;
|
||||||
|
|
||||||
|
import cn.novalon.gym.manage.groupcourse.domain.GroupCourseBooking;
|
||||||
|
import reactor.core.publisher.Flux;
|
||||||
|
import reactor.core.publisher.Mono;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 团课预约记录Repository接口
|
||||||
|
*
|
||||||
|
* @author 张翔
|
||||||
|
* @date 2026-06-01
|
||||||
|
*/
|
||||||
|
public interface IGroupCourseBookingRepository {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据ID查询预约记录
|
||||||
|
*/
|
||||||
|
Mono<GroupCourseBooking> findById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据会员ID查询预约记录列表
|
||||||
|
*/
|
||||||
|
Flux<GroupCourseBooking> findByMemberId(Long memberId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据团课ID查询预约记录列表
|
||||||
|
*/
|
||||||
|
Flux<GroupCourseBooking> findByCourseId(Long courseId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询会员是否已预约某课程
|
||||||
|
*/
|
||||||
|
Mono<GroupCourseBooking> findByCourseIdAndMemberId(Long courseId, Long memberId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询会员在指定课程的有效预约
|
||||||
|
*/
|
||||||
|
Mono<GroupCourseBooking> findValidBooking(Long courseId, Long memberId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 统计课程有效预约人数
|
||||||
|
*/
|
||||||
|
Mono<Long> countValidBookings(Long courseId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存预约记录
|
||||||
|
*/
|
||||||
|
Mono<GroupCourseBooking> save(GroupCourseBooking booking);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新预约记录
|
||||||
|
*/
|
||||||
|
Mono<GroupCourseBooking> update(GroupCourseBooking booking);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新预约状态
|
||||||
|
*/
|
||||||
|
Mono<Integer> updateStatus(Long bookingId, String status);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除预约记录
|
||||||
|
*/
|
||||||
|
Mono<Void> deleteById(Long bookingId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据会员卡记录ID查询预约记录
|
||||||
|
*/
|
||||||
|
Flux<GroupCourseBooking> findByMemberCardRecordId(Long memberCardRecordId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询会员是否有时间冲突的预约
|
||||||
|
*
|
||||||
|
* @param memberId 会员ID
|
||||||
|
* @param newStartTime 新课程开始时间
|
||||||
|
* @param newEndTime 新课程结束时间
|
||||||
|
* @return 冲突的预约记录列表
|
||||||
|
*/
|
||||||
|
Flux<GroupCourseBooking> findConflictingBookings(Long memberId, java.time.LocalDateTime newStartTime, java.time.LocalDateTime newEndTime);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询已开始课程但未到场会员的预约记录
|
||||||
|
* @return 缺席会员的预约记录列表
|
||||||
|
*/
|
||||||
|
Flux<GroupCourseBooking> findAbsentMembers();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新预约状态为缺席(3)
|
||||||
|
* @param bookingId 预约ID
|
||||||
|
* @return 更新记录数
|
||||||
|
*/
|
||||||
|
Mono<Integer> updateToAbsent(Long bookingId);
|
||||||
|
}
|
||||||
+30
@@ -0,0 +1,30 @@
|
|||||||
|
|
||||||
|
package cn.novalon.gym.manage.groupcourse.repository;
|
||||||
|
|
||||||
|
import cn.novalon.gym.manage.common.dto.PageRequest;
|
||||||
|
import cn.novalon.gym.manage.common.dto.PageResponse;
|
||||||
|
import cn.novalon.gym.manage.groupcourse.domain.GroupCourse;
|
||||||
|
import org.springframework.data.domain.Sort;
|
||||||
|
import reactor.core.publisher.Flux;
|
||||||
|
import reactor.core.publisher.Mono;
|
||||||
|
|
||||||
|
public interface IGroupCourseRepository {
|
||||||
|
Mono<GroupCourse> findByIdAndDeletedAtIsNull(Long id);
|
||||||
|
Flux<GroupCourse> findAll();
|
||||||
|
Flux<GroupCourse> findAll(Sort sort);
|
||||||
|
Flux<GroupCourse> findByDeletedAtIsNull();
|
||||||
|
Flux<GroupCourse> findByDeletedAtIsNull(Sort sort);
|
||||||
|
|
||||||
|
Mono<PageResponse<GroupCourse>> findByPage(PageRequest pageRequest);
|
||||||
|
Mono<PageResponse<GroupCourse>> findByPageAndNotDeleted(PageRequest pageRequest);
|
||||||
|
|
||||||
|
Mono<GroupCourse> save(GroupCourse groupCourse);
|
||||||
|
|
||||||
|
Mono<GroupCourse> update(GroupCourse groupCourse);
|
||||||
|
|
||||||
|
Mono<GroupCourse> cancel(Long id);
|
||||||
|
|
||||||
|
Mono<Void> deleteById(Long id);
|
||||||
|
|
||||||
|
Mono<GroupCourse> updateCurrentMembers(Long id, Integer delta);
|
||||||
|
}
|
||||||
+115
@@ -0,0 +1,115 @@
|
|||||||
|
package cn.novalon.gym.manage.groupcourse.repository.impl;
|
||||||
|
|
||||||
|
import cn.novalon.gym.manage.groupcourse.converter.GroupCourseConverter;
|
||||||
|
import cn.novalon.gym.manage.groupcourse.dao.GroupCourseBookingDao;
|
||||||
|
import cn.novalon.gym.manage.groupcourse.domain.GroupCourseBooking;
|
||||||
|
import cn.novalon.gym.manage.groupcourse.entity.GroupCourseBookingEntity;
|
||||||
|
import cn.novalon.gym.manage.groupcourse.repository.IGroupCourseBookingRepository;
|
||||||
|
import org.springframework.data.domain.Sort;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
import reactor.core.publisher.Flux;
|
||||||
|
import reactor.core.publisher.Mono;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 团课预约记录Repository实现类
|
||||||
|
*
|
||||||
|
* @author 张翔
|
||||||
|
* @date 2026-06-01
|
||||||
|
*/
|
||||||
|
@Repository
|
||||||
|
public class GroupCourseBookingRepository implements IGroupCourseBookingRepository {
|
||||||
|
|
||||||
|
private final GroupCourseBookingDao groupCourseBookingDao;
|
||||||
|
private final GroupCourseConverter groupCourseConverter;
|
||||||
|
|
||||||
|
public GroupCourseBookingRepository(GroupCourseBookingDao groupCourseBookingDao,
|
||||||
|
GroupCourseConverter groupCourseConverter) {
|
||||||
|
this.groupCourseBookingDao = groupCourseBookingDao;
|
||||||
|
this.groupCourseConverter = groupCourseConverter;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Mono<GroupCourseBooking> findById(Long id) {
|
||||||
|
return groupCourseBookingDao.findByIdIsAndDeletedAtIsNull(id)
|
||||||
|
.map(groupCourseConverter::toBookingDomain);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Flux<GroupCourseBooking> findByMemberId(Long memberId) {
|
||||||
|
return groupCourseBookingDao.findByMemberIdAndDeletedAtIsNull(memberId, Sort.by(Sort.Direction.DESC, "bookingTime"))
|
||||||
|
.map(groupCourseConverter::toBookingDomain);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Flux<GroupCourseBooking> findByCourseId(Long courseId) {
|
||||||
|
return groupCourseBookingDao.findByCourseIdAndDeletedAtIsNull(courseId)
|
||||||
|
.map(groupCourseConverter::toBookingDomain);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Mono<GroupCourseBooking> findByCourseIdAndMemberId(Long courseId, Long memberId) {
|
||||||
|
return groupCourseBookingDao.findByCourseIdAndMemberIdAndDeletedAtIsNull(courseId, memberId)
|
||||||
|
.map(groupCourseConverter::toBookingDomain);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Mono<GroupCourseBooking> findValidBooking(Long courseId, Long memberId) {
|
||||||
|
return groupCourseBookingDao.findByCourseIdAndMemberIdAndStatusAndDeletedAtIsNull(courseId, memberId, "0")
|
||||||
|
.map(groupCourseConverter::toBookingDomain);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Mono<Long> countValidBookings(Long courseId) {
|
||||||
|
return groupCourseBookingDao.countByCourseIdAndStatusAndDeletedAtIsNull(courseId, "0");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Mono<GroupCourseBooking> save(GroupCourseBooking booking) {
|
||||||
|
GroupCourseBookingEntity entity = groupCourseConverter.toBookingEntity(booking);
|
||||||
|
return groupCourseBookingDao.save(entity)
|
||||||
|
.map(groupCourseConverter::toBookingDomain);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Mono<GroupCourseBooking> update(GroupCourseBooking booking) {
|
||||||
|
GroupCourseBookingEntity entity = groupCourseConverter.toBookingEntity(booking);
|
||||||
|
return groupCourseBookingDao.save(entity)
|
||||||
|
.map(groupCourseConverter::toBookingDomain);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Mono<Integer> updateStatus(Long bookingId, String status) {
|
||||||
|
java.time.LocalDateTime now = java.time.LocalDateTime.now();
|
||||||
|
java.time.LocalDateTime cancelTime = "1".equals(status) ? now : null;
|
||||||
|
return groupCourseBookingDao.updateStatus(bookingId, status, cancelTime, now);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Mono<Void> deleteById(Long bookingId) {
|
||||||
|
return groupCourseBookingDao.softDelete(bookingId, java.time.LocalDateTime.now()).then();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Flux<GroupCourseBooking> findByMemberCardRecordId(Long memberCardRecordId) {
|
||||||
|
return groupCourseBookingDao.findByMemberCardRecordIdAndDeletedAtIsNull(memberCardRecordId)
|
||||||
|
.map(groupCourseConverter::toBookingDomain);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Flux<GroupCourseBooking> findConflictingBookings(Long memberId, java.time.LocalDateTime newStartTime, java.time.LocalDateTime newEndTime) {
|
||||||
|
return groupCourseBookingDao.findConflictingBookings(memberId, newStartTime, newEndTime)
|
||||||
|
.map(groupCourseConverter::toBookingDomain);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Flux<GroupCourseBooking> findAbsentMembers() {
|
||||||
|
return groupCourseBookingDao.findAbsentMembers()
|
||||||
|
.map(groupCourseConverter::toBookingDomain);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Mono<Integer> updateToAbsent(Long bookingId) {
|
||||||
|
java.time.LocalDateTime now = java.time.LocalDateTime.now();
|
||||||
|
return groupCourseBookingDao.updateToAbsent(bookingId, now);
|
||||||
|
}
|
||||||
|
}
|
||||||
+181
@@ -0,0 +1,181 @@
|
|||||||
|
|
||||||
|
package cn.novalon.gym.manage.groupcourse.repository.impl;
|
||||||
|
|
||||||
|
import cn.novalon.gym.manage.common.dto.PageRequest;
|
||||||
|
import cn.novalon.gym.manage.common.dto.PageResponse;
|
||||||
|
import cn.novalon.gym.manage.groupcourse.converter.GroupCourseConverter;
|
||||||
|
import cn.novalon.gym.manage.groupcourse.dao.GroupCourseDao;
|
||||||
|
import cn.novalon.gym.manage.groupcourse.domain.GroupCourse;
|
||||||
|
import cn.novalon.gym.manage.groupcourse.entity.GroupCourseEntity;
|
||||||
|
import cn.novalon.gym.manage.groupcourse.repository.IGroupCourseRepository;
|
||||||
|
import org.springframework.data.domain.Sort;
|
||||||
|
import org.springframework.data.r2dbc.core.R2dbcEntityTemplate;
|
||||||
|
import org.springframework.data.relational.core.query.Query;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
import reactor.core.publisher.Flux;
|
||||||
|
import reactor.core.publisher.Mono;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public class GroupCourseRepository implements IGroupCourseRepository {
|
||||||
|
private final GroupCourseDao groupCourseDao;
|
||||||
|
private final GroupCourseConverter groupCourseConverter;
|
||||||
|
private final R2dbcEntityTemplate r2dbcEntityTemplate;
|
||||||
|
|
||||||
|
public GroupCourseRepository(GroupCourseDao groupCourseDao, GroupCourseConverter groupCourseConverter,
|
||||||
|
R2dbcEntityTemplate r2dbcEntityTemplate){
|
||||||
|
this.groupCourseDao = groupCourseDao;
|
||||||
|
this.groupCourseConverter = groupCourseConverter;
|
||||||
|
this.r2dbcEntityTemplate = r2dbcEntityTemplate;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Mono<GroupCourse> findByIdAndDeletedAtIsNull(Long id) {
|
||||||
|
return groupCourseDao.findByIdIsAndDeletedAtIsNull(id)
|
||||||
|
.map(groupCourseConverter::toDomain);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Flux<GroupCourse> findAll() {
|
||||||
|
return groupCourseDao.findAll()
|
||||||
|
.map(groupCourseConverter::toDomain);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Flux<GroupCourse> findAll(Sort sort) {
|
||||||
|
return groupCourseDao.findAll(sort)
|
||||||
|
.map(groupCourseConverter::toDomain);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Flux<GroupCourse> findByDeletedAtIsNull() {
|
||||||
|
return groupCourseDao.findAllByDeletedAtIsNull()
|
||||||
|
.map(groupCourseConverter::toDomain);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Flux<GroupCourse> findByDeletedAtIsNull(Sort sort) {
|
||||||
|
return groupCourseDao.findAllByDeletedAtIsNull(sort)
|
||||||
|
.map(groupCourseConverter::toDomain);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Mono<PageResponse<GroupCourse>> findByPage(PageRequest pageRequest) {
|
||||||
|
int page = pageRequest.getPage();
|
||||||
|
int size = pageRequest.getSize();
|
||||||
|
String sort = pageRequest.getSort();
|
||||||
|
String order = pageRequest.getOrder();
|
||||||
|
|
||||||
|
Sort sortObj = Sort.unsorted();
|
||||||
|
if (sort != null && !sort.isEmpty()) {
|
||||||
|
sortObj = Sort.by(Sort.Direction.fromString(order), sort);
|
||||||
|
}
|
||||||
|
|
||||||
|
org.springframework.data.domain.PageRequest pageable = org.springframework.data.domain.PageRequest.of(page, size, sortObj);
|
||||||
|
|
||||||
|
Query query = Query.empty();
|
||||||
|
|
||||||
|
return r2dbcEntityTemplate.select(GroupCourseEntity.class)
|
||||||
|
.matching(query.with(pageable))
|
||||||
|
.all()
|
||||||
|
.collectList()
|
||||||
|
.zipWith(r2dbcEntityTemplate.count(query, GroupCourseEntity.class))
|
||||||
|
.map(tuple -> {
|
||||||
|
long total = tuple.getT2();
|
||||||
|
int totalPages = (int) Math.ceil((double) total / size);
|
||||||
|
List<GroupCourse> courseList = tuple.getT1().stream()
|
||||||
|
.map(groupCourseConverter::toDomain)
|
||||||
|
.toList();
|
||||||
|
return new PageResponse<>(courseList, totalPages, total, page, size);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Mono<PageResponse<GroupCourse>> findByPageAndNotDeleted(PageRequest pageRequest) {
|
||||||
|
int page = pageRequest.getPage();
|
||||||
|
int size = pageRequest.getSize();
|
||||||
|
String sort = pageRequest.getSort();
|
||||||
|
String order = pageRequest.getOrder();
|
||||||
|
|
||||||
|
Sort sortObj = Sort.unsorted();
|
||||||
|
if (sort != null && !sort.isEmpty()) {
|
||||||
|
sortObj = Sort.by(Sort.Direction.fromString(order), sort);
|
||||||
|
}
|
||||||
|
|
||||||
|
org.springframework.data.domain.PageRequest pageable = org.springframework.data.domain.PageRequest.of(page, size, sortObj);
|
||||||
|
|
||||||
|
return groupCourseDao.findAllByDeletedAtIsNull(sortObj)
|
||||||
|
.collectList()
|
||||||
|
.zipWith(groupCourseDao.findAllByDeletedAtIsNull().count())
|
||||||
|
.map(tuple -> {
|
||||||
|
List<GroupCourseEntity> allEntities = tuple.getT1();
|
||||||
|
long total = tuple.getT2();
|
||||||
|
|
||||||
|
int fromIndex = page * size;
|
||||||
|
int toIndex = Math.min(fromIndex + size, allEntities.size());
|
||||||
|
|
||||||
|
List<GroupCourse> courseList;
|
||||||
|
if (fromIndex < allEntities.size()) {
|
||||||
|
courseList = allEntities.subList(fromIndex, toIndex).stream()
|
||||||
|
.map(groupCourseConverter::toDomain)
|
||||||
|
.toList();
|
||||||
|
} else {
|
||||||
|
courseList = List.of();
|
||||||
|
}
|
||||||
|
|
||||||
|
int totalPages = (int) Math.ceil((double) total / size);
|
||||||
|
return new PageResponse<>(courseList, totalPages, total, page, size);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Mono<GroupCourse> save(GroupCourse groupCourse) {
|
||||||
|
GroupCourseEntity entity = groupCourseConverter.toEntity(groupCourse);
|
||||||
|
entity.setCreatedAt(LocalDateTime.now());
|
||||||
|
entity.setUpdatedAt(LocalDateTime.now());
|
||||||
|
entity.setStatus(0L);
|
||||||
|
entity.setCurrentMembers(0);
|
||||||
|
|
||||||
|
return groupCourseDao.save(entity)
|
||||||
|
.map(groupCourseConverter::toDomain);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Mono<GroupCourse> update(GroupCourse groupCourse) {
|
||||||
|
GroupCourseEntity entity = groupCourseConverter.toEntity(groupCourse);
|
||||||
|
entity.setUpdatedAt(LocalDateTime.now());
|
||||||
|
|
||||||
|
return r2dbcEntityTemplate.update(entity)
|
||||||
|
.then(findByIdAndDeletedAtIsNull(groupCourse.getId()));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Mono<GroupCourse> cancel(Long id) {
|
||||||
|
return groupCourseDao.cancelCourse(id, LocalDateTime.now())
|
||||||
|
.flatMap(updated -> {
|
||||||
|
if (updated > 0) {
|
||||||
|
return findByIdAndDeletedAtIsNull(id);
|
||||||
|
}
|
||||||
|
return Mono.empty();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Mono<Void> deleteById(Long id) {
|
||||||
|
return groupCourseDao.softDelete(id, LocalDateTime.now())
|
||||||
|
.then();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Mono<GroupCourse> updateCurrentMembers(Long id, Integer delta) {
|
||||||
|
return groupCourseDao.updateCurrentMembers(id, delta, LocalDateTime.now())
|
||||||
|
.flatMap(updated -> {
|
||||||
|
if (updated > 0) {
|
||||||
|
return findByIdAndDeletedAtIsNull(id);
|
||||||
|
}
|
||||||
|
return Mono.empty();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
+42
@@ -0,0 +1,42 @@
|
|||||||
|
package cn.novalon.gym.manage.groupcourse.scheduler;
|
||||||
|
|
||||||
|
import cn.novalon.gym.manage.groupcourse.service.IGroupCourseBookingService;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.scheduling.annotation.Scheduled;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 团课缺席会员定时任务
|
||||||
|
*
|
||||||
|
* 功能:定期检查已开始但会员未到场的课程,自动更新预约记录状态为缺席
|
||||||
|
*
|
||||||
|
* @author 张翔
|
||||||
|
* @date 2026-06-02
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
public class GroupCourseAbsentScheduler {
|
||||||
|
|
||||||
|
private static final Logger logger = LoggerFactory.getLogger(GroupCourseAbsentScheduler.class);
|
||||||
|
|
||||||
|
private final IGroupCourseBookingService bookingService;
|
||||||
|
|
||||||
|
public GroupCourseAbsentScheduler(IGroupCourseBookingService bookingService) {
|
||||||
|
this.bookingService = bookingService;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 每分钟检查一次已开始课程但未到场会员的预约记录
|
||||||
|
* 使用fixedRate保证任务间隔稳定执行
|
||||||
|
*/
|
||||||
|
@Scheduled(fixedRate = 60000)
|
||||||
|
public void checkAndUpdateAbsentMembers() {
|
||||||
|
logger.debug("定时任务开始检查已开始课程但未到场会员的预约记录");
|
||||||
|
|
||||||
|
bookingService.processAbsentMembers()
|
||||||
|
.subscribe(
|
||||||
|
count -> logger.debug("定时任务完成,更新了 {} 条缺席记录", count),
|
||||||
|
error -> logger.error("定时任务执行失败:{}", error.getMessage(), error)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
+65
@@ -0,0 +1,65 @@
|
|||||||
|
package cn.novalon.gym.manage.groupcourse.service;
|
||||||
|
|
||||||
|
import cn.novalon.gym.manage.groupcourse.domain.GroupCourseBooking;
|
||||||
|
import reactor.core.publisher.Flux;
|
||||||
|
import reactor.core.publisher.Mono;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 团课预约服务接口
|
||||||
|
*
|
||||||
|
* @author 张翔
|
||||||
|
* @date 2026-06-01
|
||||||
|
*/
|
||||||
|
public interface IGroupCourseBookingService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预约团课
|
||||||
|
*
|
||||||
|
* @param courseId 团课ID
|
||||||
|
* @param memberId 会员ID
|
||||||
|
* @param memberCardRecordId 会员卡记录ID
|
||||||
|
* @return 预约记录
|
||||||
|
*/
|
||||||
|
Mono<GroupCourseBooking> bookCourse(Long courseId, Long memberId, Long memberCardRecordId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 取消预约
|
||||||
|
*
|
||||||
|
* @param bookingId 预约ID
|
||||||
|
* @param memberId 会员ID
|
||||||
|
* @return 取消后的预约记录
|
||||||
|
*/
|
||||||
|
Mono<GroupCourseBooking> cancelBooking(Long bookingId, Long memberId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据会员ID查询预约记录列表
|
||||||
|
*
|
||||||
|
* @param memberId 会员ID
|
||||||
|
* @return 预约记录列表
|
||||||
|
*/
|
||||||
|
Flux<GroupCourseBooking> getBookingsByMemberId(Long memberId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据预约ID查询预约详情
|
||||||
|
*
|
||||||
|
* @param bookingId 预约ID
|
||||||
|
* @return 预约记录
|
||||||
|
*/
|
||||||
|
Mono<GroupCourseBooking> getBookingById(Long bookingId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据团课ID查询预约记录列表
|
||||||
|
*
|
||||||
|
* @param courseId 团课ID
|
||||||
|
* @return 预约记录列表
|
||||||
|
*/
|
||||||
|
Flux<GroupCourseBooking> getBookingsByCourseId(Long courseId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处理已开始课程但未到场会员的预约记录
|
||||||
|
* 将状态更新为缺席(3)
|
||||||
|
*
|
||||||
|
* @return 处理的记录数
|
||||||
|
*/
|
||||||
|
Mono<Integer> processAbsentMembers();
|
||||||
|
}
|
||||||
+26
@@ -0,0 +1,26 @@
|
|||||||
|
|
||||||
|
package cn.novalon.gym.manage.groupcourse.service;
|
||||||
|
|
||||||
|
import cn.novalon.gym.manage.common.dto.PageRequest;
|
||||||
|
import cn.novalon.gym.manage.common.dto.PageResponse;
|
||||||
|
import cn.novalon.gym.manage.groupcourse.domain.GroupCourse;
|
||||||
|
import reactor.core.publisher.Flux;
|
||||||
|
import reactor.core.publisher.Mono;
|
||||||
|
|
||||||
|
public interface IGroupCourseService {
|
||||||
|
Mono<GroupCourse> findById(Long id);
|
||||||
|
Flux<GroupCourse> findAll();
|
||||||
|
Flux<GroupCourse> findAll(boolean includeDeleted);
|
||||||
|
|
||||||
|
Mono<PageResponse<GroupCourse>> findByPage(PageRequest pageRequest, boolean includeDeleted);
|
||||||
|
|
||||||
|
Mono<GroupCourse> create(GroupCourse groupCourse);
|
||||||
|
|
||||||
|
Mono<GroupCourse> update(Long id, GroupCourse groupCourse);
|
||||||
|
|
||||||
|
Mono<GroupCourse> cancel(Long id);
|
||||||
|
|
||||||
|
Mono<GroupCourse> signIn(Long courseId, Long memberId);
|
||||||
|
|
||||||
|
Mono<Void> delete(Long id);
|
||||||
|
}
|
||||||
+372
@@ -0,0 +1,372 @@
|
|||||||
|
package cn.novalon.gym.manage.groupcourse.service.impl;
|
||||||
|
|
||||||
|
import cn.novalon.gym.manage.groupcourse.domain.GroupCourse;
|
||||||
|
import cn.novalon.gym.manage.groupcourse.domain.GroupCourseBooking;
|
||||||
|
import cn.novalon.gym.manage.groupcourse.event.BookingReminderEventPublisher;
|
||||||
|
import cn.novalon.gym.manage.groupcourse.handler.BookingSagaHandler;
|
||||||
|
import cn.novalon.gym.manage.groupcourse.repository.IGroupCourseBookingRepository;
|
||||||
|
import cn.novalon.gym.manage.groupcourse.repository.IGroupCourseRepository;
|
||||||
|
import cn.novalon.gym.manage.groupcourse.service.IGroupCourseBookingService;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import reactor.core.publisher.Flux;
|
||||||
|
import reactor.core.publisher.Mono;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.temporal.ChronoUnit;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 团课预约服务实现类
|
||||||
|
*
|
||||||
|
* 业务规则:
|
||||||
|
* - 预约需在课程开始前至少30分钟
|
||||||
|
* - 取消预约需在课程开始前至少2小时
|
||||||
|
* - 每节课最多20人
|
||||||
|
* - 预约成功后发送提醒
|
||||||
|
* - 预约成功后扣减权益
|
||||||
|
*
|
||||||
|
* 技术要点:
|
||||||
|
* - 使用Redis缓存团课信息
|
||||||
|
* - 使用分布式锁防止预约冲突
|
||||||
|
* - 使用响应式编程实现高并发预约
|
||||||
|
*
|
||||||
|
* @author 张翔
|
||||||
|
* @date 2026-06-01
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class GroupCourseBookingService implements IGroupCourseBookingService {
|
||||||
|
|
||||||
|
private static final Logger logger = LoggerFactory.getLogger(GroupCourseBookingService.class);
|
||||||
|
|
||||||
|
private final IGroupCourseBookingRepository bookingRepository;
|
||||||
|
private final IGroupCourseRepository courseRepository;
|
||||||
|
private final GroupCourseRedisService redisService;
|
||||||
|
private final BookingReminderEventPublisher bookingReminderEventPublisher;
|
||||||
|
private final BookingSagaHandler bookingSagaHandler;
|
||||||
|
|
||||||
|
// 预约提前时间限制(分钟)
|
||||||
|
private static final long BOOKING_MIN_ADVANCE_MINUTES = 30;
|
||||||
|
// 取消预约提前时间限制(小时)
|
||||||
|
private static final long CANCEL_MIN_ADVANCE_HOURS = 2;
|
||||||
|
|
||||||
|
public GroupCourseBookingService(IGroupCourseBookingRepository bookingRepository,
|
||||||
|
IGroupCourseRepository courseRepository,
|
||||||
|
GroupCourseRedisService redisService,
|
||||||
|
BookingReminderEventPublisher bookingReminderEventPublisher,
|
||||||
|
BookingSagaHandler bookingSagaHandler) {
|
||||||
|
this.bookingRepository = bookingRepository;
|
||||||
|
this.courseRepository = courseRepository;
|
||||||
|
this.redisService = redisService;
|
||||||
|
this.bookingReminderEventPublisher = bookingReminderEventPublisher;
|
||||||
|
this.bookingSagaHandler = bookingSagaHandler;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Mono<GroupCourseBooking> bookCourse(Long courseId, Long memberId, Long memberCardRecordId) {
|
||||||
|
logger.info("开始预约团课:courseId={}, memberId={}, memberCardRecordId={}", courseId, memberId, memberCardRecordId);
|
||||||
|
|
||||||
|
// 生成唯一请求ID用于分布式锁
|
||||||
|
String requestId = UUID.randomUUID().toString();
|
||||||
|
|
||||||
|
// 1. 获取分布式锁
|
||||||
|
return redisService.acquireLock(courseId, requestId)
|
||||||
|
.flatMap(lockAcquired -> {
|
||||||
|
if (!lockAcquired) {
|
||||||
|
return Mono.error(new RuntimeException("系统繁忙,请稍后重试"));
|
||||||
|
}
|
||||||
|
|
||||||
|
// 2. 尝试从缓存获取课程信息,如果缓存不存在则从数据库获取
|
||||||
|
return getCourseWithCache(courseId)
|
||||||
|
.flatMap(course -> {
|
||||||
|
// 3. 验证课程状态
|
||||||
|
Long status = course.getStatus();
|
||||||
|
if (status == null || status != 0L) {
|
||||||
|
String errorMessage;
|
||||||
|
if (status == null) {
|
||||||
|
errorMessage = "课程状态异常";
|
||||||
|
} else if (status == 1L) {
|
||||||
|
errorMessage = "课程已取消,无法预约";
|
||||||
|
} else if (status == 2L) {
|
||||||
|
errorMessage = "课程已结束,无法预约";
|
||||||
|
} else {
|
||||||
|
errorMessage = "课程状态不可预约";
|
||||||
|
}
|
||||||
|
return releaseLockAndError(courseId, requestId, errorMessage);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 4. 验证预约时间
|
||||||
|
LocalDateTime now = LocalDateTime.now();
|
||||||
|
LocalDateTime startTime = course.getStartTime();
|
||||||
|
long minutesUntilStart = ChronoUnit.MINUTES.between(now, startTime);
|
||||||
|
if (minutesUntilStart < BOOKING_MIN_ADVANCE_MINUTES) {
|
||||||
|
return releaseLockAndError(courseId, requestId,
|
||||||
|
"需在课程开始前" + BOOKING_MIN_ADVANCE_MINUTES + "分钟预约");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 5. 验证课程人数是否已满(使用数据库中的current_members字段)
|
||||||
|
if (course.getCurrentMembers() != null &&
|
||||||
|
course.getMaxMembers() != null &&
|
||||||
|
course.getCurrentMembers() >= course.getMaxMembers()) {
|
||||||
|
return releaseLockAndError(courseId, requestId, "课程已满");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 6. 验证时间冲突(会员是否已预约时间重叠的课程)
|
||||||
|
return bookingRepository.findConflictingBookings(memberId, course.getStartTime(), course.getEndTime())
|
||||||
|
.collectList()
|
||||||
|
.flatMap(conflictingBookings -> {
|
||||||
|
if (!conflictingBookings.isEmpty()) {
|
||||||
|
StringBuilder errorMsg = new StringBuilder("您已预约的课程与当前课程时间冲突:");
|
||||||
|
for (GroupCourseBooking conflict : conflictingBookings) {
|
||||||
|
errorMsg.append(conflict.getCourseName())
|
||||||
|
.append("(")
|
||||||
|
.append(conflict.getCourseStartTime())
|
||||||
|
.append(" - ")
|
||||||
|
.append(conflict.getCourseEndTime())
|
||||||
|
.append(") ");
|
||||||
|
}
|
||||||
|
return releaseLockAndError(courseId, requestId, errorMsg.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
// 7. 验证是否已预约
|
||||||
|
return bookingRepository.findValidBooking(courseId, memberId)
|
||||||
|
.flatMap(existingBooking -> {
|
||||||
|
return releaseLockAndError(courseId, requestId, "您已预约该课程");
|
||||||
|
})
|
||||||
|
.switchIfEmpty(
|
||||||
|
// 8. 使用Redis原子操作验证课程人数是否已满
|
||||||
|
validateAndIncrementBookingCount(courseId, course.getMaxMembers())
|
||||||
|
.flatMap(countValid -> {
|
||||||
|
if (countValid > course.getMaxMembers()) {
|
||||||
|
return releaseLockAndError(courseId, requestId, "课程已满");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 9. 创建预约记录
|
||||||
|
GroupCourseBooking booking = new GroupCourseBooking();
|
||||||
|
booking.setCourseId(courseId);
|
||||||
|
booking.setMemberId(memberId);
|
||||||
|
booking.setMemberCardRecordId(memberCardRecordId);
|
||||||
|
booking.setBookingTime(LocalDateTime.now());
|
||||||
|
booking.setStatus("0"); // 0-已预约
|
||||||
|
|
||||||
|
// 添加课程信息到预约记录
|
||||||
|
booking.setCourseName(course.getCourseName());
|
||||||
|
booking.setCourseStartTime(course.getStartTime());
|
||||||
|
booking.setCourseEndTime(course.getEndTime());
|
||||||
|
booking.setLocation(course.getLocation());
|
||||||
|
|
||||||
|
// 10. 使用Saga事务执行预约(包含权益扣减)
|
||||||
|
return bookingSagaHandler.executeBooking(booking, memberCardRecordId)
|
||||||
|
.flatMap(savedBooking -> {
|
||||||
|
// 11. 释放锁
|
||||||
|
return redisService.releaseLock(courseId, requestId)
|
||||||
|
.then(Mono.just(savedBooking));
|
||||||
|
})
|
||||||
|
.doOnSuccess(savedBooking -> {
|
||||||
|
logger.info("预约成功:bookingId={}, courseId={}, memberId={}",
|
||||||
|
savedBooking.getId(), courseId, memberId);
|
||||||
|
// 发布预约成功事件
|
||||||
|
bookingReminderEventPublisher.publishBookingSuccessEvent(
|
||||||
|
savedBooking.getId(),
|
||||||
|
savedBooking.getMemberId(),
|
||||||
|
savedBooking.getCourseName(),
|
||||||
|
savedBooking.getCourseStartTime().toString()
|
||||||
|
);
|
||||||
|
})
|
||||||
|
.doOnError(error -> {
|
||||||
|
// 回滚Redis计数
|
||||||
|
redisService.decrementBookingCount(courseId).subscribe();
|
||||||
|
logger.error("预约失败:courseId={}, memberId={}, error={}",
|
||||||
|
courseId, memberId, error.getMessage());
|
||||||
|
});
|
||||||
|
})
|
||||||
|
);
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.onErrorResume(error -> {
|
||||||
|
// 发生错误时释放锁
|
||||||
|
redisService.releaseLock(courseId, requestId).subscribe();
|
||||||
|
return Mono.error(error);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 从缓存或数据库获取课程信息
|
||||||
|
*/
|
||||||
|
private Mono<GroupCourse> getCourseWithCache(Long courseId) {
|
||||||
|
return redisService.getCachedCourse(courseId)
|
||||||
|
.switchIfEmpty(
|
||||||
|
// 缓存未命中,从数据库查询
|
||||||
|
courseRepository.findByIdAndDeletedAtIsNull(courseId)
|
||||||
|
.switchIfEmpty(Mono.error(new RuntimeException("团课不存在")))
|
||||||
|
.flatMap(course -> {
|
||||||
|
// 将课程信息存入缓存
|
||||||
|
return redisService.cacheCourse(course).then(Mono.just(course));
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 验证并增加预约人数(使用Redis原子操作)
|
||||||
|
*/
|
||||||
|
private Mono<Integer> validateAndIncrementBookingCount(Long courseId, Integer maxMembers) {
|
||||||
|
// 先获取当前Redis中的预约计数
|
||||||
|
return redisService.getBookingCount(courseId)
|
||||||
|
.flatMap(currentCount -> {
|
||||||
|
// 如果Redis中计数为0,可能是首次访问,需要从数据库同步
|
||||||
|
if (currentCount == 0) {
|
||||||
|
// 从数据库查询实际预约人数
|
||||||
|
return bookingRepository.countValidBookings(courseId)
|
||||||
|
.flatMap(dbCount -> {
|
||||||
|
// 将数据库中的实际预约人数同步到Redis
|
||||||
|
return redisService.setBookingCount(courseId, dbCount.intValue())
|
||||||
|
.then(Mono.just(dbCount.intValue()));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return Mono.just(currentCount);
|
||||||
|
})
|
||||||
|
// 递增预约计数
|
||||||
|
.flatMap(count -> redisService.incrementBookingCount(courseId).map(Long::intValue));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 释放锁并返回错误
|
||||||
|
*/
|
||||||
|
private Mono<GroupCourseBooking> releaseLockAndError(Long courseId, String requestId, String errorMessage) {
|
||||||
|
return redisService.releaseLock(courseId, requestId)
|
||||||
|
.then(Mono.error(new RuntimeException(errorMessage)));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Mono<GroupCourseBooking> cancelBooking(Long bookingId, Long memberId) {
|
||||||
|
logger.info("开始取消预约:bookingId={}, memberId={}", bookingId, memberId);
|
||||||
|
|
||||||
|
// 生成唯一请求ID用于分布式锁
|
||||||
|
String requestId = UUID.randomUUID().toString();
|
||||||
|
|
||||||
|
// 获取锁防止并发取消
|
||||||
|
return redisService.acquireLock(bookingId, requestId)
|
||||||
|
.flatMap(lockAcquired -> {
|
||||||
|
if (!lockAcquired) {
|
||||||
|
return Mono.error(new RuntimeException("系统繁忙,请稍后重试"));
|
||||||
|
}
|
||||||
|
|
||||||
|
// 1. 查询预约记录
|
||||||
|
return bookingRepository.findById(bookingId)
|
||||||
|
.switchIfEmpty(Mono.error(new RuntimeException("预约记录不存在")))
|
||||||
|
.flatMap(booking -> {
|
||||||
|
// 2. 验证预约归属
|
||||||
|
if (!booking.getMemberId().equals(memberId)) {
|
||||||
|
return releaseLockAndError(bookingId, requestId, "无权取消他人预约");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 3. 验证预约状态
|
||||||
|
String status = booking.getStatus();
|
||||||
|
if (!"0".equals(status)) {
|
||||||
|
String errorMessage;
|
||||||
|
if ("1".equals(status)) {
|
||||||
|
errorMessage = "预约已取消,无需重复取消";
|
||||||
|
} else if ("2".equals(status)) {
|
||||||
|
errorMessage = "课程已出席,无法取消";
|
||||||
|
} else if ("3".equals(status)) {
|
||||||
|
errorMessage = "已缺席课程,无法取消";
|
||||||
|
} else {
|
||||||
|
errorMessage = "预约状态不允许取消";
|
||||||
|
}
|
||||||
|
return releaseLockAndError(bookingId, requestId, errorMessage);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 4. 验证取消时间
|
||||||
|
LocalDateTime now = LocalDateTime.now();
|
||||||
|
LocalDateTime startTime = booking.getCourseStartTime();
|
||||||
|
if (startTime == null) {
|
||||||
|
return releaseLockAndError(bookingId, requestId, "课程开始时间为空,无法取消预约");
|
||||||
|
}
|
||||||
|
long hoursUntilStart = ChronoUnit.HOURS.between(now, startTime);
|
||||||
|
if (hoursUntilStart < CANCEL_MIN_ADVANCE_HOURS) {
|
||||||
|
return releaseLockAndError(bookingId, requestId,
|
||||||
|
"需在课程开始前" + CANCEL_MIN_ADVANCE_HOURS + "小时取消");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 5. 使用Saga事务执行取消预约(包含权益恢复)
|
||||||
|
return bookingSagaHandler.executeCancelBooking(bookingId, booking.getCourseId(), booking.getMemberCardRecordId(), memberId)
|
||||||
|
.flatMap(updatedBooking -> {
|
||||||
|
// 6. 释放锁
|
||||||
|
return redisService.releaseLock(bookingId, requestId)
|
||||||
|
.then(Mono.just(updatedBooking));
|
||||||
|
})
|
||||||
|
.doOnSuccess(updatedBooking -> {
|
||||||
|
logger.info("取消预约成功:bookingId={}, memberId={}", bookingId, memberId);
|
||||||
|
// 发布预约取消事件
|
||||||
|
bookingReminderEventPublisher.publishBookingCancelEvent(
|
||||||
|
updatedBooking.getId(),
|
||||||
|
updatedBooking.getMemberId(),
|
||||||
|
updatedBooking.getCourseName()
|
||||||
|
);
|
||||||
|
})
|
||||||
|
.doOnError(error -> {
|
||||||
|
logger.error("取消预约失败:bookingId={}, memberId={}, error={}",
|
||||||
|
bookingId, memberId, error.getMessage());
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.onErrorResume(error -> {
|
||||||
|
redisService.releaseLock(bookingId, requestId).subscribe();
|
||||||
|
return Mono.error(error);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Flux<GroupCourseBooking> getBookingsByMemberId(Long memberId) {
|
||||||
|
logger.debug("查询会员预约记录:memberId={}", memberId);
|
||||||
|
return bookingRepository.findByMemberId(memberId)
|
||||||
|
.doOnComplete(() -> logger.debug("查询完成:memberId={}", memberId));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Mono<GroupCourseBooking> getBookingById(Long bookingId) {
|
||||||
|
logger.debug("查询预约详情:bookingId={}", bookingId);
|
||||||
|
return bookingRepository.findById(bookingId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Flux<GroupCourseBooking> getBookingsByCourseId(Long courseId) {
|
||||||
|
logger.debug("查询课程预约记录:courseId={}", courseId);
|
||||||
|
return bookingRepository.findByCourseId(courseId)
|
||||||
|
.doOnComplete(() -> logger.debug("查询完成:courseId={}", courseId));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Mono<Integer> processAbsentMembers() {
|
||||||
|
logger.info("开始处理已开始课程但未到场会员的预约记录");
|
||||||
|
|
||||||
|
return bookingRepository.findAbsentMembers()
|
||||||
|
.collectList()
|
||||||
|
.flatMap(absentBookings -> {
|
||||||
|
if (absentBookings.isEmpty()) {
|
||||||
|
logger.info("没有需要处理的缺席会员记录");
|
||||||
|
return Mono.just(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
logger.info("发现 {} 条需要更新为缺席状态的预约记录", absentBookings.size());
|
||||||
|
|
||||||
|
// 批量更新状态为缺席
|
||||||
|
return Flux.fromIterable(absentBookings)
|
||||||
|
.flatMap(booking -> {
|
||||||
|
logger.debug("更新预约记录为缺席状态:bookingId={}, memberId={}, courseId={}",
|
||||||
|
booking.getId(), booking.getMemberId(), booking.getCourseId());
|
||||||
|
return bookingRepository.updateToAbsent(booking.getId());
|
||||||
|
})
|
||||||
|
.reduce(Integer::sum)
|
||||||
|
.defaultIfEmpty(0)
|
||||||
|
.doOnSuccess(count -> {
|
||||||
|
logger.info("成功更新 {} 条预约记录为缺席状态", count);
|
||||||
|
})
|
||||||
|
.doOnError(error -> {
|
||||||
|
logger.error("处理缺席会员记录时发生错误:{}", error.getMessage(), error);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
+194
@@ -0,0 +1,194 @@
|
|||||||
|
package cn.novalon.gym.manage.groupcourse.service.impl;
|
||||||
|
|
||||||
|
import cn.novalon.gym.manage.groupcourse.domain.GroupCourse;
|
||||||
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||||
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.data.redis.core.ReactiveRedisTemplate;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import reactor.core.publisher.Mono;
|
||||||
|
|
||||||
|
import java.time.Duration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 团课Redis缓存服务
|
||||||
|
*
|
||||||
|
* 负责团课信息的缓存管理和分布式锁实现
|
||||||
|
*
|
||||||
|
* @author 张翔
|
||||||
|
* @date 2026-06-01
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class GroupCourseRedisService {
|
||||||
|
|
||||||
|
private static final Logger logger = LoggerFactory.getLogger(GroupCourseRedisService.class);
|
||||||
|
|
||||||
|
// 团课信息缓存Key前缀
|
||||||
|
private static final String GROUP_COURSE_CACHE_PREFIX = "group_course:";
|
||||||
|
// 团课预约锁Key前缀
|
||||||
|
private static final String BOOKING_LOCK_PREFIX = "booking_lock:";
|
||||||
|
// 缓存过期时间(5分钟)
|
||||||
|
private static final Duration CACHE_EXPIRE_TIME = Duration.ofMinutes(5);
|
||||||
|
// 锁过期时间(30秒)
|
||||||
|
private static final Duration LOCK_EXPIRE_TIME = Duration.ofSeconds(30);
|
||||||
|
|
||||||
|
private final ReactiveRedisTemplate<String, Object> reactiveRedisTemplate;
|
||||||
|
private final ObjectMapper objectMapper;
|
||||||
|
|
||||||
|
public GroupCourseRedisService(ReactiveRedisTemplate<String, Object> reactiveRedisTemplate,
|
||||||
|
ObjectMapper objectMapper) {
|
||||||
|
this.reactiveRedisTemplate = reactiveRedisTemplate;
|
||||||
|
this.objectMapper = objectMapper;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取团课缓存Key
|
||||||
|
*/
|
||||||
|
private String getCourseCacheKey(Long courseId) {
|
||||||
|
return GROUP_COURSE_CACHE_PREFIX + courseId;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取预约锁Key
|
||||||
|
*/
|
||||||
|
private String getBookingLockKey(Long courseId) {
|
||||||
|
return BOOKING_LOCK_PREFIX + courseId;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 缓存团课信息
|
||||||
|
*/
|
||||||
|
public Mono<Void> cacheCourse(GroupCourse course) {
|
||||||
|
String key = getCourseCacheKey(course.getId());
|
||||||
|
try {
|
||||||
|
String value = objectMapper.writeValueAsString(course);
|
||||||
|
return reactiveRedisTemplate.opsForValue()
|
||||||
|
.set(key, value, CACHE_EXPIRE_TIME)
|
||||||
|
.doOnSuccess(result -> logger.debug("团课信息已缓存:courseId={}", course.getId()))
|
||||||
|
.then();
|
||||||
|
} catch (JsonProcessingException e) {
|
||||||
|
logger.error("序列化团课信息失败:courseId={}", course.getId(), e);
|
||||||
|
return Mono.error(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取缓存的团课信息
|
||||||
|
*/
|
||||||
|
public Mono<GroupCourse> getCachedCourse(Long courseId) {
|
||||||
|
String key = getCourseCacheKey(courseId);
|
||||||
|
return reactiveRedisTemplate.opsForValue()
|
||||||
|
.get(key)
|
||||||
|
.cast(String.class)
|
||||||
|
.flatMap(value -> {
|
||||||
|
try {
|
||||||
|
GroupCourse course = objectMapper.readValue(value, GroupCourse.class);
|
||||||
|
logger.debug("从缓存获取团课信息:courseId={}", courseId);
|
||||||
|
return Mono.just(course);
|
||||||
|
} catch (JsonProcessingException e) {
|
||||||
|
logger.error("反序列化团课信息失败:courseId={}", courseId, e);
|
||||||
|
return Mono.empty();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.switchIfEmpty(Mono.fromRunnable(() -> logger.debug("缓存中未找到团课信息:courseId={}", courseId)));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除团课缓存
|
||||||
|
*/
|
||||||
|
public Mono<Void> invalidateCourseCache(Long courseId) {
|
||||||
|
String key = getCourseCacheKey(courseId);
|
||||||
|
return reactiveRedisTemplate.delete(key)
|
||||||
|
.doOnSuccess(result -> logger.debug("团课缓存已删除:courseId={}", courseId))
|
||||||
|
.then();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取分布式锁
|
||||||
|
*
|
||||||
|
* @param courseId 课程ID
|
||||||
|
* @param requestId 请求ID(用于锁的唯一性校验)
|
||||||
|
* @return 是否获取成功
|
||||||
|
*/
|
||||||
|
public Mono<Boolean> acquireLock(Long courseId, String requestId) {
|
||||||
|
String key = getBookingLockKey(courseId);
|
||||||
|
return reactiveRedisTemplate.opsForValue()
|
||||||
|
.setIfAbsent(key, requestId, LOCK_EXPIRE_TIME)
|
||||||
|
.doOnSuccess(acquired -> {
|
||||||
|
if (acquired) {
|
||||||
|
logger.debug("获取预约锁成功:courseId={}, requestId={}", courseId, requestId);
|
||||||
|
} else {
|
||||||
|
logger.debug("获取预约锁失败:courseId={}", courseId);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 释放分布式锁
|
||||||
|
*
|
||||||
|
* @param courseId 课程ID
|
||||||
|
* @param requestId 请求ID(用于锁的唯一性校验)
|
||||||
|
* @return 是否释放成功
|
||||||
|
*/
|
||||||
|
public Mono<Boolean> releaseLock(Long courseId, String requestId) {
|
||||||
|
String key = getBookingLockKey(courseId);
|
||||||
|
return reactiveRedisTemplate.opsForValue()
|
||||||
|
.get(key)
|
||||||
|
.cast(String.class)
|
||||||
|
.flatMap(storedRequestId -> {
|
||||||
|
if (requestId.equals(storedRequestId)) {
|
||||||
|
return reactiveRedisTemplate.delete(key)
|
||||||
|
.map(deleted -> deleted > 0)
|
||||||
|
.doOnSuccess(result -> logger.debug("释放预约锁成功:courseId={}, requestId={}", courseId, requestId));
|
||||||
|
} else {
|
||||||
|
logger.warn("锁归属校验失败:courseId={}, expectedRequestId={}, actualRequestId={}",
|
||||||
|
courseId, requestId, storedRequestId);
|
||||||
|
return Mono.just(false);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.defaultIfEmpty(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取课程预约人数(缓存)
|
||||||
|
*/
|
||||||
|
public Mono<Integer> getBookingCount(Long courseId) {
|
||||||
|
String key = "booking_count:" + courseId;
|
||||||
|
return reactiveRedisTemplate.opsForValue()
|
||||||
|
.get(key)
|
||||||
|
.map(obj -> (Integer) obj)
|
||||||
|
.defaultIfEmpty(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 增加课程预约人数
|
||||||
|
*/
|
||||||
|
public Mono<Long> incrementBookingCount(Long courseId) {
|
||||||
|
String key = "booking_count:" + courseId;
|
||||||
|
return reactiveRedisTemplate.opsForValue()
|
||||||
|
.increment(key)
|
||||||
|
.doOnSuccess(count -> logger.debug("预约人数增加:courseId={}, count={}", courseId, count));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 减少课程预约人数
|
||||||
|
*/
|
||||||
|
public Mono<Long> decrementBookingCount(Long courseId) {
|
||||||
|
String key = "booking_count:" + courseId;
|
||||||
|
return reactiveRedisTemplate.opsForValue()
|
||||||
|
.decrement(key)
|
||||||
|
.doOnSuccess(count -> logger.debug("预约人数减少:courseId={}, count={}", courseId, count));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置课程预约人数(用于从数据库同步)
|
||||||
|
*/
|
||||||
|
public Mono<Void> setBookingCount(Long courseId, Integer count) {
|
||||||
|
String key = "booking_count:" + courseId;
|
||||||
|
return reactiveRedisTemplate.opsForValue()
|
||||||
|
.set(key, count)
|
||||||
|
.doOnSuccess(result -> logger.debug("预约人数已设置:courseId={}, count={}", courseId, count))
|
||||||
|
.then();
|
||||||
|
}
|
||||||
|
}
|
||||||
+396
@@ -0,0 +1,396 @@
|
|||||||
|
|
||||||
|
package cn.novalon.gym.manage.groupcourse.service.impl;
|
||||||
|
|
||||||
|
import cn.novalon.gym.manage.common.dto.PageRequest;
|
||||||
|
import cn.novalon.gym.manage.common.dto.PageResponse;
|
||||||
|
import cn.novalon.gym.manage.common.util.RedisUtil;
|
||||||
|
import cn.novalon.gym.manage.groupcourse.domain.GroupCourse;
|
||||||
|
import cn.novalon.gym.manage.groupcourse.domain.GroupCourseBooking;
|
||||||
|
import cn.novalon.gym.manage.groupcourse.enums.CourseEvent;
|
||||||
|
import cn.novalon.gym.manage.groupcourse.enums.CourseStatus;
|
||||||
|
import cn.novalon.gym.manage.groupcourse.handler.GroupCourseStateMachine;
|
||||||
|
import cn.novalon.gym.manage.groupcourse.repository.IGroupCourseBookingRepository;
|
||||||
|
import cn.novalon.gym.manage.groupcourse.repository.IGroupCourseRepository;
|
||||||
|
import cn.novalon.gym.manage.groupcourse.service.IGroupCourseService;
|
||||||
|
import cn.novalon.gym.manage.member.entity.MemberCard;
|
||||||
|
import cn.novalon.gym.manage.member.entity.MemberCardRecord;
|
||||||
|
import cn.novalon.gym.manage.member.enums.MemberCardType;
|
||||||
|
import cn.novalon.gym.manage.member.repository.MemberCardRepository;
|
||||||
|
import cn.novalon.gym.manage.member.service.IMemberCardRecordService;
|
||||||
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||||
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import reactor.core.publisher.Flux;
|
||||||
|
import reactor.core.publisher.Mono;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class GroupCourseService implements IGroupCourseService {
|
||||||
|
private static final Logger logger = LoggerFactory.getLogger(GroupCourseService.class);
|
||||||
|
|
||||||
|
private final IGroupCourseRepository groupCourseRepository;
|
||||||
|
private final IGroupCourseBookingRepository bookingRepository;
|
||||||
|
private final IMemberCardRecordService memberCardRecordService;
|
||||||
|
private final MemberCardRepository memberCardRepository;
|
||||||
|
private final RedisUtil redisUtil;
|
||||||
|
private final ObjectMapper objectMapper;
|
||||||
|
private final GroupCourseStateMachine stateMachine;
|
||||||
|
|
||||||
|
private static final String CACHE_KEY_PREFIX = "group_course:page:";
|
||||||
|
private static final String CACHE_KEY_ID_PREFIX = "group_course:id:";
|
||||||
|
private static final long CACHE_EXPIRE_SECONDS = 300;
|
||||||
|
|
||||||
|
private static final double DEFAULT_GROUP_COURSE_PRICE = 50.0;
|
||||||
|
|
||||||
|
public GroupCourseService(IGroupCourseRepository groupCourseRepository,
|
||||||
|
IGroupCourseBookingRepository bookingRepository,
|
||||||
|
IMemberCardRecordService memberCardRecordService,
|
||||||
|
MemberCardRepository memberCardRepository,
|
||||||
|
RedisUtil redisUtil,
|
||||||
|
ObjectMapper objectMapper,
|
||||||
|
GroupCourseStateMachine stateMachine){
|
||||||
|
this.groupCourseRepository = groupCourseRepository;
|
||||||
|
this.bookingRepository = bookingRepository;
|
||||||
|
this.memberCardRecordService = memberCardRecordService;
|
||||||
|
this.memberCardRepository = memberCardRepository;
|
||||||
|
this.redisUtil = redisUtil;
|
||||||
|
this.objectMapper = objectMapper;
|
||||||
|
this.stateMachine = stateMachine;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Mono<GroupCourse> findById(Long id) {
|
||||||
|
String cacheKey = CACHE_KEY_ID_PREFIX + id;
|
||||||
|
|
||||||
|
return redisUtil.get(cacheKey, String.class)
|
||||||
|
.flatMap(cachedJson -> {
|
||||||
|
if (cachedJson != null) {
|
||||||
|
try {
|
||||||
|
GroupCourse groupCourse = objectMapper.readValue(cachedJson, GroupCourse.class);
|
||||||
|
logger.info("缓存命中 - findById: id={}", id);
|
||||||
|
return Mono.just(groupCourse);
|
||||||
|
} catch (JsonProcessingException e) {
|
||||||
|
logger.warn("缓存解析失败,删除缓存 - id: {}, error: {}", id, e.getMessage());
|
||||||
|
return redisUtil.delete(cacheKey).then(Mono.empty());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return Mono.empty();
|
||||||
|
})
|
||||||
|
.switchIfEmpty(
|
||||||
|
groupCourseRepository.findByIdAndDeletedAtIsNull(id)
|
||||||
|
.flatMap(groupCourse -> {
|
||||||
|
try {
|
||||||
|
String jsonData = objectMapper.writeValueAsString(groupCourse);
|
||||||
|
return redisUtil.setWithExpire(cacheKey, jsonData, CACHE_EXPIRE_SECONDS)
|
||||||
|
.thenReturn(groupCourse)
|
||||||
|
.doOnSuccess(gc -> logger.debug("缓存已设置 - findById: id={}", id));
|
||||||
|
} catch (JsonProcessingException e) {
|
||||||
|
logger.error("缓存设置失败 - id: {}, error: {}", id, e.getMessage());
|
||||||
|
return Mono.just(groupCourse);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.doOnSubscribe(sub -> logger.debug("缓存未命中,查询数据库 - findById: id={}", id))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Flux<GroupCourse> findAll() {
|
||||||
|
return groupCourseRepository.findAll();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Flux<GroupCourse> findAll(boolean includeDeleted) {
|
||||||
|
if(includeDeleted){
|
||||||
|
return groupCourseRepository.findAll();
|
||||||
|
}else{
|
||||||
|
return groupCourseRepository.findByDeletedAtIsNull();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Mono<PageResponse<GroupCourse>> findByPage(PageRequest pageRequest, boolean includeDeleted) {
|
||||||
|
int page = pageRequest.getPage();
|
||||||
|
int size = pageRequest.getSize();
|
||||||
|
String sort = pageRequest.getSort();
|
||||||
|
String order = pageRequest.getOrder();
|
||||||
|
String keyword = pageRequest.getKeyword() != null ? pageRequest.getKeyword() : "";
|
||||||
|
|
||||||
|
String cacheKey = CACHE_KEY_PREFIX + page + ":" + size + ":" + includeDeleted + ":" + sort + ":" + order + ":" + keyword;
|
||||||
|
|
||||||
|
return redisUtil.get(cacheKey, String.class)
|
||||||
|
.flatMap(cachedJson -> {
|
||||||
|
if (cachedJson != null) {
|
||||||
|
try {
|
||||||
|
PageResponse<GroupCourse> pageResponse = objectMapper.readValue(cachedJson,
|
||||||
|
objectMapper.getTypeFactory().constructParametricType(PageResponse.class, GroupCourse.class));
|
||||||
|
logger.info("缓存命中 - findByPage: key={}", cacheKey);
|
||||||
|
return Mono.just(pageResponse);
|
||||||
|
} catch (JsonProcessingException e) {
|
||||||
|
logger.warn("缓存解析失败,删除缓存 - key: {}, error: {}", cacheKey, e.getMessage());
|
||||||
|
return redisUtil.delete(cacheKey).then(Mono.empty());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return Mono.empty();
|
||||||
|
})
|
||||||
|
.switchIfEmpty(
|
||||||
|
Mono.defer(() -> {
|
||||||
|
logger.debug("缓存未命中,查询数据库 - findByPage: key={}", cacheKey);
|
||||||
|
Mono<PageResponse<GroupCourse>> resultMono;
|
||||||
|
if (includeDeleted) {
|
||||||
|
resultMono = groupCourseRepository.findByPage(pageRequest);
|
||||||
|
} else {
|
||||||
|
resultMono = groupCourseRepository.findByPageAndNotDeleted(pageRequest);
|
||||||
|
}
|
||||||
|
|
||||||
|
return resultMono.flatMap(pageResponse -> {
|
||||||
|
try {
|
||||||
|
String jsonData = objectMapper.writeValueAsString(pageResponse);
|
||||||
|
return redisUtil.setWithExpire(cacheKey, jsonData, CACHE_EXPIRE_SECONDS)
|
||||||
|
.thenReturn(pageResponse)
|
||||||
|
.doOnSuccess(pr -> logger.debug("缓存已设置 - findByPage: key={}", cacheKey));
|
||||||
|
} catch (JsonProcessingException e) {
|
||||||
|
logger.error("缓存设置失败 - key: {}, error: {}", cacheKey, e.getMessage());
|
||||||
|
return Mono.just(pageResponse);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Mono<GroupCourse> create(GroupCourse groupCourse) {
|
||||||
|
return groupCourseRepository.save(groupCourse)
|
||||||
|
.doOnSuccess(course -> logger.info("团课创建成功 - id={}, name={}", course.getId(), course.getCourseName()))
|
||||||
|
.flatMap(course -> clearCache().thenReturn(course))
|
||||||
|
.doOnError(error -> logger.error("团课创建失败 - error: {}", error.getMessage()));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Mono<GroupCourse> update(Long id, GroupCourse groupCourse) {
|
||||||
|
return groupCourseRepository.findByIdAndDeletedAtIsNull(id)
|
||||||
|
.switchIfEmpty(Mono.error(new RuntimeException("团课不存在")))
|
||||||
|
.flatMap(existing -> {
|
||||||
|
if (groupCourse.getCourseName() != null) {
|
||||||
|
existing.setCourseName(groupCourse.getCourseName());
|
||||||
|
}
|
||||||
|
if (groupCourse.getCoachId() != null) {
|
||||||
|
existing.setCoachId(groupCourse.getCoachId());
|
||||||
|
}
|
||||||
|
if (groupCourse.getCourseType() != null) {
|
||||||
|
existing.setCourseType(groupCourse.getCourseType());
|
||||||
|
}
|
||||||
|
if (groupCourse.getStartTime() != null) {
|
||||||
|
existing.setStartTime(groupCourse.getStartTime());
|
||||||
|
}
|
||||||
|
if (groupCourse.getEndTime() != null) {
|
||||||
|
existing.setEndTime(groupCourse.getEndTime());
|
||||||
|
}
|
||||||
|
if (groupCourse.getMaxMembers() != null) {
|
||||||
|
existing.setMaxMembers(groupCourse.getMaxMembers());
|
||||||
|
}
|
||||||
|
if (groupCourse.getStatus() != null) {
|
||||||
|
existing.setStatus(groupCourse.getStatus());
|
||||||
|
}
|
||||||
|
if (groupCourse.getLocation() != null) {
|
||||||
|
existing.setLocation(groupCourse.getLocation());
|
||||||
|
}
|
||||||
|
if (groupCourse.getCoverImage() != null) {
|
||||||
|
existing.setCoverImage(groupCourse.getCoverImage());
|
||||||
|
}
|
||||||
|
if (groupCourse.getDescription() != null) {
|
||||||
|
existing.setDescription(groupCourse.getDescription());
|
||||||
|
}
|
||||||
|
if (groupCourse.getPointCardAmount() != null) {
|
||||||
|
existing.setPointCardAmount(groupCourse.getPointCardAmount());
|
||||||
|
}
|
||||||
|
if (groupCourse.getStoredValueAmount() != null) {
|
||||||
|
existing.setStoredValueAmount(groupCourse.getStoredValueAmount());
|
||||||
|
}
|
||||||
|
return groupCourseRepository.update(existing);
|
||||||
|
})
|
||||||
|
.doOnSuccess(course -> logger.info("团课更新成功 - id={}", id))
|
||||||
|
.flatMap(course -> clearCache().thenReturn(course))
|
||||||
|
.doOnError(error -> logger.error("团课更新失败 - id={}, error: {}", id, error.getMessage()));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Mono<GroupCourse> cancel(Long id) {
|
||||||
|
return groupCourseRepository.findByIdAndDeletedAtIsNull(id)
|
||||||
|
.switchIfEmpty(Mono.error(new RuntimeException("团课不存在")))
|
||||||
|
.flatMap(course -> {
|
||||||
|
// 使用状态机验证状态转换
|
||||||
|
return stateMachine.validateTransition(course, CourseEvent.CANCEL)
|
||||||
|
.then(Mono.just(course));
|
||||||
|
})
|
||||||
|
.flatMap(course -> {
|
||||||
|
LocalDateTime now = LocalDateTime.now();
|
||||||
|
// 检查当前时间是否超过课程开始前24小时
|
||||||
|
// 如果当前时间 > (课程开始时间 - 24小时),则不允许取消
|
||||||
|
if (now.isAfter(course.getStartTime().minusHours(24))) {
|
||||||
|
return Mono.error(new RuntimeException("课程取消需提前24小时"));
|
||||||
|
}
|
||||||
|
|
||||||
|
// 取消课程并返还权益
|
||||||
|
return groupCourseRepository.cancel(id)
|
||||||
|
.flatMap(canceledCourse -> {
|
||||||
|
// 为所有预约该课程的会员返还权益
|
||||||
|
return refundBookingMembers(canceledCourse.getId())
|
||||||
|
.then(Mono.just(canceledCourse));
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.doOnSuccess(course -> logger.info("团课取消成功 - id={}", id))
|
||||||
|
.flatMap(course -> clearCache().thenReturn(course))
|
||||||
|
.doOnError(error -> logger.error("团课取消失败 - id={}, error: {}", id, error.getMessage()));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 为预约课程的所有会员返还权益
|
||||||
|
*
|
||||||
|
* @param courseId 课程ID
|
||||||
|
* @return 空Mono
|
||||||
|
*/
|
||||||
|
private Mono<Void> refundBookingMembers(Long courseId) {
|
||||||
|
logger.info("开始为课程预约会员返还权益: courseId={}", courseId);
|
||||||
|
|
||||||
|
return groupCourseRepository.findByIdAndDeletedAtIsNull(courseId)
|
||||||
|
.switchIfEmpty(Mono.error(new RuntimeException("课程不存在")))
|
||||||
|
.flatMap(course -> {
|
||||||
|
Integer pointCardAmount = course.getPointCardAmount() != null ? course.getPointCardAmount() : 1;
|
||||||
|
Double storedValueAmount = course.getStoredValueAmount() != null ?
|
||||||
|
course.getStoredValueAmount().doubleValue() : DEFAULT_GROUP_COURSE_PRICE;
|
||||||
|
|
||||||
|
logger.info("课程权益信息: courseId={}, pointCardAmount={}, storedValueAmount={}",
|
||||||
|
courseId, pointCardAmount, storedValueAmount);
|
||||||
|
|
||||||
|
return bookingRepository.findByCourseId(courseId)
|
||||||
|
.filter(booking -> "0".equals(booking.getStatus())) // 只处理已预约状态的记录
|
||||||
|
.flatMap(booking -> {
|
||||||
|
Long memberCardRecordId = booking.getMemberCardRecordId();
|
||||||
|
if (memberCardRecordId == null) {
|
||||||
|
logger.warn("预约记录没有会员卡记录ID: bookingId={}", booking.getId());
|
||||||
|
return Mono.empty();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 根据会员卡类型返还权益
|
||||||
|
return refundCardUsage(booking.getId(), memberCardRecordId, pointCardAmount, storedValueAmount)
|
||||||
|
.doOnSuccess(unused -> logger.info("会员权益返还成功: bookingId={}, memberId={}",
|
||||||
|
booking.getId(), booking.getMemberId()))
|
||||||
|
.doOnError(error -> logger.error("会员权益返还失败: bookingId={}, memberId={}, error={}",
|
||||||
|
booking.getId(), booking.getMemberId(), error.getMessage()))
|
||||||
|
.onErrorResume(e -> Mono.empty()); // 单个会员返还失败不影响其他会员
|
||||||
|
})
|
||||||
|
.then();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据会员卡类型返还权益
|
||||||
|
*
|
||||||
|
* @param bookingId 预约ID
|
||||||
|
* @param recordId 会员卡记录ID
|
||||||
|
* @param pointCardAmount 次卡返还次数
|
||||||
|
* @param storedValueAmount 储值卡返还金额
|
||||||
|
* @return 空Mono
|
||||||
|
*/
|
||||||
|
private Mono<Void> refundCardUsage(Long bookingId, Long recordId, Integer pointCardAmount, Double storedValueAmount) {
|
||||||
|
return memberCardRecordService.findById(recordId)
|
||||||
|
.switchIfEmpty(Mono.error(new RuntimeException("会员卡记录不存在")))
|
||||||
|
.flatMap(record -> {
|
||||||
|
return memberCardRepository.findById(record.getMemberCardId())
|
||||||
|
.flatMap(card -> {
|
||||||
|
MemberCardType cardType = MemberCardType.valueOf(card.getMemberCardType());
|
||||||
|
|
||||||
|
Mono<Void> refundOperation;
|
||||||
|
switch (cardType) {
|
||||||
|
case COUNT_CARD:
|
||||||
|
// 次卡返还次数(基于课程设置的pointCardAmount)
|
||||||
|
logger.debug("返还次卡次数: recordId={}, amount={}", recordId, pointCardAmount);
|
||||||
|
refundOperation = memberCardRecordService.renewCard(recordId, pointCardAmount, 0.0, record.getExpireTime())
|
||||||
|
.then(Mono.empty());
|
||||||
|
break;
|
||||||
|
case STORED_VALUE_CARD:
|
||||||
|
// 储值卡返还金额(基于课程设置的storedValueAmount)
|
||||||
|
logger.debug("返还储值卡金额: recordId={}, amount={}", recordId, storedValueAmount);
|
||||||
|
refundOperation = memberCardRecordService.renewCard(recordId, 0, storedValueAmount, record.getExpireTime())
|
||||||
|
.then(Mono.empty());
|
||||||
|
break;
|
||||||
|
case TIME_CARD:
|
||||||
|
// 时长卡不返还,仅修改预约记录状态
|
||||||
|
logger.debug("时长卡不返还权益,仅更新预约状态: bookingId={}", bookingId);
|
||||||
|
refundOperation = Mono.empty();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return Mono.error(new RuntimeException("不支持的会员卡类型: " + cardType));
|
||||||
|
}
|
||||||
|
|
||||||
|
// 无论哪种卡类型,都需要更新预约记录状态为已取消
|
||||||
|
return refundOperation.then(bookingRepository.updateStatus(bookingId, "1"))
|
||||||
|
.flatMap(rows -> {
|
||||||
|
if (rows == 0) {
|
||||||
|
logger.warn("更新预约状态失败: bookingId={}", bookingId);
|
||||||
|
}
|
||||||
|
return Mono.empty();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Mono<GroupCourse> signIn(Long courseId, Long memberId) {
|
||||||
|
return groupCourseRepository.findByIdAndDeletedAtIsNull(courseId)
|
||||||
|
.switchIfEmpty(Mono.error(new RuntimeException("团课不存在")))
|
||||||
|
.flatMap(course -> {
|
||||||
|
if (course.getStatus() != 0L) {
|
||||||
|
return Mono.error(new RuntimeException("课程状态不允许签到"));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (course.getCurrentMembers() >= course.getMaxMembers()) {
|
||||||
|
return Mono.error(new RuntimeException("课程已满员"));
|
||||||
|
}
|
||||||
|
|
||||||
|
// 检查会员是否已预约此课程
|
||||||
|
return bookingRepository.findValidBooking(courseId, memberId)
|
||||||
|
.switchIfEmpty(Mono.error(new RuntimeException("会员未预约此课程")))
|
||||||
|
.flatMap(booking -> {
|
||||||
|
// 更新课程当前人数
|
||||||
|
return groupCourseRepository.updateCurrentMembers(courseId, 1)
|
||||||
|
.flatMap(updatedCourse -> {
|
||||||
|
// 更新预约状态为已出席
|
||||||
|
return bookingRepository.updateStatus(booking.getId(), "2")
|
||||||
|
.thenReturn(updatedCourse);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.doOnSuccess(course -> logger.info("团课签到成功 - courseId={}, memberId={}", courseId, memberId))
|
||||||
|
.flatMap(course -> clearCache().thenReturn(course))
|
||||||
|
.doOnError(error -> logger.error("团课签到失败 - courseId={}, memberId={}, error: {}", courseId, memberId, error.getMessage()));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Mono<Void> delete(Long id) {
|
||||||
|
// 先查询课程状态,只有已取消的课程才能删除
|
||||||
|
return groupCourseRepository.findByIdAndDeletedAtIsNull(id)
|
||||||
|
.switchIfEmpty(Mono.error(new RuntimeException("团课不存在")))
|
||||||
|
.flatMap(course -> {
|
||||||
|
// 检查课程状态是否为已取消(状态码1)
|
||||||
|
if (course.getStatus() == null || !course.getStatus().equals(CourseStatus.CANCELLED.getValue())) {
|
||||||
|
return Mono.error(new RuntimeException("只有已取消的课程才能删除,当前状态: " +
|
||||||
|
(course.getStatus() != null ? course.getStatus() : "未知")));
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除课程
|
||||||
|
return groupCourseRepository.deleteById(id)
|
||||||
|
.doOnSuccess(v -> logger.info("团课删除成功 - id={}", id))
|
||||||
|
.then(clearCache())
|
||||||
|
.doOnError(error -> logger.error("团课删除失败 - id={}, error: {}", id, error.getMessage()));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private Mono<Void> clearCache() {
|
||||||
|
return redisUtil.deleteByPattern(CACHE_KEY_PREFIX + "*")
|
||||||
|
.then(redisUtil.deleteByPattern(CACHE_KEY_ID_PREFIX + "*")).then();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
spring:
|
||||||
|
application:
|
||||||
|
name: gym-groupCourse
|
||||||
+13
@@ -0,0 +1,13 @@
|
|||||||
|
package cn.novalon.gym.manage.groupcourse;
|
||||||
|
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
|
|
||||||
|
@SpringBootTest
|
||||||
|
class GymGroupCourseApplicationTests {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void contextLoads() {
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+1
-1
@@ -3,7 +3,7 @@ package cn.novalon.gym.manage.member.service.impl;
|
|||||||
import cn.novalon.gym.manage.member.entity.MemberCardRecord;
|
import cn.novalon.gym.manage.member.entity.MemberCardRecord;
|
||||||
import cn.novalon.gym.manage.member.repository.MemberCardRecordRepository;
|
import cn.novalon.gym.manage.member.repository.MemberCardRecordRepository;
|
||||||
import cn.novalon.gym.manage.member.service.IMemberCardRecordService;
|
import cn.novalon.gym.manage.member.service.IMemberCardRecordService;
|
||||||
import cn.novalon.gym.manage.member.util.RedisUtil;
|
import cn.novalon.gym.manage.common.util.RedisUtil;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.Pageable;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|||||||
+1
-1
@@ -15,7 +15,7 @@ import cn.novalon.gym.manage.member.repository.MemberCardRecordRepository;
|
|||||||
import cn.novalon.gym.manage.member.repository.MemberCardRepository;
|
import cn.novalon.gym.manage.member.repository.MemberCardRepository;
|
||||||
import cn.novalon.gym.manage.member.service.IMemberCardService;
|
import cn.novalon.gym.manage.member.service.IMemberCardService;
|
||||||
import cn.novalon.gym.manage.member.service.IMemberCardTransactionService;
|
import cn.novalon.gym.manage.member.service.IMemberCardTransactionService;
|
||||||
import cn.novalon.gym.manage.member.util.RedisUtil;
|
import cn.novalon.gym.manage.common.util.RedisUtil;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.Pageable;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|||||||
+1
-10
@@ -17,30 +17,21 @@ import cn.novalon.gym.manage.member.service.MemberService;
|
|||||||
import cn.novalon.gym.manage.member.util.AesUtil;
|
import cn.novalon.gym.manage.member.util.AesUtil;
|
||||||
import cn.novalon.gym.manage.member.util.BeanConvertUtil;
|
import cn.novalon.gym.manage.member.util.BeanConvertUtil;
|
||||||
import cn.novalon.gym.manage.member.util.EsSyncUtils;
|
import cn.novalon.gym.manage.member.util.EsSyncUtils;
|
||||||
import cn.novalon.gym.manage.member.util.RedisUtil;
|
import cn.novalon.gym.manage.common.util.RedisUtil;
|
||||||
import cn.novalon.gym.manage.member.vo.MemberCardInfoVO;
|
import cn.novalon.gym.manage.member.vo.MemberCardInfoVO;
|
||||||
import cn.novalon.gym.manage.member.vo.MemberDetailVO;
|
import cn.novalon.gym.manage.member.vo.MemberDetailVO;
|
||||||
import cn.novalon.gym.manage.member.vo.MemberInfoVO;
|
import cn.novalon.gym.manage.member.vo.MemberInfoVO;
|
||||||
import co.elastic.clients.elasticsearch.ElasticsearchClient;
|
|
||||||
import co.elastic.clients.elasticsearch.core.IndexResponse;
|
|
||||||
import co.elastic.clients.json.jackson.JacksonJsonpMapper;
|
|
||||||
import co.elastic.clients.transport.rest_client.RestClientTransport;
|
|
||||||
import jakarta.annotation.PostConstruct;
|
import jakarta.annotation.PostConstruct;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.http.HttpHost;
|
|
||||||
import org.elasticsearch.client.RestClient;
|
|
||||||
import org.springframework.data.domain.PageRequest;
|
import org.springframework.data.domain.PageRequest;
|
||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.Pageable;
|
||||||
import org.springframework.data.domain.Sort;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import reactor.core.publisher.Flux;
|
import reactor.core.publisher.Flux;
|
||||||
import reactor.core.publisher.Mono;
|
import reactor.core.publisher.Mono;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+1
-1
@@ -5,7 +5,7 @@ import cn.novalon.gym.manage.member.entity.RefundApplication;
|
|||||||
import cn.novalon.gym.manage.member.enums.RefundStatus;
|
import cn.novalon.gym.manage.member.enums.RefundStatus;
|
||||||
import cn.novalon.gym.manage.member.repository.RefundApplicationRepository;
|
import cn.novalon.gym.manage.member.repository.RefundApplicationRepository;
|
||||||
import cn.novalon.gym.manage.member.service.IRefundApplicationService;
|
import cn.novalon.gym.manage.member.service.IRefundApplicationService;
|
||||||
import cn.novalon.gym.manage.member.util.RedisUtil;
|
import cn.novalon.gym.manage.common.util.RedisUtil;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import reactor.core.publisher.Mono;
|
import reactor.core.publisher.Mono;
|
||||||
|
|||||||
+1
-1
@@ -4,7 +4,7 @@ import cn.novalon.gym.manage.common.exception.ErrorCode;
|
|||||||
import cn.novalon.gym.manage.common.exception.SystemException;
|
import cn.novalon.gym.manage.common.exception.SystemException;
|
||||||
import cn.novalon.gym.manage.member.config.WechatProperties;
|
import cn.novalon.gym.manage.member.config.WechatProperties;
|
||||||
import cn.novalon.gym.manage.member.service.WechatApiService;
|
import cn.novalon.gym.manage.member.service.WechatApiService;
|
||||||
import cn.novalon.gym.manage.member.util.RedisUtil;
|
import cn.novalon.gym.manage.common.util.RedisUtil;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
|
|||||||
+1
-3
@@ -4,8 +4,6 @@ import cn.novalon.gym.manage.common.exception.ConflictException;
|
|||||||
import cn.novalon.gym.manage.common.exception.ErrorCode;
|
import cn.novalon.gym.manage.common.exception.ErrorCode;
|
||||||
import cn.novalon.gym.manage.common.exception.NotFoundException;
|
import cn.novalon.gym.manage.common.exception.NotFoundException;
|
||||||
import cn.novalon.gym.manage.common.exception.SystemException;
|
import cn.novalon.gym.manage.common.exception.SystemException;
|
||||||
import cn.novalon.gym.manage.common.util.HtmlEscapeUtil;
|
|
||||||
import cn.novalon.gym.manage.member.config.WechatProperties;
|
|
||||||
import cn.novalon.gym.manage.member.dto.WechatLoginDto;
|
import cn.novalon.gym.manage.member.dto.WechatLoginDto;
|
||||||
import cn.novalon.gym.manage.member.entity.Member;
|
import cn.novalon.gym.manage.member.entity.Member;
|
||||||
import cn.novalon.gym.manage.member.es.entity.MemberES;
|
import cn.novalon.gym.manage.member.es.entity.MemberES;
|
||||||
@@ -16,7 +14,7 @@ import cn.novalon.gym.manage.member.service.WechatAuthService;
|
|||||||
import cn.novalon.gym.manage.member.util.AesUtil;
|
import cn.novalon.gym.manage.member.util.AesUtil;
|
||||||
import cn.novalon.gym.manage.member.util.EsSyncUtils;
|
import cn.novalon.gym.manage.member.util.EsSyncUtils;
|
||||||
import cn.novalon.gym.manage.member.util.MemberNoGenerator;
|
import cn.novalon.gym.manage.member.util.MemberNoGenerator;
|
||||||
import cn.novalon.gym.manage.member.util.RedisUtil;
|
import cn.novalon.gym.manage.common.util.RedisUtil;
|
||||||
import cn.novalon.gym.manage.member.util.WechatPhoneUtil;
|
import cn.novalon.gym.manage.member.util.WechatPhoneUtil;
|
||||||
import cn.novalon.gym.manage.member.vo.WechatLoginVO;
|
import cn.novalon.gym.manage.member.vo.WechatLoginVO;
|
||||||
import cn.novalon.gym.manage.sys.security.JwtTokenProvider;
|
import cn.novalon.gym.manage.sys.security.JwtTokenProvider;
|
||||||
|
|||||||
+1
-1
@@ -8,7 +8,7 @@ import cn.novalon.gym.manage.member.es.repository.MemberESRepository;
|
|||||||
import cn.novalon.gym.manage.member.repository.IMemberRepository;
|
import cn.novalon.gym.manage.member.repository.IMemberRepository;
|
||||||
import cn.novalon.gym.manage.member.service.WechatOfficialService;
|
import cn.novalon.gym.manage.member.service.WechatOfficialService;
|
||||||
import cn.novalon.gym.manage.member.util.EsSyncUtils;
|
import cn.novalon.gym.manage.member.util.EsSyncUtils;
|
||||||
import cn.novalon.gym.manage.member.util.RedisUtil;
|
import cn.novalon.gym.manage.common.util.RedisUtil;
|
||||||
import cn.novalon.gym.manage.member.vo.WechatUserInfoVO;
|
import cn.novalon.gym.manage.member.vo.WechatUserInfoVO;
|
||||||
import com.fasterxml.jackson.databind.DeserializationFeature;
|
import com.fasterxml.jackson.databind.DeserializationFeature;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
|||||||
@@ -0,0 +1,200 @@
|
|||||||
|
2026-06-02T14:56:05.966+08:00 TRACE 22380 --- [gym-manage-api] [ctor-http-nio-7] o.s.w.s.adapter.HttpWebHandlerAdapter : [7ce54381-10] HTTP POST "/api/groupCourse/11/cancel", headers={masked}
|
||||||
|
2026-06-02T14:56:05.967+08:00 DEBUG 22380 --- [gym-manage-api] [ parallel-11] o.s.w.s.s.DefaultWebSessionManager : Created new WebSession.
|
||||||
|
2026-06-02T14:56:05.967+08:00 INFO 22380 --- [gym-manage-api] [ parallel-11] c.n.g.m.sys.audit.OperationLogWebFilter : WebFilter 拦截请求: POST /api/groupCourse/11/cancel
|
||||||
|
2026-06-02T14:56:05.967+08:00 INFO 22380 --- [gym-manage-api] [ parallel-11] c.n.g.m.sys.audit.OperationLogWebFilter : 未匹配到操作日志配置,跳过: POST /api/groupCourse/11/cancel
|
||||||
|
2026-06-02T14:56:05.967+08:00 INFO 22380 --- [gym-manage-api] [ parallel-11] c.n.g.m.sys.audit.OperationLogWebFilter : WebFilter 拦截请求: POST /api/groupCourse/11/cancel
|
||||||
|
2026-06-02T14:56:05.967+08:00 INFO 22380 --- [gym-manage-api] [ parallel-11] c.n.g.m.sys.audit.OperationLogWebFilter : 未匹配到操作日志配置,跳过: POST /api/groupCourse/11/cancel
|
||||||
|
2026-06-02T14:56:05.967+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "GET" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.967+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "GET" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.967+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "GET" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "GET" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "GET" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "POST" matches against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Pattern "/api/dictionaries" does not match against value "/api/groupCourse/11/cancel"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "PUT" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "DELETE" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "GET" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "GET" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "GET" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "GET" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "GET" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "GET" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "POST" matches against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Pattern "/api/users" does not match against value "/api/groupCourse/11/cancel"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "GET" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "PUT" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "DELETE" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "POST" matches against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Pattern "/api/users/{id}/action/change-password" does not match against value "/api/groupCourse/11/cancel"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "POST" matches against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Pattern "/api/users/{id}/action/logical-delete" does not match against value "/api/groupCourse/11/cancel"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "POST" matches against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Pattern "/api/users/logical-delete" does not match against value "/api/groupCourse/11/cancel"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "POST" matches against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Pattern "/api/users/action/restore" does not match against value "/api/groupCourse/11/cancel"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "POST" matches against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Pattern "/api/users/{id}/action/restore" does not match against value "/api/groupCourse/11/cancel"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "GET" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "POST" matches against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Pattern "/api/users/{id}/roles" does not match against value "/api/groupCourse/11/cancel"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "GET" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "GET" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "GET" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "POST" matches against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Pattern "/api/menus" does not match against value "/api/groupCourse/11/cancel"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "PUT" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "DELETE" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "GET" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "GET" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "GET" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "GET" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "GET" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "GET" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "POST" matches against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Pattern "/api/roles" does not match against value "/api/groupCourse/11/cancel"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "PUT" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "DELETE" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "POST" matches against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Pattern "/api/roles/{id}/restore" does not match against value "/api/groupCourse/11/cancel"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "GET" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "POST" matches against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Pattern "/api/roles/{id}/permissions" does not match against value "/api/groupCourse/11/cancel"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "GET" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "GET" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "GET" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "POST" matches against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Pattern "/api/config" does not match against value "/api/groupCourse/11/cancel"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "PUT" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "DELETE" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "GET" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "GET" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "GET" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "GET" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "GET" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "GET" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "POST" matches against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Pattern "/api/logs/login" does not match against value "/api/groupCourse/11/cancel"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "GET" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "GET" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "GET" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "GET" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "POST" matches against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Pattern "/api/logs/exception" does not match against value "/api/groupCourse/11/cancel"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "GET" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "GET" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "GET" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "GET" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "GET" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "POST" matches against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Pattern "/api/logs/operation" does not match against value "/api/groupCourse/11/cancel"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "POST" matches against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Pattern "/api/auth/login" does not match against value "/api/groupCourse/11/cancel"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "POST" matches against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Pattern "/api/auth/register" does not match against value "/api/groupCourse/11/cancel"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "POST" matches against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Pattern "/api/auth/logout" does not match against value "/api/groupCourse/11/cancel"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "GET" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "GET" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "GET" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "GET" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "POST" matches against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Pattern "/api/dict/types" does not match against value "/api/groupCourse/11/cancel"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "PUT" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "DELETE" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "GET" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "GET" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "GET" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "POST" matches against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Pattern "/api/dict/data" does not match against value "/api/groupCourse/11/cancel"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "PUT" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "DELETE" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "GET" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "GET" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "GET" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "POST" matches against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Pattern "/api/notices" does not match against value "/api/groupCourse/11/cancel"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "PUT" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "DELETE" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "GET" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "GET" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "GET" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "POST" matches against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Pattern "/api/messages" does not match against value "/api/groupCourse/11/cancel"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "PUT" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "DELETE" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "GET" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "GET" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "POST" matches against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Pattern "/api/files/upload" does not match against value "/api/groupCourse/11/cancel"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "GET" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "GET" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "GET" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "GET" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "DELETE" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "GET" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "GET" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "GET" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "GET" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "GET" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "POST" matches against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Pattern "/api/permissions" does not match against value "/api/groupCourse/11/cancel"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "PUT" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "DELETE" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "POST" matches against value "POST"
|
||||||
|
2026-06-02T14:56:05.969+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Pattern "/api/member/auth/miniapp/login" does not match against value "/api/groupCourse/11/cancel"
|
||||||
|
2026-06-02T14:56:05.970+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "GET" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.970+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "POST" matches against value "POST"
|
||||||
|
2026-06-02T14:56:05.970+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Pattern "/api/member/auth/mp/callback" does not match against value "/api/groupCourse/11/cancel"
|
||||||
|
2026-06-02T14:56:05.970+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "GET" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.970+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "PUT" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.970+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "POST" matches against value "POST"
|
||||||
|
2026-06-02T14:56:05.970+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Pattern "/api/member/phone/bind" does not match against value "/api/groupCourse/11/cancel"
|
||||||
|
2026-06-02T14:56:05.970+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "GET" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.970+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "POST" matches against value "POST"
|
||||||
|
2026-06-02T14:56:05.970+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Pattern "/api/admin/member/{id}/phone" does not match against value "/api/groupCourse/11/cancel"
|
||||||
|
2026-06-02T14:56:05.970+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "GET" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.970+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "PUT" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.970+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "GET" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.970+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "GET" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.970+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "GET" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.970+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "GET" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.970+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "POST" matches against value "POST"
|
||||||
|
2026-06-02T14:56:05.970+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Pattern "/api/member-cards" does not match against value "/api/groupCourse/11/cancel"
|
||||||
|
2026-06-02T14:56:05.970+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "POST" matches against value "POST"
|
||||||
|
2026-06-02T14:56:05.970+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Pattern "/api/member-card-records/purchase" does not match against value "/api/groupCourse/11/cancel"
|
||||||
|
2026-06-02T14:56:05.970+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "POST" matches against value "POST"
|
||||||
|
2026-06-02T14:56:05.970+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Pattern "/api/member-card-records/{recordId}/renew" does not match against value "/api/groupCourse/11/cancel"
|
||||||
|
2026-06-02T14:56:05.970+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "POST" matches against value "POST"
|
||||||
|
2026-06-02T14:56:05.970+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Pattern "/api/member-card-records/{recordId}/use" does not match against value "/api/groupCourse/11/cancel"
|
||||||
|
2026-06-02T14:56:05.970+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "POST" matches against value "POST"
|
||||||
|
2026-06-02T14:56:05.970+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Pattern "/api/member-card-records/{recordId}/refund" does not match against value "/api/groupCourse/11/cancel"
|
||||||
|
2026-06-02T14:56:05.970+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "GET" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.970+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "GET" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.970+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "POST" matches against value "POST"
|
||||||
|
2026-06-02T14:56:05.970+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Pattern "/api/member-card-records/process-expired" does not match against value "/api/groupCourse/11/cancel"
|
||||||
|
2026-06-02T14:56:05.970+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "POST" matches against value "POST"
|
||||||
|
2026-06-02T14:56:05.970+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Pattern "/api/member-card-transactions" does not match against value "/api/groupCourse/11/cancel"
|
||||||
|
2026-06-02T14:56:05.970+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "GET" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.970+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "GET" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.970+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "GET" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.970+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "GET" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.970+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "GET" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.970+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "GET" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.970+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "GET" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.970+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "POST" matches against value "POST"
|
||||||
|
2026-06-02T14:56:05.970+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Pattern "/api/groupCourse/page" does not match against value "/api/groupCourse/11/cancel"
|
||||||
|
2026-06-02T14:56:05.970+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "GET" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.970+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "POST" matches against value "POST"
|
||||||
|
2026-06-02T14:56:05.970+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Pattern "/api/groupCourse" does not match against value "/api/groupCourse/11/cancel"
|
||||||
|
2026-06-02T14:56:05.970+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "PUT" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.970+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "DELETE" does not match against value "POST"
|
||||||
|
2026-06-02T14:56:05.970+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Method "POST" matches against value "POST"
|
||||||
|
2026-06-02T14:56:05.970+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.server.RequestPredicates : Pattern "/api/groupCourse/{id}/cancel" matches against value "/api/groupCourse/11/cancel"
|
||||||
|
2026-06-02T14:56:05.970+08:00 TRACE 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.function.server.RouterFunctions : [7ce54381-10] Matched (POST && /api/groupCourse/{id}/cancel)
|
||||||
|
2026-06-02T14:56:05.970+08:00 DEBUG 22380 --- [gym-manage-api] [ parallel-11] o.s.w.r.f.s.s.RouterFunctionMapping : [7ce54381-10] Mapped to cn.novalon.gym.manage.app.config.SystemRouter$$Lambda/0x00000198019592d8@6903bec9
|
||||||
|
2026-06-02T14:56:05.972+08:00 DEBUG 22380 --- [gym-manage-api] [ parallel-11] o.s.r2dbc.core.DefaultDatabaseClient : Executing SQL statement [SELECT group_course.course_name, group_course.coach_id, group_course.course_type, group_course.start_time, group_course.end_time, group_course.max_members, group_course.current_members, group_course.status, group_course.location, group_course.cover_image, group_course.description, group_course.point_card_amount, group_course.stored_value_amount, group_course.id, group_course.create_by, group_course.update_by, group_course.created_at, group_course.updated_at, group_course.deleted_at FROM group_course WHERE group_course.id = $1 AND (group_course.deleted_at IS NULL)]
|
||||||
|
2026-06-02T14:56:05.976+08:00 INFO 22380 --- [gym-manage-api] [actor-tcp-nio-5] c.n.g.m.g.c.GroupCourseConverter : 转换bean,entity-domain:
|
||||||
|
2026-06-02T14:56:05.976+08:00 ERROR 22380 --- [gym-manage-api] [actor-tcp-nio-5] c.n.g.m.g.s.impl.GroupCourseService : 团课取消失败 - id=11, error: 课程取消需提前24小时
|
||||||
|
2026-06-02T14:56:05.976+08:00 TRACE 22380 --- [gym-manage-api] [actor-tcp-nio-5] org.springframework.web.HttpLogging : [7ce54381-10] Encoding [{success=false, message=课程取消需提前24小时}]
|
||||||
|
2026-06-02T14:56:05.976+08:00 TRACE 22380 --- [gym-manage-api] [actor-tcp-nio-5] o.s.w.s.adapter.HttpWebHandlerAdapter : [7ce54381-10] Completed 400 BAD_REQUEST, headers={masked}
|
||||||
|
2026-06-02T14:56:05.976+08:00 TRACE 22380 --- [gym-manage-api] [actor-tcp-nio-5] org.springframework.web.HttpLogging : [7ce54381-1, L:/[0:0:0:0:0:0:0:1]:8084 - R:/[0:0:0:0:0:0:0:1]:57674] Handling completed
|
||||||
@@ -143,6 +143,12 @@
|
|||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-data-redis</artifactId>
|
<artifactId>spring-boot-starter-data-redis</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.novalon.gym.manage</groupId>
|
||||||
|
<artifactId>gym-groupCourse</artifactId>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|||||||
+4
-1
@@ -13,17 +13,20 @@ import org.springframework.context.annotation.ComponentScan;
|
|||||||
import org.springframework.data.elasticsearch.repository.config.EnableElasticsearchRepositories;
|
import org.springframework.data.elasticsearch.repository.config.EnableElasticsearchRepositories;
|
||||||
import org.springframework.data.elasticsearch.repository.config.EnableReactiveElasticsearchRepositories;
|
import org.springframework.data.elasticsearch.repository.config.EnableReactiveElasticsearchRepositories;
|
||||||
import org.springframework.data.r2dbc.repository.config.EnableR2dbcRepositories;
|
import org.springframework.data.r2dbc.repository.config.EnableR2dbcRepositories;
|
||||||
|
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||||
import org.springframework.web.server.WebFilter;
|
import org.springframework.web.server.WebFilter;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@SpringBootApplication(scanBasePackages = "cn.novalon.gym.manage", exclude = {
|
@SpringBootApplication(scanBasePackages = "cn.novalon.gym.manage", exclude = {
|
||||||
ReactiveUserDetailsServiceAutoConfiguration.class })
|
ReactiveUserDetailsServiceAutoConfiguration.class })
|
||||||
|
@EnableScheduling
|
||||||
@EnableR2dbcRepositories(basePackages = {
|
@EnableR2dbcRepositories(basePackages = {
|
||||||
"cn.novalon.gym.manage.db.dao",
|
"cn.novalon.gym.manage.db.dao",
|
||||||
"cn.novalon.gym.manage.sys.audit.repository" ,
|
"cn.novalon.gym.manage.sys.audit.repository" ,
|
||||||
"cn.novalon.gym.manage.gymmembercard.dao",
|
"cn.novalon.gym.manage.gymmembercard.dao",
|
||||||
"cn.novalon.gym.manage.member.repository"
|
"cn.novalon.gym.manage.member.repository",
|
||||||
|
"cn.novalon.gym.manage.groupcourse.dao"
|
||||||
})
|
})
|
||||||
@EnableReactiveElasticsearchRepositories(basePackages = "cn.novalon.gym.manage.member.es.repository")
|
@EnableReactiveElasticsearchRepositories(basePackages = "cn.novalon.gym.manage.member.es.repository")
|
||||||
public class ManageApplication {
|
public class ManageApplication {
|
||||||
|
|||||||
+26
-1
@@ -2,6 +2,8 @@ package cn.novalon.gym.manage.app.config;
|
|||||||
|
|
||||||
|
|
||||||
import cn.novalon.gym.manage.file.handler.SysFileHandler;
|
import cn.novalon.gym.manage.file.handler.SysFileHandler;
|
||||||
|
import cn.novalon.gym.manage.groupcourse.handler.GroupCourseBookingHandler;
|
||||||
|
import cn.novalon.gym.manage.groupcourse.handler.GroupCourseHandler;
|
||||||
import cn.novalon.gym.manage.member.handler.MemberCardHandler;
|
import cn.novalon.gym.manage.member.handler.MemberCardHandler;
|
||||||
import cn.novalon.gym.manage.member.handler.MemberCardRecordHandler;
|
import cn.novalon.gym.manage.member.handler.MemberCardRecordHandler;
|
||||||
import cn.novalon.gym.manage.member.handler.MemberCardTransactionHandler;
|
import cn.novalon.gym.manage.member.handler.MemberCardTransactionHandler;
|
||||||
@@ -62,7 +64,9 @@ public class SystemRouter {
|
|||||||
PasswordDiagnosticHandler passwordDiagnosticHandler,
|
PasswordDiagnosticHandler passwordDiagnosticHandler,
|
||||||
MemberCardHandler memberCardHandler,
|
MemberCardHandler memberCardHandler,
|
||||||
MemberCardRecordHandler memberCardRecordHandler,
|
MemberCardRecordHandler memberCardRecordHandler,
|
||||||
MemberCardTransactionHandler memberCardTransactionHandler) {
|
MemberCardTransactionHandler memberCardTransactionHandler,
|
||||||
|
GroupCourseHandler groupCourseHandler,
|
||||||
|
GroupCourseBookingHandler groupCourseBookingHandler) {
|
||||||
|
|
||||||
return route()
|
return route()
|
||||||
// ========== 诊断路由 ==========
|
// ========== 诊断路由 ==========
|
||||||
@@ -249,6 +253,27 @@ public class SystemRouter {
|
|||||||
.GET("/api/member-card-transactions/statistics/deduct/{cardId}", memberCardTransactionHandler::getDeductCountByCardId)
|
.GET("/api/member-card-transactions/statistics/deduct/{cardId}", memberCardTransactionHandler::getDeductCountByCardId)
|
||||||
.GET("/api/member-card-transactions/statistics/renew", memberCardTransactionHandler::getRenewAmountByTimeRange)
|
.GET("/api/member-card-transactions/statistics/renew", memberCardTransactionHandler::getRenewAmountByTimeRange)
|
||||||
.GET("/api/member-card-transactions/statistics/purchase/{memberId}", memberCardTransactionHandler::getPurchaseAmountByMember)
|
.GET("/api/member-card-transactions/statistics/purchase/{memberId}", memberCardTransactionHandler::getPurchaseAmountByMember)
|
||||||
|
|
||||||
|
// ========================================
|
||||||
|
// ========== 团课管理路由 =================
|
||||||
|
// ========================================
|
||||||
|
|
||||||
|
// ===== 团课课程管理 =====
|
||||||
|
.GET("/api/groupCourse/list", groupCourseHandler::getAllGroupCourse)
|
||||||
|
.POST("/api/groupCourse/page", groupCourseHandler::getGroupCoursesByPage)
|
||||||
|
.GET("/api/groupCourse/{id}", groupCourseHandler::getGroupCourseById)
|
||||||
|
.POST("/api/groupCourse", groupCourseHandler::createGroupCourse)
|
||||||
|
.PUT("/api/groupCourse/{id}", groupCourseHandler::updateGroupCourse)
|
||||||
|
.DELETE("/api/groupCourse/{id}", groupCourseHandler::deleteGroupCourse)
|
||||||
|
.POST("/api/groupCourse/{id}/cancel", groupCourseHandler::cancelGroupCourse)
|
||||||
|
.POST("/api/groupCourse/{courseId}/signin", groupCourseHandler::signIn)
|
||||||
|
|
||||||
|
// ===== 团课预约管理 =====
|
||||||
|
.POST("/api/groupCourse/book", groupCourseBookingHandler::bookCourse)
|
||||||
|
.POST("/api/groupCourse/booking/{bookingId}/cancel", groupCourseBookingHandler::cancelBooking)
|
||||||
|
.GET("/api/groupCourse/bookings/member/{memberId}", groupCourseBookingHandler::getBookingsByMemberId)
|
||||||
|
.GET("/api/groupCourse/bookings/{bookingId}", groupCourseBookingHandler::getBookingById)
|
||||||
|
.GET("/api/groupCourse/bookings/course/{courseId}", groupCourseBookingHandler::getBookingsByCourseId)
|
||||||
|
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ spring:
|
|||||||
url: jdbc:postgresql://localhost:55432/manage_system
|
url: jdbc:postgresql://localhost:55432/manage_system
|
||||||
user: novalon
|
user: novalon
|
||||||
password: novalon123
|
password: novalon123
|
||||||
enabled: false
|
enabled: true
|
||||||
locations: classpath:db/migration
|
locations: classpath:db/migration
|
||||||
baseline-on-migrate: true
|
baseline-on-migrate: true
|
||||||
validate-on-migrate: true
|
validate-on-migrate: true
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ spring:
|
|||||||
password: ${DB_PASSWORD:novalon123}
|
password: ${DB_PASSWORD:novalon123}
|
||||||
driver-class-name: org.postgresql.Driver
|
driver-class-name: org.postgresql.Driver
|
||||||
flyway:
|
flyway:
|
||||||
enabled: false
|
enabled: true
|
||||||
locations: classpath:db/migration
|
locations: classpath:db/migration
|
||||||
baseline-on-migrate: true
|
baseline-on-migrate: true
|
||||||
baseline-version: 0
|
baseline-version: 0
|
||||||
@@ -38,11 +38,25 @@ spring:
|
|||||||
user:
|
user:
|
||||||
name: disabled
|
name: disabled
|
||||||
password: disabled
|
password: disabled
|
||||||
|
data:
|
||||||
|
redis:
|
||||||
|
host: ${REDIS_HOST:localhost}
|
||||||
|
port: ${REDIS_PORT:6379}
|
||||||
|
password: ${REDIS_PASSWORD:novalon123}
|
||||||
|
timeout: 5000
|
||||||
|
lettuce:
|
||||||
|
pool:
|
||||||
|
max-active: 8 # 最大连接数
|
||||||
|
max-idle: 8 # 最大空闲连接
|
||||||
|
min-idle: 0 # 最小空闲连接
|
||||||
|
max-wait: -1ms # 连接等待时间
|
||||||
profiles:
|
profiles:
|
||||||
active: dev
|
active: dev
|
||||||
config:
|
config:
|
||||||
import: classpath:member-config.yml
|
import: classpath:member-config.yml
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
management:
|
management:
|
||||||
endpoints:
|
endpoints:
|
||||||
web:
|
web:
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package cn.novalon.gym.manage.member.config;
|
package cn.novalon.gym.manage.common.config;
|
||||||
|
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|||||||
+9
-1
@@ -1,4 +1,4 @@
|
|||||||
package cn.novalon.gym.manage.member.util;
|
package cn.novalon.gym.manage.common.util;
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.data.redis.core.ReactiveRedisTemplate;
|
import org.springframework.data.redis.core.ReactiveRedisTemplate;
|
||||||
@@ -69,4 +69,12 @@ public class RedisUtil {
|
|||||||
public Mono<Boolean> expire(String key, long timeoutSeconds) {
|
public Mono<Boolean> expire(String key, long timeoutSeconds) {
|
||||||
return reactiveRedisTemplate.expire(key, Duration.ofSeconds(timeoutSeconds));
|
return reactiveRedisTemplate.expire(key, Duration.ofSeconds(timeoutSeconds));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据通配符模式删除key
|
||||||
|
*/
|
||||||
|
public Mono<Long> deleteByPattern(String pattern) {
|
||||||
|
return reactiveRedisTemplate.keys(pattern)
|
||||||
|
.flatMap(keys -> reactiveRedisTemplate.delete(keys)).count();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -99,6 +99,8 @@
|
|||||||
<artifactId>spring-boot-starter-test</artifactId>
|
<artifactId>spring-boot-starter-test</artifactId>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|||||||
+1
@@ -10,6 +10,7 @@ import cn.novalon.gym.manage.sys.core.query.SysUserQuery;
|
|||||||
import cn.novalon.gym.manage.sys.core.repository.ISysUserRepository;
|
import cn.novalon.gym.manage.sys.core.repository.ISysUserRepository;
|
||||||
import cn.novalon.gym.manage.common.dto.PageRequest;
|
import cn.novalon.gym.manage.common.dto.PageRequest;
|
||||||
import cn.novalon.gym.manage.common.dto.PageResponse;
|
import cn.novalon.gym.manage.common.dto.PageResponse;
|
||||||
|
import cn.novalon.gym.manage.sys.dto.response.UserResponse;
|
||||||
import org.springframework.data.domain.Sort;
|
import org.springframework.data.domain.Sort;
|
||||||
import org.springframework.data.r2dbc.core.R2dbcEntityTemplate;
|
import org.springframework.data.r2dbc.core.R2dbcEntityTemplate;
|
||||||
import org.springframework.data.relational.core.query.Query;
|
import org.springframework.data.relational.core.query.Query;
|
||||||
|
|||||||
+86
@@ -0,0 +1,86 @@
|
|||||||
|
-- V10: 团课预约业务场景测试数据
|
||||||
|
-- 测试场景:
|
||||||
|
-- 1. 用户A刚刚注册,在没有任何会员卡的情况下申请团课预约
|
||||||
|
-- 2. 用户B已有时长卡,但已经过期
|
||||||
|
-- 3. 会员C有时长卡,未过期
|
||||||
|
-- 4. 会员D有次数卡,但次数卡耗尽次数
|
||||||
|
-- 5. 会员E有次数卡,且次数充足
|
||||||
|
-- 6. 会员F有储值卡,但余额不足以支付其预约的团课
|
||||||
|
-- 7. 会员G有储值卡,余额充足
|
||||||
|
|
||||||
|
-- ============================================
|
||||||
|
-- 1. 创建测试会员用户 (A-G)
|
||||||
|
-- ============================================
|
||||||
|
|
||||||
|
INSERT INTO member_user (member_no, nickname, phone, gender, is_deleted, created_at, updated_at) VALUES
|
||||||
|
('MEM_TEST_A', '用户A_无卡新用户', '13800001001', 1, false, '2026-06-02 10:00:00', '2026-06-02 10:00:00'),
|
||||||
|
('MEM_TEST_B', '用户B_过期时长卡', '13800001002', 1, false, '2026-05-01 10:00:00', '2026-05-01 10:00:00'),
|
||||||
|
('MEM_TEST_C', '会员C_有效时长卡', '13800001003', 2, false, '2026-05-01 10:00:00', '2026-05-01 10:00:00'),
|
||||||
|
('MEM_TEST_D', '会员D_次数用尽', '13800001004', 1, false, '2026-05-01 10:00:00', '2026-05-01 10:00:00'),
|
||||||
|
('MEM_TEST_E', '会员E_次数充足', '13800001005', 2, false, '2026-05-01 10:00:00', '2026-05-01 10:00:00'),
|
||||||
|
('MEM_TEST_F', '会员F_储值卡余额不足', '13800001006', 1, false, '2026-05-01 10:00:00', '2026-05-01 10:00:00'),
|
||||||
|
('MEM_TEST_G', '会员G_储值卡余额充足', '13800001007', 2, false, '2026-05-01 10:00:00', '2026-05-01 10:00:00');
|
||||||
|
|
||||||
|
-- ============================================
|
||||||
|
-- 2. 团课课程测试数据(用于预约测试)
|
||||||
|
-- ============================================
|
||||||
|
|
||||||
|
-- 团课A: 收费类型为次数卡(点卡额度=1)
|
||||||
|
INSERT INTO group_course (course_name, coach_id, course_type, start_time, end_time, max_members, current_members, status, location, description, point_card_amount, stored_value_amount, create_by, created_at, updated_at) VALUES
|
||||||
|
('燃脂搏击_次数卡课程', 102, 2, '2026-06-10 19:30:00', '2026-06-10 20:30:00', 20, 0, '0', '综合训练区', '高强度间歇训练,配合音乐快速燃脂,消耗1次', 1, 0.00, 'admin', '2026-06-01 10:00:00', '2026-06-01 10:00:00');
|
||||||
|
|
||||||
|
-- 团课B: 收费类型为储值卡(储值额度=50.00)
|
||||||
|
INSERT INTO group_course (course_name, coach_id, course_type, start_time, end_time, max_members, current_members, status, location, description, point_card_amount, stored_value_amount, create_by, created_at, updated_at) VALUES
|
||||||
|
('高端普拉提_储值卡课程', 103, 1, '2026-06-11 19:00:00', '2026-06-11 20:00:00', 15, 0, '0', '普拉提教室', '精准训练核心肌群,消耗储值50元', 0, 20.00, 'admin', '2026-06-01 10:00:00', '2026-06-01 10:00:00');
|
||||||
|
|
||||||
|
-- ============================================
|
||||||
|
-- 3. 会员卡类型定义
|
||||||
|
-- ============================================
|
||||||
|
|
||||||
|
INSERT INTO member_card (member_card_name, member_card_type, member_card_price, member_card_validity_days, member_card_total_times, member_card_amount, member_card_status, extra_config, created_at, updated_at) VALUES
|
||||||
|
('30天时长卡', 'TIME_CARD', 299.00, 30, NULL, NULL, 1, '{}', '2026-01-01 00:00:00', '2026-01-01 00:00:00'),
|
||||||
|
('10次卡', 'COUNT_CARD', 499.00, NULL, 10, NULL, 1, '{}', '2026-01-01 00:00:00', '2026-01-01 00:00:00'),
|
||||||
|
('储值卡500', 'STORED_VALUE_CARD', 500.00, NULL, NULL, 500.00, 1, '{}', '2026-01-01 00:00:00', '2026-01-01 00:00:00');
|
||||||
|
|
||||||
|
-- ============================================
|
||||||
|
-- 4. 会员卡记录测试数据
|
||||||
|
-- ============================================
|
||||||
|
|
||||||
|
-- 场景2: 用户B - 时长卡已过期 (expire_time < 当前时间)
|
||||||
|
-- 购买于30天前,有效期30天,现已过期
|
||||||
|
INSERT INTO member_card_record (member_id, member_card_id, status, remaining_times, remaining_amount, expire_time, purchase_time, version, card_composition, created_at, updated_at) VALUES
|
||||||
|
((SELECT id FROM member_user WHERE member_no = 'MEM_TEST_B'), (SELECT member_card_id FROM member_card WHERE member_card_name = '30天时长卡'), 'EXPIRED', 0, 0.00, '2026-05-31 23:59:59', '2026-05-01 10:00:00', 0, '{}', '2026-05-01 10:00:00', '2026-06-02 10:00:00');
|
||||||
|
|
||||||
|
-- 场景3: 会员C - 时长卡未过期 (expire_time > 当前时间)
|
||||||
|
-- 购买于今天,有效期30天,还有30天有效期
|
||||||
|
INSERT INTO member_card_record (member_id, member_card_id, status, remaining_times, remaining_amount, expire_time, purchase_time, version, card_composition, created_at, updated_at) VALUES
|
||||||
|
((SELECT id FROM member_user WHERE member_no = 'MEM_TEST_C'), (SELECT member_card_id FROM member_card WHERE member_card_name = '30天时长卡'), 'ACTIVE', 0, 0.00, '2026-07-02 23:59:59', '2026-06-02 10:00:00', 0, '{}', '2026-06-02 10:00:00', '2026-06-02 10:00:00');
|
||||||
|
|
||||||
|
-- 场景4: 会员D - 次数卡耗尽 (remaining_times = 0)
|
||||||
|
INSERT INTO member_card_record (member_id, member_card_id, status, remaining_times, remaining_amount, expire_time, purchase_time, version, card_composition, created_at, updated_at) VALUES
|
||||||
|
((SELECT id FROM member_user WHERE member_no = 'MEM_TEST_D'), (SELECT member_card_id FROM member_card WHERE member_card_name = '10次卡'), 'ACTIVE', 0, 0.00, '2026-12-31 23:59:59', '2026-05-01 10:00:00', 0, '{}', '2026-05-01 10:00:00', '2026-06-02 10:00:00');
|
||||||
|
|
||||||
|
-- 场景5: 会员E - 次数卡充足 (remaining_times >= point_card_amount)
|
||||||
|
INSERT INTO member_card_record (member_id, member_card_id, status, remaining_times, remaining_amount, expire_time, purchase_time, version, card_composition, created_at, updated_at) VALUES
|
||||||
|
((SELECT id FROM member_user WHERE member_no = 'MEM_TEST_E'), (SELECT member_card_id FROM member_card WHERE member_card_name = '10次卡'), 'ACTIVE', 5, 0.00, '2026-12-31 23:59:59', '2026-05-01 10:00:00', 0, '{}', '2026-05-01 10:00:00', '2026-06-02 10:00:00');
|
||||||
|
|
||||||
|
-- 场景6: 会员F - 储值卡余额不足 (remaining_amount < stored_value_amount of course)
|
||||||
|
-- 团课B收费50元,但会员F储值卡只有30元
|
||||||
|
INSERT INTO member_card_record (member_id, member_card_id, status, remaining_times, remaining_amount, expire_time, purchase_time, version, card_composition, created_at, updated_at) VALUES
|
||||||
|
((SELECT id FROM member_user WHERE member_no = 'MEM_TEST_F'), (SELECT member_card_id FROM member_card WHERE member_card_name = '储值卡500'), 'ACTIVE', 0, 30.00, '2027-06-02 23:59:59', '2026-05-01 10:00:00', 0, '{}', '2026-05-01 10:00:00', '2026-06-02 10:00:00');
|
||||||
|
|
||||||
|
-- 场景7: 会员G - 储值卡余额充足 (remaining_amount >= stored_value_amount of course)
|
||||||
|
INSERT INTO member_card_record (member_id, member_card_id, status, remaining_times, remaining_amount, expire_time, purchase_time, version, card_composition, created_at, updated_at) VALUES
|
||||||
|
((SELECT id FROM member_user WHERE member_no = 'MEM_TEST_G'), (SELECT member_card_id FROM member_card WHERE member_card_name = '储值卡500'), 'ACTIVE', 0, 200.00, '2027-06-02 23:59:59', '2026-05-01 10:00:00', 0, '{}', '2026-05-01 10:00:00', '2026-06-02 10:00:00');
|
||||||
|
|
||||||
|
-- ============================================
|
||||||
|
-- 5. 测试场景说明
|
||||||
|
-- ============================================
|
||||||
|
|
||||||
|
-- 场景1: 用户A无会员卡 -> 预约团课时应提示"无可用会员卡"
|
||||||
|
-- 场景2: 用户B时长卡已过期 -> 预约团课时应提示"会员卡已过期"
|
||||||
|
-- 场景3: 会员C时长卡有效 -> 可以正常预约次数卡团课
|
||||||
|
-- 场景4: 会员D次数为0 -> 预约团课时应提示"剩余次数不足"
|
||||||
|
-- 场景5: 会员E次数充足 -> 可以正常预约次数卡团课
|
||||||
|
-- 场景6: 会员F储值卡余额30元,团课需50元 -> 预约时应提示"余额不足"
|
||||||
|
-- 场景7: 会员G储值卡余额200元,团课需50元 -> 可以正常预约储值卡团课
|
||||||
+116
@@ -0,0 +1,116 @@
|
|||||||
|
-- V11: 团课预约取消业务场景测试数据
|
||||||
|
-- 测试场景:
|
||||||
|
-- 1. 用户张三使用时长卡预约了团课,需要取消预约
|
||||||
|
-- 2. 用户李四使用次数卡预约了团课,需要取消预约
|
||||||
|
-- 3. 用户王五使用储值卡预约了团课,需要取消预约
|
||||||
|
|
||||||
|
-- ============================================
|
||||||
|
-- 1. 创建测试会员用户 (张三、李四、王五)
|
||||||
|
-- ============================================
|
||||||
|
|
||||||
|
INSERT INTO member_user (member_no, nickname, phone, gender, is_deleted, created_at, updated_at) VALUES
|
||||||
|
('MEM_TEST_ZHANG', '张三_时长卡用户', '13800002001', 1, false, '2026-06-02 10:00:00', '2026-06-02 10:00:00'),
|
||||||
|
('MEM_TEST_LI', '李四_次数卡用户', '13800002002', 1, false, '2026-06-02 10:00:00', '2026-06-02 10:00:00'),
|
||||||
|
('MEM_TEST_WANG', '王五_储值卡用户', '13800002003', 2, false, '2026-06-02 10:00:00', '2026-06-02 10:00:00');
|
||||||
|
|
||||||
|
-- ============================================
|
||||||
|
-- 2. 确保会员卡类型已存在(如果不存在则创建)
|
||||||
|
-- ============================================
|
||||||
|
|
||||||
|
-- 时长卡类型(30天)
|
||||||
|
INSERT INTO member_card (member_card_name, member_card_type, member_card_price, member_card_validity_days, member_card_total_times, member_card_amount, member_card_status, extra_config, created_at, updated_at)
|
||||||
|
SELECT '30天时长卡', 'TIME_CARD', 299.00, 30, NULL, NULL, 1, '{}', '2026-01-01 00:00:00', '2026-01-01 00:00:00'
|
||||||
|
WHERE NOT EXISTS (SELECT 1 FROM member_card WHERE member_card_name = '30天时长卡');
|
||||||
|
|
||||||
|
-- 次数卡类型(10次)
|
||||||
|
INSERT INTO member_card (member_card_name, member_card_type, member_card_price, member_card_validity_days, member_card_total_times, member_card_amount, member_card_status, extra_config, created_at, updated_at)
|
||||||
|
SELECT '10次卡', 'COUNT_CARD', 499.00, NULL, 10, NULL, 1, '{}', '2026-01-01 00:00:00', '2026-01-01 00:00:00'
|
||||||
|
WHERE NOT EXISTS (SELECT 1 FROM member_card WHERE member_card_name = '10次卡');
|
||||||
|
|
||||||
|
-- 储值卡类型(500元)
|
||||||
|
INSERT INTO member_card (member_card_name, member_card_type, member_card_price, member_card_validity_days, member_card_total_times, member_card_amount, member_card_status, extra_config, created_at, updated_at)
|
||||||
|
SELECT '储值卡500', 'STORED_VALUE_CARD', 500.00, NULL, NULL, 500.00, 1, '{}', '2026-01-01 00:00:00', '2026-01-01 00:00:00'
|
||||||
|
WHERE NOT EXISTS (SELECT 1 FROM member_card WHERE member_card_name = '储值卡500');
|
||||||
|
|
||||||
|
-- ============================================
|
||||||
|
-- 3. 为测试用户分配会员卡
|
||||||
|
-- ============================================
|
||||||
|
|
||||||
|
-- 张三:时长卡(有效期内)
|
||||||
|
INSERT INTO member_card_record (member_id, member_card_id, status, remaining_times, remaining_amount, expire_time, purchase_time, version, card_composition, created_at, updated_at) VALUES
|
||||||
|
((SELECT id FROM member_user WHERE member_no = 'MEM_TEST_ZHANG'),
|
||||||
|
(SELECT member_card_id FROM member_card WHERE member_card_name = '30天时长卡'),
|
||||||
|
'ACTIVE', 0, 0.00, '2026-07-02 23:59:59', '2026-06-02 10:00:00', 0, '{}', '2026-06-02 10:00:00', '2026-06-02 10:00:00');
|
||||||
|
|
||||||
|
-- 李四:次数卡(剩余5次)
|
||||||
|
INSERT INTO member_card_record (member_id, member_card_id, status, remaining_times, remaining_amount, expire_time, purchase_time, version, card_composition, created_at, updated_at) VALUES
|
||||||
|
((SELECT id FROM member_user WHERE member_no = 'MEM_TEST_LI'),
|
||||||
|
(SELECT member_card_id FROM member_card WHERE member_card_name = '10次卡'),
|
||||||
|
'ACTIVE', 5, 0.00, '2026-12-31 23:59:59', '2026-05-01 10:00:00', 0, '{}', '2026-05-01 10:00:00', '2026-06-02 10:00:00');
|
||||||
|
|
||||||
|
-- 王五:储值卡(余额200元)
|
||||||
|
INSERT INTO member_card_record (member_id, member_card_id, status, remaining_times, remaining_amount, expire_time, purchase_time, version, card_composition, created_at, updated_at) VALUES
|
||||||
|
((SELECT id FROM member_user WHERE member_no = 'MEM_TEST_WANG'),
|
||||||
|
(SELECT member_card_id FROM member_card WHERE member_card_name = '储值卡500'),
|
||||||
|
'ACTIVE', 0, 200.00, '2027-06-02 23:59:59', '2026-05-01 10:00:00', 0, '{}', '2026-05-01 10:00:00', '2026-06-02 10:00:00');
|
||||||
|
|
||||||
|
-- ============================================
|
||||||
|
-- 4. 创建用于取消预约测试的团课
|
||||||
|
-- ============================================
|
||||||
|
|
||||||
|
-- 团课X: 时长卡可用课程(使用次数卡支付,时长卡会员可预约)
|
||||||
|
INSERT INTO group_course (course_name, coach_id, course_type, start_time, end_time, max_members, current_members, status, location, description, point_card_amount, stored_value_amount, create_by, created_at, updated_at) VALUES
|
||||||
|
('晚间瑜伽_取消测试', 101, 1, '2026-06-15 19:00:00', '2026-06-15 20:00:00', 20, 0, '0', '瑜伽教室', '适合所有级别的瑜伽课程,用于测试取消预约功能', 1, 30.00, 'admin', '2026-06-02 10:00:00', '2026-06-02 10:00:00');
|
||||||
|
|
||||||
|
-- ============================================
|
||||||
|
-- 5. 创建已预约的记录(状态为0-已预约)
|
||||||
|
-- ============================================
|
||||||
|
|
||||||
|
-- 张三使用时长卡预约团课(状态:已预约)
|
||||||
|
INSERT INTO group_course_booking (course_id, member_id, member_card_id, booking_time, status, course_name, course_start_time, course_end_time, location, created_at, updated_at) VALUES
|
||||||
|
((SELECT id FROM group_course WHERE course_name = '晚间瑜伽_取消测试'),
|
||||||
|
(SELECT id FROM member_user WHERE member_no = 'MEM_TEST_ZHANG'),
|
||||||
|
(SELECT id FROM member_card_record WHERE member_id = (SELECT id FROM member_user WHERE member_no = 'MEM_TEST_ZHANG')),
|
||||||
|
'2026-06-02 11:00:00', '0', '晚间瑜伽_取消测试', '2026-06-15 19:00:00', '2026-06-15 20:00:00', '瑜伽教室',
|
||||||
|
'2026-06-02 11:00:00', '2026-06-02 11:00:00');
|
||||||
|
|
||||||
|
-- 李四使用次数卡预约团课(状态:已预约)
|
||||||
|
INSERT INTO group_course_booking (course_id, member_id, member_card_id, booking_time, status, course_name, course_start_time, course_end_time, location, created_at, updated_at) VALUES
|
||||||
|
((SELECT id FROM group_course WHERE course_name = '晚间瑜伽_取消测试'),
|
||||||
|
(SELECT id FROM member_user WHERE member_no = 'MEM_TEST_LI'),
|
||||||
|
(SELECT id FROM member_card_record WHERE member_id = (SELECT id FROM member_user WHERE member_no = 'MEM_TEST_LI')),
|
||||||
|
'2026-06-02 11:30:00', '0', '晚间瑜伽_取消测试', '2026-06-15 19:00:00', '2026-06-15 20:00:00', '瑜伽教室',
|
||||||
|
'2026-06-02 11:30:00', '2026-06-02 11:30:00');
|
||||||
|
|
||||||
|
-- 王五使用储值卡预约团课(状态:已预约)
|
||||||
|
INSERT INTO group_course_booking (course_id, member_id, member_card_id, booking_time, status, course_name, course_start_time, course_end_time, location, created_at, updated_at) VALUES
|
||||||
|
((SELECT id FROM group_course WHERE course_name = '晚间瑜伽_取消测试'),
|
||||||
|
(SELECT id FROM member_user WHERE member_no = 'MEM_TEST_WANG'),
|
||||||
|
(SELECT id FROM member_card_record WHERE member_id = (SELECT id FROM member_user WHERE member_no = 'MEM_TEST_WANG')),
|
||||||
|
'2026-06-02 12:00:00', '0', '晚间瑜伽_取消测试', '2026-06-15 19:00:00', '2026-06-15 20:00:00', '瑜伽教室',
|
||||||
|
'2026-06-02 12:00:00', '2026-06-02 12:00:00');
|
||||||
|
|
||||||
|
-- ============================================
|
||||||
|
-- 6. 更新团课当前预约人数
|
||||||
|
-- ============================================
|
||||||
|
|
||||||
|
UPDATE group_course
|
||||||
|
SET current_members = current_members + 3
|
||||||
|
WHERE course_name = '晚间瑜伽_取消测试';
|
||||||
|
|
||||||
|
-- ============================================
|
||||||
|
-- 测试数据说明
|
||||||
|
-- ============================================
|
||||||
|
-- 用户信息:
|
||||||
|
-- 张三 (MEM_TEST_ZHANG): 13800002001 - 持有有效期内的时长卡
|
||||||
|
-- 李四 (MEM_TEST_LI): 13800002002 - 持有次数卡(剩余5次)
|
||||||
|
-- 王五 (MEM_TEST_WANG): 13800002003 - 持有储值卡(余额200元)
|
||||||
|
|
||||||
|
-- 测试场景:
|
||||||
|
-- 1. 张三使用时长卡预约了团课 -> 取消预约 -> 应恢复时长卡状态,释放课程名额
|
||||||
|
-- 2. 李四使用次数卡预约了团课 -> 取消预约 -> 应返还扣除的次数,释放课程名额
|
||||||
|
-- 3. 王五使用储值卡预约了团课 -> 取消预约 -> 应返还扣除的金额,释放课程名额
|
||||||
|
|
||||||
|
-- 预约记录状态说明:
|
||||||
|
-- status = '0' 表示已预约
|
||||||
|
-- status = '1' 表示已取消(取消后应更新为此状态)
|
||||||
+58
@@ -0,0 +1,58 @@
|
|||||||
|
-- V12: 团课预约时间冲突测试数据
|
||||||
|
-- 测试场景:会员预约两个时间重叠的团课时,系统应检测到时间冲突并拒绝预约
|
||||||
|
|
||||||
|
-- ============================================
|
||||||
|
-- 1. 创建测试会员
|
||||||
|
-- ============================================
|
||||||
|
|
||||||
|
INSERT INTO member_user (member_no, nickname, phone, gender, is_deleted, created_at, updated_at) VALUES
|
||||||
|
('MEM_TIME_CONFLICT', '时间冲突测试会员', '13800009999', 1, false, '2026-06-02 10:00:00', '2026-06-02 10:00:00');
|
||||||
|
|
||||||
|
-- ============================================
|
||||||
|
-- 2. 创建时间冲突的团课
|
||||||
|
-- ============================================
|
||||||
|
|
||||||
|
-- 团课A: 6月15日 13:00 - 15:00
|
||||||
|
INSERT INTO group_course (course_name, coach_id, course_type, start_time, end_time, max_members, current_members, status, location, description, point_card_amount, stored_value_amount, create_by, created_at, updated_at) VALUES
|
||||||
|
('时间冲突测试_A_13点-15点', 102, 2, '2026-06-15 13:00:00', '2026-06-15 15:00:00', 20, 0, '0', '综合训练区', '测试用团课A,用于验证时间冲突检测', 1, 0.00, 'admin', '2026-06-02 10:00:00', '2026-06-02 10:00:00');
|
||||||
|
|
||||||
|
-- 团课B: 6月15日 14:00 - 16:00 (与团课A时间重叠)
|
||||||
|
INSERT INTO group_course (course_name, coach_id, course_type, start_time, end_time, max_members, current_members, status, location, description, point_card_amount, stored_value_amount, create_by, created_at, updated_at) VALUES
|
||||||
|
('时间冲突测试_B_14点-16点', 103, 1, '2026-06-15 14:00:00', '2026-06-15 16:00:00', 15, 0, '0', '普拉提教室', '测试用团课B,与团课A时间重叠(14:00-15:00)', 1, 0.00, 'admin', '2026-06-02 10:00:00', '2026-06-02 10:00:00');
|
||||||
|
|
||||||
|
-- 团课C: 6月15日 10:00 - 12:00 (不冲突,作为对照)
|
||||||
|
INSERT INTO group_course (course_name, coach_id, course_type, start_time, end_time, max_members, current_members, status, location, description, point_card_amount, stored_value_amount, create_by, created_at, updated_at) VALUES
|
||||||
|
('时间冲突测试_C_10点-12点', 101, 1, '2026-06-15 10:00:00', '2026-06-15 12:00:00', 15, 0, '0', '瑜伽教室', '测试用团课C,与团课A/B不冲突', 1, 0.00, 'admin', '2026-06-02 10:00:00', '2026-06-02 10:00:00');
|
||||||
|
|
||||||
|
-- ============================================
|
||||||
|
-- 3. 会员卡记录(用于预约)
|
||||||
|
-- ============================================
|
||||||
|
|
||||||
|
-- 为时间冲突测试会员创建有效次数卡
|
||||||
|
INSERT INTO member_card_record (member_id, member_card_id, status, remaining_times, remaining_amount, expire_time, purchase_time, version, card_composition, created_at, updated_at) VALUES
|
||||||
|
((SELECT id FROM member_user WHERE member_no = 'MEM_TIME_CONFLICT'), (SELECT member_card_id FROM member_card WHERE member_card_name = '10次卡'), 'ACTIVE', 10, 0.00, '2026-12-31 23:59:59', '2026-06-02 10:00:00', 0, '{}', '2026-06-02 10:00:00', '2026-06-02 10:00:00');
|
||||||
|
|
||||||
|
-- ============================================
|
||||||
|
-- 4. 测试场景说明
|
||||||
|
-- ============================================
|
||||||
|
--
|
||||||
|
-- 测试步骤:
|
||||||
|
-- 1. 使用会员 MEM_TIME_CONFLICT 预约团课A (course_name='时间冲突测试_A_13点-15点')
|
||||||
|
-- → 预期:预约成功
|
||||||
|
--
|
||||||
|
-- 2. 使用会员 MEM_TIME_CONFLICT 预约团课B (course_name='时间冲突测试_B_14点-16点')
|
||||||
|
-- → 预期:预约失败,提示时间冲突(14:00-15:00与已预约的团课A重叠)
|
||||||
|
--
|
||||||
|
-- 3. 使用会员 MEM_TIME_CONFLICT 预约团课C (course_name='时间冲突测试_C_10点-12点')
|
||||||
|
-- → 预期:预约成功(与团课A时间不冲突)
|
||||||
|
--
|
||||||
|
-- 时间冲突判断逻辑:
|
||||||
|
-- 新课程开始时间 < 已预约课程结束时间 AND 新课程结束时间 > 已预约课程开始时间
|
||||||
|
-- 即:newStartTime < existingEndTime AND newEndTime > existingStartTime
|
||||||
|
--
|
||||||
|
-- 本测试数据中的时间关系:
|
||||||
|
-- - 团课A: 13:00 - 15:00
|
||||||
|
-- - 团课B: 14:00 - 16:00
|
||||||
|
-- → 14:00 < 15:00 AND 16:00 > 13:00 → 冲突
|
||||||
|
-- - 团课C: 10:00 - 12:00
|
||||||
|
-- → 10:00 < 15:00 AND 12:00 > 13:00 → 12:00 > 13:00 不成立 → 不冲突
|
||||||
+77
@@ -0,0 +1,77 @@
|
|||||||
|
-- ============================================
|
||||||
|
-- 团课相关表
|
||||||
|
-- ============================================
|
||||||
|
|
||||||
|
-- 团课课程表
|
||||||
|
CREATE TABLE IF NOT EXISTS group_course (
|
||||||
|
id BIGSERIAL PRIMARY KEY,
|
||||||
|
course_name VARCHAR(100) NOT NULL,
|
||||||
|
coach_id BIGINT,
|
||||||
|
course_type BIGINT,
|
||||||
|
start_time TIMESTAMP NOT NULL,
|
||||||
|
end_time TIMESTAMP NOT NULL,
|
||||||
|
max_members INTEGER DEFAULT 20,
|
||||||
|
current_members INTEGER DEFAULT 0,
|
||||||
|
status VARCHAR(1) DEFAULT '0',
|
||||||
|
location VARCHAR(255),
|
||||||
|
cover_image VARCHAR(500),
|
||||||
|
description TEXT,
|
||||||
|
point_card_amount INTEGER DEFAULT 1,
|
||||||
|
stored_value_amount DECIMAL(10,2) DEFAULT 0,
|
||||||
|
create_by VARCHAR(50),
|
||||||
|
update_by VARCHAR(50),
|
||||||
|
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
deleted_at TIMESTAMP
|
||||||
|
);
|
||||||
|
|
||||||
|
-- 团课预约记录表
|
||||||
|
CREATE TABLE IF NOT EXISTS group_course_booking (
|
||||||
|
id BIGSERIAL PRIMARY KEY,
|
||||||
|
course_id BIGINT NOT NULL,
|
||||||
|
member_id BIGINT NOT NULL,
|
||||||
|
member_card_id BIGINT NOT NULL,
|
||||||
|
booking_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
status VARCHAR(1) DEFAULT '0',
|
||||||
|
cancel_time TIMESTAMP,
|
||||||
|
create_by VARCHAR(50),
|
||||||
|
update_by VARCHAR(50),
|
||||||
|
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
deleted_at TIMESTAMP
|
||||||
|
);
|
||||||
|
|
||||||
|
COMMENT ON TABLE group_course IS '团课课程表';
|
||||||
|
COMMENT ON COLUMN group_course.id IS '主键ID';
|
||||||
|
COMMENT ON COLUMN group_course.course_name IS '课程名称';
|
||||||
|
COMMENT ON COLUMN group_course.coach_id IS '教练ID(关联sys_user)';
|
||||||
|
COMMENT ON COLUMN group_course.course_type IS '课程类型(如瑜伽/普拉提/动感单车)';
|
||||||
|
COMMENT ON COLUMN group_course.start_time IS '开始时间';
|
||||||
|
COMMENT ON COLUMN group_course.end_time IS '结束时间';
|
||||||
|
COMMENT ON COLUMN group_course.max_members IS '最大参与人数';
|
||||||
|
COMMENT ON COLUMN group_course.current_members IS '当前参与人数';
|
||||||
|
COMMENT ON COLUMN group_course.status IS '状态(0正常 1已取消 2已结束)';
|
||||||
|
COMMENT ON COLUMN group_course.location IS '上课地点';
|
||||||
|
COMMENT ON COLUMN group_course.cover_image IS '封面图URL';
|
||||||
|
COMMENT ON COLUMN group_course.description IS '课程描述';
|
||||||
|
COMMENT ON COLUMN group_course.point_card_amount IS '点卡额度(消耗次数)';
|
||||||
|
COMMENT ON COLUMN group_course.stored_value_amount IS '储值卡额度(消耗金额)';
|
||||||
|
COMMENT ON COLUMN group_course.create_by IS '创建人';
|
||||||
|
COMMENT ON COLUMN group_course.update_by IS '更新人';
|
||||||
|
COMMENT ON COLUMN group_course.created_at IS '创建时间';
|
||||||
|
COMMENT ON COLUMN group_course.updated_at IS '更新时间';
|
||||||
|
COMMENT ON COLUMN group_course.deleted_at IS '删除时间(软删除)';
|
||||||
|
|
||||||
|
COMMENT ON TABLE group_course_booking IS '团课预约记录表';
|
||||||
|
COMMENT ON COLUMN group_course_booking.id IS '主键ID';
|
||||||
|
COMMENT ON COLUMN group_course_booking.course_id IS '团课ID';
|
||||||
|
COMMENT ON COLUMN group_course_booking.member_id IS '用户ID';
|
||||||
|
COMMENT ON COLUMN group_course_booking.member_card_id IS '会员卡ID';
|
||||||
|
COMMENT ON COLUMN group_course_booking.booking_time IS '预约时间';
|
||||||
|
COMMENT ON COLUMN group_course_booking.status IS '状态(0已预约 1已取消 2已出席 3缺席)';
|
||||||
|
COMMENT ON COLUMN group_course_booking.cancel_time IS '取消时间';
|
||||||
|
COMMENT ON COLUMN group_course_booking.create_by IS '创建人';
|
||||||
|
COMMENT ON COLUMN group_course_booking.update_by IS '更新人';
|
||||||
|
COMMENT ON COLUMN group_course_booking.created_at IS '创建时间';
|
||||||
|
COMMENT ON COLUMN group_course_booking.updated_at IS '更新时间';
|
||||||
|
COMMENT ON COLUMN group_course_booking.deleted_at IS '删除时间(软删除)';
|
||||||
+28
@@ -0,0 +1,28 @@
|
|||||||
|
-- 场景1: 0人预约,可预约(正常状态,6月15日,距开始还有14天)
|
||||||
|
INSERT INTO group_course (course_name, coach_id, course_type, start_time, end_time, max_members, current_members, status, location, cover_image, description, create_by, created_at, updated_at) VALUES
|
||||||
|
('极速燃脂单车', 104, 2, '2026-06-02 16:45:00', '2026-06-15 20:20:00', 25, 0, 0, '单车房', '/images/spinning.jpg', '跟随音乐节奏变换阻力和速度,体验爬坡与冲刺的快感,一节课消耗800大卡。', 'admin', '2026-06-01 11:00:00', '2026-06-01 11:00:00');
|
||||||
|
|
||||||
|
-- 场景2: 已有人预约,可预约(正常状态,6月12日,5/15人)
|
||||||
|
INSERT INTO group_course (course_name, coach_id, course_type, start_time, end_time, max_members, current_members, status, location, cover_image, description, create_by, created_at, updated_at) VALUES
|
||||||
|
('清晨流瑜伽', 101, 1, '2026-06-12 09:00:00', '2026-06-12 10:30:00', 15, 5, 0, 'A座3楼瑜伽教室', '/images/yoga_flow.jpg', '适合有一定基础的学员,通过流畅的体式连接呼吸,唤醒身体能量。', 'admin', '2026-06-01 10:00:00', '2026-06-01 10:00:00');
|
||||||
|
|
||||||
|
-- 场景3: 满员,不可预约(正常状态但已满员,6月10日,20/20人)
|
||||||
|
INSERT INTO group_course (course_name, coach_id, course_type, start_time, end_time, max_members, current_members, status, location, cover_image, description, create_by, created_at, updated_at) VALUES
|
||||||
|
('燃脂搏击', 102, 2, '2026-06-10 18:30:00', '2026-06-10 19:30:00', 20, 20, 0, '综合训练区', '/images/kickboxing.jpg', '高强度间歇训练,配合音乐快速燃脂,释放压力。名额已满,无法预约。', 'coach_zhang', '2026-06-01 14:30:00', '2026-06-01 14:30:00');
|
||||||
|
|
||||||
|
-- 场景4: 超出可预约时间,不可预约(正常状态但距开始不足30分钟)
|
||||||
|
-- 当前时间: 2026-06-01 15:00,课程开始: 2026-06-01 15:20
|
||||||
|
INSERT INTO group_course (course_name, coach_id, course_type, start_time, end_time, max_members, current_members, status, location, cover_image, description, create_by, created_at, updated_at) VALUES
|
||||||
|
('哈他瑜伽', 101, 1, '2026-06-01 15:20:00', '2026-06-01 16:50:00', 12, 3, 0, '瑜伽教室B', '/images/hatha_yoga.jpg', '基础哈他瑜伽,适合所有级别。距开始不足30分钟,已停止预约。', 'coach_li', '2026-06-01 08:00:00', '2026-06-01 08:00:00');
|
||||||
|
|
||||||
|
-- 场景5: 课程已取消,不可预约(status=1)
|
||||||
|
INSERT INTO group_course (course_name, coach_id, course_type, start_time, end_time, max_members, current_members, status, location, cover_image, description, create_by, created_at, updated_at) VALUES
|
||||||
|
('周末冥想修复', 101, 1, '2026-06-20 15:00:00', '2026-06-20 16:00:00', 12, 3, 1, '冥想室', '/images/meditation.jpg', '通过呼吸和正念冥想,深度放松身心。该课程已被取消。', 'coach_wang', '2026-05-28 08:00:00', '2026-05-28 08:00:00');
|
||||||
|
|
||||||
|
-- 场景6: 课程已结束,不可预约(status=2)
|
||||||
|
INSERT INTO group_course (course_name, coach_id, course_type, start_time, end_time, max_members, current_members, status, location, cover_image, description, create_by, created_at, updated_at) VALUES
|
||||||
|
('蜜桃臀塑造', 103, 3, '2026-05-30 19:00:00', '2026-05-30 20:00:00', 10, 8, 2, '私教专区', '/images/glute.jpg', '针对性训练臀部肌肉群,课程已于5月30日结束,无法预约。', 'coach_li', '2026-05-20 09:15:00', '2026-05-20 09:15:00');
|
||||||
|
|
||||||
|
-- 场景7(可选): 已结束但未满员的课程(status=2,即使有空位也不可预约)
|
||||||
|
INSERT INTO group_course (course_name, coach_id, course_type, start_time, end_time, max_members, current_members, status, location, cover_image, description, create_by, created_at, updated_at) VALUES
|
||||||
|
('午间冥想放松', 101, 1, '2026-05-31 12:00:00', '2026-05-31 13:00:00', 15, 6, 2, '冥想室', '/images/meditation_noon.jpg', '午间冥想课程,已于5月31日结束。', 'admin', '2026-05-25 09:00:00', '2026-05-25 09:00:00');
|
||||||
+281
@@ -0,0 +1,281 @@
|
|||||||
|
-- ============================================
|
||||||
|
-- 1. member_user 表(会员表)
|
||||||
|
-- ============================================
|
||||||
|
|
||||||
|
-- Step 1: 删除已存在的表(如果需要重建)
|
||||||
|
-- DROP TABLE IF EXISTS member_user CASCADE;
|
||||||
|
|
||||||
|
-- Step 2: 创建 member_user 表
|
||||||
|
CREATE TABLE IF NOT EXISTS member_user (
|
||||||
|
-- ========== 主键和基础字段(来自BaseEntity)==========
|
||||||
|
id BIGSERIAL PRIMARY KEY, -- 主键ID,自增
|
||||||
|
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, -- 创建时间
|
||||||
|
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, -- 更新时间
|
||||||
|
|
||||||
|
-- ========== 会员核心字段 ==========
|
||||||
|
member_no VARCHAR(50) NOT NULL UNIQUE, -- 会员编号(唯一)
|
||||||
|
nickname VARCHAR(100), -- 昵称
|
||||||
|
phone VARCHAR(255), -- 手机号(AES加密存储)
|
||||||
|
gender INTEGER DEFAULT 0, -- 性别:0-未知,1-男,2-女
|
||||||
|
birthday DATE, -- 生日
|
||||||
|
address VARCHAR(500), -- 地址
|
||||||
|
avatar VARCHAR(500), -- 头像URL
|
||||||
|
subscribed BOOLEAN DEFAULT FALSE, -- 是否关注服务号
|
||||||
|
last_login_at TIMESTAMP, -- 最后登录时间
|
||||||
|
|
||||||
|
-- ========== 微信相关字段 ==========
|
||||||
|
union_id VARCHAR(100), -- 微信UnionID(跨应用唯一标识)
|
||||||
|
miniapp_open_id VARCHAR(100), -- 小程序OpenID
|
||||||
|
official_open_id VARCHAR(100), -- 服务号OpenID
|
||||||
|
|
||||||
|
-- ========== 软删除字段 ==========
|
||||||
|
is_deleted BOOLEAN DEFAULT FALSE -- 是否删除(软删除标记)
|
||||||
|
);
|
||||||
|
|
||||||
|
-- Step 3: 创建索引
|
||||||
|
-- 会员编号索引(唯一索引,加速查询)
|
||||||
|
CREATE UNIQUE INDEX IF NOT EXISTS idx_member_user_member_no ON member_user(member_no);
|
||||||
|
|
||||||
|
-- UnionID索引(加速跨平台用户查找)
|
||||||
|
CREATE INDEX IF NOT EXISTS idx_member_user_union_id ON member_user(union_id);
|
||||||
|
|
||||||
|
-- 小程序OpenID索引(加速小程序登录查询)
|
||||||
|
CREATE INDEX IF NOT EXISTS idx_member_user_miniapp_openid ON member_user(miniapp_open_id);
|
||||||
|
|
||||||
|
-- 服务号OpenID索引(加速服务号事件处理)
|
||||||
|
CREATE INDEX IF NOT EXISTS idx_member_user_official_openid ON member_user(official_open_id);
|
||||||
|
|
||||||
|
-- 手机号索引(加速手机号查询和去重)
|
||||||
|
CREATE INDEX IF NOT EXISTS idx_member_user_phone ON member_user(phone);
|
||||||
|
|
||||||
|
-- 软删除索引(加速查询未删除的记录)
|
||||||
|
CREATE INDEX IF NOT EXISTS idx_member_user_is_deleted ON member_user(is_deleted);
|
||||||
|
|
||||||
|
-- Step 4: 添加注释
|
||||||
|
COMMENT ON TABLE member_user IS '会员表';
|
||||||
|
|
||||||
|
COMMENT ON COLUMN member_user.id IS '主键ID';
|
||||||
|
COMMENT ON COLUMN member_user.created_at IS '创建时间';
|
||||||
|
COMMENT ON COLUMN member_user.updated_at IS '更新时间';
|
||||||
|
|
||||||
|
COMMENT ON COLUMN member_user.member_no IS '会员编号(唯一,格式:MEM + 8位随机字符)';
|
||||||
|
COMMENT ON COLUMN member_user.nickname IS '昵称';
|
||||||
|
COMMENT ON COLUMN member_user.phone IS '手机号(AES-128-CBC加密存储)';
|
||||||
|
COMMENT ON COLUMN member_user.gender IS '性别:0-未知,1-男,2-女';
|
||||||
|
COMMENT ON COLUMN member_user.birthday IS '生日';
|
||||||
|
COMMENT ON COLUMN member_user.address IS '地址';
|
||||||
|
COMMENT ON COLUMN member_user.avatar IS '头像URL';
|
||||||
|
COMMENT ON COLUMN member_user.subscribed IS '是否关注服务号:true-已关注,false-未关注';
|
||||||
|
COMMENT ON COLUMN member_user.last_login_at IS '最后登录时间';
|
||||||
|
|
||||||
|
COMMENT ON COLUMN member_user.union_id IS '微信UnionID(用户在开放平台的唯一标识,跨应用相同)';
|
||||||
|
COMMENT ON COLUMN member_user.miniapp_open_id IS '小程序OpenID(用户在当前小程序的唯一标识)';
|
||||||
|
COMMENT ON COLUMN member_user.official_open_id IS '服务号OpenID(用户在当前服务号的唯一标识)';
|
||||||
|
|
||||||
|
COMMENT ON COLUMN member_user.is_deleted IS '是否删除(软删除标记):false-正常,true-已删除';
|
||||||
|
|
||||||
|
|
||||||
|
-- ============================================
|
||||||
|
-- 2. wechat_user 表(微信用户表)
|
||||||
|
-- ============================================
|
||||||
|
|
||||||
|
-- Step 1: 删除已存在的表(如果需要重建)
|
||||||
|
-- DROP TABLE IF EXISTS wechat_user CASCADE;
|
||||||
|
|
||||||
|
-- Step 2: 创建 wechat_user 表
|
||||||
|
CREATE TABLE IF NOT EXISTS wechat_user (
|
||||||
|
-- ========== 主键和基础字段(来自BaseEntity)==========
|
||||||
|
id BIGSERIAL PRIMARY KEY, -- 主键ID,自增
|
||||||
|
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, -- 创建时间
|
||||||
|
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, -- 更新时间
|
||||||
|
|
||||||
|
-- ========== 关联字段 ==========
|
||||||
|
member_id BIGINT NOT NULL, -- 会员ID(外键)
|
||||||
|
|
||||||
|
-- ========== 微信标识字段 ==========
|
||||||
|
union_id VARCHAR(100), -- 微信UnionID
|
||||||
|
miniapp_openid VARCHAR(100), -- 小程序OpenID
|
||||||
|
mp_openid VARCHAR(100), -- 服务号OpenID
|
||||||
|
|
||||||
|
-- ========== 关注状态字段 ==========
|
||||||
|
is_subscribed BOOLEAN DEFAULT FALSE, -- 是否关注服务号
|
||||||
|
subscribe_time TIMESTAMP, -- 首次关注时间
|
||||||
|
unsubscribe_time TIMESTAMP -- 最后一次取消关注时间
|
||||||
|
);
|
||||||
|
|
||||||
|
-- Step 3: 创建外键约束
|
||||||
|
ALTER TABLE wechat_user
|
||||||
|
ADD CONSTRAINT fk_wechat_user_member
|
||||||
|
FOREIGN KEY (member_id) REFERENCES member_user(id) ON DELETE CASCADE;
|
||||||
|
|
||||||
|
-- Step 4: 创建索引
|
||||||
|
-- UnionID索引(加速跨平台用户查找)
|
||||||
|
CREATE INDEX IF NOT EXISTS idx_wechat_user_union_id ON wechat_user(union_id);
|
||||||
|
|
||||||
|
-- 小程序OpenID索引(加速小程序登录查询)
|
||||||
|
CREATE INDEX IF NOT EXISTS idx_wechat_user_miniapp_openid ON wechat_user(miniapp_openid);
|
||||||
|
|
||||||
|
-- 服务号OpenID索引(加速服务号事件处理)
|
||||||
|
CREATE INDEX IF NOT EXISTS idx_wechat_user_mp_openid ON wechat_user(mp_openid);
|
||||||
|
|
||||||
|
-- 会员ID索引(加速关联查询)
|
||||||
|
CREATE INDEX IF NOT EXISTS idx_wechat_user_member_id ON wechat_user(member_id);
|
||||||
|
|
||||||
|
-- Step 5: 添加注释
|
||||||
|
COMMENT ON TABLE wechat_user IS '微信用户表';
|
||||||
|
|
||||||
|
COMMENT ON COLUMN wechat_user.id IS '主键ID';
|
||||||
|
COMMENT ON COLUMN wechat_user.created_at IS '创建时间';
|
||||||
|
COMMENT ON COLUMN wechat_user.updated_at IS '更新时间';
|
||||||
|
|
||||||
|
COMMENT ON COLUMN wechat_user.member_id IS '会员ID(关联 member_user 表的 id 字段)';
|
||||||
|
COMMENT ON COLUMN wechat_user.union_id IS '微信UnionID(用户在开放平台的唯一标识)';
|
||||||
|
COMMENT ON COLUMN wechat_user.miniapp_openid IS '小程序OpenID(用户在当前小程序的唯一标识)';
|
||||||
|
COMMENT ON COLUMN wechat_user.mp_openid IS '服务号OpenID(用户在当前服务号的唯一标识)';
|
||||||
|
|
||||||
|
COMMENT ON COLUMN wechat_user.is_subscribed IS '是否关注服务号:true-已关注,false-未关注';
|
||||||
|
COMMENT ON COLUMN wechat_user.subscribe_time IS '首次关注时间';
|
||||||
|
COMMENT ON COLUMN wechat_user.unsubscribe_time IS '最后一次取消关注时间';
|
||||||
|
|
||||||
|
|
||||||
|
-- ============================================
|
||||||
|
-- 3. member_card 表(会员卡类型表)
|
||||||
|
-- ============================================
|
||||||
|
CREATE TABLE IF NOT EXISTS member_card (
|
||||||
|
id BIGSERIAL PRIMARY KEY,
|
||||||
|
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
deleted_at TIMESTAMP,
|
||||||
|
|
||||||
|
member_card_id BIGSERIAL,
|
||||||
|
member_card_name VARCHAR(100) NOT NULL,
|
||||||
|
member_card_type VARCHAR(20) NOT NULL,
|
||||||
|
member_card_price DECIMAL(10, 2) NOT NULL,
|
||||||
|
member_card_validity_days INTEGER,
|
||||||
|
member_card_total_times INTEGER,
|
||||||
|
member_card_amount DECIMAL(10, 2),
|
||||||
|
member_card_status INTEGER DEFAULT 1 NOT NULL,
|
||||||
|
extra_config TEXT DEFAULT '{}'
|
||||||
|
);
|
||||||
|
|
||||||
|
COMMENT ON TABLE member_card IS '会员卡类型表';
|
||||||
|
COMMENT ON COLUMN member_card.member_card_id IS '会员卡ID';
|
||||||
|
COMMENT ON COLUMN member_card.member_card_name IS '会员卡名称';
|
||||||
|
COMMENT ON COLUMN member_card.member_card_type IS '会员卡类型:TIME_CARD-时长卡, COUNT_CARD-次卡, STORED_VALUE_CARD-储值卡';
|
||||||
|
COMMENT ON COLUMN member_card.member_card_price IS '会员卡价格';
|
||||||
|
COMMENT ON COLUMN member_card.member_card_validity_days IS '有效天数(时长卡用)';
|
||||||
|
COMMENT ON COLUMN member_card.member_card_total_times IS '总次数(次卡用)';
|
||||||
|
COMMENT ON COLUMN member_card.member_card_amount IS '面额(储值卡用)';
|
||||||
|
COMMENT ON COLUMN member_card.member_card_status IS '状态:0-下架, 1-上架';
|
||||||
|
COMMENT ON COLUMN member_card.extra_config IS '扩展配置(JSON格式)';
|
||||||
|
|
||||||
|
|
||||||
|
-- ============================================
|
||||||
|
-- 4. member_card_record 表(会员卡记录表)
|
||||||
|
-- ============================================
|
||||||
|
CREATE TABLE IF NOT EXISTS member_card_record (
|
||||||
|
id BIGSERIAL PRIMARY KEY,
|
||||||
|
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
deleted_at TIMESTAMP,
|
||||||
|
|
||||||
|
member_card_record_id BIGSERIAL,
|
||||||
|
member_id BIGINT NOT NULL,
|
||||||
|
member_card_id BIGINT NOT NULL,
|
||||||
|
status VARCHAR(20) NOT NULL DEFAULT 'ACTIVE',
|
||||||
|
remaining_times INTEGER DEFAULT 0,
|
||||||
|
remaining_amount DECIMAL(10, 2) DEFAULT 0.00,
|
||||||
|
expire_time TIMESTAMP,
|
||||||
|
source_order_id BIGINT,
|
||||||
|
purchase_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
version INTEGER DEFAULT 0 NOT NULL,
|
||||||
|
card_composition TEXT
|
||||||
|
);
|
||||||
|
|
||||||
|
-- 索引优化
|
||||||
|
CREATE INDEX IF NOT EXISTS idx_member_card_record_member_id ON member_card_record(member_id);
|
||||||
|
CREATE INDEX IF NOT EXISTS idx_member_card_record_status ON member_card_record(status);
|
||||||
|
CREATE INDEX IF NOT EXISTS idx_member_card_record_expire_time ON member_card_record(expire_time);
|
||||||
|
CREATE INDEX IF NOT EXISTS idx_member_card_record_member_status ON member_card_record(member_id, status);
|
||||||
|
CREATE INDEX IF NOT EXISTS idx_member_card_record_status_expire ON member_card_record(status, expire_time)
|
||||||
|
WHERE status = 'ACTIVE';
|
||||||
|
|
||||||
|
COMMENT ON TABLE member_card_record IS '会员卡记录表(会员持有的卡)';
|
||||||
|
COMMENT ON COLUMN member_card_record.member_card_record_id IS '会员卡记录ID';
|
||||||
|
COMMENT ON COLUMN member_card_record.member_id IS '会员ID';
|
||||||
|
COMMENT ON COLUMN member_card_record.member_card_id IS '会员卡类型ID';
|
||||||
|
COMMENT ON COLUMN member_card_record.status IS '状态:ACTIVE-有效, USED_UP-用完, EXPIRED-过期, REFUNDED-已退款';
|
||||||
|
COMMENT ON COLUMN member_card_record.remaining_times IS '剩余次数';
|
||||||
|
COMMENT ON COLUMN member_card_record.remaining_amount IS '剩余金额';
|
||||||
|
COMMENT ON COLUMN member_card_record.expire_time IS '到期时间';
|
||||||
|
COMMENT ON COLUMN member_card_record.source_order_id IS '来源订单ID';
|
||||||
|
COMMENT ON COLUMN member_card_record.purchase_time IS '购买时间';
|
||||||
|
COMMENT ON COLUMN member_card_record.version IS '乐观锁版本号';
|
||||||
|
COMMENT ON COLUMN member_card_record.card_composition IS '卡片组成(JSON格式,用于组合卡)';
|
||||||
|
|
||||||
|
|
||||||
|
-- ============================================
|
||||||
|
-- 5. member_card_transactions 表(会员卡交易流水表)
|
||||||
|
-- ============================================
|
||||||
|
CREATE TABLE IF NOT EXISTS member_card_transactions (
|
||||||
|
id BIGSERIAL PRIMARY KEY,
|
||||||
|
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
|
||||||
|
member_card_record_id BIGINT NOT NULL,
|
||||||
|
member_id BIGINT NOT NULL,
|
||||||
|
member_card_id BIGINT NOT NULL,
|
||||||
|
operation_type VARCHAR(20) NOT NULL,
|
||||||
|
change_amount INTEGER DEFAULT 0,
|
||||||
|
change_balance DECIMAL(10, 2) DEFAULT 0.00,
|
||||||
|
after_remaining_count INTEGER DEFAULT 0,
|
||||||
|
after_remaining_balance DECIMAL(10, 2) DEFAULT 0.00,
|
||||||
|
related_biz_type VARCHAR(20),
|
||||||
|
source_order_id BIGINT,
|
||||||
|
remark VARCHAR(500),
|
||||||
|
is_archived BOOLEAN DEFAULT FALSE,
|
||||||
|
archived_at TIMESTAMP
|
||||||
|
);
|
||||||
|
|
||||||
|
-- 索引优化
|
||||||
|
CREATE INDEX IF NOT EXISTS idx_member_card_transactions_member_id ON member_card_transactions(member_id);
|
||||||
|
CREATE INDEX IF NOT EXISTS idx_member_card_transactions_record_id ON member_card_transactions(member_card_record_id);
|
||||||
|
CREATE INDEX IF NOT EXISTS idx_member_card_transactions_created_at ON member_card_transactions(created_at);
|
||||||
|
CREATE INDEX IF NOT EXISTS idx_member_card_transactions_member_type_time
|
||||||
|
ON member_card_transactions(member_id, operation_type, created_at);
|
||||||
|
|
||||||
|
COMMENT ON TABLE member_card_transactions IS '会员卡交易流水表';
|
||||||
|
COMMENT ON COLUMN member_card_transactions.operation_type IS '操作类型:PURCHASE-购买, DEDUCT-扣次/扣费, RENEW-续费, REFUND-退款, EXPIRE-过期';
|
||||||
|
COMMENT ON COLUMN member_card_transactions.change_amount IS '变动次数';
|
||||||
|
COMMENT ON COLUMN member_card_transactions.change_balance IS '变动金额';
|
||||||
|
COMMENT ON COLUMN member_card_transactions.after_remaining_count IS '变动后剩余次数';
|
||||||
|
COMMENT ON COLUMN member_card_transactions.after_remaining_balance IS '变动后剩余金额';
|
||||||
|
COMMENT ON COLUMN member_card_transactions.related_biz_type IS '关联业务类型:GROUP_CLASS-团课, PT_CLASS-私教, CHECK_IN-签到';
|
||||||
|
COMMENT ON COLUMN member_card_transactions.is_archived IS '是否已归档';
|
||||||
|
COMMENT ON COLUMN member_card_transactions.archived_at IS '归档时间';
|
||||||
|
|
||||||
|
|
||||||
|
-- ============================================
|
||||||
|
-- 6. refund_application 表(退款申请表)
|
||||||
|
-- ============================================
|
||||||
|
CREATE TABLE IF NOT EXISTS refund_application (
|
||||||
|
id BIGSERIAL PRIMARY KEY,
|
||||||
|
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
deleted_at TIMESTAMP,
|
||||||
|
|
||||||
|
record_id BIGINT NOT NULL,
|
||||||
|
member_id BIGINT NOT NULL,
|
||||||
|
status VARCHAR(20) NOT NULL DEFAULT 'PENDING',
|
||||||
|
reason VARCHAR(500),
|
||||||
|
apply_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
audit_time TIMESTAMP,
|
||||||
|
auditor_id BIGINT,
|
||||||
|
audit_remark VARCHAR(500),
|
||||||
|
refund_amount DECIMAL(10, 2)
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE INDEX IF NOT EXISTS idx_refund_application_record_id ON refund_application(record_id);
|
||||||
|
CREATE INDEX IF NOT EXISTS idx_refund_application_status ON refund_application(status);
|
||||||
|
|
||||||
|
COMMENT ON TABLE refund_application IS '退款申请表';
|
||||||
|
COMMENT ON COLUMN refund_application.status IS '状态:PENDING-待审核, APPROVED-已批准, REJECTED-已拒绝, PROCESSING-处理中, SUCCESS-成功, FAILED-失败';
|
||||||
+15
@@ -0,0 +1,15 @@
|
|||||||
|
-- ============================================
|
||||||
|
-- 为团课预约记录表添加课程冗余字段
|
||||||
|
-- 用于保存预约时的课程快照信息
|
||||||
|
-- ============================================
|
||||||
|
|
||||||
|
ALTER TABLE group_course_booking
|
||||||
|
ADD COLUMN IF NOT EXISTS course_name VARCHAR(100),
|
||||||
|
ADD COLUMN IF NOT EXISTS course_start_time TIMESTAMP,
|
||||||
|
ADD COLUMN IF NOT EXISTS course_end_time TIMESTAMP,
|
||||||
|
ADD COLUMN IF NOT EXISTS location VARCHAR(255);
|
||||||
|
|
||||||
|
COMMENT ON COLUMN group_course_booking.course_name IS '课程名称(冗余字段,保存预约时的课程快照)';
|
||||||
|
COMMENT ON COLUMN group_course_booking.course_start_time IS '课程开始时间(冗余字段,保存预约时的课程快照)';
|
||||||
|
COMMENT ON COLUMN group_course_booking.course_end_time IS '课程结束时间(冗余字段,保存预约时的课程快照)';
|
||||||
|
COMMENT ON COLUMN group_course_booking.location IS '上课地点(冗余字段,保存预约时的课程快照)';
|
||||||
+8
-1
@@ -50,7 +50,14 @@ public class SecurityConfig {
|
|||||||
spec.pathMatchers("/api/auth/**").permitAll()
|
spec.pathMatchers("/api/auth/**").permitAll()
|
||||||
.pathMatchers("/api/public/**").permitAll()
|
.pathMatchers("/api/public/**").permitAll()
|
||||||
.pathMatchers("/ws/**").permitAll()
|
.pathMatchers("/ws/**").permitAll()
|
||||||
.pathMatchers("/actuator/**").permitAll();
|
.pathMatchers("/actuator/**").permitAll()
|
||||||
|
.pathMatchers("/api/groupCourse/**").permitAll()
|
||||||
|
.pathMatchers("/api/member/**").permitAll()
|
||||||
|
.pathMatchers("/api/admin/member/**").permitAll()
|
||||||
|
.pathMatchers("/api/member-cards/**").permitAll()
|
||||||
|
.pathMatchers("/api/member-card-records/**").permitAll()
|
||||||
|
.pathMatchers("/api/member-card-transactions/**").permitAll();
|
||||||
|
|
||||||
|
|
||||||
if (isDevOrTest) {
|
if (isDevOrTest) {
|
||||||
spec.pathMatchers("/swagger-ui.html").permitAll()
|
spec.pathMatchers("/swagger-ui.html").permitAll()
|
||||||
|
|||||||
+1
@@ -15,6 +15,7 @@ import cn.novalon.gym.manage.sys.core.repository.IUserRoleRepository;
|
|||||||
import cn.novalon.gym.manage.sys.core.service.ISysUserService;
|
import cn.novalon.gym.manage.sys.core.service.ISysUserService;
|
||||||
import cn.novalon.gym.manage.sys.core.command.CreateUserCommand;
|
import cn.novalon.gym.manage.sys.core.command.CreateUserCommand;
|
||||||
import cn.novalon.gym.manage.sys.core.command.UpdateUserCommand;
|
import cn.novalon.gym.manage.sys.core.command.UpdateUserCommand;
|
||||||
|
import cn.novalon.gym.manage.sys.dto.response.UserResponse;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Qualifier;
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
|
|||||||
+11
-4
@@ -43,6 +43,7 @@
|
|||||||
<module>manage-notify</module>
|
<module>manage-notify</module>
|
||||||
<module>manage-file</module>
|
<module>manage-file</module>
|
||||||
<module>gym-member</module>
|
<module>gym-member</module>
|
||||||
|
<module>gym-groupCourse</module>
|
||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
<dependencyManagement>
|
<dependencyManagement>
|
||||||
@@ -223,12 +224,18 @@
|
|||||||
<optional>true</optional>
|
<optional>true</optional>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- Redis响应式支持(会员卡模块需要) -->
|
<!-- HuTool工具箱-->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>cn.hutool</groupId>
|
||||||
<artifactId>spring-boot-starter-data-redis-reactive</artifactId>
|
<artifactId>hutool-all</artifactId>
|
||||||
|
<version>5.8.38</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-data-redis-reactive</artifactId>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
|
|||||||
@@ -1,4 +0,0 @@
|
|||||||
node_modules/
|
|
||||||
unpackage/
|
|
||||||
.hbuilderx/
|
|
||||||
.DS_Store
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
<script>
|
|
||||||
export default {
|
|
||||||
onLaunch: function() {
|
|
||||||
console.log('App Launch')
|
|
||||||
},
|
|
||||||
onShow: function() {
|
|
||||||
console.log('App Show')
|
|
||||||
},
|
|
||||||
onHide: function() {
|
|
||||||
console.log('App Hide')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
@import 'common/style/base.css';
|
|
||||||
/*每个页面公共css */
|
|
||||||
.app-container {
|
|
||||||
width: 100%;
|
|
||||||
min-height: 100vh;
|
|
||||||
max-width: 430px;
|
|
||||||
margin: 0 auto;
|
|
||||||
background-color: var(--bg-light);
|
|
||||||
position: relative;
|
|
||||||
overflow-x: hidden;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,130 +0,0 @@
|
|||||||
/**
|
|
||||||
* ============================================
|
|
||||||
* 健身房管理系统小程序 - 全局配色变量
|
|
||||||
* 主题:活力运动风格
|
|
||||||
* 主色调:深蓝专业 + 活力橙热情
|
|
||||||
* 兼容暗色/浅色模式基础,保证可访问性
|
|
||||||
* ============================================
|
|
||||||
*/
|
|
||||||
|
|
||||||
:root {
|
|
||||||
/* ========== 主品牌色 ========== */
|
|
||||||
--primary-dark: #0B2B4B; /* 深蓝主色 - 用于头部导航栏、重要按钮、品牌标识,体现专业信赖感 */
|
|
||||||
--primary-deep: #1A4A6F; /* 中深蓝色 - 用于hover状态、次级按钮、图标点缀,增加层次感 */
|
|
||||||
--primary-light: #2C6288; /* 浅蓝色(预留)- 用于选中态或辅助背景,保持和谐渐变 */
|
|
||||||
|
|
||||||
/* ========== 强调/行动色 ========== */
|
|
||||||
--accent-orange: #FF6B35; /* 活力橙 - 主要CTA按钮、会员标识、高亮徽章、关键数据,刺激行动力 */
|
|
||||||
--accent-orange-light: #FF8C5A; /* 浅橙色 - hover轻量背景、渐变辅助,带来温暖运动感 */
|
|
||||||
--accent-orange-dark: #E55A2B; /* 深橙色 - 按压状态或重要警告,保持色彩体系完整 */
|
|
||||||
|
|
||||||
/* ========== 背景色系 ========== */
|
|
||||||
--bg-light: #F9FAFE; /* 全局浅灰蓝背景 - 柔和且提升深蓝/橙色的视觉舒适度 */
|
|
||||||
--bg-white: #FFFFFF; /* 纯白卡片背景 - 用于内容卡片、表单区域,提高可读性与层次感 */
|
|
||||||
--bg-gray: #F2F5F9; /* 浅灰辅助背景 - 分割区域或禁用态背景 */
|
|
||||||
|
|
||||||
/* ========== 文本色系 ========== */
|
|
||||||
--text-dark: #1E2A3A; /* 主要文字 - 标题、正文,保证高对比度 */
|
|
||||||
--text-muted: #5E6F8D; /* 辅助文字 - 次要信息、占位符,保持易读性 */
|
|
||||||
--text-light: #8A99B4; /* 更浅文字 - 提示语、时间戳,但需注意与背景对比 */
|
|
||||||
--text-inverse: #FFFFFF; /* 反白文字 - 深色/橙色背景上的文字 */
|
|
||||||
|
|
||||||
/* ========== 边框/分割线 ========== */
|
|
||||||
--border-light: #E9EDF2; /* 浅边框 - 卡片分割、列表边界,细腻柔和 */
|
|
||||||
--border-focus: #FF6B35; /* 聚焦边框 - 输入框选中或强调区域,使用橙色点缀 */
|
|
||||||
|
|
||||||
/* ========== 状态颜色(功能性) ========== */
|
|
||||||
--success-green: #2ECC71; /* 成功绿 - 已完成课程、健康打卡 */
|
|
||||||
--warning-amber: #F39C12; /* 警示橙黄 - 提醒、到期提示 */
|
|
||||||
--error-red: #E74C3C; /* 错误红 - 异常情况或取消预约 */
|
|
||||||
--info-blue: #3498DB; /* 信息蓝 - 提示气泡、帮助文字 */
|
|
||||||
|
|
||||||
/* ========== 渐变色 (提升活力感) ========== */
|
|
||||||
--gradient-orange: linear-gradient(135deg, #FF6B35 0%, #FF8C5A 100%); /* 橙色渐变 - 会员按钮、重要徽章 */
|
|
||||||
--gradient-blue: linear-gradient(135deg, #0B2B4B 0%, #1A4A6F 100%); /* 深蓝渐变 - 头部banner或特别卡片 */
|
|
||||||
--gradient-subtle: linear-gradient(120deg, #F9FAFE 0%, #FFFFFF 100%); /* 微弱渐变 - 增加细节精致度 */
|
|
||||||
|
|
||||||
/* ========== 阴影层级 ========== */
|
|
||||||
--shadow-sm: 0 8px 20px rgba(0, 0, 0, 0.03), 0 2px 6px rgba(0, 0, 0, 0.05); /* 卡片小阴影 轻量浮起 */
|
|
||||||
--shadow-md: 0 12px 28px rgba(0, 0, 0, 0.08); /* 中等阴影 - 弹窗或下拉菜单 */
|
|
||||||
--shadow-lg: 0 20px 35px rgba(0, 0, 0, 0.12); /* 大阴影 - 模态框、悬浮元素 */
|
|
||||||
--shadow-orange-glow: 0 4px 12px rgba(255, 107, 53, 0.25); /* 橙色光晕 - 增强CTA吸引力 */
|
|
||||||
|
|
||||||
/* ========== 圆角规范 (柔和运动风) ========== */
|
|
||||||
--radius-sm: 12px; /* 小组件、标签圆角 */
|
|
||||||
--radius-md: 20px; /* 标准卡片圆角 */
|
|
||||||
--radius-lg: 28px; /* 大容器、头部卡片圆角 */
|
|
||||||
--radius-full: 999px; /* 胶囊按钮、头像完全圆角 */
|
|
||||||
|
|
||||||
/* ========== 布局与间距 ========== */
|
|
||||||
--spacing-xs: 4px;
|
|
||||||
--spacing-sm: 8px;
|
|
||||||
--spacing-md: 16px;
|
|
||||||
--spacing-lg: 24px;
|
|
||||||
--spacing-xl: 32px;
|
|
||||||
|
|
||||||
/* ========== 字体 (移动端优先) ========== */
|
|
||||||
--font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
|
|
||||||
--font-size-xs: 0.7rem; /* 辅助标注 */
|
|
||||||
--font-size-sm: 0.8rem; /* 次要文字 */
|
|
||||||
--font-size-base: 0.9rem; /* 正文基准 */
|
|
||||||
--font-size-md: 1rem; /* 小标题 */
|
|
||||||
--font-size-lg: 1.2rem; /* 卡片标题 */
|
|
||||||
--font-size-xl: 1.4rem; /* 大数字/欢迎语 */
|
|
||||||
--font-weight-regular: 400;
|
|
||||||
--font-weight-medium: 500;
|
|
||||||
--font-weight-bold: 700;
|
|
||||||
--font-weight-extrabold: 800;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ========== 暗色模式适配(可选,保持品牌一致性) ========== */
|
|
||||||
@media (prefers-color-scheme: dark) {
|
|
||||||
:root {
|
|
||||||
/* 暗色模式下微调背景与文字,保留品牌色核心 */
|
|
||||||
--bg-light: #121826;
|
|
||||||
--bg-white: #1E2636;
|
|
||||||
--bg-gray: #0F141F;
|
|
||||||
--text-dark: #EDF2F7;
|
|
||||||
--text-muted: #9AA9C1;
|
|
||||||
--border-light: #2A3346;
|
|
||||||
--shadow-sm: 0 8px 20px rgba(0, 0, 0, 0.4);
|
|
||||||
/* 保留主色深蓝与橙色不变,但可适当提高对比 */
|
|
||||||
--primary-dark: #123A5E; /* 亮一点保证深色背景可见度 */
|
|
||||||
--accent-orange: #FF7846; /* 稍微提亮橙色 */
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ========== 辅助类 (方便开发直接复用) ========== */
|
|
||||||
.bg-primary {
|
|
||||||
background-color: var(--primary-dark);
|
|
||||||
}
|
|
||||||
.bg-accent {
|
|
||||||
background-color: var(--accent-orange);
|
|
||||||
}
|
|
||||||
.text-primary {
|
|
||||||
color: var(--primary-dark);
|
|
||||||
}
|
|
||||||
.text-accent {
|
|
||||||
color: var(--accent-orange);
|
|
||||||
}
|
|
||||||
.btn-orange {
|
|
||||||
background: var(--gradient-orange);
|
|
||||||
color: white;
|
|
||||||
border: none;
|
|
||||||
border-radius: var(--radius-full);
|
|
||||||
padding: 10px 20px;
|
|
||||||
font-weight: var(--font-weight-bold);
|
|
||||||
box-shadow: var(--shadow-orange-glow);
|
|
||||||
transition: all 0.2s ease;
|
|
||||||
}
|
|
||||||
.btn-orange:active {
|
|
||||||
transform: scale(0.97);
|
|
||||||
background: var(--accent-orange-dark);
|
|
||||||
}
|
|
||||||
.card-default {
|
|
||||||
background: var(--bg-white);
|
|
||||||
border-radius: var(--radius-md);
|
|
||||||
box-shadow: var(--shadow-sm);
|
|
||||||
border: 1px solid var(--border-light);
|
|
||||||
padding: var(--spacing-md);
|
|
||||||
}
|
|
||||||
@@ -1,99 +0,0 @@
|
|||||||
<template>
|
|
||||||
<!-- 底部导航栏容器 -->
|
|
||||||
<view class="tab-bar">
|
|
||||||
<!-- 导航栏项 -->
|
|
||||||
<view
|
|
||||||
v-for="(tab, index) in tabs"
|
|
||||||
:key="index"
|
|
||||||
:class="['tab-item', { active: activeTab === index }]"
|
|
||||||
@click="activeTab = index"
|
|
||||||
>
|
|
||||||
<!-- 导航栏图标 -->
|
|
||||||
<image :src="activeTab === index ? tab.iconActive : tab.icon" mode="aspectFit" class="tab-icon" />
|
|
||||||
<!-- 导航栏标签文字 -->
|
|
||||||
<text class="tab-label">{{ tab.label }}</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup>
|
|
||||||
import { ref } from 'vue'
|
|
||||||
|
|
||||||
// 当前激活的导航栏索引
|
|
||||||
const activeTab = ref(0)
|
|
||||||
|
|
||||||
// 导航栏数据列表
|
|
||||||
const tabs = [
|
|
||||||
{
|
|
||||||
icon: 'https://gymfuture.oss-cn-chengdu.aliyuncs.com/static/tabBar/home.png',
|
|
||||||
iconActive: 'https://gymfuture.oss-cn-chengdu.aliyuncs.com/static/tabBar/active/home.png',
|
|
||||||
label: '首页',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
icon: 'https://gymfuture.oss-cn-chengdu.aliyuncs.com/static/tabBar/course.png',
|
|
||||||
iconActive: 'https://gymfuture.oss-cn-chengdu.aliyuncs.com/static/tabBar/active/course.png',
|
|
||||||
label: '课程'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
icon: 'https://gymfuture.oss-cn-chengdu.aliyuncs.com/static/tabBar/train.png',
|
|
||||||
iconActive: 'https://gymfuture.oss-cn-chengdu.aliyuncs.com/static/tabBar/active/train.png',
|
|
||||||
label: '训练' ,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
icon: 'https://gymfuture.oss-cn-chengdu.aliyuncs.com/static/tabBar/discover.png',
|
|
||||||
iconActive: 'https://gymfuture.oss-cn-chengdu.aliyuncs.com/static/tabBar/active/discover.png',
|
|
||||||
label: '发现',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
icon: 'https://gymfuture.oss-cn-chengdu.aliyuncs.com/static/tabBar/profile.png',
|
|
||||||
iconActive: 'https://gymfuture.oss-cn-chengdu.aliyuncs.com/static/tabBar/active/profile.png',
|
|
||||||
label: '我的',
|
|
||||||
}
|
|
||||||
]
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
/* 底部导航栏容器样式 */
|
|
||||||
.tab-bar {
|
|
||||||
position: fixed;
|
|
||||||
bottom: 0;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
height: 120rpx;
|
|
||||||
background: #1A4A6F;
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-around;
|
|
||||||
align-items: center;
|
|
||||||
padding-bottom: constant(safe-area-inset-bottom);
|
|
||||||
padding-bottom: env(safe-area-inset-bottom);
|
|
||||||
box-shadow: 0 -4rpx 20rpx rgba(0, 0, 0, 0.06);
|
|
||||||
border-radius: 32rpx 32rpx 0 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 导航栏项样式 */
|
|
||||||
.tab-item {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
gap: 8rpx;
|
|
||||||
padding: 12rpx 24rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 导航栏图标样式 */
|
|
||||||
.tab-icon {
|
|
||||||
width: 40rpx;
|
|
||||||
height: 40rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 导航栏标签文字样式 */
|
|
||||||
.tab-label {
|
|
||||||
font-size: 22rpx;
|
|
||||||
color: #94a3b8;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 导航栏激活状态文字样式 */
|
|
||||||
.tab-item.active .tab-label {
|
|
||||||
color: #f97316;
|
|
||||||
font-weight: 600;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,171 +0,0 @@
|
|||||||
<template>
|
|
||||||
<!-- 轮播图容器 -->
|
|
||||||
<view class="banner-container">
|
|
||||||
<!-- 轮播图组件 -->
|
|
||||||
<swiper
|
|
||||||
class="banner-swiper"
|
|
||||||
:circular="true"
|
|
||||||
:autoplay="true"
|
|
||||||
:interval="4000"
|
|
||||||
:duration="500"
|
|
||||||
:indicator-dots="false"
|
|
||||||
@change="onSwiperChange"
|
|
||||||
>
|
|
||||||
<!-- 轮播项 -->
|
|
||||||
<swiper-item v-for="(banner, index) in banners" :key="index">
|
|
||||||
<!-- 轮播内容 -->
|
|
||||||
<view class="banner-content">
|
|
||||||
<!-- 轮播图片 -->
|
|
||||||
<image :src="banner.image" mode="aspectFill" class="banner-image" />
|
|
||||||
<!-- 图片遮罩层 -->
|
|
||||||
<view class="banner-overlay"></view>
|
|
||||||
<!-- 轮播文字信息 -->
|
|
||||||
<view class="banner-text">
|
|
||||||
<text class="banner-title">{{ banner.title }}</text>
|
|
||||||
<text class="banner-subtitle">{{ banner.subtitle }}</text>
|
|
||||||
<text class="banner-desc">{{ banner.desc }}</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</swiper-item>
|
|
||||||
</swiper>
|
|
||||||
<!-- 轮播指示器点 -->
|
|
||||||
<view class="banner-dots">
|
|
||||||
<view
|
|
||||||
v-for="(_, index) in banners"
|
|
||||||
:key="index"
|
|
||||||
:class="['dot', { active: currentIndex === index }]"
|
|
||||||
></view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup>
|
|
||||||
import { ref } from 'vue'
|
|
||||||
|
|
||||||
// 轮播图数据列表
|
|
||||||
const banners = [
|
|
||||||
{
|
|
||||||
image: 'https://images.unsplash.com/photo-1534438327276-14e5300c3a48?w=800&q=80',
|
|
||||||
title: '突破自我',
|
|
||||||
subtitle: '超越极限',
|
|
||||||
desc: '科学训练 · 遇见更好的自己'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
image: 'https://images.unsplash.com/photo-1517836357463-d25dfeac3438?w=800&q=80',
|
|
||||||
title: '专业指导',
|
|
||||||
subtitle: '高效训练',
|
|
||||||
desc: '私人定制 · 专属健身方案'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
image: 'https://images.unsplash.com/photo-1571019614242-c5c5dee9f50b?w=800&q=80',
|
|
||||||
title: '健康生活',
|
|
||||||
subtitle: '从这里开始',
|
|
||||||
desc: '全方位 · 打造完美体态'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
|
|
||||||
// 当前轮播索引,用于控制指示器激活状态
|
|
||||||
const currentIndex = ref(0)
|
|
||||||
|
|
||||||
// 轮播图切换时的回调函数,更新当前索引
|
|
||||||
const onSwiperChange = (e) => {
|
|
||||||
currentIndex.value = e.detail.current
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
/* 轮播图容器样式 */
|
|
||||||
.banner-container {
|
|
||||||
position: relative;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 轮播图组件样式 */
|
|
||||||
.banner-swiper {
|
|
||||||
width: 100%;
|
|
||||||
height: 360rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 轮播内容容器样式 */
|
|
||||||
.banner-content {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
position: relative;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 轮播图片样式 */
|
|
||||||
.banner-image {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 图片遮罩层样式,添加渐变效果 */
|
|
||||||
.banner-overlay {
|
|
||||||
position: absolute;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
top: 0;
|
|
||||||
bottom: 0;
|
|
||||||
background: linear-gradient(135deg, rgba(11, 43, 75, 0.85) 0%, rgba(26, 74, 111, 0.6) 100%);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 轮播文字信息容器样式 */
|
|
||||||
.banner-text {
|
|
||||||
position: absolute;
|
|
||||||
left: 32rpx;
|
|
||||||
top: 50%;
|
|
||||||
transform: translateY(-50%);
|
|
||||||
z-index: 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 轮播标题样式 */
|
|
||||||
.banner-title {
|
|
||||||
display: block;
|
|
||||||
font-size: 48rpx;
|
|
||||||
font-weight: 800;
|
|
||||||
color: #ffffff;
|
|
||||||
margin-bottom: 8rpx;
|
|
||||||
text-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.3);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 轮播副标题样式 */
|
|
||||||
.banner-subtitle {
|
|
||||||
display: block;
|
|
||||||
font-size: 56rpx;
|
|
||||||
font-weight: 800;
|
|
||||||
color: #f97316;
|
|
||||||
margin-bottom: 16rpx;
|
|
||||||
text-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.3);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 轮播描述文字样式 */
|
|
||||||
.banner-desc {
|
|
||||||
display: block;
|
|
||||||
font-size: 26rpx;
|
|
||||||
color: rgba(255, 255, 255, 0.8);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 轮播指示器容器样式 */
|
|
||||||
.banner-dots {
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
gap: 16rpx;
|
|
||||||
margin-top: 24rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 轮播指示器点样式 */
|
|
||||||
.dot {
|
|
||||||
width: 48rpx;
|
|
||||||
height: 8rpx;
|
|
||||||
border-radius: 9999rpx;
|
|
||||||
background: #d1d5db;
|
|
||||||
transition: all 0.3s ease;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 轮播指示器激活状态样式 */
|
|
||||||
.dot.active {
|
|
||||||
width: 64rpx;
|
|
||||||
background: #f97316;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,115 +0,0 @@
|
|||||||
<template>
|
|
||||||
<!-- 快捷入口容器 -->
|
|
||||||
<view class="quick-entry">
|
|
||||||
<!-- 快捷入口项 -->
|
|
||||||
<view
|
|
||||||
v-for="(item, index) in entries"
|
|
||||||
:key="index"
|
|
||||||
class="entry-item"
|
|
||||||
>
|
|
||||||
<!-- 入口图标容器 -->
|
|
||||||
<view :class="['entry-icon', { accent: item.accent }]">
|
|
||||||
<!-- 入口图标图片 -->
|
|
||||||
<image :src="item.icon" mode="aspectFit" class="icon-img" />
|
|
||||||
</view>
|
|
||||||
<!-- 入口标题 -->
|
|
||||||
<text class="entry-title">{{ item.title }}</text>
|
|
||||||
<!-- 入口描述 -->
|
|
||||||
<text class="entry-desc">{{ item.desc }}</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup>
|
|
||||||
// 快捷入口数据列表
|
|
||||||
const entries = [
|
|
||||||
{
|
|
||||||
icon: 'https://gymfuture.oss-cn-chengdu.aliyuncs.com/static/icons/course.png',
|
|
||||||
title: '找课程',
|
|
||||||
desc: '精品课程',
|
|
||||||
accent: false ,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
icon: 'https://gymfuture.oss-cn-chengdu.aliyuncs.com/static/icons/plan.png',
|
|
||||||
title: '训练计划',
|
|
||||||
desc: '个性定制',
|
|
||||||
accent: true ,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
icon: 'https://gymfuture.oss-cn-chengdu.aliyuncs.com/static/icons/data.png',
|
|
||||||
title: '健身数据',
|
|
||||||
desc: '记录分析',
|
|
||||||
accent: false ,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
icon: 'https://gymfuture.oss-cn-chengdu.aliyuncs.com/static/icons/message.png',
|
|
||||||
title: '消息',
|
|
||||||
desc: '通知消息',
|
|
||||||
accent: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
icon: 'https://gymfuture.oss-cn-chengdu.aliyuncs.com/static/icons/checkIn.png',
|
|
||||||
title: '签到',
|
|
||||||
desc: '打卡签到',
|
|
||||||
accent: false,
|
|
||||||
}
|
|
||||||
]
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
/* 快捷入口容器样式 */
|
|
||||||
.quick-entry {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
padding: 32rpx 24rpx;
|
|
||||||
background: #ffffff;
|
|
||||||
margin: 24rpx;
|
|
||||||
border-radius: 24rpx;
|
|
||||||
box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.08);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 快捷入口项样式 */
|
|
||||||
.entry-item {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
flex: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 入口图标容器样式 */
|
|
||||||
.entry-icon {
|
|
||||||
width: 104rpx;
|
|
||||||
height: 104rpx;
|
|
||||||
border-radius: 20rpx;
|
|
||||||
background: #072A4E;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
margin-bottom: 16rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 入口图标图片样式 */
|
|
||||||
.icon-img {
|
|
||||||
width: 52rpx;
|
|
||||||
height: 52rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 入口图标强调色样式(橙色背景) */
|
|
||||||
.entry-icon.accent {
|
|
||||||
background: #FC5A15;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 入口标题样式 */
|
|
||||||
.entry-title {
|
|
||||||
font-size: 26rpx;
|
|
||||||
font-weight: 600;
|
|
||||||
color: #1a202c;
|
|
||||||
margin-bottom: 4rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 入口描述文字样式 */
|
|
||||||
.entry-desc {
|
|
||||||
font-size: 22rpx;
|
|
||||||
color: #94a3b8;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,291 +0,0 @@
|
|||||||
<template>
|
|
||||||
<!-- 推荐课程容器 -->
|
|
||||||
<view class="recommend-courses">
|
|
||||||
<!-- 区域标题栏 -->
|
|
||||||
<view class="section-header">
|
|
||||||
<!-- 区域标题 -->
|
|
||||||
<text class="section-title">推荐课程</text>
|
|
||||||
<!-- 查看更多按钮 -->
|
|
||||||
<view class="view-more">
|
|
||||||
<text>查看更多</text>
|
|
||||||
<text class="arrow">
|
|
||||||
<uni-icons type="right" size="20" color="#94a3b8"/>
|
|
||||||
</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<!-- 课程横向滚动容器 -->
|
|
||||||
<scroll-view class="courses-scroll" scroll-x="true" :show-scrollbar="false">
|
|
||||||
<!-- 课程列表 -->
|
|
||||||
<view class="courses-list">
|
|
||||||
<!-- 课程卡片 -->
|
|
||||||
<view
|
|
||||||
v-for="(course, index) in courses"
|
|
||||||
:key="index"
|
|
||||||
class="course-card"
|
|
||||||
>
|
|
||||||
<!-- 课程图片区域 -->
|
|
||||||
<view class="course-image">
|
|
||||||
<!-- 课程封面图片 -->
|
|
||||||
<image :src="course.image" mode="aspectFill" class="img" />
|
|
||||||
<!-- 图片渐变遮罩 -->
|
|
||||||
<view class="course-overlay"></view>
|
|
||||||
<!-- 课程标签 -->
|
|
||||||
<text :class="['course-tag', course.tagType]">{{ course.tag }}</text>
|
|
||||||
<!-- 课程信息区域 -->
|
|
||||||
<view class="course-info">
|
|
||||||
<!-- 课程名称 -->
|
|
||||||
<text class="course-name">{{ course.name }}</text>
|
|
||||||
<!-- 课程元信息(时长、难度) -->
|
|
||||||
<view class="course-meta">
|
|
||||||
<!-- 时长信息 -->
|
|
||||||
<view class="meta-item">
|
|
||||||
<text class="meta-icon">
|
|
||||||
<image src="https://gymfuture.oss-cn-chengdu.aliyuncs.com/static/time.png"/>
|
|
||||||
</text>
|
|
||||||
<text>{{ course.duration }}</text>
|
|
||||||
</view>
|
|
||||||
<!-- 难度信息 -->
|
|
||||||
<view class="meta-item">
|
|
||||||
<text class="meta-icon">
|
|
||||||
<image src="https://gymfuture.oss-cn-chengdu.aliyuncs.com/static/intensity.png"/>
|
|
||||||
</text>
|
|
||||||
<text>{{ course.level }}</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<!-- 课程底部区域 -->
|
|
||||||
<view class="course-footer">
|
|
||||||
<!-- 参与人数信息 -->
|
|
||||||
<view class="participants">
|
|
||||||
<text class="fire-icon">
|
|
||||||
<image src="https://gymfuture.oss-cn-chengdu.aliyuncs.com/static/hot.png"/>
|
|
||||||
</text>
|
|
||||||
<text>{{ course.participants }}人参与</text>
|
|
||||||
</view>
|
|
||||||
<!-- 去参与按钮 -->
|
|
||||||
<view class="join-btn">
|
|
||||||
<text>去参与</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</scroll-view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup>
|
|
||||||
// 推荐课程数据列表
|
|
||||||
const courses = [
|
|
||||||
{
|
|
||||||
image: 'https://images.unsplash.com/photo-1534438327276-14e5300c3a48?w=400&q=80',
|
|
||||||
tag: '限时免费',
|
|
||||||
tagType: 'free',
|
|
||||||
name: 'HIIT高强度燃脂',
|
|
||||||
duration: '30分钟',
|
|
||||||
level: '中级',
|
|
||||||
participants: '4587'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
image: 'https://images.unsplash.com/photo-1583454110551-21f2fa2afe61?w=400&q=80',
|
|
||||||
tag: '人气TOP',
|
|
||||||
tagType: 'hot',
|
|
||||||
name: '力量进阶训练',
|
|
||||||
duration: '45分钟',
|
|
||||||
level: '高级',
|
|
||||||
participants: '6231'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
image: 'https://images.unsplash.com/photo-1544367567-0f2fcb009e0b?w=400&q=80',
|
|
||||||
tag: '新课上线',
|
|
||||||
tagType: 'new',
|
|
||||||
name: '瑜伽·身心平衡',
|
|
||||||
duration: '60分钟',
|
|
||||||
level: '初级',
|
|
||||||
participants: '3210'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss">
|
|
||||||
/* 推荐课程容器样式 */
|
|
||||||
.recommend-courses {
|
|
||||||
padding: 0 24rpx;
|
|
||||||
margin-bottom: 32rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 区域标题栏样式 */
|
|
||||||
.section-header {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
margin-bottom: 24rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 区域标题样式 */
|
|
||||||
.section-title {
|
|
||||||
font-size: 34rpx;
|
|
||||||
font-weight: 700;
|
|
||||||
color: #1a202c;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 查看更多按钮样式 */
|
|
||||||
.view-more {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 4rpx;
|
|
||||||
font-size: 26rpx;
|
|
||||||
color: #94a3b8;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 箭头图标样式 */
|
|
||||||
.arrow {
|
|
||||||
font-size: 32rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 课程横向滚动容器样式 */
|
|
||||||
.courses-scroll {
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 课程列表样式 */
|
|
||||||
.courses-list {
|
|
||||||
display: inline-flex;
|
|
||||||
gap: 48rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 课程卡片样式 */
|
|
||||||
.course-card {
|
|
||||||
width: 320rpx;
|
|
||||||
background: #ffffff;
|
|
||||||
border-radius: 24rpx;
|
|
||||||
overflow: hidden;
|
|
||||||
box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.08);
|
|
||||||
display: inline-block;
|
|
||||||
vertical-align: top;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 课程图片区域样式 */
|
|
||||||
.course-image {
|
|
||||||
height: 280rpx;
|
|
||||||
position: relative;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
justify-content: flex-end;
|
|
||||||
padding: 20rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 课程封面图片样式 */
|
|
||||||
.img {
|
|
||||||
position: absolute;
|
|
||||||
left: 0;
|
|
||||||
top: 0;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 图片渐变遮罩样式 */
|
|
||||||
.course-overlay {
|
|
||||||
position: absolute;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
top: 0;
|
|
||||||
bottom: 0;
|
|
||||||
background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 60%);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 课程标签样式 */
|
|
||||||
.course-tag {
|
|
||||||
position: absolute;
|
|
||||||
top: 16rpx;
|
|
||||||
right: 16rpx;
|
|
||||||
padding: 8rpx 16rpx;
|
|
||||||
border-radius: 12rpx;
|
|
||||||
font-size: 20rpx;
|
|
||||||
font-weight: 600;
|
|
||||||
color: #ffffff;
|
|
||||||
background: #f97316;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 课程信息区域样式 */
|
|
||||||
.course-info {
|
|
||||||
position: relative;
|
|
||||||
z-index: 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 课程名称样式 */
|
|
||||||
.course-name {
|
|
||||||
display: block;
|
|
||||||
font-size: 28rpx;
|
|
||||||
font-weight: 600;
|
|
||||||
color: #ffffff;
|
|
||||||
margin-bottom: 8rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 课程元信息容器样式 */
|
|
||||||
.course-meta {
|
|
||||||
display: flex;
|
|
||||||
gap: 16rpx;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 课程元信息项样式 */
|
|
||||||
.meta-item {
|
|
||||||
display: flex;
|
|
||||||
align-items: end;
|
|
||||||
gap: 6rpx;
|
|
||||||
font-size: 22rpx;
|
|
||||||
color: rgba(255, 255, 255, 0.8);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 元信息图标样式 */
|
|
||||||
.meta-icon {
|
|
||||||
font-size: 20rpx;
|
|
||||||
image{
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
width: 25rpx;
|
|
||||||
height: 25rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 课程底部区域样式 */
|
|
||||||
.course-footer {
|
|
||||||
padding: 16rpx 10rpx;
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 参与人数信息样式 */
|
|
||||||
.participants {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 6rpx;
|
|
||||||
font-size: 22rpx;
|
|
||||||
color: #94a3b8;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 火热图标样式 */
|
|
||||||
.fire-icon {
|
|
||||||
font-size: 24rpx;
|
|
||||||
image{
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
width: 30rpx;
|
|
||||||
height: 30rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 去参与按钮样式 */
|
|
||||||
.join-btn {
|
|
||||||
padding: 12rpx 28rpx;
|
|
||||||
background: transparent;
|
|
||||||
border: 2rpx solid #f97316;
|
|
||||||
border-radius: 9999rpx;
|
|
||||||
font-size: 22rpx;
|
|
||||||
font-weight: 600;
|
|
||||||
color: #f97316;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,213 +0,0 @@
|
|||||||
<template>
|
|
||||||
<!-- 今日推荐容器 -->
|
|
||||||
<view class="today-recommend">
|
|
||||||
<!-- 区域标题栏 -->
|
|
||||||
<view class="section-header">
|
|
||||||
<!-- 区域标题 -->
|
|
||||||
<text class="section-title">今日推荐</text>
|
|
||||||
<!-- 查看更多按钮 -->
|
|
||||||
<view class="view-more">
|
|
||||||
<text>查看更多</text>
|
|
||||||
<text class="arrow">
|
|
||||||
<uni-icons type="right" size="20" color="#94a3b8"></uni-icons>
|
|
||||||
</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<!-- 推荐列表 -->
|
|
||||||
<view class="recommend-list">
|
|
||||||
<!-- 推荐项 -->
|
|
||||||
<view
|
|
||||||
v-for="(item, index) in recommends"
|
|
||||||
:key="index"
|
|
||||||
class="recommend-item"
|
|
||||||
>
|
|
||||||
<!-- 推荐项图片 -->
|
|
||||||
<image :src="item.image" mode="aspectFill" class="item-image" />
|
|
||||||
<!-- 推荐项内容区域 -->
|
|
||||||
<view class="item-content">
|
|
||||||
<!-- 推荐项标题 -->
|
|
||||||
<text class="item-title">{{ item.title }}</text>
|
|
||||||
<!-- 推荐项标签列表 -->
|
|
||||||
<view class="item-tags">
|
|
||||||
<text v-for="(tag, tagIndex) in item.tags" :key="tagIndex" class="tag">{{ tag }}</text>
|
|
||||||
</view>
|
|
||||||
<!-- 推荐项描述 -->
|
|
||||||
<text class="item-desc">{{ item.desc }}</text>
|
|
||||||
</view>
|
|
||||||
<!-- 推荐项操作区域 -->
|
|
||||||
<view class="item-action">
|
|
||||||
<!-- 开始训练按钮 -->
|
|
||||||
<view class="start-btn">
|
|
||||||
<text class="start-btn-text">开始训练</text>
|
|
||||||
</view>
|
|
||||||
<!-- 参与人数 -->
|
|
||||||
<text class="participants">{{ item.participants }}人参与</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup>
|
|
||||||
// 今日推荐数据列表
|
|
||||||
const recommends = [
|
|
||||||
{
|
|
||||||
image: 'https://images.unsplash.com/photo-1571019613454-1cb2f99b2d8b?w=300&q=80',
|
|
||||||
title: '晨间活力唤醒跑',
|
|
||||||
tags: ['20分钟', '初级'],
|
|
||||||
desc: '唤醒身体,开启活力一天',
|
|
||||||
participants: '2784'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
image: 'https://images.unsplash.com/photo-1581009146145-b5ef050c149a?w=300&q=80',
|
|
||||||
title: '全身力量塑形',
|
|
||||||
tags: ['50分钟', '中级'],
|
|
||||||
desc: '全身综合训练,塑造完美线条',
|
|
||||||
participants: '4126'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
image: 'https://images.unsplash.com/photo-1490645935967-10de6ba17061?w=300&q=80',
|
|
||||||
title: '蛋白增肌饮食指南',
|
|
||||||
tags: ['营养饮食', '12分钟'],
|
|
||||||
desc: '科学饮食搭配,助力肌肉增长',
|
|
||||||
participants: '1865'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
/* 今日推荐容器样式 */
|
|
||||||
.today-recommend {
|
|
||||||
padding: 0 24rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 区域标题栏样式 */
|
|
||||||
.section-header {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
margin-bottom: 24rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 区域标题样式 */
|
|
||||||
.section-title {
|
|
||||||
font-size: 34rpx;
|
|
||||||
font-weight: 700;
|
|
||||||
color: #1a202c;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 查看更多按钮样式 */
|
|
||||||
.view-more {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 4rpx;
|
|
||||||
font-size: 26rpx;
|
|
||||||
color: #94a3b8;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 箭头图标样式 */
|
|
||||||
.arrow {
|
|
||||||
font-size: 32rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 推荐列表样式 */
|
|
||||||
.recommend-list {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: 24rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 推荐项卡片样式 */
|
|
||||||
.recommend-item {
|
|
||||||
display: flex;
|
|
||||||
gap: 24rpx;
|
|
||||||
background: #ffffff;
|
|
||||||
border-radius: 24rpx;
|
|
||||||
padding: 20rpx;
|
|
||||||
box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.08);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 推荐项图片样式 */
|
|
||||||
.item-image {
|
|
||||||
width: 200rpx;
|
|
||||||
height: 160rpx;
|
|
||||||
border-radius: 16rpx;
|
|
||||||
flex-shrink: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 推荐项内容区域样式 */
|
|
||||||
.item-content {
|
|
||||||
flex: 1;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
justify-content: center;
|
|
||||||
min-width: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 推荐项标题样式 */
|
|
||||||
.item-title {
|
|
||||||
font-size: 30rpx;
|
|
||||||
font-weight: 600;
|
|
||||||
color: #1a202c;
|
|
||||||
margin-bottom: 12rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 推荐项标签列表样式 */
|
|
||||||
.item-tags {
|
|
||||||
display: flex;
|
|
||||||
gap: 12rpx;
|
|
||||||
margin-bottom: 12rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 推荐项标签样式 */
|
|
||||||
.tag {
|
|
||||||
padding: 6rpx 16rpx;
|
|
||||||
background: #f1f5f9;
|
|
||||||
border-radius: 8rpx;
|
|
||||||
font-size: 22rpx;
|
|
||||||
color: #64748b;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 推荐项描述文字样式 */
|
|
||||||
.item-desc {
|
|
||||||
font-size: 24rpx;
|
|
||||||
color: #94a3b8;
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 推荐项操作区域样式 */
|
|
||||||
.item-action {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: flex-end;
|
|
||||||
justify-content: center;
|
|
||||||
gap: 16rpx;
|
|
||||||
flex-shrink: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 开始训练按钮样式 */
|
|
||||||
.start-btn {
|
|
||||||
padding: 16rpx 28rpx;
|
|
||||||
background: linear-gradient(135deg, #f97316 0%, #fb923c 100%);
|
|
||||||
border-radius: 9999rpx;
|
|
||||||
box-shadow: 0 4rpx 16rpx rgba(249, 115, 22, 0.4);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 开始训练按钮文字样式 */
|
|
||||||
.start-btn-text {
|
|
||||||
font-size: 24rpx;
|
|
||||||
font-weight: 600;
|
|
||||||
color: #ffffff;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 参与人数文字样式 */
|
|
||||||
.participants {
|
|
||||||
font-size: 22rpx;
|
|
||||||
color: #94a3b8;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,570 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="zh-CN">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, viewport-fit=cover">
|
|
||||||
<title>健身房管理系统 | 动感配色方案</title>
|
|
||||||
<!-- 引入Font Awesome 6 (免费图标库,增强视觉) -->
|
|
||||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
|
|
||||||
<style>
|
|
||||||
* {
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
box-sizing: border-box;
|
|
||||||
-webkit-tap-highlight-color: transparent;
|
|
||||||
}
|
|
||||||
|
|
||||||
body {
|
|
||||||
background: #F5F7FC; /* 整体背景柔和灰白,衬托主色 */
|
|
||||||
font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
|
|
||||||
padding: 24px 20px 48px;
|
|
||||||
color: #1E2A3A;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 主色调变量定义 – 活力运动风格
|
|
||||||
主色: 动感深蓝 (#0B2B4B) – 权威、专业、沉稳
|
|
||||||
辅色: 活力橙 (#FF6B35) – 热情、能量、行动召唤
|
|
||||||
背景浅色: #F9FAFE, 卡片白, 强调蓝绿渐变点缀
|
|
||||||
*/
|
|
||||||
:root {
|
|
||||||
--primary-dark: #0B2B4B; /* 深蓝主色,用于头部、重要按钮、边框强调 */
|
|
||||||
--primary-deep: #1A4A6F; /* 中深蓝,用于hover、次级强调 */
|
|
||||||
--accent-orange: #FF6B35; /* 活力橙,CTA、会员卡片、高亮标签 */
|
|
||||||
--accent-orange-light: #FF8C5A;
|
|
||||||
--bg-light: #F9FAFE;
|
|
||||||
--card-white: #FFFFFF;
|
|
||||||
--text-dark: #1E2A3A;
|
|
||||||
--text-muted: #5E6F8D;
|
|
||||||
--border-light: #E9EDF2;
|
|
||||||
--success-green: #2ECC71;
|
|
||||||
--warning-amber: #F39C12;
|
|
||||||
--shadow-sm: 0 8px 20px rgba(0, 0, 0, 0.03), 0 2px 6px rgba(0, 0, 0, 0.05);
|
|
||||||
--shadow-md: 0 12px 28px rgba(0, 0, 0, 0.08);
|
|
||||||
--gradient-orange: linear-gradient(135deg, #FF6B35 0%, #FF8C5A 100%);
|
|
||||||
--gradient-blue: linear-gradient(135deg, #0B2B4B 0%, #1A4A6F 100%);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 整体容器 */
|
|
||||||
.demo-container {
|
|
||||||
max-width: 450px;
|
|
||||||
margin: 0 auto;
|
|
||||||
background: var(--bg-light);
|
|
||||||
border-radius: 36px;
|
|
||||||
box-shadow: var(--shadow-md);
|
|
||||||
overflow: hidden;
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 状态栏模拟 (小程序顶部风格) */
|
|
||||||
.status-bar {
|
|
||||||
background: var(--primary-dark);
|
|
||||||
padding: 12px 20px 6px;
|
|
||||||
color: white;
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
font-size: 14px;
|
|
||||||
font-weight: 500;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 主头部导航 */
|
|
||||||
.main-header {
|
|
||||||
background: var(--primary-dark);
|
|
||||||
padding: 12px 20px 20px;
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
|
|
||||||
.header-top {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: baseline;
|
|
||||||
margin-bottom: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.logo-area h2 {
|
|
||||||
font-size: 1.6rem;
|
|
||||||
font-weight: 700;
|
|
||||||
letter-spacing: -0.3px;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 6px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.logo-area h2 i {
|
|
||||||
color: var(--accent-orange);
|
|
||||||
font-size: 1.7rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.logo-area p {
|
|
||||||
font-size: 0.7rem;
|
|
||||||
opacity: 0.8;
|
|
||||||
letter-spacing: 0.5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.header-actions i {
|
|
||||||
font-size: 1.4rem;
|
|
||||||
background: rgba(255,255,255,0.15);
|
|
||||||
padding: 8px;
|
|
||||||
border-radius: 30px;
|
|
||||||
margin-left: 8px;
|
|
||||||
cursor: default;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 欢迎卡片 + 活力橙强调 */
|
|
||||||
.welcome-card {
|
|
||||||
background: white;
|
|
||||||
border-radius: 28px;
|
|
||||||
padding: 18px 20px;
|
|
||||||
margin-top: 12px;
|
|
||||||
box-shadow: var(--shadow-sm);
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.welcome-text h4 {
|
|
||||||
font-size: 1rem;
|
|
||||||
color: var(--text-muted);
|
|
||||||
font-weight: 500;
|
|
||||||
}
|
|
||||||
|
|
||||||
.welcome-text h3 {
|
|
||||||
font-size: 1.4rem;
|
|
||||||
margin-top: 4px;
|
|
||||||
color: var(--primary-dark);
|
|
||||||
}
|
|
||||||
|
|
||||||
.badge-member {
|
|
||||||
background: var(--gradient-orange);
|
|
||||||
padding: 8px 16px;
|
|
||||||
border-radius: 40px;
|
|
||||||
color: white;
|
|
||||||
font-weight: 600;
|
|
||||||
font-size: 0.8rem;
|
|
||||||
box-shadow: 0 4px 8px rgba(255,107,53,0.2);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 主要指标卡片区 */
|
|
||||||
.stats-grid {
|
|
||||||
display: flex;
|
|
||||||
gap: 12px;
|
|
||||||
padding: 20px;
|
|
||||||
background: var(--bg-light);
|
|
||||||
}
|
|
||||||
|
|
||||||
.stat-card {
|
|
||||||
background: var(--card-white);
|
|
||||||
flex: 1;
|
|
||||||
border-radius: 24px;
|
|
||||||
padding: 14px 0;
|
|
||||||
text-align: center;
|
|
||||||
box-shadow: var(--shadow-sm);
|
|
||||||
transition: all 0.2s;
|
|
||||||
border: 1px solid var(--border-light);
|
|
||||||
}
|
|
||||||
|
|
||||||
.stat-card i {
|
|
||||||
font-size: 1.8rem;
|
|
||||||
color: var(--accent-orange);
|
|
||||||
margin-bottom: 6px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.stat-number {
|
|
||||||
font-size: 1.6rem;
|
|
||||||
font-weight: 800;
|
|
||||||
color: var(--primary-dark);
|
|
||||||
}
|
|
||||||
|
|
||||||
.stat-label {
|
|
||||||
font-size: 0.7rem;
|
|
||||||
color: var(--text-muted);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 功能菜单 grid */
|
|
||||||
.menu-grid {
|
|
||||||
display: grid;
|
|
||||||
grid-template-columns: repeat(4, 1fr);
|
|
||||||
gap: 12px;
|
|
||||||
padding: 8px 20px 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.menu-item {
|
|
||||||
background: var(--card-white);
|
|
||||||
border-radius: 20px;
|
|
||||||
padding: 12px 6px;
|
|
||||||
text-align: center;
|
|
||||||
transition: all 0.2s ease;
|
|
||||||
border: 1px solid var(--border-light);
|
|
||||||
cursor: default;
|
|
||||||
}
|
|
||||||
|
|
||||||
.menu-item i {
|
|
||||||
font-size: 1.8rem;
|
|
||||||
color: var(--primary-deep);
|
|
||||||
margin-bottom: 6px;
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
|
|
||||||
.menu-item span {
|
|
||||||
font-size: 0.7rem;
|
|
||||||
font-weight: 500;
|
|
||||||
color: var(--text-dark);
|
|
||||||
}
|
|
||||||
|
|
||||||
.menu-item:active {
|
|
||||||
transform: scale(0.96);
|
|
||||||
background: #FEF5F0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 课程/热门活动区域 */
|
|
||||||
.section-title {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
padding: 8px 20px 4px;
|
|
||||||
align-items: baseline;
|
|
||||||
}
|
|
||||||
|
|
||||||
.section-title h3 {
|
|
||||||
font-size: 1.2rem;
|
|
||||||
font-weight: 700;
|
|
||||||
color: var(--primary-dark);
|
|
||||||
}
|
|
||||||
|
|
||||||
.section-title a {
|
|
||||||
font-size: 0.75rem;
|
|
||||||
color: var(--accent-orange);
|
|
||||||
font-weight: 600;
|
|
||||||
}
|
|
||||||
|
|
||||||
.class-list {
|
|
||||||
padding: 8px 20px 20px;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.class-card {
|
|
||||||
background: white;
|
|
||||||
border-radius: 20px;
|
|
||||||
padding: 12px 16px;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 14px;
|
|
||||||
box-shadow: var(--shadow-sm);
|
|
||||||
border-left: 5px solid var(--accent-orange);
|
|
||||||
transition: all 0.2s;
|
|
||||||
}
|
|
||||||
|
|
||||||
.class-icon {
|
|
||||||
width: 48px;
|
|
||||||
height: 48px;
|
|
||||||
background: rgba(255,107,53,0.1);
|
|
||||||
border-radius: 30px;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.class-icon i {
|
|
||||||
font-size: 1.8rem;
|
|
||||||
color: var(--accent-orange);
|
|
||||||
}
|
|
||||||
|
|
||||||
.class-info {
|
|
||||||
flex: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.class-info h4 {
|
|
||||||
font-size: 1rem;
|
|
||||||
font-weight: 700;
|
|
||||||
}
|
|
||||||
|
|
||||||
.class-info p {
|
|
||||||
font-size: 0.7rem;
|
|
||||||
color: var(--text-muted);
|
|
||||||
margin-top: 4px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.class-time {
|
|
||||||
font-size: 0.75rem;
|
|
||||||
background: #F0F3F9;
|
|
||||||
padding: 4px 10px;
|
|
||||||
border-radius: 40px;
|
|
||||||
font-weight: 600;
|
|
||||||
color: var(--primary-deep);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 底部导航栏 (Tab Bar 模拟) */
|
|
||||||
.bottom-tab {
|
|
||||||
background: white;
|
|
||||||
backdrop-filter: blur(0px);
|
|
||||||
border-top: 1px solid var(--border-light);
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-around;
|
|
||||||
padding: 10px 20px 22px;
|
|
||||||
border-radius: 0 0 36px 36px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tab-item {
|
|
||||||
text-align: center;
|
|
||||||
color: var(--text-muted);
|
|
||||||
transition: 0.1s;
|
|
||||||
cursor: default;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tab-item i {
|
|
||||||
font-size: 1.5rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tab-item span {
|
|
||||||
font-size: 0.7rem;
|
|
||||||
display: block;
|
|
||||||
margin-top: 4px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tab-item.active {
|
|
||||||
color: var(--accent-orange);
|
|
||||||
font-weight: 600;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 教练推荐卡片额外装饰 */
|
|
||||||
.trainer-spot {
|
|
||||||
background: var(--gradient-blue);
|
|
||||||
margin: 0 20px 20px;
|
|
||||||
border-radius: 28px;
|
|
||||||
padding: 16px 18px;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: space-between;
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
|
|
||||||
.trainer-info h4 {
|
|
||||||
font-size: 0.9rem;
|
|
||||||
opacity: 0.9;
|
|
||||||
}
|
|
||||||
|
|
||||||
.trainer-info h3 {
|
|
||||||
font-size: 1.1rem;
|
|
||||||
font-weight: 700;
|
|
||||||
}
|
|
||||||
|
|
||||||
.trainer-btn {
|
|
||||||
background: var(--accent-orange);
|
|
||||||
border: none;
|
|
||||||
padding: 8px 18px;
|
|
||||||
border-radius: 50px;
|
|
||||||
color: white;
|
|
||||||
font-weight: 600;
|
|
||||||
font-size: 0.8rem;
|
|
||||||
cursor: default;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 配色展示条 / 设计说明 */
|
|
||||||
.color-palette-show {
|
|
||||||
max-width: 450px;
|
|
||||||
margin: 28px auto 0;
|
|
||||||
background: white;
|
|
||||||
border-radius: 32px;
|
|
||||||
padding: 18px 20px;
|
|
||||||
box-shadow: var(--shadow-sm);
|
|
||||||
}
|
|
||||||
|
|
||||||
.color-title {
|
|
||||||
font-weight: 700;
|
|
||||||
margin-bottom: 12px;
|
|
||||||
color: var(--primary-dark);
|
|
||||||
font-size: 1rem;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.color-swatches {
|
|
||||||
display: flex;
|
|
||||||
gap: 16px;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
.swatch {
|
|
||||||
flex: 1;
|
|
||||||
min-width: 70px;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.swatch-circle {
|
|
||||||
height: 50px;
|
|
||||||
border-radius: 16px;
|
|
||||||
margin-bottom: 8px;
|
|
||||||
box-shadow: 0 2px 6px rgba(0,0,0,0.05);
|
|
||||||
}
|
|
||||||
|
|
||||||
.swatch span {
|
|
||||||
font-size: 0.7rem;
|
|
||||||
font-weight: 500;
|
|
||||||
color: var(--text-dark);
|
|
||||||
}
|
|
||||||
|
|
||||||
hr {
|
|
||||||
margin: 20px 0 8px;
|
|
||||||
border: none;
|
|
||||||
height: 1px;
|
|
||||||
background: var(--border-light);
|
|
||||||
}
|
|
||||||
|
|
||||||
.note {
|
|
||||||
font-size: 0.7rem;
|
|
||||||
color: var(--text-muted);
|
|
||||||
text-align: center;
|
|
||||||
margin-top: 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
i, .tab-item, .menu-item, .stat-card {
|
|
||||||
cursor: default;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div class="demo-container">
|
|
||||||
<!-- 模拟小程序状态栏/胶囊区 -->
|
|
||||||
<div class="status-bar">
|
|
||||||
<span>9:41</span>
|
|
||||||
<span><i class="fas fa-signal"></i> <i class="fas fa-battery-full"></i></span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 主头部深蓝区 -->
|
|
||||||
<div class="main-header">
|
|
||||||
<div class="header-top">
|
|
||||||
<div class="logo-area">
|
|
||||||
<h2><i class="fas fa-dumbbell"></i> IRONPULSE</h2>
|
|
||||||
<p>智能健身 · 即刻燃动</p>
|
|
||||||
</div>
|
|
||||||
<div class="header-actions">
|
|
||||||
<i class="fas fa-bell"></i>
|
|
||||||
<i class="fas fa-user-circle"></i>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<!-- 用户欢迎卡片,橙色高亮会员 -->
|
|
||||||
<div class="welcome-card">
|
|
||||||
<div class="welcome-text">
|
|
||||||
<h4>欢迎回来,</h4>
|
|
||||||
<h3>张峻铭 <span style="font-size: 0.8rem;">💪</span></h3>
|
|
||||||
</div>
|
|
||||||
<div class="badge-member">MVP 黑金会员</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 关键指标 活力橙点缀 -->
|
|
||||||
<div class="stats-grid">
|
|
||||||
<div class="stat-card">
|
|
||||||
<i class="fas fa-fire"></i>
|
|
||||||
<div class="stat-number">1,280</div>
|
|
||||||
<div class="stat-label">今日卡路里</div>
|
|
||||||
</div>
|
|
||||||
<div class="stat-card">
|
|
||||||
<i class="fas fa-clock"></i>
|
|
||||||
<div class="stat-number">126</div>
|
|
||||||
<div class="stat-label">运动分钟</div>
|
|
||||||
</div>
|
|
||||||
<div class="stat-card">
|
|
||||||
<i class="fas fa-calendar-check"></i>
|
|
||||||
<div class="stat-number">12</div>
|
|
||||||
<div class="stat-label">本月课程</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 功能区 网格菜单(四大模块) -->
|
|
||||||
<div class="menu-grid">
|
|
||||||
<div class="menu-item"><i class="fas fa-qrcode"></i><span>签到</span></div>
|
|
||||||
<div class="menu-item"><i class="fas fa-chalkboard-user"></i><span>团课预约</span></div>
|
|
||||||
<div class="menu-item"><i class="fas fa-chart-line"></i><span>体测报告</span></div>
|
|
||||||
<div class="menu-item"><i class="fas fa-cog"></i><span>我的会籍</span></div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 热门课程板块 (动态橙边风格) -->
|
|
||||||
<div class="section-title">
|
|
||||||
<h3><i class="fas fa-heartbeat" style="color: var(--accent-orange); margin-right: 6px;"></i> 热门团课</h3>
|
|
||||||
<a href="#">查看全部 →</a>
|
|
||||||
</div>
|
|
||||||
<div class="class-list">
|
|
||||||
<div class="class-card">
|
|
||||||
<div class="class-icon"><i class="fas fa-bicycle"></i></div>
|
|
||||||
<div class="class-info">
|
|
||||||
<h4>极速燃脂 · 动感单车</h4>
|
|
||||||
<p>张教练 | 综合有氧</p>
|
|
||||||
</div>
|
|
||||||
<div class="class-time">19:30 满员</div>
|
|
||||||
</div>
|
|
||||||
<div class="class-card">
|
|
||||||
<div class="class-icon"><i class="fas fa-hand-fist"></i></div>
|
|
||||||
<div class="class-info">
|
|
||||||
<h4>搏击风暴 · 泰拳基础</h4>
|
|
||||||
<p>李娜 | 格斗区</p>
|
|
||||||
</div>
|
|
||||||
<div class="class-time">18:00 火热</div>
|
|
||||||
</div>
|
|
||||||
<div class="class-card">
|
|
||||||
<div class="class-icon"><i class="fas fa-person-walking"></i></div>
|
|
||||||
<div class="class-info">
|
|
||||||
<h4>普拉提核心唤醒</h4>
|
|
||||||
<p>Elena | 瑜伽室</p>
|
|
||||||
</div>
|
|
||||||
<div class="class-time">明早 09:30</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 教练推荐 使用深蓝渐变+橙色按钮 -->
|
|
||||||
<div class="trainer-spot">
|
|
||||||
<div class="trainer-info">
|
|
||||||
<h4>🌟 明星私教推荐</h4>
|
|
||||||
<h3>Alex 王 · 增肌塑形专家</h3>
|
|
||||||
<p style="font-size: 0.7rem; opacity:0.85;">剩余3个时段可约</p>
|
|
||||||
</div>
|
|
||||||
<div class="trainer-btn">立即预约</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 底部tab栏 当前选中“首页”凸显橙色-->
|
|
||||||
<div class="bottom-tab">
|
|
||||||
<div class="tab-item active"><i class="fas fa-home"></i><span>首页</span></div>
|
|
||||||
<div class="tab-item"><i class="fas fa-calendar-alt"></i><span>日程</span></div>
|
|
||||||
<div class="tab-item"><i class="fas fa-chart-simple"></i><span>数据</span></div>
|
|
||||||
<div class="tab-item"><i class="fas fa-user"></i><span>我的</span></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 配色方案展示区,直观看到颜色搭配,帮助设计决策 -->
|
|
||||||
<div class="color-palette-show">
|
|
||||||
<div class="color-title">
|
|
||||||
<i class="fas fa-palette" style="color: #FF6B35;"></i> 健身房管理系统 · 能量配色方案
|
|
||||||
</div>
|
|
||||||
<div class="color-swatches">
|
|
||||||
<div class="swatch">
|
|
||||||
<div class="swatch-circle" style="background: #0B2B4B;"></div>
|
|
||||||
<span>深蓝主色 #0B2B4B<br>专业信赖</span>
|
|
||||||
</div>
|
|
||||||
<div class="swatch">
|
|
||||||
<div class="swatch-circle" style="background: #FF6B35;"></div>
|
|
||||||
<span>活力橙 #FF6B35<br>行动/热情</span>
|
|
||||||
</div>
|
|
||||||
<div class="swatch">
|
|
||||||
<div class="swatch-circle" style="background: #1A4A6F;"></div>
|
|
||||||
<span>深邃辅助 #1A4A6F</span>
|
|
||||||
</div>
|
|
||||||
<div class="swatch">
|
|
||||||
<div class="swatch-circle" style="background: #F9FAFE; border:1px solid #E2E8F0;"></div>
|
|
||||||
<span>浅色背景 #F9FAFE</span>
|
|
||||||
</div>
|
|
||||||
<div class="swatch">
|
|
||||||
<div class="swatch-circle" style="background: #FFFFFF; border:1px solid #E2E8F0;"></div>
|
|
||||||
<span>卡片白 #FFFFFF</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<hr>
|
|
||||||
<div class="note">
|
|
||||||
<i class="fas fa-lightbulb" style="color: #FF6B35;"></i> 设计理念:深蓝色传递专业与稳定感,活力橙色提升运动热情与CTA转化。<br>
|
|
||||||
圆润卡片 + 强烈对比,适合健身管理小程序的年轻、力量与现代氛围。
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 额外注释:颜色可访问性强,橙蓝互补但明度舒适 -->
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="zh-CN">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8" />
|
|
||||||
<script>
|
|
||||||
var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') ||
|
|
||||||
CSS.supports('top: constant(a)'))
|
|
||||||
document.write(
|
|
||||||
'<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' +
|
|
||||||
(coverSupport ? ', viewport-fit=cover' : '') + '" />')
|
|
||||||
</script>
|
|
||||||
<title></title>
|
|
||||||
<!--preload-links-->
|
|
||||||
<!--app-context-->
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div id="app"><!--app-html--></div>
|
|
||||||
<script type="module" src="/main.js"></script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
import App from './App'
|
|
||||||
|
|
||||||
// #ifndef VUE3
|
|
||||||
import Vue from 'vue'
|
|
||||||
import './uni.promisify.adaptor'
|
|
||||||
Vue.config.productionTip = false
|
|
||||||
App.mpType = 'app'
|
|
||||||
const app = new Vue({
|
|
||||||
...App
|
|
||||||
})
|
|
||||||
app.$mount()
|
|
||||||
// #endif
|
|
||||||
|
|
||||||
// #ifdef VUE3
|
|
||||||
import { createSSRApp } from 'vue'
|
|
||||||
export function createApp() {
|
|
||||||
const app = createSSRApp(App)
|
|
||||||
return {
|
|
||||||
app
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// #endif
|
|
||||||
@@ -1,72 +1,64 @@
|
|||||||
{
|
{
|
||||||
"name" : "gym-manage-uniapp",
|
"name": "gym-manage-uniapp",
|
||||||
"appid" : "__UNI__1F1874C",
|
"appid": "",
|
||||||
"description" : "",
|
"description": "Gym Management System Mobile App",
|
||||||
"versionName" : "1.0.0",
|
"versionName": "1.0.0",
|
||||||
"versionCode" : "100",
|
"versionCode": "100",
|
||||||
"transformPx" : false,
|
"transformPx": false,
|
||||||
/* 5+App特有相关 */
|
"app-plus": {
|
||||||
"app-plus" : {
|
"usingComponents": true,
|
||||||
"usingComponents" : true,
|
"nvueStyleCompiler": "uni-app",
|
||||||
"nvueStyleCompiler" : "uni-app",
|
"compilerVersion": 3,
|
||||||
"compilerVersion" : 3,
|
"splashscreen": {
|
||||||
"splashscreen" : {
|
"alwaysShowBeforeRender": true,
|
||||||
"alwaysShowBeforeRender" : true,
|
"waiting": true,
|
||||||
"waiting" : true,
|
"autoclose": true,
|
||||||
"autoclose" : true,
|
"delay": 0
|
||||||
"delay" : 0
|
|
||||||
},
|
|
||||||
/* 模块配置 */
|
|
||||||
"modules" : {},
|
|
||||||
/* 应用发布信息 */
|
|
||||||
"distribute" : {
|
|
||||||
/* android打包配置 */
|
|
||||||
"android" : {
|
|
||||||
"permissions" : [
|
|
||||||
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
|
|
||||||
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
|
|
||||||
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
|
|
||||||
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
|
|
||||||
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
|
|
||||||
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
|
|
||||||
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
|
|
||||||
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
|
|
||||||
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
|
|
||||||
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
|
|
||||||
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
|
|
||||||
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
|
|
||||||
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
|
|
||||||
"<uses-feature android:name=\"android.hardware.camera\"/>",
|
|
||||||
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
/* ios打包配置 */
|
|
||||||
"ios" : {},
|
|
||||||
/* SDK配置 */
|
|
||||||
"sdkConfigs" : {}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
/* 快应用特有相关 */
|
"modules": {},
|
||||||
"quickapp" : {},
|
"distribute": {
|
||||||
/* 小程序特有相关 */
|
"android": {
|
||||||
"mp-weixin" : {
|
"permissions": [
|
||||||
"appid" : "wx8278fdbc9f158915",
|
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
|
||||||
"setting" : {
|
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
|
||||||
"urlCheck" : false
|
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
|
||||||
},
|
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
|
||||||
"usingComponents" : true
|
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
|
||||||
|
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
|
||||||
|
"<uses-feature android:name=\"android.hardware.camera\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"ios": {},
|
||||||
|
"sdkConfigs": {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"quickapp": {},
|
||||||
|
"mp-weixin": {
|
||||||
|
"appid": "",
|
||||||
|
"setting": {
|
||||||
|
"urlCheck": false
|
||||||
},
|
},
|
||||||
"mp-alipay" : {
|
"usingComponents": true
|
||||||
"usingComponents" : true
|
},
|
||||||
},
|
"mp-alipay": {
|
||||||
"mp-baidu" : {
|
"usingComponents": true
|
||||||
"usingComponents" : true
|
},
|
||||||
},
|
"mp-baidu": {
|
||||||
"mp-toutiao" : {
|
"usingComponents": true
|
||||||
"usingComponents" : true
|
},
|
||||||
},
|
"mp-toutiao": {
|
||||||
"uniStatistics" : {
|
"usingComponents": true
|
||||||
"enable" : false
|
},
|
||||||
},
|
"uniStatistics": {
|
||||||
"vueVersion" : "3"
|
"enable": false
|
||||||
|
},
|
||||||
|
"vueVersion": "3"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
{
|
||||||
|
"name": "gym-manage-uniapp",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"description": "Gym Management System Mobile App",
|
||||||
|
"main": "main.js",
|
||||||
|
"scripts": {
|
||||||
|
"dev:mp-weixin": "uni -p mp-weixin",
|
||||||
|
"build:mp-weixin": "uni build -p mp-weixin",
|
||||||
|
"dev:h5": "uni",
|
||||||
|
"build:h5": "uni build"
|
||||||
|
},
|
||||||
|
"keywords": [
|
||||||
|
"uniapp",
|
||||||
|
"gym",
|
||||||
|
"management"
|
||||||
|
],
|
||||||
|
"author": "Novalon",
|
||||||
|
"license": "MIT"
|
||||||
|
}
|
||||||
@@ -1,17 +1,28 @@
|
|||||||
{
|
{
|
||||||
"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
|
"pages": [
|
||||||
{
|
{
|
||||||
"path": "pages/index/index",
|
"path": "pages/index/index",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "健身房"
|
"navigationBarTitleText": "首页"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"globalStyle": {
|
"globalStyle": {
|
||||||
"navigationBarTextStyle": "black",
|
"navigationBarTextStyle": "black",
|
||||||
"navigationBarTitleText": "uni-app",
|
"navigationBarTitleText": "健身房管理系统",
|
||||||
"navigationBarBackgroundColor": "#F8F8F8",
|
"navigationBarBackgroundColor": "#F8F8F8",
|
||||||
"backgroundColor": "#F8F8F8"
|
"backgroundColor": "#F8F8F8"
|
||||||
},
|
},
|
||||||
"uniIdRouter": {}
|
"tabBar": {
|
||||||
|
"color": "#7A7E83",
|
||||||
|
"selectedColor": "#007AFF",
|
||||||
|
"borderStyle": "black",
|
||||||
|
"backgroundColor": "#F8F8F8",
|
||||||
|
"list": [
|
||||||
|
{
|
||||||
|
"pagePath": "pages/index/index",
|
||||||
|
"text": "首页"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,41 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view class="home-page">
|
|
||||||
<!-- Banner轮播 -->
|
|
||||||
<BannerSwiper />
|
|
||||||
|
|
||||||
<!-- 功能入口 -->
|
|
||||||
<QuickEntry />
|
|
||||||
|
|
||||||
<!-- 推荐课程 -->
|
|
||||||
<RecommendCourses />
|
|
||||||
|
|
||||||
<!-- 今日推荐 -->
|
|
||||||
<TodayRecommend />
|
|
||||||
|
|
||||||
<!-- 底部占位 -->
|
|
||||||
<view class="bottom-placeholder"></view>
|
|
||||||
|
|
||||||
<!-- 底部导航 -->
|
|
||||||
<TabBar />
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup>
|
|
||||||
import BannerSwiper from '@/components/index/BannerSwiper.vue'
|
|
||||||
import QuickEntry from '@/components/index/QuickEntry.vue'
|
|
||||||
import RecommendCourses from '@/components/index/RecommendCourses.vue'
|
|
||||||
import TodayRecommend from '@/components/index/TodayRecommend.vue'
|
|
||||||
import TabBar from '@/components/TabBar.vue'
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.home-page {
|
|
||||||
min-height: 100vh;
|
|
||||||
background-color: #f0f4f8;
|
|
||||||
padding-bottom: 160rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.bottom-placeholder {
|
|
||||||
height: 40rpx;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
<template>
|
||||||
|
<view class="container">
|
||||||
|
<text class="title">健身房管理系统</text>
|
||||||
|
<text class="subtitle">欢迎使用 UniApp 移动端</text>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
title: '健身房管理系统'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad() {
|
||||||
|
console.log('Index page loaded')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.container {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
padding: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title {
|
||||||
|
font-size: 24px;
|
||||||
|
font-weight: bold;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.subtitle {
|
||||||
|
font-size: 16px;
|
||||||
|
color: #666;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 3.9 KiB |
@@ -1,13 +0,0 @@
|
|||||||
uni.addInterceptor({
|
|
||||||
returnValue (res) {
|
|
||||||
if (!(!!res && (typeof res === "object" || typeof res === "function") && typeof res.then === "function")) {
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
res.then((res) => {
|
|
||||||
if (!res) return resolve(res)
|
|
||||||
return res[0] ? reject(res[0]) : resolve(res[1])
|
|
||||||
});
|
|
||||||
});
|
|
||||||
},
|
|
||||||
});
|
|
||||||
@@ -1,76 +0,0 @@
|
|||||||
/**
|
|
||||||
* 这里是uni-app内置的常用样式变量
|
|
||||||
*
|
|
||||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
|
||||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
|
||||||
*
|
|
||||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* 颜色变量 */
|
|
||||||
|
|
||||||
/* 行为相关颜色 */
|
|
||||||
$uni-color-primary: #007aff;
|
|
||||||
$uni-color-success: #4cd964;
|
|
||||||
$uni-color-warning: #f0ad4e;
|
|
||||||
$uni-color-error: #dd524d;
|
|
||||||
|
|
||||||
/* 文字基本颜色 */
|
|
||||||
$uni-text-color:#333;//基本色
|
|
||||||
$uni-text-color-inverse:#fff;//反色
|
|
||||||
$uni-text-color-grey:#999;//辅助灰色,如加载更多的提示信息
|
|
||||||
$uni-text-color-placeholder: #808080;
|
|
||||||
$uni-text-color-disable:#c0c0c0;
|
|
||||||
|
|
||||||
/* 背景颜色 */
|
|
||||||
$uni-bg-color:#ffffff;
|
|
||||||
$uni-bg-color-grey:#f8f8f8;
|
|
||||||
$uni-bg-color-hover:#f1f1f1;//点击状态颜色
|
|
||||||
$uni-bg-color-mask:rgba(0, 0, 0, 0.4);//遮罩颜色
|
|
||||||
|
|
||||||
/* 边框颜色 */
|
|
||||||
$uni-border-color:#c8c7cc;
|
|
||||||
|
|
||||||
/* 尺寸变量 */
|
|
||||||
|
|
||||||
/* 文字尺寸 */
|
|
||||||
$uni-font-size-sm:12px;
|
|
||||||
$uni-font-size-base:14px;
|
|
||||||
$uni-font-size-lg:16px;
|
|
||||||
|
|
||||||
/* 图片尺寸 */
|
|
||||||
$uni-img-size-sm:20px;
|
|
||||||
$uni-img-size-base:26px;
|
|
||||||
$uni-img-size-lg:40px;
|
|
||||||
|
|
||||||
/* Border Radius */
|
|
||||||
$uni-border-radius-sm: 2px;
|
|
||||||
$uni-border-radius-base: 3px;
|
|
||||||
$uni-border-radius-lg: 6px;
|
|
||||||
$uni-border-radius-circle: 50%;
|
|
||||||
|
|
||||||
/* 水平间距 */
|
|
||||||
$uni-spacing-row-sm: 5px;
|
|
||||||
$uni-spacing-row-base: 10px;
|
|
||||||
$uni-spacing-row-lg: 15px;
|
|
||||||
|
|
||||||
/* 垂直间距 */
|
|
||||||
$uni-spacing-col-sm: 4px;
|
|
||||||
$uni-spacing-col-base: 8px;
|
|
||||||
$uni-spacing-col-lg: 12px;
|
|
||||||
|
|
||||||
/* 透明度 */
|
|
||||||
$uni-opacity-disabled: 0.3; // 组件禁用态的透明度
|
|
||||||
|
|
||||||
/* 文章场景相关 */
|
|
||||||
$uni-color-title: #2C405A; // 文章标题颜色
|
|
||||||
$uni-font-size-title:20px;
|
|
||||||
$uni-color-subtitle: #555555; // 二级标题颜色
|
|
||||||
$uni-font-size-subtitle:26px;
|
|
||||||
$uni-color-paragraph: #3F536E; // 文章段落颜色
|
|
||||||
$uni-font-size-paragraph:15px;
|
|
||||||
@@ -1,44 +0,0 @@
|
|||||||
## 2.0.12(2025-08-26)
|
|
||||||
- 优化 uni-app x 下 size 类型问题
|
|
||||||
## 2.0.11(2025-08-18)
|
|
||||||
- 修复 图标点击事件返回
|
|
||||||
## 2.0.9(2024-01-12)
|
|
||||||
fix: 修复图标大小默认值错误的问题
|
|
||||||
## 2.0.8(2023-12-14)
|
|
||||||
- 修复 项目未使用 ts 情况下,打包报错的bug
|
|
||||||
## 2.0.7(2023-12-14)
|
|
||||||
- 修复 size 属性为 string 时,不加单位导致尺寸异常的bug
|
|
||||||
## 2.0.6(2023-12-11)
|
|
||||||
- 优化 兼容老版本icon类型,如 top ,bottom 等
|
|
||||||
## 2.0.5(2023-12-11)
|
|
||||||
- 优化 兼容老版本icon类型,如 top ,bottom 等
|
|
||||||
## 2.0.4(2023-12-06)
|
|
||||||
- 优化 uni-app x 下示例项目图标排序
|
|
||||||
## 2.0.3(2023-12-06)
|
|
||||||
- 修复 nvue下引入组件报错的bug
|
|
||||||
## 2.0.2(2023-12-05)
|
|
||||||
-优化 size 属性支持单位
|
|
||||||
## 2.0.1(2023-12-05)
|
|
||||||
- 新增 uni-app x 支持定义图标
|
|
||||||
## 1.3.5(2022-01-24)
|
|
||||||
- 优化 size 属性可以传入不带单位的字符串数值
|
|
||||||
## 1.3.4(2022-01-24)
|
|
||||||
- 优化 size 支持其他单位
|
|
||||||
## 1.3.3(2022-01-17)
|
|
||||||
- 修复 nvue 有些图标不显示的bug,兼容老版本图标
|
|
||||||
## 1.3.2(2021-12-01)
|
|
||||||
- 优化 示例可复制图标名称
|
|
||||||
## 1.3.1(2021-11-23)
|
|
||||||
- 优化 兼容旧组件 type 值
|
|
||||||
## 1.3.0(2021-11-19)
|
|
||||||
- 新增 更多图标
|
|
||||||
- 优化 自定义图标使用方式
|
|
||||||
- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource)
|
|
||||||
- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-icons](https://uniapp.dcloud.io/component/uniui/uni-icons)
|
|
||||||
## 1.1.7(2021-11-08)
|
|
||||||
## 1.2.0(2021-07-30)
|
|
||||||
- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
|
|
||||||
## 1.1.5(2021-05-12)
|
|
||||||
- 新增 组件示例地址
|
|
||||||
## 1.1.4(2021-02-05)
|
|
||||||
- 调整为uni_modules目录规范
|
|
||||||
@@ -1,91 +0,0 @@
|
|||||||
<template>
|
|
||||||
<text class="uni-icons" :style="styleObj">
|
|
||||||
<slot>{{unicode}}</slot>
|
|
||||||
</text>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import { fontData, IconsDataItem } from './uniicons_file'
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Icons 图标
|
|
||||||
* @description 用于展示 icon 图标
|
|
||||||
* @tutorial https://ext.dcloud.net.cn/plugin?id=28
|
|
||||||
* @property {Number} size 图标大小
|
|
||||||
* @property {String} type 图标图案,参考示例
|
|
||||||
* @property {String} color 图标颜色
|
|
||||||
* @property {String} customPrefix 自定义图标
|
|
||||||
* @event {Function} click 点击 Icon 触发事件
|
|
||||||
*/
|
|
||||||
export default {
|
|
||||||
name: "uni-icons",
|
|
||||||
props: {
|
|
||||||
type: {
|
|
||||||
type: String,
|
|
||||||
default: ''
|
|
||||||
},
|
|
||||||
color: {
|
|
||||||
type: String,
|
|
||||||
default: '#333333'
|
|
||||||
},
|
|
||||||
size: {
|
|
||||||
type: [Number, String],
|
|
||||||
default: 16
|
|
||||||
},
|
|
||||||
fontFamily: {
|
|
||||||
type: String,
|
|
||||||
default: ''
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {};
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
unicode() : string {
|
|
||||||
let codes = fontData.find((item : IconsDataItem) : boolean => { return item.font_class == this.type })
|
|
||||||
if (codes !== null) {
|
|
||||||
return codes.unicode
|
|
||||||
}
|
|
||||||
return ''
|
|
||||||
},
|
|
||||||
iconSize() : string {
|
|
||||||
const size = this.size
|
|
||||||
if (typeof size == 'string') {
|
|
||||||
const reg = /^[0-9]*$/g
|
|
||||||
return reg.test(size as string) ? '' + size + 'px' : '' + size;
|
|
||||||
// return '' + this.size
|
|
||||||
}
|
|
||||||
return this.getFontSize(size as number)
|
|
||||||
},
|
|
||||||
styleObj() : UTSJSONObject {
|
|
||||||
if (this.fontFamily !== '') {
|
|
||||||
return { color: this.color, fontSize: this.iconSize, fontFamily: this.fontFamily }
|
|
||||||
}
|
|
||||||
return { color: this.color, fontSize: this.iconSize }
|
|
||||||
}
|
|
||||||
},
|
|
||||||
created() { },
|
|
||||||
methods: {
|
|
||||||
/**
|
|
||||||
* 字体大小
|
|
||||||
*/
|
|
||||||
getFontSize(size : number) : string {
|
|
||||||
return size + 'px';
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
@font-face {
|
|
||||||
font-family: UniIconsFontFamily;
|
|
||||||
src: url('./uniicons.ttf');
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-icons {
|
|
||||||
font-family: UniIconsFontFamily;
|
|
||||||
font-size: 18px;
|
|
||||||
font-style: normal;
|
|
||||||
color: #333;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,110 +0,0 @@
|
|||||||
<template>
|
|
||||||
<!-- #ifdef APP-NVUE -->
|
|
||||||
<text :style="styleObj" class="uni-icons" @click="_onClick">{{unicode}}</text>
|
|
||||||
<!-- #endif -->
|
|
||||||
<!-- #ifndef APP-NVUE -->
|
|
||||||
<text :style="styleObj" class="uni-icons" :class="['uniui-'+type,customPrefix,customPrefix?type:'']" @click="_onClick">
|
|
||||||
<slot></slot>
|
|
||||||
</text>
|
|
||||||
<!-- #endif -->
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import { fontData } from './uniicons_file_vue.js';
|
|
||||||
|
|
||||||
const getVal = (val) => {
|
|
||||||
const reg = /^[0-9]*$/g
|
|
||||||
return (typeof val === 'number' || reg.test(val)) ? val + 'px' : val;
|
|
||||||
}
|
|
||||||
|
|
||||||
// #ifdef APP-NVUE
|
|
||||||
var domModule = weex.requireModule('dom');
|
|
||||||
import iconUrl from './uniicons.ttf'
|
|
||||||
domModule.addRule('fontFace', {
|
|
||||||
'fontFamily': "uniicons",
|
|
||||||
'src': "url('" + iconUrl + "')"
|
|
||||||
});
|
|
||||||
// #endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Icons 图标
|
|
||||||
* @description 用于展示 icons 图标
|
|
||||||
* @tutorial https://ext.dcloud.net.cn/plugin?id=28
|
|
||||||
* @property {Number} size 图标大小
|
|
||||||
* @property {String} type 图标图案,参考示例
|
|
||||||
* @property {String} color 图标颜色
|
|
||||||
* @property {String} customPrefix 自定义图标
|
|
||||||
* @event {Function} click 点击 Icon 触发事件
|
|
||||||
*/
|
|
||||||
export default {
|
|
||||||
name: 'UniIcons',
|
|
||||||
emits: ['click'],
|
|
||||||
props: {
|
|
||||||
type: {
|
|
||||||
type: String,
|
|
||||||
default: ''
|
|
||||||
},
|
|
||||||
color: {
|
|
||||||
type: String,
|
|
||||||
default: '#333333'
|
|
||||||
},
|
|
||||||
size: {
|
|
||||||
type: [Number, String],
|
|
||||||
default: 16
|
|
||||||
},
|
|
||||||
customPrefix: {
|
|
||||||
type: String,
|
|
||||||
default: ''
|
|
||||||
},
|
|
||||||
fontFamily: {
|
|
||||||
type: String,
|
|
||||||
default: ''
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
icons: fontData
|
|
||||||
}
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
unicode() {
|
|
||||||
let code = this.icons.find(v => v.font_class === this.type)
|
|
||||||
if (code) {
|
|
||||||
return code.unicode
|
|
||||||
}
|
|
||||||
return ''
|
|
||||||
},
|
|
||||||
iconSize() {
|
|
||||||
return getVal(this.size)
|
|
||||||
},
|
|
||||||
styleObj() {
|
|
||||||
if (this.fontFamily !== '') {
|
|
||||||
return `color: ${this.color}; font-size: ${this.iconSize}; font-family: ${this.fontFamily};`
|
|
||||||
}
|
|
||||||
return `color: ${this.color}; font-size: ${this.iconSize};`
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
_onClick(e) {
|
|
||||||
this.$emit('click', e)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss">
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
@import './uniicons.css';
|
|
||||||
|
|
||||||
@font-face {
|
|
||||||
font-family: uniicons;
|
|
||||||
src: url('./uniicons.ttf');
|
|
||||||
}
|
|
||||||
|
|
||||||
/* #endif */
|
|
||||||
.uni-icons {
|
|
||||||
font-family: uniicons;
|
|
||||||
text-decoration: none;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,664 +0,0 @@
|
|||||||
|
|
||||||
.uniui-cart-filled:before {
|
|
||||||
content: "\e6d0";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-gift-filled:before {
|
|
||||||
content: "\e6c4";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-color:before {
|
|
||||||
content: "\e6cf";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-wallet:before {
|
|
||||||
content: "\e6b1";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-settings-filled:before {
|
|
||||||
content: "\e6ce";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-auth-filled:before {
|
|
||||||
content: "\e6cc";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-shop-filled:before {
|
|
||||||
content: "\e6cd";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-staff-filled:before {
|
|
||||||
content: "\e6cb";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-vip-filled:before {
|
|
||||||
content: "\e6c6";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-plus-filled:before {
|
|
||||||
content: "\e6c7";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-folder-add-filled:before {
|
|
||||||
content: "\e6c8";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-color-filled:before {
|
|
||||||
content: "\e6c9";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-tune-filled:before {
|
|
||||||
content: "\e6ca";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-calendar-filled:before {
|
|
||||||
content: "\e6c0";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-notification-filled:before {
|
|
||||||
content: "\e6c1";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-wallet-filled:before {
|
|
||||||
content: "\e6c2";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-medal-filled:before {
|
|
||||||
content: "\e6c3";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-fire-filled:before {
|
|
||||||
content: "\e6c5";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-refreshempty:before {
|
|
||||||
content: "\e6bf";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-location-filled:before {
|
|
||||||
content: "\e6af";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-person-filled:before {
|
|
||||||
content: "\e69d";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-personadd-filled:before {
|
|
||||||
content: "\e698";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-arrowthinleft:before {
|
|
||||||
content: "\e6d2";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-arrowthinup:before {
|
|
||||||
content: "\e6d3";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-arrowthindown:before {
|
|
||||||
content: "\e6d4";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-back:before {
|
|
||||||
content: "\e6b9";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-forward:before {
|
|
||||||
content: "\e6ba";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-arrow-right:before {
|
|
||||||
content: "\e6bb";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-arrow-left:before {
|
|
||||||
content: "\e6bc";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-arrow-up:before {
|
|
||||||
content: "\e6bd";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-arrow-down:before {
|
|
||||||
content: "\e6be";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-arrowthinright:before {
|
|
||||||
content: "\e6d1";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-down:before {
|
|
||||||
content: "\e6b8";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-bottom:before {
|
|
||||||
content: "\e6b8";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-arrowright:before {
|
|
||||||
content: "\e6d5";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-right:before {
|
|
||||||
content: "\e6b5";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-up:before {
|
|
||||||
content: "\e6b6";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-top:before {
|
|
||||||
content: "\e6b6";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-left:before {
|
|
||||||
content: "\e6b7";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-arrowup:before {
|
|
||||||
content: "\e6d6";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-eye:before {
|
|
||||||
content: "\e651";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-eye-filled:before {
|
|
||||||
content: "\e66a";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-eye-slash:before {
|
|
||||||
content: "\e6b3";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-eye-slash-filled:before {
|
|
||||||
content: "\e6b4";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-info-filled:before {
|
|
||||||
content: "\e649";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-reload:before {
|
|
||||||
content: "\e6b2";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-micoff-filled:before {
|
|
||||||
content: "\e6b0";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-map-pin-ellipse:before {
|
|
||||||
content: "\e6ac";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-map-pin:before {
|
|
||||||
content: "\e6ad";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-location:before {
|
|
||||||
content: "\e6ae";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-starhalf:before {
|
|
||||||
content: "\e683";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-star:before {
|
|
||||||
content: "\e688";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-star-filled:before {
|
|
||||||
content: "\e68f";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-calendar:before {
|
|
||||||
content: "\e6a0";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-fire:before {
|
|
||||||
content: "\e6a1";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-medal:before {
|
|
||||||
content: "\e6a2";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-font:before {
|
|
||||||
content: "\e6a3";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-gift:before {
|
|
||||||
content: "\e6a4";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-link:before {
|
|
||||||
content: "\e6a5";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-notification:before {
|
|
||||||
content: "\e6a6";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-staff:before {
|
|
||||||
content: "\e6a7";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-vip:before {
|
|
||||||
content: "\e6a8";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-folder-add:before {
|
|
||||||
content: "\e6a9";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-tune:before {
|
|
||||||
content: "\e6aa";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-auth:before {
|
|
||||||
content: "\e6ab";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-person:before {
|
|
||||||
content: "\e699";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-email-filled:before {
|
|
||||||
content: "\e69a";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-phone-filled:before {
|
|
||||||
content: "\e69b";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-phone:before {
|
|
||||||
content: "\e69c";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-email:before {
|
|
||||||
content: "\e69e";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-personadd:before {
|
|
||||||
content: "\e69f";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-chatboxes-filled:before {
|
|
||||||
content: "\e692";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-contact:before {
|
|
||||||
content: "\e693";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-chatbubble-filled:before {
|
|
||||||
content: "\e694";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-contact-filled:before {
|
|
||||||
content: "\e695";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-chatboxes:before {
|
|
||||||
content: "\e696";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-chatbubble:before {
|
|
||||||
content: "\e697";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-upload-filled:before {
|
|
||||||
content: "\e68e";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-upload:before {
|
|
||||||
content: "\e690";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-weixin:before {
|
|
||||||
content: "\e691";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-compose:before {
|
|
||||||
content: "\e67f";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-qq:before {
|
|
||||||
content: "\e680";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-download-filled:before {
|
|
||||||
content: "\e681";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-pyq:before {
|
|
||||||
content: "\e682";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-sound:before {
|
|
||||||
content: "\e684";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-trash-filled:before {
|
|
||||||
content: "\e685";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-sound-filled:before {
|
|
||||||
content: "\e686";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-trash:before {
|
|
||||||
content: "\e687";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-videocam-filled:before {
|
|
||||||
content: "\e689";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-spinner-cycle:before {
|
|
||||||
content: "\e68a";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-weibo:before {
|
|
||||||
content: "\e68b";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-videocam:before {
|
|
||||||
content: "\e68c";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-download:before {
|
|
||||||
content: "\e68d";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-help:before {
|
|
||||||
content: "\e679";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-navigate-filled:before {
|
|
||||||
content: "\e67a";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-plusempty:before {
|
|
||||||
content: "\e67b";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-smallcircle:before {
|
|
||||||
content: "\e67c";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-minus-filled:before {
|
|
||||||
content: "\e67d";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-micoff:before {
|
|
||||||
content: "\e67e";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-closeempty:before {
|
|
||||||
content: "\e66c";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-clear:before {
|
|
||||||
content: "\e66d";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-navigate:before {
|
|
||||||
content: "\e66e";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-minus:before {
|
|
||||||
content: "\e66f";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-image:before {
|
|
||||||
content: "\e670";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-mic:before {
|
|
||||||
content: "\e671";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-paperplane:before {
|
|
||||||
content: "\e672";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-close:before {
|
|
||||||
content: "\e673";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-help-filled:before {
|
|
||||||
content: "\e674";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-paperplane-filled:before {
|
|
||||||
content: "\e675";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-plus:before {
|
|
||||||
content: "\e676";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-mic-filled:before {
|
|
||||||
content: "\e677";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-image-filled:before {
|
|
||||||
content: "\e678";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-locked-filled:before {
|
|
||||||
content: "\e668";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-info:before {
|
|
||||||
content: "\e669";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-locked:before {
|
|
||||||
content: "\e66b";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-camera-filled:before {
|
|
||||||
content: "\e658";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-chat-filled:before {
|
|
||||||
content: "\e659";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-camera:before {
|
|
||||||
content: "\e65a";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-circle:before {
|
|
||||||
content: "\e65b";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-checkmarkempty:before {
|
|
||||||
content: "\e65c";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-chat:before {
|
|
||||||
content: "\e65d";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-circle-filled:before {
|
|
||||||
content: "\e65e";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-flag:before {
|
|
||||||
content: "\e65f";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-flag-filled:before {
|
|
||||||
content: "\e660";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-gear-filled:before {
|
|
||||||
content: "\e661";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-home:before {
|
|
||||||
content: "\e662";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-home-filled:before {
|
|
||||||
content: "\e663";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-gear:before {
|
|
||||||
content: "\e664";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-smallcircle-filled:before {
|
|
||||||
content: "\e665";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-map-filled:before {
|
|
||||||
content: "\e666";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-map:before {
|
|
||||||
content: "\e667";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-refresh-filled:before {
|
|
||||||
content: "\e656";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-refresh:before {
|
|
||||||
content: "\e657";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-cloud-upload:before {
|
|
||||||
content: "\e645";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-cloud-download-filled:before {
|
|
||||||
content: "\e646";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-cloud-download:before {
|
|
||||||
content: "\e647";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-cloud-upload-filled:before {
|
|
||||||
content: "\e648";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-redo:before {
|
|
||||||
content: "\e64a";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-images-filled:before {
|
|
||||||
content: "\e64b";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-undo-filled:before {
|
|
||||||
content: "\e64c";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-more:before {
|
|
||||||
content: "\e64d";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-more-filled:before {
|
|
||||||
content: "\e64e";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-undo:before {
|
|
||||||
content: "\e64f";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-images:before {
|
|
||||||
content: "\e650";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-paperclip:before {
|
|
||||||
content: "\e652";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-settings:before {
|
|
||||||
content: "\e653";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-search:before {
|
|
||||||
content: "\e654";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-redo-filled:before {
|
|
||||||
content: "\e655";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-list:before {
|
|
||||||
content: "\e644";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-mail-open-filled:before {
|
|
||||||
content: "\e63a";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-hand-down-filled:before {
|
|
||||||
content: "\e63c";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-hand-down:before {
|
|
||||||
content: "\e63d";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-hand-up-filled:before {
|
|
||||||
content: "\e63e";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-hand-up:before {
|
|
||||||
content: "\e63f";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-heart-filled:before {
|
|
||||||
content: "\e641";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-mail-open:before {
|
|
||||||
content: "\e643";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-heart:before {
|
|
||||||
content: "\e639";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-loop:before {
|
|
||||||
content: "\e633";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-pulldown:before {
|
|
||||||
content: "\e632";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-scan:before {
|
|
||||||
content: "\e62a";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-bars:before {
|
|
||||||
content: "\e627";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-checkbox:before {
|
|
||||||
content: "\e62b";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-checkbox-filled:before {
|
|
||||||
content: "\e62c";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-shop:before {
|
|
||||||
content: "\e62f";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-headphones:before {
|
|
||||||
content: "\e630";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-cart:before {
|
|
||||||
content: "\e631";
|
|
||||||
}
|
|
||||||
Binary file not shown.
@@ -1,664 +0,0 @@
|
|||||||
|
|
||||||
export type IconsData = {
|
|
||||||
id : string
|
|
||||||
name : string
|
|
||||||
font_family : string
|
|
||||||
css_prefix_text : string
|
|
||||||
description : string
|
|
||||||
glyphs : Array<IconsDataItem>
|
|
||||||
}
|
|
||||||
|
|
||||||
export type IconsDataItem = {
|
|
||||||
font_class : string
|
|
||||||
unicode : string
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
export const fontData = [
|
|
||||||
{
|
|
||||||
"font_class": "arrow-down",
|
|
||||||
"unicode": "\ue6be"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "arrow-left",
|
|
||||||
"unicode": "\ue6bc"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "arrow-right",
|
|
||||||
"unicode": "\ue6bb"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "arrow-up",
|
|
||||||
"unicode": "\ue6bd"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "auth",
|
|
||||||
"unicode": "\ue6ab"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "auth-filled",
|
|
||||||
"unicode": "\ue6cc"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "back",
|
|
||||||
"unicode": "\ue6b9"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "bars",
|
|
||||||
"unicode": "\ue627"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "calendar",
|
|
||||||
"unicode": "\ue6a0"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "calendar-filled",
|
|
||||||
"unicode": "\ue6c0"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "camera",
|
|
||||||
"unicode": "\ue65a"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "camera-filled",
|
|
||||||
"unicode": "\ue658"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "cart",
|
|
||||||
"unicode": "\ue631"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "cart-filled",
|
|
||||||
"unicode": "\ue6d0"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "chat",
|
|
||||||
"unicode": "\ue65d"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "chat-filled",
|
|
||||||
"unicode": "\ue659"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "chatboxes",
|
|
||||||
"unicode": "\ue696"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "chatboxes-filled",
|
|
||||||
"unicode": "\ue692"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "chatbubble",
|
|
||||||
"unicode": "\ue697"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "chatbubble-filled",
|
|
||||||
"unicode": "\ue694"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "checkbox",
|
|
||||||
"unicode": "\ue62b"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "checkbox-filled",
|
|
||||||
"unicode": "\ue62c"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "checkmarkempty",
|
|
||||||
"unicode": "\ue65c"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "circle",
|
|
||||||
"unicode": "\ue65b"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "circle-filled",
|
|
||||||
"unicode": "\ue65e"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "clear",
|
|
||||||
"unicode": "\ue66d"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "close",
|
|
||||||
"unicode": "\ue673"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "closeempty",
|
|
||||||
"unicode": "\ue66c"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "cloud-download",
|
|
||||||
"unicode": "\ue647"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "cloud-download-filled",
|
|
||||||
"unicode": "\ue646"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "cloud-upload",
|
|
||||||
"unicode": "\ue645"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "cloud-upload-filled",
|
|
||||||
"unicode": "\ue648"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "color",
|
|
||||||
"unicode": "\ue6cf"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "color-filled",
|
|
||||||
"unicode": "\ue6c9"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "compose",
|
|
||||||
"unicode": "\ue67f"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "contact",
|
|
||||||
"unicode": "\ue693"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "contact-filled",
|
|
||||||
"unicode": "\ue695"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "down",
|
|
||||||
"unicode": "\ue6b8"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "bottom",
|
|
||||||
"unicode": "\ue6b8"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "download",
|
|
||||||
"unicode": "\ue68d"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "download-filled",
|
|
||||||
"unicode": "\ue681"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "email",
|
|
||||||
"unicode": "\ue69e"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "email-filled",
|
|
||||||
"unicode": "\ue69a"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "eye",
|
|
||||||
"unicode": "\ue651"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "eye-filled",
|
|
||||||
"unicode": "\ue66a"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "eye-slash",
|
|
||||||
"unicode": "\ue6b3"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "eye-slash-filled",
|
|
||||||
"unicode": "\ue6b4"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "fire",
|
|
||||||
"unicode": "\ue6a1"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "fire-filled",
|
|
||||||
"unicode": "\ue6c5"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "flag",
|
|
||||||
"unicode": "\ue65f"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "flag-filled",
|
|
||||||
"unicode": "\ue660"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "folder-add",
|
|
||||||
"unicode": "\ue6a9"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "folder-add-filled",
|
|
||||||
"unicode": "\ue6c8"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "font",
|
|
||||||
"unicode": "\ue6a3"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "forward",
|
|
||||||
"unicode": "\ue6ba"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "gear",
|
|
||||||
"unicode": "\ue664"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "gear-filled",
|
|
||||||
"unicode": "\ue661"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "gift",
|
|
||||||
"unicode": "\ue6a4"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "gift-filled",
|
|
||||||
"unicode": "\ue6c4"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "hand-down",
|
|
||||||
"unicode": "\ue63d"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "hand-down-filled",
|
|
||||||
"unicode": "\ue63c"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "hand-up",
|
|
||||||
"unicode": "\ue63f"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "hand-up-filled",
|
|
||||||
"unicode": "\ue63e"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "headphones",
|
|
||||||
"unicode": "\ue630"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "heart",
|
|
||||||
"unicode": "\ue639"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "heart-filled",
|
|
||||||
"unicode": "\ue641"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "help",
|
|
||||||
"unicode": "\ue679"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "help-filled",
|
|
||||||
"unicode": "\ue674"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "home",
|
|
||||||
"unicode": "\ue662"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "home-filled",
|
|
||||||
"unicode": "\ue663"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "image",
|
|
||||||
"unicode": "\ue670"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "image-filled",
|
|
||||||
"unicode": "\ue678"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "images",
|
|
||||||
"unicode": "\ue650"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "images-filled",
|
|
||||||
"unicode": "\ue64b"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "info",
|
|
||||||
"unicode": "\ue669"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "info-filled",
|
|
||||||
"unicode": "\ue649"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "left",
|
|
||||||
"unicode": "\ue6b7"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "link",
|
|
||||||
"unicode": "\ue6a5"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "list",
|
|
||||||
"unicode": "\ue644"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "location",
|
|
||||||
"unicode": "\ue6ae"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "location-filled",
|
|
||||||
"unicode": "\ue6af"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "locked",
|
|
||||||
"unicode": "\ue66b"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "locked-filled",
|
|
||||||
"unicode": "\ue668"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "loop",
|
|
||||||
"unicode": "\ue633"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "mail-open",
|
|
||||||
"unicode": "\ue643"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "mail-open-filled",
|
|
||||||
"unicode": "\ue63a"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "map",
|
|
||||||
"unicode": "\ue667"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "map-filled",
|
|
||||||
"unicode": "\ue666"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "map-pin",
|
|
||||||
"unicode": "\ue6ad"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "map-pin-ellipse",
|
|
||||||
"unicode": "\ue6ac"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "medal",
|
|
||||||
"unicode": "\ue6a2"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "medal-filled",
|
|
||||||
"unicode": "\ue6c3"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "mic",
|
|
||||||
"unicode": "\ue671"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "mic-filled",
|
|
||||||
"unicode": "\ue677"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "micoff",
|
|
||||||
"unicode": "\ue67e"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "micoff-filled",
|
|
||||||
"unicode": "\ue6b0"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "minus",
|
|
||||||
"unicode": "\ue66f"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "minus-filled",
|
|
||||||
"unicode": "\ue67d"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "more",
|
|
||||||
"unicode": "\ue64d"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "more-filled",
|
|
||||||
"unicode": "\ue64e"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "navigate",
|
|
||||||
"unicode": "\ue66e"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "navigate-filled",
|
|
||||||
"unicode": "\ue67a"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "notification",
|
|
||||||
"unicode": "\ue6a6"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "notification-filled",
|
|
||||||
"unicode": "\ue6c1"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "paperclip",
|
|
||||||
"unicode": "\ue652"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "paperplane",
|
|
||||||
"unicode": "\ue672"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "paperplane-filled",
|
|
||||||
"unicode": "\ue675"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "person",
|
|
||||||
"unicode": "\ue699"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "person-filled",
|
|
||||||
"unicode": "\ue69d"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "personadd",
|
|
||||||
"unicode": "\ue69f"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "personadd-filled",
|
|
||||||
"unicode": "\ue698"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "personadd-filled-copy",
|
|
||||||
"unicode": "\ue6d1"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "phone",
|
|
||||||
"unicode": "\ue69c"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "phone-filled",
|
|
||||||
"unicode": "\ue69b"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "plus",
|
|
||||||
"unicode": "\ue676"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "plus-filled",
|
|
||||||
"unicode": "\ue6c7"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "plusempty",
|
|
||||||
"unicode": "\ue67b"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "pulldown",
|
|
||||||
"unicode": "\ue632"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "pyq",
|
|
||||||
"unicode": "\ue682"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "qq",
|
|
||||||
"unicode": "\ue680"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "redo",
|
|
||||||
"unicode": "\ue64a"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "redo-filled",
|
|
||||||
"unicode": "\ue655"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "refresh",
|
|
||||||
"unicode": "\ue657"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "refresh-filled",
|
|
||||||
"unicode": "\ue656"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "refreshempty",
|
|
||||||
"unicode": "\ue6bf"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "reload",
|
|
||||||
"unicode": "\ue6b2"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "right",
|
|
||||||
"unicode": "\ue6b5"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "scan",
|
|
||||||
"unicode": "\ue62a"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "search",
|
|
||||||
"unicode": "\ue654"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "settings",
|
|
||||||
"unicode": "\ue653"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "settings-filled",
|
|
||||||
"unicode": "\ue6ce"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "shop",
|
|
||||||
"unicode": "\ue62f"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "shop-filled",
|
|
||||||
"unicode": "\ue6cd"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "smallcircle",
|
|
||||||
"unicode": "\ue67c"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "smallcircle-filled",
|
|
||||||
"unicode": "\ue665"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "sound",
|
|
||||||
"unicode": "\ue684"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "sound-filled",
|
|
||||||
"unicode": "\ue686"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "spinner-cycle",
|
|
||||||
"unicode": "\ue68a"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "staff",
|
|
||||||
"unicode": "\ue6a7"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "staff-filled",
|
|
||||||
"unicode": "\ue6cb"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "star",
|
|
||||||
"unicode": "\ue688"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "star-filled",
|
|
||||||
"unicode": "\ue68f"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "starhalf",
|
|
||||||
"unicode": "\ue683"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "trash",
|
|
||||||
"unicode": "\ue687"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "trash-filled",
|
|
||||||
"unicode": "\ue685"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "tune",
|
|
||||||
"unicode": "\ue6aa"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "tune-filled",
|
|
||||||
"unicode": "\ue6ca"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "undo",
|
|
||||||
"unicode": "\ue64f"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "undo-filled",
|
|
||||||
"unicode": "\ue64c"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "up",
|
|
||||||
"unicode": "\ue6b6"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "top",
|
|
||||||
"unicode": "\ue6b6"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "upload",
|
|
||||||
"unicode": "\ue690"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "upload-filled",
|
|
||||||
"unicode": "\ue68e"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "videocam",
|
|
||||||
"unicode": "\ue68c"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "videocam-filled",
|
|
||||||
"unicode": "\ue689"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "vip",
|
|
||||||
"unicode": "\ue6a8"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "vip-filled",
|
|
||||||
"unicode": "\ue6c6"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "wallet",
|
|
||||||
"unicode": "\ue6b1"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "wallet-filled",
|
|
||||||
"unicode": "\ue6c2"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "weibo",
|
|
||||||
"unicode": "\ue68b"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "weixin",
|
|
||||||
"unicode": "\ue691"
|
|
||||||
}
|
|
||||||
] as IconsDataItem[]
|
|
||||||
|
|
||||||
// export const fontData = JSON.parse<IconsDataItem>(fontDataJson)
|
|
||||||
@@ -1,649 +0,0 @@
|
|||||||
|
|
||||||
export const fontData = [
|
|
||||||
{
|
|
||||||
"font_class": "arrow-down",
|
|
||||||
"unicode": "\ue6be"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "arrow-left",
|
|
||||||
"unicode": "\ue6bc"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "arrow-right",
|
|
||||||
"unicode": "\ue6bb"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "arrow-up",
|
|
||||||
"unicode": "\ue6bd"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "auth",
|
|
||||||
"unicode": "\ue6ab"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "auth-filled",
|
|
||||||
"unicode": "\ue6cc"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "back",
|
|
||||||
"unicode": "\ue6b9"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "bars",
|
|
||||||
"unicode": "\ue627"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "calendar",
|
|
||||||
"unicode": "\ue6a0"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "calendar-filled",
|
|
||||||
"unicode": "\ue6c0"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "camera",
|
|
||||||
"unicode": "\ue65a"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "camera-filled",
|
|
||||||
"unicode": "\ue658"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "cart",
|
|
||||||
"unicode": "\ue631"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "cart-filled",
|
|
||||||
"unicode": "\ue6d0"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "chat",
|
|
||||||
"unicode": "\ue65d"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "chat-filled",
|
|
||||||
"unicode": "\ue659"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "chatboxes",
|
|
||||||
"unicode": "\ue696"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "chatboxes-filled",
|
|
||||||
"unicode": "\ue692"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "chatbubble",
|
|
||||||
"unicode": "\ue697"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "chatbubble-filled",
|
|
||||||
"unicode": "\ue694"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "checkbox",
|
|
||||||
"unicode": "\ue62b"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "checkbox-filled",
|
|
||||||
"unicode": "\ue62c"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "checkmarkempty",
|
|
||||||
"unicode": "\ue65c"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "circle",
|
|
||||||
"unicode": "\ue65b"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "circle-filled",
|
|
||||||
"unicode": "\ue65e"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "clear",
|
|
||||||
"unicode": "\ue66d"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "close",
|
|
||||||
"unicode": "\ue673"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "closeempty",
|
|
||||||
"unicode": "\ue66c"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "cloud-download",
|
|
||||||
"unicode": "\ue647"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "cloud-download-filled",
|
|
||||||
"unicode": "\ue646"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "cloud-upload",
|
|
||||||
"unicode": "\ue645"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "cloud-upload-filled",
|
|
||||||
"unicode": "\ue648"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "color",
|
|
||||||
"unicode": "\ue6cf"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "color-filled",
|
|
||||||
"unicode": "\ue6c9"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "compose",
|
|
||||||
"unicode": "\ue67f"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "contact",
|
|
||||||
"unicode": "\ue693"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "contact-filled",
|
|
||||||
"unicode": "\ue695"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "down",
|
|
||||||
"unicode": "\ue6b8"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "bottom",
|
|
||||||
"unicode": "\ue6b8"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "download",
|
|
||||||
"unicode": "\ue68d"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "download-filled",
|
|
||||||
"unicode": "\ue681"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "email",
|
|
||||||
"unicode": "\ue69e"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "email-filled",
|
|
||||||
"unicode": "\ue69a"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "eye",
|
|
||||||
"unicode": "\ue651"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "eye-filled",
|
|
||||||
"unicode": "\ue66a"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "eye-slash",
|
|
||||||
"unicode": "\ue6b3"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "eye-slash-filled",
|
|
||||||
"unicode": "\ue6b4"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "fire",
|
|
||||||
"unicode": "\ue6a1"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "fire-filled",
|
|
||||||
"unicode": "\ue6c5"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "flag",
|
|
||||||
"unicode": "\ue65f"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "flag-filled",
|
|
||||||
"unicode": "\ue660"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "folder-add",
|
|
||||||
"unicode": "\ue6a9"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "folder-add-filled",
|
|
||||||
"unicode": "\ue6c8"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "font",
|
|
||||||
"unicode": "\ue6a3"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "forward",
|
|
||||||
"unicode": "\ue6ba"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "gear",
|
|
||||||
"unicode": "\ue664"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "gear-filled",
|
|
||||||
"unicode": "\ue661"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "gift",
|
|
||||||
"unicode": "\ue6a4"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "gift-filled",
|
|
||||||
"unicode": "\ue6c4"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "hand-down",
|
|
||||||
"unicode": "\ue63d"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "hand-down-filled",
|
|
||||||
"unicode": "\ue63c"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "hand-up",
|
|
||||||
"unicode": "\ue63f"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "hand-up-filled",
|
|
||||||
"unicode": "\ue63e"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "headphones",
|
|
||||||
"unicode": "\ue630"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "heart",
|
|
||||||
"unicode": "\ue639"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "heart-filled",
|
|
||||||
"unicode": "\ue641"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "help",
|
|
||||||
"unicode": "\ue679"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "help-filled",
|
|
||||||
"unicode": "\ue674"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "home",
|
|
||||||
"unicode": "\ue662"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "home-filled",
|
|
||||||
"unicode": "\ue663"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "image",
|
|
||||||
"unicode": "\ue670"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "image-filled",
|
|
||||||
"unicode": "\ue678"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "images",
|
|
||||||
"unicode": "\ue650"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "images-filled",
|
|
||||||
"unicode": "\ue64b"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "info",
|
|
||||||
"unicode": "\ue669"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "info-filled",
|
|
||||||
"unicode": "\ue649"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "left",
|
|
||||||
"unicode": "\ue6b7"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "link",
|
|
||||||
"unicode": "\ue6a5"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "list",
|
|
||||||
"unicode": "\ue644"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "location",
|
|
||||||
"unicode": "\ue6ae"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "location-filled",
|
|
||||||
"unicode": "\ue6af"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "locked",
|
|
||||||
"unicode": "\ue66b"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "locked-filled",
|
|
||||||
"unicode": "\ue668"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "loop",
|
|
||||||
"unicode": "\ue633"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "mail-open",
|
|
||||||
"unicode": "\ue643"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "mail-open-filled",
|
|
||||||
"unicode": "\ue63a"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "map",
|
|
||||||
"unicode": "\ue667"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "map-filled",
|
|
||||||
"unicode": "\ue666"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "map-pin",
|
|
||||||
"unicode": "\ue6ad"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "map-pin-ellipse",
|
|
||||||
"unicode": "\ue6ac"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "medal",
|
|
||||||
"unicode": "\ue6a2"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "medal-filled",
|
|
||||||
"unicode": "\ue6c3"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "mic",
|
|
||||||
"unicode": "\ue671"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "mic-filled",
|
|
||||||
"unicode": "\ue677"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "micoff",
|
|
||||||
"unicode": "\ue67e"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "micoff-filled",
|
|
||||||
"unicode": "\ue6b0"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "minus",
|
|
||||||
"unicode": "\ue66f"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "minus-filled",
|
|
||||||
"unicode": "\ue67d"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "more",
|
|
||||||
"unicode": "\ue64d"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "more-filled",
|
|
||||||
"unicode": "\ue64e"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "navigate",
|
|
||||||
"unicode": "\ue66e"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "navigate-filled",
|
|
||||||
"unicode": "\ue67a"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "notification",
|
|
||||||
"unicode": "\ue6a6"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "notification-filled",
|
|
||||||
"unicode": "\ue6c1"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "paperclip",
|
|
||||||
"unicode": "\ue652"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "paperplane",
|
|
||||||
"unicode": "\ue672"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "paperplane-filled",
|
|
||||||
"unicode": "\ue675"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "person",
|
|
||||||
"unicode": "\ue699"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "person-filled",
|
|
||||||
"unicode": "\ue69d"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "personadd",
|
|
||||||
"unicode": "\ue69f"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "personadd-filled",
|
|
||||||
"unicode": "\ue698"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "personadd-filled-copy",
|
|
||||||
"unicode": "\ue6d1"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "phone",
|
|
||||||
"unicode": "\ue69c"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "phone-filled",
|
|
||||||
"unicode": "\ue69b"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "plus",
|
|
||||||
"unicode": "\ue676"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "plus-filled",
|
|
||||||
"unicode": "\ue6c7"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "plusempty",
|
|
||||||
"unicode": "\ue67b"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "pulldown",
|
|
||||||
"unicode": "\ue632"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "pyq",
|
|
||||||
"unicode": "\ue682"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "qq",
|
|
||||||
"unicode": "\ue680"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "redo",
|
|
||||||
"unicode": "\ue64a"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "redo-filled",
|
|
||||||
"unicode": "\ue655"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "refresh",
|
|
||||||
"unicode": "\ue657"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "refresh-filled",
|
|
||||||
"unicode": "\ue656"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "refreshempty",
|
|
||||||
"unicode": "\ue6bf"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "reload",
|
|
||||||
"unicode": "\ue6b2"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "right",
|
|
||||||
"unicode": "\ue6b5"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "scan",
|
|
||||||
"unicode": "\ue62a"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "search",
|
|
||||||
"unicode": "\ue654"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "settings",
|
|
||||||
"unicode": "\ue653"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "settings-filled",
|
|
||||||
"unicode": "\ue6ce"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "shop",
|
|
||||||
"unicode": "\ue62f"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "shop-filled",
|
|
||||||
"unicode": "\ue6cd"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "smallcircle",
|
|
||||||
"unicode": "\ue67c"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "smallcircle-filled",
|
|
||||||
"unicode": "\ue665"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "sound",
|
|
||||||
"unicode": "\ue684"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "sound-filled",
|
|
||||||
"unicode": "\ue686"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "spinner-cycle",
|
|
||||||
"unicode": "\ue68a"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "staff",
|
|
||||||
"unicode": "\ue6a7"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "staff-filled",
|
|
||||||
"unicode": "\ue6cb"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "star",
|
|
||||||
"unicode": "\ue688"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "star-filled",
|
|
||||||
"unicode": "\ue68f"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "starhalf",
|
|
||||||
"unicode": "\ue683"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "trash",
|
|
||||||
"unicode": "\ue687"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "trash-filled",
|
|
||||||
"unicode": "\ue685"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "tune",
|
|
||||||
"unicode": "\ue6aa"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "tune-filled",
|
|
||||||
"unicode": "\ue6ca"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "undo",
|
|
||||||
"unicode": "\ue64f"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "undo-filled",
|
|
||||||
"unicode": "\ue64c"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "up",
|
|
||||||
"unicode": "\ue6b6"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "top",
|
|
||||||
"unicode": "\ue6b6"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "upload",
|
|
||||||
"unicode": "\ue690"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "upload-filled",
|
|
||||||
"unicode": "\ue68e"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "videocam",
|
|
||||||
"unicode": "\ue68c"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "videocam-filled",
|
|
||||||
"unicode": "\ue689"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "vip",
|
|
||||||
"unicode": "\ue6a8"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "vip-filled",
|
|
||||||
"unicode": "\ue6c6"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "wallet",
|
|
||||||
"unicode": "\ue6b1"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "wallet-filled",
|
|
||||||
"unicode": "\ue6c2"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "weibo",
|
|
||||||
"unicode": "\ue68b"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"font_class": "weixin",
|
|
||||||
"unicode": "\ue691"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
|
|
||||||
// export const fontData = JSON.parse<IconsDataItem>(fontDataJson)
|
|
||||||
@@ -1,111 +0,0 @@
|
|||||||
{
|
|
||||||
"id": "uni-icons",
|
|
||||||
"displayName": "uni-icons 图标",
|
|
||||||
"version": "2.0.12",
|
|
||||||
"description": "图标组件,用于展示移动端常见的图标,可自定义颜色、大小。",
|
|
||||||
"keywords": [
|
|
||||||
"uni-ui",
|
|
||||||
"uniui",
|
|
||||||
"icon",
|
|
||||||
"图标"
|
|
||||||
],
|
|
||||||
"repository": "https://github.com/dcloudio/uni-ui",
|
|
||||||
"engines": {
|
|
||||||
"HBuilderX": "^3.2.14",
|
|
||||||
"uni-app": "^4.08",
|
|
||||||
"uni-app-x": "^4.61"
|
|
||||||
},
|
|
||||||
"directories": {
|
|
||||||
"example": "../../temps/example_temps"
|
|
||||||
},
|
|
||||||
"dcloudext": {
|
|
||||||
"sale": {
|
|
||||||
"regular": {
|
|
||||||
"price": "0.00"
|
|
||||||
},
|
|
||||||
"sourcecode": {
|
|
||||||
"price": "0.00"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"contact": {
|
|
||||||
"qq": ""
|
|
||||||
},
|
|
||||||
"declaration": {
|
|
||||||
"ads": "无",
|
|
||||||
"data": "无",
|
|
||||||
"permissions": "无"
|
|
||||||
},
|
|
||||||
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui",
|
|
||||||
"type": "component-vue",
|
|
||||||
"darkmode": "x",
|
|
||||||
"i18n": "x",
|
|
||||||
"widescreen": "x"
|
|
||||||
},
|
|
||||||
"uni_modules": {
|
|
||||||
"dependencies": [
|
|
||||||
"uni-scss"
|
|
||||||
],
|
|
||||||
"encrypt": [],
|
|
||||||
"platforms": {
|
|
||||||
"cloud": {
|
|
||||||
"tcb": "x",
|
|
||||||
"aliyun": "x",
|
|
||||||
"alipay": "x"
|
|
||||||
},
|
|
||||||
"client": {
|
|
||||||
"uni-app": {
|
|
||||||
"vue": {
|
|
||||||
"vue2": "√",
|
|
||||||
"vue3": "√"
|
|
||||||
},
|
|
||||||
"web": {
|
|
||||||
"safari": "√",
|
|
||||||
"chrome": "√"
|
|
||||||
},
|
|
||||||
"app": {
|
|
||||||
"vue": "√",
|
|
||||||
"nvue": "-",
|
|
||||||
"android": {
|
|
||||||
"extVersion": "",
|
|
||||||
"minVersion": "29"
|
|
||||||
},
|
|
||||||
"ios": "√",
|
|
||||||
"harmony": "√"
|
|
||||||
},
|
|
||||||
"mp": {
|
|
||||||
"weixin": "√",
|
|
||||||
"alipay": "√",
|
|
||||||
"toutiao": "√",
|
|
||||||
"baidu": "√",
|
|
||||||
"kuaishou": "-",
|
|
||||||
"jd": "-",
|
|
||||||
"harmony": "-",
|
|
||||||
"qq": "√",
|
|
||||||
"lark": "-"
|
|
||||||
},
|
|
||||||
"quickapp": {
|
|
||||||
"huawei": "√",
|
|
||||||
"union": "√"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"uni-app-x": {
|
|
||||||
"web": {
|
|
||||||
"safari": "√",
|
|
||||||
"chrome": "√"
|
|
||||||
},
|
|
||||||
"app": {
|
|
||||||
"android": {
|
|
||||||
"extVersion": "",
|
|
||||||
"minVersion": "29"
|
|
||||||
},
|
|
||||||
"ios": "√",
|
|
||||||
"harmony": "√"
|
|
||||||
},
|
|
||||||
"mp": {
|
|
||||||
"weixin": "√"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
## Icons 图标
|
|
||||||
> **组件名:uni-icons**
|
|
||||||
> 代码块: `uIcons`
|
|
||||||
|
|
||||||
用于展示 icons 图标 。
|
|
||||||
|
|
||||||
### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-icons)
|
|
||||||
#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
## 1.0.3(2022-01-21)
|
|
||||||
- 优化 组件示例
|
|
||||||
## 1.0.2(2021-11-22)
|
|
||||||
- 修复 / 符号在 vue 不同版本兼容问题引起的报错问题
|
|
||||||
## 1.0.1(2021-11-22)
|
|
||||||
- 修复 vue3中scss语法兼容问题
|
|
||||||
## 1.0.0(2021-11-18)
|
|
||||||
- init
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
@import './styles/index.scss';
|
|
||||||
@@ -1,82 +0,0 @@
|
|||||||
{
|
|
||||||
"id": "uni-scss",
|
|
||||||
"displayName": "uni-scss 辅助样式",
|
|
||||||
"version": "1.0.3",
|
|
||||||
"description": "uni-sass是uni-ui提供的一套全局样式 ,通过一些简单的类名和sass变量,实现简单的页面布局操作,比如颜色、边距、圆角等。",
|
|
||||||
"keywords": [
|
|
||||||
"uni-scss",
|
|
||||||
"uni-ui",
|
|
||||||
"辅助样式"
|
|
||||||
],
|
|
||||||
"repository": "https://github.com/dcloudio/uni-ui",
|
|
||||||
"engines": {
|
|
||||||
"HBuilderX": "^3.1.0"
|
|
||||||
},
|
|
||||||
"dcloudext": {
|
|
||||||
"category": [
|
|
||||||
"JS SDK",
|
|
||||||
"通用 SDK"
|
|
||||||
],
|
|
||||||
"sale": {
|
|
||||||
"regular": {
|
|
||||||
"price": "0.00"
|
|
||||||
},
|
|
||||||
"sourcecode": {
|
|
||||||
"price": "0.00"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"contact": {
|
|
||||||
"qq": ""
|
|
||||||
},
|
|
||||||
"declaration": {
|
|
||||||
"ads": "无",
|
|
||||||
"data": "无",
|
|
||||||
"permissions": "无"
|
|
||||||
},
|
|
||||||
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
|
|
||||||
},
|
|
||||||
"uni_modules": {
|
|
||||||
"dependencies": [],
|
|
||||||
"encrypt": [],
|
|
||||||
"platforms": {
|
|
||||||
"cloud": {
|
|
||||||
"tcb": "y",
|
|
||||||
"aliyun": "y"
|
|
||||||
},
|
|
||||||
"client": {
|
|
||||||
"App": {
|
|
||||||
"app-vue": "y",
|
|
||||||
"app-nvue": "u"
|
|
||||||
},
|
|
||||||
"H5-mobile": {
|
|
||||||
"Safari": "y",
|
|
||||||
"Android Browser": "y",
|
|
||||||
"微信浏览器(Android)": "y",
|
|
||||||
"QQ浏览器(Android)": "y"
|
|
||||||
},
|
|
||||||
"H5-pc": {
|
|
||||||
"Chrome": "y",
|
|
||||||
"IE": "y",
|
|
||||||
"Edge": "y",
|
|
||||||
"Firefox": "y",
|
|
||||||
"Safari": "y"
|
|
||||||
},
|
|
||||||
"小程序": {
|
|
||||||
"微信": "y",
|
|
||||||
"阿里": "y",
|
|
||||||
"百度": "y",
|
|
||||||
"字节跳动": "y",
|
|
||||||
"QQ": "y"
|
|
||||||
},
|
|
||||||
"快应用": {
|
|
||||||
"华为": "n",
|
|
||||||
"联盟": "n"
|
|
||||||
},
|
|
||||||
"Vue": {
|
|
||||||
"vue2": "y",
|
|
||||||
"vue3": "y"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
`uni-sass` 是 `uni-ui`提供的一套全局样式 ,通过一些简单的类名和`sass`变量,实现简单的页面布局操作,比如颜色、边距、圆角等。
|
|
||||||
|
|
||||||
### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-sass)
|
|
||||||
#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
@import './setting/_variables.scss';
|
|
||||||
@import './setting/_border.scss';
|
|
||||||
@import './setting/_color.scss';
|
|
||||||
@import './setting/_space.scss';
|
|
||||||
@import './setting/_radius.scss';
|
|
||||||
@import './setting/_text.scss';
|
|
||||||
@import './setting/_styles.scss';
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
.uni-border {
|
|
||||||
border: 1px $uni-border-1 solid;
|
|
||||||
}
|
|
||||||
@@ -1,66 +0,0 @@
|
|||||||
|
|
||||||
// TODO 暂时不需要 class ,需要用户使用变量实现 ,如果使用类名其实并不推荐
|
|
||||||
// @mixin get-styles($k,$c) {
|
|
||||||
// @if $k == size or $k == weight{
|
|
||||||
// font-#{$k}:#{$c}
|
|
||||||
// }@else{
|
|
||||||
// #{$k}:#{$c}
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
$uni-ui-color:(
|
|
||||||
// 主色
|
|
||||||
primary: $uni-primary,
|
|
||||||
primary-disable: $uni-primary-disable,
|
|
||||||
primary-light: $uni-primary-light,
|
|
||||||
// 辅助色
|
|
||||||
success: $uni-success,
|
|
||||||
success-disable: $uni-success-disable,
|
|
||||||
success-light: $uni-success-light,
|
|
||||||
warning: $uni-warning,
|
|
||||||
warning-disable: $uni-warning-disable,
|
|
||||||
warning-light: $uni-warning-light,
|
|
||||||
error: $uni-error,
|
|
||||||
error-disable: $uni-error-disable,
|
|
||||||
error-light: $uni-error-light,
|
|
||||||
info: $uni-info,
|
|
||||||
info-disable: $uni-info-disable,
|
|
||||||
info-light: $uni-info-light,
|
|
||||||
// 中性色
|
|
||||||
main-color: $uni-main-color,
|
|
||||||
base-color: $uni-base-color,
|
|
||||||
secondary-color: $uni-secondary-color,
|
|
||||||
extra-color: $uni-extra-color,
|
|
||||||
// 背景色
|
|
||||||
bg-color: $uni-bg-color,
|
|
||||||
// 边框颜色
|
|
||||||
border-1: $uni-border-1,
|
|
||||||
border-2: $uni-border-2,
|
|
||||||
border-3: $uni-border-3,
|
|
||||||
border-4: $uni-border-4,
|
|
||||||
// 黑色
|
|
||||||
black:$uni-black,
|
|
||||||
// 白色
|
|
||||||
white:$uni-white,
|
|
||||||
// 透明
|
|
||||||
transparent:$uni-transparent
|
|
||||||
) !default;
|
|
||||||
@each $key, $child in $uni-ui-color {
|
|
||||||
.uni-#{"" + $key} {
|
|
||||||
color: $child;
|
|
||||||
}
|
|
||||||
.uni-#{"" + $key}-bg {
|
|
||||||
background-color: $child;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.uni-shadow-sm {
|
|
||||||
box-shadow: $uni-shadow-sm;
|
|
||||||
}
|
|
||||||
.uni-shadow-base {
|
|
||||||
box-shadow: $uni-shadow-base;
|
|
||||||
}
|
|
||||||
.uni-shadow-lg {
|
|
||||||
box-shadow: $uni-shadow-lg;
|
|
||||||
}
|
|
||||||
.uni-mask {
|
|
||||||
background-color:$uni-mask;
|
|
||||||
}
|
|
||||||
@@ -1,55 +0,0 @@
|
|||||||
@mixin radius($r,$d:null ,$important: false){
|
|
||||||
$radius-value:map-get($uni-radius, $r) if($important, !important, null);
|
|
||||||
// Key exists within the $uni-radius variable
|
|
||||||
@if (map-has-key($uni-radius, $r) and $d){
|
|
||||||
@if $d == t {
|
|
||||||
border-top-left-radius:$radius-value;
|
|
||||||
border-top-right-radius:$radius-value;
|
|
||||||
}@else if $d == r {
|
|
||||||
border-top-right-radius:$radius-value;
|
|
||||||
border-bottom-right-radius:$radius-value;
|
|
||||||
}@else if $d == b {
|
|
||||||
border-bottom-left-radius:$radius-value;
|
|
||||||
border-bottom-right-radius:$radius-value;
|
|
||||||
}@else if $d == l {
|
|
||||||
border-top-left-radius:$radius-value;
|
|
||||||
border-bottom-left-radius:$radius-value;
|
|
||||||
}@else if $d == tl {
|
|
||||||
border-top-left-radius:$radius-value;
|
|
||||||
}@else if $d == tr {
|
|
||||||
border-top-right-radius:$radius-value;
|
|
||||||
}@else if $d == br {
|
|
||||||
border-bottom-right-radius:$radius-value;
|
|
||||||
}@else if $d == bl {
|
|
||||||
border-bottom-left-radius:$radius-value;
|
|
||||||
}
|
|
||||||
}@else{
|
|
||||||
border-radius:$radius-value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@each $key, $child in $uni-radius {
|
|
||||||
@if($key){
|
|
||||||
.uni-radius-#{"" + $key} {
|
|
||||||
@include radius($key)
|
|
||||||
}
|
|
||||||
}@else{
|
|
||||||
.uni-radius {
|
|
||||||
@include radius($key)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@each $direction in t, r, b, l,tl, tr, br, bl {
|
|
||||||
@each $key, $child in $uni-radius {
|
|
||||||
@if($key){
|
|
||||||
.uni-radius-#{"" + $direction}-#{"" + $key} {
|
|
||||||
@include radius($key,$direction,false)
|
|
||||||
}
|
|
||||||
}@else{
|
|
||||||
.uni-radius-#{$direction} {
|
|
||||||
@include radius($key,$direction,false)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user