Compare commits
1 Commits
v1-initial
...
pigx_ishar
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6f270a972e |
280
DATABASE_DESIGN.md
Normal file
280
DATABASE_DESIGN.md
Normal file
@@ -0,0 +1,280 @@
|
||||
# iShare (AiShare) 数据库设计文档
|
||||
|
||||
> 模块: `as-app-server` — iShare 项目新增的核心业务模块(pigx-5.2 原版中不存在)
|
||||
>
|
||||
> 生成日期: 2026-02-16
|
||||
|
||||
---
|
||||
|
||||
## 一、数据库表清单
|
||||
|
||||
### 1. 核心业务表(as_* — iShare 新增)
|
||||
|
||||
| 表名 | 用途 |
|
||||
|------|------|
|
||||
| `as_platform` | 流媒体平台(Netflix、Spotify 等) |
|
||||
| `as_platform_type` | 平台分类(视频、音乐等) |
|
||||
| `as_sub_plan` | 订阅计划(如 Netflix 标准版、高级版) |
|
||||
| `as_sub_payroll` | 付费方案(月付/季付/年付 + 价格) |
|
||||
| `as_sub_account` | 订阅账号(实际的平台登录凭据) |
|
||||
| `as_sub_product` | 订阅产品(面向用户的合租商品) |
|
||||
| `as_sub_product_comment` | 产品评价 |
|
||||
| `as_user_sub` | 用户订阅关系(用户参与的合租) |
|
||||
|
||||
### 2. App 基础表(app_* — 来自 pigx-app 模板,SQL 中有建表语句)
|
||||
|
||||
| 表名 | 用途 |
|
||||
|------|------|
|
||||
| `app_user` | App 用户 |
|
||||
| `app_role` | App 角色 |
|
||||
| `app_user_role` | 用户-角色关联 |
|
||||
| `app_social_details` | 社交登录配置(微信小程序等) |
|
||||
| `app_article` | 文章资讯 |
|
||||
| `app_article_category` | 文章分类 |
|
||||
| `app_article_collect` | 文章收藏 |
|
||||
| `app_page` | 页面装修(首页/个人中心 JSON 配置) |
|
||||
| `app_tabbar` | 底部导航栏 |
|
||||
|
||||
---
|
||||
|
||||
## 二、核心业务表详细结构
|
||||
|
||||
### 2.1 `as_platform` — 流媒体平台
|
||||
|
||||
| 字段 | 类型 | 说明 |
|
||||
|------|------|------|
|
||||
| `id` | bigint (PK, ASSIGN_ID) | 主键 |
|
||||
| `platform_name` | varchar | 平台名称 |
|
||||
| `platform_type` | int | 平台类型(关联 as_platform_type),0=全部 |
|
||||
| `icon` | varchar | 应用图标 URL |
|
||||
| `company` | varchar | 所属公司 |
|
||||
| `website` | varchar | 平台官网 |
|
||||
| `sort_order` | varchar | 排序 |
|
||||
| `product_code` | varchar | 产品编码(格式: 类型_名称_id) |
|
||||
|
||||
### 2.2 `as_platform_type` — 平台类型
|
||||
|
||||
| 字段 | 类型 | 说明 |
|
||||
|------|------|------|
|
||||
| `id` | bigint (PK, ASSIGN_ID) | 主键 |
|
||||
| `name` | varchar | 类型名称(如:视频、音乐、AI) |
|
||||
| `platform_type` | int | 类型编号,0=全部 |
|
||||
| `sort_order` | varchar | 排序 |
|
||||
|
||||
### 2.3 `as_sub_plan` — 订阅计划
|
||||
|
||||
| 字段 | 类型 | 说明 |
|
||||
|------|------|------|
|
||||
| `id` | bigint (PK, ASSIGN_ID) | 计划 ID |
|
||||
| `name` | varchar | 计划名称(如:标准版、高级版) |
|
||||
| `platform_id` | varchar | 所属平台 ID |
|
||||
| `capacity` | varchar | 用户容量(可共享席位数) |
|
||||
| `remark` | varchar | 备注 |
|
||||
| `sort_order` | varchar | 排序 |
|
||||
|
||||
### 2.4 `as_sub_payroll` — 付费方案
|
||||
|
||||
| 字段 | 类型 | 说明 |
|
||||
|------|------|------|
|
||||
| `id` | bigint (PK, ASSIGN_ID) | 主键 |
|
||||
| `sub_plans` | bigint | 关联的订阅计划 ID |
|
||||
| `platform_id` | int | 平台 ID |
|
||||
| `payroll` | int | 付费周期:1=月付, 2=季付, 3=年付 |
|
||||
| `price` | decimal | 价格 |
|
||||
| `currency` | varchar | 货币(CNY/USD 等) |
|
||||
| `region` | varchar | 地区 |
|
||||
| `product_code` | varchar | 产品编码 |
|
||||
|
||||
### 2.5 `as_sub_account` — 订阅账号
|
||||
|
||||
| 字段 | 类型 | 说明 |
|
||||
|------|------|------|
|
||||
| `id` | bigint (PK, ASSIGN_ID) | 主键 |
|
||||
| `product_id` | bigint | 关联产品 ID |
|
||||
| `sub_plan_id` | int | 订阅计划 ID |
|
||||
| `user_id` | int | 账号持有者(主用户) |
|
||||
| `sub_payroll_id` | int | 付费方案 ID |
|
||||
| `region` | varchar | 地区 |
|
||||
| `share_type` | int | 分享类型 |
|
||||
| `account_type` | int | 账号类型 |
|
||||
| `renew_date` | datetime | 续费日期 |
|
||||
| `platform_id` | int | 平台 ID |
|
||||
| `account_name` | varchar | 平台登录用户名 |
|
||||
| `account_passwd` | varchar | 平台登录密码 |
|
||||
| `passwd_salt` | int | 密码盐值 |
|
||||
|
||||
### 2.6 `as_sub_product` — 订阅产品(合租商品)
|
||||
|
||||
| 字段 | 类型 | 说明 |
|
||||
|------|------|------|
|
||||
| `id` | bigint (PK, ASSIGN_ID) | 主键 |
|
||||
| `star` | int | 综合评分 |
|
||||
| `title` | varchar | 产品标题 |
|
||||
| `description` | varchar | 描述 |
|
||||
| `tags` | varchar | 标签(逗号分隔) |
|
||||
| `sub_plan_ids` | varchar | 关联的订阅计划 ID 列表 |
|
||||
| `amount` | decimal | 总价 |
|
||||
| `user_id` | bigint | 发布者用户 ID |
|
||||
| `product_type` | bigint | 产品类型:1=自营, 2=个人 |
|
||||
| `create_time` | datetime | 创建时间 |
|
||||
| `update_time` | datetime | 更新时间 |
|
||||
| `product_code` | varchar | 产品编码(类型_名称_id) |
|
||||
| `sub_type` | bigint | 订阅类型:1=单品, 2=多品(组合) |
|
||||
|
||||
### 2.7 `as_sub_product_comment` — 产品评价
|
||||
|
||||
> 注: 实体类 `@TableName` 误标为 `as_sub_product`,实际应为 `as_sub_product_comment`
|
||||
|
||||
| 字段 | 类型 | 说明 |
|
||||
|------|------|------|
|
||||
| `id` | bigint (PK, ASSIGN_ID) | 主键 |
|
||||
| `star` | int | 评分 |
|
||||
| `comment` | varchar | 评价内容 |
|
||||
| `user_id` | bigint | 评价用户 |
|
||||
| `product_id` | bigint | 关联产品 ID |
|
||||
| `create_time` | datetime | 创建时间 |
|
||||
| `update_time` | datetime | 更新时间 |
|
||||
|
||||
### 2.8 `as_user_sub` — 用户订阅关系
|
||||
|
||||
| 字段 | 类型 | 说明 |
|
||||
|------|------|------|
|
||||
| `id` | bigint (PK, ASSIGN_ID) | 主键 |
|
||||
| `platform_id` | int | 平台 ID |
|
||||
| `capacity` | int | 总容量(席位数) |
|
||||
| `capacity_loaded` | int | 已占用容量 |
|
||||
| `plan_id` | int | 订阅计划 ID |
|
||||
| `user_id` | int | 用户 ID |
|
||||
| `main_account` | int | 主账号 ID(关联 as_sub_account) |
|
||||
| `region` | varchar | 地区 |
|
||||
| `target_ip` | varchar | 目标 IP(用于区域限制) |
|
||||
| `remark` | int | 备注 |
|
||||
|
||||
---
|
||||
|
||||
## 三、App 基础表详细结构
|
||||
|
||||
### 3.1 `app_user` — App 用户
|
||||
|
||||
| 字段 | 类型 | 约束 | 说明 |
|
||||
|------|------|------|------|
|
||||
| `user_id` | bigint | PK | 用户 ID |
|
||||
| `username` | varchar(255) | | 用户名 |
|
||||
| `password` | varchar(255) | | 密码(BCrypt) |
|
||||
| `salt` | varchar(255) | | 盐值 |
|
||||
| `phone` | varchar(20) | | 手机号 |
|
||||
| `avatar` | varchar(255) | | 头像 |
|
||||
| `nickname` | varchar(64) | | 昵称 |
|
||||
| `name` | varchar(64) | | 姓名 |
|
||||
| `email` | varchar(128) | | 邮箱 |
|
||||
| `wx_openid` | varchar(32) | | 微信 OpenID |
|
||||
| `lock_flag` | char(1) | 默认 '0' | 锁定状态 |
|
||||
| `del_flag` | char(1) | 默认 '0' | 删除标志 |
|
||||
| `tenant_id` | bigint | NOT NULL | 租户 ID |
|
||||
| `create_by/update_by` | varchar(64) | | 操作人 |
|
||||
| `create_time/update_time` | datetime | | 时间戳 |
|
||||
| `last_modified_time` | datetime | | 最后密码修改时间 |
|
||||
|
||||
### 3.2 `app_role` — 角色表
|
||||
|
||||
| 字段 | 类型 | 说明 |
|
||||
|------|------|------|
|
||||
| `role_id` | bigint (PK) | 角色 ID |
|
||||
| `role_name` | varchar(64) | 角色名 |
|
||||
| `role_code` | varchar(64) | 角色编码(如 APP_USER) |
|
||||
| `role_desc` | varchar(255) | 描述 |
|
||||
| `tenant_id` | bigint | 租户 ID |
|
||||
|
||||
### 3.3 `app_user_role` — 用户角色关联
|
||||
|
||||
| 字段 | 类型 | 说明 |
|
||||
|------|------|------|
|
||||
| `user_id` | bigint (PK) | 用户 ID |
|
||||
| `role_id` | bigint (PK) | 角色 ID |
|
||||
|
||||
### 3.4 其他 App 表
|
||||
|
||||
- **`app_social_details`**: 社交登录配置(type/app_id/app_secret/redirect_url)
|
||||
- **`app_article`**: 文章(title/intro/content/author/visit/sort/cid→分类)
|
||||
- **`app_article_category`**: 文章分类(name/sort/is_show)
|
||||
- **`app_article_collect`**: 文章收藏(user_id/article_id)
|
||||
- **`app_page`**: 页面装修(page_type/page_name/page_data JSON)
|
||||
- **`app_tabbar`**: 底部导航(name/selected/unselected 图标/link JSON)
|
||||
|
||||
所有 app_* 表均包含 `del_flag`, `create_by`, `update_by`, `create_time`, `update_time`, `tenant_id` 公共字段。
|
||||
|
||||
---
|
||||
|
||||
## 四、ER 关系
|
||||
|
||||
```
|
||||
as_platform_type (1) ──< (N) as_platform [platform_type]
|
||||
as_platform (1) ──< (N) as_sub_plan [platform_id]
|
||||
as_sub_plan (1) ──< (N) as_sub_payroll [sub_plans]
|
||||
as_sub_plan (N) >──< (N) as_sub_product [sub_plan_ids, 逗号分隔]
|
||||
as_sub_product (1) ──< (N) as_sub_product_comment [product_id]
|
||||
as_sub_product (1) ──< (N) as_sub_account [product_id]
|
||||
as_sub_plan (1) ──< (N) as_sub_account [sub_plan_id]
|
||||
as_sub_payroll (1) ──< (N) as_sub_account [sub_payroll_id]
|
||||
as_sub_plan (1) ──< (N) as_user_sub [plan_id]
|
||||
as_sub_account (1) ──< (N) as_user_sub [main_account]
|
||||
|
||||
app_user (1) ──< (N) as_sub_product [user_id — 产品发布者]
|
||||
app_user (1) ──< (N) as_sub_account [user_id — 账号持有者]
|
||||
app_user (1) ──< (N) as_user_sub [user_id — 订阅参与者]
|
||||
app_user (1) ──< (N) as_sub_product_comment [user_id]
|
||||
|
||||
app_user (N) >──< (N) app_role [通过 app_user_role]
|
||||
app_article_category (1) ──< (N) app_article [cid]
|
||||
app_user (1) ──< (N) app_article_collect [user_id]
|
||||
app_article (1) ──< (N) app_article_collect [article_id]
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 五、核心业务模型总结
|
||||
|
||||
iShare 是一个 **流媒体账号合租平台**,核心业务流程:
|
||||
|
||||
```
|
||||
平台类型 (as_platform_type)
|
||||
└── 平台 (as_platform): Netflix, Spotify, ChatGPT...
|
||||
└── 订阅计划 (as_sub_plan): 标准版、高级版(含容量/席位数)
|
||||
└── 付费方案 (as_sub_payroll): 月/季/年付 + 价格
|
||||
└── 订阅账号 (as_sub_account): 实际登录凭据
|
||||
|
||||
订阅产品 (as_sub_product): 面向用户的合租商品
|
||||
├── 关联多个订阅计划 (sub_plan_ids)
|
||||
├── 产品类型: 自营(1) / 个人(2)
|
||||
├── 订阅类型: 单品(1) / 多品组合(2)
|
||||
└── 产品评价 (as_sub_product_comment)
|
||||
|
||||
用户订阅 (as_user_sub): 用户参与合租
|
||||
├── 关联平台、计划、主账号
|
||||
└── 容量管理 (capacity / capacity_loaded)
|
||||
```
|
||||
|
||||
### 关键业务概念
|
||||
|
||||
1. **平台 (Platform)**: 流媒体服务商,按类型分类
|
||||
2. **订阅计划 (SubPlan)**: 平台的会员等级,定义席位容量
|
||||
3. **付费方案 (SubPayroll)**: 计划的定价策略(支持多地区多货币)
|
||||
4. **订阅账号 (SubAccount)**: 实际的平台账号密码,由主用户持有
|
||||
5. **订阅产品 (SubProduct)**: 合租商品,可组合多个计划,支持自营/个人发布
|
||||
6. **用户订阅 (UserSub)**: 用户加入合租的记录,跟踪席位占用
|
||||
7. **产品评价 (SubProductComment)**: 用户对合租产品的评分和评论
|
||||
|
||||
### 代码注意事项
|
||||
|
||||
⚠️ `AsSubProductComment` 实体类的 `@TableName("as_sub_product")` 可能是 bug,应为 `as_sub_product_comment`。
|
||||
|
||||
---
|
||||
|
||||
## 六、SQL 建表语句
|
||||
|
||||
核心业务表(as_*)**没有在 SQL 脚本中找到建表语句**,仅在 Java 实体类中定义。这些表可能通过以下方式创建:
|
||||
- MyBatis-Plus 自动建表
|
||||
- 手动在数据库中创建
|
||||
- 尚未提交的 migration 脚本
|
||||
|
||||
App 基础表的完整建表语句见: `db/999pigxx_app.sql`
|
||||
@@ -1,211 +0,0 @@
|
||||
# iShare 数据库设计概要
|
||||
|
||||
> 基于 DATABASE_DESIGN_V2.md 整理
|
||||
> 评审时间:2026-02-17
|
||||
> 完整建表 SQL:`db/ishare_schema_v2.sql`
|
||||
> 完整字段说明:`DATABASE_DESIGN_V2.md`
|
||||
|
||||
---
|
||||
|
||||
## 一、表总览(23 张表)
|
||||
|
||||
### 1.1 App 基础表(复用 PigX,共 9 张)
|
||||
|
||||
| # | 表名 | 说明 | 变更 |
|
||||
|---|------|------|------|
|
||||
| 1 | `app_user` | 用户 | 追加 `invite_code`、`inviter_id` |
|
||||
| 2 | `app_role` | 角色 | 沿用 |
|
||||
| 3 | `app_user_role` | 用户角色关联 | 沿用 |
|
||||
| 4 | `app_social_details` | 第三方登录 | 沿用 |
|
||||
| 5 | `app_article_category` | 文章分类 | 沿用 |
|
||||
| 6 | `app_article` | 文章/公告 | 沿用 |
|
||||
| 7 | `app_article_collect` | 文章收藏 | 沿用 |
|
||||
| 8 | `app_page` | 页面配置 | 沿用 |
|
||||
| 9 | `app_tabbar` | 底部导航 | 沿用 |
|
||||
|
||||
### 1.2 业务表(iShare 专属,共 14 张)
|
||||
|
||||
#### 平台与产品
|
||||
|
||||
| # | 表名 | 说明 |
|
||||
|---|------|------|
|
||||
| 10 | `as_platform_type` | 平台分类(视频/音乐/AI等) |
|
||||
| 11 | `as_platform` | 流媒体平台(Netflix/Spotify等) |
|
||||
| 12 | `as_sub_plan` | 订阅计划(高级版/家庭版等) |
|
||||
| 13 | `as_sub_payroll` | 付费方案(月/季/年,含价格) |
|
||||
| 14 | `as_sub_product` | 合租商品(自营 or 个人发布) |
|
||||
| 15 | `as_sub_account` | 平台账号凭据(AES 加密存储) |
|
||||
| 16 | `as_sub_product_comment` | 商品评价 |
|
||||
|
||||
#### 订阅与订单
|
||||
|
||||
| # | 表名 | 说明 |
|
||||
|---|------|------|
|
||||
| 17 | `as_user_sub` | 合租槽/共享池(一个账号对应一个槽) |
|
||||
| 18 | `as_user_sub_member` | 个人订阅记录(原版缺失最关键表) |
|
||||
| 19 | `as_order` | 订单(含状态机、价格快照) |
|
||||
|
||||
#### 钱包与推广
|
||||
|
||||
| # | 表名 | 说明 |
|
||||
|---|------|------|
|
||||
| 20 | `as_wallet` | 用户钱包(乐观锁防并发) |
|
||||
| 21 | `as_wallet_log` | 钱包流水(含余额快照便于对账) |
|
||||
| 22 | `as_invite` | 邀请关系与返现 |
|
||||
| 23 | `as_notification` | 系统通知(续费提醒/订单/公告/奖励) |
|
||||
|
||||
---
|
||||
|
||||
## 二、核心 ER 关系概览
|
||||
|
||||
```
|
||||
as_platform_type (1) ──< (N) as_platform
|
||||
as_platform (1) ──< (N) as_sub_plan
|
||||
as_sub_plan (1) ──< (N) as_sub_payroll
|
||||
as_sub_plan (N) >──< (N) as_sub_product ← sub_plan_ids 逗号分隔(待决策改关联表)
|
||||
as_platform (1) ──< (N) as_sub_product [platform_id 冗余加速查询]
|
||||
|
||||
as_sub_product (1) ──< (N) as_sub_account [product_id]
|
||||
as_sub_product (1) ──< (N) as_user_sub [product_id]
|
||||
as_user_sub (1) ──< (N) as_user_sub_member [sub_id] ← 新增关键关联
|
||||
|
||||
as_sub_product (1) ──< (N) as_order [product_id]
|
||||
as_order (1) ──< (1) as_user_sub_member [order_id]
|
||||
|
||||
app_user (1) ──< (1) as_wallet
|
||||
as_wallet (1) ──< (N) as_wallet_log
|
||||
app_user (1) ──< (N) as_order
|
||||
app_user (1) ──< (N) as_user_sub_member
|
||||
app_user (1) ──< (N) as_invite [as inviter]
|
||||
app_user (1) ──< (1) as_invite [as invitee]
|
||||
app_user (1) ──< (N) as_notification
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 三、关键状态机
|
||||
|
||||
### 3.1 订单(as_order)
|
||||
|
||||
```
|
||||
[待支付] ─→ 15min 超时 ─→ [已取消]
|
||||
[待支付] ─→ 支付成功 ─→ [已支付] ─→ 激活订阅 ─→ [已完成]
|
||||
[已支付/已完成] ─→ 退款 ─→ [已退款]
|
||||
```
|
||||
|
||||
### 3.2 个人订阅(as_user_sub_member)
|
||||
|
||||
```
|
||||
[待激活] ─→ 订单完成 ─→ [使用中]
|
||||
├─→ 到期 ─→ [已到期] ─→ 续费 ─→ [使用中]
|
||||
└─→ 主动退订 ─→ [已退订]
|
||||
```
|
||||
|
||||
### 3.3 合租槽(as_user_sub)
|
||||
|
||||
```
|
||||
[可加入(0)] ─→ 席位满(capacity_loaded = capacity) ─→ [已满(1)]
|
||||
[可加入/已满] ─→ 到期 ─→ [已到期(2)]
|
||||
[可加入/已满] ─→ 车主关闭 ─→ [已关闭(3)]
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 四、关键设计机制
|
||||
|
||||
### 4.1 席位超卖防护(乐观锁)
|
||||
|
||||
```sql
|
||||
-- 购买时原子性占位,row affected = 0 则席位已满
|
||||
UPDATE as_user_sub
|
||||
SET capacity_loaded = capacity_loaded + 1
|
||||
WHERE id = ? AND capacity_loaded < capacity
|
||||
```
|
||||
|
||||
### 4.2 账号凭据加密
|
||||
|
||||
- 算法:AES-256-GCM(`as_sub_account.encrypt_type = 1`)
|
||||
- `account_passwd`:密文(Base64)
|
||||
- `passwd_salt`:随机 IV(16 字节 Base64,**原设计为 int 已修复**)
|
||||
- 密钥:服务端环境变量,不入库
|
||||
- 查看凭据:仅限 `as_user_sub_member.status = 1(使用中)`,服务端解密后返回明文,不记录日志
|
||||
|
||||
### 4.3 钱包余额并发控制(乐观锁)
|
||||
|
||||
```sql
|
||||
UPDATE as_wallet
|
||||
SET balance = balance - ?, version = version + 1
|
||||
WHERE user_id = ? AND version = ? AND balance >= ?
|
||||
-- row affected = 0:并发冲突或余额不足
|
||||
```
|
||||
|
||||
### 4.4 订阅到期定时任务(建议每日 02:00)
|
||||
|
||||
```
|
||||
1. expire_time < now() + 7天 且 status=1 → 推送续费提醒通知
|
||||
2. expire_time < now() 且 status=1 → 标记 status=2(已到期)
|
||||
→ as_user_sub.capacity_loaded -1(释放席位)
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 五、设计评审问题清单
|
||||
|
||||
> 评审时间:2026-02-17
|
||||
|
||||
### 🔴 严重(影响核心功能,需修复)
|
||||
|
||||
| # | 问题 | 影响 | 建议方案 |
|
||||
|---|------|------|----------|
|
||||
| R1 | **充值流水追踪缺失** | 一旦接入外部支付充值(支付宝/微信),充值过程(待支付→成功)无法追踪,无法对账 | 新增 `as_recharge` 表(order_no / user_id / amount / pay_type / pay_no / status / expire_time / pay_time)|
|
||||
| R2 | **`as_user_sub_member` 唯一键问题** | `UNIQUE(sub_id, user_id)` 导致续费只能覆盖,历史续费记录丢失,退款/对账有问题 | 去掉唯一键;改为逻辑约束:同 `sub_id+user_id` 只允许一条 `status=1` 记录,续费时新增记录(旧的置为2=已到期) |
|
||||
|
||||
### 🟠 重要(功能不完整,建议修复)
|
||||
|
||||
| # | 问题 | 影响 | 建议方案 |
|
||||
|---|------|------|----------|
|
||||
| I1 | **Banner 广告位表缺失** | 首页有 Banner 需求,但无对应表 | 新增 `as_banner`(image_url / link_url / link_type / sort_order / status / start_time / end_time)|
|
||||
| I2 | **`as_sub_product.sub_plan_ids` 逗号分隔反范式** | 反向查询(某计划关联哪些商品)需 LIKE 模糊查,不走索引 | 改为关联表 `as_product_plan_rel(product_id, plan_id)`(现在改成本最低)|
|
||||
| I3 | **SYSTEM_DESIGN.md 与 DATABASE_DESIGN_V2.md 字段不一致** | 开发时若参考旧文档会导致实现错误 | 更新 SYSTEM_DESIGN.md ER 图:`user_sub_id→member_id`、`main_account→account_id`、移除已不存在的 `available_seats` |
|
||||
|
||||
### 🟡 轻微(可优化,不影响上线)
|
||||
|
||||
| # | 问题 | 影响 | 建议方案 |
|
||||
|---|------|------|----------|
|
||||
| L1 | **广场拼车凭据录入状态未建模** | 个人拼车:用户付款后,车主需事后录入凭据,这段时间状态不明确 | `as_user_sub_member.status` 增加值:`4=等待车主录入凭据` |
|
||||
| L2 | **缺少关键索引规划** | 高频查询无索引影响性能 | 见下方索引清单 |
|
||||
|
||||
### 建议索引清单
|
||||
|
||||
```sql
|
||||
-- 我的订阅列表
|
||||
CREATE INDEX idx_member_user_status ON as_user_sub_member(user_id, status);
|
||||
-- 定时任务扫描到期
|
||||
CREATE INDEX idx_member_expire ON as_user_sub_member(expire_time, status);
|
||||
-- 用户订单列表
|
||||
CREATE INDEX idx_order_user_status ON as_order(user_id, status);
|
||||
-- 订单号查询(已设 UNIQUE,跳过)
|
||||
-- 未读通知数
|
||||
CREATE INDEX idx_notif_user_read ON as_notification(user_id, is_read);
|
||||
-- 合租槽状态
|
||||
CREATE INDEX idx_sub_product_status ON as_user_sub(product_id, status);
|
||||
-- 账号凭据查询
|
||||
CREATE INDEX idx_account_product ON as_sub_account(product_id, status);
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 六、待决策项(需 Ami 确认)
|
||||
|
||||
| # | 问题 | 选项 |
|
||||
|---|------|------|
|
||||
| 1 | 付费方式一期支持哪些? | A) 仅余额(人工充值)B) 余额+支付宝 C) 三种都支持 |
|
||||
| 2 | 拼车广场是否需要审核流程? | A) 管理员审核 B) 自动上架 C) 仅自营,无拼车广场 |
|
||||
| 3 | 账号凭据展示方式? | A) 直接明文 B) 需二次验证(短信/密码)C) 限时展示(30s后隐藏)|
|
||||
| 4 | 邀请返现比例和条件? | 需定义:返现金额/比例,是否有上限 |
|
||||
| 5 | `as_sub_product` 的多计划关联是否改为关联表? | A) 保持逗号分隔 B) 改关联表(**推荐**,趁现在改成本最低)|
|
||||
| 6 | 提现功能是否一期上线? | A) 一期上 B) 二期(一期只充值不提现)|
|
||||
|
||||
---
|
||||
|
||||
*文档由 AI 评审生成 · 最后更新:2026-02-17*
|
||||
@@ -1,427 +0,0 @@
|
||||
# iShare 数据库设计 v2.0(修订版)
|
||||
|
||||
> 基于原版 v1.0(2023-08 骨架)审查后全面修订
|
||||
> 修订时间: 2026-02-17
|
||||
> 建表脚本: `db/ishare_schema_v2.sql`
|
||||
|
||||
---
|
||||
|
||||
## 一、修订说明
|
||||
|
||||
### 1.1 原版问题总结
|
||||
|
||||
| 类型 | 数量 | 说明 |
|
||||
|------|------|------|
|
||||
| 🔴 严重缺陷 | 4 项 | 直接导致核心功能不可用 |
|
||||
| 🟠 重要问题 | 6 项 | 数据类型错误/查询困难 |
|
||||
| 🟡 设计缺失 | 5 项 | 运营/安全功能不完整 |
|
||||
|
||||
### 1.2 修订内容
|
||||
|
||||
| 表名 | 修订类型 | 主要变更 |
|
||||
|------|----------|----------|
|
||||
| `as_platform_type` | 补充 | 加 `status`、`del_flag`、时间戳;`sort_order` varchar→int |
|
||||
| `as_platform` | 补充 | 加 `description`、`status`、`del_flag`、时间戳;`sort_order` varchar→int |
|
||||
| `as_sub_plan` | 修复+补充 | `platform_id` varchar→**bigint**;`capacity` varchar→**int**;加状态/软删除/时间戳 |
|
||||
| `as_sub_payroll` | 重构 | `sub_plans`→**`sub_plan_id`**(语义明确);加 `duration_months`、`original_price`、`is_active`;软删除/时间戳 |
|
||||
| `as_sub_product` | 修复+补充 | **`Tags`→`tags`**(命名修复);加 `platform_id`、`cover_image`、`status`、`total_capacity`;`product_type`/`sub_type` Long→**tinyint** |
|
||||
| `as_sub_account` | 修复+补充 | 4个字段 int→**bigint**;`passwd_salt` int→**varchar(64)**;加 `encrypt_type`、`status`、软删除/时间戳 |
|
||||
| `as_user_sub` | 语义修订+修复 | 重定义为"合租槽(共享池)";`remark` int→**varchar**;字段 int→bigint;加 `product_id`、`status`、`expire_time`、软删除/时间戳;`user_id`→`host_user_id`(语义明确);`main_account`→`account_id` |
|
||||
| `as_sub_product_comment` | 补充 | 加 `order_id`(购买验证)、`is_anonymous`、`reply_id`(追评)、`del_flag` |
|
||||
| `as_user_sub_member` | **新增** | 个人订阅记录(原版最大缺失),含 `status`、`start_time`、`expire_time` |
|
||||
| `as_order` | **新增** | 完整订单表(含状态机、价格快照、支付信息) |
|
||||
| `as_wallet` | **新增** | 用户钱包(含乐观锁 `version` 防并发) |
|
||||
| `as_wallet_log` | **新增** | 钱包流水(含 `balance_after` 快照便于对账) |
|
||||
| `as_invite` | **新增** | 邀请关系与返现 |
|
||||
| `as_notification` | **新增** | 系统通知(续费提醒/订单/公告/奖励) |
|
||||
| `app_user` | 追加字段 | 加 `invite_code`(专属邀请码)、`inviter_id` |
|
||||
|
||||
---
|
||||
|
||||
## 二、表结构(v2.0)
|
||||
|
||||
### 2.1 `as_platform_type` — 平台类型
|
||||
|
||||
| 字段 | 类型 | 说明 |
|
||||
|------|------|------|
|
||||
| `id` | bigint PK | 主键 |
|
||||
| `name` | varchar(64) NOT NULL | 类型名称(视频/音乐/AI等) |
|
||||
| `platform_type` | int DEFAULT 0 | 类型编号(0=全部,用于筛选) |
|
||||
| `sort_order` | int DEFAULT 0 | 排序权重(升序,**原为 varchar**) |
|
||||
| `status` | tinyint DEFAULT 1 | **新增** 0=禁用, 1=启用 |
|
||||
| `del_flag` | char(1) DEFAULT '0' | **新增** 软删除 |
|
||||
| `create_time` | datetime | **新增** |
|
||||
| `update_time` | datetime | **新增** |
|
||||
|
||||
### 2.2 `as_platform` — 流媒体平台
|
||||
|
||||
| 字段 | 类型 | 说明 |
|
||||
|------|------|------|
|
||||
| `id` | bigint PK | 主键 |
|
||||
| `platform_name` | varchar(128) NOT NULL | 平台名称 |
|
||||
| `platform_type` | int DEFAULT 0 | 关联类型编号 |
|
||||
| `icon` | varchar(512) | 图标 URL |
|
||||
| `description` | varchar(512) | **新增** 平台简介 |
|
||||
| `company` | varchar(128) | 所属公司 |
|
||||
| `website` | varchar(256) | 官网 |
|
||||
| `sort_order` | int DEFAULT 0 | 排序(**原为 varchar**) |
|
||||
| `status` | tinyint DEFAULT 1 | **新增** 0=禁用, 1=启用 |
|
||||
| `del_flag` | char(1) DEFAULT '0' | **新增** 软删除 |
|
||||
| `create_time` | datetime | **新增** |
|
||||
| `update_time` | datetime | **新增** |
|
||||
|
||||
### 2.3 `as_sub_plan` — 订阅计划
|
||||
|
||||
| 字段 | 类型 | 说明 |
|
||||
|------|------|------|
|
||||
| `id` | bigint PK | 主键 |
|
||||
| `name` | varchar(128) NOT NULL | 计划名称 |
|
||||
| `platform_id` | bigint NOT NULL | 所属平台(**原为 varchar,已修复**) |
|
||||
| `capacity` | int NOT NULL DEFAULT 1 | 席位容量(**原为 varchar,已修复**) |
|
||||
| `remark` | varchar(256) | 备注 |
|
||||
| `sort_order` | int DEFAULT 0 | 排序 |
|
||||
| `status` | tinyint DEFAULT 1 | **新增** 0=禁用, 1=启用 |
|
||||
| `del_flag` | char(1) DEFAULT '0' | **新增** 软删除 |
|
||||
| `create_time` | datetime | **新增** |
|
||||
| `update_time` | datetime | **新增** |
|
||||
|
||||
### 2.4 `as_sub_payroll` — 付费方案
|
||||
|
||||
| 字段 | 类型 | 说明 |
|
||||
|------|------|------|
|
||||
| `id` | bigint PK | 主键 |
|
||||
| `sub_plan_id` | bigint NOT NULL | 所属订阅计划(**原 `sub_plans` 注释混乱,已重命名+澄清**) |
|
||||
| `platform_id` | bigint NOT NULL | 平台ID(冗余) |
|
||||
| `payroll` | tinyint NOT NULL | 周期: 1=月付, 2=季付, 3=年付 |
|
||||
| `duration_months` | int NOT NULL | **新增** 实际月数: 1/3/12 |
|
||||
| `price` | decimal(10,2) | 售价 |
|
||||
| `original_price` | decimal(10,2) | **新增** 划线价(显示折扣用) |
|
||||
| `currency` | varchar(8) DEFAULT 'CNY' | 货币单位 |
|
||||
| `region` | varchar(64) | 适用地区 |
|
||||
| `is_active` | tinyint DEFAULT 1 | **新增** 0=下架, 1=上架 |
|
||||
| `del_flag` | char(1) DEFAULT '0' | **新增** 软删除 |
|
||||
| `create_time` | datetime | **新增** |
|
||||
| `update_time` | datetime | **新增** |
|
||||
|
||||
### 2.5 `as_sub_product` — 订阅产品(合租商品)
|
||||
|
||||
| 字段 | 类型 | 说明 |
|
||||
|------|------|------|
|
||||
| `id` | bigint PK | 主键 |
|
||||
| `title` | varchar(256) NOT NULL | 产品标题 |
|
||||
| `description` | varchar(1024) | 描述 |
|
||||
| `cover_image` | varchar(512) | **新增** 封面图 URL |
|
||||
| `tags` | varchar(256) | 标签(逗号分隔,**原字段名 `Tags` 大写 Bug 已修复**) |
|
||||
| `platform_id` | bigint NOT NULL | **新增** 所属平台(加速查询) |
|
||||
| `sub_plan_ids` | varchar(256) | 关联计划ID列表(逗号分隔,保留现状) |
|
||||
| `product_type` | tinyint NOT NULL DEFAULT 1 | 1=自营, 2=个人(**原为 Long,已修复**) |
|
||||
| `sub_type` | tinyint NOT NULL DEFAULT 1 | 1=单品, 2=多品组合(**原为 Long,已修复**) |
|
||||
| `total_capacity` | int NOT NULL DEFAULT 1 | **新增** 总席位数 |
|
||||
| `amount` | decimal(10,2) | 基准月价 |
|
||||
| `star` | decimal(3,1) DEFAULT 0.0 | 综合评分(由评价聚合更新) |
|
||||
| `status` | tinyint NOT NULL DEFAULT 0 | **新增** 0=草稿, 1=上架, 2=下架, 3=售完 |
|
||||
| `user_id` | bigint | 发布者用户ID |
|
||||
| `del_flag` | char(1) DEFAULT '0' | **新增** 软删除 |
|
||||
| `create_by` / `update_by` | varchar(64) | **新增** |
|
||||
| `create_time` / `update_time` | datetime | |
|
||||
|
||||
### 2.6 `as_sub_account` — 平台账号凭据
|
||||
|
||||
| 字段 | 类型 | 说明 |
|
||||
|------|------|------|
|
||||
| `id` | bigint PK | 主键 |
|
||||
| `product_id` | bigint | 关联产品ID |
|
||||
| `sub_plan_id` | bigint | 订阅计划ID(**原 int,已修复**) |
|
||||
| `sub_payroll_id` | bigint | 付费方案ID(**原 int,已修复**) |
|
||||
| `platform_id` | bigint NOT NULL | 平台ID(**原 int,已修复**) |
|
||||
| `user_id` | bigint NOT NULL | 账号持有者(**原 int,已修复**) |
|
||||
| `account_name` | varchar(256) NOT NULL | 平台登录用户名/邮箱 |
|
||||
| `account_passwd` | varchar(512) NOT NULL | 加密后的密码 |
|
||||
| `passwd_salt` | varchar(64) NOT NULL | 加密盐值(**原 int 已修复为 varchar(64)**) |
|
||||
| `encrypt_type` | tinyint NOT NULL DEFAULT 1 | **新增** 加密算法: 1=AES-256-GCM |
|
||||
| `region` | varchar(64) | 账号地区 |
|
||||
| `share_type` | tinyint | 分享类型 |
|
||||
| `account_type` | tinyint | 账号类型 |
|
||||
| `renew_date` | datetime | 账号下次续费日 |
|
||||
| `status` | tinyint NOT NULL DEFAULT 0 | **新增** 0=正常, 1=已失效, 2=异常/被封 |
|
||||
| `del_flag` | char(1) DEFAULT '0' | **新增** 软删除 |
|
||||
| `create_time` / `update_time` | datetime | **新增** |
|
||||
|
||||
### 2.7 `as_user_sub` — 合租槽(共享池)
|
||||
|
||||
> 语义修订:代表"一个共享席位池",不代表个人订阅。个人订阅记录见 `as_user_sub_member`。
|
||||
|
||||
| 字段 | 类型 | 说明 |
|
||||
|------|------|------|
|
||||
| `id` | bigint PK | 主键 |
|
||||
| `product_id` | bigint NOT NULL | **新增** 关联产品 |
|
||||
| `plan_id` | bigint NOT NULL | 订阅计划(**原 int,已修复**) |
|
||||
| `platform_id` | bigint NOT NULL | 平台(冗余) |
|
||||
| `host_user_id` | bigint NOT NULL | **重命名自 `user_id`**,车主用户ID(语义明确) |
|
||||
| `account_id` | bigint | **重命名自 `main_account`**,关联凭据(语义明确) |
|
||||
| `capacity` | int NOT NULL | 总席位数 |
|
||||
| `capacity_loaded` | int NOT NULL DEFAULT 0 | 已占用席位数 |
|
||||
| `region` | varchar(64) | 地区 |
|
||||
| `status` | tinyint NOT NULL DEFAULT 0 | **新增** 0=可加入, 1=已满, 2=已到期, 3=已关闭 |
|
||||
| `expire_time` | datetime | **新增** 合租槽到期时间 |
|
||||
| `remark` | varchar(512) | 车主说明(**原 int,已修复为 varchar**) |
|
||||
| `del_flag` | char(1) DEFAULT '0' | **新增** 软删除 |
|
||||
| `create_time` / `update_time` | datetime | **新增** |
|
||||
|
||||
### 2.8 `as_sub_product_comment` — 产品评价
|
||||
|
||||
| 字段 | 类型 | 说明 |
|
||||
|------|------|------|
|
||||
| `id` | bigint PK | 主键 |
|
||||
| `product_id` | bigint NOT NULL | 关联产品 |
|
||||
| `user_id` | bigint NOT NULL | 评价用户 |
|
||||
| `order_id` | bigint | **新增** 关联订单(验证是否购买过) |
|
||||
| `star` | tinyint NOT NULL | 评分 1-5 |
|
||||
| `comment` | varchar(1024) | 评价内容 |
|
||||
| `is_anonymous` | tinyint DEFAULT 0 | **新增** 0=公开, 1=匿名 |
|
||||
| `reply_id` | bigint | **新增** 回复的评价ID(追评/商家回复) |
|
||||
| `del_flag` | char(1) DEFAULT '0' | **新增** 软删除 |
|
||||
| `create_time` / `update_time` | datetime | |
|
||||
|
||||
### 2.9 `as_user_sub_member` — 个人订阅记录 【新增,原版最大缺失】
|
||||
|
||||
> 原版无此表,导致"哪些用户加入了哪个合租位"完全无法追踪。
|
||||
|
||||
| 字段 | 类型 | 说明 |
|
||||
|------|------|------|
|
||||
| `id` | bigint PK | 主键 |
|
||||
| `sub_id` | bigint NOT NULL | 所在合租槽(→ `as_user_sub.id`) |
|
||||
| `user_id` | bigint NOT NULL | 订阅用户 |
|
||||
| `order_id` | bigint NOT NULL | 来源订单(→ `as_order.id`) |
|
||||
| `payroll_id` | bigint NOT NULL | 购买的付费方案 |
|
||||
| `status` | tinyint NOT NULL DEFAULT 0 | 0=待激活, 1=使用中, 2=已到期, 3=已退订 |
|
||||
| `start_time` | datetime NOT NULL | 订阅开始时间 |
|
||||
| `expire_time` | datetime NOT NULL | 订阅到期时间 |
|
||||
| `del_flag` | char(1) DEFAULT '0' | 软删除 |
|
||||
| `create_time` / `update_time` | datetime | |
|
||||
| UK: `(sub_id, user_id)` | — | 同一合租槽同一用户只能有一条有效记录 |
|
||||
|
||||
### 2.10 `as_order` — 订单表 【新增】
|
||||
|
||||
| 字段 | 类型 | 说明 |
|
||||
|------|------|------|
|
||||
| `id` | bigint PK | 主键 |
|
||||
| `order_no` | varchar(32) UNIQUE | 业务订单号(AS+时间戳+随机) |
|
||||
| `user_id` | bigint NOT NULL | 购买用户 |
|
||||
| `product_id` | bigint NOT NULL | 商品 |
|
||||
| `payroll_id` | bigint NOT NULL | 付费方案 |
|
||||
| `original_amount` | decimal(10,2) | 原价快照(防价格变动) |
|
||||
| `discount_amount` | decimal(10,2) DEFAULT 0 | 优惠金额 |
|
||||
| `amount` | decimal(10,2) | 实付金额 |
|
||||
| `pay_type` | tinyint | 1=余额, 2=支付宝, 3=微信 |
|
||||
| `pay_no` | varchar(64) | 第三方支付单号 |
|
||||
| `status` | tinyint NOT NULL DEFAULT 0 | 0=待支付, 1=已支付, 2=已完成, 3=已退款, 4=已取消 |
|
||||
| `member_id` | bigint | 关联个人订阅记录(支付后填充) |
|
||||
| `expire_time` | datetime NOT NULL | 订单过期时间(默认 +15min)|
|
||||
| `pay_time` | datetime | 实际支付时间 |
|
||||
| `del_flag` | char(1) DEFAULT '0' | 软删除 |
|
||||
| `create_time` / `update_time` | datetime | |
|
||||
|
||||
**订单状态机:**
|
||||
```
|
||||
[待支付] → 15分钟超时 → [已取消]
|
||||
[待支付] → 支付成功 → [已支付] → 激活订阅 → [已完成]
|
||||
[已支付/已完成] → 退款 → [已退款]
|
||||
```
|
||||
|
||||
### 2.11 `as_wallet` — 用户钱包 【新增】
|
||||
|
||||
| 字段 | 类型 | 说明 |
|
||||
|------|------|------|
|
||||
| `id` | bigint PK | 主键 |
|
||||
| `user_id` | bigint UNIQUE | 用户(一人一钱包) |
|
||||
| `balance` | decimal(10,2) | 可用余额 |
|
||||
| `frozen_amount` | decimal(10,2) | 冻结金额 |
|
||||
| `total_income` | decimal(10,2) | 累计收入 |
|
||||
| `total_expense` | decimal(10,2) | 累计支出 |
|
||||
| `version` | int DEFAULT 0 | 乐观锁版本号(防并发余额错误) |
|
||||
| `create_time` / `update_time` | datetime | |
|
||||
|
||||
### 2.12 `as_wallet_log` — 钱包流水 【新增】
|
||||
|
||||
| 字段 | 类型 | 说明 |
|
||||
|------|------|------|
|
||||
| `id` | bigint PK | 主键 |
|
||||
| `user_id` | bigint NOT NULL | 用户 |
|
||||
| `amount` | decimal(10,2) | 金额(正=收入, 负=支出) |
|
||||
| `type` | tinyint | 1=充值, 2=消费, 3=退款, 4=邀请返现, 5=提现 |
|
||||
| `order_id` | bigint | 关联订单(可空) |
|
||||
| `balance_after` | decimal(10,2) | 操作后余额快照(对账用) |
|
||||
| `remark` | varchar(256) | 说明 |
|
||||
| `create_time` | datetime | |
|
||||
|
||||
### 2.13 `as_invite` — 邀请关系 【新增】
|
||||
|
||||
| 字段 | 类型 | 说明 |
|
||||
|------|------|------|
|
||||
| `id` | bigint PK | 主键 |
|
||||
| `inviter_id` | bigint NOT NULL | 邀请人 |
|
||||
| `invitee_id` | bigint NOT NULL UNIQUE | 被邀请人(一个人只有一条邀请记录) |
|
||||
| `invite_code` | varchar(16) | 使用的邀请码 |
|
||||
| `reward_amount` | decimal(10,2) | 返现金额 |
|
||||
| `reward_status` | tinyint DEFAULT 0 | 0=待发放, 1=已发放, 2=已失效 |
|
||||
| `reward_time` | datetime | 返现时间 |
|
||||
| `create_time` | datetime | 注册时间 |
|
||||
|
||||
### 2.14 `as_notification` — 系统通知 【新增】
|
||||
|
||||
| 字段 | 类型 | 说明 |
|
||||
|------|------|------|
|
||||
| `id` | bigint PK | 主键 |
|
||||
| `user_id` | bigint NOT NULL | 目标用户(0=全体广播) |
|
||||
| `title` | varchar(128) | 通知标题 |
|
||||
| `content` | varchar(1024) | 通知内容 |
|
||||
| `type` | tinyint | 1=续费提醒, 2=订单通知, 3=系统公告, 4=邀请奖励 |
|
||||
| `ref_id` | bigint | 关联业务ID(按 type 解析) |
|
||||
| `is_read` | tinyint DEFAULT 0 | 0=未读, 1=已读 |
|
||||
| `create_time` | datetime | |
|
||||
|
||||
---
|
||||
|
||||
## 三、完整 ER 关系图(v2.0)
|
||||
|
||||
```
|
||||
as_platform_type (1) ──< (N) as_platform [platform_type]
|
||||
as_platform (1) ──< (N) as_sub_plan [platform_id]
|
||||
as_sub_plan (1) ──< (N) as_sub_payroll [sub_plan_id]
|
||||
as_sub_plan (N) >──< (N) as_sub_product [sub_plan_ids 逗号分隔]
|
||||
as_platform (1) ──< (N) as_sub_product [platform_id 冗余]
|
||||
|
||||
as_sub_product (1) ──< (N) as_sub_product_comment [product_id]
|
||||
as_sub_product (1) ──< (N) as_sub_account [product_id]
|
||||
as_sub_product (1) ──< (N) as_user_sub [product_id]
|
||||
as_sub_plan (1) ──< (N) as_sub_account [sub_plan_id]
|
||||
as_sub_payroll (1) ──< (N) as_sub_account [sub_payroll_id]
|
||||
|
||||
as_user_sub (1) ──< (N) as_user_sub_member [sub_id] ← 新增关键表
|
||||
as_order (1) ──< (1) as_user_sub_member [order_id]
|
||||
as_sub_payroll (1) ──< (N) as_user_sub_member [payroll_id]
|
||||
|
||||
as_sub_product (1) ──< (N) as_order [product_id]
|
||||
as_sub_payroll (1) ──< (N) as_order [payroll_id]
|
||||
as_order (1) ──< (N) as_wallet_log [order_id]
|
||||
|
||||
app_user (1) ──< (1) as_wallet [user_id]
|
||||
as_wallet (1) ──< (N) as_wallet_log [user_id]
|
||||
|
||||
app_user (1) ──< (N) as_order [user_id]
|
||||
app_user (1) ──< (N) as_user_sub [as host] [host_user_id]
|
||||
app_user (1) ──< (N) as_user_sub_member [user_id]
|
||||
app_user (1) ──< (N) as_sub_product [user_id 发布者]
|
||||
app_user (1) ──< (N) as_sub_account [user_id 持有者]
|
||||
app_user (1) ──< (N) as_sub_product_comment [user_id]
|
||||
app_user (1) ──< (N) as_notification [user_id]
|
||||
|
||||
app_user (1) ──< (N) as_invite [as inviter] [inviter_id]
|
||||
app_user (1) ──< (1) as_invite [as invitee] [invitee_id]
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 四、`as_user_sub_member` 状态机
|
||||
|
||||
```
|
||||
购买成功(order paid)
|
||||
[待激活] ──────────────→ [使用中]
|
||||
│
|
||||
┌───────────┤
|
||||
│ │
|
||||
主动退订 到期
|
||||
│ │
|
||||
↓ ↓
|
||||
[已退订] [已到期]
|
||||
│
|
||||
续费
|
||||
│
|
||||
↓
|
||||
[使用中]
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 五、重要设计说明
|
||||
|
||||
### 5.1 容量管理与并发控制
|
||||
|
||||
**席位超卖防护:**
|
||||
- `as_sub_product.total_capacity` — 总席位(固定值)
|
||||
- `as_user_sub.capacity_loaded` — 已占用(购买时 +1,退订/到期时 -1)
|
||||
- 购买时通过 **乐观锁** 控制:
|
||||
```sql
|
||||
UPDATE as_user_sub
|
||||
SET capacity_loaded = capacity_loaded + 1
|
||||
WHERE id = ? AND capacity_loaded < capacity
|
||||
```
|
||||
更新行数 = 0 则说明已满,拒绝购买
|
||||
|
||||
### 5.2 账号凭据加密
|
||||
|
||||
- 算法:AES-256-GCM(`encrypt_type = 1`)
|
||||
- `account_passwd`:密文(Base64 编码)
|
||||
- `passwd_salt`:随机 IV(16字节,Base64 编码,**原 int 类型错误已修复**)
|
||||
- 密钥:存于服务端配置/环境变量,不入库
|
||||
|
||||
### 5.3 钱包余额并发控制
|
||||
|
||||
- `as_wallet.version` 字段实现乐观锁:
|
||||
```sql
|
||||
UPDATE as_wallet
|
||||
SET balance = balance - ?, version = version + 1
|
||||
WHERE user_id = ? AND version = ? AND balance >= ?
|
||||
```
|
||||
更新行数 = 0 则说明并发冲突或余额不足
|
||||
|
||||
### 5.4 订阅到期任务
|
||||
|
||||
定时任务(建议每日 02:00):
|
||||
```
|
||||
1. 查询 expire_time < now() + 7d 且 status = 1 的 as_user_sub_member
|
||||
→ 生成 as_notification(type=1,续费提醒)
|
||||
|
||||
2. 查询 expire_time < now() 且 status = 1 的 as_user_sub_member
|
||||
→ UPDATE status = 2(已到期)
|
||||
→ UPDATE as_user_sub SET capacity_loaded = capacity_loaded - 1
|
||||
```
|
||||
|
||||
### 5.5 评价限制
|
||||
|
||||
- 写评价前校验:`as_order` 存在且 `status IN (2,3)` 且 `user_id` 匹配
|
||||
- `star` 范围 1-5,服务端强制校验
|
||||
- `as_sub_product.star` 由定时任务或触发器聚合更新(AVG)
|
||||
|
||||
---
|
||||
|
||||
## 六、数据库表总览(v2.0)
|
||||
|
||||
| # | 表名 | 类型 | 状态 |
|
||||
|---|------|------|------|
|
||||
| 1 | `app_user` | App基础 | 追加2字段 |
|
||||
| 2 | `app_role` | App基础 | 沿用 |
|
||||
| 3 | `app_user_role` | App基础 | 沿用 |
|
||||
| 4 | `app_social_details` | App基础 | 沿用 |
|
||||
| 5 | `app_article_category` | App基础 | 沿用 |
|
||||
| 6 | `app_article` | App基础 | 沿用 |
|
||||
| 7 | `app_article_collect` | App基础 | 沿用 |
|
||||
| 8 | `app_page` | App基础 | 沿用 |
|
||||
| 9 | `app_tabbar` | App基础 | 沿用 |
|
||||
| 10 | `as_platform_type` | 业务 | 修订 |
|
||||
| 11 | `as_platform` | 业务 | 修订 |
|
||||
| 12 | `as_sub_plan` | 业务 | 修订 |
|
||||
| 13 | `as_sub_payroll` | 业务 | 修订 |
|
||||
| 14 | `as_sub_product` | 业务 | 修订 |
|
||||
| 15 | `as_sub_account` | 业务 | 修订 |
|
||||
| 16 | `as_user_sub` | 业务 | 修订(语义重定义) |
|
||||
| 17 | `as_sub_product_comment` | 业务 | 修订 |
|
||||
| 18 | `as_user_sub_member` | 业务 | **新增** |
|
||||
| 19 | `as_order` | 业务 | **新增** |
|
||||
| 20 | `as_wallet` | 业务 | **新增** |
|
||||
| 21 | `as_wallet_log` | 业务 | **新增** |
|
||||
| 22 | `as_invite` | 业务 | **新增** |
|
||||
| 23 | `as_notification` | 业务 | **新增** |
|
||||
|
||||
合计:9 张 App 基础表 + 14 张业务表 = **23 张表**
|
||||
21
LICENSE
Normal file
21
LICENSE
Normal file
@@ -0,0 +1,21 @@
|
||||
Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
|
||||
协议和授权
|
||||
pigX并非一个开源软件,作者保留全部的权利。
|
||||
擅自窃用,即属严重侵权行为,与盗窃无异。产生的一切任何后果责任由侵权者自负。
|
||||
|
||||
|
||||
|
||||
🌹权益
|
||||
个人学习、毕设
|
||||
|
||||
|
||||
🚫禁止
|
||||
将本项目的部分或全部代码和资源进行任何形式的再发行(尤其上传GitHub、Gitee )
|
||||
利用本项目的部分或全部代码和资源进行任何商业行为
|
||||
|
||||
免责声明
|
||||
|
||||
PigX 未对任何组织、团队,书面授权商业使用。如若出现任何商业后果、纠纷和本人无关,特此声明
|
||||
|
||||
Author: lengleng (wangiegie@gmail.com)
|
||||
371
SYSTEM_DESIGN.md
371
SYSTEM_DESIGN.md
@@ -1,371 +0,0 @@
|
||||
# iShare 系统设计文档
|
||||
|
||||
> 优先级:最高(先于所有开发任务)
|
||||
> 版本:v1.0
|
||||
> 日期:2026-02-17
|
||||
|
||||
---
|
||||
|
||||
## 一、系统角色
|
||||
|
||||
| 角色 | 说明 |
|
||||
|------|------|
|
||||
| **普通用户** | 注册登录,购买合租商品,获取账号凭据 |
|
||||
| **车主(发布者)** | 发布自己的合租位(个人拼车广场) |
|
||||
| **平台运营(管理员)** | 管理平台数据、自营商品、用户、订单 |
|
||||
| **超级管理员** | 全局配置,含财务、权限管理 |
|
||||
|
||||
---
|
||||
|
||||
## 二、功能模块清单
|
||||
|
||||
### 2.1 用户端 H5 功能
|
||||
|
||||
| 模块 | 功能点 |
|
||||
|------|--------|
|
||||
| **账号** | 手机号注册/登录、邮箱注册/登录、找回密码(验证码)、微信/社交登录(二期) |
|
||||
| **首页** | 平台分类Tab、推荐商品卡片、Banner 广告位、热门合租榜 |
|
||||
| **商品列表** | 按平台类型筛选、按价格/评分排序、关键词搜索 |
|
||||
| **商品详情** | 平台介绍、套餐选择(月/季/年)、评价列表、剩余席位数、立即购买 |
|
||||
| **购买流程** | 选套餐 → 确认订单 → 支付(余额/在线支付)→ 获取账号凭据 |
|
||||
| **我的订阅** | 当前有效订阅列表、账号凭据查看、续费、退订 |
|
||||
| **广场/拼车** | 浏览他人发起的合租位、申请加入、发起自己的合租 |
|
||||
| **推广中心** | 邀请码、邀请记录、返现奖励记录 |
|
||||
| **钱包** | 余额查看、充值、提现(二期)、流水记录 |
|
||||
| **通知** | 续费提醒、订单状态变更、系统公告 |
|
||||
| **个人中心** | 基本信息编辑、头像、安全设置(改密)、退出登录 |
|
||||
|
||||
### 2.2 管理后台功能
|
||||
|
||||
| 模块 | 功能点 |
|
||||
|------|--------|
|
||||
| **平台管理** | 平台CRUD、平台分类CRUD、图标上传 |
|
||||
| **订阅计划管理** | 计划CRUD、付费方案CRUD(多地区/多货币) |
|
||||
| **自营商品管理** | 商品CRUD、上下架、库存(账号)管理、绑定账号凭据 |
|
||||
| **订单管理** | 订单列表、状态查看、人工审核、退款处理 |
|
||||
| **用户管理** | 用户列表、封禁/解封、余额调整、查看订阅记录 |
|
||||
| **评价管理** | 评价列表、违规删除 |
|
||||
| **财务管理** | 收入统计、提现申请审核(二期)、优惠券管理(二期) |
|
||||
| **通知配置** | 系统通知模板、续费提醒开关 |
|
||||
| **系统配置** | 站点信息、支付配置、短信/邮件配置 |
|
||||
|
||||
---
|
||||
|
||||
## 三、核心业务流程
|
||||
|
||||
### 3.1 用户注册/登录
|
||||
|
||||
```
|
||||
[用户] → 输入手机/邮箱
|
||||
→ 获取验证码(短信/邮件)
|
||||
→ 验证 → 首次登录自动注册 app_user
|
||||
→ 生成 JWT Token(复用 pigx-auth)
|
||||
→ 进入首页
|
||||
```
|
||||
|
||||
### 3.2 购买合租商品(核心流程)
|
||||
|
||||
```
|
||||
[用户] → 浏览商品列表(as_sub_product, status=上架)
|
||||
→ 商品详情页
|
||||
├── 查看剩余席位 = capacity - capacity_loaded(来自 as_user_sub 聚合)
|
||||
└── 选择付费方案(as_sub_payroll)
|
||||
→ 点击"立即购买"
|
||||
→ 创建订单(as_order, status=待支付)
|
||||
→ 支付
|
||||
├── 余额支付 → 扣减 as_wallet.balance
|
||||
└── 在线支付 → 支付宝/微信回调 → 更新订单状态
|
||||
→ 支付成功
|
||||
├── 订单状态 → 已支付 → 使用中
|
||||
├── 创建 as_user_sub 记录(capacity_loaded +1)
|
||||
├── 返回账号凭据(as_sub_account 解密后展示)
|
||||
└── 推送通知(订阅成功)
|
||||
```
|
||||
|
||||
### 3.3 账号凭据查看
|
||||
|
||||
```
|
||||
[用户] → "我的订阅" → 选择订阅
|
||||
→ 验证身份(二次密码/生物识别,可选)
|
||||
→ 从 as_sub_account 查询 account_name + account_passwd
|
||||
→ AES 解密 account_passwd(服务端解密,不返回明文密钥)
|
||||
→ 展示账号密码(可设置自动隐藏倒计时)
|
||||
```
|
||||
|
||||
### 3.4 订阅到期/续费
|
||||
|
||||
```
|
||||
[定时任务(每日凌晨)]
|
||||
→ 扫描 as_user_sub.expire_time < now() + 7天
|
||||
→ 发送续费提醒通知(as_notification)
|
||||
→ 到期当日:as_user_sub.status = expired
|
||||
→ capacity_loaded -1(释放席位)
|
||||
|
||||
[用户续费]
|
||||
→ 进入"我的订阅" → 点击续费
|
||||
→ 选择续费套餐 → 走购买流程(复用)
|
||||
→ 续费成功:as_user_sub.expire_time 延长
|
||||
```
|
||||
|
||||
### 3.5 广场拼车(个人发布)
|
||||
|
||||
```
|
||||
[车主]
|
||||
→ 填写合租信息(平台、计划、价格、总席位数、说明)
|
||||
→ 创建 as_sub_product(product_type=2 个人)
|
||||
→ 提交审核 → 管理员审核通过 → 上架(status=active)
|
||||
|
||||
[拼车者]
|
||||
→ 广场浏览 → 找到心仪的拼车
|
||||
→ 申请加入 → 走购买流程
|
||||
→ 成功后 → 车主将账号凭据录入 as_sub_account
|
||||
→ 拼车者可查看凭据
|
||||
```
|
||||
|
||||
### 3.6 推广/邀请
|
||||
|
||||
```
|
||||
[用户A] → 分享邀请码/链接
|
||||
[用户B] → 点击链接注册
|
||||
→ as_invite 记录(inviter=A, invitee=B)
|
||||
[用户B首次购买成功]
|
||||
→ 触发返现奖励
|
||||
→ as_wallet_log 记录(用户A 获得返现)
|
||||
→ as_wallet.balance 增加
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 四、数据库设计(完整版)
|
||||
|
||||
### 4.1 现有表评审与修订
|
||||
|
||||
#### ⚠️ 现有设计问题
|
||||
|
||||
| 表 | 问题 | 修订方案 |
|
||||
|----|------|----------|
|
||||
| `as_sub_account` | `passwd_salt` 是 int,不够安全;缺加密字段标记 | 改为 varchar salt,加 `encrypt_type` 字段 |
|
||||
| `as_sub_account` | 缺 `status` 字段(账号可能失效/被封) | 加 `status`: 0=正常,1=失效,2=异常 |
|
||||
| `as_user_sub` | 缺 `status`、`start_time`、`expire_time` | 补充状态和时间字段 |
|
||||
| `as_user_sub` | `remark` 字段类型是 int(应为 varchar) | 改为 varchar |
|
||||
| `as_sub_product` | 缺 `status`(上架/下架/售完)、`available_seats` | 补充状态和实时剩余席位 |
|
||||
| `as_sub_product` | `sub_plan_ids` 用逗号分隔(反范式) | 评估是否改为关联表(影响查询) |
|
||||
| `as_sub_payroll` | 缺促销价/折扣字段 | 加 `original_price`、`discount_rate` |
|
||||
| `as_platform_type` | `platform_type` 是 int,0=全部 含义混乱 | 改用独立 sort_order + is_all 标志位 |
|
||||
|
||||
### 4.2 核心业务表(完整版)
|
||||
|
||||
#### 保留现有(修订后)
|
||||
|
||||
- `as_platform`
|
||||
- `as_platform_type`
|
||||
- `as_sub_plan`
|
||||
- `as_sub_payroll`(加 original_price, discount_rate)
|
||||
- `as_sub_account`(加 status, encrypt_type, 改 passwd_salt 为 varchar)
|
||||
- `as_sub_product`(加 status, available_seats)
|
||||
- `as_sub_product_comment`
|
||||
- `as_user_sub`(加 status, start_time, expire_time, 改 remark 为 varchar)
|
||||
|
||||
#### 新增表
|
||||
|
||||
---
|
||||
|
||||
### `as_order` — 订单表
|
||||
|
||||
| 字段 | 类型 | 说明 |
|
||||
|------|------|------|
|
||||
| `id` | bigint PK | 订单ID |
|
||||
| `order_no` | varchar(32) | 订单号(唯一,业务用) |
|
||||
| `user_id` | bigint | 购买用户 |
|
||||
| `product_id` | bigint | 商品ID (as_sub_product) |
|
||||
| `payroll_id` | bigint | 付费方案ID (as_sub_payroll) |
|
||||
| `amount` | decimal(10,2) | 实付金额 |
|
||||
| `original_amount` | decimal(10,2) | 原价 |
|
||||
| `discount_amount` | decimal(10,2) | 优惠金额 |
|
||||
| `pay_type` | tinyint | 支付方式: 1=余额, 2=支付宝, 3=微信 |
|
||||
| `pay_no` | varchar(64) | 第三方支付单号 |
|
||||
| `status` | tinyint | 0=待支付, 1=已支付, 2=已完成, 3=已退款, 4=已取消 |
|
||||
| `user_sub_id` | bigint | 关联的用户订阅ID (创建后填充) |
|
||||
| `remark` | varchar | 备注 |
|
||||
| `expire_time` | datetime | 订单过期时间(未支付自动取消) |
|
||||
| `pay_time` | datetime | 支付时间 |
|
||||
| `create_time` | datetime | |
|
||||
| `update_time` | datetime | |
|
||||
|
||||
---
|
||||
|
||||
### `as_wallet` — 用户钱包
|
||||
|
||||
| 字段 | 类型 | 说明 |
|
||||
|------|------|------|
|
||||
| `id` | bigint PK | |
|
||||
| `user_id` | bigint UNIQUE | 用户ID(一人一钱包) |
|
||||
| `balance` | decimal(10,2) | 可用余额 |
|
||||
| `frozen_amount` | decimal(10,2) | 冻结金额(待退款/提现) |
|
||||
| `total_income` | decimal(10,2) | 累计收入 |
|
||||
| `total_expense` | decimal(10,2) | 累计支出 |
|
||||
| `create_time` | datetime | |
|
||||
| `update_time` | datetime | |
|
||||
|
||||
---
|
||||
|
||||
### `as_wallet_log` — 钱包流水
|
||||
|
||||
| 字段 | 类型 | 说明 |
|
||||
|------|------|------|
|
||||
| `id` | bigint PK | |
|
||||
| `user_id` | bigint | 用户ID |
|
||||
| `amount` | decimal(10,2) | 金额(正=收入,负=支出) |
|
||||
| `type` | tinyint | 1=充值, 2=消费, 3=退款, 4=邀请返现, 5=提现 |
|
||||
| `order_id` | bigint | 关联订单ID(可空) |
|
||||
| `balance_after` | decimal(10,2) | 操作后余额(快照) |
|
||||
| `remark` | varchar | 说明(如"订阅 Netflix 高级版") |
|
||||
| `create_time` | datetime | |
|
||||
|
||||
---
|
||||
|
||||
### `as_invite` — 邀请关系
|
||||
|
||||
| 字段 | 类型 | 说明 |
|
||||
|------|------|------|
|
||||
| `id` | bigint PK | |
|
||||
| `inviter_id` | bigint | 邀请人用户ID |
|
||||
| `invitee_id` | bigint | 被邀请人用户ID |
|
||||
| `invite_code` | varchar(16) | 使用的邀请码 |
|
||||
| `reward_amount` | decimal(10,2) | 返现金额 |
|
||||
| `reward_status` | tinyint | 0=待发放, 1=已发放(首次购买后触发) |
|
||||
| `create_time` | datetime | |
|
||||
| `reward_time` | datetime | 返现时间 |
|
||||
|
||||
---
|
||||
|
||||
### `as_notification` — 通知消息
|
||||
|
||||
| 字段 | 类型 | 说明 |
|
||||
|------|------|------|
|
||||
| `id` | bigint PK | |
|
||||
| `user_id` | bigint | 目标用户ID(0=全部用户) |
|
||||
| `title` | varchar | 通知标题 |
|
||||
| `content` | varchar | 通知内容 |
|
||||
| `type` | tinyint | 1=续费提醒, 2=订单通知, 3=系统公告, 4=邀请奖励 |
|
||||
| `ref_id` | bigint | 关联业务ID(如订单ID、订阅ID) |
|
||||
| `is_read` | tinyint | 0=未读, 1=已读 |
|
||||
| `create_time` | datetime | |
|
||||
|
||||
---
|
||||
|
||||
### `app_user` 字段补充
|
||||
|
||||
在现有 PigX 的 `app_user` 表上,补充以下字段(via ALTER):
|
||||
|
||||
| 字段 | 类型 | 说明 |
|
||||
|------|------|------|
|
||||
| `invite_code` | varchar(16) UNIQUE | 用户的专属邀请码(注册时生成) |
|
||||
| `inviter_id` | bigint | 邀请人用户ID(注册时记录) |
|
||||
|
||||
---
|
||||
|
||||
### 4.3 完整 ER 关系图
|
||||
|
||||
```
|
||||
as_platform_type (1) ──< (N) as_platform [platform_type]
|
||||
as_platform (1) ──< (N) as_sub_plan [platform_id]
|
||||
as_sub_plan (1) ──< (N) as_sub_payroll [sub_plans]
|
||||
as_sub_plan (N) >──< (N) as_sub_product [sub_plan_ids]
|
||||
as_sub_product (1) ──< (N) as_sub_product_comment [product_id]
|
||||
as_sub_product (1) ──< (N) as_sub_account [product_id]
|
||||
as_sub_plan (1) ──< (N) as_sub_account [sub_plan_id]
|
||||
as_sub_payroll (1) ──< (N) as_sub_account [sub_payroll_id]
|
||||
|
||||
as_sub_product (1) ──< (N) as_order [product_id]
|
||||
as_sub_payroll (1) ──< (N) as_order [payroll_id]
|
||||
as_order (1) ──< (1) as_user_sub [user_sub_id]
|
||||
|
||||
as_sub_plan (1) ──< (N) as_user_sub [plan_id]
|
||||
as_sub_account (1) ──< (N) as_user_sub [main_account]
|
||||
|
||||
app_user (1) ──< (1) as_wallet [user_id]
|
||||
as_wallet (1) ──< (N) as_wallet_log [user_id]
|
||||
as_order (1) ──< (N) as_wallet_log [order_id]
|
||||
|
||||
app_user (1) ──< (N) as_order [user_id]
|
||||
app_user (1) ──< (N) as_user_sub [user_id]
|
||||
app_user (1) ──< (N) as_sub_product [user_id — 发布者]
|
||||
app_user (1) ──< (N) as_sub_account [user_id — 账号持有者]
|
||||
app_user (1) ──< (N) as_sub_product_comment [user_id]
|
||||
app_user (1) ──< (N) as_notification [user_id]
|
||||
|
||||
app_user (1) ──< (N) as_invite [as inviter] [inviter_id]
|
||||
app_user (1) ──< (1) as_invite [as invitee] [invitee_id]
|
||||
```
|
||||
|
||||
### 4.4 `as_user_sub` 状态机
|
||||
|
||||
```
|
||||
购买成功
|
||||
[pending] ──────→ [active] ──→ 到期 ──→ [expired]
|
||||
│ │
|
||||
│ 退款/申请退订 │ 续费
|
||||
↓ ↓
|
||||
[cancelled] [active]
|
||||
```
|
||||
|
||||
状态值:0=待激活, 1=使用中, 2=已到期, 3=已退订
|
||||
|
||||
### 4.5 `as_order` 状态机
|
||||
|
||||
```
|
||||
[pending] → 15分钟未支付 → [cancelled]
|
||||
[pending] → 支付成功 → [paid] → 激活订阅成功 → [completed]
|
||||
[paid/completed] → 退款申请 → 审核通过 → [refunded]
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 五、接口设计要点
|
||||
|
||||
### 5.1 账号凭据安全
|
||||
|
||||
- `account_passwd` 使用 **AES-256-GCM** 加密存储
|
||||
- 密钥由服务端持有(存配置中心/环境变量),不入库
|
||||
- `passwd_salt` 用于 AES 的 IV(改为 varchar(32),16字节随机)
|
||||
- 凭据查看接口:仅限订阅状态为 `active` 的用户,且需校验 `as_user_sub.user_id == currentUser`
|
||||
- 返回解密后的明文,但 **不记录日志**(防止泄露)
|
||||
|
||||
### 5.2 席位并发控制
|
||||
|
||||
- 购买时使用 **数据库乐观锁** 或 **Redis 分布式锁** 防止超卖
|
||||
- `as_sub_product.available_seats` 在下单时 -1(乐观锁 version 字段)
|
||||
- 订单取消/超时后 +1 回补
|
||||
|
||||
### 5.3 价格一致性
|
||||
|
||||
- 订单金额在创建时 **快照** 到 `as_order.amount`
|
||||
- 不依赖付费方案的实时价格(防止价格变动导致差异)
|
||||
|
||||
---
|
||||
|
||||
## 六、设计待决策项(需 Ami 确认)
|
||||
|
||||
| # | 问题 | 选项 |
|
||||
|---|------|------|
|
||||
| 1 | 付费方式一期支持哪些? | A) 仅余额(人工充值)B) 余额+支付宝 C) 三种都支持 |
|
||||
| 2 | 拼车广场是否需要审核流程? | A) 管理员审核 B) 自动上架 C) 仅自营,无拼车广场 |
|
||||
| 3 | 账号凭据展示方式? | A) 直接明文 B) 需二次验证(短信/密码)C) 限时展示(30s后隐藏)|
|
||||
| 4 | 邀请返现比例和条件? | 需定义:返现金额/比例,是否有上限 |
|
||||
| 5 | `as_sub_product` 的多计划关联是否改为关联表? | A) 保持逗号分隔(简单)B) 改关联表(规范,便于查询)|
|
||||
| 6 | 提现功能是否一期上线? | A) 一期上 B) 二期(一期只充值不提现)|
|
||||
|
||||
---
|
||||
|
||||
## 七、调整后的项目阶段
|
||||
|
||||
| 阶段 | 内容 | 时间 |
|
||||
|------|------|------|
|
||||
| **Phase D(当前·最高优先)** | 系统设计:功能清单 + 业务流程 + 数据库设计 | 进行中 |
|
||||
| **Phase 0** | 环境搭建:仓库 + Fork PigX + CI/CD + 建库 SQL | D 完成后 |
|
||||
| **Phase 1** | 后端核心 CRUD API | 1-2周 |
|
||||
| **Phase 2** | 管理后台前端 | 1周 |
|
||||
| **Phase 3** | 用户端 H5 | 2-3周 |
|
||||
| **Phase 4** | 支付集成 | 按需 |
|
||||
| **Phase 5** | 测试 + 上线 | — |
|
||||
@@ -1,71 +0,0 @@
|
||||
# 工作总结 - 2026-02-16
|
||||
|
||||
## 项目概述
|
||||
|
||||
**iShare** - 流媒体账号合租平台
|
||||
|
||||
## 今日完成的工作
|
||||
|
||||
### 1. 项目发现与信息记录
|
||||
- 发现项目位置:`/Users/mini/Work/ClaudeCowork/`
|
||||
- 记录到 MEMORY.md 和 TOOLS.md
|
||||
- 记录 Gitea 仓库信息(https://git.puro.im)
|
||||
|
||||
### 2. 代码版本对比与整理
|
||||
- 对比三个版本:ishare (2023-06), as-sys (2024-03), ishare-sys (2026-02)
|
||||
- 确定最新版本:ishare-sys(111个Java文件,功能最完整)
|
||||
- 复制到新目录:`new_pigx_iShare`
|
||||
|
||||
### 3. 数据库设计提取
|
||||
- 分析 as-app-server 模块(新增的核心业务模块)
|
||||
- 识别 17 张表(8个业务表 + 9个App基础表)
|
||||
- 生成 DATABASE_DESIGN.md 文档
|
||||
- 核心业务链路:平台类型 → 平台 → 订阅计划 → 付费方案 → 订阅账号 → 订阅产品 → 用户订阅
|
||||
|
||||
### 4. 代码修复与 SQL 生成
|
||||
- 修复 `AsSubProductComment.java` 的 `@TableName` 注解错误
|
||||
- 生成完整建表 SQL:`db/ishare_schema.sql`
|
||||
|
||||
### 5. Git 仓库管理
|
||||
- 创建 pigx_ishare 仓库
|
||||
- master 分支:README.md + 设计文档
|
||||
- pigx_ishare 分支:完整项目代码(1910文件,21.8万行)
|
||||
- 备份 PigX 原版框架到独立仓库
|
||||
|
||||
### 6. 配置优化
|
||||
- 更新 OpenClaw 模型配置:主会话 Sonnet 4.5,子代理 Opus 4.6
|
||||
|
||||
## 项目结构
|
||||
|
||||
```
|
||||
new_pigx_iShare/
|
||||
├── as-app-server/ # 核心业务模块(新增)
|
||||
├── as-gateway/ # 网关
|
||||
├── as-upms/ # 权限管理
|
||||
├── pigx-auth/ # 认证服务
|
||||
├── pigx-common/ # 公共模块
|
||||
├── db/
|
||||
│ └── ishare_schema.sql # 建表脚本
|
||||
├── DATABASE_DESIGN.md # 数据库设计文档
|
||||
└── README.md # 项目说明
|
||||
```
|
||||
|
||||
## 技术栈
|
||||
|
||||
- 基于 **PigX 5.2** 企业级框架
|
||||
- 后端:Spring Boot + MyBatis Plus
|
||||
- 数据库:MySQL(utf8mb4)
|
||||
- 前端:Vue(pigx-ui)
|
||||
|
||||
## 下一步计划
|
||||
|
||||
- [ ] 完善业务逻辑实现
|
||||
- [ ] 前端页面开发
|
||||
- [ ] API 接口对接
|
||||
- [ ] 测试环境部署
|
||||
|
||||
## 重要链接
|
||||
|
||||
- Gitea 仓库:https://git.puro.im/purovps/pigx_ishare
|
||||
- 代码分支:https://git.puro.im/purovps/pigx_ishare/src/branch/pigx_ishare
|
||||
- PigX 备份:https://git.puro.im/purovps/pigx
|
||||
37
as-app-server/as-app-server-api/pom.xml
Normal file
37
as-app-server/as-app-server-api/pom.xml
Normal file
@@ -0,0 +1,37 @@
|
||||
<?xml version="1.0"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
|
||||
http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>as-app-server</artifactId>
|
||||
<version>5.2.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>as-app-server-api</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<!--core 工具类-->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-core</artifactId>
|
||||
</dependency>
|
||||
<!--mybatis plus extension,包含了mybatis plus core-->
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-extension</artifactId>
|
||||
</dependency>
|
||||
<!--feign 工具类-->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-feign</artifactId>
|
||||
</dependency>
|
||||
<!-- excel 导入导出 -->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-excel</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.pig4cloud.pigx.app.api.dto;
|
||||
|
||||
import com.pig4cloud.pigx.app.api.entity.AppUser;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Schema(description = "APP用户传输对象")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class AppUserDTO extends AppUser {
|
||||
|
||||
/**
|
||||
* 角色ID
|
||||
*/
|
||||
@Schema(description = "角色id集合")
|
||||
private List<Long> role;
|
||||
|
||||
/**
|
||||
* 新密码
|
||||
*/
|
||||
@Schema(description = "新密码")
|
||||
private String newpassword1;
|
||||
|
||||
@Schema(description = "验证码")
|
||||
private String mobileCode;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.app.api.dto;
|
||||
|
||||
import com.pig4cloud.pigx.app.api.entity.AppUser;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author lengleng
|
||||
* @date 2017/11/11
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "用户信息")
|
||||
public class AppUserInfo implements Serializable {
|
||||
|
||||
/**
|
||||
* 用户基本信息
|
||||
*/
|
||||
@Schema(description = "用户基本信息")
|
||||
private AppUser appUser;
|
||||
|
||||
/**
|
||||
* 权限标识集合
|
||||
*/
|
||||
@Schema(description = "权限标识集合")
|
||||
private String[] permissions;
|
||||
|
||||
/**
|
||||
* 角色集合
|
||||
*/
|
||||
@Schema(description = "角色标识集合")
|
||||
private Long[] roles;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package com.pig4cloud.pigx.app.api.dto;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author ami
|
||||
* @date 2023/10
|
||||
*/
|
||||
@Data
|
||||
public class AppUserInfoDto implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description = "userId")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
@Schema(description = "用户名")
|
||||
private String username;
|
||||
|
||||
/**
|
||||
* 手机号 -> 加密&模糊梳理
|
||||
*/
|
||||
// @Schema(description = "手机号")
|
||||
// private String phone;
|
||||
|
||||
/**
|
||||
* 头像
|
||||
*/
|
||||
@Schema(description = "头像")
|
||||
private String avatar;
|
||||
|
||||
/**
|
||||
* 昵称
|
||||
*/
|
||||
@Schema(description = "拓展字段:昵称")
|
||||
private String nickname;
|
||||
|
||||
/**
|
||||
* 邮箱 -> 加密&模糊梳理
|
||||
*/
|
||||
@Schema(description = "拓展字段:邮箱")
|
||||
private String email;
|
||||
|
||||
/**
|
||||
* 所属租户
|
||||
*/
|
||||
// @Schema(description = "所属租户", hidden = true)
|
||||
// private Long tenantId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.pig4cloud.pigx.app.api.dto;
|
||||
|
||||
import com.pig4cloud.pigx.app.api.entity.as.AsSubProduct;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Schema(description = "网站首页数据传输对象")
|
||||
public class AsInitDTO {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
|
||||
//合租产品信息
|
||||
//title price desc icon orderType/自营/个人
|
||||
|
||||
private List<AsSubProduct> products;
|
||||
private List<SubOrderDTO> orders;
|
||||
|
||||
|
||||
//合租订单展示
|
||||
//title desc price
|
||||
//用户评价
|
||||
//用户名 头像 使用时常(上车时间) 评论时间 评分?
|
||||
|
||||
//最近订单?ws推送
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.pig4cloud.pigx.app.api.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Schema(description = "订阅统计数据传输对象")
|
||||
public class AsUserSubDTO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 订阅数量
|
||||
*/
|
||||
private Integer subCount;
|
||||
/**
|
||||
* 平台id
|
||||
*/
|
||||
private Integer platformId;
|
||||
/**
|
||||
* 平台名称
|
||||
*/
|
||||
private String platformName;
|
||||
private String subPrice;
|
||||
private String title;
|
||||
private List<SubComment> comments;//object
|
||||
private List<RealTimeOrder> realTimeOrders;//object
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.pig4cloud.pigx.app.api.dto;
|
||||
|
||||
/**
|
||||
* 首页实时订单
|
||||
*/
|
||||
public class RealTimeOrder {
|
||||
|
||||
//order time
|
||||
|
||||
//platform id
|
||||
|
||||
//subtype id
|
||||
|
||||
//user id
|
||||
|
||||
//avatar
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.pig4cloud.pigx.app.api.dto;
|
||||
|
||||
/**
|
||||
* 订阅评价
|
||||
*/
|
||||
public class SubComment {
|
||||
|
||||
//comment time
|
||||
|
||||
//comment
|
||||
|
||||
//id
|
||||
|
||||
//avatar
|
||||
|
||||
//name
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.pig4cloud.pigx.app.api.dto;
|
||||
|
||||
/**
|
||||
* 订阅订单DTO
|
||||
*/
|
||||
public class SubOrderDTO {
|
||||
|
||||
//order time
|
||||
|
||||
//platform id
|
||||
|
||||
//subtype id
|
||||
|
||||
//user id
|
||||
|
||||
//avatar
|
||||
|
||||
//comment
|
||||
|
||||
//star
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package com.pig4cloud.pigx.app.api.dto;
|
||||
|
||||
/**
|
||||
* 订阅产品DTO
|
||||
*/
|
||||
public class SubProductDTO {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
package com.pig4cloud.pigx.app.api.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 文章分类表
|
||||
*
|
||||
* @author pig
|
||||
* @date 2023-06-07 16:28:03
|
||||
*/
|
||||
@Data
|
||||
@TableName("app_article_category")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "文章分类表")
|
||||
public class AppArticleCategoryEntity extends Model<AppArticleCategoryEntity> {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description = "主键")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@Schema(description = "名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
@Schema(description = "排序")
|
||||
private Integer sort;
|
||||
|
||||
/**
|
||||
* 是否显示: 0=否, 1=是
|
||||
*/
|
||||
@Schema(description = "是否显示: 0=否, 1=是")
|
||||
private Integer isShow;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description = "更新人")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description = "更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 是否删除: 0=否, 1=是
|
||||
*/
|
||||
@TableLogic
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "是否删除: 0=否, 1=是")
|
||||
private String delFlag;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
package com.pig4cloud.pigx.app.api.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 文章收藏表
|
||||
*
|
||||
* @author pig
|
||||
* @date 2023-06-16 14:33:41
|
||||
*/
|
||||
@Data
|
||||
@TableName("app_article_collect")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "文章收藏表")
|
||||
public class AppArticleCollectEntity extends Model<AppArticleCollectEntity> {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description = "主键")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
@Schema(description = "用户ID")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 文章ID
|
||||
*/
|
||||
@Schema(description = "文章ID")
|
||||
private Long articleId;
|
||||
|
||||
/**
|
||||
* 文章标题
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description = "更新人")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description = "更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
@TableLogic
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "是否删除")
|
||||
private String delFlag;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,134 @@
|
||||
package com.pig4cloud.pigx.app.api.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.FieldNameConstants;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 文章资讯
|
||||
*
|
||||
* @author pig
|
||||
* @date 2023-06-07 16:32:35
|
||||
*/
|
||||
@Data
|
||||
@FieldNameConstants
|
||||
@TableName("app_article")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "文章资讯")
|
||||
public class AppArticleEntity extends Model<AppArticleEntity> {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description = "主键")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 分类
|
||||
*/
|
||||
@Schema(description = "分类")
|
||||
private Long cid;
|
||||
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
@Schema(description = "标题")
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* 简介
|
||||
*/
|
||||
@Schema(description = "简介")
|
||||
private String intro;
|
||||
|
||||
/**
|
||||
* 摘要
|
||||
*/
|
||||
@Schema(description = "摘要")
|
||||
private String summary;
|
||||
|
||||
/**
|
||||
* 封面
|
||||
*/
|
||||
@Schema(description = "封面")
|
||||
private String image;
|
||||
|
||||
/**
|
||||
* 内容
|
||||
*/
|
||||
@Schema(description = "内容")
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* 作者
|
||||
*/
|
||||
@Schema(description = "作者")
|
||||
private String author;
|
||||
|
||||
/**
|
||||
* 浏览
|
||||
*/
|
||||
@Schema(description = "浏览")
|
||||
private Integer visit;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
@Schema(description = "排序")
|
||||
private Integer sort;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description = "更新人")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description = "更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 删除时间
|
||||
*/
|
||||
@TableLogic
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "删除标志")
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 当前用户是否已收藏
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private boolean collect;
|
||||
|
||||
/**
|
||||
* 分类名称
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String cname;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
package com.pig4cloud.pigx.app.api.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 页面
|
||||
*
|
||||
* @author lengleng
|
||||
* @date 2023-06-08 11:19:23
|
||||
*/
|
||||
@Data
|
||||
@TableName("app_page")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "页面")
|
||||
public class AppPageEntity extends Model<AppPageEntity> {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description = "主键")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 页面类型
|
||||
*/
|
||||
@Schema(description = "页面类型")
|
||||
private Integer pageType;
|
||||
|
||||
/**
|
||||
* 页面名称
|
||||
*/
|
||||
@Schema(description = "页面名称")
|
||||
private String pageName;
|
||||
|
||||
/**
|
||||
* 页面数据
|
||||
*/
|
||||
@Schema(description = "页面数据")
|
||||
private String pageData;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description = "修改人")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description = "修改时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 删除标记
|
||||
*/
|
||||
@TableLogic
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "删除标记")
|
||||
private String delFlag;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.app.api.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* app角色表
|
||||
*
|
||||
* @author aeizzz
|
||||
* @date 2022-12-07 09:52:03
|
||||
*/
|
||||
@Data
|
||||
@TableName("app_role")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "app角色表")
|
||||
public class AppRole extends Model<AppRole> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* roleId
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description = "roleId")
|
||||
private Long roleId;
|
||||
|
||||
/**
|
||||
* roleName
|
||||
*/
|
||||
@Schema(description = "roleName")
|
||||
private String roleName;
|
||||
|
||||
/**
|
||||
* roleCode
|
||||
*/
|
||||
@Schema(description = "roleCode")
|
||||
private String roleCode;
|
||||
|
||||
/**
|
||||
* roleDesc
|
||||
*/
|
||||
@Schema(description = "roleDesc")
|
||||
private String roleDesc;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@Schema(description = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
@Schema(description = "修改人")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* createTime
|
||||
*/
|
||||
@Schema(description = "createTime")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* updateTime
|
||||
*/
|
||||
@Schema(description = "updateTime")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* delFlag
|
||||
*/
|
||||
@Schema(description = "delFlag")
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* tenantId
|
||||
*/
|
||||
@Schema(description = "tenantId", hidden = true)
|
||||
private Long tenantId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,125 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.app.api.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import com.pig4cloud.pigx.common.core.sensitive.Sensitive;
|
||||
import com.pig4cloud.pigx.common.core.util.ValidGroup;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* app 社交账号登录
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "第三方账号信息")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class AppSocialDetails extends Model<AppSocialDetails> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主鍵
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description = "主键")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
@NotBlank(message = "类型不能为空")
|
||||
@Schema(description = "账号类型")
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
@Schema(description = "描述")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* appid
|
||||
*/
|
||||
@Sensitive(prefixNoMaskLen = 4, suffixNoMaskLen = 4)
|
||||
@NotBlank(message = "账号不能为空")
|
||||
@Schema(description = "appId")
|
||||
private String appId;
|
||||
|
||||
/**
|
||||
* app_secret
|
||||
*/
|
||||
@Sensitive(prefixNoMaskLen = 4, suffixNoMaskLen = 4)
|
||||
@NotBlank(message = "密钥不能为空", groups = { ValidGroup.Insert.class })
|
||||
@Schema(description = "app secret")
|
||||
private String appSecret;
|
||||
|
||||
/**
|
||||
* 回调地址
|
||||
*/
|
||||
@Schema(description = "回调地址")
|
||||
private String redirectUrl;
|
||||
|
||||
/**
|
||||
* 拓展字段
|
||||
*/
|
||||
@Schema(description = "拓展字段")
|
||||
private String ext;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
@Schema(description = "修改人")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Schema(description = "创建时间")
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@Schema(description = "更新时间")
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 删除标记
|
||||
*/
|
||||
@TableLogic
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "删除标记,1:已删除,0:正常")
|
||||
private String delFlag;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
package com.pig4cloud.pigx.app.api.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import com.fasterxml.jackson.annotation.JsonRawValue;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 导航栏
|
||||
*
|
||||
* @author lengleng
|
||||
* @date 2023-06-08 11:18:46
|
||||
*/
|
||||
@Data
|
||||
@TableName("app_tabbar")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "导航栏")
|
||||
public class AppTabbarEntity extends Model<AppTabbarEntity> {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description = "主键")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 导航名称
|
||||
*/
|
||||
@Schema(description = "导航名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 未选图标
|
||||
*/
|
||||
@Schema(description = "未选图标")
|
||||
private String selected;
|
||||
|
||||
/**
|
||||
* 已选图标
|
||||
*/
|
||||
@Schema(description = "已选图标")
|
||||
private String unselected;
|
||||
|
||||
/**
|
||||
* 链接地址
|
||||
*/
|
||||
@Schema(description = "链接地址")
|
||||
@JsonRawValue
|
||||
@JsonDeserialize()
|
||||
private String link;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description = "更新人")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description = "更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 删除标记
|
||||
*/
|
||||
@TableLogic
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "删除标记")
|
||||
private String delFlag;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,159 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.app.api.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* app用户表
|
||||
*
|
||||
* @author aeizzz
|
||||
* @date 2022-12-07 09:52:03
|
||||
*/
|
||||
@Data
|
||||
@TableName("app_user")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "app用户表")
|
||||
public class AppUser extends Model<AppUser> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* userId
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description = "userId")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
@Schema(description = "用户名")
|
||||
private String username;
|
||||
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
@Schema(description = "密码")
|
||||
private String password;
|
||||
|
||||
/**
|
||||
* 随机盐
|
||||
*/
|
||||
@JsonIgnore
|
||||
@Schema(description = "随机盐")
|
||||
private String salt;
|
||||
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
@Schema(description = "手机号")
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 头像
|
||||
*/
|
||||
@Schema(description = "头像")
|
||||
private String avatar;
|
||||
|
||||
/**
|
||||
* 昵称
|
||||
*/
|
||||
@Schema(description = "拓展字段:昵称")
|
||||
private String nickname;
|
||||
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
@Schema(description = "拓展字段:姓名")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 邮箱
|
||||
*/
|
||||
@Schema(description = "拓展字段:邮箱")
|
||||
private String email;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@Schema(description = "创建人")
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
@Schema(description = "修改人")
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Schema(description = "创建时间")
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@Schema(description = "修改时间")
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 删除标记
|
||||
*/
|
||||
@Schema(description = "删除标记,1:已删除,0:正常")
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@TableLogic
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 所属租户
|
||||
*/
|
||||
@Schema(description = "所属租户", hidden = true)
|
||||
private Long tenantId;
|
||||
|
||||
/**
|
||||
* 最后一次密码修改时间
|
||||
*/
|
||||
@Schema(description = "最后一次密码修改时间")
|
||||
private LocalDateTime lastModifiedTime;
|
||||
|
||||
/**
|
||||
* 锁定标记
|
||||
*/
|
||||
@Schema(description = "锁定标记")
|
||||
private String lockFlag;
|
||||
|
||||
/**
|
||||
* 微信小程序登录openId
|
||||
*/
|
||||
@Schema(description = "微信小程序登录openId")
|
||||
private String wxOpenid;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.app.api.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 用户角色表
|
||||
*
|
||||
* @author aeizzz
|
||||
* @date 2022-12-07 09:52:03
|
||||
*/
|
||||
@Data
|
||||
@TableName("app_user_role")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "用户角色表")
|
||||
public class AppUserRole extends Model<AppUserRole> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description = "用户ID")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 角色ID
|
||||
*/
|
||||
@Schema(description = "角色ID")
|
||||
private Long roleId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.pig4cloud.pigx.app.api.entity.as;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 媒体平台
|
||||
*
|
||||
* @author amigo
|
||||
* @date 2023-07
|
||||
*/
|
||||
@Data
|
||||
@TableName("as_platform")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "媒体平台表")
|
||||
public class AsPlatform extends Model<AsPlatform> {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description = "ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "平台名称")
|
||||
private String platformName;
|
||||
@Schema(description = "平台类型 0:全部")
|
||||
private Integer platformType;
|
||||
@Schema(description = "应用图标")
|
||||
private String icon;
|
||||
@Schema(description = "公司")
|
||||
private String company;
|
||||
@Schema(description = "平台网站")
|
||||
private String website;
|
||||
@Schema(description = "sort")
|
||||
private String sortOrder;
|
||||
|
||||
@Schema(description = "产品code: 类型_名称_id")
|
||||
private String productCode;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.pig4cloud.pigx.app.api.entity.as;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 平台类型表
|
||||
*
|
||||
* @author amigo
|
||||
* @date 2023-07
|
||||
*/
|
||||
@Data
|
||||
@TableName("as_platform_type")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "平台类型表")
|
||||
public class AsPlatformType extends Model<AsPlatformType> {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description = "ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "名称")
|
||||
private String name;
|
||||
@Schema(description = "平台类型 0:全部")
|
||||
private Integer platformType;
|
||||
@Schema(description = "平台类型")
|
||||
private String sortOrder;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
package com.pig4cloud.pigx.app.api.entity.as;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 流媒体订阅账号
|
||||
*
|
||||
* @author amigo
|
||||
* @date 2023-08
|
||||
*/
|
||||
@Data
|
||||
@TableName("as_sub_account")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "as流媒体订阅账号")
|
||||
public class AsSubAccount extends Model<AsSubAccount> {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 产品id
|
||||
*/
|
||||
@Schema(description = "product_id")
|
||||
private Long productId;
|
||||
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description = "ID")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 订阅计划id
|
||||
*/
|
||||
@Schema(description = "sub_plan_id")
|
||||
private Integer subPlanId;
|
||||
|
||||
/**
|
||||
* main user
|
||||
*/
|
||||
@Schema(description = "user_id")
|
||||
private Integer userId;
|
||||
|
||||
/**
|
||||
* 付费计划id
|
||||
*/
|
||||
@Schema(description = "sub_payroll_id")
|
||||
private Integer subPayrollId;
|
||||
|
||||
/**
|
||||
* 地区
|
||||
*/
|
||||
@Schema(description = "region")
|
||||
private String region;
|
||||
|
||||
/**
|
||||
* 分享类型
|
||||
*/
|
||||
@Schema(description = "share_type")
|
||||
private Integer shareType;
|
||||
|
||||
/**
|
||||
* 账号类型
|
||||
*/
|
||||
@Schema(description = "account_type")
|
||||
private Integer accountType;
|
||||
|
||||
/**
|
||||
* 续费日期
|
||||
*/
|
||||
@Schema(description = "renew_date")
|
||||
private LocalDateTime renewDate;
|
||||
|
||||
/**
|
||||
* 平台id
|
||||
*/
|
||||
@Schema(description = "platform_id")
|
||||
private Integer platformId;
|
||||
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
@Schema(description = "account_name")
|
||||
private String accountName;
|
||||
|
||||
/**
|
||||
* 用户密码
|
||||
*/
|
||||
@Schema(description = "account_passwd")
|
||||
private String accountPasswd;
|
||||
|
||||
/**
|
||||
* 密码salt
|
||||
*/
|
||||
@Schema(description = "passwd_salt")
|
||||
private Integer passwdSalt;
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.pig4cloud.pigx.app.api.entity.as;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 付费计划表
|
||||
*
|
||||
* @author amigo
|
||||
* @date 2023-07
|
||||
*/
|
||||
@Data
|
||||
@TableName("as_sub_payroll")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "as付费计划")
|
||||
public class AsSubPayroll extends Model<AsSubPayroll> {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description = "ID")
|
||||
private Long id;
|
||||
/**
|
||||
* 订阅计划id +=,
|
||||
*/
|
||||
@Schema(description = "sub_plans")
|
||||
private Long subPlans;
|
||||
@Schema(description = "platform_id")
|
||||
private Integer platformId;
|
||||
/**
|
||||
* 付费方式 月/季/年 - 1/2/3
|
||||
*/
|
||||
@Schema(description = "payroll")
|
||||
private Integer payroll;
|
||||
|
||||
@Schema(description = "price")
|
||||
private BigDecimal price;
|
||||
@Schema(description = "currency")
|
||||
private String currency;
|
||||
@Schema(description = "region")
|
||||
private String region;
|
||||
@Schema(description = "产品code")
|
||||
private String productCode;
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.pig4cloud.pigx.app.api.entity.as;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 流媒体订阅计划表
|
||||
*
|
||||
* @author amigo
|
||||
* @date 2023-07
|
||||
*/
|
||||
@Data
|
||||
@TableName("as_sub_plan")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "as订阅计划")
|
||||
public class AsSubPlan extends Model<AsSubPlan> {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description = "订阅计划ID")
|
||||
private Long id;
|
||||
@Schema(description = "订阅名称")
|
||||
private String name;
|
||||
@Schema(description = "平台id")
|
||||
private String platformId;
|
||||
@Schema(description = "用户容量")
|
||||
private String capacity;
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
@Schema(description = "排序")
|
||||
private String sortOrder;
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.pig4cloud.pigx.app.api.entity.as;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
@TableName("as_sub_product")
|
||||
@Schema(description = "订阅产品")
|
||||
public class AsSubProduct {
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description = "id")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "综合评分")
|
||||
private Integer star;
|
||||
@Schema(description = "标题")
|
||||
private String title;
|
||||
@Schema(description = "描述")
|
||||
private String description;
|
||||
@Schema(description = "标签s")
|
||||
private String Tags;
|
||||
@Schema(description = "订阅ids")
|
||||
private String subPlanIds;
|
||||
@Schema(description = "总价")
|
||||
private BigDecimal amount;
|
||||
@Schema(description = "用户id")
|
||||
private Long userId;
|
||||
@Schema(description = "产品类型 1自营 2个人")
|
||||
private Long productType;
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
@Schema(description = "更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
@Schema(description = "产品code: 类型_名称_id")
|
||||
private String productCode;
|
||||
@Schema(description = "订阅类型 1单品 2多品")
|
||||
private Long subType;
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.pig4cloud.pigx.app.api.entity.as;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
@TableName("as_sub_product_comment")
|
||||
@Schema(description = "订阅产品评价")
|
||||
public class AsSubProductComment {
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description = "id")
|
||||
private Long id;
|
||||
@Schema(description = "评分")
|
||||
private Integer star;
|
||||
@Schema(description = "评价")
|
||||
private String comment;
|
||||
@Schema(description = "用户id")
|
||||
private Long userId;
|
||||
@Schema(description = "产品id")
|
||||
private Long productId;
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
@Schema(description = "更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package com.pig4cloud.pigx.app.api.entity.as;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 流媒体订阅计划表
|
||||
*
|
||||
* @author amigo
|
||||
* @date 2023-07
|
||||
*/
|
||||
@Data
|
||||
@TableName("as_user_sub")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "账号订阅表")
|
||||
public class AsUserSub extends Model<AsUserSub> {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description = "ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "platformId")
|
||||
private Integer platformId;
|
||||
|
||||
@Schema(description = "capacity")
|
||||
private Integer capacity;
|
||||
|
||||
@Schema(description = "capacity_loaded")
|
||||
private Integer capacityLoaded;
|
||||
|
||||
@Schema(description = "plan_id")
|
||||
private Integer planId;
|
||||
@Schema(description = "user_id")
|
||||
private Integer userId;
|
||||
@Schema(description = "main_account")
|
||||
private Integer mainAccount;
|
||||
@Schema(description = "region")
|
||||
private String region;
|
||||
@Schema(description = "target_ip")
|
||||
private String targetIp;
|
||||
@Schema(description = "remark")
|
||||
private Integer remark;
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.app.api.feign;
|
||||
|
||||
import com.pig4cloud.pigx.app.api.dto.AppUserInfo;
|
||||
import com.pig4cloud.pigx.common.core.constant.SecurityConstants;
|
||||
import com.pig4cloud.pigx.common.core.constant.ServiceNameConstants;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestHeader;
|
||||
|
||||
/**
|
||||
* @author lengleng
|
||||
* @date 2018/6/22
|
||||
*/
|
||||
@FeignClient(contextId = "remoteAppUserService", value = ServiceNameConstants.APP_SERVER)
|
||||
public interface RemoteAppUserService {
|
||||
|
||||
/**
|
||||
* 通过用户名查询用户、角色信息
|
||||
* @param username 用户名
|
||||
* @param from 调用标志
|
||||
* @return R
|
||||
*/
|
||||
@GetMapping("/appuser/info/{username}")
|
||||
R<AppUserInfo> info(@PathVariable("username") String username, @RequestHeader(SecurityConstants.FROM) String from);
|
||||
|
||||
/**
|
||||
* 通过社交账号或手机号查询用户、角色信息
|
||||
* @param inStr appid@code
|
||||
* @param from 调用标志
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/appsocial/info/{inStr}")
|
||||
R<AppUserInfo> social(@PathVariable("inStr") String inStr, @RequestHeader(SecurityConstants.FROM) String from);
|
||||
|
||||
/**
|
||||
* 锁定用户
|
||||
* @param username 用户名
|
||||
* @param from 调用标识
|
||||
* @return
|
||||
*/
|
||||
@PutMapping("/appuser/lock/{username}")
|
||||
R<Boolean> lockUser(@PathVariable("username") String username, @RequestHeader(SecurityConstants.FROM) String from);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.app.api.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnore;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.alibaba.excel.annotation.write.style.ColumnWidth;
|
||||
import com.pig4cloud.pigx.common.excel.annotation.ExcelLine;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author lengleng
|
||||
* @date 2020/2/10
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "前端角色展示对象")
|
||||
@ColumnWidth(30)
|
||||
public class AppRoleExcelVO {
|
||||
|
||||
/**
|
||||
* 导入时候回显行号
|
||||
*/
|
||||
@ExcelLine
|
||||
@ExcelIgnore
|
||||
private Long lineNum;
|
||||
|
||||
/**
|
||||
* roleName
|
||||
*/
|
||||
@ExcelProperty("角色名称")
|
||||
private String roleName;
|
||||
|
||||
/**
|
||||
* roleCode
|
||||
*/
|
||||
@ExcelProperty("角色标识")
|
||||
private String roleCode;
|
||||
|
||||
/**
|
||||
* roleDesc
|
||||
*/
|
||||
@ExcelProperty("角色描述")
|
||||
private String roleDesc;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.app.api.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author lengleng
|
||||
* @date 2020/2/10
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "前端角色展示对象")
|
||||
public class AppRoleVO {
|
||||
|
||||
/**
|
||||
* 角色id
|
||||
*/
|
||||
private Long roleId;
|
||||
|
||||
/**
|
||||
* 菜单列表
|
||||
*/
|
||||
private String menuIds;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
package com.pig4cloud.pigx.app.api.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnore;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.alibaba.excel.annotation.write.style.ColumnWidth;
|
||||
import com.pig4cloud.pigx.common.excel.annotation.ExcelLine;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
@ColumnWidth(30)
|
||||
public class AppUserExcelVO {
|
||||
|
||||
/**
|
||||
* 导入时候回显行号
|
||||
*/
|
||||
@ExcelLine
|
||||
@ExcelIgnore
|
||||
private Long lineNum;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@ExcelProperty("用户编号")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
@NotBlank(message = "用户名不能为空")
|
||||
@ExcelProperty("用户名")
|
||||
private String username;
|
||||
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
@NotBlank(message = "手机号不能为空")
|
||||
@ExcelProperty("手机号")
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
@NotBlank(message = "昵称不能为空")
|
||||
@ExcelProperty("昵称")
|
||||
private String nickname;
|
||||
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
@NotBlank(message = "姓名不能为空")
|
||||
@ExcelProperty("姓名")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
@NotBlank(message = "邮箱不能为空")
|
||||
@ExcelProperty("邮箱")
|
||||
private String email;
|
||||
|
||||
/**
|
||||
* 角色列表
|
||||
*/
|
||||
@NotBlank(message = "角色不能为空")
|
||||
@ExcelProperty("角色")
|
||||
private String roleNameList;
|
||||
|
||||
/**
|
||||
* 锁定标记
|
||||
*/
|
||||
@ExcelProperty("锁定标记,0:正常,9:已锁定")
|
||||
private String lockFlag;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ExcelProperty(value = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
package com.pig4cloud.pigx.app.api.vo;
|
||||
|
||||
import com.pig4cloud.pigx.app.api.entity.AppRole;
|
||||
import com.pig4cloud.pigx.common.core.sensitive.Sensitive;
|
||||
import com.pig4cloud.pigx.common.core.sensitive.SensitiveTypeEnum;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class AppUserVO implements Serializable {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@Schema(description = "主键")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
@Schema(description = "用户名")
|
||||
private String username;
|
||||
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
@Schema(description = "密码")
|
||||
private String password;
|
||||
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
@Schema(description = "手机号")
|
||||
@Sensitive(type = SensitiveTypeEnum.MOBILE_PHONE)
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 头像
|
||||
*/
|
||||
@Schema(description = "头像")
|
||||
private String avatar;
|
||||
|
||||
/**
|
||||
* 昵称
|
||||
*/
|
||||
@Schema(description = "拓展字段:昵称")
|
||||
private String nickname;
|
||||
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
@Schema(description = "拓展字段:姓名")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 邮箱
|
||||
*/
|
||||
@Schema(description = "拓展字段:邮箱")
|
||||
private String email;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 删除标记
|
||||
*/
|
||||
@Schema(description = "删除标记,1:已删除,0:正常")
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 所属租户
|
||||
*/
|
||||
@Schema(description = "所属租户")
|
||||
private Long tenantId;
|
||||
|
||||
/**
|
||||
* 最后一次密码修改时间
|
||||
*/
|
||||
@Schema(description = "最后一次密码修改时间")
|
||||
private LocalDateTime lastModifiedTime;
|
||||
|
||||
/**
|
||||
* 锁定标记
|
||||
*/
|
||||
@Schema(description = "锁定标记")
|
||||
private String lockFlag;
|
||||
|
||||
/**
|
||||
* 角色列表
|
||||
*/
|
||||
@Schema(description = "拥有的角色列表")
|
||||
private List<AppRole> roleList;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
com.pig4cloud.pigx.common.feign.PigxFeignAutoConfiguration=\
|
||||
com.pig4cloud.pigx.app.api.feign.RemoteAppUserService
|
||||
18
as-app-server/as-app-server-biz/Dockerfile
Normal file
18
as-app-server/as-app-server-biz/Dockerfile
Normal file
@@ -0,0 +1,18 @@
|
||||
FROM pig4cloud/java:8-jre
|
||||
|
||||
MAINTAINER wangiegie@gmail.com
|
||||
|
||||
ENV TZ=Asia/Shanghai
|
||||
ENV JAVA_OPTS="-Xms512m -Xmx1024m -Djava.security.egd=file:/dev/./urandom"
|
||||
|
||||
RUN ln -sf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
||||
|
||||
RUN mkdir -p /as-app-server
|
||||
|
||||
WORKDIR /as-app-server
|
||||
|
||||
EXPOSE 7060
|
||||
|
||||
ADD ./target/as-app-server-biz.jar ./
|
||||
|
||||
CMD sleep 60;java $JAVA_OPTS -jar as-app-server-biz.jar
|
||||
105
as-app-server/as-app-server-biz/pom.xml
Normal file
105
as-app-server/as-app-server-biz/pom.xml
Normal file
@@ -0,0 +1,105 @@
|
||||
<?xml version="1.0"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
|
||||
http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>as-app-server</artifactId>
|
||||
<version>5.2.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>as-app-server-biz</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<!--必备: undertow容器-->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-undertow</artifactId>
|
||||
</dependency>
|
||||
<!--必备: spring boot web-->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
<!--必备: 注册中心客户端-->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
</dependency>
|
||||
<!--必备: 配置中心客户端-->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||
</dependency>
|
||||
<!--必备: 操作数据源相关-->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-data</artifactId>
|
||||
</dependency>
|
||||
<!--必备:pigx安全模块-->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-security</artifactId>
|
||||
</dependency>
|
||||
<!--必备:xss 过滤模块-->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-xss</artifactId>
|
||||
</dependency>
|
||||
<!--必备: sentinel 依赖-->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-sentinel</artifactId>
|
||||
</dependency>
|
||||
<!--必备: feign 依赖-->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-feign</artifactId>
|
||||
</dependency>
|
||||
<!--必备: 依赖api模块-->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>as-app-server-api</artifactId>
|
||||
<version>5.2.0</version>
|
||||
</dependency>
|
||||
<!--必备: log 依赖-->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-log</artifactId>
|
||||
</dependency>
|
||||
<!--选配: mybatis 依赖 -->
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-boot-starter</artifactId>
|
||||
</dependency>
|
||||
<!--选配: druid 连接池 -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>druid-spring-boot-starter</artifactId>
|
||||
</dependency>
|
||||
<!--选配: mysql 数据库驱动 -->
|
||||
<dependency>
|
||||
<groupId>com.mysql</groupId>
|
||||
<artifactId>mysql-connector-j</artifactId>
|
||||
</dependency>
|
||||
<!--选配: swagger文档-->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-swagger</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>io.fabric8</groupId>
|
||||
<artifactId>docker-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.pig4cloud.pigx.app;
|
||||
|
||||
import com.pig4cloud.pigx.common.feign.annotation.EnablePigxFeignClients;
|
||||
import com.pig4cloud.pigx.common.security.annotation.EnablePigxResourceServer;
|
||||
import com.pig4cloud.pigx.common.swagger.annotation.EnableOpenApi;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
||||
|
||||
/**
|
||||
* @author pigx archetype
|
||||
* <p>
|
||||
* 项目启动类
|
||||
*/
|
||||
@EnableOpenApi("app")
|
||||
@EnablePigxFeignClients
|
||||
@EnableDiscoveryClient
|
||||
@EnablePigxResourceServer
|
||||
@SpringBootApplication
|
||||
public class AsAppApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(AsAppApplication.class, args);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,131 @@
|
||||
package com.pig4cloud.pigx.app.controller;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppArticleCategoryEntity;
|
||||
import com.pig4cloud.pigx.app.service.AppArticleCategoryService;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.common.excel.annotation.ResponseExcel;
|
||||
import com.pig4cloud.pigx.common.log.annotation.SysLog;
|
||||
import com.pig4cloud.pigx.common.security.annotation.Inner;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springdoc.api.annotations.ParameterObject;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 文章分类表
|
||||
*
|
||||
* @author pig
|
||||
* @date 2023-06-07 16:28:03
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/appArticleCategory")
|
||||
@Tag(description = "appArticleCategory", name = "文章分类表管理")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class AppArticleCategoryController {
|
||||
|
||||
private final AppArticleCategoryService appArticleCategoryService;
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param page 分页对象
|
||||
* @param appArticleCategory 文章分类表
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "分页查询", description = "分页查询")
|
||||
@GetMapping("/page")
|
||||
@PreAuthorize("@pms.hasPermission('app_appArticleCategory_view')")
|
||||
public R getAppArticleCategoryPage(@ParameterObject Page page,
|
||||
@ParameterObject AppArticleCategoryEntity appArticleCategory) {
|
||||
LambdaQueryWrapper<AppArticleCategoryEntity> wrapper = Wrappers.lambdaQuery();
|
||||
wrapper.like(StrUtil.isNotBlank(appArticleCategory.getName()), AppArticleCategoryEntity::getName,
|
||||
appArticleCategory.getName());
|
||||
return R.ok(appArticleCategoryService.page(page, wrapper));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询文章分类表
|
||||
* @param id id
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "通过id查询", description = "通过id查询")
|
||||
@GetMapping("/{id}")
|
||||
@PreAuthorize("@pms.hasPermission('app_appArticleCategory_view')")
|
||||
public R getById(@PathVariable("id") Long id) {
|
||||
return R.ok(appArticleCategoryService.getById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过查询文章分类
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "查询文章分类", description = "查询文章分类")
|
||||
@Inner(value = false)
|
||||
@GetMapping("/list")
|
||||
public R list() {
|
||||
return R.ok(appArticleCategoryService.list());
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增文章分类表
|
||||
* @param appArticleCategory 文章分类表
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "新增文章分类表", description = "新增文章分类表")
|
||||
@SysLog("新增文章分类表")
|
||||
@PostMapping
|
||||
@PreAuthorize("@pms.hasPermission('app_appArticleCategory_add')")
|
||||
public R save(@RequestBody AppArticleCategoryEntity appArticleCategory) {
|
||||
return R.ok(appArticleCategoryService.save(appArticleCategory));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改文章分类表
|
||||
* @param appArticleCategory 文章分类表
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "修改文章分类表", description = "修改文章分类表")
|
||||
@SysLog("修改文章分类表")
|
||||
@PutMapping
|
||||
@PreAuthorize("@pms.hasPermission('app_appArticleCategory_edit')")
|
||||
public R updateById(@RequestBody AppArticleCategoryEntity appArticleCategory) {
|
||||
return R.ok(appArticleCategoryService.updateById(appArticleCategory));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除文章分类表
|
||||
* @param ids id列表
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "通过id删除文章分类表", description = "通过id删除文章分类表")
|
||||
@SysLog("通过id删除文章分类表")
|
||||
@DeleteMapping
|
||||
@PreAuthorize("@pms.hasPermission('app_appArticleCategory_del')")
|
||||
public R removeById(@RequestBody Long[] ids) {
|
||||
return R.ok(appArticleCategoryService.removeBatchByIds(CollUtil.toList(ids)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel 表格
|
||||
* @param appArticleCategory 查询条件
|
||||
* @return excel 文件流
|
||||
*/
|
||||
@ResponseExcel
|
||||
@GetMapping("/export")
|
||||
@PreAuthorize("@pms.hasPermission('app_appArticleCategory_export')")
|
||||
public List<AppArticleCategoryEntity> export(AppArticleCategoryEntity appArticleCategory) {
|
||||
return appArticleCategoryService.list(Wrappers.query(appArticleCategory));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,124 @@
|
||||
package com.pig4cloud.pigx.app.controller;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppArticleCollectEntity;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppArticleEntity;
|
||||
import com.pig4cloud.pigx.app.service.AppArticleCollectService;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.common.excel.annotation.ResponseExcel;
|
||||
import com.pig4cloud.pigx.common.log.annotation.SysLog;
|
||||
import com.pig4cloud.pigx.common.security.util.SecurityUtils;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springdoc.api.annotations.ParameterObject;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 文章收藏表
|
||||
*
|
||||
* @author pig
|
||||
* @date 2023-06-16 14:33:41
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/collect")
|
||||
@Tag(description = "collect", name = "文章收藏表管理")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class AppArticleCollectController {
|
||||
|
||||
private final AppArticleCollectService appArticleCollectService;
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param page 分页对象
|
||||
* @param appArticleCollect 文章收藏表
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "分页查询", description = "分页查询")
|
||||
@GetMapping("/page")
|
||||
public R getAppArticleCollectPage(@ParameterObject Page page) {
|
||||
MPJLambdaWrapper<AppArticleCollectEntity> wrapper = new MPJLambdaWrapper<AppArticleCollectEntity>()
|
||||
.selectAll(AppArticleCollectEntity.class).select(AppArticleEntity::getTitle)
|
||||
.leftJoin(AppArticleEntity.class, AppArticleEntity::getId, AppArticleCollectEntity::getArticleId)
|
||||
.eq(AppArticleCollectEntity::getUserId, SecurityUtils.getUser().getId());
|
||||
return R.ok(appArticleCollectService.selectJoinListPage(page, AppArticleCollectEntity.class, wrapper));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询文章收藏表
|
||||
* @param id id
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "通过id查询", description = "通过id查询")
|
||||
@GetMapping("/{id}")
|
||||
public R getById(@PathVariable("id") Long id) {
|
||||
return R.ok(appArticleCollectService.getById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增文章收藏表
|
||||
* @param appArticleCollect 文章收藏表
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "新增文章收藏表", description = "新增文章收藏表")
|
||||
@SysLog("新增文章收藏表")
|
||||
@PostMapping
|
||||
public R save(@RequestBody AppArticleCollectEntity appArticleCollect) {
|
||||
return R.ok(appArticleCollectService.saveArticleCollect(appArticleCollect));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改文章收藏表
|
||||
* @param appArticleCollect 文章收藏表
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "修改文章收藏表", description = "修改文章收藏表")
|
||||
@SysLog("修改文章收藏表")
|
||||
@PutMapping
|
||||
public R updateById(@RequestBody AppArticleCollectEntity appArticleCollect) {
|
||||
return R.ok(appArticleCollectService.updateById(appArticleCollect));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除文章收藏表
|
||||
* @param ids id列表
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "通过id删除文章收藏表", description = "通过id删除文章收藏表")
|
||||
@SysLog("通过id删除文章收藏表")
|
||||
@DeleteMapping
|
||||
public R removeById(@RequestBody Long[] ids) {
|
||||
return R.ok(appArticleCollectService.removeBatchByIds(CollUtil.toList(ids)));
|
||||
}
|
||||
|
||||
@Operation(summary = "通过文章id删除文章收藏表", description = "通过文章id删除文章收藏表")
|
||||
@SysLog("通过文章id删除文章收藏表")
|
||||
@DeleteMapping("/{articleId}")
|
||||
public R removeByArticleId(@PathVariable String articleId) {
|
||||
Long id = SecurityUtils.getUser().getId();
|
||||
return R.ok(appArticleCollectService.remove(Wrappers.<AppArticleCollectEntity>lambdaQuery()
|
||||
.eq(AppArticleCollectEntity::getUserId, id).eq(AppArticleCollectEntity::getArticleId, articleId)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel 表格
|
||||
* @param appArticleCollect 查询条件
|
||||
* @return excel 文件流
|
||||
*/
|
||||
@ResponseExcel
|
||||
@GetMapping("/export")
|
||||
@PreAuthorize("@pms.hasPermission('app_collect_export')")
|
||||
public List<AppArticleCollectEntity> export(AppArticleCollectEntity appArticleCollect) {
|
||||
return appArticleCollectService.list(Wrappers.query(appArticleCollect));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
package com.pig4cloud.pigx.app.controller;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppArticleEntity;
|
||||
import com.pig4cloud.pigx.app.service.AppArticleService;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.common.excel.annotation.ResponseExcel;
|
||||
import com.pig4cloud.pigx.common.log.annotation.SysLog;
|
||||
import com.pig4cloud.pigx.common.security.annotation.Inner;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springdoc.api.annotations.ParameterObject;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 文章资讯
|
||||
*
|
||||
* @author pig
|
||||
* @date 2023-06-07 16:32:35
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/appArticle")
|
||||
@Tag(description = "appArticle", name = "文章资讯管理")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class AppArticleController {
|
||||
|
||||
private final AppArticleService appArticleService;
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param page 分页对象
|
||||
* @param appArticle 文章资讯
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "分页查询", description = "分页查询")
|
||||
@Inner(value = false)
|
||||
@GetMapping("/page")
|
||||
public R getAppArticlePage(@ParameterObject Page page, @ParameterObject AppArticleEntity appArticle) {
|
||||
return R.ok(appArticleService.pageAndCname(page, appArticle));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询文章资讯
|
||||
* @param id id
|
||||
* @return R
|
||||
*/
|
||||
@Inner(value = false)
|
||||
@Operation(summary = "通过id查询", description = "通过id查询")
|
||||
@GetMapping("/details/{id}/{userId}")
|
||||
public R getById(@PathVariable("id") Long id, @PathVariable(required = false) Long userId) {
|
||||
return R.ok(appArticleService.getArticleAndIncrById(id, userId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增文章资讯
|
||||
* @param appArticle 文章资讯
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "新增文章资讯", description = "新增文章资讯")
|
||||
@SysLog("新增文章资讯")
|
||||
@PostMapping
|
||||
@PreAuthorize("@pms.hasPermission('app_appArticle_add')")
|
||||
public R save(@RequestBody AppArticleEntity appArticle) {
|
||||
return R.ok(appArticleService.save(appArticle));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改文章资讯
|
||||
* @param appArticle 文章资讯
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "修改文章资讯", description = "修改文章资讯")
|
||||
@SysLog("修改文章资讯")
|
||||
@PutMapping
|
||||
@PreAuthorize("@pms.hasPermission('app_appArticle_edit')")
|
||||
public R updateById(@RequestBody AppArticleEntity appArticle) {
|
||||
return R.ok(appArticleService.updateById(appArticle));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除文章资讯
|
||||
* @param ids id列表
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "通过id删除文章资讯", description = "通过id删除文章资讯")
|
||||
@SysLog("通过id删除文章资讯")
|
||||
@DeleteMapping
|
||||
@PreAuthorize("@pms.hasPermission('app_appArticle_del')")
|
||||
public R removeById(@RequestBody Long[] ids) {
|
||||
return R.ok(appArticleService.removeBatchByIds(CollUtil.toList(ids)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel 表格
|
||||
* @param appArticle 查询条件
|
||||
* @return excel 文件流
|
||||
*/
|
||||
@ResponseExcel
|
||||
@GetMapping("/export")
|
||||
@PreAuthorize("@pms.hasPermission('app_appArticle_export')")
|
||||
public List<AppArticleEntity> export(AppArticleEntity appArticle) {
|
||||
return appArticleService.list(Wrappers.query(appArticle));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
package com.pig4cloud.pigx.app.controller;
|
||||
|
||||
import com.pig4cloud.pigx.app.api.entity.AppPageEntity;
|
||||
import com.pig4cloud.pigx.app.service.AppIndexService;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.common.security.annotation.Inner;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* app 首页控制
|
||||
*
|
||||
* @author lengleng
|
||||
* @date 2023/6/8
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/index")
|
||||
@Tag(description = "App 页面控制", name = "app index")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class AppIndexController {
|
||||
|
||||
private final AppIndexService indexService;
|
||||
|
||||
/**
|
||||
* 首页
|
||||
* @return Object
|
||||
*/
|
||||
@Inner(value = false)
|
||||
@GetMapping("/index")
|
||||
public R index() {
|
||||
Map<String, Object> detail = indexService.index();
|
||||
return R.ok(detail);
|
||||
}
|
||||
|
||||
@Inner(value = false)
|
||||
@GetMapping("/config")
|
||||
public R config() {
|
||||
Map<String, Object> map = indexService.config();
|
||||
return R.ok(map);
|
||||
}
|
||||
|
||||
@Inner(value = false)
|
||||
@GetMapping("/decorate")
|
||||
public R decorate(@Validated @RequestParam("id") Integer id) {
|
||||
AppPageEntity detail = indexService.decorate(id);
|
||||
return R.ok(detail);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.app.controller;
|
||||
|
||||
import com.pig4cloud.pigx.app.service.AppMobileService;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.common.security.annotation.Inner;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @author lengleng
|
||||
* @date 2018/11/14
|
||||
* <p>
|
||||
* 手机验证码
|
||||
*/
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/appmobile")
|
||||
@Tag(description = "mobile", name = "手机管理模块")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class AppMobileController {
|
||||
|
||||
private final AppMobileService appMobileService;
|
||||
|
||||
@Inner(value = false)
|
||||
@GetMapping("/{mobile}")
|
||||
public R sendSmsCode(@PathVariable String mobile) {
|
||||
return appMobileService.sendSmsCode(mobile);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.pig4cloud.pigx.app.controller;
|
||||
|
||||
import com.pig4cloud.pigx.app.api.entity.AppPageEntity;
|
||||
import com.pig4cloud.pigx.app.service.AppPageService;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* 页面管理
|
||||
*
|
||||
* @author pig
|
||||
* @date 2023-06-07 16:32:35
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/appPage")
|
||||
@Tag(description = "appPage", name = "页面管理")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class AppPageController {
|
||||
|
||||
private final AppPageService pageService;
|
||||
|
||||
/**
|
||||
* 通过id查询文章资讯
|
||||
* @param id id
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "通过id查询", description = "通过id查询")
|
||||
@GetMapping("/{id}")
|
||||
public R getById(@PathVariable("id") Long id) {
|
||||
return R.ok(pageService.getById(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "更新页面", description = "更新页面")
|
||||
@PutMapping
|
||||
public R update(@RequestBody AppPageEntity page) {
|
||||
return R.ok(pageService.updateById(page));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,175 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.app.controller;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppRole;
|
||||
import com.pig4cloud.pigx.app.api.vo.AppRoleExcelVO;
|
||||
import com.pig4cloud.pigx.app.service.AppRoleService;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.common.excel.annotation.RequestExcel;
|
||||
import com.pig4cloud.pigx.common.excel.annotation.ResponseExcel;
|
||||
import com.pig4cloud.pigx.common.log.annotation.SysLog;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* app角色表
|
||||
*
|
||||
* @author aeizzz
|
||||
* @date 2022-12-07 09:52:03
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/approle")
|
||||
@Tag(description = "approle", name = "app角色表管理")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class AppRoleController {
|
||||
|
||||
private final AppRoleService appRoleService;
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param page 分页对象
|
||||
* @param appRole app角色表
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "分页查询", description = "分页查询")
|
||||
@GetMapping("/page")
|
||||
public R getAppRolePage(Page page, AppRole appRole) {
|
||||
return R.ok(appRoleService.page(page, Wrappers.<AppRole>lambdaQuery()
|
||||
.like(StrUtil.isNotBlank(appRole.getRoleName()), AppRole::getRoleName, appRole.getRoleName())));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询全部角色
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "查询全部", description = "查询全部")
|
||||
@GetMapping("/list")
|
||||
public R list() {
|
||||
return R.ok(appRoleService.list(Wrappers.emptyWrapper()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询app角色表
|
||||
* @param roleId id
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "通过id查询", description = "通过id查询")
|
||||
@GetMapping("/{roleId}")
|
||||
public R getById(@PathVariable("roleId") Long roleId) {
|
||||
return R.ok(appRoleService.getById(roleId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过roleName查询app角色表
|
||||
* @param roleName roleName
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "通过id查询", description = "通过id查询")
|
||||
@GetMapping("/details/{roleName}")
|
||||
public R getByUserName(@PathVariable("roleName") String roleName) {
|
||||
return R.ok(appRoleService.getOne(Wrappers.<AppRole>lambdaQuery().eq(AppRole::getRoleName, roleName)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过roleCode查询app角色表
|
||||
* @param roleCode roleCode
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "通过roleCode查询", description = "通过roleCode查询")
|
||||
@GetMapping("/detailsByCode/{roleCode}")
|
||||
public R getByPhone(@PathVariable("roleCode") String roleCode) {
|
||||
return R.ok(appRoleService.getOne(Wrappers.<AppRole>lambdaQuery().eq(AppRole::getRoleCode, roleCode)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增app角色表
|
||||
* @param appRole app角色表
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "新增app角色表", description = "新增app角色表")
|
||||
@SysLog("新增app角色表")
|
||||
@PostMapping
|
||||
@PreAuthorize("@pms.hasPermission('app_approle_add')")
|
||||
public R save(@RequestBody AppRole appRole) {
|
||||
return R.ok(appRoleService.save(appRole));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改app角色表
|
||||
* @param appRole app角色表
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "修改app角色表", description = "修改app角色表")
|
||||
@SysLog("修改app角色表")
|
||||
@PutMapping
|
||||
@PreAuthorize("@pms.hasPermission('app_approle_edit')")
|
||||
public R updateById(@RequestBody AppRole appRole) {
|
||||
return R.ok(appRoleService.updateById(appRole));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过ids批量删除app角色表
|
||||
* @param ids roleIds
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "通过ids批量删除app角色表", description = "通过ids批量删除app角色表")
|
||||
@SysLog("通过ids批量删除app角色表")
|
||||
@DeleteMapping
|
||||
@PreAuthorize("@pms.hasPermission('app_approle_del')")
|
||||
public R removeById(@RequestBody Long[] ids) {
|
||||
return R.ok(appRoleService.deleteRoleByIds(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel 表格
|
||||
* @param appRole 查询条件
|
||||
* @return excel 文件流
|
||||
*/
|
||||
@ResponseExcel
|
||||
@GetMapping("/export")
|
||||
@PreAuthorize("@pms.hasPermission('app_approle_export')")
|
||||
public List<AppRole> export(AppRole appRole) {
|
||||
return appRoleService.list(Wrappers.query(appRole));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入角色
|
||||
* @param excelVOList 角色列表
|
||||
* @param bindingResult 错误信息列表
|
||||
* @return ok fail
|
||||
*/
|
||||
@PostMapping("/import")
|
||||
@PreAuthorize("@pms.hasPermission('app_approle_export')")
|
||||
public R importRole(@RequestExcel List<AppRoleExcelVO> excelVOList, BindingResult bindingResult) {
|
||||
return appRoleService.importRole(excelVOList, bindingResult);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,139 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.app.controller;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppSocialDetails;
|
||||
import com.pig4cloud.pigx.app.service.AppSocialDetailsService;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.common.core.util.ValidGroup;
|
||||
import com.pig4cloud.pigx.common.excel.annotation.ResponseExcel;
|
||||
import com.pig4cloud.pigx.common.log.annotation.SysLog;
|
||||
import com.pig4cloud.pigx.common.security.annotation.Inner;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/appsocial")
|
||||
@AllArgsConstructor
|
||||
@Tag(description = "social", name = "三方账号管理模块")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class AppSocialDetailsController {
|
||||
|
||||
private final AppSocialDetailsService appSocialDetailsService;
|
||||
|
||||
/**
|
||||
* 社交登录账户简单分页查询
|
||||
* @param page 分页对象
|
||||
* @param appSocialDetails 社交登录
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
public R getSocialDetailsPage(Page page, AppSocialDetails appSocialDetails) {
|
||||
return R.ok(appSocialDetailsService.page(page, Wrappers.query(appSocialDetails)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 信息
|
||||
* @param id id
|
||||
* @return R
|
||||
*/
|
||||
@GetMapping("/{id}")
|
||||
public R getinfo(@PathVariable("id") Long id) {
|
||||
return R.ok(appSocialDetailsService.getById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存
|
||||
* @param appSocialDetails
|
||||
* @return R
|
||||
*/
|
||||
@SysLog("保存三方信息")
|
||||
@PostMapping
|
||||
@PreAuthorize("@pms.hasPermission('app_social_details_add')")
|
||||
public R save(@Valid @RequestBody AppSocialDetails appSocialDetails) {
|
||||
return R.ok(appSocialDetailsService.save(appSocialDetails));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
* @param appSocialDetails
|
||||
* @return R
|
||||
*/
|
||||
@SysLog("修改三方信息")
|
||||
@PutMapping
|
||||
@PreAuthorize("@pms.hasPermission('app_social_details_edit')")
|
||||
public R updateById(@Validated({ ValidGroup.Update.class }) @RequestBody AppSocialDetails appSocialDetails) {
|
||||
appSocialDetailsService.updateById(appSocialDetails);
|
||||
return R.ok(Boolean.TRUE);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* @param ids
|
||||
* @return R
|
||||
*/
|
||||
@SysLog("删除三方信息")
|
||||
@DeleteMapping
|
||||
@PreAuthorize("@pms.hasPermission('app_social_details_del')")
|
||||
public R removeById(@RequestBody Long[] ids) {
|
||||
return R.ok(appSocialDetailsService.removeBatchByIds(CollUtil.toList(ids)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过社交账号、手机号查询用户、角色信息
|
||||
* @param inStr appid@code
|
||||
* @return
|
||||
*/
|
||||
@Inner
|
||||
@GetMapping("/info/{inStr}")
|
||||
public R getUserInfo(@PathVariable String inStr) {
|
||||
return R.ok(appSocialDetailsService.getUserInfo(inStr));
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定社交账号
|
||||
* @param state 类型
|
||||
* @param code code
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/bind")
|
||||
public R bindSocial(String state, String code) {
|
||||
return R.ok(appSocialDetailsService.bindSocial(state, code));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出
|
||||
*/
|
||||
@GetMapping("/export")
|
||||
@ResponseExcel
|
||||
public List<AppSocialDetails> export(AppSocialDetails appSocialDetails) {
|
||||
return appSocialDetailsService.list(Wrappers.query(appSocialDetails));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package com.pig4cloud.pigx.app.controller;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppTabbarEntity;
|
||||
import com.pig4cloud.pigx.app.service.AppTabbarService;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 底部导航
|
||||
*
|
||||
* @author pig
|
||||
* @date 2023-06-07 16:32:35
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/appTabbar")
|
||||
@Tag(description = "appTabbar", name = "底部导航")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class AppTabbarController {
|
||||
|
||||
private final AppTabbarService tabbarService;
|
||||
|
||||
/**
|
||||
* 查询导航列表
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "查询导航列表", description = "查询导航列表")
|
||||
@GetMapping("/list")
|
||||
public R list() {
|
||||
return R.ok(tabbarService.list());
|
||||
}
|
||||
|
||||
@Operation(summary = "更新导航", description = "更新导航")
|
||||
@PutMapping
|
||||
public R update(@RequestBody List<AppTabbarEntity> tabbarEntityList) {
|
||||
// 删除不在新增范围的导航菜单
|
||||
List<Long> idList = tabbarService.list().stream().map(AppTabbarEntity::getId).collect(Collectors.toList());
|
||||
List<Long> newIdList = tabbarEntityList.stream().map(AppTabbarEntity::getId).collect(Collectors.toList());
|
||||
tabbarService.removeBatchByIds(CollUtil.subtractToList(idList, newIdList));
|
||||
return R.ok(tabbarService.saveOrUpdateBatch(tabbarEntityList));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,208 @@
|
||||
package com.pig4cloud.pigx.app.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.pig4cloud.pigx.app.api.dto.AppUserDTO;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppUser;
|
||||
import com.pig4cloud.pigx.app.api.vo.AppUserExcelVO;
|
||||
import com.pig4cloud.pigx.app.service.AppUserService;
|
||||
import com.pig4cloud.pigx.common.core.constant.CommonConstants;
|
||||
import com.pig4cloud.pigx.common.core.constant.enums.UserTypeEnum;
|
||||
import com.pig4cloud.pigx.common.core.exception.ErrorCodes;
|
||||
import com.pig4cloud.pigx.common.core.util.MsgUtils;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.common.excel.annotation.RequestExcel;
|
||||
import com.pig4cloud.pigx.common.excel.annotation.ResponseExcel;
|
||||
import com.pig4cloud.pigx.common.log.annotation.SysLog;
|
||||
import com.pig4cloud.pigx.common.security.annotation.Inner;
|
||||
import com.pig4cloud.pigx.common.security.util.SecurityUtils;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* app用户表
|
||||
*
|
||||
* @author aeizzz
|
||||
* @date 2022-12-07 09:52:03
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/appuser")
|
||||
@Tag(description = "appuser", name = "app用户表管理")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class AppUserController {
|
||||
|
||||
private final AppUserService appUserService;
|
||||
|
||||
|
||||
/**
|
||||
* 注册用户
|
||||
* @param userDto 用户信息
|
||||
* @return success/false
|
||||
*/
|
||||
@Operation(summary = "注册用户", description = "注册用户")
|
||||
@Inner(value = false)
|
||||
@SysLog("注册用户")
|
||||
@PostMapping("/regUser")
|
||||
public R<Boolean> registerUser(@RequestBody AppUserDTO userDto) {
|
||||
// 判断用户名是否存在
|
||||
AppUser user = appUserService.getOne(Wrappers.<AppUser>query()
|
||||
.lambda().eq(AppUser::getUsername, userDto.getUsername()));
|
||||
if (user != null) {
|
||||
String message = MsgUtils.getMessage(ErrorCodes.SYS_USER_USERNAME_EXISTING, userDto.getUsername());
|
||||
return R.failed(message);
|
||||
}
|
||||
return R.ok(appUserService.regUser(userDto));
|
||||
}
|
||||
|
||||
@Inner
|
||||
@GetMapping("/info/{username}")
|
||||
public R info(@PathVariable String username) {
|
||||
AppUser user = appUserService.getOne(Wrappers.<AppUser>query().lambda().eq(AppUser::getUsername, username).or()
|
||||
.eq(AppUser::getPhone, username));
|
||||
if (user == null) {
|
||||
return R.failed(MsgUtils.getMessage(ErrorCodes.APP_USER_USERINFO_EMPTY, username));
|
||||
}
|
||||
return R.ok(appUserService.findUserInfo(user));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前用户全部信息
|
||||
* @return 用户信息
|
||||
*/
|
||||
@GetMapping(value = { "/info" })
|
||||
public R info() {
|
||||
String username = SecurityUtils.getUser().getUsername();
|
||||
AppUser user = appUserService.getOne(Wrappers.<AppUser>query().lambda().eq(AppUser::getUsername, username));
|
||||
if (user == null) {
|
||||
return R.failed(MsgUtils.getMessage(ErrorCodes.SYS_USER_QUERY_ERROR));
|
||||
}
|
||||
return R.ok(appUserService.findUserInfo(user));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param page 分页对象
|
||||
* @param appUserDTO app用户表
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "分页查询", description = "分页查询")
|
||||
@GetMapping("/page")
|
||||
public R getAppUserPage(Page page, AppUserDTO appUserDTO) {
|
||||
return R.ok(appUserService.getUsersWithRolePage(page, appUserDTO));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询app用户表
|
||||
* @param userId id
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "通过id查询", description = "通过id查询")
|
||||
@GetMapping("/details/{userId}")
|
||||
public R getById(@PathVariable("userId") Long userId) {
|
||||
return R.ok(appUserService.selectUserVoById(userId));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "通过userName查询", description = "通过userName查询")
|
||||
@GetMapping("/details")
|
||||
public R getByUserName(AppUser user) {
|
||||
AppUser one = appUserService.getOne(Wrappers.query(user), false);
|
||||
return R.ok(one == null ? null : CommonConstants.SUCCESS);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增app用户表
|
||||
* @param appUser app用户表
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "新增app用户表", description = "新增app用户表")
|
||||
@SysLog("新增app用户表")
|
||||
@PostMapping
|
||||
@PreAuthorize("@pms.hasPermission('app_appuser_add')")
|
||||
public R save(@RequestBody AppUserDTO appUser) {
|
||||
appUserService.saveUser(appUser);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改app用户表
|
||||
* @param appUser app用户表
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "修改app用户表", description = "修改app用户表")
|
||||
@SysLog("修改app用户表")
|
||||
@PutMapping
|
||||
@PreAuthorize("@pms.hasPermission('app_appuser_edit')")
|
||||
public R updateById(@RequestBody AppUserDTO appUser) {
|
||||
return R.ok(appUserService.updateUser(appUser));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除app用户表
|
||||
* @param ids userIds
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "通过ids删除app用户表", description = "通过ids删除app用户表")
|
||||
@SysLog("通过id删除app用户表")
|
||||
@DeleteMapping
|
||||
@PreAuthorize("@pms.hasPermission('app_appuser_del')")
|
||||
public R removeById(@RequestBody Long[] ids) {
|
||||
return R.ok(appUserService.deleteAppUserByIds(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel 表格
|
||||
* @param appUser 查询条件
|
||||
* @return excel 文件流
|
||||
*/
|
||||
@ResponseExcel
|
||||
@GetMapping("/export")
|
||||
@PreAuthorize("@pms.hasPermission('app_appuser_export')")
|
||||
public List<AppUserExcelVO> export(AppUserDTO appUser) {
|
||||
return appUserService.listUser(appUser);
|
||||
}
|
||||
|
||||
@SysLog("修改个人信息")
|
||||
@PutMapping("/edit")
|
||||
public R updateUserInfo(@Valid @RequestBody AppUserDTO userDto) {
|
||||
if (UserTypeEnum.TOC.getStatus().equals(SecurityUtils.getUser().getUserType())) {
|
||||
userDto.setUserId(SecurityUtils.getUser().getId());
|
||||
// TOC 以手机号为key
|
||||
userDto.setUsername(SecurityUtils.getUser().getUsername());
|
||||
}
|
||||
return appUserService.updateUserInfo(userDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入用户
|
||||
* @param excelVOList 用户列表
|
||||
* @param bindingResult 错误信息列表
|
||||
* @return R
|
||||
*/
|
||||
@PostMapping("/import")
|
||||
@PreAuthorize("@pms.hasPermission('app_appuser_export')")
|
||||
public R importUser(@RequestExcel List<AppUserExcelVO> excelVOList, BindingResult bindingResult) {
|
||||
return appUserService.importUser(excelVOList, bindingResult);
|
||||
}
|
||||
|
||||
@Operation(summary = "注册app用户表", description = "注册app用户表")
|
||||
@SysLog("注册app用户表")
|
||||
@Inner(value = false)
|
||||
@PostMapping("/register")
|
||||
public R register(@RequestBody AppUserDTO appUser) {
|
||||
return appUserService.registerAppUser(appUser);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,128 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.app.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppUserRole;
|
||||
import com.pig4cloud.pigx.app.service.AppUserRoleService;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.common.excel.annotation.ResponseExcel;
|
||||
import com.pig4cloud.pigx.common.log.annotation.SysLog;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户角色表
|
||||
*
|
||||
* @author aeizzz
|
||||
* @date 2022-12-07 09:52:03
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/appuserrole")
|
||||
@Tag(description = "appuserrole", name = "用户角色表管理")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class AppUserRoleController {
|
||||
|
||||
private final AppUserRoleService appUserRoleService;
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param page 分页对象
|
||||
* @param appUserRole 用户角色表
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "分页查询", description = "分页查询")
|
||||
@GetMapping("/page")
|
||||
@PreAuthorize("@pms.hasPermission('app_appuserrole_view')")
|
||||
public R getAppUserRolePage(Page page, AppUserRole appUserRole) {
|
||||
return R.ok(appUserRoleService.page(page, Wrappers.query(appUserRole)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询用户角色表
|
||||
* @param userId id
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "通过id查询", description = "通过id查询")
|
||||
@GetMapping("/{userId}")
|
||||
@PreAuthorize("@pms.hasPermission('app_appuserrole_view')")
|
||||
public R getById(@PathVariable("userId") Long userId) {
|
||||
return R.ok(appUserRoleService.getById(userId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增用户角色表
|
||||
* @param appUserRole 用户角色表
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "新增用户角色表", description = "新增用户角色表")
|
||||
@SysLog("新增用户角色表")
|
||||
@PostMapping
|
||||
@PreAuthorize("@pms.hasPermission('app_appuserrole_add')")
|
||||
public R save(@RequestBody AppUserRole appUserRole) {
|
||||
return R.ok(appUserRoleService.save(appUserRole));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户角色表
|
||||
* @param appUserRole 用户角色表
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "修改用户角色表", description = "修改用户角色表")
|
||||
@SysLog("修改用户角色表")
|
||||
@PutMapping
|
||||
@PreAuthorize("@pms.hasPermission('app_appuserrole_edit')")
|
||||
public R updateById(@RequestBody AppUserRole appUserRole) {
|
||||
return R.ok(appUserRoleService.updateById(appUserRole));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除用户角色表
|
||||
* @param userId id
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "通过id删除用户角色表", description = "通过id删除用户角色表")
|
||||
@SysLog("通过id删除用户角色表")
|
||||
@DeleteMapping("/{userId}")
|
||||
@PreAuthorize("@pms.hasPermission('app_appuserrole_del')")
|
||||
public R removeById(@PathVariable Long userId) {
|
||||
return R.ok(appUserRoleService.removeById(userId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel 表格
|
||||
* @param appUserRole 查询条件
|
||||
* @return excel 文件流
|
||||
*/
|
||||
@ResponseExcel
|
||||
@GetMapping("/export")
|
||||
@PreAuthorize("@pms.hasPermission('app_appuserrole_export')")
|
||||
public List<AppUserRole> export(AppUserRole appUserRole) {
|
||||
return appUserRoleService.list(Wrappers.query(appUserRole));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package com.pig4cloud.pigx.app.controller.as;
|
||||
|
||||
import com.pig4cloud.pigx.app.service.as.AsPlatformService;
|
||||
import com.pig4cloud.pigx.app.service.as.AsSubPayrollService;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* AS 公用API
|
||||
* 注:不需要访问权限
|
||||
* 注2:限制请求频次
|
||||
*
|
||||
* @author amigo
|
||||
* @date 2023-8
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/asApi")
|
||||
@Tag(description = "AS-public-api", name = "AS-公用API")
|
||||
//@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class AsApi {
|
||||
|
||||
//传参二进制加密?
|
||||
|
||||
private final AsPlatformService asPlatformService;
|
||||
private final AsSubPayrollService asSubPayrollService;
|
||||
|
||||
/**
|
||||
* 获取首页产品、用户订单、评价等 展示信息
|
||||
* todo 静态缓存,限流
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "首页产品、订单信息", description = "首页产品、订单信息")
|
||||
@GetMapping("/indexInfo")
|
||||
public R indexInfo(){
|
||||
|
||||
// asPlatformService.getById();
|
||||
// AsSubPayroll byId = asSubPayrollService.getById();
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
//首页信息
|
||||
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package com.pig4cloud.pigx.app.controller.as;
|
||||
|
||||
import com.pig4cloud.pigx.app.api.entity.as.AsPlatform;
|
||||
import com.pig4cloud.pigx.app.service.as.AsPlatformService;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.common.log.annotation.SysLog;
|
||||
import com.pig4cloud.pigx.common.security.annotation.Inner;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* as 媒体平台
|
||||
*
|
||||
* @author amigo
|
||||
* @date 2023-7
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/asPlatform")
|
||||
@Tag(description = "AS platform manage", name = "AS-流媒体平台")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class AsPlatformController {
|
||||
|
||||
private final AsPlatformService asPlatformService;
|
||||
|
||||
/**
|
||||
* 新增媒体平台
|
||||
* @param asPlatform 媒体平台
|
||||
* @return success/false
|
||||
*/
|
||||
@Operation(summary = "新增媒体平台", description = "新增媒体平台")
|
||||
@PostMapping("/save")
|
||||
public R save(@Valid @RequestBody AsPlatform asPlatform) {
|
||||
asPlatformService.save(asPlatform);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回媒体平台集合
|
||||
* @param platType 媒体平台
|
||||
* @return 媒体平台集合
|
||||
* get -> post
|
||||
*/
|
||||
@Inner(value = false)
|
||||
@Operation(summary = "查询媒体平台", description = "查询媒体平台 0:全部")
|
||||
@GetMapping("/getPlatform")
|
||||
public R getPlatform(Integer platType) {
|
||||
return R.ok(asPlatformService.listAsPlatformByType(platType));
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新媒体平台
|
||||
* @param asPlatform
|
||||
* @return
|
||||
*/
|
||||
@SysLog("更新媒体平台")
|
||||
@Operation(summary = "更新媒体平台", description = "更新媒体平台")
|
||||
@PutMapping("/update")
|
||||
public R update(@Valid @RequestBody AsPlatform asPlatform) {
|
||||
return R.ok(asPlatformService.updateById(asPlatform));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package com.pig4cloud.pigx.app.controller.as;
|
||||
|
||||
import com.pig4cloud.pigx.app.api.entity.as.AsPlatformType;
|
||||
import com.pig4cloud.pigx.app.service.as.AsPlatformTypeService;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.common.log.annotation.SysLog;
|
||||
import com.pig4cloud.pigx.common.security.annotation.Inner;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* as 平台类型
|
||||
*
|
||||
* @author amigo
|
||||
* @date 2023-7
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/asPlatformType")
|
||||
@Tag(description = "AS-platformType-manage", name = "AS-平台类型")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class AsPlatformTypeController {
|
||||
|
||||
private final AsPlatformTypeService asPlatformTypeService;
|
||||
|
||||
/**
|
||||
* 新增订阅计划
|
||||
* @param asPlatformType 订阅计划
|
||||
* @return success/false
|
||||
*/
|
||||
@SysLog("新增平台类型")
|
||||
@Operation(summary = "新增平台类型", description = "新增平台类型")
|
||||
@PostMapping("/save")
|
||||
// @PreAuthorize("@pms.hasPermission('as_subplan_add')")
|
||||
public R save(@Valid @RequestBody AsPlatformType asPlatformType) {
|
||||
asPlatformTypeService.save(asPlatformType);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回平台类型集合
|
||||
* @param platType 平台类型
|
||||
* @return 平台类型集合
|
||||
* get -> post
|
||||
*/
|
||||
@Inner(value = false)
|
||||
@Operation(summary = "查询平台类型", description = "查询平台类型 0:全部")
|
||||
@GetMapping("/getPlatformType")
|
||||
public R getPlatformType(Integer platType) {
|
||||
return R.ok(asPlatformTypeService.listAsPlatformTypeByType(platType));
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新平台类型
|
||||
* @param asPlatformType
|
||||
* @return
|
||||
*/
|
||||
@SysLog("更新平台类型")
|
||||
@Operation(summary = "更新平台类型", description = "更新平台类型")
|
||||
@PutMapping("/update")
|
||||
public R update(@Valid @RequestBody AsPlatformType asPlatformType) {
|
||||
return R.ok(asPlatformTypeService.updateById(asPlatformType));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.pig4cloud.pigx.app.controller.as;
|
||||
|
||||
import com.pig4cloud.pigx.app.service.as.AsSubAccountService;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.common.security.annotation.Inner;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* as 订阅账号表
|
||||
*
|
||||
* @author amigo
|
||||
* @date 2023-8
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/asSubAccount")
|
||||
@Tag(description = "AS-subAccount-manage", name = "AS-流媒体账号")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class AsSubAccountController {
|
||||
|
||||
private final AsSubAccountService asSubAccountService;
|
||||
|
||||
//get by userid (前台) 其他条件 平台、订阅付费计划、 时间、
|
||||
|
||||
@Inner(value = false)
|
||||
@Operation(summary = "获取订阅账号", description = "获取订阅账号")
|
||||
@GetMapping("/getSubAccountBy")
|
||||
public R getSubAccountBy() {
|
||||
// return R.ok(asSubAccountService.getOne());
|
||||
// return R.ok(asSubAccountService.listByMap());
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.pig4cloud.pigx.app.controller.as;
|
||||
|
||||
import com.pig4cloud.pigx.app.service.as.AsSubPayrollService;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.common.security.annotation.Inner;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* as 订阅付费计划
|
||||
*
|
||||
* @author amigo
|
||||
* @date 2023-8
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/asSubPayroll")
|
||||
@Tag(description = "AS-subPayroll-manage", name = "AS-订阅付费计划")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class AsSubPayrollController {
|
||||
|
||||
private final AsSubPayrollService asSubPayrollService;
|
||||
|
||||
/**
|
||||
* 返回订阅计划集合
|
||||
* @param platId 平台id
|
||||
* @return 订阅计划集合
|
||||
*/
|
||||
@Inner(value = false)
|
||||
@Operation(summary = "获取订阅计划", description = "获取订阅计划")
|
||||
@GetMapping("/getSubPayrollBy")
|
||||
public R getSubPayrollBy(Long platId,String region) {
|
||||
return R.ok(asSubPayrollService.listByPlatId(platId,region));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.pig4cloud.pigx.app.controller.as;
|
||||
|
||||
import com.pig4cloud.pigx.app.api.entity.as.AsSubPlan;
|
||||
import com.pig4cloud.pigx.app.service.as.AsSubPlanService;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* as 订阅计划表
|
||||
*
|
||||
* @author amigo
|
||||
* @date 2023-7
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/asSubPlan")
|
||||
@Tag(description = "AS-subPlan-manage", name = "AS-流媒体订阅计划")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class AsSubPlanController {
|
||||
|
||||
private final AsSubPlanService asSubPlanService;
|
||||
|
||||
/**
|
||||
* 新增订阅计划
|
||||
* @param subPlan 订阅计划
|
||||
* @return success/false
|
||||
*/
|
||||
@Operation(summary = "新增订阅计划", description = "新增订阅计划")
|
||||
@PostMapping("/save")
|
||||
// @PreAuthorize("@pms.hasPermission('as_subplan_add')")
|
||||
public R save(@Valid @RequestBody AsSubPlan subPlan) {
|
||||
asSubPlanService.save(subPlan);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回订阅计划集合
|
||||
* @param platId 平台id
|
||||
* @return 订阅计划集合
|
||||
*/
|
||||
@Operation(summary = "获取订阅计划", description = "获取订阅计划")
|
||||
@GetMapping("/getSubPlan")
|
||||
public R getSubPlan(Long platId) {
|
||||
return R.ok(asSubPlanService.listSubPlanByPlatId(platId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新订阅计划
|
||||
* @param subPlan
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "更新订阅计划", description = "更新订阅计划")
|
||||
@PutMapping("/update")
|
||||
public R update(@Valid @RequestBody AsSubPlan subPlan) {
|
||||
return R.ok(asSubPlanService.updateById(subPlan));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.pig4cloud.pigx.app.controller.as;
|
||||
|
||||
import com.pig4cloud.pigx.app.service.as.AsSubProductCmtService;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* as 订阅产品评价
|
||||
*
|
||||
* @author amigo
|
||||
* @date 2023-9
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/asSubProductCmt")
|
||||
@Tag(description = "AS-sub-product-comment", name = "AS-订阅产品评价")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class AsSubProductCmtController {
|
||||
|
||||
private final AsSubProductCmtService asSubProductCmtService;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.pig4cloud.pigx.app.controller.as;
|
||||
|
||||
import com.pig4cloud.pigx.app.service.as.AsSubProductService;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* as 订阅产品
|
||||
*
|
||||
* @author amigo
|
||||
* @date 2023-9
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/asSubProduct")
|
||||
@Tag(description = "AS-sub-product", name = "AS-订阅产品")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class AsSubProductController {
|
||||
|
||||
private final AsSubProductService asSubProductService;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.pig4cloud.pigx.app.controller.as;
|
||||
|
||||
import com.pig4cloud.pigx.app.service.as.AsUserSubService;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.common.security.annotation.Inner;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* as 用户订阅
|
||||
*
|
||||
* @author amigo
|
||||
* @date 2023-7
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/asUserSub")
|
||||
@Tag(description = "AS-sub-manage", name = "AS-订阅")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class AsUserSubController {
|
||||
|
||||
//init first page ?
|
||||
|
||||
private final AsUserSubService asUserSubService;
|
||||
|
||||
/**
|
||||
* 获取订阅人数
|
||||
* 根据平台类型查询总订阅人数 、 新增至redis
|
||||
*/
|
||||
@Inner(value = false)
|
||||
@Operation(summary = "获取订阅人数", description = "获取订阅人数")
|
||||
@GetMapping("/getSubCount")
|
||||
public R getSubCount(){
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.app.handler;
|
||||
|
||||
import com.pig4cloud.pigx.app.api.dto.AppUserInfo;
|
||||
|
||||
/**
|
||||
* @author lengleng
|
||||
* @date 2018/11/18
|
||||
*/
|
||||
public abstract class AbstractLoginHandler implements LoginHandler {
|
||||
|
||||
/***
|
||||
* 数据合法性校验
|
||||
* @param loginStr 通过用户传入获取唯一标识
|
||||
* @return 默认不校验
|
||||
*/
|
||||
@Override
|
||||
public Boolean check(String loginStr) {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理方法
|
||||
* @param loginStr 登录参数
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AppUserInfo handle(String loginStr) {
|
||||
if (!check(loginStr)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
String identify = identify(loginStr);
|
||||
return info(identify);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.app.handler;
|
||||
|
||||
import com.pig4cloud.pigx.app.api.dto.AppUserInfo;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppUser;
|
||||
|
||||
/**
|
||||
* @author lengleng
|
||||
* @date 2018/11/18
|
||||
* <p>
|
||||
* 登录处理器
|
||||
*/
|
||||
public interface LoginHandler {
|
||||
|
||||
/***
|
||||
* 数据合法性校验
|
||||
* @param loginStr 通过用户传入获取唯一标识
|
||||
* @return
|
||||
*/
|
||||
Boolean check(String loginStr);
|
||||
|
||||
/**
|
||||
* 通过用户传入获取唯一标识
|
||||
* @param loginStr
|
||||
* @return
|
||||
*/
|
||||
String identify(String loginStr);
|
||||
|
||||
/**
|
||||
* 通过openId 获取用户信息
|
||||
* @param identify
|
||||
* @return
|
||||
*/
|
||||
AppUserInfo info(String identify);
|
||||
|
||||
/**
|
||||
* 处理方法
|
||||
* @param loginStr 登录参数
|
||||
* @return
|
||||
*/
|
||||
AppUserInfo handle(String loginStr);
|
||||
|
||||
/**
|
||||
* 绑定逻辑
|
||||
* @param user 用户实体
|
||||
* @param identify 渠道返回唯一标识
|
||||
* @return
|
||||
*/
|
||||
default Boolean bind(AppUser user, String identify) {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.app.handler;
|
||||
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.pig4cloud.pigx.app.api.dto.AppUserInfo;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppSocialDetails;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppUser;
|
||||
import com.pig4cloud.pigx.app.mapper.AppSocialDetailsMapper;
|
||||
import com.pig4cloud.pigx.app.service.AppUserService;
|
||||
import com.pig4cloud.pigx.common.core.constant.SecurityConstants;
|
||||
import com.pig4cloud.pigx.common.core.constant.enums.LoginTypeEnum;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @author lengleng
|
||||
* @date 2019年11月02日
|
||||
* <p>
|
||||
* 微信小程序
|
||||
*/
|
||||
@Slf4j
|
||||
@Component("APP-MINI")
|
||||
@AllArgsConstructor
|
||||
public class MiniAppLoginHandler extends AbstractLoginHandler {
|
||||
|
||||
private final AppUserService appUserService;
|
||||
|
||||
private final AppSocialDetailsMapper appSocialDetailsMapper;
|
||||
|
||||
/**
|
||||
* 小程序登录传入code
|
||||
* <p>
|
||||
* 通过code 调用qq 获取唯一标识
|
||||
* @param code
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public String identify(String code) {
|
||||
AppSocialDetails condition = new AppSocialDetails();
|
||||
condition.setType(LoginTypeEnum.MINI_APP.getType());
|
||||
AppSocialDetails socialDetails = appSocialDetailsMapper.selectOne(new QueryWrapper<>(condition));
|
||||
|
||||
String url = String.format(SecurityConstants.MINI_APP_AUTHORIZATION_CODE_URL, socialDetails.getAppId(),
|
||||
socialDetails.getAppSecret(), code);
|
||||
String result = HttpUtil.get(url);
|
||||
log.debug("微信小程序响应报文:{}", result);
|
||||
|
||||
Object obj = JSONUtil.parseObj(result).get("openid");
|
||||
return obj.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* openId 获取用户信息
|
||||
* @param openId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AppUserInfo info(String openId) {
|
||||
AppUser user = appUserService.getOne(Wrappers.<AppUser>query().lambda().eq(AppUser::getWxOpenid, openId));
|
||||
|
||||
if (user == null) {
|
||||
log.info("微信小程序未绑定:{},创建新的用户", openId);
|
||||
return createAndSaveAppUserInfo(openId);
|
||||
}
|
||||
return appUserService.findUserInfo(user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定逻辑
|
||||
* @param user 用户实体
|
||||
* @param identify 渠道返回唯一标识
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Boolean bind(AppUser user, String identify) {
|
||||
user.setWxOpenid(identify);
|
||||
appUserService.updateById(user);
|
||||
return true;
|
||||
}
|
||||
|
||||
private AppUserInfo createAndSaveAppUserInfo(String openId) {
|
||||
AppUser appUser = new AppUser();
|
||||
appUser.setWxOpenid(openId);
|
||||
appUser.setUsername(openId);
|
||||
appUserService.saveOrUpdate(appUser, Wrappers.<AppUser>lambdaQuery().eq(AppUser::getUsername, openId));
|
||||
|
||||
AppUserInfo appUserDTO = new AppUserInfo();
|
||||
appUserDTO.setAppUser(appUser);
|
||||
return appUserDTO;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.app.handler;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.pig4cloud.pigx.app.api.dto.AppUserInfo;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppUser;
|
||||
import com.pig4cloud.pigx.app.service.AppUserService;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @author lengleng
|
||||
* @date 2018/11/18
|
||||
*/
|
||||
@Slf4j
|
||||
@Component("APP-SMS")
|
||||
@AllArgsConstructor
|
||||
public class SmsLoginHandler extends AbstractLoginHandler {
|
||||
|
||||
private final AppUserService appUserService;
|
||||
|
||||
/**
|
||||
* 验证码登录传入为手机号 不用不处理
|
||||
* @param mobile
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public String identify(String mobile) {
|
||||
return mobile;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过mobile 获取用户信息
|
||||
* @param identify
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AppUserInfo info(String identify) {
|
||||
AppUser user = appUserService.getOne(Wrappers.<AppUser>query().lambda().eq(AppUser::getPhone, identify));
|
||||
|
||||
if (user == null) {
|
||||
log.info("手机号未注册:{}", identify);
|
||||
return createAndSaveAppUserInfo(identify);
|
||||
}
|
||||
return appUserService.findUserInfo(user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建并插入用户
|
||||
* @param identify
|
||||
* @return
|
||||
*/
|
||||
private AppUserInfo createAndSaveAppUserInfo(String phone) {
|
||||
AppUser appUser = new AppUser();
|
||||
appUser.setUsername(phone);
|
||||
appUser.setPhone(phone);
|
||||
appUserService.saveOrUpdate(appUser, Wrappers.<AppUser>lambdaQuery().eq(AppUser::getPhone, phone));
|
||||
|
||||
AppUserInfo appUserDTO = new AppUserInfo();
|
||||
appUserDTO.setAppUser(appUser);
|
||||
return appUserDTO;
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定逻辑
|
||||
* @param user 用户实体
|
||||
* @param identify 渠道返回唯一标识
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Boolean bind(AppUser user, String identify) {
|
||||
user.setPhone(identify);
|
||||
appUserService.updateById(user);
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.pig4cloud.pigx.app.mapper;
|
||||
|
||||
import com.pig4cloud.pigx.app.api.entity.AppArticleCategoryEntity;
|
||||
import com.pig4cloud.pigx.common.data.datascope.PigxBaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface AppArticleCategoryMapper extends PigxBaseMapper<AppArticleCategoryEntity> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.pig4cloud.pigx.app.mapper;
|
||||
|
||||
import com.pig4cloud.pigx.app.api.entity.AppArticleCollectEntity;
|
||||
import com.pig4cloud.pigx.common.data.datascope.PigxBaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface AppArticleCollectMapper extends PigxBaseMapper<AppArticleCollectEntity> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.pig4cloud.pigx.app.mapper;
|
||||
|
||||
import com.pig4cloud.pigx.app.api.entity.AppArticleEntity;
|
||||
import com.pig4cloud.pigx.common.data.datascope.PigxBaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface AppArticleMapper extends PigxBaseMapper<AppArticleEntity> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.pig4cloud.pigx.app.mapper;
|
||||
|
||||
import com.pig4cloud.pigx.app.api.entity.AppPageEntity;
|
||||
import com.pig4cloud.pigx.common.data.datascope.PigxBaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface AppPageMapper extends PigxBaseMapper<AppPageEntity> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.app.mapper;
|
||||
|
||||
import com.pig4cloud.pigx.app.api.entity.AppRole;
|
||||
import com.pig4cloud.pigx.common.data.datascope.PigxBaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* app角色表
|
||||
*
|
||||
* @author aeizzz
|
||||
* @date 2022-12-07 09:52:03
|
||||
*/
|
||||
@Mapper
|
||||
public interface AppRoleMapper extends PigxBaseMapper<AppRole> {
|
||||
|
||||
List<AppRole> listRolesByUserId(Long userId);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.app.mapper;
|
||||
|
||||
import com.pig4cloud.pigx.app.api.entity.AppSocialDetails;
|
||||
import com.pig4cloud.pigx.common.data.datascope.PigxBaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 系统社交登录账号表
|
||||
*
|
||||
* @author lengleng
|
||||
* @date 2018-08-16 21:30:41
|
||||
*/
|
||||
@Mapper
|
||||
public interface AppSocialDetailsMapper extends PigxBaseMapper<AppSocialDetails> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.pig4cloud.pigx.app.mapper;
|
||||
|
||||
import com.pig4cloud.pigx.app.api.entity.AppTabbarEntity;
|
||||
import com.pig4cloud.pigx.common.data.datascope.PigxBaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface AppTabbarMapper extends PigxBaseMapper<AppTabbarEntity> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.app.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.pig4cloud.pigx.app.api.dto.AppUserDTO;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppUser;
|
||||
import com.pig4cloud.pigx.app.api.vo.AppUserVO;
|
||||
import com.pig4cloud.pigx.common.data.datascope.PigxBaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* app用户表
|
||||
*
|
||||
* @author aeizzz
|
||||
* @date 2022-12-07 09:52:03
|
||||
*/
|
||||
@Mapper
|
||||
public interface AppUserMapper extends PigxBaseMapper<AppUser> {
|
||||
|
||||
IPage<AppUserVO> getUserVosPage(Page page, @Param("query") AppUserDTO appUserDTO);
|
||||
|
||||
AppUserVO getUserVoById(Long userId);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.app.mapper;
|
||||
|
||||
import com.pig4cloud.pigx.app.api.entity.AppUserRole;
|
||||
import com.pig4cloud.pigx.common.data.datascope.PigxBaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 用户角色表
|
||||
*
|
||||
* @author aeizzz
|
||||
* @date 2022-12-07 09:52:03
|
||||
*/
|
||||
@Mapper
|
||||
public interface AppUserRoleMapper extends PigxBaseMapper<AppUserRole> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.pig4cloud.pigx.app.mapper.as;
|
||||
|
||||
import com.pig4cloud.pigx.app.api.entity.as.AsPlatform;
|
||||
import com.pig4cloud.pigx.common.data.datascope.PigxBaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 媒体平台
|
||||
*
|
||||
* @author amigo
|
||||
* @date 2023-07
|
||||
*/
|
||||
@Mapper
|
||||
public interface AsPlatformMapper extends PigxBaseMapper<AsPlatform> {
|
||||
List<AsPlatform> listAsPlatformByType(Integer platformType);
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.pig4cloud.pigx.app.mapper.as;
|
||||
|
||||
import com.pig4cloud.pigx.app.api.entity.as.AsPlatformType;
|
||||
import com.pig4cloud.pigx.common.data.datascope.PigxBaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 平台类型
|
||||
*
|
||||
* @author amigo
|
||||
* @date 2023-07
|
||||
*/
|
||||
@Mapper
|
||||
public interface AsPlatformTypeMapper extends PigxBaseMapper<AsPlatformType> {
|
||||
List<AsPlatformType> listAsPlatformTypeByType(Integer platformType);
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.pig4cloud.pigx.app.mapper.as;
|
||||
|
||||
import com.pig4cloud.pigx.app.api.entity.as.AsSubAccount;
|
||||
import com.pig4cloud.pigx.common.data.datascope.PigxBaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 订阅计划
|
||||
*
|
||||
* @author amigo
|
||||
* @date 2023-08
|
||||
*/
|
||||
@Mapper
|
||||
public interface AsSubAccountMapper extends PigxBaseMapper<AsSubAccount> {
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.pig4cloud.pigx.app.mapper.as;
|
||||
|
||||
import com.pig4cloud.pigx.app.api.entity.as.AsSubPayroll;
|
||||
import com.pig4cloud.pigx.common.data.datascope.PigxBaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 订阅付费计划
|
||||
*
|
||||
* @author amigo
|
||||
* @date 2023-08
|
||||
*/
|
||||
@Mapper
|
||||
public interface AsSubPayrollMapper extends PigxBaseMapper<AsSubPayroll> {
|
||||
List<AsSubPayroll> listByPlatId(@Param("platId")Long platId, @Param("region")String region);
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.pig4cloud.pigx.app.mapper.as;
|
||||
|
||||
import com.pig4cloud.pigx.app.api.entity.as.AsSubPlan;
|
||||
import com.pig4cloud.pigx.common.data.datascope.PigxBaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 订阅计划
|
||||
*
|
||||
* @author amigo
|
||||
* @date 2023-07
|
||||
*/
|
||||
@Mapper
|
||||
public interface AsSubPlanMapper extends PigxBaseMapper<AsSubPlan> {
|
||||
List<AsSubPlan> listSubPlanByPlatId(Long platId);
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.pig4cloud.pigx.app.mapper.as;
|
||||
|
||||
import com.pig4cloud.pigx.app.api.entity.as.AsSubProductComment;
|
||||
import com.pig4cloud.pigx.common.data.datascope.PigxBaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 媒体平台
|
||||
*
|
||||
* @author amigo
|
||||
* @date 2023-09
|
||||
*/
|
||||
@Mapper
|
||||
public interface AsSubProductCommentMapper extends PigxBaseMapper<AsSubProductComment> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.pig4cloud.pigx.app.mapper.as;
|
||||
|
||||
import com.pig4cloud.pigx.app.api.entity.as.AsSubProduct;
|
||||
import com.pig4cloud.pigx.common.data.datascope.PigxBaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 媒体平台
|
||||
*
|
||||
* @author amigo
|
||||
* @date 2023-09
|
||||
*/
|
||||
@Mapper
|
||||
public interface AsSubProductMapper extends PigxBaseMapper<AsSubProduct> {
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.pig4cloud.pigx.app.mapper.as;
|
||||
|
||||
import com.pig4cloud.pigx.app.api.entity.as.AsUserSub;
|
||||
import com.pig4cloud.pigx.common.data.datascope.PigxBaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户订阅
|
||||
*
|
||||
* @author amigo
|
||||
* @date 2023-07
|
||||
*/
|
||||
@Mapper
|
||||
public interface AsUserSubMapper extends PigxBaseMapper<AsUserSub> {
|
||||
List<AsUserSub> listSubPlanById(Long id);
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package com.pig4cloud.pigx.app.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppArticleCategoryEntity;
|
||||
|
||||
public interface AppArticleCategoryService extends IService<AppArticleCategoryEntity> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.pig4cloud.pigx.app.service;
|
||||
|
||||
import com.github.yulichang.base.MPJBaseService;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppArticleCollectEntity;
|
||||
|
||||
public interface AppArticleCollectService extends MPJBaseService<AppArticleCollectEntity> {
|
||||
|
||||
Boolean saveArticleCollect(AppArticleCollectEntity appArticleCollect);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.pig4cloud.pigx.app.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppArticleEntity;
|
||||
|
||||
public interface AppArticleService extends IService<AppArticleEntity> {
|
||||
|
||||
/**
|
||||
* 获取文章并使阅读数+1
|
||||
* @param id id
|
||||
* @return
|
||||
*/
|
||||
AppArticleEntity getArticleAndIncrById(Long id, Long userId);
|
||||
|
||||
/**
|
||||
* 分页查询文章列表 包含分类名称
|
||||
* @param page 分页参数
|
||||
* @param appArticle 文章查询条件
|
||||
* @return
|
||||
*/
|
||||
Page pageAndCname(Page page, AppArticleEntity appArticle);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.pig4cloud.pigx.app.service;
|
||||
|
||||
import com.pig4cloud.pigx.app.api.entity.AppPageEntity;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* app 页面控制
|
||||
*
|
||||
* @author lengleng
|
||||
* @date 2023/6/8
|
||||
*/
|
||||
public interface AppIndexService {
|
||||
|
||||
/**
|
||||
* 首页
|
||||
*/
|
||||
Map<String, Object> index();
|
||||
|
||||
/**
|
||||
* 配置
|
||||
* @return Map<String, Object>
|
||||
*/
|
||||
Map<String, Object> config();
|
||||
|
||||
/**
|
||||
* 装修
|
||||
* @param id 装修ID
|
||||
* @return Map<String, Object>
|
||||
*/
|
||||
AppPageEntity decorate(Integer id);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.app.service;
|
||||
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
|
||||
/**
|
||||
* @author lengleng
|
||||
* @date 2018/11/14
|
||||
*/
|
||||
public interface AppMobileService {
|
||||
|
||||
/**
|
||||
* 发送手机验证码
|
||||
* @param mobile mobile
|
||||
* @return code
|
||||
*/
|
||||
R<Boolean> sendSmsCode(String mobile);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package com.pig4cloud.pigx.app.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppPageEntity;
|
||||
|
||||
public interface AppPageService extends IService<AppPageEntity> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.app.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppRole;
|
||||
import com.pig4cloud.pigx.app.api.vo.AppRoleExcelVO;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import org.springframework.validation.BindingResult;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* app角色表
|
||||
*
|
||||
* @author aeizzz
|
||||
* @date 2022-12-07 09:52:03
|
||||
*/
|
||||
public interface AppRoleService extends IService<AppRole> {
|
||||
|
||||
List<AppRole> findRolesByUserId(Long userId);
|
||||
|
||||
/**
|
||||
* 删除用户的同时,把role_menu关系删除
|
||||
* @param ids RoleIds
|
||||
*/
|
||||
Boolean deleteRoleByIds(Long[] ids);
|
||||
|
||||
R importRole(List<AppRoleExcelVO> excelVOList, BindingResult bindingResult);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.app.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.pig4cloud.pigx.app.api.dto.AppUserInfo;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppSocialDetails;
|
||||
|
||||
/**
|
||||
* 系统社交登录账号表
|
||||
*
|
||||
* @author lengleng
|
||||
* @date 2018-08-16 21:30:41
|
||||
*/
|
||||
public interface AppSocialDetailsService extends IService<AppSocialDetails> {
|
||||
|
||||
/**
|
||||
* 绑定社交账号
|
||||
* @param state 类型
|
||||
* @param code code
|
||||
* @return
|
||||
*/
|
||||
Boolean bindSocial(String state, String code);
|
||||
|
||||
/**
|
||||
* 根据入参查询用户信息
|
||||
* @param inStr
|
||||
* @return
|
||||
*/
|
||||
AppUserInfo getUserInfo(String inStr);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package com.pig4cloud.pigx.app.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppTabbarEntity;
|
||||
|
||||
public interface AppTabbarService extends IService<AppTabbarEntity> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.app.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppUserRole;
|
||||
|
||||
/**
|
||||
* 用户角色表
|
||||
*
|
||||
* @author aeizzz
|
||||
* @date 2022-12-07 09:52:03
|
||||
*/
|
||||
public interface AppUserRoleService extends IService<AppUserRole> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.pig4cloud.pigx.app.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.pig4cloud.pigx.app.api.dto.AppUserDTO;
|
||||
import com.pig4cloud.pigx.app.api.dto.AppUserInfo;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppUser;
|
||||
import com.pig4cloud.pigx.app.api.vo.AppUserExcelVO;
|
||||
import com.pig4cloud.pigx.app.api.vo.AppUserVO;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import org.springframework.validation.BindingResult;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* app用户表
|
||||
*
|
||||
* @author aeizzz
|
||||
* @date 2022-12-07 09:52:03
|
||||
*/
|
||||
public interface AppUserService extends IService<AppUser> {
|
||||
|
||||
Boolean regUser(AppUserDTO appUser);
|
||||
|
||||
Boolean updateUser(AppUserDTO appUser);
|
||||
|
||||
Boolean saveUser(AppUserDTO appUser);
|
||||
|
||||
List<AppUserExcelVO> listUser(AppUserDTO appUser);
|
||||
|
||||
IPage getUsersWithRolePage(Page page, AppUserDTO appUserDTO);
|
||||
|
||||
AppUserInfo findUserInfo(AppUser user);
|
||||
|
||||
R updateUserInfo(AppUserDTO userDto);
|
||||
|
||||
AppUserVO selectUserVoById(Long userId);
|
||||
|
||||
Boolean deleteAppUserByIds(Long[] ids);
|
||||
|
||||
R importUser(List<AppUserExcelVO> excelVOList, BindingResult bindingResult);
|
||||
|
||||
R registerAppUser(AppUserDTO appUser);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.pig4cloud.pigx.app.service.as;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.pig4cloud.pigx.app.api.entity.as.AsPlatform;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* As 媒体平台
|
||||
*
|
||||
* @author amigo
|
||||
* @date 2023-07
|
||||
*/
|
||||
public interface AsPlatformService extends IService<AsPlatform> {
|
||||
|
||||
List<AsPlatform> listAsPlatformByType(Integer platformType);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.pig4cloud.pigx.app.service.as;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.pig4cloud.pigx.app.api.entity.as.AsPlatformType;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* As 媒体平台
|
||||
*
|
||||
* @author amigo
|
||||
* @date 2023-07
|
||||
*/
|
||||
public interface AsPlatformTypeService extends IService<AsPlatformType> {
|
||||
|
||||
List<AsPlatformType> listAsPlatformTypeByType(Integer platformType);
|
||||
|
||||
// R removePlatformTypeById(Long id);
|
||||
|
||||
// Boolean updatePlatformTypeById(AsPlatformType asPlatformType);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.pig4cloud.pigx.app.service.as;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.pig4cloud.pigx.app.api.entity.as.AsSubAccount;
|
||||
|
||||
/**
|
||||
* 订阅账号表
|
||||
*
|
||||
* @author amigo
|
||||
* @date 2023-08
|
||||
*/
|
||||
public interface AsSubAccountService extends IService<AsSubAccount> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.pig4cloud.pigx.app.service.as;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.pig4cloud.pigx.app.api.entity.as.AsSubPayroll;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 订阅付费计划
|
||||
*
|
||||
* @author amigo
|
||||
* @date 2023-08
|
||||
*/
|
||||
public interface AsSubPayrollService extends IService<AsSubPayroll> {
|
||||
|
||||
/**
|
||||
* 通过平台Id查询订阅列表
|
||||
* @param platId 平台ID
|
||||
* @return 订阅列表
|
||||
*/
|
||||
List<AsSubPayroll> listByPlatId(Long platId, String region);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.pig4cloud.pigx.app.service.as;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.pig4cloud.pigx.app.api.entity.as.AsSubPlan;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* AsSubPlan
|
||||
*
|
||||
* @author amigo
|
||||
* @date 2023-07
|
||||
*/
|
||||
public interface AsSubPlanService extends IService<AsSubPlan> {
|
||||
|
||||
/**
|
||||
* 通过平台Id查询订阅列表
|
||||
* @param platId 平台ID
|
||||
* @return 订阅列表
|
||||
*/
|
||||
List<AsSubPlan> listSubPlanByPlatId(Long platId);
|
||||
|
||||
/**
|
||||
* 级联删除订阅
|
||||
* @param id 订阅ID
|
||||
* @return 成功、失败
|
||||
*/
|
||||
// R removeSubPlanById(Long id);
|
||||
|
||||
/**
|
||||
* 更新订阅信息
|
||||
* @param subPlan 订阅信息
|
||||
* @return 成功、失败
|
||||
*/
|
||||
// Boolean updateSubPlanById(AsSubPlan subPlan);
|
||||
|
||||
/**
|
||||
* 构建树
|
||||
* @param parentId 父节点ID
|
||||
* @param subPlanName 订阅名称
|
||||
* @return
|
||||
*/
|
||||
// List<Tree<Long>> treeSubPlan(Long parentId, String subPlanName);
|
||||
|
||||
/**
|
||||
* 查询订阅
|
||||
* @param voSet
|
||||
* @param parentId
|
||||
* @return
|
||||
*/
|
||||
// List<Tree<Long>> filterSubPlan(Set<AsSubPlan> voSet, String type, Long parentId);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.pig4cloud.pigx.app.service.as;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.pig4cloud.pigx.app.api.entity.as.AsSubProductComment;
|
||||
|
||||
/**
|
||||
* @author amigo
|
||||
* @date 2023-09
|
||||
*/
|
||||
public interface AsSubProductCmtService extends IService<AsSubProductComment> {
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user