feat(generator): 添加Taro页面模板和AI聊天功能
- 添加.gitignore文件配置忽略规则 - 添加Taro新增页面配置模板add.config.ts.btl - 添加Taro新增页面组件模板add.tsx.btl - 实现AiController控制器支持AI聊天消息处理 - 添加AlipayConfigUtil支付宝配置工具类 - 添加AlipayParam支付宝参数类 - 添加AliYunSender阿里云发送工具类 - 添加AliyunTranslateUtil阿里云翻译工具类 - 添加ApiResult统一返回结果类 - 配置application.yml主应用配置文件 - 配置application-cms.yml生产环境配置 - 配置application-dev.yml开发环境配置 - 添加application-prod.yml生产环境配置文件
This commit is contained in:
45
.gitignore
vendored
Normal file
45
.gitignore
vendored
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
HELP.md
|
||||||
|
target/
|
||||||
|
!.mvn/wrapper/maven-wrapper.jar
|
||||||
|
!**/src/main/**
|
||||||
|
!**/src/test/**
|
||||||
|
|
||||||
|
### STS ###
|
||||||
|
.apt_generated
|
||||||
|
.classpath
|
||||||
|
.factorypath
|
||||||
|
.project
|
||||||
|
.settings
|
||||||
|
.springBeans
|
||||||
|
.sts4-cache
|
||||||
|
|
||||||
|
### IntelliJ IDEA ###
|
||||||
|
.idea
|
||||||
|
*.iws
|
||||||
|
*.iml
|
||||||
|
*.ipr
|
||||||
|
|
||||||
|
### NetBeans ###
|
||||||
|
/nbproject/private/
|
||||||
|
/nbbuild/
|
||||||
|
/dist/
|
||||||
|
/nbdist/
|
||||||
|
/.nb-gradle/
|
||||||
|
build/
|
||||||
|
|
||||||
|
### VS Code ###
|
||||||
|
.vscode/
|
||||||
|
/cert/
|
||||||
|
/src/main/resources/dev/
|
||||||
|
|
||||||
|
### macOS ###
|
||||||
|
.DS_Store
|
||||||
|
.DS_Store?
|
||||||
|
._*
|
||||||
|
.Spotlight-V100
|
||||||
|
.Trashes
|
||||||
|
ehthumbs.db
|
||||||
|
Thumbs.db
|
||||||
|
/file/
|
||||||
|
/websoft-modules.log
|
||||||
|
/tmp/
|
||||||
51
Dockerfile
Normal file
51
Dockerfile
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
# 使用更小的 Alpine Linux + OpenJDK 17 镜像
|
||||||
|
FROM openjdk:17-jdk-alpine
|
||||||
|
|
||||||
|
# 设置工作目录
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
# 创建日志目录
|
||||||
|
RUN mkdir -p /app/logs
|
||||||
|
|
||||||
|
# 创建上传文件目录
|
||||||
|
RUN mkdir -p /app/uploads
|
||||||
|
|
||||||
|
# 安装必要工具和中文字体支持
|
||||||
|
# fontconfig: 字体配置库
|
||||||
|
# ttf-dejavu: 包含DejaVu字体,支持中文显示
|
||||||
|
# wqy-zenhei: 文泉驿正黑字体,开源中文字体
|
||||||
|
RUN apk add --no-cache wget fontconfig ttf-dejavu && \
|
||||||
|
# 下载并安装文泉驿微米黑字体(更好的中文支持)
|
||||||
|
wget -O /tmp/wqy-microhei.ttc https://github.com/anthonyfok/fonts-wqy-microhei/raw/master/wqy-microhei.ttc && \
|
||||||
|
mkdir -p /usr/share/fonts/truetype/wqy && \
|
||||||
|
mv /tmp/wqy-microhei.ttc /usr/share/fonts/truetype/wqy/ && \
|
||||||
|
# 刷新字体缓存
|
||||||
|
fc-cache -fv && \
|
||||||
|
# 创建应用用户(安全考虑)
|
||||||
|
addgroup -g 1000 appgroup && \
|
||||||
|
adduser -D -u 1000 -G appgroup appuser
|
||||||
|
|
||||||
|
# 复制jar包到容器
|
||||||
|
COPY target/*.jar app.jar
|
||||||
|
|
||||||
|
# 设置目录权限
|
||||||
|
RUN chown -R appuser:appgroup /app
|
||||||
|
|
||||||
|
# 切换到应用用户
|
||||||
|
USER appuser
|
||||||
|
|
||||||
|
# 暴露端口
|
||||||
|
EXPOSE 9200
|
||||||
|
|
||||||
|
# 设置JVM参数
|
||||||
|
ENV JAVA_OPTS="-Xms512m -Xmx1024m -Djava.security.egd=file:/dev/./urandom"
|
||||||
|
|
||||||
|
# 设置Spring Profile
|
||||||
|
ENV SPRING_PROFILES_ACTIVE=prod
|
||||||
|
|
||||||
|
# 健康检查
|
||||||
|
HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
|
||||||
|
CMD wget --no-verbose --tries=1 --spider http://localhost:9200/actuator/health || exit 1
|
||||||
|
|
||||||
|
# 启动应用
|
||||||
|
ENTRYPOINT ["sh", "-c", "java $JAVA_OPTS -jar app.jar"]
|
||||||
286
README.md
Normal file
286
README.md
Normal file
@@ -0,0 +1,286 @@
|
|||||||
|
<div align="center">
|
||||||
|
<h1>🚀 WebSoft API</h1>
|
||||||
|
<p><strong>基于 Spring Boot + MyBatis Plus 的企业级后端API服务</strong></p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<img src="https://img.shields.io/badge/Java-1.8+-ED8B00" alt="Java">
|
||||||
|
<img src="https://img.shields.io/badge/Spring%20Boot-2.5.4-6DB33F" alt="Spring Boot">
|
||||||
|
<img src="https://img.shields.io/badge/MyBatis%20Plus-3.4.3-blue" alt="MyBatis Plus">
|
||||||
|
<img src="https://img.shields.io/badge/MySQL-8.0+-4479A1" alt="MySQL">
|
||||||
|
<img src="https://img.shields.io/badge/Redis-6.0+-DC382D" alt="Redis">
|
||||||
|
<img src="https://img.shields.io/badge/License-MIT-blue" alt="License">
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
## 📖 项目简介
|
||||||
|
|
||||||
|
WebSoft API 是一个基于 **Spring Boot + MyBatis Plus** 构建的现代化企业级后端API服务,采用最新的Java技术栈:
|
||||||
|
|
||||||
|
- **核心框架**:Spring Boot 2.5.4 + Spring Security + Spring AOP
|
||||||
|
- **数据访问**:MyBatis Plus 3.4.3 + Druid 连接池
|
||||||
|
- **数据库**:MySQL + Redis
|
||||||
|
- **文档工具**:Swagger 3.0 + Knife4j
|
||||||
|
- **工具库**:Hutool、Lombok、FastJSON
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## 项目演示
|
||||||
|
| 后台管理系统 | https://mp.websoft.top |
|
||||||
|
|--------|-------------------------------------------------------------------------------------------------------------------------------------|
|
||||||
|
| 测试账号 | 13800010123,123456
|
||||||
|
| 正式账号 | [立即注册](https://mp.websoft.top/register/?inviteCode=github) |
|
||||||
|
| 关注公众号 |  |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## 🛠️ 技术栈
|
||||||
|
|
||||||
|
### 核心框架
|
||||||
|
| 技术 | 版本 | 说明 |
|
||||||
|
|------|------|------|
|
||||||
|
| Java | 1.8+ | 编程语言 |
|
||||||
|
| Spring Boot | 2.5.4 | 微服务框架 |
|
||||||
|
| Spring Security | 5.5.x | 安全框架 |
|
||||||
|
| MyBatis Plus | 3.4.3 | ORM框架 |
|
||||||
|
| MySQL | 8.0+ | 关系型数据库 |
|
||||||
|
| Redis | 6.0+ | 缓存数据库 |
|
||||||
|
| Druid | 1.2.6 | 数据库连接池 |
|
||||||
|
|
||||||
|
### 功能组件
|
||||||
|
- **Swagger 3.0 + Knife4j** - API文档生成与测试
|
||||||
|
- **JWT** - 用户认证与授权
|
||||||
|
- **Hutool** - Java工具类库
|
||||||
|
- **EasyPOI** - Excel文件处理
|
||||||
|
- **阿里云OSS** - 对象存储服务
|
||||||
|
- **微信支付/支付宝** - 支付集成
|
||||||
|
- **Socket.IO** - 实时通信
|
||||||
|
- **MQTT** - 物联网消息传输
|
||||||
|
|
||||||
|
## 📋 环境要求
|
||||||
|
|
||||||
|
### 基础环境
|
||||||
|
- ☕ **Java 1.8+**
|
||||||
|
- 🗄️ **MySQL 8.0+**
|
||||||
|
- 🔴 **Redis 6.0+**
|
||||||
|
- 📦 **Maven 3.6+**
|
||||||
|
|
||||||
|
### 开发工具
|
||||||
|
- **推荐**:IntelliJ IDEA / Eclipse
|
||||||
|
- **插件**:Lombok Plugin、MyBatis Plugin
|
||||||
|
|
||||||
|
## 🚀 快速开始
|
||||||
|
|
||||||
|
### 1. 克隆项目
|
||||||
|
```bash
|
||||||
|
git clone https://github.com/websoft-top/mp-java.git
|
||||||
|
cd mp-java
|
||||||
|
```
|
||||||
|
|
||||||
|
### 2. 数据库配置
|
||||||
|
```sql
|
||||||
|
-- 创建数据库
|
||||||
|
CREATE DATABASE websoft_db CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
||||||
|
|
||||||
|
-- 导入数据库脚本(如果有的话)
|
||||||
|
-- source /path/to/database.sql
|
||||||
|
```
|
||||||
|
|
||||||
|
### 3. 配置文件
|
||||||
|
编辑 `src/main/resources/application-dev.yml` 文件,配置数据库连接:
|
||||||
|
```yaml
|
||||||
|
spring:
|
||||||
|
datasource:
|
||||||
|
url: jdbc:mysql://localhost:3306/websoft_db?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8
|
||||||
|
username: your_username
|
||||||
|
password: your_password
|
||||||
|
redis:
|
||||||
|
host: localhost
|
||||||
|
port: 6379
|
||||||
|
password: your_redis_password
|
||||||
|
```
|
||||||
|
|
||||||
|
### 4. 启动项目
|
||||||
|
```bash
|
||||||
|
# 使用 Maven 启动
|
||||||
|
mvn spring-boot:run
|
||||||
|
|
||||||
|
# 或者使用 IDE 直接运行 WebSoftApplication.java
|
||||||
|
```
|
||||||
|
|
||||||
|
访问 `http://localhost:9200` 即可看到API服务。
|
||||||
|
|
||||||
|
### 5. API文档
|
||||||
|
启动项目后,访问以下地址查看API文档:
|
||||||
|
- Swagger UI: `http://localhost:9200/swagger-ui/index.html`
|
||||||
|
- Knife4j: `http://localhost:9200/doc.html`
|
||||||
|
|
||||||
|
## ⚙️ 配置说明
|
||||||
|
|
||||||
|
### 数据库配置
|
||||||
|
在 `application-dev.yml` 中配置数据库连接:
|
||||||
|
```yaml
|
||||||
|
spring:
|
||||||
|
datasource:
|
||||||
|
url: jdbc:mysql://localhost:3306/websoft_db
|
||||||
|
username: root
|
||||||
|
password: your_password
|
||||||
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
|
```
|
||||||
|
|
||||||
|
### Redis配置
|
||||||
|
```yaml
|
||||||
|
spring:
|
||||||
|
redis:
|
||||||
|
host: localhost
|
||||||
|
port: 6379
|
||||||
|
password: your_redis_password
|
||||||
|
database: 0
|
||||||
|
```
|
||||||
|
|
||||||
|
### 阿里云OSS配置
|
||||||
|
```yaml
|
||||||
|
config:
|
||||||
|
endpoint: https://oss-cn-shenzhen.aliyuncs.com
|
||||||
|
accessKeyId: your_access_key_id
|
||||||
|
accessKeySecret: your_access_key_secret
|
||||||
|
bucketName: your_bucket_name
|
||||||
|
bucketDomain: https://your-domain.com
|
||||||
|
```
|
||||||
|
|
||||||
|
### 其他配置
|
||||||
|
- **JWT密钥**:`config.token-key` 用于JWT令牌加密
|
||||||
|
- **文件上传路径**:`config.upload-path` 本地文件存储路径
|
||||||
|
- **邮件服务**:配置SMTP服务器用于发送邮件
|
||||||
|
|
||||||
|
## 🎯 核心功能
|
||||||
|
|
||||||
|
### 🔐 用户认证与授权
|
||||||
|
- **JWT认证**:基于JSON Web Token的用户认证
|
||||||
|
- **Spring Security**:完整的安全框架集成
|
||||||
|
- **角色权限**:基于RBAC的权限控制
|
||||||
|
- **图形验证码**:防止恶意登录
|
||||||
|
|
||||||
|
### 📝 内容管理系统(CMS)
|
||||||
|
- **文章管理**:支持富文本内容管理
|
||||||
|
- **媒体文件**:图片/视频文件上传与管理
|
||||||
|
- **分类管理**:内容分类与标签管理
|
||||||
|
- **SEO优化**:搜索引擎优化支持
|
||||||
|
|
||||||
|
### 🛒 电商系统
|
||||||
|
- **商品管理**:商品信息、规格、库存管理
|
||||||
|
- **订单系统**:完整的订单流程管理
|
||||||
|
- **支付集成**:支持微信支付、支付宝
|
||||||
|
- **物流跟踪**:快递100物流查询集成
|
||||||
|
|
||||||
|
### 🔧 系统管理
|
||||||
|
- **用户管理**:用户信息维护与管理
|
||||||
|
- **系统配置**:动态配置管理
|
||||||
|
- **日志监控**:系统操作日志记录
|
||||||
|
- **数据备份**:数据库备份与恢复
|
||||||
|
|
||||||
|
### 📊 数据分析
|
||||||
|
- **统计报表**:业务数据统计分析
|
||||||
|
- **图表展示**:数据可视化展示
|
||||||
|
- **导出功能**:Excel数据导出
|
||||||
|
- **实时监控**:系统性能监控
|
||||||
|
|
||||||
|
## 🏗️ 项目结构
|
||||||
|
|
||||||
|
```
|
||||||
|
src/main/java/com/gxwebsoft/
|
||||||
|
├── WebSoftApplication.java # 启动类
|
||||||
|
├── cms/ # 内容管理模块
|
||||||
|
│ ├── controller/ # 控制器层
|
||||||
|
│ ├── service/ # 业务逻辑层
|
||||||
|
│ ├── mapper/ # 数据访问层
|
||||||
|
│ └── entity/ # 实体类
|
||||||
|
├── shop/ # 商城模块
|
||||||
|
│ ├── controller/
|
||||||
|
│ ├── service/
|
||||||
|
│ ├── mapper/
|
||||||
|
│ └── entity/
|
||||||
|
├── common/ # 公共模块
|
||||||
|
│ ├── core/ # 核心配置
|
||||||
|
│ ├── utils/ # 工具类
|
||||||
|
│ └── exception/ # 异常处理
|
||||||
|
└── resources/
|
||||||
|
├── application.yml # 主配置文件
|
||||||
|
├── application-dev.yml # 开发环境配置
|
||||||
|
└── application-prod.yml# 生产环境配置
|
||||||
|
```
|
||||||
|
|
||||||
|
## 🔧 开发规范
|
||||||
|
|
||||||
|
### 代码结构
|
||||||
|
- **Controller层**:处理HTTP请求,参数验证
|
||||||
|
- **Service层**:业务逻辑处理,事务管理
|
||||||
|
- **Mapper层**:数据访问,SQL映射
|
||||||
|
- **Entity层**:数据实体,数据库表映射
|
||||||
|
|
||||||
|
### 命名规范
|
||||||
|
- **类名**:使用大驼峰命名法(PascalCase)
|
||||||
|
- **方法名**:使用小驼峰命名法(camelCase)
|
||||||
|
- **常量**:使用全大写,下划线分隔
|
||||||
|
- **包名**:使用小写字母,点分隔
|
||||||
|
|
||||||
|
## 📚 API文档
|
||||||
|
|
||||||
|
项目集成了Swagger和Knife4j,提供完整的API文档:
|
||||||
|
|
||||||
|
### 访问地址
|
||||||
|
- **Swagger UI**: `http://localhost:9200/swagger-ui/index.html`
|
||||||
|
- **Knife4j**: `http://localhost:9200/doc.html`
|
||||||
|
|
||||||
|
### 主要接口模块
|
||||||
|
- **用户认证**: `/api/auth/**` - 登录、注册、权限验证
|
||||||
|
- **用户管理**: `/api/user/**` - 用户CRUD操作
|
||||||
|
- **内容管理**: `/api/cms/**` - 文章、媒体文件管理
|
||||||
|
- **商城管理**: `/api/shop/**` - 商品、订单管理
|
||||||
|
- **系统管理**: `/api/system/**` - 系统配置、日志管理
|
||||||
|
|
||||||
|
## 🚀 部署指南
|
||||||
|
|
||||||
|
### 开发环境部署
|
||||||
|
```bash
|
||||||
|
# 1. 启动MySQL和Redis服务
|
||||||
|
# 2. 创建数据库并导入初始数据
|
||||||
|
# 3. 修改配置文件
|
||||||
|
# 4. 启动应用
|
||||||
|
mvn spring-boot:run
|
||||||
|
```
|
||||||
|
|
||||||
|
### 生产环境部署
|
||||||
|
```bash
|
||||||
|
# 1. 打包应用
|
||||||
|
mvn clean package -Dmaven.test.skip=true
|
||||||
|
|
||||||
|
# 2. 运行jar包
|
||||||
|
java -jar target/com-gxwebsoft-modules-1.5.0.jar --spring.profiles.active=prod
|
||||||
|
|
||||||
|
# 3. 使用Docker部署(可选)
|
||||||
|
docker build -t websoft-api .
|
||||||
|
docker run -d -p 9200:9200 websoft-api
|
||||||
|
```
|
||||||
|
|
||||||
|
## 🤝 贡献指南
|
||||||
|
|
||||||
|
1. Fork 本仓库
|
||||||
|
2. 创建特性分支 (`git checkout -b feature/AmazingFeature`)
|
||||||
|
3. 提交更改 (`git commit -m 'Add some AmazingFeature'`)
|
||||||
|
4. 推送到分支 (`git push origin feature/AmazingFeature`)
|
||||||
|
5. 打开 Pull Request
|
||||||
|
|
||||||
|
## 📄 许可证
|
||||||
|
|
||||||
|
本项目采用 MIT 许可证 - 查看 [LICENSE](LICENSE) 文件了解详情
|
||||||
|
|
||||||
|
## 📞 联系我们
|
||||||
|
|
||||||
|
- 官网:https://websoft.top
|
||||||
|
- 邮箱:170083662@qq.top
|
||||||
|
- QQ群:479713884
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
⭐ 如果这个项目对您有帮助,请给我们一个星标!
|
||||||
38
docker-compose.yml
Normal file
38
docker-compose.yml
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
version: '3.8'
|
||||||
|
|
||||||
|
services:
|
||||||
|
# 应用服务
|
||||||
|
cms-api:
|
||||||
|
build: .
|
||||||
|
container_name: cms-api
|
||||||
|
ports:
|
||||||
|
- "9200:9200"
|
||||||
|
environment:
|
||||||
|
- SPRING_PROFILES_ACTIVE=prod
|
||||||
|
- JAVA_OPTS=-Xms512m -Xmx1024m
|
||||||
|
volumes:
|
||||||
|
# 证书挂载卷 - 将宿主机证书目录挂载到容器
|
||||||
|
- ./certs:/app/certs:ro
|
||||||
|
# 日志挂载卷
|
||||||
|
- ./logs:/app/logs
|
||||||
|
# 上传文件挂载卷
|
||||||
|
- ./uploads:/app/uploads
|
||||||
|
networks:
|
||||||
|
- cms-network
|
||||||
|
restart: unless-stopped
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:9200/actuator/health"]
|
||||||
|
interval: 30s
|
||||||
|
timeout: 10s
|
||||||
|
retries: 3
|
||||||
|
start_period: 60s
|
||||||
|
|
||||||
|
networks:
|
||||||
|
cms-network:
|
||||||
|
driver: bridge
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
mysql_data:
|
||||||
|
driver: local
|
||||||
|
redis_data:
|
||||||
|
driver: local
|
||||||
188
docker-deploy-guide.md
Normal file
188
docker-deploy-guide.md
Normal file
@@ -0,0 +1,188 @@
|
|||||||
|
# Docker容器化部署指南
|
||||||
|
|
||||||
|
## 支付证书问题解决方案
|
||||||
|
|
||||||
|
本项目已经解决了Docker容器中支付证书路径失效的问题,支持多种证书加载方式。
|
||||||
|
|
||||||
|
## 目录结构
|
||||||
|
|
||||||
|
```
|
||||||
|
project-root/
|
||||||
|
├── Dockerfile
|
||||||
|
├── docker-compose.yml
|
||||||
|
├── certs/ # 证书目录(需要手动创建)
|
||||||
|
│ ├── wechat/ # 微信支付证书
|
||||||
|
│ │ ├── apiclient_key.pem
|
||||||
|
│ │ ├── apiclient_cert.pem
|
||||||
|
│ │ └── wechatpay_cert.pem
|
||||||
|
│ └── alipay/ # 支付宝证书
|
||||||
|
│ ├── app_private_key.pem
|
||||||
|
│ ├── appCertPublicKey.crt
|
||||||
|
│ ├── alipayCertPublicKey.crt
|
||||||
|
│ └── alipayRootCert.crt
|
||||||
|
├── logs/ # 日志目录
|
||||||
|
├── uploads/ # 上传文件目录
|
||||||
|
└── src/
|
||||||
|
```
|
||||||
|
|
||||||
|
## 部署步骤
|
||||||
|
|
||||||
|
### 1. 准备证书文件
|
||||||
|
|
||||||
|
创建证书目录并放置证书文件:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# 创建证书目录
|
||||||
|
mkdir -p certs/wechat
|
||||||
|
mkdir -p certs/alipay
|
||||||
|
|
||||||
|
# 复制微信支付证书到对应目录
|
||||||
|
cp /path/to/your/apiclient_key.pem certs/wechat/
|
||||||
|
cp /path/to/your/apiclient_cert.pem certs/wechat/
|
||||||
|
cp /path/to/your/wechatpay_cert.pem certs/wechat/
|
||||||
|
|
||||||
|
# 复制支付宝证书到对应目录
|
||||||
|
cp /path/to/your/app_private_key.pem certs/alipay/
|
||||||
|
cp /path/to/your/appCertPublicKey.crt certs/alipay/
|
||||||
|
cp /path/to/your/alipayCertPublicKey.crt certs/alipay/
|
||||||
|
cp /path/to/your/alipayRootCert.crt certs/alipay/
|
||||||
|
|
||||||
|
# 设置证书文件权限(只读)
|
||||||
|
chmod -R 444 certs/
|
||||||
|
```
|
||||||
|
|
||||||
|
### 2. 配置环境变量
|
||||||
|
|
||||||
|
创建 `.env` 文件(可选):
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# 应用配置
|
||||||
|
SPRING_PROFILES_ACTIVE=prod
|
||||||
|
JAVA_OPTS=-Xms512m -Xmx1024m
|
||||||
|
|
||||||
|
# 数据库配置
|
||||||
|
MYSQL_ROOT_PASSWORD=root123456
|
||||||
|
MYSQL_DATABASE=modules
|
||||||
|
MYSQL_USER=modules
|
||||||
|
MYSQL_PASSWORD=8YdLnk7KsPAyDXGA
|
||||||
|
|
||||||
|
# Redis配置
|
||||||
|
REDIS_PASSWORD=redis_WSDb88
|
||||||
|
```
|
||||||
|
|
||||||
|
### 3. 构建和启动
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# 构建应用
|
||||||
|
mvn clean package -DskipTests
|
||||||
|
|
||||||
|
# 启动所有服务
|
||||||
|
docker-compose up -d
|
||||||
|
|
||||||
|
# 查看服务状态
|
||||||
|
docker-compose ps
|
||||||
|
|
||||||
|
# 查看应用日志
|
||||||
|
docker-compose logs -f cms-app
|
||||||
|
```
|
||||||
|
|
||||||
|
### 4. 验证部署
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# 检查应用健康状态
|
||||||
|
curl http://localhost:9200/actuator/health
|
||||||
|
|
||||||
|
# 检查证书是否正确加载
|
||||||
|
docker exec cms-java-app ls -la /app/certs/
|
||||||
|
```
|
||||||
|
|
||||||
|
## 证书加载模式
|
||||||
|
|
||||||
|
### 开发环境 (CLASSPATH)
|
||||||
|
- 证书文件放在 `src/main/resources/certs/` 目录下
|
||||||
|
- 打包时会包含在jar包中
|
||||||
|
- 适合开发和测试环境
|
||||||
|
|
||||||
|
### 生产环境 (VOLUME)
|
||||||
|
- 证书文件通过Docker挂载卷加载
|
||||||
|
- 证书文件在宿主机上,挂载到容器的 `/app/certs` 目录
|
||||||
|
- 支持证书文件的动态更新(重启容器后生效)
|
||||||
|
|
||||||
|
### 文件系统模式 (FILESYSTEM)
|
||||||
|
- 直接从文件系统路径加载证书
|
||||||
|
- 适合传统部署方式
|
||||||
|
|
||||||
|
## 配置说明
|
||||||
|
|
||||||
|
### application.yml 配置
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
certificate:
|
||||||
|
load-mode: VOLUME # 证书加载模式
|
||||||
|
cert-root-path: /app/certs # 证书根目录
|
||||||
|
|
||||||
|
wechat-pay:
|
||||||
|
dev:
|
||||||
|
api-v3-key: "your-api-v3-key"
|
||||||
|
private-key-file: "apiclient_key.pem"
|
||||||
|
apiclient-cert-file: "apiclient_cert.pem"
|
||||||
|
wechatpay-cert-file: "wechatpay_cert.pem"
|
||||||
|
```
|
||||||
|
|
||||||
|
### 环境特定配置
|
||||||
|
|
||||||
|
- **开发环境**: `application-dev.yml` - 使用CLASSPATH模式
|
||||||
|
- **生产环境**: `application-prod.yml` - 使用VOLUME模式
|
||||||
|
|
||||||
|
## 故障排除
|
||||||
|
|
||||||
|
### 1. 证书文件找不到
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# 检查证书文件是否存在
|
||||||
|
docker exec cms-java-app ls -la /app/certs/
|
||||||
|
|
||||||
|
# 检查文件权限
|
||||||
|
docker exec cms-java-app ls -la /app/certs/wechat/
|
||||||
|
```
|
||||||
|
|
||||||
|
### 2. 支付接口调用失败
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# 查看应用日志
|
||||||
|
docker-compose logs cms-app | grep -i cert
|
||||||
|
|
||||||
|
# 检查证书配置
|
||||||
|
docker exec cms-java-app cat /app/application.yml | grep -A 10 certificate
|
||||||
|
```
|
||||||
|
|
||||||
|
### 3. 容器启动失败
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# 查看详细错误信息
|
||||||
|
docker-compose logs cms-app
|
||||||
|
|
||||||
|
# 检查容器状态
|
||||||
|
docker-compose ps
|
||||||
|
```
|
||||||
|
|
||||||
|
## 安全建议
|
||||||
|
|
||||||
|
1. **证书文件权限**: 设置为只读权限 (444)
|
||||||
|
2. **证书目录权限**: 限制访问权限
|
||||||
|
3. **敏感信息**: 使用环境变量或Docker secrets管理敏感配置
|
||||||
|
4. **网络安全**: 使用内部网络,限制端口暴露
|
||||||
|
|
||||||
|
## 更新证书
|
||||||
|
|
||||||
|
1. 停止应用容器:`docker-compose stop cms-app`
|
||||||
|
2. 更新证书文件到 `certs/` 目录
|
||||||
|
3. 重启应用容器:`docker-compose start cms-app`
|
||||||
|
|
||||||
|
## 监控和日志
|
||||||
|
|
||||||
|
- 应用日志:`./logs/` 目录
|
||||||
|
- 容器日志:`docker-compose logs`
|
||||||
|
- 健康检查:访问 `/actuator/health` 端点
|
||||||
|
|
||||||
|
通过以上配置,你的应用在Docker容器中就能正确加载支付证书了!
|
||||||
427
pom.xml
Normal file
427
pom.xml
Normal file
@@ -0,0 +1,427 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
<groupId>com.gxwebsoft</groupId>
|
||||||
|
<artifactId>mp-api</artifactId>
|
||||||
|
<version>1.5.0</version>
|
||||||
|
|
||||||
|
<name>mp-api</name>
|
||||||
|
<description>WebSoftApi project for Spring Boot</description>
|
||||||
|
|
||||||
|
<parent>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-parent</artifactId>
|
||||||
|
<version>2.7.18</version>
|
||||||
|
<relativePath/> <!-- lookup parent from repository -->
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<java.version>17</java.version>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<!-- spring-boot-devtools -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-devtools</artifactId>
|
||||||
|
<scope>runtime</scope>
|
||||||
|
<optional>true</optional>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- spring-boot-test -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-test</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.h2database</groupId>
|
||||||
|
<artifactId>h2</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- spring-boot-web -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-web</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Jackson JSR310 support for Java 8 time -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.fasterxml.jackson.datatype</groupId>
|
||||||
|
<artifactId>jackson-datatype-jsr310</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- spring-boot-aop -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-aop</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- spring-boot-configuration-processor -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-configuration-processor</artifactId>
|
||||||
|
<optional>true</optional>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- lombok -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.projectlombok</groupId>
|
||||||
|
<artifactId>lombok</artifactId>
|
||||||
|
<optional>true</optional>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- mysql -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.mysql</groupId>
|
||||||
|
<artifactId>mysql-connector-j</artifactId>
|
||||||
|
<scope>runtime</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- druid -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba</groupId>
|
||||||
|
<artifactId>druid-spring-boot-starter</artifactId>
|
||||||
|
<version>1.2.20</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- mybatis-plus -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.baomidou</groupId>
|
||||||
|
<artifactId>mybatis-plus-boot-starter</artifactId>
|
||||||
|
<version>3.4.3.3</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- mybatis-plus 连表插件-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.yulichang</groupId>
|
||||||
|
<artifactId>mybatis-plus-join-boot-starter</artifactId>
|
||||||
|
<version>1.4.5</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- mybatis-plus-generator -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.baomidou</groupId>
|
||||||
|
<artifactId>mybatis-plus-generator</artifactId>
|
||||||
|
<version>3.4.1</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- hutool -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.hutool</groupId>
|
||||||
|
<artifactId>hutool-core</artifactId>
|
||||||
|
<version>5.8.25</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.hutool</groupId>
|
||||||
|
<artifactId>hutool-extra</artifactId>
|
||||||
|
<version>5.8.25</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.hutool</groupId>
|
||||||
|
<artifactId>hutool-http</artifactId>
|
||||||
|
<version>5.8.25</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.hutool</groupId>
|
||||||
|
<artifactId>hutool-crypto</artifactId>
|
||||||
|
<version>5.8.25</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- easy poi -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.afterturn</groupId>
|
||||||
|
<artifactId>easypoi-base</artifactId>
|
||||||
|
<version>4.4.0</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- tika, 用于FileServer获取content-type -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.tika</groupId>
|
||||||
|
<artifactId>tika-core</artifactId>
|
||||||
|
<version>2.9.1</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- open office, 用于文档转pdf实现在线预览 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.livesense</groupId>
|
||||||
|
<artifactId>jodconverter-core</artifactId>
|
||||||
|
<version>1.0.5</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- spring-boot-mail -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-mail</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 模板引擎, 用于邮件、代码生成等 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.ibeetl</groupId>
|
||||||
|
<artifactId>beetl</artifactId>
|
||||||
|
<version>3.15.10.RELEASE</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- SpringDoc OpenAPI 3 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springdoc</groupId>
|
||||||
|
<artifactId>springdoc-openapi-ui</artifactId>
|
||||||
|
<version>1.7.0</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- spring security -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-security</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- jjwt -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.jsonwebtoken</groupId>
|
||||||
|
<artifactId>jjwt-api</artifactId>
|
||||||
|
<version>0.11.5</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.jsonwebtoken</groupId>
|
||||||
|
<artifactId>jjwt-impl</artifactId>
|
||||||
|
<version>0.11.5</version>
|
||||||
|
<scope>runtime</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.jsonwebtoken</groupId>
|
||||||
|
<artifactId>jjwt-jackson</artifactId>
|
||||||
|
<version>0.11.5</version>
|
||||||
|
<scope>runtime</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 图形验证码 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.whvcse</groupId>
|
||||||
|
<artifactId>easy-captcha</artifactId>
|
||||||
|
<version>1.6.2</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!--Redis-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-data-redis</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 阿里SDK -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.aliyun</groupId>
|
||||||
|
<artifactId>aliyun-java-sdk-core</artifactId>
|
||||||
|
<version>4.4.3</version>
|
||||||
|
</dependency>
|
||||||
|
<!--阿里支付 老版本 SDK-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alipay.sdk</groupId>
|
||||||
|
<artifactId>alipay-sdk-java</artifactId>
|
||||||
|
<version>4.35.0.ALL</version>
|
||||||
|
</dependency>
|
||||||
|
<!-- https://mvnrepository.com/artifact/org.bouncycastle/bcprov-jdk18on -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.bouncycastle</groupId>
|
||||||
|
<artifactId>bcprov-jdk18on</artifactId>
|
||||||
|
<version>1.77</version>
|
||||||
|
</dependency>
|
||||||
|
<!-- https://mvnrepository.com/artifact/commons-logging/commons-logging -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>commons-logging</groupId>
|
||||||
|
<artifactId>commons-logging</artifactId>
|
||||||
|
<version>1.3.0</version>
|
||||||
|
</dependency>
|
||||||
|
<!-- https://mvnrepository.com/artifact/com.alibaba/fastjson -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba</groupId>
|
||||||
|
<artifactId>fastjson</artifactId>
|
||||||
|
<version>2.0.43</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!--二维码-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.google.zxing</groupId>
|
||||||
|
<artifactId>core</artifactId>
|
||||||
|
<version>3.5.2</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.google.code.gson</groupId>
|
||||||
|
<artifactId>gson</artifactId>
|
||||||
|
<version>2.10.1</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.vaadin.external.google</groupId>
|
||||||
|
<artifactId>android-json</artifactId>
|
||||||
|
<version>0.0.20131108.vaadin1</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- socketio -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.corundumstudio.socketio</groupId>
|
||||||
|
<artifactId>netty-socketio</artifactId>
|
||||||
|
<version>2.0.2</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 微信支付 APIv3 Java SDK-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.wechatpay-apiv3</groupId>
|
||||||
|
<artifactId>wechatpay-java</artifactId>
|
||||||
|
<version>0.2.17</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- MQTT -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.integration</groupId>
|
||||||
|
<artifactId>spring-integration-mqtt</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.eclipse.paho</groupId>
|
||||||
|
<artifactId>org.eclipse.paho.client.mqttv3</artifactId>
|
||||||
|
<version>1.2.0</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.binarywang</groupId>
|
||||||
|
<artifactId>weixin-java-miniapp</artifactId>
|
||||||
|
<version>4.6.0</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.binarywang</groupId>
|
||||||
|
<artifactId>weixin-java-mp</artifactId>
|
||||||
|
<version>4.6.0</version> <!-- 请替换为最新版本号 -->
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 阿里云 OSS -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.aliyun.oss</groupId>
|
||||||
|
<artifactId>aliyun-sdk-oss</artifactId>
|
||||||
|
<version>3.17.4</version>
|
||||||
|
</dependency>
|
||||||
|
<!-- 快递100-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.kuaidi100-api</groupId>
|
||||||
|
<artifactId>sdk</artifactId>
|
||||||
|
<version>1.0.13</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!--诺诺开票接口-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.nuonuo</groupId>
|
||||||
|
<artifactId>open-sdk</artifactId>
|
||||||
|
<version>1.0.5.2</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- knife4j for SpringDoc OpenAPI -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.xiaoymin</groupId>
|
||||||
|
<artifactId>knife4j-openapi3-spring-boot-starter</artifactId>
|
||||||
|
<version>4.3.0</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.belerweb</groupId>
|
||||||
|
<artifactId>pinyin4j</artifactId>
|
||||||
|
<version>2.5.1</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 机器翻译 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.aliyun</groupId>
|
||||||
|
<artifactId>alimt20181012</artifactId>
|
||||||
|
<version>1.0.3</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.aliyun</groupId>
|
||||||
|
<artifactId>tea-openapi</artifactId>
|
||||||
|
<version>0.2.5</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.squareup.okhttp3</groupId>
|
||||||
|
<artifactId>okhttp</artifactId>
|
||||||
|
<version>4.12.0</version>
|
||||||
|
</dependency>
|
||||||
|
<!-- 可选:用来做内存缓存 access_token -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.ben-manes.caffeine</groupId>
|
||||||
|
<artifactId>caffeine</artifactId>
|
||||||
|
<version>3.1.8</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.aliyun</groupId>
|
||||||
|
<artifactId>bailian20231229</artifactId>
|
||||||
|
<version>2.4.0</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.freewayso</groupId>
|
||||||
|
<artifactId>image-combiner</artifactId>
|
||||||
|
<version>2.6.9</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-websocket</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<resources>
|
||||||
|
<resource>
|
||||||
|
<directory>src/main/java</directory>
|
||||||
|
<includes>
|
||||||
|
<include>**/*Mapper.xml</include>
|
||||||
|
</includes>
|
||||||
|
</resource>
|
||||||
|
<resource>
|
||||||
|
<directory>src/main/resources</directory>
|
||||||
|
<includes>
|
||||||
|
<include>**</include>
|
||||||
|
</includes>
|
||||||
|
</resource>
|
||||||
|
</resources>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<excludes>
|
||||||
|
<exclude>
|
||||||
|
<groupId>org.project-lombok</groupId>
|
||||||
|
<artifactId>lombok</artifactId>
|
||||||
|
</exclude>
|
||||||
|
</excludes>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<source>17</source>
|
||||||
|
<target>17</target>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
|
||||||
|
<repositories>
|
||||||
|
<repository>
|
||||||
|
<id>aliYunMaven</id>
|
||||||
|
<url>https://maven.aliyun.com/repository/public</url>
|
||||||
|
</repository>
|
||||||
|
</repositories>
|
||||||
|
|
||||||
|
</project>
|
||||||
31
src/main/java/com/gxwebsoft/WebSoftApplication.java
Normal file
31
src/main/java/com/gxwebsoft/WebSoftApplication.java
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
package com.gxwebsoft;
|
||||||
|
|
||||||
|
import com.gxwebsoft.common.core.config.ConfigProperties;
|
||||||
|
import com.gxwebsoft.common.core.config.MqttProperties;
|
||||||
|
import org.mybatis.spring.annotation.MapperScan;
|
||||||
|
import org.springframework.boot.SpringApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||||
|
import org.springframework.scheduling.annotation.EnableAsync;
|
||||||
|
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||||
|
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||||
|
import org.springframework.web.socket.config.annotation.EnableWebSocket;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 启动类
|
||||||
|
* Created by WebSoft on 2018-02-22 11:29:03
|
||||||
|
*/
|
||||||
|
@EnableAsync
|
||||||
|
@EnableTransactionManagement
|
||||||
|
@MapperScan("com.gxwebsoft.**.mapper")
|
||||||
|
@EnableConfigurationProperties({ConfigProperties.class, MqttProperties.class})
|
||||||
|
@SpringBootApplication
|
||||||
|
@EnableScheduling
|
||||||
|
@EnableWebSocket
|
||||||
|
public class WebSoftApplication {
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
SpringApplication.run(WebSoftApplication.class, args);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,104 @@
|
|||||||
|
package com.gxwebsoft.auto.controller;
|
||||||
|
|
||||||
|
import com.gxwebsoft.auto.dto.QrLoginConfirmRequest;
|
||||||
|
import com.gxwebsoft.auto.dto.QrLoginGenerateResponse;
|
||||||
|
import com.gxwebsoft.auto.dto.QrLoginStatusResponse;
|
||||||
|
import com.gxwebsoft.auto.service.QrLoginService;
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.validation.Valid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 认证模块
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2025-03-06 22:50:25
|
||||||
|
*/
|
||||||
|
@Tag(name = "认证模块")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/qr-login")
|
||||||
|
public class QrLoginController extends BaseController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private QrLoginService qrLoginService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生成扫码登录token
|
||||||
|
*/
|
||||||
|
@Operation(summary = "生成扫码登录token")
|
||||||
|
@PostMapping("/generate")
|
||||||
|
public ApiResult<?> generateQrLoginToken() {
|
||||||
|
try {
|
||||||
|
QrLoginGenerateResponse response = qrLoginService.generateQrLoginToken();
|
||||||
|
return success("生成成功", response);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return fail(e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检查扫码登录状态
|
||||||
|
*/
|
||||||
|
@Operation(summary = "检查扫码登录状态")
|
||||||
|
@GetMapping("/status/{token}")
|
||||||
|
public ApiResult<?> checkQrLoginStatus(
|
||||||
|
@Parameter(description = "扫码登录token") @PathVariable String token) {
|
||||||
|
try {
|
||||||
|
QrLoginStatusResponse response = qrLoginService.checkQrLoginStatus(token);
|
||||||
|
return success("查询成功", response);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return fail(e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 确认扫码登录
|
||||||
|
*/
|
||||||
|
@Operation(summary = "确认扫码登录")
|
||||||
|
@PostMapping("/confirm")
|
||||||
|
public ApiResult<?> confirmQrLogin(@Valid @RequestBody QrLoginConfirmRequest request) {
|
||||||
|
try {
|
||||||
|
QrLoginStatusResponse response = qrLoginService.confirmQrLogin(request);
|
||||||
|
return success("确认成功", response);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return fail(e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 扫码操作(可选接口,用于移动端扫码后更新状态)
|
||||||
|
*/
|
||||||
|
@Operation(summary = "扫码操作")
|
||||||
|
@PostMapping("/scan/{token}")
|
||||||
|
public ApiResult<?> scanQrCode(@Parameter(description = "扫码登录token") @PathVariable String token) {
|
||||||
|
try {
|
||||||
|
boolean result = qrLoginService.scanQrCode(token);
|
||||||
|
return success("操作成功", result);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return fail(e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 微信小程序扫码登录确认(便捷接口)
|
||||||
|
*/
|
||||||
|
@Operation(summary = "微信小程序扫码登录确认")
|
||||||
|
@PostMapping("/wechat-confirm")
|
||||||
|
public ApiResult<?> wechatMiniProgramConfirm(@Valid @RequestBody QrLoginConfirmRequest request) {
|
||||||
|
try {
|
||||||
|
// 设置平台为微信小程序
|
||||||
|
request.setPlatform("miniprogram");
|
||||||
|
QrLoginStatusResponse response = qrLoginService.confirmQrLogin(request);
|
||||||
|
return success("微信小程序登录确认成功", response);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return fail(e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,50 @@
|
|||||||
|
package com.gxwebsoft.auto.dto;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 扫码登录确认请求
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2025-08-31
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Schema(description = "扫码登录确认请求")
|
||||||
|
public class QrLoginConfirmRequest {
|
||||||
|
|
||||||
|
@Schema(description = "扫码登录token")
|
||||||
|
@NotBlank(message = "token不能为空")
|
||||||
|
private String token;
|
||||||
|
|
||||||
|
@Schema(description = "用户ID")
|
||||||
|
private Integer userId;
|
||||||
|
|
||||||
|
@Schema(description = "登录平台: web-网页端, app-移动应用, miniprogram-微信小程序")
|
||||||
|
private String platform;
|
||||||
|
|
||||||
|
@Schema(description = "微信小程序相关信息")
|
||||||
|
private WechatMiniProgramInfo wechatInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 微信小程序信息
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Schema(description = "微信小程序信息")
|
||||||
|
public static class WechatMiniProgramInfo {
|
||||||
|
@Schema(description = "微信openid")
|
||||||
|
private String openid;
|
||||||
|
|
||||||
|
@Schema(description = "微信unionid")
|
||||||
|
private String unionid;
|
||||||
|
|
||||||
|
@Schema(description = "微信昵称")
|
||||||
|
private String nickname;
|
||||||
|
|
||||||
|
@Schema(description = "微信头像")
|
||||||
|
private String avatar;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
55
src/main/java/com/gxwebsoft/auto/dto/QrLoginData.java
Normal file
55
src/main/java/com/gxwebsoft/auto/dto/QrLoginData.java
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
package com.gxwebsoft.auto.dto;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 扫码登录数据模型
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2025-08-31
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class QrLoginData {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 扫码登录token
|
||||||
|
*/
|
||||||
|
private String token;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态: pending-等待扫码, scanned-已扫码, confirmed-已确认, expired-已过期
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户ID(扫码确认后设置)
|
||||||
|
*/
|
||||||
|
private Integer userId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户名(扫码确认后设置)
|
||||||
|
*/
|
||||||
|
private String username;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 过期时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime expireTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* JWT访问令牌(确认后生成)
|
||||||
|
*/
|
||||||
|
private String accessToken;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package com.gxwebsoft.auto.dto;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 扫码登录生成响应
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2025-08-31
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Schema(description = "扫码登录生成响应")
|
||||||
|
public class QrLoginGenerateResponse {
|
||||||
|
|
||||||
|
@Schema(description = "扫码登录token")
|
||||||
|
private String token;
|
||||||
|
|
||||||
|
@Schema(description = "二维码内容")
|
||||||
|
private String qrCode;
|
||||||
|
|
||||||
|
@Schema(description = "过期时间(秒)")
|
||||||
|
private Long expiresIn;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
package com.gxwebsoft.auto.dto;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 扫码登录状态响应
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2025-08-31
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Schema(description = "扫码登录状态响应")
|
||||||
|
public class QrLoginStatusResponse {
|
||||||
|
|
||||||
|
@Schema(description = "状态: pending-等待扫码, scanned-已扫码, confirmed-已确认, expired-已过期")
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
@Schema(description = "JWT访问令牌(仅在confirmed状态时返回)")
|
||||||
|
private String accessToken;
|
||||||
|
|
||||||
|
@Schema(description = "用户信息(仅在confirmed状态时返回)")
|
||||||
|
private Object userInfo;
|
||||||
|
|
||||||
|
@Schema(description = "剩余过期时间(秒)")
|
||||||
|
private Long expiresIn;
|
||||||
|
|
||||||
|
}
|
||||||
46
src/main/java/com/gxwebsoft/auto/service/QrLoginService.java
Normal file
46
src/main/java/com/gxwebsoft/auto/service/QrLoginService.java
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
package com.gxwebsoft.auto.service;
|
||||||
|
|
||||||
|
import com.gxwebsoft.auto.dto.QrLoginConfirmRequest;
|
||||||
|
import com.gxwebsoft.auto.dto.QrLoginGenerateResponse;
|
||||||
|
import com.gxwebsoft.auto.dto.QrLoginStatusResponse;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 扫码登录服务接口
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2025-08-31
|
||||||
|
*/
|
||||||
|
public interface QrLoginService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生成扫码登录token
|
||||||
|
*
|
||||||
|
* @return QrLoginGenerateResponse
|
||||||
|
*/
|
||||||
|
QrLoginGenerateResponse generateQrLoginToken();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检查扫码登录状态
|
||||||
|
*
|
||||||
|
* @param token 扫码登录token
|
||||||
|
* @return QrLoginStatusResponse
|
||||||
|
*/
|
||||||
|
QrLoginStatusResponse checkQrLoginStatus(String token);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 确认扫码登录
|
||||||
|
*
|
||||||
|
* @param request 确认请求
|
||||||
|
* @return QrLoginStatusResponse
|
||||||
|
*/
|
||||||
|
QrLoginStatusResponse confirmQrLogin(QrLoginConfirmRequest request);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 扫码操作(更新状态为已扫码)
|
||||||
|
*
|
||||||
|
* @param token 扫码登录token
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
boolean scanQrCode(String token);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,239 @@
|
|||||||
|
package com.gxwebsoft.auto.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.lang.UUID;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.gxwebsoft.auto.dto.*;
|
||||||
|
import com.gxwebsoft.auto.service.QrLoginService;
|
||||||
|
import com.gxwebsoft.common.core.security.JwtSubject;
|
||||||
|
import com.gxwebsoft.common.core.security.JwtUtil;
|
||||||
|
import com.gxwebsoft.common.core.utils.JSONUtil;
|
||||||
|
import com.gxwebsoft.common.core.utils.RedisUtil;
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import com.gxwebsoft.common.system.service.UserService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.temporal.ChronoUnit;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
import static com.gxwebsoft.common.core.constants.RedisConstants.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 扫码登录服务实现
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2025-08-31
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
public class QrLoginServiceImpl implements QrLoginService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private RedisUtil redisUtil;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private UserService userService;
|
||||||
|
|
||||||
|
@Value("${config.jwt.secret:websoft-jwt-secret-key-2025}")
|
||||||
|
private String jwtSecret;
|
||||||
|
|
||||||
|
@Value("${config.jwt.expire:86400}")
|
||||||
|
private Long jwtExpire;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public QrLoginGenerateResponse generateQrLoginToken() {
|
||||||
|
// 生成唯一的扫码登录token
|
||||||
|
String token = UUID.randomUUID().toString(true);
|
||||||
|
|
||||||
|
// 创建扫码登录数据
|
||||||
|
QrLoginData qrLoginData = new QrLoginData();
|
||||||
|
qrLoginData.setToken(token);
|
||||||
|
qrLoginData.setStatus(QR_LOGIN_STATUS_PENDING);
|
||||||
|
qrLoginData.setCreateTime(LocalDateTime.now());
|
||||||
|
qrLoginData.setExpireTime(LocalDateTime.now().plusSeconds(QR_LOGIN_TOKEN_TTL));
|
||||||
|
|
||||||
|
// 存储到Redis,设置过期时间
|
||||||
|
String redisKey = QR_LOGIN_TOKEN_KEY + token;
|
||||||
|
redisUtil.set(redisKey, qrLoginData, QR_LOGIN_TOKEN_TTL, TimeUnit.SECONDS);
|
||||||
|
|
||||||
|
log.info("生成扫码登录token: {}", token);
|
||||||
|
|
||||||
|
// 构造二维码内容(这里可以是前端登录页面的URL + token参数)
|
||||||
|
String qrCodeContent = "qr-login:" + token;
|
||||||
|
|
||||||
|
return new QrLoginGenerateResponse(token, qrCodeContent, QR_LOGIN_TOKEN_TTL);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public QrLoginStatusResponse checkQrLoginStatus(String token) {
|
||||||
|
if (StrUtil.isBlank(token)) {
|
||||||
|
return new QrLoginStatusResponse(QR_LOGIN_STATUS_EXPIRED, null, null, 0L);
|
||||||
|
}
|
||||||
|
|
||||||
|
String redisKey = QR_LOGIN_TOKEN_KEY + token;
|
||||||
|
QrLoginData qrLoginData = redisUtil.get(redisKey, QrLoginData.class);
|
||||||
|
|
||||||
|
if (qrLoginData == null) {
|
||||||
|
return new QrLoginStatusResponse(QR_LOGIN_STATUS_EXPIRED, null, null, 0L);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 检查是否过期
|
||||||
|
if (LocalDateTime.now().isAfter(qrLoginData.getExpireTime())) {
|
||||||
|
// 删除过期的token
|
||||||
|
redisUtil.delete(redisKey);
|
||||||
|
return new QrLoginStatusResponse(QR_LOGIN_STATUS_EXPIRED, null, null, 0L);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 计算剩余过期时间
|
||||||
|
long expiresIn = ChronoUnit.SECONDS.between(LocalDateTime.now(), qrLoginData.getExpireTime());
|
||||||
|
|
||||||
|
QrLoginStatusResponse response = new QrLoginStatusResponse();
|
||||||
|
response.setStatus(qrLoginData.getStatus());
|
||||||
|
response.setExpiresIn(expiresIn);
|
||||||
|
|
||||||
|
// 如果已确认,返回token和用户信息
|
||||||
|
if (QR_LOGIN_STATUS_CONFIRMED.equals(qrLoginData.getStatus())) {
|
||||||
|
response.setAccessToken(qrLoginData.getAccessToken());
|
||||||
|
|
||||||
|
// 获取用户信息
|
||||||
|
if (qrLoginData.getUserId() != null) {
|
||||||
|
User user = userService.getByIdRel(qrLoginData.getUserId());
|
||||||
|
if (user != null) {
|
||||||
|
// 清除敏感信息
|
||||||
|
user.setPassword(null);
|
||||||
|
response.setUserInfo(user);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 确认后删除token,防止重复使用
|
||||||
|
redisUtil.delete(redisKey);
|
||||||
|
}
|
||||||
|
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public QrLoginStatusResponse confirmQrLogin(QrLoginConfirmRequest request) {
|
||||||
|
String token = request.getToken();
|
||||||
|
Integer userId = request.getUserId();
|
||||||
|
String platform = request.getPlatform();
|
||||||
|
|
||||||
|
if (StrUtil.isBlank(token) || userId == null) {
|
||||||
|
throw new RuntimeException("参数不能为空");
|
||||||
|
}
|
||||||
|
|
||||||
|
String redisKey = QR_LOGIN_TOKEN_KEY + token;
|
||||||
|
QrLoginData qrLoginData = redisUtil.get(redisKey, QrLoginData.class);
|
||||||
|
|
||||||
|
if (qrLoginData == null) {
|
||||||
|
throw new RuntimeException("扫码登录token不存在或已过期");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 检查是否过期
|
||||||
|
if (LocalDateTime.now().isAfter(qrLoginData.getExpireTime())) {
|
||||||
|
redisUtil.delete(redisKey);
|
||||||
|
throw new RuntimeException("扫码登录token已过期");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取用户信息
|
||||||
|
User user = userService.getByIdRel(userId);
|
||||||
|
if (user == null) {
|
||||||
|
throw new RuntimeException("用户不存在");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 检查用户状态
|
||||||
|
if (user.getStatus() != null && user.getStatus() != 0) {
|
||||||
|
throw new RuntimeException("用户已被冻结");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 如果是微信小程序登录,处理微信相关信息
|
||||||
|
if ("miniprogram".equals(platform) && request.getWechatInfo() != null) {
|
||||||
|
handleWechatMiniProgramLogin(user, request.getWechatInfo());
|
||||||
|
}
|
||||||
|
|
||||||
|
// 生成JWT token
|
||||||
|
JwtSubject jwtSubject = new JwtSubject(user.getUsername(), user.getTenantId());
|
||||||
|
String accessToken = JwtUtil.buildToken(jwtSubject, jwtExpire, jwtSecret);
|
||||||
|
|
||||||
|
// 更新扫码登录数据
|
||||||
|
qrLoginData.setStatus(QR_LOGIN_STATUS_CONFIRMED);
|
||||||
|
qrLoginData.setUserId(userId);
|
||||||
|
qrLoginData.setUsername(user.getUsername());
|
||||||
|
qrLoginData.setAccessToken(accessToken);
|
||||||
|
|
||||||
|
// 更新Redis中的数据
|
||||||
|
redisUtil.set(redisKey, qrLoginData, 60L, TimeUnit.SECONDS); // 给前端60秒时间获取token
|
||||||
|
|
||||||
|
log.info("用户 {} 通过 {} 平台确认扫码登录,token: {}", user.getUsername(),
|
||||||
|
platform != null ? platform : "unknown", token);
|
||||||
|
|
||||||
|
// 清除敏感信息
|
||||||
|
user.setPassword(null);
|
||||||
|
|
||||||
|
return new QrLoginStatusResponse(QR_LOGIN_STATUS_CONFIRMED, accessToken, user, 60L);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处理微信小程序登录相关逻辑
|
||||||
|
*/
|
||||||
|
private void handleWechatMiniProgramLogin(User user, QrLoginConfirmRequest.WechatMiniProgramInfo wechatInfo) {
|
||||||
|
// 更新用户的微信信息
|
||||||
|
if (StrUtil.isNotBlank(wechatInfo.getOpenid())) {
|
||||||
|
user.setOpenid(wechatInfo.getOpenid());
|
||||||
|
}
|
||||||
|
if (StrUtil.isNotBlank(wechatInfo.getUnionid())) {
|
||||||
|
user.setUnionid(wechatInfo.getUnionid());
|
||||||
|
}
|
||||||
|
if (StrUtil.isNotBlank(wechatInfo.getNickname()) && StrUtil.isBlank(user.getNickname())) {
|
||||||
|
user.setNickname(wechatInfo.getNickname());
|
||||||
|
}
|
||||||
|
if (StrUtil.isNotBlank(wechatInfo.getAvatar()) && StrUtil.isBlank(user.getAvatar())) {
|
||||||
|
user.setAvatar(wechatInfo.getAvatar());
|
||||||
|
}
|
||||||
|
|
||||||
|
// 更新用户信息到数据库
|
||||||
|
try {
|
||||||
|
userService.updateById(user);
|
||||||
|
log.info("更新用户 {} 的微信小程序信息成功", user.getUsername());
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.warn("更新用户 {} 的微信小程序信息失败: {}", user.getUsername(), e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean scanQrCode(String token) {
|
||||||
|
if (StrUtil.isBlank(token)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
String redisKey = QR_LOGIN_TOKEN_KEY + token;
|
||||||
|
QrLoginData qrLoginData = redisUtil.get(redisKey, QrLoginData.class);
|
||||||
|
|
||||||
|
if (qrLoginData == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 检查是否过期
|
||||||
|
if (LocalDateTime.now().isAfter(qrLoginData.getExpireTime())) {
|
||||||
|
redisUtil.delete(redisKey);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 只有pending状态才能更新为scanned
|
||||||
|
if (QR_LOGIN_STATUS_PENDING.equals(qrLoginData.getStatus())) {
|
||||||
|
qrLoginData.setStatus(QR_LOGIN_STATUS_SCANNED);
|
||||||
|
|
||||||
|
// 计算剩余过期时间
|
||||||
|
long remainingSeconds = ChronoUnit.SECONDS.between(LocalDateTime.now(), qrLoginData.getExpireTime());
|
||||||
|
redisUtil.set(redisKey, qrLoginData, remainingSeconds, TimeUnit.SECONDS);
|
||||||
|
|
||||||
|
log.info("扫码登录token {} 状态更新为已扫码", token);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
119
src/main/java/com/gxwebsoft/cms/controller/CmsAdController.java
Normal file
119
src/main/java/com/gxwebsoft/cms/controller/CmsAdController.java
Normal file
@@ -0,0 +1,119 @@
|
|||||||
|
package com.gxwebsoft.cms.controller;
|
||||||
|
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.cms.service.CmsAdService;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsAd;
|
||||||
|
import com.gxwebsoft.cms.param.CmsAdParam;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 广告位控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-10 20:47:57
|
||||||
|
*/
|
||||||
|
@Tag(name = "广告位管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/cms/cms-ad")
|
||||||
|
public class CmsAdController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private CmsAdService cmsAdService;
|
||||||
|
|
||||||
|
@Operation(summary = "分页查询广告位")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<CmsAd>> page(CmsAdParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsAdService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "查询全部广告位")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<CmsAd>> list(CmsAdParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsAdService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "根据id查询广告位")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<CmsAd> get(@PathVariable("id") Integer id) {
|
||||||
|
// 使用关联查询
|
||||||
|
final CmsAd ad = cmsAdService.getByIdRel(id);
|
||||||
|
return success(ad);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "根据code查询广告位")
|
||||||
|
@GetMapping("/getByCode/{code}")
|
||||||
|
public ApiResult<CmsAd> getByCode(@PathVariable("code") String code) {
|
||||||
|
final CmsAd ad = cmsAdService.getByIdCode(code);
|
||||||
|
return success(ad);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "添加广告位")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody CmsAd cmsAd) {
|
||||||
|
// 记录当前登录用户id
|
||||||
|
User loginUser = getLoginUser();
|
||||||
|
if (loginUser != null) {
|
||||||
|
cmsAd.setUserId(loginUser.getUserId());
|
||||||
|
}
|
||||||
|
if (cmsAdService.save(cmsAd)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "修改广告位")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody CmsAd cmsAd) {
|
||||||
|
if (cmsAdService.updateById(cmsAd)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "删除广告位")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (cmsAdService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "批量添加广告位")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<CmsAd> list) {
|
||||||
|
if (cmsAdService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "批量修改广告位")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsAd> batchParam) {
|
||||||
|
if (batchParam.update(cmsAdService, "ad_id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "批量删除广告位")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (cmsAdService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,114 @@
|
|||||||
|
package com.gxwebsoft.cms.controller;
|
||||||
|
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.cms.service.CmsAdRecordService;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsAdRecord;
|
||||||
|
import com.gxwebsoft.cms.param.CmsAdRecordParam;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageParam;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 广告图片控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-10 20:47:57
|
||||||
|
*/
|
||||||
|
@Tag(name = "广告图片管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/cms/cms-ad-record")
|
||||||
|
public class CmsAdRecordController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private CmsAdRecordService cmsAdRecordService;
|
||||||
|
|
||||||
|
@Operation(summary = "分页查询广告图片")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<CmsAdRecord>> page(CmsAdRecordParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsAdRecordService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "查询全部广告图片")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<CmsAdRecord>> list(CmsAdRecordParam param) {
|
||||||
|
PageParam<CmsAdRecord, CmsAdRecordParam> page = new PageParam<>(param);
|
||||||
|
page.setDefaultOrder("create_time desc");
|
||||||
|
return success(cmsAdRecordService.list(page.getOrderWrapper()));
|
||||||
|
// 使用关联查询
|
||||||
|
//return success(cmsAdRecordService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsAdRecord:list')")
|
||||||
|
@OperationLog
|
||||||
|
@Operation(summary = "根据id查询广告图片")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<CmsAdRecord> get(@PathVariable("id") Integer id) {
|
||||||
|
return success(cmsAdRecordService.getById(id));
|
||||||
|
// 使用关联查询
|
||||||
|
//return success(cmsAdRecordService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "添加广告图片")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody CmsAdRecord cmsAdRecord) {
|
||||||
|
if (cmsAdRecordService.save(cmsAdRecord)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "修改广告图片")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody CmsAdRecord cmsAdRecord) {
|
||||||
|
if (cmsAdRecordService.updateById(cmsAdRecord)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "删除广告图片")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (cmsAdRecordService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "批量添加广告图片")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<CmsAdRecord> list) {
|
||||||
|
if (cmsAdRecordService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "批量修改广告图片")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsAdRecord> batchParam) {
|
||||||
|
if (batchParam.update(cmsAdRecordService, "ad_record_id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "批量删除广告图片")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (cmsAdRecordService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,111 @@
|
|||||||
|
package com.gxwebsoft.cms.controller;
|
||||||
|
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.cms.service.CmsArticleCategoryService;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsArticleCategory;
|
||||||
|
import com.gxwebsoft.cms.param.CmsArticleCategoryParam;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文章分类表控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-10 20:47:57
|
||||||
|
*/
|
||||||
|
@Tag(name = "文章分类表管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/cms/cms-article-category")
|
||||||
|
public class CmsArticleCategoryController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private CmsArticleCategoryService cmsArticleCategoryService;
|
||||||
|
|
||||||
|
@Operation(summary = "分页查询文章分类表")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<CmsArticleCategory>> page(CmsArticleCategoryParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsArticleCategoryService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "查询全部文章分类表")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<CmsArticleCategory>> list(CmsArticleCategoryParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsArticleCategoryService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "根据id查询文章分类表")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<CmsArticleCategory> get(@PathVariable("id") Integer id) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsArticleCategoryService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "添加文章分类表")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody CmsArticleCategory cmsArticleCategory) {
|
||||||
|
// 记录当前登录用户id
|
||||||
|
User loginUser = getLoginUser();
|
||||||
|
if (loginUser != null) {
|
||||||
|
cmsArticleCategory.setUserId(loginUser.getUserId());
|
||||||
|
}
|
||||||
|
if (cmsArticleCategoryService.save(cmsArticleCategory)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "修改文章分类表")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody CmsArticleCategory cmsArticleCategory) {
|
||||||
|
if (cmsArticleCategoryService.updateById(cmsArticleCategory)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "删除文章分类表")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (cmsArticleCategoryService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "批量添加文章分类表")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<CmsArticleCategory> list) {
|
||||||
|
if (cmsArticleCategoryService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "批量修改文章分类表")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsArticleCategory> batchParam) {
|
||||||
|
if (batchParam.update(cmsArticleCategoryService, "category_id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "批量删除文章分类表")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (cmsArticleCategoryService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,120 @@
|
|||||||
|
package com.gxwebsoft.cms.controller;
|
||||||
|
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.cms.service.CmsArticleCommentService;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsArticleComment;
|
||||||
|
import com.gxwebsoft.cms.param.CmsArticleCommentParam;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageParam;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文章评论表控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-10 20:47:57
|
||||||
|
*/
|
||||||
|
@Tag(name = "文章评论表管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/cms/cms-article-comment")
|
||||||
|
public class CmsArticleCommentController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private CmsArticleCommentService cmsArticleCommentService;
|
||||||
|
|
||||||
|
@Operation(summary = "分页查询文章评论表")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<CmsArticleComment>> page(CmsArticleCommentParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsArticleCommentService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "查询全部文章评论表")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<CmsArticleComment>> list(CmsArticleCommentParam param) {
|
||||||
|
PageParam<CmsArticleComment, CmsArticleCommentParam> page = new PageParam<>(param);
|
||||||
|
page.setDefaultOrder("create_time desc");
|
||||||
|
return success(cmsArticleCommentService.list(page.getOrderWrapper()));
|
||||||
|
// 使用关联查询
|
||||||
|
//return success(cmsArticleCommentService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsArticleComment:list')")
|
||||||
|
@OperationLog
|
||||||
|
@Operation(summary = "根据id查询文章评论表")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<CmsArticleComment> get(@PathVariable("id") Integer id) {
|
||||||
|
return success(cmsArticleCommentService.getById(id));
|
||||||
|
// 使用关联查询
|
||||||
|
//return success(cmsArticleCommentService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "添加文章评论表")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody CmsArticleComment cmsArticleComment) {
|
||||||
|
// 记录当前登录用户id
|
||||||
|
User loginUser = getLoginUser();
|
||||||
|
if (loginUser != null) {
|
||||||
|
cmsArticleComment.setUserId(loginUser.getUserId());
|
||||||
|
}
|
||||||
|
if (cmsArticleCommentService.save(cmsArticleComment)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "修改文章评论表")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody CmsArticleComment cmsArticleComment) {
|
||||||
|
if (cmsArticleCommentService.updateById(cmsArticleComment)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "删除文章评论表")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (cmsArticleCommentService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "批量添加文章评论表")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<CmsArticleComment> list) {
|
||||||
|
if (cmsArticleCommentService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "批量修改文章评论表")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsArticleComment> batchParam) {
|
||||||
|
if (batchParam.update(cmsArticleCommentService, "comment_id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "批量删除文章评论表")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (cmsArticleCommentService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,113 @@
|
|||||||
|
package com.gxwebsoft.cms.controller;
|
||||||
|
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.cms.service.CmsArticleContentService;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsArticleContent;
|
||||||
|
import com.gxwebsoft.cms.param.CmsArticleContentParam;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文章记录表控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-10 20:47:57
|
||||||
|
*/
|
||||||
|
@Tag(name = "文章记录表管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/cms/cms-article-content")
|
||||||
|
public class CmsArticleContentController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private CmsArticleContentService cmsArticleContentService;
|
||||||
|
|
||||||
|
@Operation(summary = "分页查询文章记录表")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<CmsArticleContent>> page(CmsArticleContentParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsArticleContentService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "查询全部文章记录表")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<CmsArticleContent>> list(CmsArticleContentParam param) {
|
||||||
|
// PageParam<CmsArticleContent, CmsArticleContentParam> page = new PageParam<>(param);
|
||||||
|
// page.setDefaultOrder("create_time desc");
|
||||||
|
// return success(cmsArticleContentService.list(page.getOrderWrapper()));
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsArticleContentService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsArticleContent:list')")
|
||||||
|
@OperationLog
|
||||||
|
@Operation(summary = "根据id查询文章记录表")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<CmsArticleContent> get(@PathVariable("id") Integer id) {
|
||||||
|
// return success(cmsArticleContentService.getById(id));
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsArticleContentService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "添加文章记录表")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody CmsArticleContent cmsArticleContent) {
|
||||||
|
if (cmsArticleContentService.save(cmsArticleContent)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "修改文章记录表")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody CmsArticleContent cmsArticleContent) {
|
||||||
|
if (cmsArticleContentService.updateById(cmsArticleContent)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "删除文章记录表")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (cmsArticleContentService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "批量添加文章记录表")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<CmsArticleContent> list) {
|
||||||
|
if (cmsArticleContentService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "批量修改文章记录表")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsArticleContent> batchParam) {
|
||||||
|
if (batchParam.update(cmsArticleContentService, "id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "批量删除文章记录表")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (cmsArticleContentService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,379 @@
|
|||||||
|
package com.gxwebsoft.cms.controller;
|
||||||
|
|
||||||
|
import cn.afterturn.easypoi.excel.ExcelImportUtil;
|
||||||
|
import cn.afterturn.easypoi.excel.entity.ImportParams;
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||||
|
import com.gxwebsoft.cms.entity.*;
|
||||||
|
import com.gxwebsoft.cms.param.CmsArticleImportParam;
|
||||||
|
import com.gxwebsoft.cms.service.*;
|
||||||
|
import com.gxwebsoft.common.core.utils.JSONUtil;
|
||||||
|
import com.gxwebsoft.common.core.utils.RedisUtil;
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.cms.param.CmsArticleParam;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import com.gxwebsoft.common.system.service.UserService;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import org.springframework.context.annotation.Lazy;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.validation.Valid;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import static com.gxwebsoft.common.core.constants.ArticleConstants.CACHE_KEY_ARTICLE;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文章控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-10 20:47:57
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Validated
|
||||||
|
@Tag(name = "文章管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/cms/cms-article")
|
||||||
|
public class CmsArticleController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private CmsArticleService cmsArticleService;
|
||||||
|
@Resource
|
||||||
|
private CmsArticleContentService articleContentService;
|
||||||
|
@Resource
|
||||||
|
@Lazy
|
||||||
|
private CmsNavigationService cmsNavigationService;
|
||||||
|
@Resource
|
||||||
|
private CmsModelService cmsModelService;
|
||||||
|
@Resource
|
||||||
|
private UserService userService;
|
||||||
|
@Resource
|
||||||
|
private RedisUtil redisUtil;
|
||||||
|
|
||||||
|
private static final long CACHE_MINUTES = 30L;
|
||||||
|
|
||||||
|
@Operation(summary = "分页查询文章")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<CmsArticle>> page(CmsArticleParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsArticleService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "查询全部文章")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<CmsArticle>> list(CmsArticleParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsArticleService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "根据id查询文章")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<CmsArticle> get(@PathVariable("id") @NotNull Integer id) {
|
||||||
|
final CmsArticle article = cmsArticleService.getByIdRel(id);
|
||||||
|
if (ObjectUtil.isNotEmpty(article)) {
|
||||||
|
final CmsArticleContent item = articleContentService.getByIdRel(article.getArticleId());
|
||||||
|
if (ObjectUtil.isNotEmpty(item)) {
|
||||||
|
article.setContent(item.getContent());
|
||||||
|
}
|
||||||
|
return success(article);
|
||||||
|
}
|
||||||
|
return fail("文章ID不存在",null);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "根据code查询文章")
|
||||||
|
@GetMapping("/getByCode/{code}")
|
||||||
|
public ApiResult<CmsArticle> getByCode(@PathVariable("code") String code) {
|
||||||
|
final CmsArticle article = cmsArticleService.getByIdCode(code);
|
||||||
|
if (ObjectUtil.isNotEmpty(article)) {
|
||||||
|
final CmsArticleContent item = articleContentService.getByIdRel(article.getArticleId());
|
||||||
|
if (ObjectUtil.isNotEmpty(item)) {
|
||||||
|
article.setContent(item.getContent());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return success(article);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsArticle:save')")
|
||||||
|
@Operation(summary = "添加文章")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody @Valid CmsArticle article) {
|
||||||
|
// 记录当前登录用户id
|
||||||
|
User loginUser = getLoginUser();
|
||||||
|
if (loginUser != null) {
|
||||||
|
article.setUserId(loginUser.getUserId());
|
||||||
|
article.setAuthor(loginUser.getNickname());
|
||||||
|
article.setMerchantId(loginUser.getMerchantId());
|
||||||
|
if (cmsArticleService.saveRel(article)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsArticle:update')")
|
||||||
|
@Operation(summary = "修改文章")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody CmsArticle article) {
|
||||||
|
if (cmsArticleService.updateByIdRel(article)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsArticle:remove')")
|
||||||
|
@Operation(summary = "删除文章")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (cmsArticleService.removeById(id)) {
|
||||||
|
redisUtil.delete(CACHE_KEY_ARTICLE + id);
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsArticle:save')")
|
||||||
|
@Operation(summary = "批量添加文章")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<CmsArticle> list) {
|
||||||
|
if (cmsArticleService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsArticle:update')")
|
||||||
|
@Operation(summary = "批量修改文章")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsArticle> batchParam) {
|
||||||
|
if (batchParam.update(cmsArticleService, "article_id")) {
|
||||||
|
// 删除缓存
|
||||||
|
final List<Serializable> ids = batchParam.getIds();
|
||||||
|
ids.forEach(id -> {
|
||||||
|
redisUtil.delete(CACHE_KEY_ARTICLE + id);
|
||||||
|
});
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsArticle:remove')")
|
||||||
|
@Operation(summary = "批量删除文章")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (cmsArticleService.removeByIds(ids)) {
|
||||||
|
// 删除缓存
|
||||||
|
ids.forEach(id -> {
|
||||||
|
redisUtil.delete(CACHE_KEY_ARTICLE + id);
|
||||||
|
});
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "读取上一篇")
|
||||||
|
@GetMapping("/getPrevious/{id}")
|
||||||
|
public ApiResult<CmsArticle> getPrevious(@PathVariable("id") Integer id) {
|
||||||
|
final CmsArticle item = cmsArticleService.getById(id);
|
||||||
|
if (ObjectUtil.isEmpty(item)) {
|
||||||
|
return success("没有找到上一篇文章",null);
|
||||||
|
}
|
||||||
|
CmsArticle article;
|
||||||
|
// TODO 按排序号规则
|
||||||
|
LambdaQueryWrapper<CmsArticle> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
wrapper.lt(CmsArticle::getSortNumber, item.getSortNumber());
|
||||||
|
wrapper.eq(CmsArticle::getStatus, 0);
|
||||||
|
wrapper.eq(CmsArticle::getType, 0);
|
||||||
|
wrapper.eq(CmsArticle::getCategoryId, item.getCategoryId());
|
||||||
|
wrapper.orderByDesc(CmsArticle::getSortNumber);
|
||||||
|
wrapper.last("limit 1");
|
||||||
|
article = cmsArticleService.getOne(wrapper);
|
||||||
|
if (ObjectUtil.isNotEmpty(article)) {
|
||||||
|
return success(article);
|
||||||
|
}
|
||||||
|
// TODO 按ID排序
|
||||||
|
LambdaQueryWrapper<CmsArticle> wrapper2 = new LambdaQueryWrapper<>();
|
||||||
|
wrapper2.lt(CmsArticle::getArticleId, item.getArticleId());
|
||||||
|
wrapper2.eq(CmsArticle::getStatus, 0);
|
||||||
|
wrapper2.eq(CmsArticle::getCategoryId, item.getCategoryId());
|
||||||
|
wrapper2.last("limit 1");
|
||||||
|
wrapper2.orderByDesc(CmsArticle::getArticleId);
|
||||||
|
article = cmsArticleService.getOne(wrapper2);
|
||||||
|
return success(article);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "读取下一篇")
|
||||||
|
@GetMapping("/getNext/{id}")
|
||||||
|
public ApiResult<CmsArticle> getNext(@PathVariable("id") Integer id) {
|
||||||
|
CmsArticle item = cmsArticleService.getById(id);
|
||||||
|
if (ObjectUtil.isEmpty(item)) {
|
||||||
|
return success("没有找到下一篇文章",null);
|
||||||
|
}
|
||||||
|
CmsArticle article;
|
||||||
|
// TODO 按排序号规则
|
||||||
|
LambdaQueryWrapper<CmsArticle> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
wrapper.gt(CmsArticle::getSortNumber, item.getSortNumber());
|
||||||
|
wrapper.eq(CmsArticle::getStatus, 0);
|
||||||
|
wrapper.eq(CmsArticle::getType, 0);
|
||||||
|
wrapper.eq(CmsArticle::getCategoryId, item.getCategoryId());
|
||||||
|
wrapper.orderByAsc(CmsArticle::getSortNumber);
|
||||||
|
wrapper.last("limit 1");
|
||||||
|
article = cmsArticleService.getOne(wrapper);
|
||||||
|
if (ObjectUtil.isNotEmpty(article)) {
|
||||||
|
return success(article);
|
||||||
|
}
|
||||||
|
// TODO 按ID排序
|
||||||
|
LambdaQueryWrapper<CmsArticle> wrapper2 = new LambdaQueryWrapper<>();
|
||||||
|
wrapper2.gt(CmsArticle::getArticleId, item.getArticleId());
|
||||||
|
wrapper2.eq(CmsArticle::getStatus, 0);
|
||||||
|
wrapper2.eq(CmsArticle::getCategoryId, item.getCategoryId());
|
||||||
|
wrapper2.last("limit 1");
|
||||||
|
wrapper2.orderByAsc(CmsArticle::getArticleId);
|
||||||
|
article = cmsArticleService.getOne(wrapper2);
|
||||||
|
return success(article);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "统计信息")
|
||||||
|
@GetMapping("/data")
|
||||||
|
public ApiResult<Map<String, Integer>> data(CmsArticleParam param) {
|
||||||
|
Map<String, Integer> data = new HashMap<>();
|
||||||
|
final LambdaQueryWrapper<CmsArticle> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
|
||||||
|
if (param.getMerchantId() != null) {
|
||||||
|
wrapper.eq(CmsArticle::getMerchantId, param.getMerchantId());
|
||||||
|
}
|
||||||
|
|
||||||
|
long totalNum = cmsArticleService.count(
|
||||||
|
wrapper.eq(CmsArticle::getDeleted, 0).eq(CmsArticle::getStatus, 0)
|
||||||
|
);
|
||||||
|
data.put("totalNum", Math.toIntExact(totalNum));
|
||||||
|
|
||||||
|
long totalNum2 = cmsArticleService.count(
|
||||||
|
wrapper.eq(CmsArticle::getStatus, 1)
|
||||||
|
);
|
||||||
|
data.put("totalNum2", Math.toIntExact(totalNum2));
|
||||||
|
|
||||||
|
long totalNum3 = cmsArticleService.count(
|
||||||
|
wrapper.gt(CmsArticle::getStatus, 1)
|
||||||
|
);
|
||||||
|
data.put("totalNum3", Math.toIntExact(totalNum3));
|
||||||
|
|
||||||
|
return success(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "密码校验")
|
||||||
|
@GetMapping("/checkArticlePassword")
|
||||||
|
public ApiResult<?> checkArticlePassword(CmsArticle param) {
|
||||||
|
if (!userService.comparePassword(param.getPassword(), param.getPassword2())) {
|
||||||
|
return fail("密码不正确");
|
||||||
|
}
|
||||||
|
return success("密码正确");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* excel批量导入文章
|
||||||
|
*/
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsArticle:save')")
|
||||||
|
@Operation(summary = "批量导入文章")
|
||||||
|
@Transactional(rollbackFor = {Exception.class})
|
||||||
|
@PostMapping("/import")
|
||||||
|
public ApiResult<List<String>> importBatch(MultipartFile file) {
|
||||||
|
ImportParams importParams = new ImportParams();
|
||||||
|
try {
|
||||||
|
List<CmsArticleImportParam> list = ExcelImportUtil.importExcel(file.getInputStream(), CmsArticleImportParam.class, importParams);
|
||||||
|
list.forEach(d -> {
|
||||||
|
CmsArticle item = JSONUtil.parseObject(JSONUtil.toJSONString(d), CmsArticle.class);
|
||||||
|
assert item != null;
|
||||||
|
if (ObjectUtil.isNotEmpty(item)) {
|
||||||
|
if (item.getStatus() == null) {
|
||||||
|
item.setStatus(1);
|
||||||
|
}
|
||||||
|
if (cmsArticleService.save(item)) {
|
||||||
|
CmsArticleContent content = new CmsArticleContent();
|
||||||
|
content.setArticleId(item.getArticleId());
|
||||||
|
content.setContent(item.getContent());
|
||||||
|
articleContentService.save(content);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return success("成功导入" + list.size() + "条", null);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return fail("导入失败", null);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "按标签分页查询")
|
||||||
|
@GetMapping("/findTags")
|
||||||
|
public ApiResult<List<CmsArticle>> findTags(CmsArticleParam param) {
|
||||||
|
final String tags = param.getTags();
|
||||||
|
if (StringUtils.isNotBlank(tags)) {
|
||||||
|
final String[] split = tags.split(",");
|
||||||
|
final List<String> list = Arrays.asList(split);
|
||||||
|
LambdaQueryWrapper<CmsArticle> queryWrapper = new LambdaQueryWrapper();
|
||||||
|
if (StrUtil.isNotBlank(tags)) {
|
||||||
|
for (String s : list) {
|
||||||
|
queryWrapper.or().like(CmsArticle::getTags, s);
|
||||||
|
// queryWrapper.or().apply("LOCATE(" + "'" + s + "'," + "tags" + ") > 0");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (param.getCategoryId() != null) {
|
||||||
|
queryWrapper.eq(CmsArticle::getCategoryId, param.getCategoryId());
|
||||||
|
}
|
||||||
|
if (param.getDetail() != null) {
|
||||||
|
queryWrapper.eq(CmsArticle::getDetail, param.getDetail());
|
||||||
|
}
|
||||||
|
queryWrapper.last("limit 8");
|
||||||
|
List<CmsArticle> articles = cmsArticleService.list(queryWrapper);
|
||||||
|
return success(articles);
|
||||||
|
}
|
||||||
|
return success("", null);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "按标签分页查询")
|
||||||
|
@GetMapping("/pageTags")
|
||||||
|
public ApiResult<List<CmsArticle>> pageTags(CmsArticleParam param) {
|
||||||
|
final String tags = param.getTags();
|
||||||
|
if (StringUtils.isNotBlank(tags)) {
|
||||||
|
final String[] split = tags.split(",");
|
||||||
|
final List<String> list = Arrays.asList(split);
|
||||||
|
LambdaQueryWrapper<CmsArticle> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
for (String s : list) {
|
||||||
|
queryWrapper.or().like(CmsArticle::getTags, s);
|
||||||
|
}
|
||||||
|
queryWrapper.orderByDesc(CmsArticle::getCreateTime);
|
||||||
|
queryWrapper.last("limit 100");
|
||||||
|
List<CmsArticle> articles = cmsArticleService.list(queryWrapper);
|
||||||
|
if (!articles.isEmpty()) {
|
||||||
|
List<CmsNavigation> navigationList = cmsNavigationService.listByIds(articles.stream().map(CmsArticle::getCategoryId).toList());
|
||||||
|
for (CmsArticle article : articles) {
|
||||||
|
for (CmsNavigation navigation : navigationList) {
|
||||||
|
if (article.getCategoryId().equals(navigation.getNavigationId())) {
|
||||||
|
article.setCategoryName(navigation.getTitle());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return success(articles);
|
||||||
|
}
|
||||||
|
return success("", null);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "按IDS查询")
|
||||||
|
@GetMapping("/getByIds")
|
||||||
|
public ApiResult<List<CmsArticle>> getByIds(CmsArticleParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsArticleService.list(new LambdaQueryWrapper<CmsArticle>().in(CmsArticle::getArticleId, param.getArticleIds())));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,120 @@
|
|||||||
|
package com.gxwebsoft.cms.controller;
|
||||||
|
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.cms.service.CmsArticleCountService;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsArticleCount;
|
||||||
|
import com.gxwebsoft.cms.param.CmsArticleCountParam;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageParam;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 点赞文章控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-10 20:47:57
|
||||||
|
*/
|
||||||
|
@Tag(name = "点赞文章管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/cms/cms-article-count")
|
||||||
|
public class CmsArticleCountController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private CmsArticleCountService cmsArticleCountService;
|
||||||
|
|
||||||
|
@Operation(summary = "分页查询点赞文章")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<CmsArticleCount>> page(CmsArticleCountParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsArticleCountService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "查询全部点赞文章")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<CmsArticleCount>> list(CmsArticleCountParam param) {
|
||||||
|
PageParam<CmsArticleCount, CmsArticleCountParam> page = new PageParam<>(param);
|
||||||
|
page.setDefaultOrder("create_time desc");
|
||||||
|
return success(cmsArticleCountService.list(page.getOrderWrapper()));
|
||||||
|
// 使用关联查询
|
||||||
|
//return success(cmsArticleCountService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsArticleCount:list')")
|
||||||
|
@OperationLog
|
||||||
|
@Operation(summary = "根据id查询点赞文章")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<CmsArticleCount> get(@PathVariable("id") Integer id) {
|
||||||
|
return success(cmsArticleCountService.getById(id));
|
||||||
|
// 使用关联查询
|
||||||
|
//return success(cmsArticleCountService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "添加点赞文章")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody CmsArticleCount cmsArticleCount) {
|
||||||
|
// 记录当前登录用户id
|
||||||
|
User loginUser = getLoginUser();
|
||||||
|
if (loginUser != null) {
|
||||||
|
cmsArticleCount.setUserId(loginUser.getUserId());
|
||||||
|
}
|
||||||
|
if (cmsArticleCountService.save(cmsArticleCount)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "修改点赞文章")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody CmsArticleCount cmsArticleCount) {
|
||||||
|
if (cmsArticleCountService.updateById(cmsArticleCount)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "删除点赞文章")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (cmsArticleCountService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "批量添加点赞文章")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<CmsArticleCount> list) {
|
||||||
|
if (cmsArticleCountService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "批量修改点赞文章")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsArticleCount> batchParam) {
|
||||||
|
if (batchParam.update(cmsArticleCountService, "id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "批量删除点赞文章")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (cmsArticleCountService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,120 @@
|
|||||||
|
package com.gxwebsoft.cms.controller;
|
||||||
|
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.cms.service.CmsArticleLikeService;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsArticleLike;
|
||||||
|
import com.gxwebsoft.cms.param.CmsArticleLikeParam;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageParam;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 点赞文章控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-10 20:47:57
|
||||||
|
*/
|
||||||
|
@Tag(name = "点赞文章管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/cms/cms-article-like")
|
||||||
|
public class CmsArticleLikeController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private CmsArticleLikeService cmsArticleLikeService;
|
||||||
|
|
||||||
|
@Operation(summary = "分页查询点赞文章")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<CmsArticleLike>> page(CmsArticleLikeParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsArticleLikeService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "查询全部点赞文章")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<CmsArticleLike>> list(CmsArticleLikeParam param) {
|
||||||
|
PageParam<CmsArticleLike, CmsArticleLikeParam> page = new PageParam<>(param);
|
||||||
|
page.setDefaultOrder("create_time desc");
|
||||||
|
return success(cmsArticleLikeService.list(page.getOrderWrapper()));
|
||||||
|
// 使用关联查询
|
||||||
|
//return success(cmsArticleLikeService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsArticleLike:list')")
|
||||||
|
@OperationLog
|
||||||
|
@Operation(summary = "根据id查询点赞文章")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<CmsArticleLike> get(@PathVariable("id") Integer id) {
|
||||||
|
return success(cmsArticleLikeService.getById(id));
|
||||||
|
// 使用关联查询
|
||||||
|
//return success(cmsArticleLikeService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "添加点赞文章")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody CmsArticleLike cmsArticleLike) {
|
||||||
|
// 记录当前登录用户id
|
||||||
|
User loginUser = getLoginUser();
|
||||||
|
if (loginUser != null) {
|
||||||
|
cmsArticleLike.setUserId(loginUser.getUserId());
|
||||||
|
}
|
||||||
|
if (cmsArticleLikeService.save(cmsArticleLike)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "修改点赞文章")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody CmsArticleLike cmsArticleLike) {
|
||||||
|
if (cmsArticleLikeService.updateById(cmsArticleLike)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "删除点赞文章")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (cmsArticleLikeService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "批量添加点赞文章")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<CmsArticleLike> list) {
|
||||||
|
if (cmsArticleLikeService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "批量修改点赞文章")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsArticleLike> batchParam) {
|
||||||
|
if (batchParam.update(cmsArticleLikeService, "id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "批量删除点赞文章")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (cmsArticleLikeService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,127 @@
|
|||||||
|
package com.gxwebsoft.cms.controller;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsNavigation;
|
||||||
|
import com.gxwebsoft.cms.service.CmsNavigationService;
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.cms.service.CmsDesignService;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsDesign;
|
||||||
|
import com.gxwebsoft.cms.param.CmsDesignParam;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面管理记录表控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-10 20:47:57
|
||||||
|
*/
|
||||||
|
@Tag(name = "页面管理记录表管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/cms/cms-design")
|
||||||
|
public class CmsDesignController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private CmsDesignService cmsDesignService;
|
||||||
|
@Resource
|
||||||
|
private CmsNavigationService cmsNavigationService;
|
||||||
|
|
||||||
|
@Operation(summary = "分页查询页面管理记录表")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<CmsDesign>> page(CmsDesignParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsDesignService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "查询全部页面管理记录表")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<CmsDesign>> list(CmsDesignParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsDesignService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "根据id查询页面管理记录表")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<CmsDesign> get(@PathVariable("id") Integer id) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsDesignService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "添加页面管理记录表")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody CmsDesign cmsDesign) {
|
||||||
|
// 记录当前登录用户id
|
||||||
|
User loginUser = getLoginUser();
|
||||||
|
if (loginUser != null) {
|
||||||
|
cmsDesign.setUserId(loginUser.getUserId());
|
||||||
|
}
|
||||||
|
if (cmsDesignService.save(cmsDesign)) {
|
||||||
|
try {
|
||||||
|
cmsNavigationService.update(new LambdaUpdateWrapper<CmsNavigation>().set(CmsNavigation::getBanner, cmsDesign.getPhoto()).eq(CmsNavigation::getNavigationId,cmsDesign.getCategoryId()));
|
||||||
|
// 同步翻译英文版
|
||||||
|
cmsDesignService.translate(cmsDesign);
|
||||||
|
return success("添加成功");
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "修改页面管理记录表")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody CmsDesign cmsDesign) {
|
||||||
|
if (cmsDesignService.updateById(cmsDesign)) {
|
||||||
|
// 同步翻译英文版
|
||||||
|
cmsDesignService.translate(cmsDesign);
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "删除页面管理记录表")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (cmsDesignService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "批量添加页面管理记录表")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<CmsDesign> list) {
|
||||||
|
if (cmsDesignService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "批量修改页面管理记录表")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsDesign> batchParam) {
|
||||||
|
if (batchParam.update(cmsDesignService, "page_id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "批量删除页面管理记录表")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (cmsDesignService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,120 @@
|
|||||||
|
package com.gxwebsoft.cms.controller;
|
||||||
|
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.cms.service.CmsDesignRecordService;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsDesignRecord;
|
||||||
|
import com.gxwebsoft.cms.param.CmsDesignRecordParam;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageParam;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面组件表控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-10 20:47:57
|
||||||
|
*/
|
||||||
|
@Tag(name = "页面组件表管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/cms/cms-design-record")
|
||||||
|
public class CmsDesignRecordController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private CmsDesignRecordService cmsDesignRecordService;
|
||||||
|
|
||||||
|
@Operation(summary = "分页查询页面组件表")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<CmsDesignRecord>> page(CmsDesignRecordParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsDesignRecordService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "查询全部页面组件表")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<CmsDesignRecord>> list(CmsDesignRecordParam param) {
|
||||||
|
PageParam<CmsDesignRecord, CmsDesignRecordParam> page = new PageParam<>(param);
|
||||||
|
page.setDefaultOrder("create_time desc");
|
||||||
|
return success(cmsDesignRecordService.list(page.getOrderWrapper()));
|
||||||
|
// 使用关联查询
|
||||||
|
//return success(cmsDesignRecordService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsDesignRecord:list')")
|
||||||
|
@OperationLog
|
||||||
|
@Operation(summary = "根据id查询页面组件表")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<CmsDesignRecord> get(@PathVariable("id") Integer id) {
|
||||||
|
return success(cmsDesignRecordService.getById(id));
|
||||||
|
// 使用关联查询
|
||||||
|
//return success(cmsDesignRecordService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "添加页面组件表")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody CmsDesignRecord cmsDesignRecord) {
|
||||||
|
// 记录当前登录用户id
|
||||||
|
User loginUser = getLoginUser();
|
||||||
|
if (loginUser != null) {
|
||||||
|
cmsDesignRecord.setUserId(loginUser.getUserId());
|
||||||
|
}
|
||||||
|
if (cmsDesignRecordService.save(cmsDesignRecord)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "修改页面组件表")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody CmsDesignRecord cmsDesignRecord) {
|
||||||
|
if (cmsDesignRecordService.updateById(cmsDesignRecord)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "删除页面组件表")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (cmsDesignRecordService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "批量添加页面组件表")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<CmsDesignRecord> list) {
|
||||||
|
if (cmsDesignRecordService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "批量修改页面组件表")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsDesignRecord> batchParam) {
|
||||||
|
if (batchParam.update(cmsDesignRecordService, "id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "批量删除页面组件表")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (cmsDesignRecordService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,166 @@
|
|||||||
|
package com.gxwebsoft.cms.controller;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.gxwebsoft.cms.mapper.CmsDomainMapper;
|
||||||
|
import com.gxwebsoft.common.core.utils.RedisUtil;
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.cms.service.CmsDomainService;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsDomain;
|
||||||
|
import com.gxwebsoft.cms.param.CmsDomainParam;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageParam;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 网站域名记录表控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-10 20:36:14
|
||||||
|
*/
|
||||||
|
@Tag(name = "网站域名记录表管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/cms/cms-domain")
|
||||||
|
public class CmsDomainController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private CmsDomainService cmsDomainService;
|
||||||
|
@Resource
|
||||||
|
private CmsDomainMapper cmsDomainMapper;
|
||||||
|
@Resource
|
||||||
|
private RedisUtil redisUtil;
|
||||||
|
|
||||||
|
@Operation(summary = "分页查询网站域名记录表")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<CmsDomain>> page(CmsDomainParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsDomainService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "查询全部网站域名记录表")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<CmsDomain>> list(CmsDomainParam param) {
|
||||||
|
PageParam<CmsDomain, CmsDomainParam> page = new PageParam<>(param);
|
||||||
|
page.setDefaultOrder("create_time desc");
|
||||||
|
return success(cmsDomainService.list(page.getOrderWrapper()));
|
||||||
|
// 使用关联查询
|
||||||
|
//return success(cmsDomainService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsDomain:list')")
|
||||||
|
@OperationLog
|
||||||
|
@Operation(summary = "根据id查询网站域名记录表")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<CmsDomain> get(@PathVariable("id") Integer id) {
|
||||||
|
return success(cmsDomainService.getById(id));
|
||||||
|
// 使用关联查询
|
||||||
|
//return success(cmsDomainService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "添加网站域名记录表")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody CmsDomain cmsDomain) {
|
||||||
|
// 记录当前登录用户id
|
||||||
|
User loginUser = getLoginUser();
|
||||||
|
if (loginUser != null) {
|
||||||
|
cmsDomain.setUserId(loginUser.getUserId());
|
||||||
|
}
|
||||||
|
if (cmsDomainService.save(cmsDomain)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "修改网站域名记录表")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody CmsDomain cmsDomain) {
|
||||||
|
if (cmsDomainService.updateById(cmsDomain)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "删除网站域名记录表")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (cmsDomainService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "批量添加网站域名记录表")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<CmsDomain> list) {
|
||||||
|
if (cmsDomainService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "批量修改网站域名记录表")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsDomain> batchParam) {
|
||||||
|
if (batchParam.update(cmsDomainService, "id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "批量删除网站域名记录表")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (cmsDomainService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "查询授权域名信息")
|
||||||
|
@GetMapping("/getTenantIdByDomain")
|
||||||
|
public ApiResult<?> getTenantIdByDomain(CmsDomainParam param) {
|
||||||
|
final CmsDomain domain = cmsDomainService.getOne(new LambdaQueryWrapper<CmsDomain>().eq(CmsDomain::getDomain, param.getDomain()).last("limit 1"));
|
||||||
|
return success(domain);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "授权二级域名")
|
||||||
|
@PostMapping("/domain")
|
||||||
|
public ApiResult<?> domain(@RequestBody CmsDomain cmsDomain) {
|
||||||
|
final User loginUser = getLoginUser();
|
||||||
|
String key = "Domain:" + cmsDomain.getDomain();
|
||||||
|
final Integer tenantId = loginUser.getTenantId();
|
||||||
|
final CmsDomain domain = cmsDomainService.getOne(new LambdaQueryWrapper<CmsDomain>()
|
||||||
|
.eq(CmsDomain::getWebsiteId, cmsDomain.getWebsiteId()).last("limit 1"));
|
||||||
|
if (ObjectUtil.isNotEmpty(domain)) {
|
||||||
|
// 重写缓存
|
||||||
|
redisUtil.set(key,tenantId);
|
||||||
|
domain.setDomain(cmsDomain.getDomain());
|
||||||
|
cmsDomainService.updateById(domain);
|
||||||
|
return success("授权成功");
|
||||||
|
}
|
||||||
|
if(ObjectUtil.isEmpty(domain)){
|
||||||
|
cmsDomain.setUserId(loginUser.getUserId());
|
||||||
|
cmsDomain.setSortNumber(100);
|
||||||
|
cmsDomain.setStatus(1);
|
||||||
|
cmsDomain.setHostName("@");
|
||||||
|
cmsDomain.setWebsiteId(cmsDomain.getWebsiteId());
|
||||||
|
cmsDomain.setTenantId(tenantId);
|
||||||
|
if(cmsDomainService.save(cmsDomain)){
|
||||||
|
// 重写缓存
|
||||||
|
redisUtil.set(key,tenantId);
|
||||||
|
return success("授权成功");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return fail("授权失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,120 @@
|
|||||||
|
package com.gxwebsoft.cms.controller;
|
||||||
|
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.cms.service.CmsFormService;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsForm;
|
||||||
|
import com.gxwebsoft.cms.param.CmsFormParam;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageParam;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 表单设计表控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-10 20:47:57
|
||||||
|
*/
|
||||||
|
@Tag(name = "表单设计表管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/cms/cms-form")
|
||||||
|
public class CmsFormController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private CmsFormService cmsFormService;
|
||||||
|
|
||||||
|
@Operation(summary = "分页查询表单设计表")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<CmsForm>> page(CmsFormParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsFormService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "查询全部表单设计表")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<CmsForm>> list(CmsFormParam param) {
|
||||||
|
PageParam<CmsForm, CmsFormParam> page = new PageParam<>(param);
|
||||||
|
page.setDefaultOrder("create_time desc");
|
||||||
|
return success(cmsFormService.list(page.getOrderWrapper()));
|
||||||
|
// 使用关联查询
|
||||||
|
//return success(cmsFormService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsForm:list')")
|
||||||
|
@OperationLog
|
||||||
|
@Operation(summary = "根据id查询表单设计表")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<CmsForm> get(@PathVariable("id") Integer id) {
|
||||||
|
return success(cmsFormService.getById(id));
|
||||||
|
// 使用关联查询
|
||||||
|
//return success(cmsFormService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "添加表单设计表")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody CmsForm cmsForm) {
|
||||||
|
// 记录当前登录用户id
|
||||||
|
User loginUser = getLoginUser();
|
||||||
|
if (loginUser != null) {
|
||||||
|
cmsForm.setUserId(loginUser.getUserId());
|
||||||
|
}
|
||||||
|
if (cmsFormService.save(cmsForm)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "修改表单设计表")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody CmsForm cmsForm) {
|
||||||
|
if (cmsFormService.updateById(cmsForm)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "删除表单设计表")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (cmsFormService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "批量添加表单设计表")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<CmsForm> list) {
|
||||||
|
if (cmsFormService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "批量修改表单设计表")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsForm> batchParam) {
|
||||||
|
if (batchParam.update(cmsFormService, "form_id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "批量删除表单设计表")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (cmsFormService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,120 @@
|
|||||||
|
package com.gxwebsoft.cms.controller;
|
||||||
|
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.cms.service.CmsFormRecordService;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsFormRecord;
|
||||||
|
import com.gxwebsoft.cms.param.CmsFormRecordParam;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageParam;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 表单数据记录表控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-10 20:47:57
|
||||||
|
*/
|
||||||
|
@Tag(name = "表单数据记录表管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/cms/cms-form-record")
|
||||||
|
public class CmsFormRecordController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private CmsFormRecordService cmsFormRecordService;
|
||||||
|
|
||||||
|
@Operation(summary = "分页查询表单数据记录表")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<CmsFormRecord>> page(CmsFormRecordParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsFormRecordService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "查询全部表单数据记录表")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<CmsFormRecord>> list(CmsFormRecordParam param) {
|
||||||
|
PageParam<CmsFormRecord, CmsFormRecordParam> page = new PageParam<>(param);
|
||||||
|
page.setDefaultOrder("create_time desc");
|
||||||
|
return success(cmsFormRecordService.list(page.getOrderWrapper()));
|
||||||
|
// 使用关联查询
|
||||||
|
//return success(cmsFormRecordService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsFormRecord:list')")
|
||||||
|
@OperationLog
|
||||||
|
@Operation(summary = "根据id查询表单数据记录表")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<CmsFormRecord> get(@PathVariable("id") Integer id) {
|
||||||
|
return success(cmsFormRecordService.getById(id));
|
||||||
|
// 使用关联查询
|
||||||
|
//return success(cmsFormRecordService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "添加表单数据记录表")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody CmsFormRecord cmsFormRecord) {
|
||||||
|
// 记录当前登录用户id
|
||||||
|
User loginUser = getLoginUser();
|
||||||
|
if (loginUser != null) {
|
||||||
|
cmsFormRecord.setUserId(loginUser.getUserId());
|
||||||
|
}
|
||||||
|
if (cmsFormRecordService.save(cmsFormRecord)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "修改表单数据记录表")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody CmsFormRecord cmsFormRecord) {
|
||||||
|
if (cmsFormRecordService.updateById(cmsFormRecord)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "删除表单数据记录表")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (cmsFormRecordService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "批量添加表单数据记录表")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<CmsFormRecord> list) {
|
||||||
|
if (cmsFormRecordService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "批量修改表单数据记录表")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsFormRecord> batchParam) {
|
||||||
|
if (batchParam.update(cmsFormRecordService, "form_record_id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "批量删除表单数据记录表")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (cmsFormRecordService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,113 @@
|
|||||||
|
package com.gxwebsoft.cms.controller;
|
||||||
|
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.cms.service.CmsLangService;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsLang;
|
||||||
|
import com.gxwebsoft.cms.param.CmsLangParam;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 国际化控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2025-01-06 19:29:26
|
||||||
|
*/
|
||||||
|
@Tag(name = "国际化管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/cms/cms-lang")
|
||||||
|
public class CmsLangController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private CmsLangService cmsLangService;
|
||||||
|
|
||||||
|
@Operation(summary = "分页查询国际化")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<CmsLang>> page(CmsLangParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsLangService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "查询全部国际化")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<CmsLang>> list(CmsLangParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsLangService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsLang:list')")
|
||||||
|
@Operation(summary = "根据id查询国际化")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<CmsLang> get(@PathVariable("id") Integer id) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsLangService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsLang:save')")
|
||||||
|
@Operation(summary = "添加国际化")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody CmsLang cmsLang) {
|
||||||
|
if (cmsLangService.save(cmsLang)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsLang:update')")
|
||||||
|
@Operation(summary = "修改国际化")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody CmsLang cmsLang) {
|
||||||
|
if (cmsLangService.updateById(cmsLang)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsLang:remove')")
|
||||||
|
@Operation(summary = "删除国际化")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (cmsLangService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsLang:save')")
|
||||||
|
@Operation(summary = "批量添加国际化")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<CmsLang> list) {
|
||||||
|
if (cmsLangService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsLang:update')")
|
||||||
|
@Operation(summary = "批量修改国际化")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsLang> batchParam) {
|
||||||
|
if (batchParam.update(cmsLangService, "id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsLang:reomve')")
|
||||||
|
@Operation(summary = "批量删除国际化")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (cmsLangService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,113 @@
|
|||||||
|
package com.gxwebsoft.cms.controller;
|
||||||
|
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.cms.service.CmsLangLogService;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsLangLog;
|
||||||
|
import com.gxwebsoft.cms.param.CmsLangLogParam;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 国际化记录启用控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2025-01-06 19:29:26
|
||||||
|
*/
|
||||||
|
@Tag(name = "国际化记录启用管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/cms/cms-lang-log")
|
||||||
|
public class CmsLangLogController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private CmsLangLogService cmsLangLogService;
|
||||||
|
|
||||||
|
@Operation(summary = "分页查询国际化记录启用")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<CmsLangLog>> page(CmsLangLogParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsLangLogService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "查询全部国际化记录启用")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<CmsLangLog>> list(CmsLangLogParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsLangLogService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsLangLog:list')")
|
||||||
|
@Operation(summary = "根据id查询国际化记录启用")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<CmsLangLog> get(@PathVariable("id") Integer id) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsLangLogService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsLangLog:save')")
|
||||||
|
@Operation(summary = "添加国际化记录启用")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody CmsLangLog cmsLangLog) {
|
||||||
|
if (cmsLangLogService.save(cmsLangLog)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsLangLog:update')")
|
||||||
|
@Operation(summary = "修改国际化记录启用")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody CmsLangLog cmsLangLog) {
|
||||||
|
if (cmsLangLogService.updateById(cmsLangLog)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsLangLog:remove')")
|
||||||
|
@Operation(summary = "删除国际化记录启用")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (cmsLangLogService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsLangLog:save')")
|
||||||
|
@Operation(summary = "批量添加国际化记录启用")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<CmsLangLog> list) {
|
||||||
|
if (cmsLangLogService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsLangLog:update')")
|
||||||
|
@Operation(summary = "批量修改国际化记录启用")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsLangLog> batchParam) {
|
||||||
|
if (batchParam.update(cmsLangLogService, "id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsLangLog:remove')")
|
||||||
|
@Operation(summary = "批量删除国际化记录启用")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (cmsLangLogService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,115 @@
|
|||||||
|
package com.gxwebsoft.cms.controller;
|
||||||
|
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.cms.service.CmsLinkService;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsLink;
|
||||||
|
import com.gxwebsoft.cms.param.CmsLinkParam;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 常用链接控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-10 20:47:57
|
||||||
|
*/
|
||||||
|
@Tag(name = "常用链接管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/cms/cms-link")
|
||||||
|
public class CmsLinkController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private CmsLinkService cmsLinkService;
|
||||||
|
|
||||||
|
@Operation(summary = "分页查询常用链接")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<CmsLink>> page(CmsLinkParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsLinkService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "查询全部常用链接")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<CmsLink>> list(CmsLinkParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsLinkService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsLink:list')")
|
||||||
|
@OperationLog
|
||||||
|
@Operation(summary = "根据id查询常用链接")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<CmsLink> get(@PathVariable("id") Integer id) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsLinkService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "添加常用链接")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody CmsLink cmsLink) {
|
||||||
|
// 记录当前登录用户id
|
||||||
|
User loginUser = getLoginUser();
|
||||||
|
if (loginUser != null) {
|
||||||
|
cmsLink.setUserId(loginUser.getUserId());
|
||||||
|
}
|
||||||
|
if (cmsLinkService.save(cmsLink)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "修改常用链接")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody CmsLink cmsLink) {
|
||||||
|
if (cmsLinkService.updateById(cmsLink)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "删除常用链接")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (cmsLinkService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "批量添加常用链接")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<CmsLink> list) {
|
||||||
|
if (cmsLinkService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "批量修改常用链接")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsLink> batchParam) {
|
||||||
|
if (batchParam.update(cmsLinkService, "id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "批量删除常用链接")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (cmsLinkService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
package com.gxwebsoft.cms.controller;
|
||||||
|
|
||||||
|
import com.gxwebsoft.cms.service.CmsWebsiteService;
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 网站应用主入口
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-10 20:36:14
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Tag(name = "网站应用")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/cms")
|
||||||
|
public class CmsMainController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private CmsWebsiteService cmsWebsiteService;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,118 @@
|
|||||||
|
package com.gxwebsoft.cms.controller;
|
||||||
|
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.cms.service.CmsModelService;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsModel;
|
||||||
|
import com.gxwebsoft.cms.param.CmsModelParam;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 模型控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-11-26 15:44:53
|
||||||
|
*/
|
||||||
|
@Tag(name = "模型管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/cms/cms-model")
|
||||||
|
public class CmsModelController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private CmsModelService cmsModelService;
|
||||||
|
|
||||||
|
@Operation(summary = "分页查询模型")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<CmsModel>> page(CmsModelParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsModelService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "查询全部模型")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<CmsModel>> list(CmsModelParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsModelService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "根据id查询模型")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<CmsModel> get(@PathVariable("id") Integer id) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsModelService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsModel:save')")
|
||||||
|
@Operation(summary = "添加模型")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody CmsModel cmsModel) {
|
||||||
|
// 记录当前登录用户id
|
||||||
|
User loginUser = getLoginUser();
|
||||||
|
if (loginUser != null) {
|
||||||
|
cmsModel.setUserId(loginUser.getUserId());
|
||||||
|
}
|
||||||
|
if (cmsModelService.save(cmsModel)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsModel:update')")
|
||||||
|
@Operation(summary = "修改模型")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody CmsModel cmsModel) {
|
||||||
|
if (cmsModelService.updateById(cmsModel)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsModel:remove')")
|
||||||
|
@Operation(summary = "删除模型")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (cmsModelService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsModel:save')")
|
||||||
|
@Operation(summary = "批量添加模型")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<CmsModel> list) {
|
||||||
|
if (cmsModelService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsModel:update')")
|
||||||
|
@Operation(summary = "批量修改模型")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsModel> batchParam) {
|
||||||
|
if (batchParam.update(cmsModelService, "model_id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsModel:remvoe')")
|
||||||
|
@Operation(summary = "批量删除模型")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (cmsModelService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,381 @@
|
|||||||
|
package com.gxwebsoft.cms.controller;
|
||||||
|
|
||||||
|
import cn.afterturn.easypoi.excel.ExcelImportUtil;
|
||||||
|
import cn.afterturn.easypoi.excel.entity.ImportParams;
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsDesign;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsModel;
|
||||||
|
import com.gxwebsoft.cms.param.CmsNavigationImportParam;
|
||||||
|
import com.gxwebsoft.cms.service.CmsDesignService;
|
||||||
|
import com.gxwebsoft.cms.service.CmsModelService;
|
||||||
|
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||||
|
import com.gxwebsoft.common.core.utils.CommonUtil;
|
||||||
|
import com.gxwebsoft.common.core.utils.RedisUtil;
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.cms.service.CmsNavigationService;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsNavigation;
|
||||||
|
import com.gxwebsoft.cms.param.CmsNavigationParam;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import com.gxwebsoft.common.system.service.UserService;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import org.springframework.util.CollectionUtils;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 网站导航记录表控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-10 20:47:57
|
||||||
|
*/
|
||||||
|
@Tag(name = "网站导航记录表管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/cms/cms-navigation")
|
||||||
|
public class CmsNavigationController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private CmsNavigationService cmsNavigationService;
|
||||||
|
@Resource
|
||||||
|
private CmsModelService cmsModelService;
|
||||||
|
@Resource
|
||||||
|
private CmsDesignService cmsDesignService;
|
||||||
|
@Resource
|
||||||
|
private UserService userService;
|
||||||
|
@Resource
|
||||||
|
private RedisUtil redisUtil;
|
||||||
|
|
||||||
|
|
||||||
|
private static final String SITE_INFO_KEY_PREFIX = "SiteInfo:";
|
||||||
|
|
||||||
|
@Operation(summary = "分页查询网站导航记录表")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<CmsNavigation>> page(CmsNavigationParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsNavigationService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "查询全部网站导航记录表")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<CmsNavigation>> list(CmsNavigationParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsNavigationService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "根据id查询网站导航记录表")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<CmsNavigation> get(@PathVariable("id") Integer id) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsNavigationService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "根据code查询网站导航记录表")
|
||||||
|
@GetMapping("/getByCode/{code}")
|
||||||
|
public ApiResult<CmsNavigation> getByCode(@PathVariable("code") String code) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsNavigationService.getByIdRelByCodeRel(code));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsNavigation:save')")
|
||||||
|
@Operation(summary = "添加网站导航记录表")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody CmsNavigation cmsNavigation) {
|
||||||
|
// 记录当前登录用户id
|
||||||
|
User loginUser = getLoginUser();
|
||||||
|
if (loginUser != null) {
|
||||||
|
cmsNavigation.setUserId(loginUser.getUserId());
|
||||||
|
cmsNavigation.setTenantId(loginUser.getTenantId());
|
||||||
|
}
|
||||||
|
// 去除前面空格
|
||||||
|
cmsNavigation.setTitle(StrUtil.trimStart(cmsNavigation.getTitle()));
|
||||||
|
if (cmsNavigationService.save(cmsNavigation)) {
|
||||||
|
// 添加成功事务处理
|
||||||
|
cmsNavigationService.saveAsync(cmsNavigation);
|
||||||
|
redisUtil.delete(SITE_INFO_KEY_PREFIX.concat(getTenantId().toString()));
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsNavigation:update')")
|
||||||
|
@Operation(summary = "修改网站导航记录表")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody CmsNavigation cmsNavigation) {
|
||||||
|
if (cmsNavigationService.updateById(cmsNavigation)) {
|
||||||
|
// 修改成功事务处理
|
||||||
|
cmsNavigationService.saveAsync(cmsNavigation);
|
||||||
|
redisUtil.delete(SITE_INFO_KEY_PREFIX.concat(getTenantId().toString()));
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsNavigation:remove')")
|
||||||
|
@Operation(summary = "删除网站导航记录表")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (cmsNavigationService.removeById(id)) {
|
||||||
|
redisUtil.delete(SITE_INFO_KEY_PREFIX.concat(getTenantId().toString()));
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsNavigation:save')")
|
||||||
|
@Operation(summary = "批量添加网站导航记录表")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<CmsNavigation> list) {
|
||||||
|
if (cmsNavigationService.saveBatch(list)) {
|
||||||
|
redisUtil.delete(SITE_INFO_KEY_PREFIX.concat(getTenantId().toString()));
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsNavigation:update')")
|
||||||
|
@Operation(summary = "批量修改网站导航记录表")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsNavigation> batchParam) {
|
||||||
|
if (batchParam.update(cmsNavigationService, "navigation_id")) {
|
||||||
|
redisUtil.delete(SITE_INFO_KEY_PREFIX.concat(getTenantId().toString()));
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsNavigation:remove')")
|
||||||
|
@Operation(summary = "批量删除网站导航记录表")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (cmsNavigationService.removeByIds(ids)) {
|
||||||
|
redisUtil.delete(SITE_INFO_KEY_PREFIX.concat(getTenantId().toString()));
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* excel批量导入网站导航
|
||||||
|
*/
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsNavigation:save')")
|
||||||
|
@OperationLog
|
||||||
|
@Operation(summary = "批量导入网站导航")
|
||||||
|
@Transactional(rollbackFor = {Exception.class})
|
||||||
|
@PostMapping("/import")
|
||||||
|
public ApiResult<?> importBatch(@RequestParam("file") MultipartFile file) {
|
||||||
|
ImportParams importParams = new ImportParams();
|
||||||
|
try {
|
||||||
|
User loginUser = getLoginUser();
|
||||||
|
if (loginUser == null) {
|
||||||
|
return fail("请先登录");
|
||||||
|
}
|
||||||
|
Integer currentUserId = loginUser.getUserId();
|
||||||
|
Integer currentTenantId = loginUser.getTenantId();
|
||||||
|
|
||||||
|
// 1) 清理当前租户的历史数据:先清理 deleted=1,再把 deleted=0 标记为 deleted=1
|
||||||
|
List<CmsNavigation> undeleted = cmsNavigationService.list(new LambdaQueryWrapper<CmsNavigation>()
|
||||||
|
.eq(CmsNavigation::getTenantId, currentTenantId)
|
||||||
|
.eq(CmsNavigation::getDeleted, 0));
|
||||||
|
cmsNavigationService.remove(new LambdaQueryWrapper<CmsNavigation>()
|
||||||
|
.eq(CmsNavigation::getTenantId, currentTenantId)
|
||||||
|
.eq(CmsNavigation::getDeleted, 1));
|
||||||
|
if (!CollectionUtils.isEmpty(undeleted)) {
|
||||||
|
LambdaUpdateWrapper<CmsNavigation> updateWrapper = new LambdaUpdateWrapper<>();
|
||||||
|
updateWrapper.eq(CmsNavigation::getTenantId, currentTenantId);
|
||||||
|
updateWrapper.eq(CmsNavigation::getDeleted, 0);
|
||||||
|
updateWrapper.set(CmsNavigation::getDeleted, 1);
|
||||||
|
cmsNavigationService.update(updateWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 2) 读取Excel
|
||||||
|
List<CmsNavigationImportParam> list = ExcelImportUtil.importExcel(
|
||||||
|
file.getInputStream(), CmsNavigationImportParam.class, importParams);
|
||||||
|
if (CollectionUtils.isEmpty(list)) {
|
||||||
|
return fail("未读取到数据,请确认模板表头与示例格式一致");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 3) 先全部落库(先按根节点保存),再尝试按“导入文件的 parentId -> 导入文件的 navigationId”映射回填层级。
|
||||||
|
// 这样即使 parentId 无法匹配(导入文件缺少导航ID/父节点缺失),也能把数据全部导入,无法还原层级的作为根节点处理。
|
||||||
|
Map<Integer, Integer> newIdByOldId = new HashMap<>();
|
||||||
|
List<Integer> newIds = new ArrayList<>(list.size());
|
||||||
|
List<Integer> oldIds = new ArrayList<>(list.size());
|
||||||
|
List<Integer> oldParentIds = new ArrayList<>(list.size());
|
||||||
|
|
||||||
|
for (CmsNavigationImportParam param : list) {
|
||||||
|
CmsNavigation nav = convertToNavigation(param, currentUserId, currentTenantId);
|
||||||
|
nav.setParentId(0);
|
||||||
|
cmsNavigationService.save(nav);
|
||||||
|
cmsNavigationService.saveAsync(nav);
|
||||||
|
|
||||||
|
Integer oldId = param.getNavigationId();
|
||||||
|
if (oldId != null) {
|
||||||
|
newIdByOldId.put(oldId, nav.getNavigationId());
|
||||||
|
}
|
||||||
|
newIds.add(nav.getNavigationId());
|
||||||
|
oldIds.add(oldId);
|
||||||
|
oldParentIds.add(param.getParentId() != null ? param.getParentId() : 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int orphanCount = 0;
|
||||||
|
int restoredCount = 0;
|
||||||
|
for (int i = 0; i < newIds.size(); i++) {
|
||||||
|
Integer oldParentId = oldParentIds.get(i);
|
||||||
|
if (oldParentId == null || oldParentId == 0) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
Integer oldId = oldIds.get(i);
|
||||||
|
Integer newId = newIds.get(i);
|
||||||
|
Integer newParentId = newIdByOldId.get(oldParentId);
|
||||||
|
// 无法匹配父节点(或出现自引用)就当作孤儿节点,保持根节点
|
||||||
|
if (newParentId == null || (oldId != null && oldParentId.equals(oldId)) || (newId != null && newParentId.equals(newId))) {
|
||||||
|
orphanCount++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
cmsNavigationService.update(new LambdaUpdateWrapper<CmsNavigation>()
|
||||||
|
.eq(CmsNavigation::getNavigationId, newId)
|
||||||
|
.set(CmsNavigation::getParentId, newParentId));
|
||||||
|
restoredCount++;
|
||||||
|
}
|
||||||
|
|
||||||
|
redisUtil.delete(SITE_INFO_KEY_PREFIX.concat(currentTenantId.toString()));
|
||||||
|
return success("成功导入" + list.size() + "条,恢复层级" + restoredCount + "条,无法还原层级的孤儿节点" + orphanCount + "条(已作为根节点导入)");
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return fail("导入失败: " + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 递归创建子级导航
|
||||||
|
*/
|
||||||
|
private void createChildNavigations(Map<Integer, List<CmsNavigationImportParam>> navGroups,
|
||||||
|
Map<Integer, CmsNavigation> tempIdMapping,
|
||||||
|
Integer originalParentId,
|
||||||
|
Integer defaultUserId,
|
||||||
|
Integer defaultTenantId) {
|
||||||
|
if (originalParentId == null || originalParentId == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
List<CmsNavigationImportParam> children = navGroups.get(originalParentId);
|
||||||
|
if (CollectionUtils.isEmpty(children)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
CmsNavigation parent = tempIdMapping.get(originalParentId);
|
||||||
|
if (parent == null || parent.getNavigationId() == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Integer newParentId = parent.getNavigationId();
|
||||||
|
for (CmsNavigationImportParam param : children) {
|
||||||
|
CmsNavigation nav = convertToNavigation(param, defaultUserId, defaultTenantId);
|
||||||
|
nav.setParentId(newParentId);
|
||||||
|
cmsNavigationService.save(nav);
|
||||||
|
cmsNavigationService.saveAsync(nav);
|
||||||
|
if (param.getNavigationId() != null) {
|
||||||
|
tempIdMapping.put(param.getNavigationId(), nav);
|
||||||
|
}
|
||||||
|
createChildNavigations(navGroups, tempIdMapping, param.getNavigationId(), defaultUserId, defaultTenantId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private CmsNavigation convertToNavigation(CmsNavigationImportParam param, Integer defaultUserId, Integer defaultTenantId) {
|
||||||
|
CmsNavigation nav = new CmsNavigation();
|
||||||
|
nav.setType(param.getType());
|
||||||
|
nav.setTitle(StrUtil.trimStart(param.getTitle()));
|
||||||
|
nav.setParentId(param.getParentId() != null ? param.getParentId() : 0);
|
||||||
|
// saveAsync 依赖 model 生成路由/页面;缺省按 page 处理
|
||||||
|
nav.setModel(StrUtil.isBlank(param.getModel()) ? "page" : param.getModel());
|
||||||
|
nav.setCode(param.getCode());
|
||||||
|
nav.setPath(param.getPath());
|
||||||
|
nav.setComponent(param.getComponent());
|
||||||
|
nav.setTarget(param.getTarget());
|
||||||
|
nav.setIcon(param.getIcon());
|
||||||
|
nav.setColor(param.getColor());
|
||||||
|
nav.setHide(param.getHide());
|
||||||
|
nav.setPermission(param.getPermission());
|
||||||
|
nav.setPassword(param.getPassword());
|
||||||
|
nav.setPosition(param.getPosition());
|
||||||
|
nav.setTop(param.getTop());
|
||||||
|
nav.setBottom(param.getBottom());
|
||||||
|
nav.setActive(param.getActive());
|
||||||
|
nav.setMeta(param.getMeta());
|
||||||
|
nav.setStyle(param.getStyle());
|
||||||
|
nav.setModelName(param.getModelName());
|
||||||
|
nav.setPageId(param.getPageId());
|
||||||
|
nav.setItemId(param.getItemId());
|
||||||
|
nav.setIsMpWeixin(param.getIsMpWeixin());
|
||||||
|
nav.setGutter(param.getGutter());
|
||||||
|
nav.setSpan(param.getSpan());
|
||||||
|
nav.setReadNum(param.getReadNum());
|
||||||
|
nav.setMerchantId(param.getMerchantId());
|
||||||
|
nav.setLang(param.getLang());
|
||||||
|
nav.setHome(param.getHome());
|
||||||
|
nav.setRecommend(param.getRecommend());
|
||||||
|
nav.setSortNumber(param.getSortNumber() != null ? param.getSortNumber() : 0);
|
||||||
|
nav.setComments(param.getComments());
|
||||||
|
nav.setStatus(param.getStatus() != null ? param.getStatus() : 0);
|
||||||
|
|
||||||
|
// 导入时强制落到当前登录用户/租户,避免“导出其他租户 -> 导入”写回原租户导致当前租户数据不全。
|
||||||
|
nav.setUserId(defaultUserId);
|
||||||
|
nav.setTenantId(defaultTenantId);
|
||||||
|
nav.setDeleted(0);
|
||||||
|
return nav;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "获取树形结构的网站导航数据")
|
||||||
|
@GetMapping("/tree")
|
||||||
|
public ApiResult<List<CmsNavigation>> tree(CmsNavigationParam param) {
|
||||||
|
param.setHide(0);
|
||||||
|
final List<CmsNavigation> navigations = cmsNavigationService.listRel(param);
|
||||||
|
return success(CommonUtil.toTreeData(navigations, 0, CmsNavigation::getParentId, CmsNavigation::getNavigationId, CmsNavigation::setChildren));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "根据path获取导航")
|
||||||
|
@GetMapping("/getNavigationByPath")
|
||||||
|
public ApiResult<CmsNavigation> getNavigationByPath(CmsNavigationParam param) {
|
||||||
|
final CmsNavigation navigation = cmsNavigationService.getOne(new LambdaUpdateWrapper<CmsNavigation>().eq(CmsNavigation::getModel, param.getModel()).last("limit 1"));
|
||||||
|
if (ObjectUtil.isNotEmpty(navigation)) {
|
||||||
|
// 页面元素
|
||||||
|
final CmsDesign design = cmsDesignService.getOne(new LambdaUpdateWrapper<CmsDesign>().eq(CmsDesign::getCategoryId, navigation.getNavigationId()).last("limit 1"));
|
||||||
|
// 模型信息
|
||||||
|
final CmsModel model = cmsModelService.getOne(new LambdaQueryWrapper<CmsModel>().eq(CmsModel::getModel, navigation.getModel()).last("limit 1"));
|
||||||
|
navigation.setBanner(model.getBanner());
|
||||||
|
// 上级导航
|
||||||
|
if (!navigation.getParentId().equals(0)) {
|
||||||
|
final CmsNavigation parent = cmsNavigationService.getById(navigation.getParentId());
|
||||||
|
navigation.setParentPath(parent.getPath());
|
||||||
|
navigation.setParentName(parent.getTitle());
|
||||||
|
}
|
||||||
|
// 页面信息
|
||||||
|
navigation.setDesign(design);
|
||||||
|
// 页面布局
|
||||||
|
if (ObjectUtil.isNotEmpty(design)) {
|
||||||
|
navigation.setLayout(design.getLayout());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return success(navigation);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "密码校验")
|
||||||
|
@GetMapping("/checkNavigationPassword")
|
||||||
|
public ApiResult<?> checkNavigationPassword(CmsNavigationParam param) {
|
||||||
|
if (!userService.comparePassword(param.getPassword(), param.getPassword2())) {
|
||||||
|
return fail("密码不正确");
|
||||||
|
}
|
||||||
|
return success("密码正确");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,122 @@
|
|||||||
|
package com.gxwebsoft.cms.controller;
|
||||||
|
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.cms.service.CmsOrderService;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsOrder;
|
||||||
|
import com.gxwebsoft.cms.param.CmsOrderParam;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageParam;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 网站订单控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2026-01-27 13:03:25
|
||||||
|
*/
|
||||||
|
@Tag(name = "网站订单管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/cms/cms-order")
|
||||||
|
public class CmsOrderController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private CmsOrderService cmsOrderService;
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsOrder:list')")
|
||||||
|
@Operation(summary = "分页查询网站订单")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<CmsOrder>> page(CmsOrderParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsOrderService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsOrder:list')")
|
||||||
|
@Operation(summary = "查询全部网站订单")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<CmsOrder>> list(CmsOrderParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsOrderService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsOrder:list')")
|
||||||
|
@Operation(summary = "根据id查询网站订单")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<CmsOrder> get(@PathVariable("id") Integer id) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsOrderService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "添加网站订单")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody CmsOrder cmsOrder) {
|
||||||
|
|
||||||
|
if (cmsOrderService.save(cmsOrder)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsOrder:update')")
|
||||||
|
@OperationLog
|
||||||
|
@Operation(summary = "修改网站订单")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody CmsOrder cmsOrder) {
|
||||||
|
if (cmsOrderService.updateById(cmsOrder)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsOrder:remove')")
|
||||||
|
@OperationLog
|
||||||
|
@Operation(summary = "删除网站订单")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (cmsOrderService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsOrder:save')")
|
||||||
|
@OperationLog
|
||||||
|
@Operation(summary = "批量添加网站订单")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<CmsOrder> list) {
|
||||||
|
if (cmsOrderService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsOrder:update')")
|
||||||
|
@OperationLog
|
||||||
|
@Operation(summary = "批量修改网站订单")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsOrder> batchParam) {
|
||||||
|
if (batchParam.update(cmsOrderService, "id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsOrder:remove')")
|
||||||
|
@OperationLog
|
||||||
|
@Operation(summary = "批量删除网站订单")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (cmsOrderService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,126 @@
|
|||||||
|
package com.gxwebsoft.cms.controller;
|
||||||
|
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.cms.service.CmsStatisticsService;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsStatistics;
|
||||||
|
import com.gxwebsoft.cms.param.CmsStatisticsParam;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageParam;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 站点统计信息表控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2025-07-25 12:32:06
|
||||||
|
*/
|
||||||
|
@Tag(name = "站点统计信息表管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/cms/cms-statistics")
|
||||||
|
public class CmsStatisticsController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private CmsStatisticsService cmsStatisticsService;
|
||||||
|
|
||||||
|
@Operation(summary = "分页查询站点统计信息表")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<CmsStatistics>> page(CmsStatisticsParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsStatisticsService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "查询全部站点统计信息表")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<CmsStatistics>> list(CmsStatisticsParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsStatisticsService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "根据id查询站点统计信息表")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<CmsStatistics> get(@PathVariable("id") Integer id) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsStatisticsService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsStatistics:save')")
|
||||||
|
@OperationLog
|
||||||
|
@Operation(summary = "添加站点统计信息表")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody CmsStatistics cmsStatistics) {
|
||||||
|
// 记录当前登录用户id
|
||||||
|
User loginUser = getLoginUser();
|
||||||
|
if (loginUser != null) {
|
||||||
|
cmsStatistics.setUserId(loginUser.getUserId());
|
||||||
|
}
|
||||||
|
if (cmsStatisticsService.save(cmsStatistics)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsStatistics:update')")
|
||||||
|
@OperationLog
|
||||||
|
@Operation(summary = "修改站点统计信息表")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody CmsStatistics cmsStatistics) {
|
||||||
|
if (cmsStatisticsService.updateById(cmsStatistics)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsStatistics:remove')")
|
||||||
|
@OperationLog
|
||||||
|
@Operation(summary = "删除站点统计信息表")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (cmsStatisticsService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsStatistics:save')")
|
||||||
|
@OperationLog
|
||||||
|
@Operation(summary = "批量添加站点统计信息表")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<CmsStatistics> list) {
|
||||||
|
if (cmsStatisticsService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsStatistics:update')")
|
||||||
|
@OperationLog
|
||||||
|
@Operation(summary = "批量修改站点统计信息表")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsStatistics> batchParam) {
|
||||||
|
if (batchParam.update(cmsStatisticsService, "id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsStatistics:remove')")
|
||||||
|
@OperationLog
|
||||||
|
@Operation(summary = "批量删除站点统计信息表")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (cmsStatisticsService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,118 @@
|
|||||||
|
package com.gxwebsoft.cms.controller;
|
||||||
|
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.cms.service.CmsTemplateService;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsTemplate;
|
||||||
|
import com.gxwebsoft.cms.param.CmsTemplateParam;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 网站模版控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2025-01-21 14:21:16
|
||||||
|
*/
|
||||||
|
@Tag(name = "网站模版管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/cms/cms-template")
|
||||||
|
public class CmsTemplateController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private CmsTemplateService cmsTemplateService;
|
||||||
|
|
||||||
|
@Operation(summary = "分页查询网站模版")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<CmsTemplate>> page(CmsTemplateParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsTemplateService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "查询全部网站模版")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<CmsTemplate>> list(CmsTemplateParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsTemplateService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "根据id查询网站模版")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<CmsTemplate> get(@PathVariable("id") Integer id) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsTemplateService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsTemplate:save')")
|
||||||
|
@Operation(summary = "添加网站模版")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody CmsTemplate cmsTemplate) {
|
||||||
|
// 记录当前登录用户id
|
||||||
|
User loginUser = getLoginUser();
|
||||||
|
if (loginUser != null) {
|
||||||
|
cmsTemplate.setUserId(loginUser.getUserId());
|
||||||
|
}
|
||||||
|
if (cmsTemplateService.save(cmsTemplate)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsTemplate:update')")
|
||||||
|
@Operation(summary = "修改网站模版")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody CmsTemplate cmsTemplate) {
|
||||||
|
if (cmsTemplateService.updateById(cmsTemplate)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsTemplate:remove')")
|
||||||
|
@Operation(summary = "删除网站模版")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (cmsTemplateService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsTemplate:save')")
|
||||||
|
@Operation(summary = "批量添加网站模版")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<CmsTemplate> list) {
|
||||||
|
if (cmsTemplateService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsTemplate:update')")
|
||||||
|
@Operation(summary = "批量修改网站模版")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsTemplate> batchParam) {
|
||||||
|
if (batchParam.update(cmsTemplateService, "id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsTemplate:remove')")
|
||||||
|
@Operation(summary = "批量删除网站模版")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (cmsTemplateService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,541 @@
|
|||||||
|
package com.gxwebsoft.cms.controller;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateTime;
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.gxwebsoft.cms.entity.*;
|
||||||
|
import com.gxwebsoft.cms.param.CmsNavigationParam;
|
||||||
|
import com.gxwebsoft.cms.service.CmsNavigationService;
|
||||||
|
import com.gxwebsoft.cms.service.CmsWebsiteFieldService;
|
||||||
|
import com.gxwebsoft.cms.service.CmsWebsiteSettingService;
|
||||||
|
import com.gxwebsoft.common.core.utils.CommonUtil;
|
||||||
|
import com.gxwebsoft.common.core.utils.RedisUtil;
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.cms.service.CmsWebsiteService;
|
||||||
|
import com.gxwebsoft.cms.param.CmsWebsiteParam;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 网站信息记录表控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-10 20:36:14
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Tag(name = "网站信息记录表管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/cms/cms-website")
|
||||||
|
public class CmsWebsiteController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private CmsWebsiteService cmsWebsiteService;
|
||||||
|
@Resource
|
||||||
|
private RedisUtil redisUtil;
|
||||||
|
@Resource
|
||||||
|
private CmsWebsiteFieldService cmsWebsiteFieldService;
|
||||||
|
@Resource
|
||||||
|
private CmsNavigationService cmsNavigationService;
|
||||||
|
@Resource
|
||||||
|
private CmsWebsiteSettingService cmsWebsiteSettingService;
|
||||||
|
|
||||||
|
private static final String SITE_INFO_KEY_PREFIX = "SiteInfo:";
|
||||||
|
private static final String MP_INFO_KEY_PREFIX = "MpInfo:";
|
||||||
|
private static final String SELECT_PAYMENT_KEY_PREFIX = "SelectPayment:";
|
||||||
|
private static final String SYS_DOMAIN_SUFFIX = ".websoft.top";
|
||||||
|
private static final String DOMAIN_SUFFIX = ".wsdns.cn";
|
||||||
|
|
||||||
|
@Operation(summary = "分页查询网站信息记录表")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<CmsWebsite>> page(CmsWebsiteParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsWebsiteService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "查询全部网站信息记录表")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<CmsWebsite>> list(CmsWebsiteParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsWebsiteService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "分页查询网站信息记录表")
|
||||||
|
@GetMapping("/pageAll")
|
||||||
|
public ApiResult<PageResult<CmsWebsite>> pageAll(CmsWebsiteParam param) {
|
||||||
|
return success(cmsWebsiteService.pageRelAll(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "根据id查询网站信息记录表")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<CmsWebsite> get(@PathVariable("id") Integer id) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsWebsiteService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "根据id查询网站信息记录表")
|
||||||
|
@GetMapping("/getAll/{id}")
|
||||||
|
public ApiResult<CmsWebsite> getAll(@PathVariable("id") Integer id) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsWebsiteService.getByIdRelAll(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:website:save')")
|
||||||
|
@Operation(summary = "添加网站信息记录表")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody CmsWebsite cmsWebsite) {
|
||||||
|
// 记录当前登录用户id
|
||||||
|
User loginUser = getLoginUser();
|
||||||
|
if (loginUser != null) {
|
||||||
|
cmsWebsite.setLoginUser(loginUser);
|
||||||
|
return success("创建成功", cmsWebsiteService.create(cmsWebsite));
|
||||||
|
}
|
||||||
|
return fail("创建失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:website:update')")
|
||||||
|
@Operation(summary = "修改网站信息记录表")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody CmsWebsite cmsWebsite) {
|
||||||
|
if (cmsWebsiteService.updateById(cmsWebsite)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:website:update')")
|
||||||
|
@Operation(summary = "修改网站信息记录表")
|
||||||
|
@PutMapping("/updateAll")
|
||||||
|
public ApiResult<?> updateAll(@RequestBody CmsWebsite cmsWebsite) {
|
||||||
|
if (cmsWebsiteService.updateByIdAll(cmsWebsite)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:website:remove')")
|
||||||
|
@Operation(summary = "删除网站信息记录表")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (cmsWebsiteService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:website:remove')")
|
||||||
|
@Operation(summary = "删除网站信息记录表")
|
||||||
|
@DeleteMapping("/removeAll/{id}")
|
||||||
|
public ApiResult<?> removeAll(@PathVariable("id") Integer id) {
|
||||||
|
if (cmsWebsiteService.removeByIdAll(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:website:save')")
|
||||||
|
@Operation(summary = "批量添加网站信息记录表")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<CmsWebsite> list) {
|
||||||
|
if (cmsWebsiteService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:website:update')")
|
||||||
|
@Operation(summary = "批量修改网站信息记录表")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsWebsite> batchParam) {
|
||||||
|
if (batchParam.update(cmsWebsiteService, "website_id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:website:remove')")
|
||||||
|
@Operation(summary = "批量删除网站信息记录表")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (cmsWebsiteService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "网站基本信息")
|
||||||
|
@GetMapping("/getSiteInfo")
|
||||||
|
public ApiResult<CmsWebsite> getSiteInfo() {
|
||||||
|
log.info("开始获取网站基本信息...");
|
||||||
|
try {
|
||||||
|
Integer tenantId = getTenantId();
|
||||||
|
log.info("获取到租户ID: {}", tenantId);
|
||||||
|
if (ObjectUtil.isEmpty(tenantId)) {
|
||||||
|
log.warn("租户ID为空");
|
||||||
|
return fail("租户ID不能为空", null);
|
||||||
|
}
|
||||||
|
|
||||||
|
String key = SITE_INFO_KEY_PREFIX + tenantId;
|
||||||
|
|
||||||
|
// 尝试从缓存获取
|
||||||
|
try {
|
||||||
|
final String siteInfo = redisUtil.get(key);
|
||||||
|
if (StrUtil.isNotBlank(siteInfo)) {
|
||||||
|
log.info("从缓存获取网站信息: = {}", key);
|
||||||
|
// 可以启用缓存返回,但先注释掉确保数据最新
|
||||||
|
// return success(JSONUtil.parseObject(siteInfo, CmsWebsite.class));
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.warn("获取缓存失败: {}", e.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取站点信息
|
||||||
|
CmsWebsite website = null;
|
||||||
|
try {
|
||||||
|
log.info("开始查询租户{}的站点信息", tenantId);
|
||||||
|
website = cmsWebsiteService.getOne(new LambdaQueryWrapper<CmsWebsite>()
|
||||||
|
.eq(CmsWebsite::getTenantId, tenantId)
|
||||||
|
.eq(CmsWebsite::getDeleted, 0)
|
||||||
|
.last("limit 1"));
|
||||||
|
log.info("查询站点信息完成, website: {}", website != null ? "存在" : "不存在");
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("查询站点信息失败: {}", e.getMessage(), e);
|
||||||
|
return fail("查询站点信息失败: " + e.getMessage(), null);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 创建默认站点
|
||||||
|
if (ObjectUtil.isEmpty(website)) {
|
||||||
|
return success("请先创建站点...", null);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 安全地构建网站信息
|
||||||
|
try {
|
||||||
|
buildSafeWebsiteInfo(website);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("构建网站信息失败: {}", e.getMessage(), e);
|
||||||
|
return fail("构建网站信息失败", null);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 缓存结果
|
||||||
|
try {
|
||||||
|
redisUtil.set(key, website, 1L, TimeUnit.DAYS);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.warn("缓存网站信息失败: {}", e.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
return success(website);
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("获取网站信息异常: {}", e.getMessage(), e);
|
||||||
|
return fail("获取网站信息失败: " + e.getMessage(), null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 安全地构建网站信息
|
||||||
|
*/
|
||||||
|
private void buildSafeWebsiteInfo(CmsWebsite website) {
|
||||||
|
if (website == null) {
|
||||||
|
throw new IllegalArgumentException("网站对象不能为空");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 1. 设置网站状态
|
||||||
|
try {
|
||||||
|
setWebsiteStatus(website);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.warn("设置网站状态失败: {}", e.getMessage());
|
||||||
|
website.setStatus(0); // 默认状态
|
||||||
|
website.setStatusText("状态未知");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 2. 构建配置信息
|
||||||
|
try {
|
||||||
|
HashMap<String, Object> config = buildSafeWebsiteConfig(website);
|
||||||
|
website.setConfig(config);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.warn("构建网站配置失败: {}", e.getMessage());
|
||||||
|
website.setConfig(new HashMap<>());
|
||||||
|
}
|
||||||
|
|
||||||
|
// 3. 设置导航信息
|
||||||
|
try {
|
||||||
|
setSafeWebsiteNavigation(website);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.warn("设置网站导航失败: {}", e.getMessage());
|
||||||
|
website.setTopNavs(new ArrayList<>());
|
||||||
|
website.setBottomNavs(new ArrayList<>());
|
||||||
|
}
|
||||||
|
|
||||||
|
// 4. 设置网站设置信息
|
||||||
|
try {
|
||||||
|
setWebsiteSetting(website);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.warn("设置网站设置失败: {}", e.getMessage());
|
||||||
|
// 设置为null,让前端知道没有设置信息
|
||||||
|
}
|
||||||
|
|
||||||
|
// 5. 构建服务器时间(使用LocalDateTime)
|
||||||
|
try {
|
||||||
|
HashMap<String, Object> serverTime = buildSafeServerTime();
|
||||||
|
website.setServerTime(serverTime);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.warn("构建服务器时间失败: {}", e.getMessage());
|
||||||
|
HashMap<String, Object> defaultTime = new HashMap<>();
|
||||||
|
defaultTime.put("now", java.time.LocalDateTime.now().toString());
|
||||||
|
website.setServerTime(defaultTime);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setWebsiteStatus(CmsWebsite website) {
|
||||||
|
// 空值检查,避免NullPointerException
|
||||||
|
Integer running = website.getRunning();
|
||||||
|
if (running == null) {
|
||||||
|
// 默认状态:未开通
|
||||||
|
website.setStatusIcon("error");
|
||||||
|
website.setStatusText("状态未知");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!running.equals(1)) {
|
||||||
|
// 未开通
|
||||||
|
if (running.equals(0)) {
|
||||||
|
website.setStatusIcon("error");
|
||||||
|
website.setStatusText("该站点未开通");
|
||||||
|
}
|
||||||
|
// 维护中
|
||||||
|
if (running.equals(2)) {
|
||||||
|
website.setStatusIcon("warning");
|
||||||
|
}
|
||||||
|
// 已关闭
|
||||||
|
if (running.equals(3)) {
|
||||||
|
website.setStatusIcon("error");
|
||||||
|
website.setStatusText("已关闭");
|
||||||
|
}
|
||||||
|
// 已欠费停机
|
||||||
|
if (running.equals(4)) {
|
||||||
|
website.setStatusIcon("error");
|
||||||
|
website.setStatusText("已欠费停机");
|
||||||
|
}
|
||||||
|
// 违规关停
|
||||||
|
if (running.equals(5)) {
|
||||||
|
website.setStatusIcon("error");
|
||||||
|
website.setStatusText("违规关停");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private HashMap<String, Object> buildWebsiteConfig(CmsWebsite website) {
|
||||||
|
return buildSafeWebsiteConfig(website);
|
||||||
|
}
|
||||||
|
|
||||||
|
private HashMap<String, Object> buildSafeWebsiteConfig(CmsWebsite website) {
|
||||||
|
HashMap<String, Object> config = new HashMap<>();
|
||||||
|
|
||||||
|
try {
|
||||||
|
// 获取网站字段配置
|
||||||
|
LambdaQueryWrapper<CmsWebsiteField> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
wrapper.eq(CmsWebsiteField::getDeleted, 0);
|
||||||
|
final List<CmsWebsiteField> fields = cmsWebsiteFieldService.list(wrapper);
|
||||||
|
|
||||||
|
if (fields != null && !fields.isEmpty()) {
|
||||||
|
fields.forEach(field -> {
|
||||||
|
if (field != null && StrUtil.isNotBlank(field.getName())) {
|
||||||
|
config.put(field.getName(), field.getValue() != null ? field.getValue() : "");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.warn("获取网站字段配置失败: {}", e.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
// 安全地设置域名信息
|
||||||
|
try {
|
||||||
|
config.put("SysDomain", getSafeSysDomain(website));
|
||||||
|
config.put("Domain", getSafeDomain(website));
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.warn("设置域名信息失败: {}", e.getMessage());
|
||||||
|
config.put("SysDomain", website.getTenantId() + ".websoft.top");
|
||||||
|
config.put("Domain", website.getTenantId() + ".wsdns.cn");
|
||||||
|
}
|
||||||
|
|
||||||
|
return config;
|
||||||
|
}
|
||||||
|
|
||||||
|
private String getSysDomain(CmsWebsite website) {
|
||||||
|
return getSafeSysDomain(website);
|
||||||
|
}
|
||||||
|
|
||||||
|
private String getDomain(CmsWebsite website) {
|
||||||
|
return getSafeDomain(website);
|
||||||
|
}
|
||||||
|
|
||||||
|
private String getSafeSysDomain(CmsWebsite website) {
|
||||||
|
if (website == null || website.getTenantId() == null) {
|
||||||
|
return "unknown.websoft.top";
|
||||||
|
}
|
||||||
|
return StrUtil.isNotBlank(website.getWebsiteCode()) ?
|
||||||
|
website.getWebsiteCode() + SYS_DOMAIN_SUFFIX :
|
||||||
|
website.getTenantId() + SYS_DOMAIN_SUFFIX;
|
||||||
|
}
|
||||||
|
|
||||||
|
private String getSafeDomain(CmsWebsite website) {
|
||||||
|
if (website == null || website.getTenantId() == null) {
|
||||||
|
return "unknown.wsdns.cn";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (StrUtil.isNotBlank(website.getDomain())) {
|
||||||
|
return website.getDomain();
|
||||||
|
}
|
||||||
|
if (StrUtil.isNotBlank(website.getWebsiteCode())) {
|
||||||
|
return website.getWebsiteCode() + DOMAIN_SUFFIX;
|
||||||
|
}
|
||||||
|
return website.getTenantId() + DOMAIN_SUFFIX;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setWebsiteNavigation(CmsWebsite website) {
|
||||||
|
setSafeWebsiteNavigation(website);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setSafeWebsiteNavigation(CmsWebsite website) {
|
||||||
|
if (website == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 设置顶部导航
|
||||||
|
try {
|
||||||
|
final CmsNavigationParam topParam = new CmsNavigationParam();
|
||||||
|
topParam.setHide(0);
|
||||||
|
topParam.setTop(0);
|
||||||
|
topParam.setBottom(null);
|
||||||
|
final List<CmsNavigation> topNavs = cmsNavigationService.listRel(topParam);
|
||||||
|
|
||||||
|
if (topNavs != null && !topNavs.isEmpty()) {
|
||||||
|
try {
|
||||||
|
website.setTopNavs(CommonUtil.toTreeData(topNavs, 0,
|
||||||
|
CmsNavigation::getParentId,
|
||||||
|
CmsNavigation::getNavigationId,
|
||||||
|
CmsNavigation::setChildren));
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.warn("构建顶部导航树失败: {}", e.getMessage());
|
||||||
|
website.setTopNavs(new ArrayList<>(topNavs));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
website.setTopNavs(new ArrayList<>());
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.warn("获取顶部导航失败: {}", e.getMessage());
|
||||||
|
website.setTopNavs(new ArrayList<>());
|
||||||
|
}
|
||||||
|
|
||||||
|
// 设置底部导航
|
||||||
|
try {
|
||||||
|
final CmsNavigationParam bottomParam = new CmsNavigationParam();
|
||||||
|
bottomParam.setHide(0);
|
||||||
|
bottomParam.setTop(null);
|
||||||
|
bottomParam.setBottom(0);
|
||||||
|
final List<CmsNavigation> bottomNavs = cmsNavigationService.listRel(bottomParam);
|
||||||
|
|
||||||
|
if (bottomNavs != null && !bottomNavs.isEmpty()) {
|
||||||
|
try {
|
||||||
|
website.setBottomNavs(CommonUtil.toTreeData(bottomNavs, 0,
|
||||||
|
CmsNavigation::getParentId,
|
||||||
|
CmsNavigation::getNavigationId,
|
||||||
|
CmsNavigation::setChildren));
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.warn("构建底部导航树失败: {}", e.getMessage());
|
||||||
|
website.setBottomNavs(new ArrayList<>(bottomNavs));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
website.setBottomNavs(new ArrayList<>());
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.warn("获取底部导航失败: {}", e.getMessage());
|
||||||
|
website.setBottomNavs(new ArrayList<>());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setWebsiteSetting(CmsWebsite website) {
|
||||||
|
final CmsWebsiteSetting setting = cmsWebsiteSettingService.getOne(new LambdaQueryWrapper<CmsWebsiteSetting>().eq(CmsWebsiteSetting::getWebsiteId, website.getWebsiteId()));
|
||||||
|
if (ObjectUtil.isNotEmpty(setting)) {
|
||||||
|
website.setSetting(setting);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private HashMap<String, Object> buildServerTime() {
|
||||||
|
return buildSafeServerTime();
|
||||||
|
}
|
||||||
|
|
||||||
|
private HashMap<String, Object> buildSafeServerTime() {
|
||||||
|
HashMap<String, Object> serverTime = new HashMap<>();
|
||||||
|
|
||||||
|
try {
|
||||||
|
// 使用 LocalDateTime 替代 DateTime
|
||||||
|
java.time.LocalDateTime now = java.time.LocalDateTime.now();
|
||||||
|
java.time.LocalDate today = java.time.LocalDate.now();
|
||||||
|
|
||||||
|
// 当前时间
|
||||||
|
serverTime.put("now", now.toString());
|
||||||
|
|
||||||
|
// 今天日期
|
||||||
|
serverTime.put("today", today.toString());
|
||||||
|
|
||||||
|
// 明天日期
|
||||||
|
java.time.LocalDate tomorrow = today.plusDays(1);
|
||||||
|
serverTime.put("tomorrow", tomorrow.toString());
|
||||||
|
|
||||||
|
// 后天日期
|
||||||
|
java.time.LocalDate afterDay = today.plusDays(2);
|
||||||
|
serverTime.put("afterDay", afterDay.toString());
|
||||||
|
|
||||||
|
// 今天星期几 (1=Monday, 7=Sunday)
|
||||||
|
int week = today.getDayOfWeek().getValue();
|
||||||
|
serverTime.put("week", week);
|
||||||
|
|
||||||
|
// 下周同一天
|
||||||
|
java.time.LocalDate nextWeek = today.plusWeeks(1);
|
||||||
|
serverTime.put("nextWeek", nextWeek.toString());
|
||||||
|
|
||||||
|
// 时间戳
|
||||||
|
serverTime.put("timestamp", System.currentTimeMillis());
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("构建服务器时间失败: {}", e.getMessage(), e);
|
||||||
|
// 提供最基本的时间信息
|
||||||
|
serverTime.put("now", java.time.LocalDateTime.now().toString());
|
||||||
|
serverTime.put("today", java.time.LocalDate.now().toString());
|
||||||
|
serverTime.put("timestamp", System.currentTimeMillis());
|
||||||
|
}
|
||||||
|
|
||||||
|
return serverTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "清除缓存")
|
||||||
|
@DeleteMapping("/clearSiteInfo/{key}")
|
||||||
|
public ApiResult<?> clearSiteInfo(@PathVariable("key") String key) {
|
||||||
|
log.info("清除缓存开始,key: {}", key);
|
||||||
|
System.out.println("清除缓存开始,key = " + key);
|
||||||
|
// 清除指定key
|
||||||
|
redisUtil.delete(key);
|
||||||
|
// 清除缓存
|
||||||
|
redisUtil.delete(SITE_INFO_KEY_PREFIX.concat(getTenantId().toString()));
|
||||||
|
log.info("清除缓存结束,key: {}", SITE_INFO_KEY_PREFIX.concat(getTenantId().toString()));
|
||||||
|
// 清除小程序缓存
|
||||||
|
redisUtil.delete(MP_INFO_KEY_PREFIX.concat(getTenantId().toString()));
|
||||||
|
// 选择支付方式
|
||||||
|
redisUtil.delete(SELECT_PAYMENT_KEY_PREFIX.concat(getTenantId().toString()));
|
||||||
|
return success("清除成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,188 @@
|
|||||||
|
package com.gxwebsoft.cms.controller;
|
||||||
|
|
||||||
|
import cn.afterturn.easypoi.excel.ExcelImportUtil;
|
||||||
|
import cn.afterturn.easypoi.excel.entity.ImportParams;
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.cms.service.CmsWebsiteFieldService;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsWebsiteField;
|
||||||
|
import com.gxwebsoft.cms.param.CmsWebsiteFieldParam;
|
||||||
|
import com.gxwebsoft.cms.param.CmsWebsiteFieldImportParam;
|
||||||
|
import com.gxwebsoft.common.core.utils.JSONUtil;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import org.checkerframework.checker.units.qual.A;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 应用参数控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-10 20:36:14
|
||||||
|
*/
|
||||||
|
@Tag(name = "应用参数管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/cms/cms-website-field")
|
||||||
|
public class CmsWebsiteFieldController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private CmsWebsiteFieldService cmsWebsiteFieldService;
|
||||||
|
|
||||||
|
@Operation(summary = "分页查询应用参数")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<CmsWebsiteField>> page(CmsWebsiteFieldParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsWebsiteFieldService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "查询全部应用参数")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<CmsWebsiteField>> list(CmsWebsiteFieldParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsWebsiteFieldService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "根据id查询应用参数")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<CmsWebsiteField> get(@PathVariable("id") Integer id) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsWebsiteFieldService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "根据code查询应用参数")
|
||||||
|
@GetMapping("/getByCode/{code}")
|
||||||
|
public ApiResult<CmsWebsiteField> getByCode(@PathVariable("code") String code) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsWebsiteFieldService.getByCodeRel(code));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsWebsiteField:save')")
|
||||||
|
@Operation(summary = "添加应用参数")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody CmsWebsiteField cmsWebsiteField) {
|
||||||
|
if (cmsWebsiteFieldService.save(cmsWebsiteField)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsWebsiteField:update')")
|
||||||
|
@Operation(summary = "修改应用参数")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody CmsWebsiteField cmsWebsiteField) {
|
||||||
|
if (cmsWebsiteFieldService.updateById(cmsWebsiteField)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsWebsiteField:remove')")
|
||||||
|
@Operation(summary = "删除应用参数")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (cmsWebsiteFieldService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsWebsiteField:save')")
|
||||||
|
@Operation(summary = "批量添加应用参数")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<CmsWebsiteField> list) {
|
||||||
|
if (cmsWebsiteFieldService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsWebsiteField:update')")
|
||||||
|
@Operation(summary = "批量修改应用参数")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsWebsiteField> batchParam) {
|
||||||
|
if (batchParam.update(cmsWebsiteFieldService, "id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsWebsiteField:remove')")
|
||||||
|
@Operation(summary = "批量删除应用参数")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (cmsWebsiteFieldService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "获取网站配置参数-对象形式")
|
||||||
|
@GetMapping("/config")
|
||||||
|
public ApiResult<?> getConfig(CmsWebsiteFieldParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
final List<CmsWebsiteField> fields = cmsWebsiteFieldService.listRel(param);
|
||||||
|
|
||||||
|
HashMap<String, Object> config = new HashMap<>();
|
||||||
|
fields.forEach(d -> {
|
||||||
|
config.put(d.getName(), d.getValue());
|
||||||
|
});
|
||||||
|
return success(config);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* excel批量导入应用参数
|
||||||
|
*/
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsWebsiteField:save')")
|
||||||
|
@Operation(summary = "批量导入应用参数")
|
||||||
|
@Transactional(rollbackFor = {Exception.class})
|
||||||
|
@PostMapping("/import")
|
||||||
|
public ApiResult<List<String>> importBatch(MultipartFile file) {
|
||||||
|
ImportParams importParams = new ImportParams();
|
||||||
|
try {
|
||||||
|
// 第一步:永久删除已标记为 deleted=1 的记录
|
||||||
|
cmsWebsiteFieldService.remove(new LambdaQueryWrapper<CmsWebsiteField>().eq(CmsWebsiteField::getDeleted, 1));
|
||||||
|
|
||||||
|
// 第二步:将现有未删除的记录(deleted=0)标记为 deleted=1
|
||||||
|
LambdaUpdateWrapper<CmsWebsiteField> updateWrapper = new LambdaUpdateWrapper<>();
|
||||||
|
updateWrapper.eq(CmsWebsiteField::getDeleted, 0);
|
||||||
|
updateWrapper.set(CmsWebsiteField::getDeleted, 1);
|
||||||
|
cmsWebsiteFieldService.update(updateWrapper);
|
||||||
|
|
||||||
|
// 第三步:导入XLS文件的内容
|
||||||
|
List<CmsWebsiteFieldImportParam> list = ExcelImportUtil.importExcel(file.getInputStream(), CmsWebsiteFieldImportParam.class, importParams);
|
||||||
|
list.forEach(d -> {
|
||||||
|
CmsWebsiteField item = JSONUtil.parseObject(JSONUtil.toJSONString(d), CmsWebsiteField.class);
|
||||||
|
assert item != null;
|
||||||
|
if (ObjectUtil.isNotEmpty(item)) {
|
||||||
|
System.out.println("item = " + item);
|
||||||
|
// 设置默认值
|
||||||
|
if (item.getDeleted() == null) {
|
||||||
|
item.setDeleted(0); // 新导入的数据deleted设为0
|
||||||
|
}
|
||||||
|
if (item.getSortNumber() == null) {
|
||||||
|
item.setSortNumber(100);
|
||||||
|
}
|
||||||
|
if (item.getEncrypted() == null) {
|
||||||
|
item.setEncrypted(false);
|
||||||
|
}
|
||||||
|
cmsWebsiteFieldService.save(item);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return success("成功导入" + list.size() + "条", null);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return fail("导入失败", null);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,121 @@
|
|||||||
|
package com.gxwebsoft.cms.controller;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.cms.service.CmsWebsiteSettingService;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsWebsiteSetting;
|
||||||
|
import com.gxwebsoft.cms.param.CmsWebsiteSettingParam;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 网站设置控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2025-02-19 01:35:44
|
||||||
|
*/
|
||||||
|
@Tag(name = "网站设置管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/cms/cms-website-setting")
|
||||||
|
public class CmsWebsiteSettingController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private CmsWebsiteSettingService cmsWebsiteSettingService;
|
||||||
|
|
||||||
|
@Operation(summary = "分页查询网站设置")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<CmsWebsiteSetting>> page(CmsWebsiteSettingParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsWebsiteSettingService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "查询全部网站设置")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<CmsWebsiteSetting>> list(CmsWebsiteSettingParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsWebsiteSettingService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "根据id查询网站设置")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<CmsWebsiteSetting> get(@PathVariable("id") Integer id) {
|
||||||
|
// 使用关联查询
|
||||||
|
final CmsWebsiteSetting cmsWebsiteSetting = cmsWebsiteSettingService.getOne(new LambdaQueryWrapper<CmsWebsiteSetting>().eq(CmsWebsiteSetting::getWebsiteId, id));
|
||||||
|
if(ObjectUtil.isEmpty(cmsWebsiteSetting)){
|
||||||
|
final CmsWebsiteSetting setting = new CmsWebsiteSetting();
|
||||||
|
setting.setWebsiteId(id);
|
||||||
|
cmsWebsiteSettingService.save(setting);
|
||||||
|
return success(cmsWebsiteSettingService.getOne(new LambdaQueryWrapper<CmsWebsiteSetting>().eq(CmsWebsiteSetting::getWebsiteId, id)));
|
||||||
|
}
|
||||||
|
return success(cmsWebsiteSetting);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsWebsiteSetting:save')")
|
||||||
|
@Operation(summary = "添加网站设置")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody CmsWebsiteSetting cmsWebsiteSetting) {
|
||||||
|
if (cmsWebsiteSettingService.save(cmsWebsiteSetting)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:website:update')")
|
||||||
|
@Operation(summary = "修改网站设置")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody CmsWebsiteSetting cmsWebsiteSetting) {
|
||||||
|
if (cmsWebsiteSettingService.updateById(cmsWebsiteSetting)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsWebsiteSetting:remove')")
|
||||||
|
@Operation(summary = "删除网站设置")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (cmsWebsiteSettingService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsWebsiteSetting:save')")
|
||||||
|
@Operation(summary = "批量添加网站设置")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<CmsWebsiteSetting> list) {
|
||||||
|
if (cmsWebsiteSettingService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsWebsiteSetting:update')")
|
||||||
|
@Operation(summary = "批量修改网站设置")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsWebsiteSetting> batchParam) {
|
||||||
|
if (batchParam.update(cmsWebsiteSettingService, "id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsWebsiteSetting:remove')")
|
||||||
|
@Operation(summary = "批量删除网站设置")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (cmsWebsiteSettingService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
106
src/main/java/com/gxwebsoft/cms/entity/CmsAd.java
Normal file
106
src/main/java/com/gxwebsoft/cms/entity/CmsAd.java
Normal file
@@ -0,0 +1,106 @@
|
|||||||
|
package com.gxwebsoft.cms.entity;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.DesensitizedUtil;
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import com.gxwebsoft.common.core.utils.JSONUtil;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 广告位
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-10 20:47:57
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Schema(name = "CmsAd对象", description = "广告位")
|
||||||
|
public class CmsAd implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Schema(description = "ID")
|
||||||
|
@TableId(value = "ad_id", type = IdType.AUTO)
|
||||||
|
private Integer adId;
|
||||||
|
|
||||||
|
@Schema(description = "类型")
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
@Schema(description = "唯一标识")
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
@Schema(description = "栏目ID")
|
||||||
|
private Integer categoryId;
|
||||||
|
|
||||||
|
@Schema(description = "栏目名称")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String categoryName;
|
||||||
|
|
||||||
|
@Schema(description = "广告位名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "宽")
|
||||||
|
private String width;
|
||||||
|
|
||||||
|
@Schema(description = "高")
|
||||||
|
private String height;
|
||||||
|
|
||||||
|
@Schema(description = "边框")
|
||||||
|
private String border;
|
||||||
|
|
||||||
|
@Schema(description = "CSS样式")
|
||||||
|
private String style;
|
||||||
|
|
||||||
|
@Schema(description = "广告图片")
|
||||||
|
private String images;
|
||||||
|
|
||||||
|
@Schema(description = "广告图片")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private JSONArray imageList;
|
||||||
|
|
||||||
|
@Schema(description = "路由/链接地址")
|
||||||
|
private String path;
|
||||||
|
|
||||||
|
@Schema(description = "用户ID")
|
||||||
|
private Integer userId;
|
||||||
|
|
||||||
|
@Schema(description = "国际化语言")
|
||||||
|
private String lang;
|
||||||
|
|
||||||
|
@Schema(description = "排序(数字越小越靠前)")
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
@Schema(description = "备注")
|
||||||
|
private String comments;
|
||||||
|
|
||||||
|
@Schema(description = "状态, 0正常, 1冻结")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@Schema(description = "是否删除, 0否, 1是")
|
||||||
|
@TableLogic
|
||||||
|
private Integer deleted;
|
||||||
|
|
||||||
|
@Schema(description = "租户id")
|
||||||
|
private Integer tenantId;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
public JSONArray getImageList() {
|
||||||
|
return JSON.parseArray(this.images);
|
||||||
|
}
|
||||||
|
}
|
||||||
58
src/main/java/com/gxwebsoft/cms/entity/CmsAdRecord.java
Normal file
58
src/main/java/com/gxwebsoft/cms/entity/CmsAdRecord.java
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
package com.gxwebsoft.cms.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 广告图片
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-10 20:47:57
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Schema(name = "CmsAdRecord对象", description = "广告图片")
|
||||||
|
public class CmsAdRecord implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Schema(description = "ID")
|
||||||
|
@TableId(value = "ad_record_id", type = IdType.AUTO)
|
||||||
|
private Integer adRecordId;
|
||||||
|
|
||||||
|
@Schema(description = "广告标题")
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
@Schema(description = "图片地址")
|
||||||
|
private String path;
|
||||||
|
|
||||||
|
@Schema(description = "链接地址")
|
||||||
|
private String url;
|
||||||
|
|
||||||
|
@Schema(description = "广告位ID")
|
||||||
|
private Integer adId;
|
||||||
|
|
||||||
|
@Schema(description = "排序(数字越小越靠前)")
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
@Schema(description = "备注")
|
||||||
|
private String comments;
|
||||||
|
|
||||||
|
@Schema(description = "状态, 0正常, 1冻结")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@Schema(description = "租户id")
|
||||||
|
private Integer tenantId;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
}
|
||||||
43
src/main/java/com/gxwebsoft/cms/entity/CmsAdVo.java
Normal file
43
src/main/java/com/gxwebsoft/cms/entity/CmsAdVo.java
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
package com.gxwebsoft.cms.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Schema(name = "图片DTO", description = "图片DTO")
|
||||||
|
public class CmsAdVo implements Serializable {
|
||||||
|
|
||||||
|
@Schema(description = "ID")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Integer uid;
|
||||||
|
|
||||||
|
@Schema(description = "名称")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
@Schema(description = "图片路径")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String url;
|
||||||
|
|
||||||
|
@Schema(description = "视频地址")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String video;
|
||||||
|
|
||||||
|
@Schema(description = "状态")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
@Schema(description = "图片宽")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Integer width;
|
||||||
|
|
||||||
|
@Schema(description = "图片高")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Integer height;
|
||||||
|
}
|
||||||
267
src/main/java/com/gxwebsoft/cms/entity/CmsArticle.java
Normal file
267
src/main/java/com/gxwebsoft/cms/entity/CmsArticle.java
Normal file
@@ -0,0 +1,267 @@
|
|||||||
|
package com.gxwebsoft.cms.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文章
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-10 20:47:57
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Schema(name = "CmsArticle对象", description = "文章")
|
||||||
|
public class CmsArticle implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Schema(description = "文章ID")
|
||||||
|
@TableId(value = "article_id", type = IdType.AUTO)
|
||||||
|
private Integer articleId;
|
||||||
|
|
||||||
|
@Schema(description = "文章标题")
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
@Schema(description = "文章类型 0常规 1视频")
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
@Schema(description = "文章模型")
|
||||||
|
private String model;
|
||||||
|
|
||||||
|
@Schema(description = "文章编号")
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
@Schema(description = "内容模板页面")
|
||||||
|
private String detail;
|
||||||
|
|
||||||
|
@Schema(description = "banner")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String banner;
|
||||||
|
|
||||||
|
@Schema(description = "访问路径")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String path;
|
||||||
|
|
||||||
|
@Schema(description = "列表显示方式(10小图展示 20大图展示)")
|
||||||
|
private Integer showType;
|
||||||
|
|
||||||
|
@Schema(description = "话题")
|
||||||
|
private String topic;
|
||||||
|
|
||||||
|
@Schema(description = "标签")
|
||||||
|
private String tags;
|
||||||
|
|
||||||
|
@Schema(description = "文章分类ID")
|
||||||
|
private Integer categoryId;
|
||||||
|
|
||||||
|
@Schema(description = "当前分类")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String categoryName;
|
||||||
|
|
||||||
|
@Schema(description = "父级分类ID")
|
||||||
|
private Integer parentId;
|
||||||
|
|
||||||
|
@Schema(description = "父级分类")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String parentName;
|
||||||
|
|
||||||
|
@Schema(description = "封面图")
|
||||||
|
private String image;
|
||||||
|
|
||||||
|
@Schema(description = "封面图宽度")
|
||||||
|
private Integer imageWidth;
|
||||||
|
|
||||||
|
@Schema(description = "封面图高度")
|
||||||
|
private Integer imageHeight;
|
||||||
|
|
||||||
|
@Schema(description = "价格")
|
||||||
|
private BigDecimal price;
|
||||||
|
|
||||||
|
@Schema(description = "开始时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime startTime;
|
||||||
|
|
||||||
|
@Schema(description = "到期时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime endTime;
|
||||||
|
|
||||||
|
@Schema(description = "来源")
|
||||||
|
private String source;
|
||||||
|
|
||||||
|
@Schema(description = "产品概述")
|
||||||
|
private String overview;
|
||||||
|
|
||||||
|
@Schema(description = "虚拟阅读量(仅用作展示)")
|
||||||
|
private Integer virtualViews;
|
||||||
|
|
||||||
|
@Schema(description = "实际阅读量")
|
||||||
|
private Integer actualViews;
|
||||||
|
|
||||||
|
@Schema(description = "评分")
|
||||||
|
private BigDecimal rate;
|
||||||
|
|
||||||
|
@Schema(description = "可见类型 0所有人 1登录可见 2密码可见")
|
||||||
|
private Integer permission;
|
||||||
|
|
||||||
|
@Schema(description = "访问密码")
|
||||||
|
private String password;
|
||||||
|
|
||||||
|
@Schema(description = "验证密码(前端回传)")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String password2;
|
||||||
|
|
||||||
|
@Schema(description = "发布来源客户端 (APP、H5、小程序等)")
|
||||||
|
private String platform;
|
||||||
|
|
||||||
|
@Schema(description = "文章附件")
|
||||||
|
private String files;
|
||||||
|
|
||||||
|
@Schema(description = "视频地址")
|
||||||
|
private String video;
|
||||||
|
|
||||||
|
@Schema(description = "接受的文件类型")
|
||||||
|
private String accept;
|
||||||
|
|
||||||
|
@Schema(description = "经度")
|
||||||
|
private String longitude;
|
||||||
|
|
||||||
|
@Schema(description = "纬度")
|
||||||
|
private String latitude;
|
||||||
|
|
||||||
|
@Schema(description = "所在省份")
|
||||||
|
private String province;
|
||||||
|
|
||||||
|
@Schema(description = "所在城市")
|
||||||
|
private String city;
|
||||||
|
|
||||||
|
@Schema(description = "所在辖区")
|
||||||
|
private String region;
|
||||||
|
|
||||||
|
@Schema(description = "街道地址")
|
||||||
|
private String address;
|
||||||
|
|
||||||
|
@Schema(description = "点赞数")
|
||||||
|
private Integer likes;
|
||||||
|
|
||||||
|
@Schema(description = "评论数")
|
||||||
|
private Integer commentNumbers;
|
||||||
|
|
||||||
|
@Schema(description = "提醒谁看")
|
||||||
|
private String toUsers;
|
||||||
|
|
||||||
|
@Schema(description = "用户ID")
|
||||||
|
private Integer userId;
|
||||||
|
|
||||||
|
@Schema(description = "作者")
|
||||||
|
private String author;
|
||||||
|
|
||||||
|
@Schema(description = "国际化语言")
|
||||||
|
private String lang;
|
||||||
|
|
||||||
|
@Schema(description = "关联默认语言的文章ID,用于同步翻译更新")
|
||||||
|
private Integer langArticleId;
|
||||||
|
|
||||||
|
@Schema(description = "是否启用自动翻译")
|
||||||
|
private Boolean translation;
|
||||||
|
|
||||||
|
@Schema(description = "编辑器类型 1 富文本编辑器 2 Markdown编辑器")
|
||||||
|
private Integer editor;
|
||||||
|
|
||||||
|
@Schema(description = "PDF地址")
|
||||||
|
private String pdfUrl;
|
||||||
|
|
||||||
|
@Schema(description = "版本号")
|
||||||
|
private Integer version;
|
||||||
|
|
||||||
|
@Schema(description = "商户ID")
|
||||||
|
private Long merchantId;
|
||||||
|
|
||||||
|
@Schema(description = "项目ID")
|
||||||
|
private Long projectId;
|
||||||
|
|
||||||
|
@Schema(description = "商户名称")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String merchantName;
|
||||||
|
|
||||||
|
@Schema(description = "商户名称")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String merchantAvatar;
|
||||||
|
|
||||||
|
@Schema(description = "昵称")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String nickname;
|
||||||
|
|
||||||
|
@Schema(description = "头像")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String avatar;
|
||||||
|
|
||||||
|
@Schema(description = "是否推荐")
|
||||||
|
private Integer recommend;
|
||||||
|
|
||||||
|
@Schema(description = "排序(数字越小越靠前)")
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
@Schema(description = "备注")
|
||||||
|
private String comments;
|
||||||
|
|
||||||
|
@Schema(description = "状态, 0已发布, 1待审核 2已驳回 3违规内容")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@Schema(description = "状态文本")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String statusText;
|
||||||
|
|
||||||
|
@Schema(description = "是否删除, 0否, 1是")
|
||||||
|
@TableLogic
|
||||||
|
private Integer deleted;
|
||||||
|
|
||||||
|
@Schema(description = "租户id")
|
||||||
|
private Integer tenantId;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
@Schema(description = "修改时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime updateTime;
|
||||||
|
|
||||||
|
@Schema(description = "是否更新")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Boolean isUpdate;
|
||||||
|
|
||||||
|
@Schema(description = "文章内容")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String content;
|
||||||
|
|
||||||
|
@Schema(description = "已报名人数")
|
||||||
|
private Integer bmUsers;
|
||||||
|
|
||||||
|
public String getStatusText() {
|
||||||
|
if (this.status == 0) {
|
||||||
|
return "已发布";
|
||||||
|
}
|
||||||
|
if (this.status == 1) {
|
||||||
|
return "待审核";
|
||||||
|
}
|
||||||
|
if (this.status == 2) {
|
||||||
|
return "已驳回";
|
||||||
|
}
|
||||||
|
if (this.status == 3) {
|
||||||
|
return "违规内容";
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,94 @@
|
|||||||
|
package com.gxwebsoft.cms.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文章分类表
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-10 20:47:57
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Schema(name = "CmsArticleCategory对象", description = "文章分类表")
|
||||||
|
public class CmsArticleCategory implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Schema(description = "文章分类ID")
|
||||||
|
@TableId(value = "category_id", type = IdType.AUTO)
|
||||||
|
private Integer categoryId;
|
||||||
|
|
||||||
|
@Schema(description = "分类标识")
|
||||||
|
private String categoryCode;
|
||||||
|
|
||||||
|
@Schema(description = "分类名称")
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
@Schema(description = "类型 0列表 1单页 2外链")
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
@Schema(description = "分类图片")
|
||||||
|
private String image;
|
||||||
|
|
||||||
|
@Schema(description = "上级分类ID")
|
||||||
|
private Integer parentId;
|
||||||
|
|
||||||
|
@Schema(description = "路由/链接地址")
|
||||||
|
private String path;
|
||||||
|
|
||||||
|
@Schema(description = "组件路径")
|
||||||
|
private String component;
|
||||||
|
|
||||||
|
@Schema(description = "绑定的页面")
|
||||||
|
private Integer pageId;
|
||||||
|
|
||||||
|
@Schema(description = "用户ID")
|
||||||
|
private Integer userId;
|
||||||
|
|
||||||
|
@Schema(description = "文章数量")
|
||||||
|
private Integer count;
|
||||||
|
|
||||||
|
@Schema(description = "排序(数字越小越靠前)")
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
@Schema(description = "备注")
|
||||||
|
private String comments;
|
||||||
|
|
||||||
|
@Schema(description = "是否隐藏, 0否, 1是(仅注册路由不显示在左侧菜单)")
|
||||||
|
private Integer hide;
|
||||||
|
|
||||||
|
@Schema(description = "是否推荐")
|
||||||
|
private Integer recommend;
|
||||||
|
|
||||||
|
@Schema(description = "是否显示在首页")
|
||||||
|
private Integer showIndex;
|
||||||
|
|
||||||
|
@Schema(description = "状态, 0正常, 1禁用")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@Schema(description = "是否删除, 0否, 1是")
|
||||||
|
@TableLogic
|
||||||
|
private Integer deleted;
|
||||||
|
|
||||||
|
@Schema(description = "租户id")
|
||||||
|
private Integer tenantId;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
@Schema(description = "修改时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime updateTime;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,79 @@
|
|||||||
|
package com.gxwebsoft.cms.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文章评论表
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-10 20:47:57
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Schema(name = "CmsArticleComment对象", description = "文章评论表")
|
||||||
|
public class CmsArticleComment implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Schema(description = "评价ID")
|
||||||
|
@TableId(value = "comment_id", type = IdType.AUTO)
|
||||||
|
private Integer commentId;
|
||||||
|
|
||||||
|
@Schema(description = "文章ID")
|
||||||
|
private Integer articleId;
|
||||||
|
|
||||||
|
@Schema(description = "评分 (10好评 20中评 30差评)")
|
||||||
|
private Integer score;
|
||||||
|
|
||||||
|
@Schema(description = "评价内容")
|
||||||
|
private String content;
|
||||||
|
|
||||||
|
@Schema(description = "是否为图片评价")
|
||||||
|
private Integer isPicture;
|
||||||
|
|
||||||
|
@Schema(description = "评论者ID")
|
||||||
|
private Integer userId;
|
||||||
|
|
||||||
|
@Schema(description = "被评价者ID")
|
||||||
|
private Integer toUserId;
|
||||||
|
|
||||||
|
@Schema(description = "回复的评论ID")
|
||||||
|
private Integer replyCommentId;
|
||||||
|
|
||||||
|
@Schema(description = "回复者ID")
|
||||||
|
private Integer replyUserId;
|
||||||
|
|
||||||
|
@Schema(description = "排序(数字越小越靠前)")
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
@Schema(description = "备注")
|
||||||
|
private String comments;
|
||||||
|
|
||||||
|
@Schema(description = "状态, 0未读, 1已读")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@Schema(description = "是否删除, 0否, 1是")
|
||||||
|
@TableLogic
|
||||||
|
private Integer deleted;
|
||||||
|
|
||||||
|
@Schema(description = "租户id")
|
||||||
|
private Integer tenantId;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
@Schema(description = "修改时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime updateTime;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
package com.gxwebsoft.cms.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文章记录表
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-10 20:47:57
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Schema(name = "CmsArticleContent对象", description = "文章记录表")
|
||||||
|
public class CmsArticleContent implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@Schema(description = "文章ID")
|
||||||
|
private Integer articleId;
|
||||||
|
|
||||||
|
@Schema(description = "文章内容")
|
||||||
|
private String content;
|
||||||
|
|
||||||
|
@Schema(description = "租户id")
|
||||||
|
private Integer tenantId;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
}
|
||||||
43
src/main/java/com/gxwebsoft/cms/entity/CmsArticleCount.java
Normal file
43
src/main/java/com/gxwebsoft/cms/entity/CmsArticleCount.java
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
package com.gxwebsoft.cms.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 点赞文章
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-10 20:47:57
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Schema(name = "CmsArticleCount对象", description = "点赞文章")
|
||||||
|
public class CmsArticleCount implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Schema(description = "主键ID")
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@Schema(description = "文章ID")
|
||||||
|
private Integer articleId;
|
||||||
|
|
||||||
|
@Schema(description = "用户ID")
|
||||||
|
private Integer userId;
|
||||||
|
|
||||||
|
@Schema(description = "租户id")
|
||||||
|
private Integer tenantId;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
}
|
||||||
43
src/main/java/com/gxwebsoft/cms/entity/CmsArticleLike.java
Normal file
43
src/main/java/com/gxwebsoft/cms/entity/CmsArticleLike.java
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
package com.gxwebsoft.cms.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 点赞文章
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-10 20:47:57
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Schema(name = "CmsArticleLike对象", description = "点赞文章")
|
||||||
|
public class CmsArticleLike implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Schema(description = "主键ID")
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@Schema(description = "文章ID")
|
||||||
|
private Integer articleId;
|
||||||
|
|
||||||
|
@Schema(description = "用户ID")
|
||||||
|
private Integer userId;
|
||||||
|
|
||||||
|
@Schema(description = "租户id")
|
||||||
|
private Integer tenantId;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
}
|
||||||
123
src/main/java/com/gxwebsoft/cms/entity/CmsDesign.java
Normal file
123
src/main/java/com/gxwebsoft/cms/entity/CmsDesign.java
Normal file
@@ -0,0 +1,123 @@
|
|||||||
|
package com.gxwebsoft.cms.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面管理记录表
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-10 20:47:57
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Schema(name = "CmsDesign对象", description = "页面管理记录表")
|
||||||
|
public class CmsDesign implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Schema(description = "ID")
|
||||||
|
@TableId(value = "page_id", type = IdType.AUTO)
|
||||||
|
private Integer pageId;
|
||||||
|
|
||||||
|
@Schema(description = "页面")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "所属栏目ID")
|
||||||
|
private Integer categoryId;
|
||||||
|
|
||||||
|
@Schema(description = "所属栏目")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String categoryName;
|
||||||
|
|
||||||
|
@Schema(description = "页面模型")
|
||||||
|
private String model;
|
||||||
|
|
||||||
|
@Schema(description = "页面关键词")
|
||||||
|
private String keywords;
|
||||||
|
|
||||||
|
@Schema(description = "页面描述")
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
@Schema(description = "路由地址")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String path;
|
||||||
|
|
||||||
|
@Schema(description = "组件路径")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String component;
|
||||||
|
|
||||||
|
@Schema(description = "缩列图")
|
||||||
|
private String photo;
|
||||||
|
|
||||||
|
@Schema(description = "购买链接")
|
||||||
|
private String buyUrl;
|
||||||
|
|
||||||
|
@Schema(description = "页面样式")
|
||||||
|
private String style;
|
||||||
|
|
||||||
|
@Schema(description = "页面内容")
|
||||||
|
private String content;
|
||||||
|
|
||||||
|
@Schema(description = "是否开启布局")
|
||||||
|
private Boolean showLayout;
|
||||||
|
|
||||||
|
@Schema(description = "页面布局")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String layout;
|
||||||
|
|
||||||
|
@Schema(description = "是否显示banner")
|
||||||
|
private Boolean showBanner;
|
||||||
|
|
||||||
|
@Schema(description = "是否显示Button")
|
||||||
|
private Boolean showButton;
|
||||||
|
|
||||||
|
@Schema(description = "上级id, 0是顶级")
|
||||||
|
private Integer parentId;
|
||||||
|
|
||||||
|
@Schema(description = "用户ID")
|
||||||
|
private Integer userId;
|
||||||
|
|
||||||
|
@Schema(description = "国际化语言")
|
||||||
|
private String lang;
|
||||||
|
|
||||||
|
@Schema(description = "用于同步翻译内容")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Integer langCategoryId;
|
||||||
|
|
||||||
|
@Schema(description = "是否启用自动翻译")
|
||||||
|
private Boolean translation;
|
||||||
|
|
||||||
|
@Schema(description = "设为首页")
|
||||||
|
private Integer home;
|
||||||
|
|
||||||
|
@Schema(description = "排序(数字越小越靠前)")
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
@Schema(description = "备注")
|
||||||
|
private String comments;
|
||||||
|
|
||||||
|
@Schema(description = "状态, 0正常, 1冻结")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@Schema(description = "是否删除, 0否, 1是")
|
||||||
|
@TableLogic
|
||||||
|
private Integer deleted;
|
||||||
|
|
||||||
|
@Schema(description = "租户id")
|
||||||
|
private Integer tenantId;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
}
|
||||||
76
src/main/java/com/gxwebsoft/cms/entity/CmsDesignRecord.java
Normal file
76
src/main/java/com/gxwebsoft/cms/entity/CmsDesignRecord.java
Normal file
@@ -0,0 +1,76 @@
|
|||||||
|
package com.gxwebsoft.cms.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面组件表
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-10 20:47:57
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Schema(name = "CmsDesignRecord对象", description = "页面组件表")
|
||||||
|
public class CmsDesignRecord implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Schema(description = "ID")
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@Schema(description = "关联导航ID")
|
||||||
|
private Integer navigationId;
|
||||||
|
|
||||||
|
@Schema(description = "组件")
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
@Schema(description = "组件标识")
|
||||||
|
private String dictCode;
|
||||||
|
|
||||||
|
@Schema(description = "组件样式")
|
||||||
|
private String styles;
|
||||||
|
|
||||||
|
@Schema(description = "卡片阴影显示时机")
|
||||||
|
private String shadow;
|
||||||
|
|
||||||
|
@Schema(description = "页面关键词")
|
||||||
|
private String keywords;
|
||||||
|
|
||||||
|
@Schema(description = "页面描述")
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
@Schema(description = "页面路由地址")
|
||||||
|
private String path;
|
||||||
|
|
||||||
|
@Schema(description = "缩列图")
|
||||||
|
private String photo;
|
||||||
|
|
||||||
|
@Schema(description = "用户ID")
|
||||||
|
private Integer userId;
|
||||||
|
|
||||||
|
@Schema(description = "排序(数字越小越靠前)")
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
@Schema(description = "备注")
|
||||||
|
private String comments;
|
||||||
|
|
||||||
|
@Schema(description = "状态, 0正常, 1冻结")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@Schema(description = "租户id")
|
||||||
|
private Integer tenantId;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
}
|
||||||
73
src/main/java/com/gxwebsoft/cms/entity/CmsDomain.java
Normal file
73
src/main/java/com/gxwebsoft/cms/entity/CmsDomain.java
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
package com.gxwebsoft.cms.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 网站域名记录表
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-10 20:36:14
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Schema(name = "CmsDomain对象", description = "网站域名记录表")
|
||||||
|
public class CmsDomain implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Schema(description = "ID")
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@Schema(description = "类型 0赠送域名 1绑定域名 ")
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
@Schema(description = "域名")
|
||||||
|
private String domain;
|
||||||
|
|
||||||
|
@Schema(description = "主机记录")
|
||||||
|
private String hostName;
|
||||||
|
|
||||||
|
@Schema(description = "记录值")
|
||||||
|
private String hostValue;
|
||||||
|
|
||||||
|
@Schema(description = "状态")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@Schema(description = "排序号")
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
@Schema(description = "网站ID")
|
||||||
|
private Integer websiteId;
|
||||||
|
|
||||||
|
@Schema(description = "租户ID")
|
||||||
|
private Integer appId;
|
||||||
|
|
||||||
|
@Schema(description = "用户ID")
|
||||||
|
private Integer userId;
|
||||||
|
|
||||||
|
@Schema(description = "是否删除, 0否, 1是")
|
||||||
|
@TableLogic
|
||||||
|
private Integer deleted;
|
||||||
|
|
||||||
|
@Schema(description = "租户id")
|
||||||
|
private Integer tenantId;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
@Schema(description = "修改时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime updateTime;
|
||||||
|
|
||||||
|
}
|
||||||
91
src/main/java/com/gxwebsoft/cms/entity/CmsForm.java
Normal file
91
src/main/java/com/gxwebsoft/cms/entity/CmsForm.java
Normal file
@@ -0,0 +1,91 @@
|
|||||||
|
package com.gxwebsoft.cms.entity;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 表单设计表
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-10 20:47:57
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Schema(name = "CmsForm对象", description = "表单设计表")
|
||||||
|
public class CmsForm implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Schema(description = "ID")
|
||||||
|
@TableId(value = "form_id", type = IdType.AUTO)
|
||||||
|
private Integer formId;
|
||||||
|
|
||||||
|
@Schema(description = "表单标题")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "顶部图片")
|
||||||
|
private String photo;
|
||||||
|
|
||||||
|
@Schema(description = "背景图片")
|
||||||
|
private String background;
|
||||||
|
|
||||||
|
@Schema(description = "视频文件")
|
||||||
|
private String video;
|
||||||
|
|
||||||
|
@Schema(description = "提交次数")
|
||||||
|
private Integer submitNumber;
|
||||||
|
|
||||||
|
@Schema(description = "页面布局")
|
||||||
|
private String layout;
|
||||||
|
|
||||||
|
@Schema(description = "是否隐藏顶部图片")
|
||||||
|
private Integer hidePhoto;
|
||||||
|
|
||||||
|
@Schema(description = "是否隐藏背景图片")
|
||||||
|
private Integer hideBackground;
|
||||||
|
|
||||||
|
@Schema(description = "是否隐藏视频")
|
||||||
|
private Integer hideVideo;
|
||||||
|
|
||||||
|
@Schema(description = "背景图片透明度")
|
||||||
|
private BigDecimal opacity;
|
||||||
|
|
||||||
|
@Schema(description = "用户ID")
|
||||||
|
private Integer userId;
|
||||||
|
|
||||||
|
@Schema(description = "国际化语言")
|
||||||
|
private String lang;
|
||||||
|
|
||||||
|
@Schema(description = "商户ID")
|
||||||
|
private Long merchantId;
|
||||||
|
|
||||||
|
@Schema(description = "排序(数字越小越靠前)")
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
@Schema(description = "备注")
|
||||||
|
private String comments;
|
||||||
|
|
||||||
|
@Schema(description = "状态, 0正常, 1冻结")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@Schema(description = "是否删除, 0否, 1是")
|
||||||
|
@TableLogic
|
||||||
|
private Integer deleted;
|
||||||
|
|
||||||
|
@Schema(description = "租户id")
|
||||||
|
private Integer tenantId;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
}
|
||||||
69
src/main/java/com/gxwebsoft/cms/entity/CmsFormRecord.java
Normal file
69
src/main/java/com/gxwebsoft/cms/entity/CmsFormRecord.java
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
package com.gxwebsoft.cms.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 表单数据记录表
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-10 20:47:57
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Schema(name = "CmsFormRecord对象", description = "表单数据记录表")
|
||||||
|
public class CmsFormRecord implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Schema(description = "ID")
|
||||||
|
@TableId(value = "form_record_id", type = IdType.AUTO)
|
||||||
|
private Integer formRecordId;
|
||||||
|
|
||||||
|
@Schema(description = "手机号")
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
@Schema(description = "表单数据")
|
||||||
|
private String formData;
|
||||||
|
|
||||||
|
@Schema(description = "表单ID")
|
||||||
|
private Integer formId;
|
||||||
|
|
||||||
|
@Schema(description = "用户ID")
|
||||||
|
private Integer userId;
|
||||||
|
|
||||||
|
@Schema(description = "商户ID")
|
||||||
|
private Long merchantId;
|
||||||
|
|
||||||
|
@Schema(description = "姓名")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "排序(数字越小越靠前)")
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
@Schema(description = "备注")
|
||||||
|
private String comments;
|
||||||
|
|
||||||
|
@Schema(description = "状态, 0正常, 1冻结")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@Schema(description = "是否删除, 0否, 1是")
|
||||||
|
@TableLogic
|
||||||
|
private Integer deleted;
|
||||||
|
|
||||||
|
@Schema(description = "租户id")
|
||||||
|
private Integer tenantId;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
}
|
||||||
61
src/main/java/com/gxwebsoft/cms/entity/CmsLang.java
Normal file
61
src/main/java/com/gxwebsoft/cms/entity/CmsLang.java
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
package com.gxwebsoft.cms.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 国际化
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2025-01-06 19:29:26
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Schema(name = "CmsLang对象", description = "国际化")
|
||||||
|
public class CmsLang implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Schema(description = "ID")
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@Schema(description = "名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "编码")
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
@Schema(description = "排序(数字越小越靠前)")
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
@Schema(description = "备注")
|
||||||
|
private String comments;
|
||||||
|
|
||||||
|
@Schema(description = "状态, 0已发布, 1待审核 2已驳回 3违规内容")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@Schema(description = "是否删除, 0否, 1是")
|
||||||
|
@TableLogic
|
||||||
|
private Integer deleted;
|
||||||
|
|
||||||
|
@Schema(description = "租户id")
|
||||||
|
private Integer tenantId;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
@Schema(description = "修改时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime updateTime;
|
||||||
|
|
||||||
|
}
|
||||||
46
src/main/java/com/gxwebsoft/cms/entity/CmsLangLog.java
Normal file
46
src/main/java/com/gxwebsoft/cms/entity/CmsLangLog.java
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
package com.gxwebsoft.cms.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 国际化记录启用
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2025-01-06 19:29:26
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Schema(name = "CmsLangLog对象", description = "国际化记录启用")
|
||||||
|
public class CmsLangLog implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Schema(description = "ID")
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@Schema(description = "名称")
|
||||||
|
private String lang;
|
||||||
|
|
||||||
|
@Schema(description = "关联ID")
|
||||||
|
private Integer langId;
|
||||||
|
|
||||||
|
@Schema(description = "编码")
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
@Schema(description = "租户id")
|
||||||
|
private Integer tenantId;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
}
|
||||||
80
src/main/java/com/gxwebsoft/cms/entity/CmsLink.java
Normal file
80
src/main/java/com/gxwebsoft/cms/entity/CmsLink.java
Normal file
@@ -0,0 +1,80 @@
|
|||||||
|
package com.gxwebsoft.cms.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 常用链接
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-10 20:47:57
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Schema(name = "CmsLink对象", description = "常用链接")
|
||||||
|
public class CmsLink implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Schema(description = "自增ID")
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@Schema(description = "链接名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "图标")
|
||||||
|
private String icon;
|
||||||
|
|
||||||
|
@Schema(description = "链接地址")
|
||||||
|
private String url;
|
||||||
|
|
||||||
|
@Schema(description = "栏目ID")
|
||||||
|
private Integer categoryId;
|
||||||
|
|
||||||
|
@Schema(description = "应用ID")
|
||||||
|
private Integer appId;
|
||||||
|
|
||||||
|
@Schema(description = "用户ID")
|
||||||
|
private Integer userId;
|
||||||
|
|
||||||
|
@Schema(description = "国际化语言")
|
||||||
|
private String lang;
|
||||||
|
|
||||||
|
@Schema(description = "是否推荐")
|
||||||
|
private Integer recommend;
|
||||||
|
|
||||||
|
@Schema(description = "备注")
|
||||||
|
private String comments;
|
||||||
|
|
||||||
|
@Schema(description = "排序(数字越小越靠前)")
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
@Schema(description = "是否删除, 0否, 1是")
|
||||||
|
@TableLogic
|
||||||
|
private Integer deleted;
|
||||||
|
|
||||||
|
@Schema(description = "状态, 0正常, 1待确认")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@Schema(description = "租户id")
|
||||||
|
private Integer tenantId;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
@Schema(description = "栏目名称")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String categoryName;
|
||||||
|
|
||||||
|
}
|
||||||
97
src/main/java/com/gxwebsoft/cms/entity/CmsModel.java
Normal file
97
src/main/java/com/gxwebsoft/cms/entity/CmsModel.java
Normal file
@@ -0,0 +1,97 @@
|
|||||||
|
package com.gxwebsoft.cms.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 模型
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-11-26 15:44:53
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Schema(name = "CmsModel对象", description = "模型")
|
||||||
|
public class CmsModel implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Schema(description = "ID")
|
||||||
|
@TableId(value = "model_id", type = IdType.AUTO)
|
||||||
|
private Integer modelId;
|
||||||
|
|
||||||
|
@Schema(description = "模型名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "唯一标识")
|
||||||
|
private String model;
|
||||||
|
|
||||||
|
@Schema(description = "列表页路径")
|
||||||
|
private String component;
|
||||||
|
|
||||||
|
@Schema(description = "详情页路径")
|
||||||
|
private String componentDetail;
|
||||||
|
|
||||||
|
@Schema(description = "模型banner图片")
|
||||||
|
private String banner;
|
||||||
|
|
||||||
|
@Schema(description = "文章后缀")
|
||||||
|
private String suffix;
|
||||||
|
|
||||||
|
@Schema(description = "拇指图片")
|
||||||
|
private String thumb;
|
||||||
|
|
||||||
|
@Schema(description = "封面图宽")
|
||||||
|
private String imageWidth;
|
||||||
|
|
||||||
|
@Schema(description = "封面图高")
|
||||||
|
private String imageHeight;
|
||||||
|
|
||||||
|
@Schema(description = "css样式")
|
||||||
|
private String style;
|
||||||
|
|
||||||
|
@Schema(description = "Banner上的标题")
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
@Schema(description = "列表显示方式(10小图展示 20大图展示)")
|
||||||
|
private Integer showType;
|
||||||
|
|
||||||
|
@Schema(description = "是否禁用")
|
||||||
|
private Boolean disabled;
|
||||||
|
|
||||||
|
@Schema(description = "用户ID")
|
||||||
|
private Integer userId;
|
||||||
|
|
||||||
|
@Schema(description = "排序(数字越小越靠前)")
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
@Schema(description = "备注")
|
||||||
|
private String comments;
|
||||||
|
|
||||||
|
@Schema(description = "状态, 0已发布, 1待审核 2已驳回 3违规内容")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@Schema(description = "是否删除, 0否, 1是")
|
||||||
|
@TableLogic
|
||||||
|
private Integer deleted;
|
||||||
|
|
||||||
|
@Schema(description = "租户id")
|
||||||
|
private Integer tenantId;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
@Schema(description = "修改时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime updateTime;
|
||||||
|
|
||||||
|
}
|
||||||
242
src/main/java/com/gxwebsoft/cms/entity/CmsNavigation.java
Normal file
242
src/main/java/com/gxwebsoft/cms/entity/CmsNavigation.java
Normal file
@@ -0,0 +1,242 @@
|
|||||||
|
package com.gxwebsoft.cms.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 网站导航记录表
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-10 20:47:57
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Schema(name = "CmsNavigation对象", description = "网站导航记录表")
|
||||||
|
public class CmsNavigation implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Schema(description = "ID")
|
||||||
|
@TableId(value = "navigation_id", type = IdType.AUTO)
|
||||||
|
private Integer navigationId;
|
||||||
|
|
||||||
|
@Schema(description = "类型, 0列表 1图文")
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
@Schema(description = "菜单名称")
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
@Schema(description = "上级id, 0是顶级")
|
||||||
|
private Integer parentId;
|
||||||
|
|
||||||
|
@Schema(description = "模型")
|
||||||
|
private String model;
|
||||||
|
|
||||||
|
@Schema(description = "模型名称")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String modelName;
|
||||||
|
|
||||||
|
@Schema(description = "标识")
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
@Schema(description = "菜单路由地址")
|
||||||
|
private String path;
|
||||||
|
|
||||||
|
@Schema(description = "菜单组件地址, 目录可为空")
|
||||||
|
private String component;
|
||||||
|
|
||||||
|
@Schema(description = "文件后缀")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String suffix;
|
||||||
|
|
||||||
|
@Schema(description = "打开位置")
|
||||||
|
private String target;
|
||||||
|
|
||||||
|
@Schema(description = "菜单图标")
|
||||||
|
private String icon;
|
||||||
|
|
||||||
|
@Schema(description = "banner")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String banner;
|
||||||
|
|
||||||
|
@Schema(description = "移动端banner")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String mpBanner;
|
||||||
|
|
||||||
|
@Schema(description = "图标颜色")
|
||||||
|
private String color;
|
||||||
|
|
||||||
|
@Schema(description = "是否隐藏, 0否, 1是(仅注册路由不显示在左侧菜单)")
|
||||||
|
private Integer hide;
|
||||||
|
|
||||||
|
@Schema(description = "可见类型 0所有人 1登录可见 2密码可见")
|
||||||
|
private Integer permission;
|
||||||
|
|
||||||
|
@Schema(description = "访问密码")
|
||||||
|
private String password;
|
||||||
|
|
||||||
|
@Schema(description = "验证密码(前端回传)")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String password2;
|
||||||
|
|
||||||
|
@Schema(description = "位置 0不限 1顶部 2底部")
|
||||||
|
private Integer position;
|
||||||
|
|
||||||
|
@Schema(description = "仅在顶部显示")
|
||||||
|
private Integer top;
|
||||||
|
|
||||||
|
@Schema(description = "仅在底部显示")
|
||||||
|
private Integer bottom;
|
||||||
|
|
||||||
|
@Schema(description = "菜单侧栏选中的path")
|
||||||
|
private String active;
|
||||||
|
|
||||||
|
@Schema(description = "其它路由元信息")
|
||||||
|
private String meta;
|
||||||
|
|
||||||
|
@Schema(description = "css样式")
|
||||||
|
private String style;
|
||||||
|
|
||||||
|
@Schema(description = "父级栏目路由")
|
||||||
|
private String parentPath;
|
||||||
|
|
||||||
|
@Schema(description = "父级栏目名称")
|
||||||
|
private String parentName;
|
||||||
|
|
||||||
|
@Schema(description = "父级栏目位置")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Integer parentPosition;
|
||||||
|
|
||||||
|
@Schema(description = "绑定的页面(已废弃)")
|
||||||
|
private Integer pageId;
|
||||||
|
|
||||||
|
@Schema(description = "详情页ID")
|
||||||
|
private Integer itemId;
|
||||||
|
|
||||||
|
@Schema(description = "是否微信小程序菜单")
|
||||||
|
private Boolean isMpWeixin;
|
||||||
|
|
||||||
|
@Schema(description = "菜单间距")
|
||||||
|
private Integer gutter;
|
||||||
|
|
||||||
|
@Schema(description = "菜单宽度")
|
||||||
|
private Integer span;
|
||||||
|
|
||||||
|
@Schema(description = "阅读量")
|
||||||
|
private Integer readNum;
|
||||||
|
|
||||||
|
@Schema(description = "用户ID")
|
||||||
|
private Integer userId;
|
||||||
|
|
||||||
|
@Schema(description = "商户ID")
|
||||||
|
private Long merchantId;
|
||||||
|
|
||||||
|
@Schema(description = "国际化语言")
|
||||||
|
private String lang;
|
||||||
|
|
||||||
|
@Schema(description = "用于同步翻译内容")
|
||||||
|
private Integer langCategoryId;
|
||||||
|
|
||||||
|
@Schema(description = "设为首页")
|
||||||
|
private Integer home;
|
||||||
|
|
||||||
|
@Schema(description = "是否推荐")
|
||||||
|
private Boolean recommend;
|
||||||
|
|
||||||
|
@Schema(description = "排序(数字越小越靠前)")
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
@Schema(description = "备注")
|
||||||
|
private String comments;
|
||||||
|
|
||||||
|
@Schema(description = "是否删除, 0否, 1是")
|
||||||
|
@TableLogic
|
||||||
|
private Integer deleted;
|
||||||
|
|
||||||
|
@Schema(description = "状态, 0正常, 1冻结")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@Schema(description = "租户id")
|
||||||
|
private Integer tenantId;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@JsonIgnore // 导航的创建时间前端不需要
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
|
||||||
|
@Schema(description = "页面名称")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String pageName;
|
||||||
|
|
||||||
|
@Schema(description = "子菜单")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private List<CmsNavigation> children;
|
||||||
|
|
||||||
|
@Schema(description = "页面布局")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String layout;
|
||||||
|
|
||||||
|
@Schema(description = "关联的页面")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private CmsDesign design;
|
||||||
|
|
||||||
|
@Schema(description = "所属模型")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private CmsModel modelInfo;
|
||||||
|
|
||||||
|
@Schema(description = "父级栏目")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private CmsNavigation parent;
|
||||||
|
|
||||||
|
@Schema(description = "当前栏目名称")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String categoryName;
|
||||||
|
|
||||||
|
@Schema(description = "当前栏目链接")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String categoryPath;
|
||||||
|
|
||||||
|
@Schema(description = "栏目图片")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String photo;
|
||||||
|
|
||||||
|
@Schema(description = "是否开启布局")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Boolean showLayout;
|
||||||
|
|
||||||
|
@Schema(description = "单页内容")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String content;
|
||||||
|
|
||||||
|
@Schema(description = "是否显示banner")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Boolean showBanner;
|
||||||
|
|
||||||
|
@Schema(description = "菜单标题")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String text;
|
||||||
|
|
||||||
|
public String getCategoryName() {
|
||||||
|
return this.title;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCategoryPath() {
|
||||||
|
return this.path;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getText() {
|
||||||
|
return this.title;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
266
src/main/java/com/gxwebsoft/cms/entity/CmsOrder.java
Normal file
266
src/main/java/com/gxwebsoft/cms/entity/CmsOrder.java
Normal file
@@ -0,0 +1,266 @@
|
|||||||
|
package com.gxwebsoft.cms.entity;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 网站订单
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2026-01-27 13:03:24
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Schema(name = "CmsOrder对象", description = "网站订单")
|
||||||
|
public class CmsOrder implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Schema(description = "id")
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@Schema(description = "订单类型,0售前咨询 1售后服务 2意见反馈")
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
@Schema(description = "订单标题")
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
@Schema(description = "公司/团队名称")
|
||||||
|
private String company;
|
||||||
|
|
||||||
|
@Schema(description = "订单内容")
|
||||||
|
private String content;
|
||||||
|
|
||||||
|
@Schema(description = "订单编号")
|
||||||
|
private String orderNo;
|
||||||
|
|
||||||
|
@Schema(description = "快递/自提")
|
||||||
|
private Integer deliveryType;
|
||||||
|
|
||||||
|
@Schema(description = "下单渠道,0网站 1微信小程序 2其他")
|
||||||
|
private Integer channel;
|
||||||
|
|
||||||
|
@Schema(description = "微信支付交易号号")
|
||||||
|
private String transactionId;
|
||||||
|
|
||||||
|
@Schema(description = "微信退款订单号")
|
||||||
|
private String refundOrder;
|
||||||
|
|
||||||
|
@Schema(description = "商户ID")
|
||||||
|
private Integer merchantId;
|
||||||
|
|
||||||
|
@Schema(description = "商户名称")
|
||||||
|
private String merchantName;
|
||||||
|
|
||||||
|
@Schema(description = "商户编号")
|
||||||
|
private String merchantCode;
|
||||||
|
|
||||||
|
@Schema(description = "使用的优惠券id")
|
||||||
|
private Integer couponId;
|
||||||
|
|
||||||
|
@Schema(description = "使用的会员卡id")
|
||||||
|
private String cardId;
|
||||||
|
|
||||||
|
@Schema(description = "关联管理员id")
|
||||||
|
private Integer adminId;
|
||||||
|
|
||||||
|
@Schema(description = "核销管理员id")
|
||||||
|
private Integer confirmId;
|
||||||
|
|
||||||
|
@Schema(description = "IC卡号")
|
||||||
|
private String icCard;
|
||||||
|
|
||||||
|
@Schema(description = "真实姓名")
|
||||||
|
private String realName;
|
||||||
|
|
||||||
|
@Schema(description = "关联收货地址")
|
||||||
|
private Integer addressId;
|
||||||
|
|
||||||
|
@Schema(description = "收货地址")
|
||||||
|
private String address;
|
||||||
|
|
||||||
|
private String addressLat;
|
||||||
|
|
||||||
|
private String addressLng;
|
||||||
|
|
||||||
|
@Schema(description = "自提店铺id")
|
||||||
|
private Integer selfTakeMerchantId;
|
||||||
|
|
||||||
|
@Schema(description = "自提店铺")
|
||||||
|
private String selfTakeMerchantName;
|
||||||
|
|
||||||
|
@Schema(description = "配送开始时间")
|
||||||
|
private String sendStartTime;
|
||||||
|
|
||||||
|
@Schema(description = "配送结束时间")
|
||||||
|
private String sendEndTime;
|
||||||
|
|
||||||
|
@Schema(description = "发货店铺id")
|
||||||
|
private Integer expressMerchantId;
|
||||||
|
|
||||||
|
@Schema(description = "发货店铺")
|
||||||
|
private String expressMerchantName;
|
||||||
|
|
||||||
|
@Schema(description = "订单总额")
|
||||||
|
private BigDecimal totalPrice;
|
||||||
|
|
||||||
|
@Schema(description = "减少的金额,使用VIP会员折扣、优惠券抵扣、优惠券折扣后减去的价格")
|
||||||
|
private BigDecimal reducePrice;
|
||||||
|
|
||||||
|
@Schema(description = "实际付款")
|
||||||
|
private BigDecimal payPrice;
|
||||||
|
|
||||||
|
@Schema(description = "用于统计")
|
||||||
|
private BigDecimal price;
|
||||||
|
|
||||||
|
@Schema(description = "价钱,用于积分赠送")
|
||||||
|
private BigDecimal money;
|
||||||
|
|
||||||
|
@Schema(description = "取消时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime cancelTime;
|
||||||
|
|
||||||
|
@Schema(description = "取消原因")
|
||||||
|
private String cancelReason;
|
||||||
|
|
||||||
|
@Schema(description = "退款金额")
|
||||||
|
private BigDecimal refundMoney;
|
||||||
|
|
||||||
|
@Schema(description = "教练价格")
|
||||||
|
private BigDecimal coachPrice;
|
||||||
|
|
||||||
|
@Schema(description = "购买数量")
|
||||||
|
private Integer totalNum;
|
||||||
|
|
||||||
|
@Schema(description = "教练id")
|
||||||
|
private Integer coachId;
|
||||||
|
|
||||||
|
@Schema(description = "商品ID")
|
||||||
|
private Integer formId;
|
||||||
|
|
||||||
|
@Schema(description = "支付的用户id")
|
||||||
|
private Integer payUserId;
|
||||||
|
|
||||||
|
@Schema(description = "0余额支付,1微信支付,2支付宝支付,3银联支付,4现金支付,5POS机支付,6免费,7积分支付")
|
||||||
|
private Integer payType;
|
||||||
|
|
||||||
|
@Schema(description = "微信支付子类型:JSAPI小程序支付,NATIVE扫码支付")
|
||||||
|
private String wechatPayType;
|
||||||
|
|
||||||
|
@Schema(description = "0余额支付,1微信支付,2支付宝支付,3银联支付,4现金支付,5POS机支付,6免费,7积分支付")
|
||||||
|
private Integer friendPayType;
|
||||||
|
|
||||||
|
@Schema(description = "0未付款,1已付款")
|
||||||
|
private Integer payStatus;
|
||||||
|
|
||||||
|
@Schema(description = "0未使用,1已完成,2已取消,3取消中,4退款申请中,5退款被拒绝,6退款成功,7客户端申请退款")
|
||||||
|
private Integer orderStatus;
|
||||||
|
|
||||||
|
@Schema(description = "发货状态(10未发货 20已发货 30部分发货)")
|
||||||
|
private Integer deliveryStatus;
|
||||||
|
|
||||||
|
@Schema(description = "无需发货备注")
|
||||||
|
private String deliveryNote;
|
||||||
|
|
||||||
|
@Schema(description = "发货时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime deliveryTime;
|
||||||
|
|
||||||
|
@Schema(description = "评价状态(0未评价 1已评价)")
|
||||||
|
private Integer evaluateStatus;
|
||||||
|
|
||||||
|
@Schema(description = "评价时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime evaluateTime;
|
||||||
|
|
||||||
|
@Schema(description = "优惠类型:0无、1抵扣优惠券、2折扣优惠券、3、VIP月卡、4VIP年卡,5VIP次卡、6VIP会员卡、7IC月卡、8IC年卡、9IC次卡、10IC会员卡、11免费订单、12VIP充值卡、13IC充值卡、14VIP季卡、15IC季卡")
|
||||||
|
private Integer couponType;
|
||||||
|
|
||||||
|
@Schema(description = "优惠说明")
|
||||||
|
private String couponDesc;
|
||||||
|
|
||||||
|
@Schema(description = "二维码地址,保存订单号,支付成功后才生成")
|
||||||
|
private String qrcode;
|
||||||
|
|
||||||
|
@Schema(description = "vip月卡年卡、ic月卡年卡回退次数")
|
||||||
|
private Integer returnNum;
|
||||||
|
|
||||||
|
@Schema(description = "vip充值回退金额")
|
||||||
|
private BigDecimal returnMoney;
|
||||||
|
|
||||||
|
@Schema(description = "预约详情开始时间数组")
|
||||||
|
private String startTime;
|
||||||
|
|
||||||
|
@Schema(description = "是否已开具发票:0未开发票,1已开发票,2不能开具发票")
|
||||||
|
private Integer isInvoice;
|
||||||
|
|
||||||
|
@Schema(description = "发票流水号")
|
||||||
|
private String invoiceNo;
|
||||||
|
|
||||||
|
@Schema(description = "商家留言")
|
||||||
|
private String merchantRemarks;
|
||||||
|
|
||||||
|
@Schema(description = "支付时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime payTime;
|
||||||
|
|
||||||
|
@Schema(description = "退款时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime refundTime;
|
||||||
|
|
||||||
|
@Schema(description = "申请退款时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime refundApplyTime;
|
||||||
|
|
||||||
|
@Schema(description = "过期时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime expirationTime;
|
||||||
|
|
||||||
|
@Schema(description = "自提码")
|
||||||
|
private String selfTakeCode;
|
||||||
|
|
||||||
|
@Schema(description = "是否已收到赠品")
|
||||||
|
private Boolean hasTakeGift;
|
||||||
|
|
||||||
|
@Schema(description = "对账情况:0=未对账;1=已对账;3=已对账,金额对不上;4=未查询到该订单")
|
||||||
|
private Integer checkBill;
|
||||||
|
|
||||||
|
@Schema(description = "订单是否已结算(0未结算 1已结算)")
|
||||||
|
private Integer isSettled;
|
||||||
|
|
||||||
|
@Schema(description = "系统版本号 0当前版本 value=其他版本")
|
||||||
|
private Integer version;
|
||||||
|
|
||||||
|
@Schema(description = "用户id")
|
||||||
|
private Integer userId;
|
||||||
|
|
||||||
|
@Schema(description = "备注")
|
||||||
|
private String comments;
|
||||||
|
|
||||||
|
@Schema(description = "排序号")
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
@Schema(description = "是否删除, 0否, 1是")
|
||||||
|
@TableLogic
|
||||||
|
private Integer deleted;
|
||||||
|
|
||||||
|
@Schema(description = "租户id")
|
||||||
|
private Integer tenantId;
|
||||||
|
|
||||||
|
@Schema(description = "修改时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime updateTime;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
}
|
||||||
126
src/main/java/com/gxwebsoft/cms/entity/CmsStatistics.java
Normal file
126
src/main/java/com/gxwebsoft/cms/entity/CmsStatistics.java
Normal file
@@ -0,0 +1,126 @@
|
|||||||
|
package com.gxwebsoft.cms.entity;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 站点统计信息表
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2025-07-25 12:32:06
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Schema(name = "CmsStatistics对象", description = "站点统计信息表")
|
||||||
|
public class CmsStatistics implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Schema(description = "自增ID")
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@Schema(description = "站点ID")
|
||||||
|
private Integer websiteId;
|
||||||
|
|
||||||
|
@Schema(description = "用户总数")
|
||||||
|
private Integer userCount;
|
||||||
|
|
||||||
|
@Schema(description = "订单总数")
|
||||||
|
private Integer orderCount;
|
||||||
|
|
||||||
|
@Schema(description = "商品总数")
|
||||||
|
private Integer productCount;
|
||||||
|
|
||||||
|
@Schema(description = "总销售额")
|
||||||
|
private BigDecimal totalSales;
|
||||||
|
|
||||||
|
@Schema(description = "本月销售额")
|
||||||
|
private BigDecimal monthSales;
|
||||||
|
|
||||||
|
@Schema(description = "今日销售额")
|
||||||
|
private BigDecimal todaySales;
|
||||||
|
|
||||||
|
@Schema(description = "昨日销售额")
|
||||||
|
private BigDecimal yesterdaySales;
|
||||||
|
|
||||||
|
@Schema(description = "本周销售额")
|
||||||
|
private BigDecimal weekSales;
|
||||||
|
|
||||||
|
@Schema(description = "本年销售额")
|
||||||
|
private BigDecimal yearSales;
|
||||||
|
|
||||||
|
@Schema(description = "今日订单数")
|
||||||
|
private Integer todayOrders;
|
||||||
|
|
||||||
|
@Schema(description = "本月订单数")
|
||||||
|
private Integer monthOrders;
|
||||||
|
|
||||||
|
@Schema(description = "今日新增用户")
|
||||||
|
private Integer todayUsers;
|
||||||
|
|
||||||
|
@Schema(description = "本月新增用户")
|
||||||
|
private Integer monthUsers;
|
||||||
|
|
||||||
|
@Schema(description = "今日访问量")
|
||||||
|
private Integer todayVisits;
|
||||||
|
|
||||||
|
@Schema(description = "总访问量")
|
||||||
|
private Integer totalVisits;
|
||||||
|
|
||||||
|
@Schema(description = "商户总数")
|
||||||
|
private Integer merchantCount;
|
||||||
|
|
||||||
|
@Schema(description = "活跃用户数")
|
||||||
|
private Integer activeUsers;
|
||||||
|
|
||||||
|
@Schema(description = "转化率(%)")
|
||||||
|
private BigDecimal conversionRate;
|
||||||
|
|
||||||
|
@Schema(description = "平均订单金额")
|
||||||
|
private BigDecimal avgOrderAmount;
|
||||||
|
|
||||||
|
@Schema(description = "统计日期")
|
||||||
|
private LocalDate statisticsDate;
|
||||||
|
|
||||||
|
@Schema(description = "统计类型: 1日统计, 2月统计, 3年统计")
|
||||||
|
private Integer statisticsType;
|
||||||
|
|
||||||
|
@Schema(description = "排序号")
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
@Schema(description = "操作用户ID")
|
||||||
|
private Integer userId;
|
||||||
|
|
||||||
|
@Schema(description = "商户ID")
|
||||||
|
private Integer merchantId;
|
||||||
|
|
||||||
|
@Schema(description = "状态: 0禁用, 1启用")
|
||||||
|
private Boolean status;
|
||||||
|
|
||||||
|
@Schema(description = "是否删除: 0否, 1是")
|
||||||
|
@TableLogic
|
||||||
|
private Boolean deleted;
|
||||||
|
|
||||||
|
@Schema(description = "租户ID")
|
||||||
|
private Integer tenantId;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
@Schema(description = "修改时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime updateTime;
|
||||||
|
|
||||||
|
}
|
||||||
98
src/main/java/com/gxwebsoft/cms/entity/CmsTemplate.java
Normal file
98
src/main/java/com/gxwebsoft/cms/entity/CmsTemplate.java
Normal file
@@ -0,0 +1,98 @@
|
|||||||
|
package com.gxwebsoft.cms.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 网站模版
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2025-01-21 14:21:16
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Schema(name = "CmsTemplate对象", description = "网站模版")
|
||||||
|
public class CmsTemplate implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Schema(description = "ID")
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@Schema(description = "模版名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "模版标识")
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
@Schema(description = "缩列图")
|
||||||
|
private String image;
|
||||||
|
|
||||||
|
@Schema(description = "类型 1企业官网 2其他")
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
@Schema(description = "网站关键词")
|
||||||
|
private String keywords;
|
||||||
|
|
||||||
|
@Schema(description = "域名前缀")
|
||||||
|
private String prefix;
|
||||||
|
|
||||||
|
@Schema(description = "预览地址")
|
||||||
|
private String domain;
|
||||||
|
|
||||||
|
@Schema(description = "模版下载地址")
|
||||||
|
private String downUrl;
|
||||||
|
|
||||||
|
@Schema(description = "色系")
|
||||||
|
private String color;
|
||||||
|
|
||||||
|
@Schema(description = "应用版本 10免费版 20授权版 30永久授权")
|
||||||
|
private Integer version;
|
||||||
|
|
||||||
|
@Schema(description = "行业类型(父级)")
|
||||||
|
private String industryParent;
|
||||||
|
|
||||||
|
@Schema(description = "行业类型(子级)")
|
||||||
|
private String industryChild;
|
||||||
|
|
||||||
|
@Schema(description = "备注")
|
||||||
|
private String comments;
|
||||||
|
|
||||||
|
@Schema(description = "是否推荐")
|
||||||
|
private Boolean recommend;
|
||||||
|
|
||||||
|
@Schema(description = "是否共享模板")
|
||||||
|
private Boolean share;
|
||||||
|
|
||||||
|
@Schema(description = "排序号")
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
@Schema(description = "用户ID")
|
||||||
|
private Integer userId;
|
||||||
|
|
||||||
|
@Schema(description = "是否删除, 0否, 1是")
|
||||||
|
@TableLogic
|
||||||
|
private Integer deleted;
|
||||||
|
|
||||||
|
@Schema(description = "租户id")
|
||||||
|
private Integer tenantId;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
@Schema(description = "修改时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime updateTime;
|
||||||
|
|
||||||
|
}
|
||||||
327
src/main/java/com/gxwebsoft/cms/entity/CmsWebsite.java
Normal file
327
src/main/java/com/gxwebsoft/cms/entity/CmsWebsite.java
Normal file
@@ -0,0 +1,327 @@
|
|||||||
|
package com.gxwebsoft.cms.entity;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.DesensitizedUtil;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 网站信息记录表
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-10 20:36:14
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Schema(name = "CmsWebsite对象", description = "网站信息记录表")
|
||||||
|
public class CmsWebsite implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Schema(description = "站点ID")
|
||||||
|
@TableId(value = "website_id", type = IdType.AUTO)
|
||||||
|
private Integer websiteId;
|
||||||
|
|
||||||
|
@Schema(description = "网站名称")
|
||||||
|
private String websiteName;
|
||||||
|
|
||||||
|
@Schema(description = "网站标识")
|
||||||
|
private String websiteCode;
|
||||||
|
|
||||||
|
@Schema(description = "网站密钥")
|
||||||
|
private String websiteSecret;
|
||||||
|
|
||||||
|
@Schema(description = "网站LOGO")
|
||||||
|
private String websiteIcon;
|
||||||
|
|
||||||
|
@Schema(description = "网站LOGO")
|
||||||
|
private String websiteLogo;
|
||||||
|
|
||||||
|
@Schema(description = "网站LOGO(深色模式)")
|
||||||
|
private String websiteDarkLogo;
|
||||||
|
|
||||||
|
@Schema(description = "网站类型")
|
||||||
|
private String websiteType;
|
||||||
|
|
||||||
|
@Schema(description = "栏目ID")
|
||||||
|
private Integer categoryId;
|
||||||
|
|
||||||
|
@Schema(description = "应用ID")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Integer appId;
|
||||||
|
|
||||||
|
@Schema(description = "网站截图")
|
||||||
|
private String files;
|
||||||
|
|
||||||
|
@Schema(description = "网站类型 10企业官网 20微信小程序 30APP 40其他")
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
@Schema(description = "网站关键词")
|
||||||
|
private String keywords;
|
||||||
|
|
||||||
|
@Schema(description = "域名前缀")
|
||||||
|
private String prefix;
|
||||||
|
|
||||||
|
@Schema(description = "绑定域名")
|
||||||
|
private String domain;
|
||||||
|
|
||||||
|
@Schema(description = "全局样式")
|
||||||
|
private String style;
|
||||||
|
|
||||||
|
@Schema(description = "后台管理地址")
|
||||||
|
private String adminUrl;
|
||||||
|
|
||||||
|
@Schema(description = "自定义API接口")
|
||||||
|
private String apiUrl;
|
||||||
|
|
||||||
|
@Schema(description = "应用版本 10免费版 20授权版 30永久授权")
|
||||||
|
private Integer version;
|
||||||
|
|
||||||
|
@Schema(description = "服务到期时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date expirationTime;
|
||||||
|
|
||||||
|
@Schema(description = "是否到期")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Integer expired;
|
||||||
|
|
||||||
|
@Schema(description = "剩余天数")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Long expiredDays;
|
||||||
|
|
||||||
|
@Schema(description = "服务器ID")
|
||||||
|
private Integer assetsId;
|
||||||
|
|
||||||
|
@Schema(description = "服务器ID")
|
||||||
|
private String assetsName;
|
||||||
|
|
||||||
|
@Schema(description = "模版ID(存克隆的租户UID)")
|
||||||
|
private Integer templateId;
|
||||||
|
|
||||||
|
@Schema(description = "模版名称")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String templateName;
|
||||||
|
|
||||||
|
@Schema(description = "行业类型(父级)")
|
||||||
|
private String industryParent;
|
||||||
|
|
||||||
|
@Schema(description = "行业类型(子级)")
|
||||||
|
private String industryChild;
|
||||||
|
|
||||||
|
@Schema(description = "企业ID")
|
||||||
|
private Integer companyId;
|
||||||
|
|
||||||
|
@Schema(description = "开发者名称")
|
||||||
|
private String developer;
|
||||||
|
|
||||||
|
@Schema(description = "所在国家")
|
||||||
|
private String country;
|
||||||
|
|
||||||
|
@Schema(description = "所在省份")
|
||||||
|
private String province;
|
||||||
|
|
||||||
|
@Schema(description = "所在城市")
|
||||||
|
private String city;
|
||||||
|
|
||||||
|
@Schema(description = "所在辖区")
|
||||||
|
private String region;
|
||||||
|
|
||||||
|
@Schema(description = "经度")
|
||||||
|
private String longitude;
|
||||||
|
|
||||||
|
@Schema(description = "纬度")
|
||||||
|
private String latitude;
|
||||||
|
|
||||||
|
@Schema(description = "街道地址")
|
||||||
|
private String address;
|
||||||
|
|
||||||
|
@Schema(description = "联系电话")
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
@Schema(description = "电子邮箱")
|
||||||
|
private String email;
|
||||||
|
|
||||||
|
@Schema(description = "ICP备案号")
|
||||||
|
private String icpNo;
|
||||||
|
|
||||||
|
@Schema(description = "公安备案")
|
||||||
|
private String policeNo;
|
||||||
|
|
||||||
|
@Schema(description = "网站描述")
|
||||||
|
private String content;
|
||||||
|
|
||||||
|
@Schema(description = "备注")
|
||||||
|
private String comments;
|
||||||
|
|
||||||
|
@Schema(description = "管理员备注")
|
||||||
|
private String remarks;
|
||||||
|
|
||||||
|
@Schema(description = "是否推荐")
|
||||||
|
private Integer recommend;
|
||||||
|
|
||||||
|
@Schema(description = "是否官方产品")
|
||||||
|
private Boolean official;
|
||||||
|
|
||||||
|
@Schema(description = "允许展示到插件市场")
|
||||||
|
private Boolean market;
|
||||||
|
|
||||||
|
@Schema(description = "是否插件类型 0应用 1插件")
|
||||||
|
private Boolean plugin;
|
||||||
|
|
||||||
|
@Schema(description = "允许被搜索")
|
||||||
|
private Boolean search;
|
||||||
|
|
||||||
|
@Schema(description = "主题色")
|
||||||
|
private String color;
|
||||||
|
|
||||||
|
@Schema(description = "运行状态 0运行中 1已关闭 2维护中")
|
||||||
|
private Integer running;
|
||||||
|
|
||||||
|
@Schema(description = "即将过期")
|
||||||
|
private Integer soon;
|
||||||
|
|
||||||
|
@Schema(description = "评分")
|
||||||
|
private BigDecimal rate;
|
||||||
|
|
||||||
|
@Schema(description = "点赞数量")
|
||||||
|
private Integer likes;
|
||||||
|
|
||||||
|
@Schema(description = "点击数量")
|
||||||
|
private Integer clicks;
|
||||||
|
|
||||||
|
@Schema(description = "购买数量")
|
||||||
|
private Integer buys;
|
||||||
|
|
||||||
|
@Schema(description = "下载数量")
|
||||||
|
private Integer downloads;
|
||||||
|
|
||||||
|
@Schema(description = "销售价格")
|
||||||
|
private BigDecimal price;
|
||||||
|
|
||||||
|
@Schema(description = "交付方式")
|
||||||
|
private Integer deliveryMethod;
|
||||||
|
|
||||||
|
@Schema(description = "计费方式")
|
||||||
|
private Integer chargingMethod;
|
||||||
|
|
||||||
|
@Schema(description = "状态 0未开通 1运行中 2维护中 3已关闭 4已欠费停机 5违规关停")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@Schema(description = "状态图标")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String statusIcon;
|
||||||
|
|
||||||
|
@Schema(description = "维护说明")
|
||||||
|
private String statusText;
|
||||||
|
|
||||||
|
@Schema(description = "关闭说明")
|
||||||
|
private String statusClose;
|
||||||
|
|
||||||
|
@Schema(description = "全局样式")
|
||||||
|
private String styles;
|
||||||
|
|
||||||
|
@Schema(description = "排序号")
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
@Schema(description = "用户ID")
|
||||||
|
private Integer userId;
|
||||||
|
|
||||||
|
@Schema(description = "商户ID")
|
||||||
|
private Long merchantId;
|
||||||
|
|
||||||
|
@Schema(description = "是否删除, 0否, 1是")
|
||||||
|
@TableLogic
|
||||||
|
private Integer deleted;
|
||||||
|
|
||||||
|
@Schema(description = "租户id")
|
||||||
|
private Integer tenantId;
|
||||||
|
|
||||||
|
@Schema(description = "租户名称")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String tenantName;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
@Schema(description = "修改时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
@Schema(description = "预设字段")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private List<CmsWebsiteField> fields;
|
||||||
|
|
||||||
|
@Schema(description = "小程序导航图标")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Map<String, List<CmsNavigation>> mpMenus;
|
||||||
|
|
||||||
|
@Schema(description = "网站导航栏")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private List<CmsNavigation> navigations;
|
||||||
|
|
||||||
|
@Schema(description = "顶部菜单")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private List<CmsNavigation> topNavs;
|
||||||
|
|
||||||
|
@Schema(description = "底部菜单")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private List<CmsNavigation> bottomNavs;
|
||||||
|
|
||||||
|
@Schema(description = "幻灯片广告")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private CmsAd slide;
|
||||||
|
|
||||||
|
@Schema(description = "站点广告")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private List<CmsAd> ads;
|
||||||
|
|
||||||
|
@Schema(description = "首页布局")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String layout;
|
||||||
|
|
||||||
|
@Schema(description = "友情链接")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private List<CmsLink> links;
|
||||||
|
|
||||||
|
@Schema(description = "配置信息")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Object config;
|
||||||
|
|
||||||
|
@Schema(description = "服务器时间")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private HashMap<String, Object> serverTime;
|
||||||
|
|
||||||
|
@Schema(description = "当前登录用户")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private User loginUser;
|
||||||
|
|
||||||
|
@Schema(description = "超管账号")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String superAdminPhone;
|
||||||
|
|
||||||
|
@Schema(description = "是否登录")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Boolean isLogin;
|
||||||
|
|
||||||
|
@Schema(description = "网站设置")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private CmsWebsiteSetting setting;
|
||||||
|
|
||||||
|
public String getPhone(){
|
||||||
|
return DesensitizedUtil.mobilePhone(this.phone);
|
||||||
|
}
|
||||||
|
}
|
||||||
75
src/main/java/com/gxwebsoft/cms/entity/CmsWebsiteField.java
Normal file
75
src/main/java/com/gxwebsoft/cms/entity/CmsWebsiteField.java
Normal file
@@ -0,0 +1,75 @@
|
|||||||
|
package com.gxwebsoft.cms.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 应用参数
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-10 20:36:14
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Schema(name = "CmsWebsiteField对象", description = "应用参数")
|
||||||
|
public class CmsWebsiteField implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Schema(description = "自增ID")
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@Schema(description = "类型,0文本 1图片 2其他")
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
@Schema(description = "名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "默认值")
|
||||||
|
private String defaultValue;
|
||||||
|
|
||||||
|
@Schema(description = "可修改的值 [on|off]")
|
||||||
|
private String modifyRange;
|
||||||
|
|
||||||
|
@Schema(description = "备注")
|
||||||
|
private String comments;
|
||||||
|
|
||||||
|
@Schema(description = "css样式")
|
||||||
|
private String style;
|
||||||
|
|
||||||
|
@Schema(description = "名称")
|
||||||
|
private String value;
|
||||||
|
|
||||||
|
@Schema(description = "国际化语言")
|
||||||
|
private String lang;
|
||||||
|
|
||||||
|
@Schema(description = "是否加密")
|
||||||
|
private Boolean encrypted;
|
||||||
|
|
||||||
|
@Schema(description = "商户ID")
|
||||||
|
private Long merchantId;
|
||||||
|
|
||||||
|
@Schema(description = "排序(数字越小越靠前)")
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
@Schema(description = "是否删除, 0否, 1是")
|
||||||
|
@TableLogic
|
||||||
|
private Integer deleted;
|
||||||
|
|
||||||
|
@Schema(description = "租户id")
|
||||||
|
private Integer tenantId;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,89 @@
|
|||||||
|
package com.gxwebsoft.cms.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 网站设置
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2025-02-19 01:35:44
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Schema(name = "CmsWebsiteSetting对象", description = "网站设置")
|
||||||
|
public class CmsWebsiteSetting implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Schema(description = "自增ID")
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@Schema(description = "关联网站ID")
|
||||||
|
private Integer websiteId;
|
||||||
|
|
||||||
|
@Schema(description = "是否官方插件")
|
||||||
|
private Boolean official;
|
||||||
|
|
||||||
|
@Schema(description = "是否展示在插件市场")
|
||||||
|
private Boolean market;
|
||||||
|
|
||||||
|
@Schema(description = "是否允许被搜索")
|
||||||
|
private Boolean search;
|
||||||
|
|
||||||
|
@Schema(description = "是否共享")
|
||||||
|
private Boolean share;
|
||||||
|
|
||||||
|
@Schema(description = "文章是否需要审核")
|
||||||
|
private Boolean articleReview;
|
||||||
|
|
||||||
|
@Schema(description = "是否插件 0应用1 插件 ")
|
||||||
|
private Boolean plugin;
|
||||||
|
|
||||||
|
@Schema(description = "编辑器类型 1 富文本编辑器 2 Markdown编辑器")
|
||||||
|
private Integer editor;
|
||||||
|
|
||||||
|
@Schema(description = "显示站内搜索")
|
||||||
|
private Boolean searchBtn;
|
||||||
|
|
||||||
|
@Schema(description = "显示登录注册功能")
|
||||||
|
private Boolean loginBtn;
|
||||||
|
|
||||||
|
@Schema(description = "显示悬浮客服工具")
|
||||||
|
private Boolean floatTool;
|
||||||
|
|
||||||
|
@Schema(description = "显示版权链接")
|
||||||
|
private Boolean copyrightLink;
|
||||||
|
|
||||||
|
@Schema(description = "导航栏最多显示数量")
|
||||||
|
private Boolean maxMenuNum;
|
||||||
|
|
||||||
|
@Schema(description = "排序号")
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
@Schema(description = "是否删除, 0否, 1是")
|
||||||
|
@TableLogic
|
||||||
|
private Integer deleted;
|
||||||
|
|
||||||
|
@Schema(description = "租户id")
|
||||||
|
private Integer tenantId;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
@Schema(description = "修改时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
}
|
||||||
43
src/main/java/com/gxwebsoft/cms/entity/TranslateDataVo.java
Normal file
43
src/main/java/com/gxwebsoft/cms/entity/TranslateDataVo.java
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
package com.gxwebsoft.cms.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Schema(name = "翻译结果", description = "翻译结果")
|
||||||
|
public class TranslateDataVo implements Serializable {
|
||||||
|
|
||||||
|
@Schema(description = "文本格式")
|
||||||
|
private String FormatType;
|
||||||
|
|
||||||
|
@Schema(description = "原文语言")
|
||||||
|
private String SourceLanguage;
|
||||||
|
|
||||||
|
@Schema(description = "译文语言")
|
||||||
|
private String TargetLanguage;
|
||||||
|
|
||||||
|
@Schema(description = "待翻译内容")
|
||||||
|
private String SourceText;
|
||||||
|
|
||||||
|
@Schema(description = "场景可选取值:商品标题(title),商品描述(description),商品沟通(communication),医疗(medical),社交(social),金融(finance)")
|
||||||
|
private String Scene;
|
||||||
|
|
||||||
|
@Schema(description = "上下文信息")
|
||||||
|
private String Context;
|
||||||
|
|
||||||
|
@Schema(description = "翻译结果")
|
||||||
|
private String translated;
|
||||||
|
|
||||||
|
@Schema(description = "总单词数")
|
||||||
|
private String wordCount;
|
||||||
|
|
||||||
|
@Schema(description = "源语言传入 auto 时,语种识别后的源语言代码")
|
||||||
|
private String detectedLanguage;
|
||||||
|
|
||||||
|
}
|
||||||
30
src/main/java/com/gxwebsoft/cms/entity/TranslateVo.java
Normal file
30
src/main/java/com/gxwebsoft/cms/entity/TranslateVo.java
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
package com.gxwebsoft.cms.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Schema(name = "阿里云机器翻译", description = "阿里云机器翻译")
|
||||||
|
public class TranslateVo implements Serializable {
|
||||||
|
|
||||||
|
@Schema(description = "错误码")
|
||||||
|
private String Code;
|
||||||
|
|
||||||
|
@Schema(description = "错误信息")
|
||||||
|
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||||
|
private String Message;
|
||||||
|
|
||||||
|
@Schema(description = "请求ID")
|
||||||
|
private String RequestId;
|
||||||
|
|
||||||
|
@Schema(description = "返回数据")
|
||||||
|
private TranslateDataVo Data;
|
||||||
|
|
||||||
|
}
|
||||||
42
src/main/java/com/gxwebsoft/cms/mapper/CmsAdMapper.java
Normal file
42
src/main/java/com/gxwebsoft/cms/mapper/CmsAdMapper.java
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
package com.gxwebsoft.cms.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsAd;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsLangLog;
|
||||||
|
import com.gxwebsoft.cms.param.CmsAdParam;
|
||||||
|
import com.gxwebsoft.cms.param.CmsLangLogParam;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 广告位Mapper
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-10 20:47:57
|
||||||
|
*/
|
||||||
|
public interface CmsAdMapper extends BaseMapper<CmsAd> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*
|
||||||
|
* @param page 分页对象
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<CmsAd>
|
||||||
|
*/
|
||||||
|
List<CmsAd> selectPageRel(@Param("page") IPage<CmsAd> page,
|
||||||
|
@Param("param") CmsAdParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<User>
|
||||||
|
*/
|
||||||
|
List<CmsAd> selectListRel(@Param("param") CmsAdParam param);
|
||||||
|
|
||||||
|
@InterceptorIgnore(tenantLine = "true")
|
||||||
|
List<CmsAd> selectListAllRel(@Param("param") CmsAdParam param);
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package com.gxwebsoft.cms.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsAdRecord;
|
||||||
|
import com.gxwebsoft.cms.param.CmsAdRecordParam;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 广告图片Mapper
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-10 20:47:57
|
||||||
|
*/
|
||||||
|
public interface CmsAdRecordMapper extends BaseMapper<CmsAdRecord> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*
|
||||||
|
* @param page 分页对象
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<CmsAdRecord>
|
||||||
|
*/
|
||||||
|
List<CmsAdRecord> selectPageRel(@Param("page") IPage<CmsAdRecord> page,
|
||||||
|
@Param("param") CmsAdRecordParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<User>
|
||||||
|
*/
|
||||||
|
List<CmsAdRecord> selectListRel(@Param("param") CmsAdRecordParam param);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package com.gxwebsoft.cms.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsArticleCategory;
|
||||||
|
import com.gxwebsoft.cms.param.CmsArticleCategoryParam;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文章分类表Mapper
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-10 20:47:57
|
||||||
|
*/
|
||||||
|
public interface CmsArticleCategoryMapper extends BaseMapper<CmsArticleCategory> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*
|
||||||
|
* @param page 分页对象
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<CmsArticleCategory>
|
||||||
|
*/
|
||||||
|
List<CmsArticleCategory> selectPageRel(@Param("page") IPage<CmsArticleCategory> page,
|
||||||
|
@Param("param") CmsArticleCategoryParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<User>
|
||||||
|
*/
|
||||||
|
List<CmsArticleCategory> selectListRel(@Param("param") CmsArticleCategoryParam param);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package com.gxwebsoft.cms.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsArticleComment;
|
||||||
|
import com.gxwebsoft.cms.param.CmsArticleCommentParam;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文章评论表Mapper
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-10 20:47:57
|
||||||
|
*/
|
||||||
|
public interface CmsArticleCommentMapper extends BaseMapper<CmsArticleComment> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*
|
||||||
|
* @param page 分页对象
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<CmsArticleComment>
|
||||||
|
*/
|
||||||
|
List<CmsArticleComment> selectPageRel(@Param("page") IPage<CmsArticleComment> page,
|
||||||
|
@Param("param") CmsArticleCommentParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<User>
|
||||||
|
*/
|
||||||
|
List<CmsArticleComment> selectListRel(@Param("param") CmsArticleCommentParam param);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package com.gxwebsoft.cms.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsArticleContent;
|
||||||
|
import com.gxwebsoft.cms.param.CmsArticleContentParam;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文章记录表Mapper
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-10 20:47:57
|
||||||
|
*/
|
||||||
|
public interface CmsArticleContentMapper extends BaseMapper<CmsArticleContent> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*
|
||||||
|
* @param page 分页对象
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<CmsArticleContent>
|
||||||
|
*/
|
||||||
|
List<CmsArticleContent> selectPageRel(@Param("page") IPage<CmsArticleContent> page,
|
||||||
|
@Param("param") CmsArticleContentParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<User>
|
||||||
|
*/
|
||||||
|
List<CmsArticleContent> selectListRel(@Param("param") CmsArticleContentParam param);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package com.gxwebsoft.cms.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsArticleCount;
|
||||||
|
import com.gxwebsoft.cms.param.CmsArticleCountParam;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 点赞文章Mapper
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-10 20:47:57
|
||||||
|
*/
|
||||||
|
public interface CmsArticleCountMapper extends BaseMapper<CmsArticleCount> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*
|
||||||
|
* @param page 分页对象
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<CmsArticleCount>
|
||||||
|
*/
|
||||||
|
List<CmsArticleCount> selectPageRel(@Param("page") IPage<CmsArticleCount> page,
|
||||||
|
@Param("param") CmsArticleCountParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<User>
|
||||||
|
*/
|
||||||
|
List<CmsArticleCount> selectListRel(@Param("param") CmsArticleCountParam param);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package com.gxwebsoft.cms.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsArticleLike;
|
||||||
|
import com.gxwebsoft.cms.param.CmsArticleLikeParam;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 点赞文章Mapper
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-10 20:47:57
|
||||||
|
*/
|
||||||
|
public interface CmsArticleLikeMapper extends BaseMapper<CmsArticleLike> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*
|
||||||
|
* @param page 分页对象
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<CmsArticleLike>
|
||||||
|
*/
|
||||||
|
List<CmsArticleLike> selectPageRel(@Param("page") IPage<CmsArticleLike> page,
|
||||||
|
@Param("param") CmsArticleLikeParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<User>
|
||||||
|
*/
|
||||||
|
List<CmsArticleLike> selectListRel(@Param("param") CmsArticleLikeParam param);
|
||||||
|
|
||||||
|
}
|
||||||
43
src/main/java/com/gxwebsoft/cms/mapper/CmsArticleMapper.java
Normal file
43
src/main/java/com/gxwebsoft/cms/mapper/CmsArticleMapper.java
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
package com.gxwebsoft.cms.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsArticle;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsLangLog;
|
||||||
|
import com.gxwebsoft.cms.param.CmsArticleParam;
|
||||||
|
import com.gxwebsoft.cms.param.CmsLangLogParam;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文章Mapper
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-10 20:47:57
|
||||||
|
*/
|
||||||
|
public interface CmsArticleMapper extends BaseMapper<CmsArticle> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*
|
||||||
|
* @param page 分页对象
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<CmsArticle>
|
||||||
|
*/
|
||||||
|
List<CmsArticle> selectPageRel(@Param("page") IPage<CmsArticle> page,
|
||||||
|
@Param("param") CmsArticleParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<User>
|
||||||
|
*/
|
||||||
|
List<CmsArticle> selectListRel(@Param("param") CmsArticleParam param);
|
||||||
|
|
||||||
|
|
||||||
|
@InterceptorIgnore(tenantLine = "true")
|
||||||
|
List<CmsArticle> selectListAllRel(@Param("param") CmsArticleParam param);
|
||||||
|
}
|
||||||
37
src/main/java/com/gxwebsoft/cms/mapper/CmsDesignMapper.java
Normal file
37
src/main/java/com/gxwebsoft/cms/mapper/CmsDesignMapper.java
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
package com.gxwebsoft.cms.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsDesign;
|
||||||
|
import com.gxwebsoft.cms.param.CmsDesignParam;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面管理记录表Mapper
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-10 20:47:57
|
||||||
|
*/
|
||||||
|
public interface CmsDesignMapper extends BaseMapper<CmsDesign> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*
|
||||||
|
* @param page 分页对象
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<CmsDesign>
|
||||||
|
*/
|
||||||
|
List<CmsDesign> selectPageRel(@Param("page") IPage<CmsDesign> page,
|
||||||
|
@Param("param") CmsDesignParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<User>
|
||||||
|
*/
|
||||||
|
List<CmsDesign> selectListRel(@Param("param") CmsDesignParam param);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package com.gxwebsoft.cms.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsDesignRecord;
|
||||||
|
import com.gxwebsoft.cms.param.CmsDesignRecordParam;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面组件表Mapper
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-10 20:47:57
|
||||||
|
*/
|
||||||
|
public interface CmsDesignRecordMapper extends BaseMapper<CmsDesignRecord> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*
|
||||||
|
* @param page 分页对象
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<CmsDesignRecord>
|
||||||
|
*/
|
||||||
|
List<CmsDesignRecord> selectPageRel(@Param("page") IPage<CmsDesignRecord> page,
|
||||||
|
@Param("param") CmsDesignRecordParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<User>
|
||||||
|
*/
|
||||||
|
List<CmsDesignRecord> selectListRel(@Param("param") CmsDesignRecordParam param);
|
||||||
|
|
||||||
|
}
|
||||||
40
src/main/java/com/gxwebsoft/cms/mapper/CmsDomainMapper.java
Normal file
40
src/main/java/com/gxwebsoft/cms/mapper/CmsDomainMapper.java
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
package com.gxwebsoft.cms.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsDomain;
|
||||||
|
import com.gxwebsoft.cms.param.CmsDomainParam;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 网站域名记录表Mapper
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-10 20:36:14
|
||||||
|
*/
|
||||||
|
public interface CmsDomainMapper extends BaseMapper<CmsDomain> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*
|
||||||
|
* @param page 分页对象
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<CmsDomain>
|
||||||
|
*/
|
||||||
|
List<CmsDomain> selectPageRel(@Param("page") IPage<CmsDomain> page,
|
||||||
|
@Param("param") CmsDomainParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<User>
|
||||||
|
*/
|
||||||
|
List<CmsDomain> selectListRel(@Param("param") CmsDomainParam param);
|
||||||
|
|
||||||
|
@InterceptorIgnore(tenantLine = "true")
|
||||||
|
CmsDomain getDomain(@Param("domain") String domain);
|
||||||
|
}
|
||||||
37
src/main/java/com/gxwebsoft/cms/mapper/CmsFormMapper.java
Normal file
37
src/main/java/com/gxwebsoft/cms/mapper/CmsFormMapper.java
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
package com.gxwebsoft.cms.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsForm;
|
||||||
|
import com.gxwebsoft.cms.param.CmsFormParam;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 表单设计表Mapper
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-10 20:47:57
|
||||||
|
*/
|
||||||
|
public interface CmsFormMapper extends BaseMapper<CmsForm> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*
|
||||||
|
* @param page 分页对象
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<CmsForm>
|
||||||
|
*/
|
||||||
|
List<CmsForm> selectPageRel(@Param("page") IPage<CmsForm> page,
|
||||||
|
@Param("param") CmsFormParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<User>
|
||||||
|
*/
|
||||||
|
List<CmsForm> selectListRel(@Param("param") CmsFormParam param);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package com.gxwebsoft.cms.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsFormRecord;
|
||||||
|
import com.gxwebsoft.cms.param.CmsFormRecordParam;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 表单数据记录表Mapper
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-10 20:47:57
|
||||||
|
*/
|
||||||
|
public interface CmsFormRecordMapper extends BaseMapper<CmsFormRecord> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*
|
||||||
|
* @param page 分页对象
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<CmsFormRecord>
|
||||||
|
*/
|
||||||
|
List<CmsFormRecord> selectPageRel(@Param("page") IPage<CmsFormRecord> page,
|
||||||
|
@Param("param") CmsFormRecordParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<User>
|
||||||
|
*/
|
||||||
|
List<CmsFormRecord> selectListRel(@Param("param") CmsFormRecordParam param);
|
||||||
|
|
||||||
|
}
|
||||||
41
src/main/java/com/gxwebsoft/cms/mapper/CmsLangLogMapper.java
Normal file
41
src/main/java/com/gxwebsoft/cms/mapper/CmsLangLogMapper.java
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
package com.gxwebsoft.cms.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsLangLog;
|
||||||
|
import com.gxwebsoft.cms.param.CmsLangLogParam;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 国际化记录启用Mapper
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2025-01-06 19:29:26
|
||||||
|
*/
|
||||||
|
public interface CmsLangLogMapper extends BaseMapper<CmsLangLog> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*
|
||||||
|
* @param page 分页对象
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<CmsLangLog>
|
||||||
|
*/
|
||||||
|
List<CmsLangLog> selectPageRel(@Param("page") IPage<CmsLangLog> page,
|
||||||
|
@Param("param") CmsLangLogParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<User>
|
||||||
|
*/
|
||||||
|
List<CmsLangLog> selectListRel(@Param("param") CmsLangLogParam param);
|
||||||
|
|
||||||
|
@InterceptorIgnore(tenantLine = "true")
|
||||||
|
List<CmsLangLog> selectListAllRel(@Param("param") CmsLangLogParam param);
|
||||||
|
|
||||||
|
}
|
||||||
37
src/main/java/com/gxwebsoft/cms/mapper/CmsLangMapper.java
Normal file
37
src/main/java/com/gxwebsoft/cms/mapper/CmsLangMapper.java
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
package com.gxwebsoft.cms.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsLang;
|
||||||
|
import com.gxwebsoft.cms.param.CmsLangParam;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 国际化Mapper
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2025-01-06 19:29:26
|
||||||
|
*/
|
||||||
|
public interface CmsLangMapper extends BaseMapper<CmsLang> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*
|
||||||
|
* @param page 分页对象
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<CmsLang>
|
||||||
|
*/
|
||||||
|
List<CmsLang> selectPageRel(@Param("page") IPage<CmsLang> page,
|
||||||
|
@Param("param") CmsLangParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<User>
|
||||||
|
*/
|
||||||
|
List<CmsLang> selectListRel(@Param("param") CmsLangParam param);
|
||||||
|
|
||||||
|
}
|
||||||
43
src/main/java/com/gxwebsoft/cms/mapper/CmsLinkMapper.java
Normal file
43
src/main/java/com/gxwebsoft/cms/mapper/CmsLinkMapper.java
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
package com.gxwebsoft.cms.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsLangLog;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsLink;
|
||||||
|
import com.gxwebsoft.cms.param.CmsLangLogParam;
|
||||||
|
import com.gxwebsoft.cms.param.CmsLinkParam;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 常用链接Mapper
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-10 20:47:57
|
||||||
|
*/
|
||||||
|
public interface CmsLinkMapper extends BaseMapper<CmsLink> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*
|
||||||
|
* @param page 分页对象
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<CmsLink>
|
||||||
|
*/
|
||||||
|
List<CmsLink> selectPageRel(@Param("page") IPage<CmsLink> page,
|
||||||
|
@Param("param") CmsLinkParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<User>
|
||||||
|
*/
|
||||||
|
List<CmsLink> selectListRel(@Param("param") CmsLinkParam param);
|
||||||
|
|
||||||
|
|
||||||
|
@InterceptorIgnore(tenantLine = "true")
|
||||||
|
List<CmsLink> selectListAllRel(@Param("param") CmsLinkParam param);
|
||||||
|
}
|
||||||
41
src/main/java/com/gxwebsoft/cms/mapper/CmsModelMapper.java
Normal file
41
src/main/java/com/gxwebsoft/cms/mapper/CmsModelMapper.java
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
package com.gxwebsoft.cms.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsModel;
|
||||||
|
import com.gxwebsoft.cms.param.CmsModelParam;
|
||||||
|
import com.gxwebsoft.cms.param.CmsWebsiteFieldParam;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 模型Mapper
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-11-26 15:44:53
|
||||||
|
*/
|
||||||
|
public interface CmsModelMapper extends BaseMapper<CmsModel> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*
|
||||||
|
* @param page 分页对象
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<CmsModel>
|
||||||
|
*/
|
||||||
|
List<CmsModel> selectPageRel(@Param("page") IPage<CmsModel> page,
|
||||||
|
@Param("param") CmsModelParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<User>
|
||||||
|
*/
|
||||||
|
List<CmsModel> selectListRel(@Param("param") CmsModelParam param);
|
||||||
|
|
||||||
|
@InterceptorIgnore(tenantLine = "true")
|
||||||
|
List<CmsModel> selectListAllRel(@Param("param") CmsModelParam param);
|
||||||
|
}
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
package com.gxwebsoft.cms.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsModel;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsNavigation;
|
||||||
|
import com.gxwebsoft.cms.param.CmsModelParam;
|
||||||
|
import com.gxwebsoft.cms.param.CmsNavigationParam;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 网站导航记录表Mapper
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-10 20:47:57
|
||||||
|
*/
|
||||||
|
public interface CmsNavigationMapper extends BaseMapper<CmsNavigation> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*
|
||||||
|
* @param page 分页对象
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<CmsNavigation>
|
||||||
|
*/
|
||||||
|
List<CmsNavigation> selectPageRel(@Param("page") IPage<CmsNavigation> page,
|
||||||
|
@Param("param") CmsNavigationParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<User>
|
||||||
|
*/
|
||||||
|
List<CmsNavigation> selectListRel(@Param("param") CmsNavigationParam param);
|
||||||
|
|
||||||
|
|
||||||
|
@InterceptorIgnore(tenantLine = "true")
|
||||||
|
List<CmsNavigation> selectListAllRel(@Param("param") CmsNavigationParam param);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
37
src/main/java/com/gxwebsoft/cms/mapper/CmsOrderMapper.java
Normal file
37
src/main/java/com/gxwebsoft/cms/mapper/CmsOrderMapper.java
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
package com.gxwebsoft.cms.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsOrder;
|
||||||
|
import com.gxwebsoft.cms.param.CmsOrderParam;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 网站订单Mapper
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2026-01-27 13:03:24
|
||||||
|
*/
|
||||||
|
public interface CmsOrderMapper extends BaseMapper<CmsOrder> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*
|
||||||
|
* @param page 分页对象
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<CmsOrder>
|
||||||
|
*/
|
||||||
|
List<CmsOrder> selectPageRel(@Param("page") IPage<CmsOrder> page,
|
||||||
|
@Param("param") CmsOrderParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<User>
|
||||||
|
*/
|
||||||
|
List<CmsOrder> selectListRel(@Param("param") CmsOrderParam param);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package com.gxwebsoft.cms.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsStatistics;
|
||||||
|
import com.gxwebsoft.cms.param.CmsStatisticsParam;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 站点统计信息表Mapper
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2025-07-25 12:32:06
|
||||||
|
*/
|
||||||
|
public interface CmsStatisticsMapper extends BaseMapper<CmsStatistics> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*
|
||||||
|
* @param page 分页对象
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<CmsStatistics>
|
||||||
|
*/
|
||||||
|
List<CmsStatistics> selectPageRel(@Param("page") IPage<CmsStatistics> page,
|
||||||
|
@Param("param") CmsStatisticsParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<User>
|
||||||
|
*/
|
||||||
|
List<CmsStatistics> selectListRel(@Param("param") CmsStatisticsParam param);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package com.gxwebsoft.cms.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsTemplate;
|
||||||
|
import com.gxwebsoft.cms.param.CmsTemplateParam;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 网站模版Mapper
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2025-01-21 14:21:16
|
||||||
|
*/
|
||||||
|
public interface CmsTemplateMapper extends BaseMapper<CmsTemplate> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*
|
||||||
|
* @param page 分页对象
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<CmsTemplate>
|
||||||
|
*/
|
||||||
|
List<CmsTemplate> selectPageRel(@Param("page") IPage<CmsTemplate> page,
|
||||||
|
@Param("param") CmsTemplateParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<User>
|
||||||
|
*/
|
||||||
|
List<CmsTemplate> selectListRel(@Param("param") CmsTemplateParam param);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
package com.gxwebsoft.cms.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsWebsiteField;
|
||||||
|
import com.gxwebsoft.cms.param.CmsWebsiteFieldParam;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 应用参数Mapper
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-10 20:36:14
|
||||||
|
*/
|
||||||
|
public interface CmsWebsiteFieldMapper extends BaseMapper<CmsWebsiteField> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*
|
||||||
|
* @param page 分页对象
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<CmsWebsiteField>
|
||||||
|
*/
|
||||||
|
List<CmsWebsiteField> selectPageRel(@Param("page") IPage<CmsWebsiteField> page,
|
||||||
|
@Param("param") CmsWebsiteFieldParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<User>
|
||||||
|
*/
|
||||||
|
List<CmsWebsiteField> selectListRel(@Param("param") CmsWebsiteFieldParam param);
|
||||||
|
|
||||||
|
|
||||||
|
@InterceptorIgnore(tenantLine = "true")
|
||||||
|
List<CmsWebsiteField> selectListAllRel(@Param("param") CmsWebsiteFieldParam param);
|
||||||
|
|
||||||
|
}
|
||||||
53
src/main/java/com/gxwebsoft/cms/mapper/CmsWebsiteMapper.java
Normal file
53
src/main/java/com/gxwebsoft/cms/mapper/CmsWebsiteMapper.java
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
package com.gxwebsoft.cms.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsWebsite;
|
||||||
|
import com.gxwebsoft.cms.param.CmsWebsiteParam;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 网站信息记录表Mapper
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-10 20:36:14
|
||||||
|
*/
|
||||||
|
public interface CmsWebsiteMapper extends BaseMapper<CmsWebsite> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*
|
||||||
|
* @param page 分页对象
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<CmsWebsite>
|
||||||
|
*/
|
||||||
|
List<CmsWebsite> selectPageRel(@Param("page") IPage<CmsWebsite> page,
|
||||||
|
@Param("param") CmsWebsiteParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<User>
|
||||||
|
*/
|
||||||
|
List<CmsWebsite> selectListRel(@Param("param") CmsWebsiteParam param);
|
||||||
|
|
||||||
|
@InterceptorIgnore(tenantLine = "true")
|
||||||
|
List<CmsWebsite> selectPageRelAll(@Param("page") IPage<CmsWebsite> page,
|
||||||
|
@Param("param") CmsWebsiteParam param);
|
||||||
|
|
||||||
|
@InterceptorIgnore(tenantLine = "true")
|
||||||
|
CmsWebsite getByIdRelAll(@Param("websiteId") Integer id);
|
||||||
|
|
||||||
|
@InterceptorIgnore(tenantLine = "true")
|
||||||
|
boolean updateByIdAll(@Param("param") CmsWebsite cmsWebsite);
|
||||||
|
|
||||||
|
@InterceptorIgnore(tenantLine = "true")
|
||||||
|
boolean removeByIdAll(@Param("websiteId") Integer id);
|
||||||
|
|
||||||
|
@InterceptorIgnore(tenantLine = "true")
|
||||||
|
CmsWebsite getByTenantId(@Param("tenantId") Integer tenantId);
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package com.gxwebsoft.cms.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsWebsiteSetting;
|
||||||
|
import com.gxwebsoft.cms.param.CmsWebsiteSettingParam;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 网站设置Mapper
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2025-02-19 01:35:44
|
||||||
|
*/
|
||||||
|
public interface CmsWebsiteSettingMapper extends BaseMapper<CmsWebsiteSetting> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*
|
||||||
|
* @param page 分页对象
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<CmsWebsiteSetting>
|
||||||
|
*/
|
||||||
|
List<CmsWebsiteSetting> selectPageRel(@Param("page") IPage<CmsWebsiteSetting> page,
|
||||||
|
@Param("param") CmsWebsiteSettingParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<User>
|
||||||
|
*/
|
||||||
|
List<CmsWebsiteSetting> selectListRel(@Param("param") CmsWebsiteSettingParam param);
|
||||||
|
|
||||||
|
}
|
||||||
92
src/main/java/com/gxwebsoft/cms/mapper/xml/CmsAdMapper.xml
Normal file
92
src/main/java/com/gxwebsoft/cms/mapper/xml/CmsAdMapper.xml
Normal file
@@ -0,0 +1,92 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.gxwebsoft.cms.mapper.CmsAdMapper">
|
||||||
|
|
||||||
|
<!-- 关联查询sql -->
|
||||||
|
<sql id="selectSql">
|
||||||
|
SELECT a.*, b.user_id as websiteUserId, c.title as categoryName
|
||||||
|
FROM cms_ad a
|
||||||
|
LEFT JOIN cms_website b ON a.tenant_id = b.tenant_id
|
||||||
|
LEFT JOIN cms_navigation c ON a.category_id = c.navigation_id
|
||||||
|
<where>
|
||||||
|
<if test="param.adId != null">
|
||||||
|
AND a.ad_id = #{param.adId}
|
||||||
|
</if>
|
||||||
|
<if test="param.type != null">
|
||||||
|
AND a.type = #{param.type}
|
||||||
|
</if>
|
||||||
|
<if test="param.code != null">
|
||||||
|
AND a.code = #{param.code}
|
||||||
|
</if>
|
||||||
|
<if test="param.categoryId != null">
|
||||||
|
AND a.category_id = #{param.categoryId}
|
||||||
|
</if>
|
||||||
|
<if test="param.lang != null">
|
||||||
|
AND a.lang = #{param.lang}
|
||||||
|
</if>
|
||||||
|
<if test="param.name != null">
|
||||||
|
AND a.name LIKE CONCAT('%', #{param.name}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.width != null">
|
||||||
|
AND a.width LIKE CONCAT('%', #{param.width}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.height != null">
|
||||||
|
AND a.height LIKE CONCAT('%', #{param.height}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.images != null">
|
||||||
|
AND a.images LIKE CONCAT('%', #{param.images}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.path != null">
|
||||||
|
AND a.path LIKE CONCAT('%', #{param.path}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.userId != null">
|
||||||
|
AND a.user_id = #{param.userId}
|
||||||
|
</if>
|
||||||
|
<if test="param.websiteUserId != null">
|
||||||
|
AND b.user_id = #{param.websiteUserId}
|
||||||
|
</if>
|
||||||
|
<if test="param.sortNumber != null">
|
||||||
|
AND a.sort_number = #{param.sortNumber}
|
||||||
|
</if>
|
||||||
|
<if test="param.comments != null">
|
||||||
|
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.status != null">
|
||||||
|
AND a.status = #{param.status}
|
||||||
|
</if>
|
||||||
|
<if test="param.deleted != null">
|
||||||
|
AND a.deleted = #{param.deleted}
|
||||||
|
</if>
|
||||||
|
<if test="param.deleted == null">
|
||||||
|
AND a.deleted = 0
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeStart != null">
|
||||||
|
AND a.create_time >= #{param.createTimeStart}
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeEnd != null">
|
||||||
|
AND a.create_time <= #{param.createTimeEnd}
|
||||||
|
</if>
|
||||||
|
<if test="param.keywords != null">
|
||||||
|
AND (a.name LIKE CONCAT('%', #{param.keywords}, '%')
|
||||||
|
OR a.ad_id = #{param.keywords}
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 分页查询 -->
|
||||||
|
<select id="selectPageRel" resultType="com.gxwebsoft.cms.entity.CmsAd">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 查询全部 -->
|
||||||
|
<select id="selectListRel" resultType="com.gxwebsoft.cms.entity.CmsAd">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectListAllRel" resultType="com.gxwebsoft.cms.entity.CmsAd">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.gxwebsoft.cms.mapper.CmsAdRecordMapper">
|
||||||
|
|
||||||
|
<!-- 关联查询sql -->
|
||||||
|
<sql id="selectSql">
|
||||||
|
SELECT a.*
|
||||||
|
FROM cms_ad_record a
|
||||||
|
<where>
|
||||||
|
<if test="param.adRecordId != null">
|
||||||
|
AND a.ad_record_id = #{param.adRecordId}
|
||||||
|
</if>
|
||||||
|
<if test="param.title != null">
|
||||||
|
AND a.title LIKE CONCAT('%', #{param.title}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.path != null">
|
||||||
|
AND a.path LIKE CONCAT('%', #{param.path}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.url != null">
|
||||||
|
AND a.url LIKE CONCAT('%', #{param.url}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.adId != null">
|
||||||
|
AND a.ad_id = #{param.adId}
|
||||||
|
</if>
|
||||||
|
<if test="param.sortNumber != null">
|
||||||
|
AND a.sort_number = #{param.sortNumber}
|
||||||
|
</if>
|
||||||
|
<if test="param.comments != null">
|
||||||
|
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.status != null">
|
||||||
|
AND a.status = #{param.status}
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeStart != null">
|
||||||
|
AND a.create_time >= #{param.createTimeStart}
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeEnd != null">
|
||||||
|
AND a.create_time <= #{param.createTimeEnd}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 分页查询 -->
|
||||||
|
<select id="selectPageRel" resultType="com.gxwebsoft.cms.entity.CmsAdRecord">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 查询全部 -->
|
||||||
|
<select id="selectListRel" resultType="com.gxwebsoft.cms.entity.CmsAdRecord">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,86 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.gxwebsoft.cms.mapper.CmsArticleCategoryMapper">
|
||||||
|
|
||||||
|
<!-- 关联查询sql -->
|
||||||
|
<sql id="selectSql">
|
||||||
|
SELECT a.*
|
||||||
|
FROM cms_article_category a
|
||||||
|
<where>
|
||||||
|
<if test="param.categoryId != null">
|
||||||
|
AND a.category_id = #{param.categoryId}
|
||||||
|
</if>
|
||||||
|
<if test="param.categoryCode != null">
|
||||||
|
AND a.category_code LIKE CONCAT('%', #{param.categoryCode}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.title != null">
|
||||||
|
AND a.title LIKE CONCAT('%', #{param.title}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.type != null">
|
||||||
|
AND a.type = #{param.type}
|
||||||
|
</if>
|
||||||
|
<if test="param.image != null">
|
||||||
|
AND a.image LIKE CONCAT('%', #{param.image}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.parentId != null">
|
||||||
|
AND a.parent_id = #{param.parentId}
|
||||||
|
</if>
|
||||||
|
<if test="param.path != null">
|
||||||
|
AND a.path LIKE CONCAT('%', #{param.path}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.component != null">
|
||||||
|
AND a.component LIKE CONCAT('%', #{param.component}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.pageId != null">
|
||||||
|
AND a.page_id = #{param.pageId}
|
||||||
|
</if>
|
||||||
|
<if test="param.userId != null">
|
||||||
|
AND a.user_id = #{param.userId}
|
||||||
|
</if>
|
||||||
|
<if test="param.count != null">
|
||||||
|
AND a.count = #{param.count}
|
||||||
|
</if>
|
||||||
|
<if test="param.sortNumber != null">
|
||||||
|
AND a.sort_number = #{param.sortNumber}
|
||||||
|
</if>
|
||||||
|
<if test="param.comments != null">
|
||||||
|
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.hide != null">
|
||||||
|
AND a.hide = #{param.hide}
|
||||||
|
</if>
|
||||||
|
<if test="param.recommend != null">
|
||||||
|
AND a.recommend = #{param.recommend}
|
||||||
|
</if>
|
||||||
|
<if test="param.showIndex != null">
|
||||||
|
AND a.show_index = #{param.showIndex}
|
||||||
|
</if>
|
||||||
|
<if test="param.status != null">
|
||||||
|
AND a.status = #{param.status}
|
||||||
|
</if>
|
||||||
|
<if test="param.deleted != null">
|
||||||
|
AND a.deleted = #{param.deleted}
|
||||||
|
</if>
|
||||||
|
<if test="param.deleted == null">
|
||||||
|
AND a.deleted = 0
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeStart != null">
|
||||||
|
AND a.create_time >= #{param.createTimeStart}
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeEnd != null">
|
||||||
|
AND a.create_time <= #{param.createTimeEnd}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 分页查询 -->
|
||||||
|
<select id="selectPageRel" resultType="com.gxwebsoft.cms.entity.CmsArticleCategory">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 查询全部 -->
|
||||||
|
<select id="selectListRel" resultType="com.gxwebsoft.cms.entity.CmsArticleCategory">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,71 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.gxwebsoft.cms.mapper.CmsArticleCommentMapper">
|
||||||
|
|
||||||
|
<!-- 关联查询sql -->
|
||||||
|
<sql id="selectSql">
|
||||||
|
SELECT a.*
|
||||||
|
FROM cms_article_comment a
|
||||||
|
<where>
|
||||||
|
<if test="param.commentId != null">
|
||||||
|
AND a.comment_id = #{param.commentId}
|
||||||
|
</if>
|
||||||
|
<if test="param.articleId != null">
|
||||||
|
AND a.article_id = #{param.articleId}
|
||||||
|
</if>
|
||||||
|
<if test="param.score != null">
|
||||||
|
AND a.score = #{param.score}
|
||||||
|
</if>
|
||||||
|
<if test="param.content != null">
|
||||||
|
AND a.content LIKE CONCAT('%', #{param.content}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.isPicture != null">
|
||||||
|
AND a.is_picture = #{param.isPicture}
|
||||||
|
</if>
|
||||||
|
<if test="param.userId != null">
|
||||||
|
AND a.user_id = #{param.userId}
|
||||||
|
</if>
|
||||||
|
<if test="param.toUserId != null">
|
||||||
|
AND a.to_user_id = #{param.toUserId}
|
||||||
|
</if>
|
||||||
|
<if test="param.replyCommentId != null">
|
||||||
|
AND a.reply_comment_id = #{param.replyCommentId}
|
||||||
|
</if>
|
||||||
|
<if test="param.replyUserId != null">
|
||||||
|
AND a.reply_user_id = #{param.replyUserId}
|
||||||
|
</if>
|
||||||
|
<if test="param.sortNumber != null">
|
||||||
|
AND a.sort_number = #{param.sortNumber}
|
||||||
|
</if>
|
||||||
|
<if test="param.comments != null">
|
||||||
|
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.status != null">
|
||||||
|
AND a.status = #{param.status}
|
||||||
|
</if>
|
||||||
|
<if test="param.deleted != null">
|
||||||
|
AND a.deleted = #{param.deleted}
|
||||||
|
</if>
|
||||||
|
<if test="param.deleted == null">
|
||||||
|
AND a.deleted = 0
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeStart != null">
|
||||||
|
AND a.create_time >= #{param.createTimeStart}
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeEnd != null">
|
||||||
|
AND a.create_time <= #{param.createTimeEnd}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 分页查询 -->
|
||||||
|
<select id="selectPageRel" resultType="com.gxwebsoft.cms.entity.CmsArticleComment">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 查询全部 -->
|
||||||
|
<select id="selectListRel" resultType="com.gxwebsoft.cms.entity.CmsArticleComment">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.gxwebsoft.cms.mapper.CmsArticleContentMapper">
|
||||||
|
|
||||||
|
<!-- 关联查询sql -->
|
||||||
|
<sql id="selectSql">
|
||||||
|
SELECT a.*
|
||||||
|
FROM cms_article_content a
|
||||||
|
<where>
|
||||||
|
<if test="param.id != null">
|
||||||
|
AND a.id = #{param.id}
|
||||||
|
</if>
|
||||||
|
<if test="param.articleId != null">
|
||||||
|
AND a.article_id = #{param.articleId}
|
||||||
|
</if>
|
||||||
|
<if test="param.content != null">
|
||||||
|
AND a.content LIKE CONCAT('%', #{param.content}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeStart != null">
|
||||||
|
AND a.create_time >= #{param.createTimeStart}
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeEnd != null">
|
||||||
|
AND a.create_time <= #{param.createTimeEnd}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 分页查询 -->
|
||||||
|
<select id="selectPageRel" resultType="com.gxwebsoft.cms.entity.CmsArticleContent">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 查询全部 -->
|
||||||
|
<select id="selectListRel" resultType="com.gxwebsoft.cms.entity.CmsArticleContent">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.gxwebsoft.cms.mapper.CmsArticleCountMapper">
|
||||||
|
|
||||||
|
<!-- 关联查询sql -->
|
||||||
|
<sql id="selectSql">
|
||||||
|
SELECT a.*
|
||||||
|
FROM cms_article_count a
|
||||||
|
<where>
|
||||||
|
<if test="param.id != null">
|
||||||
|
AND a.id = #{param.id}
|
||||||
|
</if>
|
||||||
|
<if test="param.articleId != null">
|
||||||
|
AND a.article_id = #{param.articleId}
|
||||||
|
</if>
|
||||||
|
<if test="param.userId != null">
|
||||||
|
AND a.user_id = #{param.userId}
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeStart != null">
|
||||||
|
AND a.create_time >= #{param.createTimeStart}
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeEnd != null">
|
||||||
|
AND a.create_time <= #{param.createTimeEnd}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 分页查询 -->
|
||||||
|
<select id="selectPageRel" resultType="com.gxwebsoft.cms.entity.CmsArticleCount">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 查询全部 -->
|
||||||
|
<select id="selectListRel" resultType="com.gxwebsoft.cms.entity.CmsArticleCount">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.gxwebsoft.cms.mapper.CmsArticleLikeMapper">
|
||||||
|
|
||||||
|
<!-- 关联查询sql -->
|
||||||
|
<sql id="selectSql">
|
||||||
|
SELECT a.*
|
||||||
|
FROM cms_article_like a
|
||||||
|
<where>
|
||||||
|
<if test="param.id != null">
|
||||||
|
AND a.id = #{param.id}
|
||||||
|
</if>
|
||||||
|
<if test="param.articleId != null">
|
||||||
|
AND a.article_id = #{param.articleId}
|
||||||
|
</if>
|
||||||
|
<if test="param.userId != null">
|
||||||
|
AND a.user_id = #{param.userId}
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeStart != null">
|
||||||
|
AND a.create_time >= #{param.createTimeStart}
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeEnd != null">
|
||||||
|
AND a.create_time <= #{param.createTimeEnd}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 分页查询 -->
|
||||||
|
<select id="selectPageRel" resultType="com.gxwebsoft.cms.entity.CmsArticleLike">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 查询全部 -->
|
||||||
|
<select id="selectListRel" resultType="com.gxwebsoft.cms.entity.CmsArticleLike">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
187
src/main/java/com/gxwebsoft/cms/mapper/xml/CmsArticleMapper.xml
Normal file
187
src/main/java/com/gxwebsoft/cms/mapper/xml/CmsArticleMapper.xml
Normal file
@@ -0,0 +1,187 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.gxwebsoft.cms.mapper.CmsArticleMapper">
|
||||||
|
|
||||||
|
<!-- 关联查询sql -->
|
||||||
|
<sql id="selectSql">
|
||||||
|
SELECT a.*,b.title as categoryName,b.parent_Id as parentId, b.model,c.title as parentName,u.nickname,u.avatar
|
||||||
|
FROM cms_article a
|
||||||
|
LEFT JOIN cms_navigation b ON a.category_id = b.navigation_id
|
||||||
|
LEFT JOIN cms_navigation c ON b.parent_id = c.navigation_id
|
||||||
|
LEFT JOIN gxwebsoft_core.sys_user u ON a.user_id = u.user_id
|
||||||
|
<where>
|
||||||
|
<if test="param.articleId != null">
|
||||||
|
AND a.article_id = #{param.articleId}
|
||||||
|
</if>
|
||||||
|
<if test="param.title != null">
|
||||||
|
AND a.title LIKE CONCAT('%', #{param.title}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.type != null">
|
||||||
|
AND a.type = #{param.type}
|
||||||
|
</if>
|
||||||
|
<if test="param.lang != null">
|
||||||
|
AND a.lang = #{param.lang}
|
||||||
|
</if>
|
||||||
|
<if test="param.model != null">
|
||||||
|
AND a.model = #{param.model}
|
||||||
|
</if>
|
||||||
|
<if test="param.code != null">
|
||||||
|
AND a.code = #{param.code}
|
||||||
|
</if>
|
||||||
|
<if test="param.detail != null">
|
||||||
|
AND a.detail = #{param.detail}
|
||||||
|
</if>
|
||||||
|
<if test="param.showType != null">
|
||||||
|
AND a.show_type = #{param.showType}
|
||||||
|
</if>
|
||||||
|
<if test="param.topic != null">
|
||||||
|
AND a.topic LIKE CONCAT('%', #{param.topic}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.categoryId != null">
|
||||||
|
AND a.category_id = #{param.categoryId}
|
||||||
|
</if>
|
||||||
|
<if test="param.categoryIds != null">
|
||||||
|
AND a.category_id IN
|
||||||
|
<foreach collection="param.categoryIds" item="item" separator="," open="(" close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
<if test="param.image != null">
|
||||||
|
AND a.image LIKE CONCAT('%', #{param.image}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.hasImage != null">
|
||||||
|
AND a.image != ''
|
||||||
|
</if>
|
||||||
|
<if test="param.source != null">
|
||||||
|
AND a.source LIKE CONCAT('%', #{param.source}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.virtualViews != null">
|
||||||
|
AND a.virtual_views = #{param.virtualViews}
|
||||||
|
</if>
|
||||||
|
<if test="param.actualViews != null">
|
||||||
|
AND a.actual_views = #{param.actualViews}
|
||||||
|
</if>
|
||||||
|
<if test="param.platform != null">
|
||||||
|
AND a.platform LIKE CONCAT('%', #{param.platform}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.files != null">
|
||||||
|
AND a.files LIKE CONCAT('%', #{param.files}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.video != null">
|
||||||
|
AND a.video LIKE CONCAT('%', #{param.video}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.accept != null">
|
||||||
|
AND a.accept LIKE CONCAT('%', #{param.accept}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.longitude != null">
|
||||||
|
AND a.longitude LIKE CONCAT('%', #{param.longitude}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.latitude != null">
|
||||||
|
AND a.latitude LIKE CONCAT('%', #{param.latitude}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.province != null">
|
||||||
|
AND a.province LIKE CONCAT('%', #{param.province}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.city != null">
|
||||||
|
AND a.city LIKE CONCAT('%', #{param.city}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.region != null">
|
||||||
|
AND a.region LIKE CONCAT('%', #{param.region}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.address != null">
|
||||||
|
AND a.address LIKE CONCAT('%', #{param.address}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.likes != null">
|
||||||
|
AND a.likes = #{param.likes}
|
||||||
|
</if>
|
||||||
|
<if test="param.commentNumbers != null">
|
||||||
|
AND a.comment_numbers = #{param.commentNumbers}
|
||||||
|
</if>
|
||||||
|
<if test="param.toUsers != null">
|
||||||
|
AND a.to_users LIKE CONCAT('%', #{param.toUsers}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.userId != null">
|
||||||
|
AND a.user_id = #{param.userId}
|
||||||
|
</if>
|
||||||
|
<if test="param.projectId != null">
|
||||||
|
AND a.project_id = #{param.projectId}
|
||||||
|
</if>
|
||||||
|
<if test="param.tags != null">
|
||||||
|
AND a.tags LIKE CONCAT('%', #{param.tags}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.sortNumber != null">
|
||||||
|
AND a.sort_number = #{param.sortNumber}
|
||||||
|
</if>
|
||||||
|
<if test="param.comments != null">
|
||||||
|
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.recommend != null">
|
||||||
|
AND a.recommend = #{param.recommend}
|
||||||
|
</if>
|
||||||
|
<if test="param.status != null">
|
||||||
|
AND a.status = #{param.status}
|
||||||
|
</if>
|
||||||
|
<if test="param.deleted != null">
|
||||||
|
AND a.deleted = #{param.deleted}
|
||||||
|
</if>
|
||||||
|
<if test="param.deleted == null">
|
||||||
|
AND a.deleted = 0
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeStart != null">
|
||||||
|
AND a.create_time >= #{param.createTimeStart}
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeEnd != null">
|
||||||
|
AND a.create_time <= #{param.createTimeEnd}
|
||||||
|
</if>
|
||||||
|
<if test="param.articleIds != null">
|
||||||
|
AND a.article_id IN
|
||||||
|
<foreach collection="param.articleIds" item="item" separator="," open="(" close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
<if test="param.keywords != null">
|
||||||
|
AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%')
|
||||||
|
OR a.article_id = #{param.keywords}
|
||||||
|
OR a.detail = #{param.keywords}
|
||||||
|
OR a.title LIKE CONCAT('%', #{param.keywords}, '%')
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 分页查询 -->
|
||||||
|
<select id="selectPageRel" resultType="com.gxwebsoft.cms.entity.CmsArticle">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 查询全部 -->
|
||||||
|
<select id="selectListRel" resultType="com.gxwebsoft.cms.entity.CmsArticle">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectListAllRel" resultType="com.gxwebsoft.cms.entity.CmsArticle">
|
||||||
|
SELECT a.*,b.user_id as websiteUserId, c.content
|
||||||
|
FROM cms_article a
|
||||||
|
LEFT JOIN cms_website b ON a.tenant_id = b.tenant_id
|
||||||
|
LEFT JOIN cms_article_content c ON a.article_id = c.article_id
|
||||||
|
<where>
|
||||||
|
<if test="param.websiteUserId != null">
|
||||||
|
AND b.user_id = #{param.websiteUserId}
|
||||||
|
</if>
|
||||||
|
websiteId
|
||||||
|
<if test="param.parentId != null">
|
||||||
|
AND a.parent_id = #{param.parentId}
|
||||||
|
</if>
|
||||||
|
<if test="param.categoryId != null">
|
||||||
|
AND a.category_id = #{param.categoryId}
|
||||||
|
</if>
|
||||||
|
<if test="param.deleted != null">
|
||||||
|
AND a.deleted = #{param.deleted}
|
||||||
|
</if>
|
||||||
|
<if test="param.deleted == null">
|
||||||
|
AND a.deleted = 0
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,93 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.gxwebsoft.cms.mapper.CmsDesignMapper">
|
||||||
|
|
||||||
|
<!-- 关联查询sql -->
|
||||||
|
<sql id="selectSql">
|
||||||
|
SELECT a.*,b.lang_category_id, b.title as categoryName
|
||||||
|
FROM cms_design a
|
||||||
|
LEFT JOIN cms_navigation b ON a.category_id = b.navigation_id
|
||||||
|
<where>
|
||||||
|
<if test="param.pageId != null">
|
||||||
|
AND a.page_id = #{param.pageId}
|
||||||
|
</if>
|
||||||
|
<if test="param.name != null">
|
||||||
|
AND a.name LIKE CONCAT('%', #{param.name}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.lang != null">
|
||||||
|
AND a.lang = #{param.lang}
|
||||||
|
</if>
|
||||||
|
<if test="param.categoryId != null">
|
||||||
|
AND a.category_id = #{param.categoryId}
|
||||||
|
</if>
|
||||||
|
<if test="param.model != null">
|
||||||
|
AND a.model = #{param.model}
|
||||||
|
</if>
|
||||||
|
<if test="param.keywords != null">
|
||||||
|
AND a.keywords LIKE CONCAT('%', #{param.keywords}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.description != null">
|
||||||
|
AND a.description LIKE CONCAT('%', #{param.description}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.photo != null">
|
||||||
|
AND a.photo LIKE CONCAT('%', #{param.photo}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.buyUrl != null">
|
||||||
|
AND a.buy_url LIKE CONCAT('%', #{param.buyUrl}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.style != null">
|
||||||
|
AND a.style LIKE CONCAT('%', #{param.style}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.content != null">
|
||||||
|
AND a.content LIKE CONCAT('%', #{param.content}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.showLayout != null">
|
||||||
|
AND a.show_layout = #{param.showLayout}
|
||||||
|
</if>
|
||||||
|
<if test="param.layout != null">
|
||||||
|
AND a.layout LIKE CONCAT('%', #{param.layout}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.parentId != null">
|
||||||
|
AND a.parent_id = #{param.parentId}
|
||||||
|
</if>
|
||||||
|
<if test="param.userId != null">
|
||||||
|
AND a.user_id = #{param.userId}
|
||||||
|
</if>
|
||||||
|
<if test="param.home != null">
|
||||||
|
AND a.home = #{param.home}
|
||||||
|
</if>
|
||||||
|
<if test="param.sortNumber != null">
|
||||||
|
AND a.sort_number = #{param.sortNumber}
|
||||||
|
</if>
|
||||||
|
<if test="param.comments != null">
|
||||||
|
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.status != null">
|
||||||
|
AND a.status = #{param.status}
|
||||||
|
</if>
|
||||||
|
<if test="param.deleted != null">
|
||||||
|
AND a.deleted = #{param.deleted}
|
||||||
|
</if>
|
||||||
|
<if test="param.deleted == null">
|
||||||
|
AND a.deleted = 0
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeStart != null">
|
||||||
|
AND a.create_time >= #{param.createTimeStart}
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeEnd != null">
|
||||||
|
AND a.create_time <= #{param.createTimeEnd}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 分页查询 -->
|
||||||
|
<select id="selectPageRel" resultType="com.gxwebsoft.cms.entity.CmsDesign">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 查询全部 -->
|
||||||
|
<select id="selectListRel" resultType="com.gxwebsoft.cms.entity.CmsDesign">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,71 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.gxwebsoft.cms.mapper.CmsDesignRecordMapper">
|
||||||
|
|
||||||
|
<!-- 关联查询sql -->
|
||||||
|
<sql id="selectSql">
|
||||||
|
SELECT a.*
|
||||||
|
FROM cms_design_record a
|
||||||
|
<where>
|
||||||
|
<if test="param.id != null">
|
||||||
|
AND a.id = #{param.id}
|
||||||
|
</if>
|
||||||
|
<if test="param.navigationId != null">
|
||||||
|
AND a.navigation_id = #{param.navigationId}
|
||||||
|
</if>
|
||||||
|
<if test="param.title != null">
|
||||||
|
AND a.title LIKE CONCAT('%', #{param.title}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.dictCode != null">
|
||||||
|
AND a.dict_code LIKE CONCAT('%', #{param.dictCode}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.styles != null">
|
||||||
|
AND a.styles LIKE CONCAT('%', #{param.styles}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.shadow != null">
|
||||||
|
AND a.shadow LIKE CONCAT('%', #{param.shadow}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.keywords != null">
|
||||||
|
AND a.keywords LIKE CONCAT('%', #{param.keywords}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.description != null">
|
||||||
|
AND a.description LIKE CONCAT('%', #{param.description}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.path != null">
|
||||||
|
AND a.path LIKE CONCAT('%', #{param.path}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.photo != null">
|
||||||
|
AND a.photo LIKE CONCAT('%', #{param.photo}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.userId != null">
|
||||||
|
AND a.user_id = #{param.userId}
|
||||||
|
</if>
|
||||||
|
<if test="param.sortNumber != null">
|
||||||
|
AND a.sort_number = #{param.sortNumber}
|
||||||
|
</if>
|
||||||
|
<if test="param.comments != null">
|
||||||
|
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.status != null">
|
||||||
|
AND a.status = #{param.status}
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeStart != null">
|
||||||
|
AND a.create_time >= #{param.createTimeStart}
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeEnd != null">
|
||||||
|
AND a.create_time <= #{param.createTimeEnd}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 分页查询 -->
|
||||||
|
<select id="selectPageRel" resultType="com.gxwebsoft.cms.entity.CmsDesignRecord">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 查询全部 -->
|
||||||
|
<select id="selectListRel" resultType="com.gxwebsoft.cms.entity.CmsDesignRecord">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user