Compare commits
165 Commits
dev_202510
...
facff46bb6
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
facff46bb6 | ||
|
|
71589ab13a | ||
|
|
edbcf2729b | ||
|
|
476ea60b27 | ||
|
|
740a343863 | ||
|
|
a76d954979 | ||
|
|
ecbb2e993c | ||
|
|
de53fb7838 | ||
|
|
2079e6a1a8 | ||
|
|
0e164f9623 | ||
|
|
a8d1c73390 | ||
|
|
2516e1e1a3 | ||
|
|
cbdce6211f | ||
|
|
f048818b4c | ||
|
|
e85b25754d | ||
|
|
ed3209d69d | ||
|
|
344cb30e5d | ||
|
|
3ae7b9ac52 | ||
|
|
7d51a13dd7 | ||
|
|
de8f44f063 | ||
|
|
6da2b05345 | ||
|
|
c93a74e9a5 | ||
|
|
bdd48ead74 | ||
|
|
6b793228e3 | ||
|
|
b24f647c87 | ||
|
|
8a0032cfa4 | ||
|
|
dffa3ea84a | ||
|
|
dca88d28cd | ||
|
|
c07537c527 | ||
|
|
978eb7501b | ||
|
|
a13fcf8440 | ||
|
|
bd8fd15b32 | ||
|
|
7807d6be80 | ||
|
|
d5e423ee45 | ||
|
|
b93e064edc | ||
|
|
aefb8d0c12 | ||
|
|
2955df71e9 | ||
|
|
23511407ab | ||
|
|
ecfe64c188 | ||
|
|
58f512df4a | ||
|
|
77c1155b38 | ||
|
|
e96c54c328 | ||
|
|
59307d612c | ||
|
|
48800adccd | ||
| 2933b1961e | |||
| 7be8216a5a | |||
| c74505b8c3 | |||
| 8ac012f49c | |||
| 068ca75caf | |||
| 6248147389 | |||
| 01f18f87ba | |||
| 9917e46c29 | |||
| 54cd851245 | |||
| 8b13d4cd92 | |||
| 46175c7295 | |||
| d72f637be3 | |||
| 6da50d70d0 | |||
| eec3fc663b | |||
| 29bdb9ddbb | |||
| 86e0935353 | |||
| 4c2cb4f0e5 | |||
| 3442591d2b | |||
| 4928c71b19 | |||
| 5cd5353f97 | |||
| 73ab200daf | |||
| 4298fcb402 | |||
| 37c0ac035e | |||
| 977ca260da | |||
| 4808960491 | |||
| 74d8c66a6e | |||
| fca95e1203 | |||
| b7d3e07d16 | |||
| 35ac70e82d | |||
| 632b37d5bd | |||
| 75ed266532 | |||
| 884459e91a | |||
| 5acb3a34e0 | |||
| 9dc9bff8b1 | |||
| b44214f74a | |||
| 78ff89ba0d | |||
| 8bbb3ac38f | |||
| 983f8cb429 | |||
| 0d9ae593c6 | |||
| 07e8151736 | |||
| ad5ca8c545 | |||
| 95e7b752e3 | |||
| 3ea2777c94 | |||
| 1db7b3f6a1 | |||
| 03c5226a6a | |||
| 7bd3d54d97 | |||
| 61371a4a76 | |||
| 6606438862 | |||
| c9332b85db | |||
| 74d19bb9d6 | |||
| 57f97a490a | |||
| 746e5051cf | |||
| f27b57ec8b | |||
| 5e0773a59f | |||
| 70ea5f4dd4 | |||
| 31ea86d90c | |||
| 73dda8b648 | |||
| 80a60e37af | |||
| 71885c8796 | |||
| bfbb94481f | |||
| 3dcf9ca3ef | |||
| 2b92f29a17 | |||
| 3dbfff5f41 | |||
| f04385a306 | |||
| 44f817eced | |||
| 0f2cc6a33c | |||
| 0d1127f25e | |||
| bb7b4035fc | |||
| c3b3ed3681 | |||
| 3fe027661b | |||
| 74034ed26a | |||
| ad98033faa | |||
| bd8f47d9ae | |||
| c975c205df | |||
| 3ead596483 | |||
| 882df50f75 | |||
| 13da68b90d | |||
| 5f8bc1af55 | |||
| 1391239193 | |||
| fe93d9fac0 | |||
| 6ed65f89b5 | |||
| 9ff5b98b05 | |||
| 461c390cf7 | |||
| 1b9c9e9b86 | |||
| be30f31990 | |||
| ac4d7d8176 | |||
| 54997d4e3d | |||
| 7bbb1be2a2 | |||
| 19312e7a6f | |||
| 727dd254f0 | |||
| 2942fdabfe | |||
| 5ea30d6f85 | |||
| e6ae7d60e3 | |||
| cca1847fbf | |||
| 10a317bed6 | |||
| a3bf673440 | |||
| 30c4ec612a | |||
| 486455af81 | |||
| e8dc76ef82 | |||
| 8aa6fc0abf | |||
| 7eda1a85eb | |||
| 6a124a5754 | |||
| 564e617802 | |||
| 3f09aa1238 | |||
| b6cdbba20a | |||
| bc77cd244b | |||
| d28f358127 | |||
| 5306431417 | |||
| 1cc52a113d | |||
| 53287f0a1d | |||
| c895e7364a | |||
| efbe2a3def | |||
| a1cbb9fdf0 | |||
| 5bb485c612 | |||
| 4ceb96738e | |||
| a84e8b9fe6 | |||
| 98052c0ce7 | |||
| 3780b9d2ab | |||
| bd43d35074 | |||
| 085cd485ad | |||
| 9007c7de57 |
@@ -1,211 +0,0 @@
|
||||
# Gitea Actions 工作流配置说明
|
||||
|
||||
本项目配置了两个 Gitea Actions 工作流,用于自动化构建、测试和部署。
|
||||
|
||||
## 工作流列表
|
||||
|
||||
### 1. ci.yml - 持续集成
|
||||
**触发时机:**
|
||||
- 推送代码到 `main` 或 `master` 分支
|
||||
- 创建 Pull Request
|
||||
|
||||
**执行内容:**
|
||||
- 自动检出代码
|
||||
- 配置 Java 8 环境
|
||||
- 使用 Gradle 构建项目
|
||||
- 运行单元测试
|
||||
- 上传构建产物(JAR 包)
|
||||
- 上传测试报告
|
||||
|
||||
**查看结果:**
|
||||
构建完成后,可以在 Gitea 仓库的 "Actions" 标签页查看运行结果和下载构建产物。
|
||||
|
||||
---
|
||||
|
||||
### 2. deploy.yml - 自动部署
|
||||
**触发时机:**
|
||||
- 推送代码到 `main` 或 `master` 分支
|
||||
- 手动触发(在 Gitea Actions 页面点击 "Run workflow")
|
||||
|
||||
**执行内容:**
|
||||
- 构建项目
|
||||
- 通过 SCP 将 JAR 包上传到服务器
|
||||
- 通过 SSH 重启应用
|
||||
|
||||
**配置步骤:**
|
||||
|
||||
#### 第一步:在 Gitea 中配置 Secrets
|
||||
进入仓库 → Settings → Secrets,添加以下密钥:
|
||||
|
||||
| 密钥名称 | 说明 | 示例 |
|
||||
|---------|------|------|
|
||||
| `SERVER_HOST` | 服务器 IP 地址 | `120.24.204.180` |
|
||||
| `SERVER_PORT` | SSH 端口 | `22` |
|
||||
| `SERVER_USER` | SSH 用户名 | `root` 或 `ubuntu` |
|
||||
| `SERVER_SSH_KEY` | SSH 私钥内容 | 完整的私钥文件内容 |
|
||||
| `DEPLOY_PATH` | 部署目录路径 | `/opt/corewing` |
|
||||
|
||||
#### 第二步:生成 SSH 密钥对(如果还没有)
|
||||
```bash
|
||||
# 在本地生成密钥对
|
||||
ssh-keygen -t rsa -b 4096 -C "gitea-deploy" -f ~/.ssh/gitea_deploy
|
||||
|
||||
# 查看公钥
|
||||
cat ~/.ssh/gitea_deploy.pub
|
||||
|
||||
# 查看私钥(复制到 Gitea Secrets 中)
|
||||
cat ~/.ssh/gitea_deploy
|
||||
```
|
||||
|
||||
#### 第三步:配置服务器
|
||||
```bash
|
||||
# 1. SSH 登录到服务器
|
||||
ssh user@your-server
|
||||
|
||||
# 2. 创建部署目录
|
||||
sudo mkdir -p /opt/corewing
|
||||
sudo chown $USER:$USER /opt/corewing
|
||||
|
||||
# 3. 添加公钥到 authorized_keys
|
||||
echo "your-public-key-content" >> ~/.ssh/authorized_keys
|
||||
chmod 600 ~/.ssh/authorized_keys
|
||||
|
||||
# 4. 安装 Java(如果未安装)
|
||||
sudo apt update
|
||||
sudo apt install openjdk-8-jdk -y
|
||||
java -version
|
||||
```
|
||||
|
||||
#### 第四步:测试部署
|
||||
推送代码到 main 分支,或在 Gitea Actions 页面手动触发 deploy 工作流。
|
||||
|
||||
---
|
||||
|
||||
## 启用 Gitea Actions
|
||||
|
||||
### Gitea 服务器端配置
|
||||
|
||||
如果你的 Gitea 实例还未启用 Actions,需要管理员配置:
|
||||
|
||||
1. **修改 Gitea 配置文件** (`app.ini`):
|
||||
```ini
|
||||
[actions]
|
||||
ENABLED = true
|
||||
DEFAULT_ACTIONS_URL = https://gitea.com
|
||||
```
|
||||
|
||||
2. **安装 Gitea Act Runner**:
|
||||
```bash
|
||||
# 下载 Act Runner
|
||||
wget https://dl.gitea.com/act_runner/0.2.6/act_runner-0.2.6-linux-amd64
|
||||
chmod +x act_runner-0.2.6-linux-amd64
|
||||
mv act_runner-0.2.6-linux-amd64 /usr/local/bin/act_runner
|
||||
|
||||
# 注册 Runner
|
||||
act_runner register --no-interactive --instance http://120.24.204.180:3000 --token YOUR_RUNNER_TOKEN
|
||||
|
||||
# 启动 Runner
|
||||
act_runner daemon
|
||||
```
|
||||
|
||||
3. **获取 Runner Token**:
|
||||
- 登录 Gitea 管理后台
|
||||
- 进入 Site Administration → Actions → Runners
|
||||
- 点击 "Create new Runner" 获取 Token
|
||||
|
||||
---
|
||||
|
||||
## 自定义工作流
|
||||
|
||||
### 修改触发条件
|
||||
可以根据需要修改工作流的触发条件:
|
||||
|
||||
```yaml
|
||||
on:
|
||||
push:
|
||||
branches: [ main, develop ] # 监听多个分支
|
||||
tags:
|
||||
- 'v*' # 监听标签
|
||||
schedule:
|
||||
- cron: '0 0 * * *' # 定时执行(每天午夜)
|
||||
```
|
||||
|
||||
### 添加环境变量
|
||||
在工作流中使用环境变量:
|
||||
|
||||
```yaml
|
||||
env:
|
||||
JAVA_VERSION: '8'
|
||||
SPRING_PROFILES_ACTIVE: 'prod'
|
||||
|
||||
steps:
|
||||
- name: 运行应用
|
||||
run: java -jar -Dspring.profiles.active=${{ env.SPRING_PROFILES_ACTIVE }} app.jar
|
||||
```
|
||||
|
||||
### 添加通知
|
||||
可以添加构建成功/失败通知:
|
||||
|
||||
```yaml
|
||||
- name: 发送通知
|
||||
if: failure()
|
||||
run: |
|
||||
curl -X POST "https://your-notification-webhook" \
|
||||
-d "构建失败: ${{ github.repository }}"
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 常见问题
|
||||
|
||||
### 1. 工作流未触发?
|
||||
- 检查 Gitea Actions 是否启用
|
||||
- 检查 Act Runner 是否正常运行
|
||||
- 确认触发条件是否匹配
|
||||
|
||||
### 2. 构建失败?
|
||||
- 查看 Actions 日志获取详细错误信息
|
||||
- 检查 Java 版本是否正确
|
||||
- 确认依赖是否能正常下载
|
||||
|
||||
### 3. 部署失败?
|
||||
- 检查 Secrets 配置是否正确
|
||||
- 测试 SSH 连接是否正常
|
||||
- 检查服务器目录权限
|
||||
|
||||
### 4. 如何查看日志?
|
||||
- Gitea 仓库 → Actions 标签页
|
||||
- 点击具体的工作流运行记录
|
||||
- 展开各个步骤查看详细日志
|
||||
|
||||
---
|
||||
|
||||
## 最佳实践
|
||||
|
||||
1. **分支策略**:
|
||||
- `main` 分支自动部署到生产环境
|
||||
- `develop` 分支自动部署到测试环境
|
||||
- Pull Request 只执行构建和测试
|
||||
|
||||
2. **安全性**:
|
||||
- 不要在代码中硬编码密码和密钥
|
||||
- 使用 Secrets 管理敏感信息
|
||||
- 定期轮换 SSH 密钥
|
||||
|
||||
3. **性能优化**:
|
||||
- 启用 Gradle 缓存加快构建速度
|
||||
- 使用 `build -x test` 跳过测试快速构建
|
||||
- 合理设置产物保留时间
|
||||
|
||||
4. **监控**:
|
||||
- 定期检查工作流运行状态
|
||||
- 设置构建失败通知
|
||||
- 保存构建日志便于问题排查
|
||||
|
||||
---
|
||||
|
||||
## 更多资源
|
||||
|
||||
- [Gitea Actions 官方文档](https://docs.gitea.io/en-us/actions/)
|
||||
- [GitHub Actions 语法参考](https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions)(Gitea Actions 兼容 GitHub Actions 语法)
|
||||
- [Act Runner 项目](https://gitea.com/gitea/act_runner)
|
||||
@@ -1,55 +0,0 @@
|
||||
name: CI Build and Test
|
||||
|
||||
# 触发条件:推送到 main 分支或创建 Pull Request
|
||||
on:
|
||||
push:
|
||||
branches: [ main, master ]
|
||||
pull_request:
|
||||
branches: [ main, master ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
# 1. 检出代码
|
||||
- name: 检出代码
|
||||
uses: actions/checkout@v3
|
||||
|
||||
# 2. 设置 Java 环境
|
||||
- name: 设置 Java 8
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
java-version: '8'
|
||||
distribution: 'temurin'
|
||||
cache: 'gradle'
|
||||
|
||||
# 3. 赋予 Gradle wrapper 执行权限
|
||||
- name: 赋予 Gradle wrapper 执行权限
|
||||
run: chmod +x gradlew
|
||||
|
||||
# 4. 构建项目(跳过测试)
|
||||
- name: 使用 Gradle 构建项目
|
||||
run: ./gradlew build -x test
|
||||
|
||||
# 5. 运行测试
|
||||
- name: 运行测试
|
||||
run: ./gradlew test
|
||||
|
||||
# 6. 上传构建产物(JAR 文件)
|
||||
- name: 上传 JAR 包
|
||||
uses: actions/upload-artifact@v3
|
||||
if: success()
|
||||
with:
|
||||
name: corewing-app
|
||||
path: build/libs/*.jar
|
||||
retention-days: 7
|
||||
|
||||
# 7. 上传测试报告
|
||||
- name: 上传测试报告
|
||||
uses: actions/upload-artifact@v3
|
||||
if: always()
|
||||
with:
|
||||
name: test-reports
|
||||
path: build/reports/tests/
|
||||
retention-days: 7
|
||||
@@ -1,80 +0,0 @@
|
||||
name: Deploy to Server
|
||||
|
||||
# 触发条件:手动触发或推送到 main 分支
|
||||
on:
|
||||
push:
|
||||
branches: [ main, master ]
|
||||
workflow_dispatch: # 允许手动触发
|
||||
|
||||
jobs:
|
||||
build-and-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
# 1. 检出代码
|
||||
- name: 检出代码
|
||||
uses: actions/checkout@v3
|
||||
|
||||
# 2. 设置 Java 环境
|
||||
- name: 设置 Java 8
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
java-version: '8'
|
||||
distribution: 'temurin'
|
||||
cache: 'gradle'
|
||||
|
||||
# 3. 赋予 Gradle wrapper 执行权限
|
||||
- name: 赋予 Gradle wrapper 执行权限
|
||||
run: chmod +x gradlew
|
||||
|
||||
# 4. 构建项目
|
||||
- name: 构建项目
|
||||
run: ./gradlew build -x test
|
||||
|
||||
# 5. 打包 JAR 文件
|
||||
- name: 获取 JAR 文件名
|
||||
id: jar
|
||||
run: echo "jar_file=$(ls build/libs/*.jar | head -n 1)" >> $GITHUB_OUTPUT
|
||||
|
||||
# 6. 部署到服务器(使用 SCP)
|
||||
# 需要在 Gitea 仓库设置中配置以下 Secrets:
|
||||
# - SERVER_HOST: 服务器地址
|
||||
# - SERVER_PORT: SSH 端口(默认 22)
|
||||
# - SERVER_USER: SSH 用户名
|
||||
# - SERVER_SSH_KEY: SSH 私钥
|
||||
# - DEPLOY_PATH: 部署路径(如 /opt/corewing)
|
||||
- name: 部署到服务器
|
||||
uses: appleboy/scp-action@master
|
||||
with:
|
||||
host: ${{ secrets.SERVER_HOST }}
|
||||
username: ${{ secrets.SERVER_USER }}
|
||||
key: ${{ secrets.SERVER_SSH_KEY }}
|
||||
port: ${{ secrets.SERVER_PORT }}
|
||||
source: "build/libs/*.jar"
|
||||
target: ${{ secrets.DEPLOY_PATH }}
|
||||
strip_components: 2
|
||||
|
||||
# 7. 重启应用(通过 SSH 执行命令)
|
||||
- name: 重启应用
|
||||
uses: appleboy/ssh-action@master
|
||||
with:
|
||||
host: ${{ secrets.SERVER_HOST }}
|
||||
username: ${{ secrets.SERVER_USER }}
|
||||
key: ${{ secrets.SERVER_SSH_KEY }}
|
||||
port: ${{ secrets.SERVER_PORT }}
|
||||
script: |
|
||||
cd ${{ secrets.DEPLOY_PATH }}
|
||||
# 停止旧进程
|
||||
pkill -f corewing || true
|
||||
# 等待进程完全停止
|
||||
sleep 3
|
||||
# 启动新进程
|
||||
nohup java -jar *.jar > app.log 2>&1 &
|
||||
# 检查启动状态
|
||||
sleep 5
|
||||
if pgrep -f corewing > /dev/null; then
|
||||
echo "应用启动成功"
|
||||
else
|
||||
echo "应用启动失败"
|
||||
exit 1
|
||||
fi
|
||||
12
build.gradle
12
build.gradle
@@ -34,13 +34,25 @@ dependencies {
|
||||
implementation 'com.baomidou:mybatis-plus-generator' // 代码生成器
|
||||
implementation("com.baomidou:mybatis-plus-jsqlparser") // SQL 解析器
|
||||
implementation 'cn.dev33:sa-token-spring-boot-starter:1.44.0' // 权限认证
|
||||
implementation 'cn.dev33:sa-token-redis-template:1.44.0' // Sa-Token 整合 RedisTemplate
|
||||
implementation 'org.apache.commons:commons-pool2' // 提供 Redis 连接池
|
||||
implementation 'com.alibaba:druid-spring-boot-starter:1.2.27' // 数据库连接池
|
||||
implementation 'org.lionsoul:ip2region:2.7.0' // IP 归属地
|
||||
// implementation 'org.springframework.boot:spring-boot-starter-data-mongodb' // mongodb
|
||||
compileOnly 'org.projectlombok:lombok' // Lombok
|
||||
developmentOnly 'org.springframework.boot:spring-boot-devtools' // 热重载
|
||||
runtimeOnly 'com.mysql:mysql-connector-j' // MySQL 驱动
|
||||
annotationProcessor 'org.projectlombok:lombok' // Lombok 注解处理
|
||||
testImplementation 'org.springframework.boot:spring-boot-starter-test' // 测试框架
|
||||
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf' // thymeleaf模版引擎
|
||||
implementation 'com.aliyun.oss:aliyun-sdk-oss:3.18.3' // OSS SDK
|
||||
implementation 'cn.hutool:hutool-all:5.8.42' // hutool工具包
|
||||
implementation 'io.springfox:springfox-swagger2:2.10.5'
|
||||
implementation 'com.github.xiaoymin:knife4j-openapi2-spring-boot-starter:4.4.0'
|
||||
implementation 'org.lionsoul:ip2region:3.3.4'
|
||||
implementation 'jakarta.servlet:jakarta.servlet-api:5.0.0'
|
||||
|
||||
|
||||
}
|
||||
|
||||
tasks.named('test') {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.corewing.app.common;
|
||||
|
||||
import com.corewing.app.util.I18nUtil;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
@@ -16,21 +17,25 @@ public class Result<T> implements Serializable {
|
||||
/**
|
||||
* 状态码
|
||||
*/
|
||||
@ApiModelProperty("状态码")
|
||||
private Integer code;
|
||||
|
||||
/**
|
||||
* 返回消息
|
||||
*/
|
||||
@ApiModelProperty("消息内容")
|
||||
private String message;
|
||||
|
||||
/**
|
||||
* 返回数据
|
||||
*/
|
||||
@ApiModelProperty("数据")
|
||||
private T data;
|
||||
|
||||
/**
|
||||
* 成功标识
|
||||
*/
|
||||
@ApiModelProperty("是否成功")
|
||||
private Boolean success;
|
||||
|
||||
public Result(Integer code, String message, T data, Boolean success) {
|
||||
@@ -54,6 +59,13 @@ public class Result<T> implements Serializable {
|
||||
return new Result<>(200, I18nUtil.getMessage("common.success"), data, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 成功返回(自定义消息)
|
||||
*/
|
||||
public static <T> Result<T> success(String message) {
|
||||
return new Result<>(200, message, null, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 成功返回(自定义消息和数据)
|
||||
*/
|
||||
@@ -81,4 +93,27 @@ public class Result<T> implements Serializable {
|
||||
public static <T> Result<T> error(Integer code, String message) {
|
||||
return new Result<>(code, message, null, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据状态返回信息结果
|
||||
*/
|
||||
public static <T> Result<T> isBool(boolean flag) {
|
||||
return flag ? Result.success() : Result.error();
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据状态返回信息结果(自定义成功消息)
|
||||
*/
|
||||
public static <T> Result<T> isBoolAsMsg(boolean flag, String successMsg) {
|
||||
return flag ? Result.success(successMsg) : Result.error();
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据状态返回信息结果(自定义消息)
|
||||
*/
|
||||
public static <T> Result<T> isBoolAsMsg(boolean flag, String successMsg, String errorMsg) {
|
||||
return flag ? Result.success(successMsg) : Result.error(errorMsg);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
37
src/main/java/com/corewing/app/common/base/BaseEntity.java
Normal file
37
src/main/java/com/corewing/app/common/base/BaseEntity.java
Normal file
@@ -0,0 +1,37 @@
|
||||
package com.corewing.app.common.base;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class BaseEntity {
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private Date createTime;
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String createBy;
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
private Date updateTime;
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
private String updateBy;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
49
src/main/java/com/corewing/app/common/base/CommonEntity.java
Normal file
49
src/main/java/com/corewing/app/common/base/CommonEntity.java
Normal file
@@ -0,0 +1,49 @@
|
||||
package com.corewing.app.common.base;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public class CommonEntity implements Serializable {
|
||||
|
||||
/** 删除标志 */
|
||||
@JsonIgnore
|
||||
@TableLogic
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private String deleteFlag;
|
||||
|
||||
/** 创建时间 */
|
||||
@ApiModelProperty("创建时间")
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private Date createTime;
|
||||
|
||||
/** 创建人 */
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private String createUser;
|
||||
|
||||
/** 创建人名称 */
|
||||
@TableField(exist = false)
|
||||
private String createUserName;
|
||||
|
||||
/** 更新时间 */
|
||||
@ApiModelProperty("更新时间")
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
private Date updateTime;
|
||||
|
||||
/** 更新人 */
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
private String updateUser;
|
||||
|
||||
/** 更新人名称 */
|
||||
@TableField(exist = false)
|
||||
private String updateUserName;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.corewing.app.common.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 通用删除标志枚举
|
||||
*
|
||||
* @author xuyuxiang
|
||||
* @date 2021/10/11 14:02
|
||||
**/
|
||||
@Getter
|
||||
public enum CommonDeleteFlagEnum {
|
||||
|
||||
/** 未删除 */
|
||||
NOT_DELETE,
|
||||
|
||||
/** 已删除 */
|
||||
DELETED
|
||||
}
|
||||
134
src/main/java/com/corewing/app/common/page/PageContext.java
Normal file
134
src/main/java/com/corewing/app/common/page/PageContext.java
Normal file
@@ -0,0 +1,134 @@
|
||||
package com.corewing.app.common.page;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class PageContext {
|
||||
private static final ThreadLocal<PagePool> PAGE_POOL_HOLDER = new ThreadLocal<>();
|
||||
|
||||
private static class PagePool {
|
||||
private final Map<String, Page<?>> pool = new HashMap<>();
|
||||
private int counter = 0;
|
||||
|
||||
public synchronized String generateKey() {
|
||||
return "page_" + (counter++);
|
||||
}
|
||||
|
||||
public Page<?> get(String key) {
|
||||
return pool.get(key);
|
||||
}
|
||||
|
||||
public void put(String key, Page<?> page) {
|
||||
pool.put(key, page);
|
||||
}
|
||||
|
||||
public void remove(String key) {
|
||||
pool.remove(key);
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
pool.clear();
|
||||
counter = 0;
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
return pool.isEmpty();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取一个新的 Page 对象(带唯一key)
|
||||
* 适合单个查询场景
|
||||
*/
|
||||
public static <T> Page<T> getPage(Class<T> clazz) {
|
||||
PagePool pool = getPagePool();
|
||||
String key = pool.generateKey();
|
||||
Page<T> page = new Page<>();
|
||||
pool.put(key, page);
|
||||
return page;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取带有默认分页参数的 Page 对象
|
||||
*/
|
||||
public static <T> Page<T> getPage(Class<T> clazz, Integer current, Integer size) {
|
||||
int pageNum = current != null && current > 0 ? current : 1;
|
||||
int pageSize = size != null && size > 0 ? size : 10;
|
||||
|
||||
PagePool pool = getPagePool();
|
||||
String key = pool.generateKey();
|
||||
Page<T> page = new Page<>(pageNum, pageSize);
|
||||
pool.put(key, page);
|
||||
return page;
|
||||
}
|
||||
|
||||
/**
|
||||
* 注册一个 Page 对象到池中(供 PageInterceptor 使用)
|
||||
*/
|
||||
public static <T> void registerPage(Page<T> page) {
|
||||
PagePool pool = getPagePool();
|
||||
String key = pool.generateKey();
|
||||
pool.put(key, page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取默认的 Page 对象(第一个注册的)
|
||||
* 保持向后兼容性
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public static <T> Page<T> getDefaultPage(Class<T> clazz) {
|
||||
PagePool pool = PAGE_POOL_HOLDER.get();
|
||||
if (pool == null || pool.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// 返回第一个 Page 对象
|
||||
return (Page<T>) pool.pool.values().stream().findFirst().orElse(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过 key 获取 Page 对象
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public static <T> Page<T> getPageByKey(String key) {
|
||||
PagePool pool = PAGE_POOL_HOLDER.get();
|
||||
if (pool == null) {
|
||||
return null;
|
||||
}
|
||||
return (Page<T>) pool.get(key);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取 PagePool
|
||||
*/
|
||||
private static PagePool getPagePool() {
|
||||
PagePool pool = PAGE_POOL_HOLDER.get();
|
||||
if (pool == null) {
|
||||
pool = new PagePool();
|
||||
PAGE_POOL_HOLDER.set(pool);
|
||||
}
|
||||
return pool;
|
||||
}
|
||||
|
||||
/**
|
||||
* 清除指定 key 的 Page 对象
|
||||
*/
|
||||
public static void clearPage(String key) {
|
||||
PagePool pool = PAGE_POOL_HOLDER.get();
|
||||
if (pool != null) {
|
||||
pool.remove(key);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 清除所有
|
||||
*/
|
||||
public static void clear() {
|
||||
PagePool pool = PAGE_POOL_HOLDER.get();
|
||||
if (pool != null) {
|
||||
pool.clear();
|
||||
}
|
||||
PAGE_POOL_HOLDER.remove();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package com.corewing.app.common.page;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.springframework.web.servlet.HandlerInterceptor;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
public class PageInterceptor implements HandlerInterceptor {
|
||||
|
||||
// 默认的 Page key,用于获取默认分页参数
|
||||
public static final String DEFAULT_PAGE_KEY = "default_page";
|
||||
|
||||
@Override
|
||||
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
|
||||
// 默认分页参数
|
||||
int pageNum = 1;
|
||||
int pageSize = 10;
|
||||
|
||||
// 从请求参数中获取分页信息
|
||||
String current = request.getParameter("current");
|
||||
String size = request.getParameter("size");
|
||||
|
||||
// 解析页码
|
||||
if (current != null && !current.isEmpty()) {
|
||||
try {
|
||||
pageNum = Integer.parseInt(current);
|
||||
if (pageNum < 1) pageNum = 1; // 页码不能小于1
|
||||
} catch (NumberFormatException e) {
|
||||
// 非法参数使用默认值
|
||||
}
|
||||
}
|
||||
|
||||
// 解析每页条数
|
||||
if (size != null && !size.isEmpty()) {
|
||||
try {
|
||||
pageSize = Integer.parseInt(size);
|
||||
if (pageSize < 1) pageSize = 10; // 每页条数不能小于1
|
||||
if (pageSize > 100) pageSize = 100; // 限制最大条数
|
||||
} catch (NumberFormatException e) {
|
||||
// 非法参数使用默认值
|
||||
}
|
||||
}
|
||||
|
||||
// 创建 MyBatis-Plus 的 Page 对象并注册到 PagePool
|
||||
Page<?> page = new Page<>(pageNum, pageSize);
|
||||
PageContext.registerPage(page);
|
||||
|
||||
// 将分页参数存储到 request 属性中,方便其他地方使用
|
||||
request.setAttribute("pageNum", pageNum);
|
||||
request.setAttribute("pageSize", pageSize);
|
||||
request.setAttribute("pageCurrent", pageNum); // 兼容 current 参数名
|
||||
request.setAttribute("pageSize", pageSize);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {
|
||||
// 清除ThreadLocal中的数据,防止内存泄漏
|
||||
PageContext.clear();
|
||||
}
|
||||
}
|
||||
39
src/main/java/com/corewing/app/config/CorsConfig.java
Normal file
39
src/main/java/com/corewing/app/config/CorsConfig.java
Normal file
@@ -0,0 +1,39 @@
|
||||
package com.corewing.app.config;
|
||||
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.cors.CorsConfiguration;
|
||||
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
|
||||
import org.springframework.web.filter.CorsFilter;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
|
||||
@Configuration // 标记为配置类
|
||||
public class CorsConfig implements WebMvcConfigurer {
|
||||
|
||||
/**
|
||||
* 配置跨域过滤器,优先级高于所有拦截器
|
||||
*/
|
||||
@Bean
|
||||
public CorsFilter corsFilter() {
|
||||
// 1. 配置跨域参数
|
||||
CorsConfiguration config = new CorsConfiguration();
|
||||
// 允许的前端域名(根据实际环境修改)
|
||||
config.addAllowedOriginPattern("*");
|
||||
// 允许携带 Cookie(前后端都需要开启)
|
||||
config.setAllowCredentials(true);
|
||||
// 允许的请求方法(包含预检请求 OPTIONS)
|
||||
config.addAllowedMethod("*");
|
||||
// 允许的请求头(* 表示所有)
|
||||
config.addAllowedHeader("*");
|
||||
// 预检请求缓存时间(1小时,减少重复验证)
|
||||
config.setMaxAge(3600L);
|
||||
|
||||
// 2. 配置路径匹配规则(对所有接口生效)
|
||||
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
|
||||
source.registerCorsConfiguration("/**", config);
|
||||
|
||||
// 3. 返回过滤器(优先级最高)
|
||||
return new CorsFilter(source);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.corewing.app.config;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import springfox.documentation.builders.ApiInfoBuilder;
|
||||
import springfox.documentation.builders.PathSelectors;
|
||||
import springfox.documentation.builders.RequestHandlerSelectors;
|
||||
import springfox.documentation.service.Contact;
|
||||
import springfox.documentation.spi.DocumentationType;
|
||||
import springfox.documentation.spring.web.plugins.Docket;
|
||||
import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc;
|
||||
|
||||
@Configuration
|
||||
@EnableSwagger2WebMvc
|
||||
public class Knife4jConfiguration {
|
||||
|
||||
@Bean(value = "defaultApi")
|
||||
public Docket defaultApi() {
|
||||
return new Docket(DocumentationType.SWAGGER_2)
|
||||
.apiInfo(new ApiInfoBuilder()
|
||||
.title("CoreWing APP APIs")
|
||||
.description("CoreWing APP APIs")
|
||||
.contact(new Contact("CoreWing", "www.corewing.com", "main@corewing.com"))
|
||||
.version("1.0")
|
||||
.build())
|
||||
//分组名称
|
||||
.groupName("1.1.0版本")
|
||||
.select()
|
||||
//这里指定Controller扫描包路径
|
||||
.apis(RequestHandlerSelectors.basePackage("com.corewing.app.modules"))
|
||||
.paths(PathSelectors.any())
|
||||
.build();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,8 +2,11 @@ package com.corewing.app.config;
|
||||
|
||||
import cn.dev33.satoken.interceptor.SaInterceptor;
|
||||
import cn.dev33.satoken.stp.StpUtil;
|
||||
import com.corewing.app.common.page.PageInterceptor;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.util.ResourceUtils;
|
||||
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
|
||||
/**
|
||||
@@ -17,27 +20,54 @@ public class SaTokenConfig implements WebMvcConfigurer {
|
||||
*/
|
||||
@Override
|
||||
public void addInterceptors(InterceptorRegistry registry) {
|
||||
// 分页参数拦截
|
||||
registry.addInterceptor(new PageInterceptor());
|
||||
// 注册 Sa-Token 拦截器,校验规则为 StpUtil.checkLogin() 登录校验。
|
||||
registry.addInterceptor(new SaInterceptor(handle -> StpUtil.checkLogin()))
|
||||
// 拦截所有路由
|
||||
.addPathPatterns("/**")
|
||||
// 排除登录、注册、发送验证码接口
|
||||
.excludePathPatterns("/user/login", "/user/register", "/user/sendCode")
|
||||
// 排除登录、注册、发送验证码, 忘记密码接口
|
||||
.excludePathPatterns("/user/login", "/user/register", "/user/sendCode", "/user/forgetPassword", "/user/codeLogin")
|
||||
// 排除后台管理登录接口
|
||||
.excludePathPatterns("/sys/user/login")
|
||||
// 排除反馈接口(支持匿名提交)
|
||||
.excludePathPatterns("/feedback", "/feedback/**")
|
||||
// 排除教程接口(支持匿名查询)
|
||||
.excludePathPatterns("/tutorial", "/tutorial/**")
|
||||
// 排除隐私政策接口(支持匿名查询)
|
||||
.excludePathPatterns("/privacy_policy", "/privacy_policy/**")
|
||||
// 排除固件查询接口(不需要登录)
|
||||
.excludePathPatterns("/firmware/**")
|
||||
// 排除公共固件
|
||||
.excludePathPatterns("/public_firmware/**")
|
||||
// 排除系统登录页(不需要登录)
|
||||
// .excludePathPatterns("/loading.html", "/admin/login.html")
|
||||
// 排除静态资源
|
||||
.excludePathPatterns("/", "/index.html", "/*.html", "/*.css", "/*.js", "/*.ico", "/static/**")
|
||||
// 排除后台管理静态资源
|
||||
.excludePathPatterns("/admin/**")
|
||||
.excludePathPatterns("/", "/*.css", "/*.js", "/*.ico", "/static/**", "/assets/**")
|
||||
// 排除接口静态资源
|
||||
.excludePathPatterns("/doc.html", "/webjars/**")
|
||||
.excludePathPatterns("/v3/api-docs/swagger-config", "/v3/api-docs/**", "/swagger-resources")
|
||||
// 排除 Druid 监控
|
||||
.excludePathPatterns("/druid/**")
|
||||
// 排除错误页面
|
||||
.excludePathPatterns("/error", "/error/**");
|
||||
.excludePathPatterns("/error", "/error/**")
|
||||
// 排除校验更新接口
|
||||
.excludePathPatterns("/app_version/**")
|
||||
// 排除获取最新app接口
|
||||
.excludePathPatterns("/api/app", "/api/app/getAppVersion")
|
||||
.excludePathPatterns("/api/website/**")
|
||||
.excludePathPatterns("/api/app/access_statistics/accumulate")
|
||||
.excludePathPatterns("/api/app/resource_category/**")
|
||||
.excludePathPatterns("/api/app/resource/**")
|
||||
// 排除模型接口
|
||||
.excludePathPatterns("/model/page", "/model/list", "/model/detail/**", "/model/category/**")
|
||||
// 排除咨询接口
|
||||
.excludePathPatterns("/contactMsg", "/contactMsg/**");
|
||||
}
|
||||
|
||||
public void addResourceHandlers(ResourceHandlerRegistry registry) {
|
||||
registry.addResourceHandler("doc.html").addResourceLocations(ResourceUtils.CLASSPATH_URL_PREFIX + "/META-INF/resources/");
|
||||
registry.addResourceHandler("/webjars/**").addResourceLocations(ResourceUtils.CLASSPATH_URL_PREFIX + "/META-INF/resources/webjars/");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,76 +0,0 @@
|
||||
package com.corewing.app.controller;
|
||||
|
||||
import cn.dev33.satoken.stp.StpUtil;
|
||||
import com.corewing.app.common.Result;
|
||||
import com.corewing.app.dto.SysLoginRequest;
|
||||
import com.corewing.app.entity.SysUser;
|
||||
import com.corewing.app.service.SysUserService;
|
||||
import com.corewing.app.util.I18nUtil;
|
||||
import com.corewing.app.util.IpUtil;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 后台管理用户 Controller
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/sys/user")
|
||||
public class SysUserController {
|
||||
|
||||
private final SysUserService sysUserService;
|
||||
|
||||
public SysUserController(SysUserService sysUserService) {
|
||||
this.sysUserService = sysUserService;
|
||||
}
|
||||
|
||||
/**
|
||||
* 后台管理登录
|
||||
*/
|
||||
@PostMapping("/login")
|
||||
public Result<Map<String, Object>> login(@RequestBody SysLoginRequest request, HttpServletRequest httpRequest) {
|
||||
try {
|
||||
// 获取登录IP
|
||||
String loginIp = IpUtil.getClientIp(httpRequest);
|
||||
|
||||
// 执行登录
|
||||
String token = sysUserService.login(request.getUsername(), request.getPassword(), loginIp);
|
||||
|
||||
// 查询用户信息
|
||||
SysUser user = sysUserService.getByUsername(request.getUsername());
|
||||
|
||||
Map<String, Object> data = new HashMap<>();
|
||||
data.put("token", token);
|
||||
data.put("userId", user.getId());
|
||||
data.put("username", user.getUsername());
|
||||
data.put("realName", user.getRealName());
|
||||
|
||||
return Result.success(I18nUtil.getMessage("user.login.success"), data);
|
||||
} catch (Exception e) {
|
||||
return Result.error(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 后台管理登出
|
||||
*/
|
||||
@PostMapping("/logout")
|
||||
public Result<String> logout() {
|
||||
StpUtil.logout();
|
||||
return Result.success(I18nUtil.getMessage("user.logout.success"));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前登录用户信息
|
||||
*/
|
||||
@GetMapping("/info")
|
||||
public Result<SysUser> getUserInfo() {
|
||||
Long userId = StpUtil.getLoginIdAsLong();
|
||||
SysUser user = sysUserService.getById(userId);
|
||||
// 隐藏密码
|
||||
user.setPassword(null);
|
||||
return Result.success(user);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.corewing.app.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
@ApiModel("APP统计请求模型")
|
||||
@Data
|
||||
public class AccessStatisticsRequest {
|
||||
|
||||
@ApiModelProperty("访问页面")
|
||||
private String visitPage;
|
||||
|
||||
@ApiModelProperty("访问类型")
|
||||
private String accessType;
|
||||
|
||||
@ApiModelProperty(value = "访问设备", required = true)
|
||||
@NotBlank(message = "访问设备不能为空")
|
||||
private String accessDevice;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.corewing.app.dto.AppModel;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ModelCategoryListRequest {
|
||||
|
||||
@ApiModelProperty(value = "搜索参数(分类名称)")
|
||||
private String searchKey;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.corewing.app.dto.AppModel;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ModelCategoryPageRequest {
|
||||
|
||||
@ApiModelProperty(value = "搜索参数(分类名称)")
|
||||
private String searchKey;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.corewing.app.dto.AppModel;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class ModelCreateRequest {
|
||||
|
||||
@ApiModelProperty(value = "模型标题", required = true)
|
||||
@NotBlank(message = "模型标题不能为空")
|
||||
private String title;
|
||||
|
||||
@ApiModelProperty(value = "模型描述", required = true)
|
||||
@NotBlank(message = "模型描述不能为空")
|
||||
private String description;
|
||||
|
||||
@ApiModelProperty(value = "模型分类id", required = true)
|
||||
@NotBlank(message = "模型分类id不能为空")
|
||||
private String categoryId;
|
||||
|
||||
@ApiModelProperty(value = "模型封面", required = true)
|
||||
@NotBlank(message = "模型封面不能为空")
|
||||
private String coverImage;
|
||||
|
||||
@ApiModelProperty(value = "备注", required = false)
|
||||
private String remark;
|
||||
|
||||
@ApiModelProperty("模型文件")
|
||||
@NotNull(message = "模型文件不能为空")
|
||||
private List<MultipartFile> files;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.corewing.app.dto.AppModel;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ModelDownloadLogListRequest {
|
||||
|
||||
@ApiModelProperty(value = "模型标题", required = false)
|
||||
private String searchKey;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.corewing.app.dto.AppModel;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ModelDownloadLogPageRequest {
|
||||
|
||||
@ApiModelProperty(value = "模型标题", required = false)
|
||||
private String searchKey;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.corewing.app.dto.AppModel;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
@Data
|
||||
public class ModelDownloadRequest {
|
||||
|
||||
@ApiModelProperty(value = "模型id", required = true)
|
||||
@NotBlank(message = "模型id不能为空")
|
||||
private String modelId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.corewing.app.dto.AppModel;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
@Data
|
||||
public class ModelFavoriteListRequest {
|
||||
|
||||
@ApiModelProperty(value = "模型标题", required = false)
|
||||
private String searchKey;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.corewing.app.dto.AppModel;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ModelFavoritePageRequest {
|
||||
|
||||
@ApiModelProperty(value = "模型标题", required = false)
|
||||
private String searchKey;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.corewing.app.dto.AppModel;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
@Data
|
||||
public class ModelFavoriteRequest {
|
||||
|
||||
@ApiModelProperty(value = "模型id", required = true)
|
||||
@NotBlank(message = "模型id不能为空")
|
||||
private String modelId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.corewing.app.dto.AppModel;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
@Data
|
||||
public class ModelIdRequest {
|
||||
|
||||
@ApiModelProperty(value = "模型id", required = true)
|
||||
@NotBlank(message = "模型Id不能为空")
|
||||
private String modelId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.corewing.app.dto.AppModel;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
@Data
|
||||
public class ModelLikeRequest {
|
||||
|
||||
@ApiModelProperty(value = "模型id", required = true)
|
||||
@NotBlank(message = "模型id不能为空")
|
||||
private String modelId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.corewing.app.dto.AppModel;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ModelListRequest {
|
||||
|
||||
@ApiModelProperty(value = "用户id")
|
||||
private Long userId;
|
||||
|
||||
@ApiModelProperty(value = "搜索参数(模型标题)")
|
||||
private String searchKey;
|
||||
|
||||
@ApiModelProperty(value = "模型状态(1正常 0下架 2审核中)")
|
||||
private String status;
|
||||
|
||||
@ApiModelProperty(value = "模型公布状态(1公开 0私有)")
|
||||
private String isPublic;
|
||||
|
||||
@ApiModelProperty(value = "分类id")
|
||||
private String categoryId;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.corewing.app.dto.AppModel;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ModelPageRequest {
|
||||
|
||||
@ApiModelProperty(value = "用户id")
|
||||
private Long userId;
|
||||
|
||||
@ApiModelProperty(value = "搜索参数(模型标题)")
|
||||
private String searchKey;
|
||||
|
||||
@ApiModelProperty(value = "模型状态(1正常 0下架 2审核中)")
|
||||
private String status;
|
||||
|
||||
@ApiModelProperty(value = "模型公布状态(1公开 0私有)")
|
||||
private String isPublic;
|
||||
|
||||
@ApiModelProperty(value = "分类id")
|
||||
private String categoryId;
|
||||
|
||||
}
|
||||
19
src/main/java/com/corewing/app/dto/CheckVersionRequest.java
Normal file
19
src/main/java/com/corewing/app/dto/CheckVersionRequest.java
Normal file
@@ -0,0 +1,19 @@
|
||||
package com.corewing.app.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
@Data
|
||||
public class CheckVersionRequest {
|
||||
|
||||
@NotBlank(message = "版本不能为空")
|
||||
private String localVersion;
|
||||
|
||||
@NotBlank(message = "构建版本不能为空")
|
||||
private int localBuildNumber;
|
||||
|
||||
@NotBlank(message = "类型不能为空")
|
||||
private String type;
|
||||
|
||||
}
|
||||
19
src/main/java/com/corewing/app/dto/CodeLoginRequest.java
Normal file
19
src/main/java/com/corewing/app/dto/CodeLoginRequest.java
Normal file
@@ -0,0 +1,19 @@
|
||||
package com.corewing.app.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
/**
|
||||
* 验证码登录请求对象
|
||||
*/
|
||||
@Data
|
||||
public class CodeLoginRequest {
|
||||
|
||||
@NotBlank(message = "手机号或邮箱不能为空")
|
||||
private String account;
|
||||
|
||||
@NotBlank(message = "验证码不能为空")
|
||||
private String verificationCode;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.corewing.app.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
@Data
|
||||
public class DeviceActivationRequest {
|
||||
|
||||
@ApiModelProperty(value = "MAC地址", required = true)
|
||||
@NotBlank(message = "MAC地址不能为空")
|
||||
private String mac;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.corewing.app.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
@Data
|
||||
public class ForgetPasswordRequest {
|
||||
|
||||
@NotBlank(message = "手机号或邮箱不能为空")
|
||||
private String account;
|
||||
|
||||
@NotBlank(message = "验证码不能为空")
|
||||
private String verificationCode;
|
||||
|
||||
@NotBlank(message = "密码不能为空")
|
||||
private String password;
|
||||
|
||||
}
|
||||
13
src/main/java/com/corewing/app/dto/LogoffRequest.java
Normal file
13
src/main/java/com/corewing/app/dto/LogoffRequest.java
Normal file
@@ -0,0 +1,13 @@
|
||||
package com.corewing.app.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
@Data
|
||||
public class LogoffRequest {
|
||||
|
||||
@NotBlank(message = "验证码不能为空")
|
||||
private String code;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.corewing.app.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ResourceCategoryTreeRequest {
|
||||
}
|
||||
14
src/main/java/com/corewing/app/dto/ResourcePageRequest.java
Normal file
14
src/main/java/com/corewing/app/dto/ResourcePageRequest.java
Normal file
@@ -0,0 +1,14 @@
|
||||
package com.corewing.app.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ResourcePageRequest {
|
||||
|
||||
@ApiModelProperty(value = "搜索参数")
|
||||
private String searchKey;
|
||||
|
||||
@ApiModelProperty(value = "分类id")
|
||||
private String categoryId;
|
||||
}
|
||||
2
src/main/java/com/corewing/app/dto/SendCodeRequest.java
Normal file → Executable file
2
src/main/java/com/corewing/app/dto/SendCodeRequest.java
Normal file → Executable file
@@ -17,7 +17,7 @@ public class SendCodeRequest {
|
||||
private String account;
|
||||
|
||||
/**
|
||||
* 验证码类型:register-注册, login-登录, reset-重置密码
|
||||
* 验证码类型:register-注册, login-登录, reset-重置密码, forget-忘记密码,logoff-注销
|
||||
*/
|
||||
@NotBlank(message = "验证码类型不能为空")
|
||||
private String type;
|
||||
|
||||
47
src/main/java/com/corewing/app/dto/TrajectoryData.java
Normal file
47
src/main/java/com/corewing/app/dto/TrajectoryData.java
Normal file
@@ -0,0 +1,47 @@
|
||||
package com.corewing.app.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class TrajectoryData {
|
||||
private Long id;
|
||||
private Long session_id;
|
||||
private Long timestamp;
|
||||
|
||||
// 基础遥测数据
|
||||
private Long rc;
|
||||
private Long gps;
|
||||
private Long gps_status;
|
||||
private double voltage;
|
||||
private double cell_voltage;
|
||||
private Long consumption;
|
||||
private double current;
|
||||
private double speed;
|
||||
private double air_speed;
|
||||
private double v_speed;
|
||||
private double altitude;
|
||||
private double distance;
|
||||
private double range;
|
||||
private Long throttle;
|
||||
private Long wind_direction;
|
||||
private double wind_speed;
|
||||
private Long heading;
|
||||
private double roll;
|
||||
private double pitch;
|
||||
private double yaw;
|
||||
|
||||
// 扩展数据
|
||||
private double compass_heading;
|
||||
private double drone_lat;
|
||||
private double drone_lon;
|
||||
private double home_lat;
|
||||
private double home_lon;
|
||||
private String map_type;
|
||||
private Boolean show_trajectory;
|
||||
private String flight_mode;
|
||||
private Long vehicle_type;
|
||||
private Long autopilot_type;
|
||||
private Boolean is_armed;
|
||||
|
||||
private String sync_id;
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.corewing.app.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class TutorialListRequest {
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.corewing.app.dto.publicFirmware;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
@Data
|
||||
public class PublicBoardTypeListRequest {
|
||||
|
||||
@ApiModelProperty(value = "固件类型", required = true)
|
||||
@NotBlank(message = "固件类型不能为空")
|
||||
public String firmwareType;
|
||||
|
||||
@ApiModelProperty(value = "固件版本id", required = true)
|
||||
@NotBlank(message = "固件版本id不能为空")
|
||||
public String versionId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.corewing.app.dto.publicFirmware;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
@Data
|
||||
public class PublicFirmwareListRequest {
|
||||
|
||||
@ApiModelProperty(value = "固件类型", required = true)
|
||||
@NotBlank(message = "固件类型不能为空")
|
||||
public String firmwareType;
|
||||
|
||||
@ApiModelProperty(value = "固件版本id", required = true)
|
||||
@NotBlank(message = "固件版本id不能为空")
|
||||
public String versionId;
|
||||
|
||||
@ApiModelProperty(value = "板载类型", required = true)
|
||||
@NotBlank(message = "板载类型不能为空")
|
||||
public String boardType;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.corewing.app.dto.publicFirmware;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
@Data
|
||||
public class PublicFirmwareVersionListRequest {
|
||||
|
||||
@ApiModelProperty(value = "固件类型", required = true)
|
||||
@NotBlank(message = "固件类型不能为空")
|
||||
public String firmwareType;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.corewing.app.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class uploadReplaySessionRequest {
|
||||
|
||||
private Long id;
|
||||
private String name;
|
||||
private String description;
|
||||
private Long start_time;
|
||||
private Long end_time;
|
||||
private Long duration; // 持续时间(秒)
|
||||
private Long data_count; // 数据点数量
|
||||
private Date created_at;
|
||||
private Date updated_at;
|
||||
private String sync_id;
|
||||
List<TrajectoryData> trajectoryDataList;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.corewing.app.dto.website;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
@Data
|
||||
public class ProductCategoryRequest {
|
||||
|
||||
@ApiModelProperty(value = "产品名称")
|
||||
private String searchKey;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.corewing.app.dto.website;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
@Data
|
||||
public class ProductPageRequest {
|
||||
|
||||
@ApiModelProperty(value = "产品名称")
|
||||
private String searchKey;
|
||||
|
||||
@ApiModelProperty(value = "产品分类")
|
||||
private String categoryId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package com.corewing.app.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.corewing.app.common.base.CommonEntity;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@ApiModel("APP访问统计")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@TableName("app_access_statistics")
|
||||
public class AppAccessStatistics extends CommonEntity {
|
||||
|
||||
@ApiModelProperty("id")
|
||||
@TableId
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty("用户id")
|
||||
private Long userId;
|
||||
|
||||
@ApiModelProperty("访问页面")
|
||||
private String visitPage;
|
||||
|
||||
@ApiModelProperty("访问类型")
|
||||
private String accessType;
|
||||
|
||||
@ApiModelProperty("访问设备")
|
||||
private String accessDevice;
|
||||
|
||||
@ApiModelProperty("设备型号")
|
||||
private String deviceModel;
|
||||
|
||||
@ApiModelProperty("设备系统")
|
||||
private String deviceSystem;
|
||||
|
||||
@ApiModelProperty("设备品牌")
|
||||
private String deviceBrand;
|
||||
|
||||
@ApiModelProperty("访问IP")
|
||||
private String accessIp;
|
||||
|
||||
@ApiModelProperty("访问地址")
|
||||
private String accessAddress;
|
||||
|
||||
@ApiModelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@ApiModelProperty("扩展参数")
|
||||
private String extJson;
|
||||
|
||||
|
||||
}
|
||||
71
src/main/java/com/corewing/app/entity/AppModel.java
Normal file
71
src/main/java/com/corewing/app/entity/AppModel.java
Normal file
@@ -0,0 +1,71 @@
|
||||
package com.corewing.app.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.corewing.app.common.base.CommonEntity;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@TableName("app_model")
|
||||
public class AppModel extends CommonEntity {
|
||||
|
||||
@TableId
|
||||
@ApiModelProperty("模型id")
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty("用户id")
|
||||
private Long userId;
|
||||
|
||||
@ApiModelProperty("模型标题")
|
||||
private String title;
|
||||
|
||||
@ApiModelProperty("模型描述")
|
||||
private String description;
|
||||
|
||||
@ApiModelProperty("分类id")
|
||||
private String categoryId;
|
||||
|
||||
@ApiModelProperty("模型封面(base64)")
|
||||
private String coverImage;
|
||||
|
||||
@ApiModelProperty("是否公开:(1公开,0私有)")
|
||||
private String isPublic;
|
||||
|
||||
@ApiModelProperty("状态:(1正常,0下架,2审核中)")
|
||||
private String status;
|
||||
|
||||
@ApiModelProperty("下载次数")
|
||||
private int downloadCount;
|
||||
|
||||
@ApiModelProperty("点赞次数")
|
||||
private int likeCount;
|
||||
|
||||
@ApiModelProperty("收藏次数")
|
||||
private int favoriteCount;
|
||||
|
||||
@ApiModelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@ApiModelProperty("扩展参数")
|
||||
private String extJson;
|
||||
|
||||
@ApiModelProperty("暂未使用【点击详情接口获取文件模型】")
|
||||
@TableField(exist = false)
|
||||
private List<AppModelFile> modelFile;
|
||||
|
||||
/**
|
||||
* 分类名称
|
||||
*/
|
||||
@ApiModelProperty("分类名称")
|
||||
@TableField(exist = false)
|
||||
private String categoryTitle;
|
||||
|
||||
|
||||
}
|
||||
35
src/main/java/com/corewing/app/entity/AppModelCategory.java
Normal file
35
src/main/java/com/corewing/app/entity/AppModelCategory.java
Normal file
@@ -0,0 +1,35 @@
|
||||
package com.corewing.app.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.corewing.app.common.base.CommonEntity;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@TableName("app_model_category")
|
||||
public class AppModelCategory extends CommonEntity {
|
||||
|
||||
@TableId
|
||||
@ApiModelProperty("分类id")
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty("分类名称")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty("父级id")
|
||||
private String parentId;
|
||||
|
||||
@ApiModelProperty("排序码")
|
||||
private int sortCode;
|
||||
|
||||
@ApiModelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@ApiModelProperty("扩展参数")
|
||||
private String extJson;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.corewing.app.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.corewing.app.common.base.CommonEntity;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@TableName("app_model_download_log")
|
||||
public class AppModelDownloadLog extends CommonEntity {
|
||||
|
||||
@TableId
|
||||
@ApiModelProperty("id")
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty("用户id")
|
||||
private Long userId;
|
||||
|
||||
@ApiModelProperty("模型id")
|
||||
private String modelId;
|
||||
|
||||
@ApiModelProperty("下载ip")
|
||||
private String ipAddress;
|
||||
|
||||
@ApiModelProperty("下载备注")
|
||||
private String remark;
|
||||
|
||||
@ApiModelProperty("扩展参数")
|
||||
private String extJson;
|
||||
|
||||
|
||||
}
|
||||
25
src/main/java/com/corewing/app/entity/AppModelFavorite.java
Normal file
25
src/main/java/com/corewing/app/entity/AppModelFavorite.java
Normal file
@@ -0,0 +1,25 @@
|
||||
package com.corewing.app.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.corewing.app.common.base.CommonEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@TableName("app_model_favorite")
|
||||
public class AppModelFavorite extends CommonEntity {
|
||||
|
||||
@TableId
|
||||
private Long id;
|
||||
|
||||
private Long userId;
|
||||
|
||||
private String modelId;
|
||||
|
||||
private String remark;
|
||||
|
||||
private String extJson;
|
||||
|
||||
}
|
||||
38
src/main/java/com/corewing/app/entity/AppModelFile.java
Normal file
38
src/main/java/com/corewing/app/entity/AppModelFile.java
Normal file
@@ -0,0 +1,38 @@
|
||||
package com.corewing.app.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.corewing.app.common.base.CommonEntity;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@TableName("app_model_file")
|
||||
public class AppModelFile extends CommonEntity {
|
||||
|
||||
@TableId
|
||||
@ApiModelProperty("id")
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty("模型id")
|
||||
private String modelId;
|
||||
|
||||
@ApiModelProperty("文件名称")
|
||||
private String fileName;
|
||||
|
||||
@ApiModelProperty("文件类型")
|
||||
private String fileType;
|
||||
|
||||
@ApiModelProperty("文件大小")
|
||||
private Long fileSize;
|
||||
|
||||
@ApiModelProperty("文件地址")
|
||||
private String fileUrl;
|
||||
|
||||
@ApiModelProperty("文件排序")
|
||||
private int sortCode;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
package com.corewing.app.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.corewing.app.common.base.CommonEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 固件详情表
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@TableName("app_public_firmware_plane")
|
||||
public class AppPublicFirmwarePlane extends CommonEntity {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 版本号Id
|
||||
*/
|
||||
private String versionId;
|
||||
|
||||
/**
|
||||
* 板载类型
|
||||
*/
|
||||
private String boardType;
|
||||
|
||||
/**
|
||||
* 固件类型
|
||||
*/
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 固件下载地址
|
||||
*/
|
||||
private String downloadUrl;
|
||||
|
||||
/**
|
||||
* 固件名称
|
||||
*/
|
||||
private String firmwareName;
|
||||
|
||||
/**
|
||||
* 固件大小
|
||||
*/
|
||||
private Long fileSize;
|
||||
|
||||
/**
|
||||
* 固件发布时间
|
||||
*/
|
||||
private Date releaseTime;
|
||||
|
||||
/**
|
||||
* 固件同步时间
|
||||
*/
|
||||
private Date crawlTime;
|
||||
|
||||
/**
|
||||
* 是否有效
|
||||
*/
|
||||
private int isValid;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private int sortCode;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 扩展字段
|
||||
*/
|
||||
private String extJson;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.corewing.app.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.corewing.app.common.base.CommonEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 公共固件版本表
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@TableName("app_public_firmware_version")
|
||||
public class AppPublicFirmwareVersion extends CommonEntity {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId
|
||||
public String id;
|
||||
|
||||
/**
|
||||
* 固件版本类型
|
||||
*/
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 版本类型
|
||||
*/
|
||||
private String versionType;
|
||||
|
||||
/**
|
||||
* 版本号
|
||||
*/
|
||||
private String versionNumber;
|
||||
|
||||
/**
|
||||
* 数字版本号
|
||||
*/
|
||||
private int versionCode;
|
||||
|
||||
/**
|
||||
* 发布时间
|
||||
*/
|
||||
private Date releaseDate;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private int sortCode;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 扩展字段
|
||||
*/
|
||||
private String extJson;
|
||||
|
||||
}
|
||||
38
src/main/java/com/corewing/app/entity/AppVersion.java
Normal file
38
src/main/java/com/corewing/app/entity/AppVersion.java
Normal file
@@ -0,0 +1,38 @@
|
||||
package com.corewing.app.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* app版本控制
|
||||
*/
|
||||
@Data
|
||||
@TableName("app_version")
|
||||
public class AppVersion {
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
private String version;
|
||||
|
||||
private int versionNumber;
|
||||
|
||||
private int buildNumber;
|
||||
|
||||
private String updateContent;
|
||||
|
||||
private String downloadUrl;
|
||||
|
||||
private String type;
|
||||
|
||||
private Integer status;
|
||||
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
40
src/main/java/com/corewing/app/entity/BizDevice.java
Normal file
40
src/main/java/com/corewing/app/entity/BizDevice.java
Normal file
@@ -0,0 +1,40 @@
|
||||
package com.corewing.app.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.corewing.app.common.base.CommonEntity;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 设备表
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@TableName("biz_device")
|
||||
public class BizDevice extends CommonEntity {
|
||||
|
||||
@TableId
|
||||
@ApiModelProperty("设备id")
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty("设备mac地址")
|
||||
private String deviceMac;
|
||||
|
||||
@ApiModelProperty("状态")
|
||||
private String status;
|
||||
|
||||
@ApiModelProperty("公布状态")
|
||||
private String publicStatus;
|
||||
|
||||
@ApiModelProperty("排序")
|
||||
private int sortCode;
|
||||
|
||||
@ApiModelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@ApiModelProperty("扩展字段")
|
||||
private String extJson;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.corewing.app.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.corewing.app.common.base.CommonEntity;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 设备激活表
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@TableName("biz_device_activation")
|
||||
public class BizDeviceActivation extends CommonEntity {
|
||||
|
||||
@TableId
|
||||
@ApiModelProperty("激活id")
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty("设备mac地址")
|
||||
private String deviceMac;
|
||||
|
||||
@ApiModelProperty("设备id")
|
||||
private String deviceId;
|
||||
|
||||
@ApiModelProperty("激活时间")
|
||||
private Date activationTime;
|
||||
|
||||
@ApiModelProperty("用户id")
|
||||
private Long userId;
|
||||
|
||||
@ApiModelProperty("激活ip")
|
||||
private String activationIp;
|
||||
|
||||
@ApiModelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@ApiModelProperty("扩展字段")
|
||||
private String extJson;
|
||||
|
||||
}
|
||||
38
src/main/java/com/corewing/app/entity/BizDeviceCategory.java
Normal file
38
src/main/java/com/corewing/app/entity/BizDeviceCategory.java
Normal file
@@ -0,0 +1,38 @@
|
||||
package com.corewing.app.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.corewing.app.common.base.CommonEntity;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 设备型号表
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@TableName("biz_device_category")
|
||||
public class BizDeviceCategory extends CommonEntity {
|
||||
|
||||
@TableId
|
||||
@ApiModelProperty("设备型号id")
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty("设备型号缩略图")
|
||||
private String thumbnail;
|
||||
|
||||
@ApiModelProperty("设备型号名称")
|
||||
private String categoryName;
|
||||
|
||||
@ApiModelProperty("排序")
|
||||
private int sortCode;
|
||||
|
||||
@ApiModelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@ApiModelProperty("扩展字段")
|
||||
private String extJson;
|
||||
|
||||
|
||||
}
|
||||
50
src/main/java/com/corewing/app/entity/BizDict.java
Normal file
50
src/main/java/com/corewing/app/entity/BizDict.java
Normal file
@@ -0,0 +1,50 @@
|
||||
package com.corewing.app.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldStrategy;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.corewing.app.common.base.CommonEntity;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* 字典实体
|
||||
*
|
||||
* @author xuyuxiang
|
||||
* @date 2022/2/23 18:27
|
||||
**/
|
||||
@Getter
|
||||
@Setter
|
||||
@TableName("DEV_DICT")
|
||||
public class BizDict extends CommonEntity {
|
||||
|
||||
/** id */
|
||||
@ApiModelProperty("id")
|
||||
private String id;
|
||||
|
||||
/** 父id */
|
||||
@ApiModelProperty("父级id")
|
||||
private String parentId;
|
||||
|
||||
/** 字典文字 */
|
||||
@ApiModelProperty("字典文字")
|
||||
private String dictLabel;
|
||||
|
||||
/** 字典值 */
|
||||
@ApiModelProperty("字典值")
|
||||
private String dictValue;
|
||||
|
||||
/** 分类 */
|
||||
@ApiModelProperty("分类")
|
||||
private String category;
|
||||
|
||||
/** 排序码 */
|
||||
@ApiModelProperty("排序码")
|
||||
private Integer sortCode;
|
||||
|
||||
/** 扩展信息 */
|
||||
@ApiModelProperty("扩展信息")
|
||||
@TableField(insertStrategy = FieldStrategy.ALWAYS, updateStrategy = FieldStrategy.ALWAYS)
|
||||
private String extJson;
|
||||
}
|
||||
59
src/main/java/com/corewing/app/entity/BizProduct.java
Normal file
59
src/main/java/com/corewing/app/entity/BizProduct.java
Normal file
@@ -0,0 +1,59 @@
|
||||
package com.corewing.app.entity;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.corewing.app.common.base.CommonEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@TableName("biz_product")
|
||||
public class BizProduct extends CommonEntity {
|
||||
|
||||
@TableId
|
||||
private String id;
|
||||
|
||||
private String title;
|
||||
|
||||
private String description;
|
||||
|
||||
private String thumbnail;
|
||||
|
||||
private String hotStatus;
|
||||
|
||||
private String showType;
|
||||
|
||||
private String content;
|
||||
|
||||
private String tag;
|
||||
|
||||
private String detailUrl;
|
||||
|
||||
private BigDecimal amount;
|
||||
|
||||
private String status;
|
||||
|
||||
private int sortCode;
|
||||
|
||||
private String remark;
|
||||
|
||||
private String extJson;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String categoryId;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String[] features;
|
||||
|
||||
public String[] getFeatures() {
|
||||
if(StrUtil.isNotBlank(tag)) {
|
||||
return tag.split(",");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.corewing.app.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.corewing.app.common.base.CommonEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@TableName("biz_product_category")
|
||||
public class BizProductCategory extends CommonEntity {
|
||||
|
||||
@TableId
|
||||
private String id;
|
||||
|
||||
private String parentId;
|
||||
|
||||
private String thumbnail;
|
||||
|
||||
private String categoryTitle;
|
||||
|
||||
private String description;
|
||||
|
||||
private String status;
|
||||
|
||||
private Integer sortCode;
|
||||
|
||||
private String remark;
|
||||
|
||||
private String extJson;
|
||||
|
||||
@TableField(exist = false)
|
||||
Page<BizProduct> productPage;
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.corewing.app.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@TableName("biz_product_category_relation")
|
||||
public class BizProductCategoryRelation {
|
||||
|
||||
@TableId
|
||||
private String id;
|
||||
|
||||
private String productId;
|
||||
|
||||
private String categoryId;
|
||||
|
||||
}
|
||||
44
src/main/java/com/corewing/app/entity/BizResource.java
Normal file
44
src/main/java/com/corewing/app/entity/BizResource.java
Normal file
@@ -0,0 +1,44 @@
|
||||
package com.corewing.app.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.corewing.app.common.base.CommonEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class BizResource extends CommonEntity {
|
||||
|
||||
@TableId
|
||||
private String id;
|
||||
|
||||
private String thumbnail;
|
||||
|
||||
private String title;
|
||||
|
||||
private String fileName;
|
||||
|
||||
private String categoryId;
|
||||
|
||||
private String subtitle;
|
||||
|
||||
private String content;
|
||||
|
||||
private String status;
|
||||
|
||||
private String version;
|
||||
|
||||
private String downloadUrl;
|
||||
|
||||
private Integer sortCode;
|
||||
|
||||
private String remark;
|
||||
|
||||
private String extJson;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String categoryName;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.corewing.app.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.corewing.app.common.base.CommonEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class BizResourceCategory extends CommonEntity {
|
||||
|
||||
@TableId
|
||||
private String id;
|
||||
|
||||
private String categoryName;
|
||||
|
||||
private String parentId;
|
||||
|
||||
private Integer sortCode;
|
||||
|
||||
private String remark;
|
||||
|
||||
private String extJson;
|
||||
|
||||
}
|
||||
52
src/main/java/com/corewing/app/entity/ContactMsg.java
Normal file
52
src/main/java/com/corewing/app/entity/ContactMsg.java
Normal file
@@ -0,0 +1,52 @@
|
||||
package com.corewing.app.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.corewing.app.common.base.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.springframework.data.annotation.Id;
|
||||
|
||||
/**
|
||||
* 联系消息
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@TableName("app_contact_msg")
|
||||
public class ContactMsg extends BaseEntity {
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 咨询人
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 咨询类型
|
||||
*/
|
||||
private int category;
|
||||
|
||||
/**
|
||||
* 联系方式
|
||||
*/
|
||||
private String contact;
|
||||
|
||||
/**
|
||||
* 咨询内容
|
||||
*/
|
||||
private String msg;
|
||||
|
||||
/**
|
||||
* 咨询状态
|
||||
*/
|
||||
private int status;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -55,6 +55,16 @@ public class Feedback implements Serializable {
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 反馈IP
|
||||
*/
|
||||
private String submitIp;
|
||||
|
||||
/**
|
||||
* 反馈地址
|
||||
*/
|
||||
private String submitRegion;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@@ -66,4 +76,34 @@ public class Feedback implements Serializable {
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 用户昵称
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String nickName;
|
||||
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String username;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String statusName;
|
||||
|
||||
public String getStatusName() {
|
||||
switch (status) {
|
||||
case 0:
|
||||
return "待处理";
|
||||
case 1:
|
||||
return "处理中";
|
||||
case 2:
|
||||
return "已完成";
|
||||
case 3:
|
||||
return "已关闭";
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
62
src/main/java/com/corewing/app/entity/FeedbackLog.java
Normal file
62
src/main/java/com/corewing/app/entity/FeedbackLog.java
Normal file
@@ -0,0 +1,62 @@
|
||||
package com.corewing.app.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 反馈日志
|
||||
*/
|
||||
@Data
|
||||
@TableName("app_feedback_log")
|
||||
public class FeedbackLog implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 反馈用户id
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* oss地址
|
||||
*/
|
||||
private String ossPath;
|
||||
|
||||
/**
|
||||
* 日志文件大小
|
||||
*/
|
||||
private Long logSize;
|
||||
|
||||
/**
|
||||
* 反馈日志内容
|
||||
*/
|
||||
private String logContent;
|
||||
|
||||
/**
|
||||
* 日志文件名称
|
||||
*/
|
||||
private String logName;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
@@ -61,4 +61,20 @@ public class Firmware implements Serializable {
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String firmwareTypeName;
|
||||
|
||||
public String getFirmwareTypeName() {
|
||||
switch (firmwareType) {
|
||||
case 1:
|
||||
return "调参固件";
|
||||
case 2:
|
||||
return "AP固件";
|
||||
case 3:
|
||||
return "INAV固件";
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -70,6 +70,21 @@ public class ParamsCenter implements Serializable {
|
||||
*/
|
||||
private Integer downloadCount;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 审核状态
|
||||
*/
|
||||
private String auditStatus;
|
||||
|
||||
/**
|
||||
* 失败原因
|
||||
*/
|
||||
private String auditErrorMsg;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@@ -79,6 +94,6 @@ public class ParamsCenter implements Serializable {
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
private LocalDateTime updateTime;
|
||||
}
|
||||
|
||||
48
src/main/java/com/corewing/app/entity/PrivacyPolicy.java
Normal file
48
src/main/java/com/corewing/app/entity/PrivacyPolicy.java
Normal file
@@ -0,0 +1,48 @@
|
||||
package com.corewing.app.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.corewing.app.common.base.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 隐私政策实体
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@TableName("app_privacy_policy")
|
||||
public class PrivacyPolicy extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 隐私政策id
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 隐私政策名称
|
||||
*/
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* 隐私政策内容
|
||||
*/
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* 是否显示
|
||||
*/
|
||||
private Integer visible;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sort;
|
||||
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
private Integer category;
|
||||
}
|
||||
80
src/main/java/com/corewing/app/entity/ReplaySession.java
Normal file
80
src/main/java/com/corewing/app/entity/ReplaySession.java
Normal file
@@ -0,0 +1,80 @@
|
||||
package com.corewing.app.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.corewing.app.dto.TrajectoryData;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@TableName("app_replay_session")
|
||||
public class ReplaySession {
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
private String syncId;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* oss地址
|
||||
*/
|
||||
private String ossPath;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 开始时间戳
|
||||
*/
|
||||
private Long startTime;
|
||||
|
||||
/**
|
||||
* 结束时间戳
|
||||
*/
|
||||
private Long endTime;
|
||||
|
||||
/**
|
||||
* 持续时间
|
||||
*/
|
||||
private Long duration;
|
||||
|
||||
/**
|
||||
* 数据点
|
||||
*/
|
||||
private Long dataCount;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createdAt;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updatedAt;
|
||||
|
||||
/**
|
||||
* 轨迹数据点
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
List<TrajectoryData> trajectoryDataList;
|
||||
}
|
||||
57
src/main/java/com/corewing/app/entity/SysMenu.java
Normal file
57
src/main/java/com/corewing/app/entity/SysMenu.java
Normal file
@@ -0,0 +1,57 @@
|
||||
package com.corewing.app.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.corewing.app.common.base.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@TableName("sys_menu")
|
||||
public class SysMenu extends BaseEntity implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 菜单id
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 菜单名称
|
||||
*/
|
||||
private String menuName;
|
||||
|
||||
/**
|
||||
* 菜单地址
|
||||
*/
|
||||
private String menuUrl;
|
||||
|
||||
/**
|
||||
* 菜单图标
|
||||
*/
|
||||
private String menuIcon;
|
||||
|
||||
/**
|
||||
* 菜单分类
|
||||
*/
|
||||
private String menuCategory;
|
||||
|
||||
/**
|
||||
* 是否隐藏
|
||||
*/
|
||||
private boolean visible;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private int sort;
|
||||
|
||||
|
||||
|
||||
}
|
||||
31
src/main/java/com/corewing/app/entity/SysOption.java
Normal file
31
src/main/java/com/corewing/app/entity/SysOption.java
Normal file
@@ -0,0 +1,31 @@
|
||||
package com.corewing.app.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.corewing.app.common.base.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@TableName("sys_option")
|
||||
public class SysOption extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 键名
|
||||
*/
|
||||
private String key;
|
||||
|
||||
/**
|
||||
* 键值
|
||||
*/
|
||||
private String value;
|
||||
|
||||
}
|
||||
@@ -1,12 +1,11 @@
|
||||
package com.corewing.app.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
@@ -39,6 +38,11 @@ public class Tutorial implements Serializable {
|
||||
*/
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* 知识库地址
|
||||
*/
|
||||
private String knowledgeUrl;
|
||||
|
||||
/**
|
||||
* 查看次数
|
||||
*/
|
||||
@@ -62,12 +66,23 @@ public class Tutorial implements Serializable {
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 教程分类id
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private Long categoryId;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String categoryName;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
package com.corewing.app.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 教程分类
|
||||
@@ -27,6 +27,11 @@ public class TutorialCategory implements Serializable {
|
||||
*/
|
||||
private String icon;
|
||||
|
||||
/**
|
||||
* 颜色
|
||||
*/
|
||||
private String color;
|
||||
|
||||
/**
|
||||
* 分类名称
|
||||
*/
|
||||
@@ -60,11 +65,19 @@ public class TutorialCategory implements Serializable {
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
public static final String typeCategory = "category";
|
||||
public static final String typeTag = "tag";
|
||||
|
||||
@TableField(exist = false)
|
||||
private List<Tutorial> tutorials;
|
||||
|
||||
}
|
||||
|
||||
@@ -25,6 +25,11 @@ public class User implements Serializable {
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 用户昵称
|
||||
*/
|
||||
private String nickName;
|
||||
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,116 @@
|
||||
package com.corewing.app.handler;
|
||||
|
||||
import cn.dev33.satoken.stp.StpUtil;
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.util.EnumUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
|
||||
import com.corewing.app.common.enums.CommonDeleteFlagEnum;
|
||||
import org.apache.ibatis.reflection.MetaObject;
|
||||
import org.apache.ibatis.reflection.ReflectionException;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* MyBatis-Plus 自动填充处理器
|
||||
* 兼容 Date 和 LocalDateTime 两种时间类型的自动填充
|
||||
*/
|
||||
@Component
|
||||
public class CustomMetaObjectHandler implements MetaObjectHandler {
|
||||
|
||||
/** 删除标志 */
|
||||
private static final String DELETE_FLAG = "deleteFlag";
|
||||
|
||||
/** 创建人 */
|
||||
private static final String CREATE_USER = "createUser";
|
||||
|
||||
/** 创建时间 */
|
||||
private static final String CREATE_TIME = "createTime";
|
||||
|
||||
/** 更新人 */
|
||||
private static final String UPDATE_USER = "updateUser";
|
||||
|
||||
/** 更新时间 */
|
||||
private static final String UPDATE_TIME = "updateTime";
|
||||
|
||||
@Override
|
||||
public void insertFill(MetaObject metaObject) {
|
||||
try {
|
||||
//为空则设置deleteFlag
|
||||
Object deleteFlag = metaObject.getValue(DELETE_FLAG);
|
||||
if (ObjectUtil.isNull(deleteFlag)) {
|
||||
setFieldValByName(DELETE_FLAG, EnumUtil.toString(CommonDeleteFlagEnum.NOT_DELETE), metaObject);
|
||||
}
|
||||
} catch (ReflectionException ignored) { }
|
||||
|
||||
try {
|
||||
//为空则设置createUser
|
||||
Object createUser = metaObject.getValue(CREATE_USER);
|
||||
if (ObjectUtil.isNull(createUser)) {
|
||||
setFieldValByName(CREATE_USER, this.getUserId(), metaObject);
|
||||
}
|
||||
} catch (ReflectionException ignored) { }
|
||||
|
||||
try {
|
||||
// 兼容 Date 和 LocalDateTime 类型的 createTime 填充
|
||||
fillTimeField(metaObject, CREATE_TIME);
|
||||
} catch (ReflectionException ignored) { }
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateFill(MetaObject metaObject) {
|
||||
try {
|
||||
//设置updateUser
|
||||
setFieldValByName(UPDATE_USER, this.getUserId(), metaObject);
|
||||
} catch (ReflectionException ignored) {
|
||||
}
|
||||
|
||||
try {
|
||||
// 兼容 Date 和 LocalDateTime 类型的 updateTime 填充
|
||||
fillTimeField(metaObject, UPDATE_TIME);
|
||||
} catch (ReflectionException ignored) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 统一填充时间字段(自动识别 Date/LocalDateTime 类型)
|
||||
* @param metaObject 元对象
|
||||
* @param fieldName 时间字段名(createTime/updateTime)
|
||||
*/
|
||||
private void fillTimeField(MetaObject metaObject, String fieldName) {
|
||||
// 先判断字段是否为空
|
||||
Object fieldValue = metaObject.getValue(fieldName);
|
||||
if (ObjectUtil.isNotNull(fieldValue)) {
|
||||
return; // 字段已有值,不填充
|
||||
}
|
||||
|
||||
// 获取字段的类型,自动匹配填充值类型
|
||||
Class<?> fieldType = metaObject.getGetterType(fieldName);
|
||||
if (fieldType == LocalDateTime.class) {
|
||||
// 字段是 LocalDateTime 类型
|
||||
setFieldValByName(fieldName, LocalDateTime.now(), metaObject);
|
||||
} else if (fieldType == Date.class || fieldType == DateTime.class) {
|
||||
// 字段是 Date/hutool DateTime 类型
|
||||
setFieldValByName(fieldName, new Date(), metaObject);
|
||||
}
|
||||
// 其他类型不处理(避免填充错误)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户id
|
||||
*/
|
||||
private String getUserId() {
|
||||
try {
|
||||
String loginId = StpUtil.getLoginIdAsString();
|
||||
if (ObjectUtil.isNotEmpty(loginId)) {
|
||||
return loginId;
|
||||
} else {
|
||||
return "-1";
|
||||
}
|
||||
} catch (Exception e) {
|
||||
return "-1";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -50,10 +50,10 @@ public class GlobalExceptionHandler {
|
||||
* 处理其他异常
|
||||
*/
|
||||
@ExceptionHandler(Exception.class)
|
||||
@ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
|
||||
// @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
|
||||
public Result<String> handleException(Exception e) {
|
||||
log.error(e.getMessage());
|
||||
return Result.error(HttpStatus.INTERNAL_SERVER_ERROR.value(),
|
||||
I18nUtil.getMessage("error.server.internal", e.getMessage()));
|
||||
e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
package com.corewing.app.handler;
|
||||
|
||||
import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
|
||||
import org.apache.ibatis.reflection.MetaObject;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* MyBatis-Plus 自动填充处理器
|
||||
* 用于自动填充创建时间和更新时间
|
||||
*/
|
||||
@Component
|
||||
public class MyMetaObjectHandler implements MetaObjectHandler {
|
||||
|
||||
/**
|
||||
* 插入时的填充策略
|
||||
*/
|
||||
@Override
|
||||
public void insertFill(MetaObject metaObject) {
|
||||
// 自动填充创建时间
|
||||
this.strictInsertFill(metaObject, "createTime", LocalDateTime.class, LocalDateTime.now());
|
||||
// 自动填充更新时间
|
||||
this.strictInsertFill(metaObject, "updateTime", LocalDateTime.class, LocalDateTime.now());
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新时的填充策略
|
||||
*/
|
||||
@Override
|
||||
public void updateFill(MetaObject metaObject) {
|
||||
// 自动填充更新时间
|
||||
this.strictUpdateFill(metaObject, "updateTime", LocalDateTime.class, LocalDateTime.now());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.corewing.app.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.corewing.app.entity.AppAccessStatistics;
|
||||
import org.mapstruct.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface AppAccessStatisticsMapper extends BaseMapper<AppAccessStatistics> {
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.corewing.app.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.corewing.app.dto.AppModel.ModelCategoryListRequest;
|
||||
import com.corewing.app.dto.AppModel.ModelCategoryPageRequest;
|
||||
import com.corewing.app.entity.AppModelCategory;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface AppModelCategoryMapper extends BaseMapper<AppModelCategory> {
|
||||
Page<AppModelCategory> page(Page<AppModelCategory> page, @Param("modelCategoryPageRequest") ModelCategoryPageRequest modelCategoryPageRequest);
|
||||
|
||||
List<AppModelCategory> list(@Param("modelCategoryListRequest") ModelCategoryListRequest modelCategoryListRequest);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.corewing.app.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.corewing.app.entity.AppModelDownloadLog;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface AppModelDownloadLogMapper extends BaseMapper<AppModelDownloadLog> {
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.corewing.app.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.corewing.app.entity.AppModelFavorite;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface AppModelFavoriteMapper extends BaseMapper<AppModelFavorite> {
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.corewing.app.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.corewing.app.entity.AppModelFile;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface AppModelFileMapper extends BaseMapper<AppModelFile> {
|
||||
}
|
||||
28
src/main/java/com/corewing/app/mapper/AppModelMapper.java
Normal file
28
src/main/java/com/corewing/app/mapper/AppModelMapper.java
Normal file
@@ -0,0 +1,28 @@
|
||||
package com.corewing.app.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.corewing.app.dto.AppModel.*;
|
||||
import com.corewing.app.entity.AppModel;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface AppModelMapper extends BaseMapper<AppModel> {
|
||||
|
||||
Page<AppModel> page(Page<AppModel> page, @Param("modelPageRequest") ModelPageRequest modelPageRequest);
|
||||
|
||||
List<AppModel> list(@Param("modelListRequest") ModelListRequest modelListRequest);
|
||||
|
||||
AppModel getModelById(@Param("modelId") String modelId);
|
||||
|
||||
List<AppModel> favoriteList(@Param("userId") Long userId, @Param("modelFavoriteListRequest") ModelFavoriteListRequest modelFavoriteListRequest);
|
||||
|
||||
Page<AppModel> favoritePage(Page<AppModel> page, @Param("userId") Long userId, @Param("modelFavoritePageRequest") ModelFavoritePageRequest modelFavoritePageRequest);
|
||||
|
||||
List<AppModel> downloadLogList(@Param("userId") Long userId, @Param("modelDownloadLogListRequest") ModelDownloadLogListRequest modelDownloadLogListRequest);
|
||||
|
||||
Page<AppModel> downloadLogPage(Page<AppModel> page, @Param("userId") Long userId, @Param("modelDownloadLogPageRequest") ModelDownloadLogPageRequest modelDownloadLogPageRequest);
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.corewing.app.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.corewing.app.entity.AppPublicFirmwarePlane;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface AppPublicFirmwarePlaneMapper extends BaseMapper<AppPublicFirmwarePlane> {
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.corewing.app.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.corewing.app.entity.AppPublicFirmwareVersion;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface AppPublicFirmwareVersionMapper extends BaseMapper<AppPublicFirmwareVersion> {
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.corewing.app.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.corewing.app.entity.AppVersion;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface AppVersionMapper extends BaseMapper<AppVersion> {
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.corewing.app.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.corewing.app.entity.BizDeviceActivation;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface BizDeviceActivationMapper extends BaseMapper<BizDeviceActivation> {
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.corewing.app.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.corewing.app.entity.BizDeviceCategory;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface BizDeviceCategoryMapper extends BaseMapper<BizDeviceCategory> {
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.corewing.app.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.corewing.app.entity.BizDevice;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface BizDeviceMapper extends BaseMapper<BizDevice> {
|
||||
}
|
||||
9
src/main/java/com/corewing/app/mapper/BizDictMapper.java
Normal file
9
src/main/java/com/corewing/app/mapper/BizDictMapper.java
Normal file
@@ -0,0 +1,9 @@
|
||||
package com.corewing.app.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.corewing.app.entity.BizDict;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface BizDictMapper extends BaseMapper<BizDict> {
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.corewing.app.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.corewing.app.dto.website.ProductCategoryRequest;
|
||||
import com.corewing.app.entity.BizProductCategory;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface BizProductCategoryMapper extends BaseMapper<BizProductCategory> {
|
||||
|
||||
|
||||
}
|
||||
14
src/main/java/com/corewing/app/mapper/BizProductMapper.java
Normal file
14
src/main/java/com/corewing/app/mapper/BizProductMapper.java
Normal file
@@ -0,0 +1,14 @@
|
||||
package com.corewing.app.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.corewing.app.dto.website.ProductPageRequest;
|
||||
import com.corewing.app.entity.BizProduct;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
@Mapper
|
||||
public interface BizProductMapper extends BaseMapper<BizProduct> {
|
||||
|
||||
Page<BizProduct> page(Page<BizProduct> page, @Param("productPageRequest") ProductPageRequest productPageRequest);
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.corewing.app.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.corewing.app.entity.BizResourceCategory;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface BizResourceCategoryMapper extends BaseMapper<BizResourceCategory> {
|
||||
|
||||
}
|
||||
13
src/main/java/com/corewing/app/mapper/BizResourceMapper.java
Normal file
13
src/main/java/com/corewing/app/mapper/BizResourceMapper.java
Normal file
@@ -0,0 +1,13 @@
|
||||
package com.corewing.app.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.corewing.app.dto.ResourcePageRequest;
|
||||
import com.corewing.app.entity.BizResource;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
@Mapper
|
||||
public interface BizResourceMapper extends BaseMapper<BizResource> {
|
||||
Page<BizResource> page(Page<BizResource> page, @Param("resourcePageRequest") ResourcePageRequest resourcePageRequest);
|
||||
}
|
||||
10
src/main/java/com/corewing/app/mapper/ContactMsgMapper.java
Normal file
10
src/main/java/com/corewing/app/mapper/ContactMsgMapper.java
Normal file
@@ -0,0 +1,10 @@
|
||||
package com.corewing.app.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.corewing.app.entity.ContactMsg;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface ContactMsgMapper extends BaseMapper<ContactMsg> {
|
||||
|
||||
}
|
||||
10
src/main/java/com/corewing/app/mapper/FeedbackLogMapper.java
Normal file
10
src/main/java/com/corewing/app/mapper/FeedbackLogMapper.java
Normal file
@@ -0,0 +1,10 @@
|
||||
package com.corewing.app.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.corewing.app.entity.FeedbackLog;
|
||||
import lombok.Data;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface FeedbackLogMapper extends BaseMapper<FeedbackLog> {
|
||||
}
|
||||
@@ -1,8 +1,10 @@
|
||||
package com.corewing.app.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.corewing.app.entity.Feedback;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 问题反馈 Mapper 接口
|
||||
@@ -10,4 +12,5 @@ import org.apache.ibatis.annotations.Mapper;
|
||||
@Mapper
|
||||
public interface FeedbackMapper extends BaseMapper<Feedback> {
|
||||
|
||||
Page<Feedback> page(Page<Feedback> page, @Param("feedback") Feedback feedback);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.corewing.app.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.corewing.app.entity.PrivacyPolicy;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface PrivacyPolicyMapper extends BaseMapper<PrivacyPolicy> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.corewing.app.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.corewing.app.entity.ReplaySession;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface ReplaySessionMapper extends BaseMapper<ReplaySession> {
|
||||
}
|
||||
9
src/main/java/com/corewing/app/mapper/SysMenuMapper.java
Normal file
9
src/main/java/com/corewing/app/mapper/SysMenuMapper.java
Normal file
@@ -0,0 +1,9 @@
|
||||
package com.corewing.app.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.corewing.app.entity.SysMenu;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface SysMenuMapper extends BaseMapper<SysMenu> {
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user