fix swagger
32
Frontend/.gitignore
vendored
@@ -1,14 +1,24 @@
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
pnpm-debug.log*
|
||||
lerna-debug.log*
|
||||
|
||||
node_modules
|
||||
dist
|
||||
.DS_Store
|
||||
*.log
|
||||
.vscode
|
||||
dist-ssr
|
||||
*.local
|
||||
|
||||
# Editor directories and files
|
||||
.vscode/*
|
||||
!.vscode/extensions.json
|
||||
.idea
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.DS_Store
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
||||
|
||||
3
Frontend/.vscode/extensions.json
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"recommendations": ["Vue.volar"]
|
||||
}
|
||||
@@ -1,142 +0,0 @@
|
||||
# 快速开始指南
|
||||
|
||||
## 安装和运行
|
||||
|
||||
1. **安装依赖**
|
||||
```bash
|
||||
npm install
|
||||
```
|
||||
|
||||
2. **启动开发服务器**
|
||||
```bash
|
||||
npm run dev
|
||||
```
|
||||
|
||||
3. **访问应用**
|
||||
浏览器会自动打开 http://localhost:3000
|
||||
|
||||
## 使用流程
|
||||
|
||||
### 第一步:注册账号
|
||||
1. 访问登录页面,点击"还没有账号?立即注册"
|
||||
2. 填写账号、密码、确认密码和姓名
|
||||
3. 点击注册,自动登录并跳转到主页
|
||||
|
||||
### 第二步:创建或加入房间
|
||||
**创建房间:**
|
||||
1. 在主页"创建房间"卡片中,输入房间名称
|
||||
2. 点击"创建房间"按钮
|
||||
3. 自动进入房间,成为主持人
|
||||
|
||||
**加入房间:**
|
||||
1. 在主页"加入房间"卡片中,输入房间号
|
||||
2. 点击"加入房间"按钮
|
||||
3. 自动进入房间,成为玩家
|
||||
|
||||
### 第三步:使用骰子系统
|
||||
|
||||
**玩家初始投掷(4个D4):**
|
||||
1. 进入房间后,玩家会看到"玩家初始投掷(4个D4)"区域
|
||||
2. 点击"投掷4个D4"按钮
|
||||
3. 查看投掷结果,显示4个骰子的值
|
||||
4. 如果3的数量少于3个:
|
||||
- 可以输入消耗的属性值来增加3的数量
|
||||
- 如果最终达到3个3,不会产生混沌值
|
||||
- 否则,每个不是3的D4会产生1点混沌值
|
||||
5. 点击"确认投掷结果"完成初始投掷
|
||||
|
||||
**普通投掷:**
|
||||
- 在"选择骰子类型"区域,点击对应的骰子按钮(D3/D4/D6/D12/D20)
|
||||
- 投掷结果会显示在投掷历史中
|
||||
|
||||
**混沌值管理(仅主持人):**
|
||||
- 混沌值显示在页面顶部,所有人可见
|
||||
- 主持人可以点击"消耗混沌值"按钮来消耗混沌值
|
||||
|
||||
### 第四步:总部/分部管理
|
||||
|
||||
1. 在主页点击"总部/分部管理"
|
||||
2. **创建分部**(需要经理权限):
|
||||
- 点击"创建分部"按钮
|
||||
- 填写分部名称和负责人
|
||||
- 点击确定
|
||||
3. **发布招聘信息**(需要经理权限):
|
||||
- 在右侧"招聘信息"卡片中,点击"发布招聘"
|
||||
- 填写标题和内容
|
||||
- 点击确定
|
||||
4. **查看分部信息**:
|
||||
- 点击分部列表中的"查看详情"
|
||||
- 可以看到该分部的天气、散一端等信息
|
||||
|
||||
### 第五步:异常管理
|
||||
|
||||
1. 在主页点击"异常管理"
|
||||
2. **添加异常**:
|
||||
- 点击"添加异常"按钮
|
||||
- 填写异常信息:
|
||||
- 异常名称
|
||||
- 类型(实体/概念/地点/现象)
|
||||
- 特殊能力
|
||||
- 焦点
|
||||
- 领域(现实/记忆/时间/空间/生命/死亡/知识/情感)
|
||||
- 点击确定
|
||||
3. **收容异常**:
|
||||
- 在"未收容异常"列表中,点击"收容"按钮
|
||||
- 异常会移动到"已收容异常"列表
|
||||
4. **解决异常**:
|
||||
- 在"已收容异常"列表中,点击"标记为已解决"
|
||||
- 异常会移动到"已解决异常"列表
|
||||
5. **设置天气**:
|
||||
- 在"天气系统"卡片中,输入天气信息
|
||||
- 点击"设置天气"按钮
|
||||
|
||||
## 功能说明
|
||||
|
||||
### 混沌值规则(TRTC三角洲机构规则)
|
||||
|
||||
1. **初始投掷规则**:
|
||||
- 玩家开始时必须投掷4个D4
|
||||
- 如果投出的4个D4中,3的数量达到3个(可通过消耗属性值达到),则不会产生混沌值
|
||||
- 如果3的数量少于3个,每个不是3的D4会产生1点混沌值
|
||||
|
||||
2. **混沌值显示**:
|
||||
- 混沌值显示在房间页面顶部,所有玩家可见
|
||||
- 只有主持人可以消耗混沌值
|
||||
|
||||
3. **普通投掷**:
|
||||
- 普通投掷不会自动产生混沌值(除非特殊规则)
|
||||
|
||||
### 数据存储
|
||||
|
||||
- 当前版本使用浏览器的localStorage进行数据存储
|
||||
- 所有数据保存在本地浏览器中
|
||||
- 刷新页面后数据会保留
|
||||
- 清除浏览器数据会丢失所有信息
|
||||
|
||||
## 注意事项
|
||||
|
||||
1. **房间号分享**:创建房间后,可以点击"复制房间号"按钮分享给其他玩家
|
||||
2. **角色权限**:
|
||||
- 主持人:可以消耗混沌值
|
||||
- 玩家:可以投掷骰子,但不能消耗混沌值
|
||||
- 经理:可以创建分部、发布招聘信息
|
||||
3. **数据同步**:当前版本是纯前端应用,多个浏览器标签页之间的数据不会实时同步
|
||||
|
||||
## 常见问题
|
||||
|
||||
**Q: 如何切换账号?**
|
||||
A: 点击右上角"退出"按钮,然后使用其他账号登录。
|
||||
|
||||
**Q: 房间数据会丢失吗?**
|
||||
A: 数据保存在浏览器localStorage中,除非清除浏览器数据,否则不会丢失。
|
||||
|
||||
**Q: 可以多人同时使用吗?**
|
||||
A: 当前版本是纯前端,多人使用时需要各自在浏览器中操作,数据不会实时同步。如需实时同步,需要集成WebSocket或后端API。
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,140 +1,5 @@
|
||||
# 三角洲机构 - TRPG跑团在线工具
|
||||
# Vue 3 + Vite
|
||||
|
||||
基于Vue3 + Ant Design Vue构建的TRPG跑团在线工具网站,遵循TRTC三角洲机构规则。
|
||||
|
||||
## 功能特性
|
||||
|
||||
### 用户系统
|
||||
- 用户注册/登录(账号、密码、姓名)
|
||||
- 用户信息管理
|
||||
|
||||
### 房间系统
|
||||
- 创建房间,房间号可分享
|
||||
- 加入房间(通过房间号)
|
||||
- 房间内角色:主持人(Host)和玩家(PL)
|
||||
- 房间信息展示
|
||||
|
||||
### 骰子系统
|
||||
- 支持常见骰子:D3、D4、D6、D12、D20
|
||||
- 玩家初始投掷:4个D4
|
||||
- **混沌值机制**:
|
||||
- 每个不是3的D4给主持人加1点混沌值
|
||||
- 玩家投出3个3(可通过消耗属性值达到)不会产生混沌值
|
||||
- 每个不是3的骰子都会变成混沌值
|
||||
- 混沌值所有人可见
|
||||
- 主持人可以消耗混沌值
|
||||
- 投掷历史记录
|
||||
|
||||
### 总部/分部管理系统
|
||||
- 创建分部
|
||||
- 解散分部
|
||||
- 发布招聘信息(经理权限)
|
||||
- 查看招聘信息(所有分部成员)
|
||||
- 分部信息管理(散一端、天气系统)
|
||||
|
||||
### 异常管理系统
|
||||
- 添加异常(名称、类型、特殊能力、焦点、领域)
|
||||
- 异常收容
|
||||
- 异常解决
|
||||
- 异常分类:未收容、已收容、已解决
|
||||
- 天气系统设置
|
||||
- 散一端管理
|
||||
|
||||
## 技术栈
|
||||
|
||||
- Vue 3 (Composition API)
|
||||
- Ant Design Vue 4.x
|
||||
- Vue Router 4
|
||||
- Pinia (状态管理)
|
||||
- Vite (构建工具)
|
||||
|
||||
## 项目结构
|
||||
|
||||
```
|
||||
src/
|
||||
├── views/ # 页面组件
|
||||
│ ├── Login.vue # 登录页
|
||||
│ ├── Register.vue # 注册页
|
||||
│ ├── Home.vue # 主页
|
||||
│ ├── Room.vue # 房间页
|
||||
│ ├── Organization.vue # 总部/分部管理
|
||||
│ └── Anomaly.vue # 异常管理
|
||||
├── stores/ # Pinia状态管理
|
||||
│ ├── user.js # 用户状态
|
||||
│ ├── room.js # 房间状态
|
||||
│ ├── organization.js # 组织状态
|
||||
│ └── anomaly.js # 异常状态
|
||||
├── router/ # 路由配置
|
||||
├── utils/ # 工具函数
|
||||
└── main.js # 入口文件
|
||||
```
|
||||
|
||||
## 快速开始
|
||||
|
||||
### 安装依赖
|
||||
|
||||
```bash
|
||||
npm install
|
||||
```
|
||||
|
||||
### 开发运行
|
||||
|
||||
```bash
|
||||
npm run dev
|
||||
```
|
||||
|
||||
访问 http://localhost:3000
|
||||
|
||||
### 构建生产版本
|
||||
|
||||
```bash
|
||||
npm run build
|
||||
```
|
||||
|
||||
## 使用说明
|
||||
|
||||
### 1. 注册/登录
|
||||
- 首次使用需要注册账号(账号、密码、姓名)
|
||||
- 注册成功后自动登录
|
||||
|
||||
### 2. 创建/加入房间
|
||||
- 在主页可以创建新房间或通过房间号加入现有房间
|
||||
- 创建房间后自动成为主持人
|
||||
- 房间号可以分享给其他玩家
|
||||
|
||||
### 3. 使用骰子系统
|
||||
- **玩家初始投掷**:进入房间后,玩家可以投掷4个D4
|
||||
- **混沌值规则**:
|
||||
- 如果投出的4个D4中,3的数量少于3个,会产生混沌值
|
||||
- 玩家可以通过消耗属性值来增加3的数量
|
||||
- 如果最终达到3个3,则不会产生混沌值
|
||||
- 每个不是3的D4会产生1点混沌值
|
||||
- **普通投掷**:可以选择D3/D4/D6/D12/D20进行投掷
|
||||
- **消耗混沌值**:只有主持人可以消耗混沌值
|
||||
|
||||
### 4. 总部/分部管理
|
||||
- 经理可以创建分部、发布招聘信息
|
||||
- 所有成员可以查看招聘信息
|
||||
- 每个分部可以设置天气和散一端
|
||||
|
||||
### 5. 异常管理
|
||||
- 添加异常时需要填写:名称、类型、特殊能力、焦点、领域
|
||||
- 异常类型:实体、概念、地点、现象
|
||||
- 异常领域:现实、记忆、时间、空间、生命、死亡、知识、情感
|
||||
- 异常状态流转:未收容 → 已收容 → 已解决
|
||||
|
||||
## 注意事项
|
||||
|
||||
- 当前版本使用localStorage进行数据存储(纯前端)
|
||||
- 刷新页面后数据会保留
|
||||
- 如需后端支持,需要对接相应的API接口
|
||||
|
||||
## 开发计划
|
||||
|
||||
- [ ] WebSocket实时通信
|
||||
- [ ] 后端API集成
|
||||
- [ ] 数据持久化
|
||||
- [ ] 更多骰子类型和规则
|
||||
- [ ] 角色属性管理
|
||||
- [ ] 跑团记录导出
|
||||
This template should help get you started developing with Vue 3 in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.
|
||||
|
||||
Learn more about IDE Support for Vue in the [Vue Docs Scaling up Guide](https://vuejs.org/guide/scaling-up/tooling.html#ide-support).
|
||||
|
||||
10
Frontend/controller/auth-controller/postApiAuthLogin.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import request from "../../src/api/http.js";
|
||||
import { type LoginResponse, type DeepRequired, type LoginRequest } from "../../interface";
|
||||
import { type AxiosRequestConfig } from "axios";
|
||||
|
||||
/**
|
||||
* /api/auth/login
|
||||
*/
|
||||
export function postApiAuthLogin(input: LoginRequest, config?: AxiosRequestConfig) {
|
||||
return request.post<DeepRequired<LoginResponse>>(`/api/auth/login`, input, config);
|
||||
}
|
||||
10
Frontend/controller/auth-controller/postApiAuthLogout.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import request from "../../src/api/http.js";
|
||||
import { type ApiResponse, type DeepRequired } from "../../interface";
|
||||
import { type AxiosRequestConfig } from "axios";
|
||||
|
||||
/**
|
||||
* /api/auth/logout
|
||||
*/
|
||||
export function postApiAuthLogout(config?: AxiosRequestConfig) {
|
||||
return request.post<DeepRequired<ApiResponse>>(`/api/auth/logout`, config);
|
||||
}
|
||||
122
Frontend/docs.json
Normal file
@@ -0,0 +1,122 @@
|
||||
{
|
||||
"openapi": "3.0.1",
|
||||
"info": {
|
||||
"title": "TrangleAgent API",
|
||||
"description": "TrangleAgent API Documentation",
|
||||
"version": "v1"
|
||||
},
|
||||
"servers": [
|
||||
{
|
||||
"url": "http://localhost:8080",
|
||||
"description": "Generated server url"
|
||||
}
|
||||
],
|
||||
"paths": {
|
||||
"/api/auth/login": {
|
||||
"post": {
|
||||
"tags": [
|
||||
"auth-controller"
|
||||
],
|
||||
"operationId": "login",
|
||||
"requestBody": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/LoginRequest"
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": true
|
||||
},
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/LoginResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/auth/logout": {
|
||||
"post": {
|
||||
"tags": [
|
||||
"auth-controller"
|
||||
],
|
||||
"operationId": "logout",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/ApiResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"components": {
|
||||
"schemas": {
|
||||
"LoginRequest": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"username": {
|
||||
"type": "string"
|
||||
},
|
||||
"password": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"LoginResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"token": {
|
||||
"type": "string"
|
||||
},
|
||||
"user": {
|
||||
"$ref": "#/components/schemas/User"
|
||||
}
|
||||
}
|
||||
},
|
||||
"User": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "integer",
|
||||
"format": "int64"
|
||||
},
|
||||
"username": {
|
||||
"type": "string"
|
||||
},
|
||||
"email": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"ApiResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"code": {
|
||||
"type": "integer",
|
||||
"format": "int32"
|
||||
},
|
||||
"message": {
|
||||
"type": "string"
|
||||
},
|
||||
"data": {
|
||||
"type": "object"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,21 +1,13 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>三角洲机构 - TRPG跑团工具</title>
|
||||
<title>trangleagent</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script type="module" src="/src/main.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
1030
Frontend/package-lock.json
generated
@@ -1,32 +1,23 @@
|
||||
{
|
||||
"name": "trangle-agent",
|
||||
"version": "1.0.0",
|
||||
"description": "TRPG跑团在线工具网站 - 三角洲机构",
|
||||
"name": "trangleagent",
|
||||
"private": true,
|
||||
"version": "0.0.0",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "vite build",
|
||||
"preview": "vite preview"
|
||||
"preview": "vite preview",
|
||||
"swagger:generate": "zerone api -p ./src/api"
|
||||
},
|
||||
"dependencies": {
|
||||
"vue": "^3.4.21",
|
||||
"vue-router": "^4.3.0",
|
||||
"pinia": "^2.1.7",
|
||||
"ant-design-vue": "^4.2.1",
|
||||
"@ant-design/icons-vue": "^7.0.1",
|
||||
"axios": "^1.6.7"
|
||||
"ant-design-vue": "^4.2.6",
|
||||
"axios": "^1.7.9",
|
||||
"vue": "^3.5.24",
|
||||
"vue-router": "^4.4.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vitejs/plugin-vue": "^5.0.4",
|
||||
"vite": "^5.1.4",
|
||||
"sass": "^1.71.1"
|
||||
"@vitejs/plugin-vue": "^6.0.1",
|
||||
"vite": "^7.2.4"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
BIN
Frontend/public/File/Blue/A7.png
Normal file
|
After Width: | Height: | Size: 246 KiB |
BIN
Frontend/public/File/Blue/G8.png
Normal file
|
After Width: | Height: | Size: 462 KiB |
BIN
Frontend/public/File/Blue/H3.png
Normal file
|
After Width: | Height: | Size: 579 KiB |
BIN
Frontend/public/File/Blue/H4-2.png
Normal file
|
After Width: | Height: | Size: 449 KiB |
BIN
Frontend/public/File/Blue/H4.png
Normal file
|
After Width: | Height: | Size: 669 KiB |
BIN
Frontend/public/File/Blue/L10-O8.png
Normal file
|
After Width: | Height: | Size: 527 KiB |
BIN
Frontend/public/File/Blue/L10.png
Normal file
|
After Width: | Height: | Size: 534 KiB |
BIN
Frontend/public/File/Blue/N1.png
Normal file
|
After Width: | Height: | Size: 538 KiB |
BIN
Frontend/public/File/Blue/Q2.png
Normal file
|
After Width: | Height: | Size: 608 KiB |
BIN
Frontend/public/File/Blue/U2.png
Normal file
|
After Width: | Height: | Size: 714 KiB |
BIN
Frontend/public/File/Blue/X1.png
Normal file
|
After Width: | Height: | Size: 462 KiB |
BIN
Frontend/public/File/Blue/X2.png
Normal file
|
After Width: | Height: | Size: 653 KiB |
BIN
Frontend/public/File/Blue/Z1.png
Normal file
|
After Width: | Height: | Size: 509 KiB |
BIN
Frontend/public/File/Red/A3.png
Normal file
|
After Width: | Height: | Size: 282 KiB |
BIN
Frontend/public/File/Red/D4.png
Normal file
|
After Width: | Height: | Size: 517 KiB |
BIN
Frontend/public/File/Red/G3.png
Normal file
|
After Width: | Height: | Size: 276 KiB |
BIN
Frontend/public/File/Red/J2退休.png
Normal file
|
After Width: | Height: | Size: 534 KiB |
BIN
Frontend/public/File/Red/J3.png
Normal file
|
After Width: | Height: | Size: 944 KiB |
BIN
Frontend/public/File/Red/N3.png
Normal file
|
After Width: | Height: | Size: 474 KiB |
BIN
Frontend/public/File/Red/Q3.png
Normal file
|
After Width: | Height: | Size: 631 KiB |
BIN
Frontend/public/File/Red/T3.png
Normal file
|
After Width: | Height: | Size: 546 KiB |
BIN
Frontend/public/File/Red/T7.png
Normal file
|
After Width: | Height: | Size: 448 KiB |
BIN
Frontend/public/File/Red/W8-2.png
Normal file
|
After Width: | Height: | Size: 569 KiB |
BIN
Frontend/public/File/Red/W8.png
Normal file
|
After Width: | Height: | Size: 538 KiB |
BIN
Frontend/public/File/Red/Y2.png
Normal file
|
After Width: | Height: | Size: 262 KiB |
BIN
Frontend/public/File/Red/Z3.png
Normal file
|
After Width: | Height: | Size: 565 KiB |
BIN
Frontend/public/File/Yellow/C4.png
Normal file
|
After Width: | Height: | Size: 460 KiB |
BIN
Frontend/public/File/Yellow/E2.png
Normal file
|
After Width: | Height: | Size: 700 KiB |
BIN
Frontend/public/File/Yellow/E3.png
Normal file
|
After Width: | Height: | Size: 98 KiB |
BIN
Frontend/public/File/Yellow/H5.png
Normal file
|
After Width: | Height: | Size: 744 KiB |
BIN
Frontend/public/File/Yellow/L11.png
Normal file
|
After Width: | Height: | Size: 638 KiB |
BIN
Frontend/public/File/Yellow/N2.png
Normal file
|
After Width: | Height: | Size: 644 KiB |
BIN
Frontend/public/File/Yellow/O4.png
Normal file
|
After Width: | Height: | Size: 707 KiB |
BIN
Frontend/public/File/Yellow/T6.png
Normal file
|
After Width: | Height: | Size: 620 KiB |
BIN
Frontend/public/File/Yellow/V2.png
Normal file
|
After Width: | Height: | Size: 816 KiB |
BIN
Frontend/public/File/Yellow/X3.png
Normal file
|
After Width: | Height: | Size: 750 KiB |
BIN
Frontend/public/File/Yellow/Z2.png
Normal file
|
After Width: | Height: | Size: 612 KiB |
1
Frontend/public/vite.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
|
||||
|
After Width: | Height: | Size: 1.5 KiB |
@@ -1,35 +1,3 @@
|
||||
<template>
|
||||
<router-view />
|
||||
<RouterView />
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
// App根组件
|
||||
</script>
|
||||
|
||||
<style>
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
|
||||
'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol',
|
||||
'Noto Color Emoji';
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
#app {
|
||||
min-height: 100vh;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
55
Frontend/src/api/README.md
Normal file
@@ -0,0 +1,55 @@
|
||||
# Swagger 文档自动生成配置说明
|
||||
|
||||
本文档介绍了如何使用 Swagger/OpenAPI 文档自动生成 TypeScript 接口和服务代码。
|
||||
|
||||
## 安装全局 CLI 工具
|
||||
|
||||
```bash
|
||||
npm install -g @zeronejs/cli
|
||||
```
|
||||
|
||||
## 配置文件
|
||||
|
||||
在项目中创建 `swagger.config.json` 文件:
|
||||
|
||||
```json
|
||||
{
|
||||
"docsUrl": "./docs.json",
|
||||
"axiosInstanceUrl": "./src/api/http.js"
|
||||
}
|
||||
```
|
||||
|
||||
其中:
|
||||
- `docsUrl`: 指向 Swagger 的 JSON 文档地址,可以是远程 URL 或本地文件路径
|
||||
- `axiosInstanceUrl`: 指向项目中 Axios 实例的位置
|
||||
|
||||
## 使用方法
|
||||
|
||||
### 生成 TypeScript 代码
|
||||
|
||||
```bash
|
||||
# 在项目根目录执行
|
||||
zerone api
|
||||
|
||||
# 或者指定特定路径
|
||||
zerone api -p ./src/api
|
||||
```
|
||||
|
||||
### 生成 JavaScript 代码
|
||||
|
||||
```bash
|
||||
# 生成 JS 代码(基于 axios)
|
||||
zerone api -js
|
||||
|
||||
# 指定路径生成 JS 代码
|
||||
zerone api -js -p ./src/api
|
||||
```
|
||||
|
||||
## 项目结构
|
||||
|
||||
生成的代码将包含以下内容:
|
||||
|
||||
1. `interface/` - 包含所有从 Swagger 模式生成的 TypeScript 接口定义
|
||||
2. `controller/` - 包含基于 API 路径生成的服务函数
|
||||
|
||||
这些生成的代码具有完整的 TypeScript 类型支持和 IDE 代码提示功能。
|
||||
8
Frontend/src/api/auth.js
Normal file
@@ -0,0 +1,8 @@
|
||||
import http from './http'
|
||||
|
||||
export const login = (data) => http.post('/login', data)
|
||||
export const register = (data) => http.post('/register', data)
|
||||
export const loginByEmail = (data) => http.post('/login/email', data)
|
||||
export const registerByEmail = (data) => http.post('/register/email', data)
|
||||
export const sendEmailCode = (data) => http.post('/email/send-code', data)
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
import request from "../../http.js";
|
||||
import { type LekeApiContainmentV1ContainmentRepoDeleteRes, type DeepRequired } from "../../interface";
|
||||
import { type AxiosRequestConfig } from "axios";
|
||||
|
||||
/**
|
||||
* Containment Repo Delete
|
||||
* /api/containment/delete
|
||||
*/
|
||||
export function deleteApiContainmentDelete(params: DeleteApiContainmentDeleteParams, config?: AxiosRequestConfig) {
|
||||
const paramsInput = {
|
||||
id: params.id,
|
||||
};
|
||||
return request.delete<DeepRequired<LekeApiContainmentV1ContainmentRepoDeleteRes>>(`/api/containment/delete`, {
|
||||
params: paramsInput,
|
||||
...config,
|
||||
});
|
||||
}
|
||||
|
||||
export interface DeleteApiContainmentDeleteParams {
|
||||
/** primary key */
|
||||
id?: number;
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
import request from "../../http.js";
|
||||
import { type LekeApiContainmentV1ContainmentRepoListRes, type DeepRequired } from "../../interface";
|
||||
import { type AxiosRequestConfig } from "axios";
|
||||
|
||||
/**
|
||||
* Containment Repo List
|
||||
* /api/containment/list
|
||||
*/
|
||||
export function getApiContainmentList(params: GetApiContainmentListParams, config?: AxiosRequestConfig) {
|
||||
const paramsInput = {
|
||||
page: params.page,
|
||||
pageSize: params.pageSize,
|
||||
total: params.total,
|
||||
terminalId: params.terminalId,
|
||||
anomalyName: params.anomalyName,
|
||||
agentName: params.agentName,
|
||||
repoName: params.repoName,
|
||||
};
|
||||
return request.get<DeepRequired<LekeApiContainmentV1ContainmentRepoListRes>>(`/api/containment/list`, {
|
||||
params: paramsInput,
|
||||
...config,
|
||||
});
|
||||
}
|
||||
|
||||
export interface GetApiContainmentListParams {
|
||||
page?: number;
|
||||
pageSize?: number;
|
||||
total?: number;
|
||||
/** terminal (散逸端) */
|
||||
terminalId?: number;
|
||||
/** anomaly name */
|
||||
anomalyName?: string;
|
||||
/** agent name */
|
||||
agentName?: string;
|
||||
/** containment repo name */
|
||||
repoName?: string;
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
import request from "../../http.js";
|
||||
import { type LekeApiContainmentV1ContainmentRepoViewRes, type DeepRequired } from "../../interface";
|
||||
import { type AxiosRequestConfig } from "axios";
|
||||
|
||||
/**
|
||||
* Containment Repo View
|
||||
* /api/containment/view
|
||||
*/
|
||||
export function getApiContainmentView(params: GetApiContainmentViewParams, config?: AxiosRequestConfig) {
|
||||
const paramsInput = {
|
||||
id: params.id,
|
||||
};
|
||||
return request.get<DeepRequired<LekeApiContainmentV1ContainmentRepoViewRes>>(`/api/containment/view`, {
|
||||
params: paramsInput,
|
||||
...config,
|
||||
});
|
||||
}
|
||||
|
||||
export interface GetApiContainmentViewParams {
|
||||
/** primary key */
|
||||
id?: number;
|
||||
}
|
||||
4
Frontend/src/api/controller/Containment/index.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
export * from "./deleteApiContainmentDelete";
|
||||
export * from "./getApiContainmentList";
|
||||
export * from "./postApiContainmentUpdate";
|
||||
export * from "./getApiContainmentView";
|
||||
@@ -0,0 +1,11 @@
|
||||
import request from "../../http.js";
|
||||
import { type LekeApiContainmentV1ContainmentRepoUpdateRes, type DeepRequired, type LekeApiContainmentV1ContainmentRepoUpdateReq } from "../../interface";
|
||||
import { type AxiosRequestConfig } from "axios";
|
||||
|
||||
/**
|
||||
* Create or Update Containment Repo
|
||||
* /api/containment/update
|
||||
*/
|
||||
export function postApiContainmentUpdate(input?: LekeApiContainmentV1ContainmentRepoUpdateReq, config?: AxiosRequestConfig) {
|
||||
return request.post<DeepRequired<LekeApiContainmentV1ContainmentRepoUpdateRes>>(`/api/containment/update`, input, config);
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
import request from "../../http.js";
|
||||
import { type LekeApiDepartmentV1DepartmentDeleteRes, type DeepRequired } from "../../interface";
|
||||
import { type AxiosRequestConfig } from "axios";
|
||||
|
||||
/**
|
||||
* Department Delete
|
||||
* /api/department/delete
|
||||
*/
|
||||
export function deleteApiDepartmentDelete(params: DeleteApiDepartmentDeleteParams, config?: AxiosRequestConfig) {
|
||||
const paramsInput = {
|
||||
id: params.id,
|
||||
};
|
||||
return request.delete<DeepRequired<LekeApiDepartmentV1DepartmentDeleteRes>>(`/api/department/delete`, {
|
||||
params: paramsInput,
|
||||
...config,
|
||||
});
|
||||
}
|
||||
|
||||
export interface DeleteApiDepartmentDeleteParams {
|
||||
id: number;
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
import request from "../../http.js";
|
||||
import { type LekeApiDepartmentV1DepartmentListRes, type DeepRequired } from "../../interface";
|
||||
import { type AxiosRequestConfig } from "axios";
|
||||
|
||||
/**
|
||||
* Department List
|
||||
* /api/department/list
|
||||
*/
|
||||
export function getApiDepartmentList(params: GetApiDepartmentListParams, config?: AxiosRequestConfig) {
|
||||
const paramsInput = {
|
||||
page: params.page,
|
||||
pageSize: params.pageSize,
|
||||
total: params.total,
|
||||
branchName: params.branchName,
|
||||
managerName: params.managerName,
|
||||
userId: params.userId,
|
||||
};
|
||||
return request.get<DeepRequired<LekeApiDepartmentV1DepartmentListRes>>(`/api/department/list`, {
|
||||
params: paramsInput,
|
||||
...config,
|
||||
});
|
||||
}
|
||||
|
||||
export interface GetApiDepartmentListParams {
|
||||
page?: number;
|
||||
pageSize?: number;
|
||||
total?: number;
|
||||
/** 分部名称 */
|
||||
branchName?: string;
|
||||
/** 分部经理名称 */
|
||||
managerName?: string;
|
||||
/** 所属用户ID */
|
||||
userId?: number;
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
import request from "../../http.js";
|
||||
import { type LekeApiDepartmentV1DepartmentViewRes, type DeepRequired } from "../../interface";
|
||||
import { type AxiosRequestConfig } from "axios";
|
||||
|
||||
/**
|
||||
* Department View
|
||||
* /api/department/view
|
||||
*/
|
||||
export function getApiDepartmentView(params: GetApiDepartmentViewParams, config?: AxiosRequestConfig) {
|
||||
const paramsInput = {
|
||||
id: params.id,
|
||||
};
|
||||
return request.get<DeepRequired<LekeApiDepartmentV1DepartmentViewRes>>(`/api/department/view`, {
|
||||
params: paramsInput,
|
||||
...config,
|
||||
});
|
||||
}
|
||||
|
||||
export interface GetApiDepartmentViewParams {
|
||||
id: number;
|
||||
}
|
||||
5
Frontend/src/api/controller/Department/index.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
export * from "./postApiDepartmentCreate";
|
||||
export * from "./deleteApiDepartmentDelete";
|
||||
export * from "./getApiDepartmentList";
|
||||
export * from "./putApiDepartmentUpdate";
|
||||
export * from "./getApiDepartmentView";
|
||||
@@ -0,0 +1,11 @@
|
||||
import request from "../../http.js";
|
||||
import { type LekeApiDepartmentV1DepartmentCreateRes, type DeepRequired, type LekeApiDepartmentV1DepartmentCreateReq } from "../../interface";
|
||||
import { type AxiosRequestConfig } from "axios";
|
||||
|
||||
/**
|
||||
* Department Create
|
||||
* /api/department/create
|
||||
*/
|
||||
export function postApiDepartmentCreate(input?: LekeApiDepartmentV1DepartmentCreateReq, config?: AxiosRequestConfig) {
|
||||
return request.post<DeepRequired<LekeApiDepartmentV1DepartmentCreateRes>>(`/api/department/create`, input, config);
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
import request from "../../http.js";
|
||||
import { type LekeApiDepartmentV1DepartmentUpdateRes, type DeepRequired, type LekeApiDepartmentV1DepartmentUpdateReq } from "../../interface";
|
||||
import { type AxiosRequestConfig } from "axios";
|
||||
|
||||
/**
|
||||
* Department Update
|
||||
* /api/department/update
|
||||
*/
|
||||
export function putApiDepartmentUpdate(input?: LekeApiDepartmentV1DepartmentUpdateReq, config?: AxiosRequestConfig) {
|
||||
return request.put<DeepRequired<LekeApiDepartmentV1DepartmentUpdateRes>>(`/api/department/update`, input, config);
|
||||
}
|
||||
1
Frontend/src/api/controller/Email/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export * from "./postApiEmailSendCode";
|
||||
11
Frontend/src/api/controller/Email/postApiEmailSendCode.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import request from "../../http.js";
|
||||
import { type LekeApiLoginV1SendVerificationCodeRes, type DeepRequired, type LekeApiLoginV1SendVerificationCodeReq } from "../../interface";
|
||||
import { type AxiosRequestConfig } from "axios";
|
||||
|
||||
/**
|
||||
* Send Verification Code
|
||||
* /api/email/send-code
|
||||
*/
|
||||
export function postApiEmailSendCode(input?: LekeApiLoginV1SendVerificationCodeReq, config?: AxiosRequestConfig) {
|
||||
return request.post<DeepRequired<LekeApiLoginV1SendVerificationCodeRes>>(`/api/email/send-code`, input, config);
|
||||
}
|
||||
21
Frontend/src/api/controller/Fans/deleteApiFansDelete.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import request from "../../http.js";
|
||||
import { type LekeApiUserV1FansDeleteRes, type DeepRequired } from "../../interface";
|
||||
import { type AxiosRequestConfig } from "axios";
|
||||
|
||||
/**
|
||||
* Fans Delete
|
||||
* /api/fans/delete
|
||||
*/
|
||||
export function deleteApiFansDelete(params: DeleteApiFansDeleteParams, config?: AxiosRequestConfig) {
|
||||
const paramsInput = {
|
||||
id: params.id,
|
||||
};
|
||||
return request.delete<DeepRequired<LekeApiUserV1FansDeleteRes>>(`/api/fans/delete`, {
|
||||
params: paramsInput,
|
||||
...config,
|
||||
});
|
||||
}
|
||||
|
||||
export interface DeleteApiFansDeleteParams {
|
||||
id: number;
|
||||
}
|
||||
30
Frontend/src/api/controller/Fans/getApiFansList.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
import request from "../../http.js";
|
||||
import { type LekeApiUserV1FansListRes, type DeepRequired } from "../../interface";
|
||||
import { type AxiosRequestConfig } from "axios";
|
||||
|
||||
/**
|
||||
* Fans List
|
||||
* /api/fans/list
|
||||
*/
|
||||
export function getApiFansList(params: GetApiFansListParams, config?: AxiosRequestConfig) {
|
||||
const paramsInput = {
|
||||
page: params.page,
|
||||
pageSize: params.pageSize,
|
||||
total: params.total,
|
||||
userId: params.userId,
|
||||
status: params.status,
|
||||
};
|
||||
return request.get<DeepRequired<LekeApiUserV1FansListRes>>(`/api/fans/list`, {
|
||||
params: paramsInput,
|
||||
...config,
|
||||
});
|
||||
}
|
||||
|
||||
export interface GetApiFansListParams {
|
||||
page?: number;
|
||||
pageSize?: number;
|
||||
total?: number;
|
||||
userId: number;
|
||||
/** 状态:1=粉丝 0=取关/无效 */
|
||||
status?: number;
|
||||
}
|
||||
21
Frontend/src/api/controller/Fans/getApiFansView.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import request from "../../http.js";
|
||||
import { type LekeApiUserV1FansViewRes, type DeepRequired } from "../../interface";
|
||||
import { type AxiosRequestConfig } from "axios";
|
||||
|
||||
/**
|
||||
* Fans View
|
||||
* /api/fans/view
|
||||
*/
|
||||
export function getApiFansView(params: GetApiFansViewParams, config?: AxiosRequestConfig) {
|
||||
const paramsInput = {
|
||||
id: params.id,
|
||||
};
|
||||
return request.get<DeepRequired<LekeApiUserV1FansViewRes>>(`/api/fans/view`, {
|
||||
params: paramsInput,
|
||||
...config,
|
||||
});
|
||||
}
|
||||
|
||||
export interface GetApiFansViewParams {
|
||||
id: number;
|
||||
}
|
||||
5
Frontend/src/api/controller/Fans/index.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
export * from "./postApiFansCreate";
|
||||
export * from "./deleteApiFansDelete";
|
||||
export * from "./getApiFansList";
|
||||
export * from "./putApiFansUpdate";
|
||||
export * from "./getApiFansView";
|
||||
11
Frontend/src/api/controller/Fans/postApiFansCreate.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import request from "../../http.js";
|
||||
import { type LekeApiUserV1FansCreateRes, type DeepRequired, type LekeApiUserV1FansCreateReq } from "../../interface";
|
||||
import { type AxiosRequestConfig } from "axios";
|
||||
|
||||
/**
|
||||
* Fans Create
|
||||
* /api/fans/create
|
||||
*/
|
||||
export function postApiFansCreate(input?: LekeApiUserV1FansCreateReq, config?: AxiosRequestConfig) {
|
||||
return request.post<DeepRequired<LekeApiUserV1FansCreateRes>>(`/api/fans/create`, input, config);
|
||||
}
|
||||
11
Frontend/src/api/controller/Fans/putApiFansUpdate.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import request from "../../http.js";
|
||||
import { type LekeApiUserV1FansUpdateRes, type DeepRequired, type LekeApiUserV1FansUpdateReq } from "../../interface";
|
||||
import { type AxiosRequestConfig } from "axios";
|
||||
|
||||
/**
|
||||
* Fans Update
|
||||
* /api/fans/update
|
||||
*/
|
||||
export function putApiFansUpdate(input?: LekeApiUserV1FansUpdateReq, config?: AxiosRequestConfig) {
|
||||
return request.put<DeepRequired<LekeApiUserV1FansUpdateRes>>(`/api/fans/update`, input, config);
|
||||
}
|
||||
2
Frontend/src/api/controller/Login/index.ts
Normal file
@@ -0,0 +1,2 @@
|
||||
export * from "./postApiLogin";
|
||||
export * from "./postApiLoginEmail";
|
||||
11
Frontend/src/api/controller/Login/postApiLogin.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import request from "../../http.js";
|
||||
import { type LekeApiLoginV1LoginRes, type DeepRequired, type LekeApiLoginV1LoginReq } from "../../interface";
|
||||
import { type AxiosRequestConfig } from "axios";
|
||||
|
||||
/**
|
||||
* User Login
|
||||
* /api/login
|
||||
*/
|
||||
export function postApiLogin(input?: LekeApiLoginV1LoginReq, config?: AxiosRequestConfig) {
|
||||
return request.post<DeepRequired<LekeApiLoginV1LoginRes>>(`/api/login`, input, config);
|
||||
}
|
||||
11
Frontend/src/api/controller/Login/postApiLoginEmail.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import request from "../../http.js";
|
||||
import { type LekeApiLoginV1LoginByEmailRes, type DeepRequired, type LekeApiLoginV1LoginByEmailReq } from "../../interface";
|
||||
import { type AxiosRequestConfig } from "axios";
|
||||
|
||||
/**
|
||||
* User Login By Email
|
||||
* /api/login/email
|
||||
*/
|
||||
export function postApiLoginEmail(input?: LekeApiLoginV1LoginByEmailReq, config?: AxiosRequestConfig) {
|
||||
return request.post<DeepRequired<LekeApiLoginV1LoginByEmailRes>>(`/api/login/email`, input, config);
|
||||
}
|
||||
1
Frontend/src/api/controller/Logout/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export * from "./postApiLogout";
|
||||
11
Frontend/src/api/controller/Logout/postApiLogout.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import request from "../../http.js";
|
||||
import { type LekeApiLoginV1LogoutRes, type DeepRequired, type LekeApiLoginV1LogoutReq } from "../../interface";
|
||||
import { type AxiosRequestConfig } from "axios";
|
||||
|
||||
/**
|
||||
* User Logout
|
||||
* /api/logout
|
||||
*/
|
||||
export function postApiLogout(input?: LekeApiLoginV1LogoutReq, config?: AxiosRequestConfig) {
|
||||
return request.post<DeepRequired<LekeApiLoginV1LogoutRes>>(`/api/logout`, input, config);
|
||||
}
|
||||
2
Frontend/src/api/controller/Register/index.ts
Normal file
@@ -0,0 +1,2 @@
|
||||
export * from "./postApiRegister";
|
||||
export * from "./postApiRegisterEmail";
|
||||
11
Frontend/src/api/controller/Register/postApiRegister.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import request from "../../http.js";
|
||||
import { type LekeApiLoginV1RegisterRes, type DeepRequired, type LekeApiLoginV1RegisterReq } from "../../interface";
|
||||
import { type AxiosRequestConfig } from "axios";
|
||||
|
||||
/**
|
||||
* User Register
|
||||
* /api/register
|
||||
*/
|
||||
export function postApiRegister(input?: LekeApiLoginV1RegisterReq, config?: AxiosRequestConfig) {
|
||||
return request.post<DeepRequired<LekeApiLoginV1RegisterRes>>(`/api/register`, input, config);
|
||||
}
|
||||
11
Frontend/src/api/controller/Register/postApiRegisterEmail.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import request from "../../http.js";
|
||||
import { type LekeApiLoginV1RegisterByEmailRes, type DeepRequired, type LekeApiLoginV1RegisterByEmailReq } from "../../interface";
|
||||
import { type AxiosRequestConfig } from "axios";
|
||||
|
||||
/**
|
||||
* User Register By Email
|
||||
* /api/register/email
|
||||
*/
|
||||
export function postApiRegisterEmail(input?: LekeApiLoginV1RegisterByEmailReq, config?: AxiosRequestConfig) {
|
||||
return request.post<DeepRequired<LekeApiLoginV1RegisterByEmailRes>>(`/api/register/email`, input, config);
|
||||
}
|
||||
22
Frontend/src/api/controller/Role/deleteApiRoleDelete.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import request from "../../http.js";
|
||||
import { type LekeApiUserV1RoleDeleteRes, type DeepRequired } from "../../interface";
|
||||
import { type AxiosRequestConfig } from "axios";
|
||||
|
||||
/**
|
||||
* Delete Role
|
||||
* /api/role/delete
|
||||
*/
|
||||
export function deleteApiRoleDelete(params: DeleteApiRoleDeleteParams, config?: AxiosRequestConfig) {
|
||||
const paramsInput = {
|
||||
id: params.id,
|
||||
};
|
||||
return request.delete<DeepRequired<LekeApiUserV1RoleDeleteRes>>(`/api/role/delete`, {
|
||||
params: paramsInput,
|
||||
...config,
|
||||
});
|
||||
}
|
||||
|
||||
export interface DeleteApiRoleDeleteParams {
|
||||
/** 角色ID */
|
||||
id: number;
|
||||
}
|
||||
31
Frontend/src/api/controller/Role/getApiRoleList.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import request from "../../http.js";
|
||||
import { type LekeApiUserV1RoleListRes, type DeepRequired } from "../../interface";
|
||||
import { type AxiosRequestConfig } from "axios";
|
||||
|
||||
/**
|
||||
* Role List
|
||||
* /api/role/list
|
||||
*/
|
||||
export function getApiRoleList(params: GetApiRoleListParams, config?: AxiosRequestConfig) {
|
||||
const paramsInput = {
|
||||
page: params.page,
|
||||
pageSize: params.pageSize,
|
||||
total: params.total,
|
||||
userId: params.userId,
|
||||
departmentId: params.departmentId,
|
||||
};
|
||||
return request.get<DeepRequired<LekeApiUserV1RoleListRes>>(`/role/list`, {
|
||||
params: paramsInput,
|
||||
...config,
|
||||
});
|
||||
}
|
||||
|
||||
export interface GetApiRoleListParams {
|
||||
page?: number;
|
||||
pageSize?: number;
|
||||
total?: number;
|
||||
/** 用户ID */
|
||||
userId?: number;
|
||||
/** 部门ID */
|
||||
departmentId?: number;
|
||||
}
|
||||
22
Frontend/src/api/controller/Role/getApiRoleView.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import request from "../../http.js";
|
||||
import { type LekeApiUserV1RoleViewRes, type DeepRequired } from "../../interface";
|
||||
import { type AxiosRequestConfig } from "axios";
|
||||
|
||||
/**
|
||||
* View Role
|
||||
* /api/role/view
|
||||
*/
|
||||
export function getApiRoleView(params: GetApiRoleViewParams, config?: AxiosRequestConfig) {
|
||||
const paramsInput = {
|
||||
id: params.id,
|
||||
};
|
||||
return request.get<DeepRequired<LekeApiUserV1RoleViewRes>>(`/api/role/view`, {
|
||||
params: paramsInput,
|
||||
...config,
|
||||
});
|
||||
}
|
||||
|
||||
export interface GetApiRoleViewParams {
|
||||
/** 角色ID */
|
||||
id: number;
|
||||
}
|
||||
6
Frontend/src/api/controller/Role/index.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
export * from "./postApiRoleCreate";
|
||||
export * from "./deleteApiRoleDelete";
|
||||
export * from "./getApiRoleList";
|
||||
export * from "./postApiRolePermissionCheck";
|
||||
export * from "./putApiRoleUpdate";
|
||||
export * from "./getApiRoleView";
|
||||
11
Frontend/src/api/controller/Role/postApiRoleCreate.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import request from "../../http.js";
|
||||
import { type LekeApiUserV1RoleCreateRes, type DeepRequired, type LekeApiUserV1RoleCreateReq } from "../../interface";
|
||||
import { type AxiosRequestConfig } from "axios";
|
||||
|
||||
/**
|
||||
* Create Role
|
||||
* /api/role/create
|
||||
*/
|
||||
export function postApiRoleCreate(input?: LekeApiUserV1RoleCreateReq, config?: AxiosRequestConfig) {
|
||||
return request.post<DeepRequired<LekeApiUserV1RoleCreateRes>>(`/api/role/create`, input, config);
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
import request from "../../http.js";
|
||||
import { type LekeApiUserV1RolePermissionCheckRes, type DeepRequired, type LekeApiUserV1RolePermissionCheckReq } from "../../interface";
|
||||
import { type AxiosRequestConfig } from "axios";
|
||||
|
||||
/**
|
||||
* Check Role Permission
|
||||
* /api/role/permission/check
|
||||
*/
|
||||
export function postApiRolePermissionCheck(input?: LekeApiUserV1RolePermissionCheckReq, config?: AxiosRequestConfig) {
|
||||
return request.post<DeepRequired<LekeApiUserV1RolePermissionCheckRes>>(`/api/role/permission/check`, input, config);
|
||||
}
|
||||
11
Frontend/src/api/controller/Role/putApiRoleUpdate.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import request from "../../http.js";
|
||||
import { type LekeApiUserV1RoleUpdateRes, type DeepRequired, type LekeApiUserV1RoleUpdateReq } from "../../interface";
|
||||
import { type AxiosRequestConfig } from "axios";
|
||||
|
||||
/**
|
||||
* Update Role
|
||||
* /api/role/update
|
||||
*/
|
||||
export function putApiRoleUpdate(input?: LekeApiUserV1RoleUpdateReq, config?: AxiosRequestConfig) {
|
||||
return request.put<DeepRequired<LekeApiUserV1RoleUpdateRes>>(`/api/role/update`, input, config);
|
||||
}
|
||||
22
Frontend/src/api/controller/Room/deleteApiRoomDelete.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import request from "../../http.js";
|
||||
import { type LekeApiRoomV1RoomDeleteRes, type DeepRequired } from "../../interface";
|
||||
import { type AxiosRequestConfig } from "axios";
|
||||
|
||||
/**
|
||||
* Room Delete
|
||||
* /api/room/delete
|
||||
*/
|
||||
export function deleteApiRoomDelete(params: DeleteApiRoomDeleteParams, config?: AxiosRequestConfig) {
|
||||
const paramsInput = {
|
||||
room_code: params.room_code,
|
||||
};
|
||||
return request.delete<DeepRequired<LekeApiRoomV1RoomDeleteRes>>(`/api/room/delete`, {
|
||||
params: paramsInput,
|
||||
...config,
|
||||
});
|
||||
}
|
||||
|
||||
export interface DeleteApiRoomDeleteParams {
|
||||
/** 房间号 */
|
||||
room_code?: string;
|
||||
}
|
||||
40
Frontend/src/api/controller/Room/getApiRoomList.ts
Normal file
@@ -0,0 +1,40 @@
|
||||
import request from "../../http.js";
|
||||
import { type LekeApiRoomV1RoomListRes, type DeepRequired } from "../../interface";
|
||||
import { type AxiosRequestConfig } from "axios";
|
||||
|
||||
/**
|
||||
* Room List
|
||||
* /api/room/list
|
||||
*/
|
||||
export function getApiRoomList(params: GetApiRoomListParams, config?: AxiosRequestConfig) {
|
||||
const paramsInput = {
|
||||
page: params.page,
|
||||
pageSize: params.pageSize,
|
||||
total: params.total,
|
||||
room_code: params.room_code,
|
||||
room_name: params.room_name,
|
||||
host_id: params.host_id,
|
||||
status: params.status,
|
||||
system_name: params.system_name,
|
||||
};
|
||||
return request.get<DeepRequired<LekeApiRoomV1RoomListRes>>(`/api/room/list`, {
|
||||
params: paramsInput,
|
||||
...config,
|
||||
});
|
||||
}
|
||||
|
||||
export interface GetApiRoomListParams {
|
||||
page?: number;
|
||||
pageSize?: number;
|
||||
total?: number;
|
||||
/** 房间号 */
|
||||
room_code?: string;
|
||||
/** 房间名称 */
|
||||
room_name?: string;
|
||||
/** 主持人用户ID */
|
||||
host_id?: number;
|
||||
/** 房间状态:0未开始 1进行中 2已结束 3已关闭 */
|
||||
status?: number;
|
||||
/** 规则系统,如COC、DND5E */
|
||||
system_name?: string;
|
||||
}
|
||||
25
Frontend/src/api/controller/Room/getApiRoomView.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import request from "../../http.js";
|
||||
import { type LekeApiRoomV1RoomViewRes, type DeepRequired } from "../../interface";
|
||||
import { type AxiosRequestConfig } from "axios";
|
||||
|
||||
/**
|
||||
* Room View
|
||||
* /api/room/view
|
||||
*/
|
||||
export function getApiRoomView(params: GetApiRoomViewParams, config?: AxiosRequestConfig) {
|
||||
const paramsInput = {
|
||||
id: params.id,
|
||||
room_code: params.room_code,
|
||||
};
|
||||
return request.get<DeepRequired<LekeApiRoomV1RoomViewRes>>(`/api/room/view`, {
|
||||
params: paramsInput,
|
||||
...config,
|
||||
});
|
||||
}
|
||||
|
||||
export interface GetApiRoomViewParams {
|
||||
/** 房间ID */
|
||||
id?: number;
|
||||
/** 房间号 */
|
||||
room_code?: string;
|
||||
}
|
||||
5
Frontend/src/api/controller/Room/index.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
export * from "./postApiRoomCreate";
|
||||
export * from "./deleteApiRoomDelete";
|
||||
export * from "./getApiRoomList";
|
||||
export * from "./putApiRoomUpdate";
|
||||
export * from "./getApiRoomView";
|
||||
11
Frontend/src/api/controller/Room/postApiRoomCreate.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import request from "../../http.js";
|
||||
import { type LekeApiRoomV1RoomCreateRes, type DeepRequired, type LekeApiRoomV1RoomCreateReq } from "../../interface";
|
||||
import { type AxiosRequestConfig } from "axios";
|
||||
|
||||
/**
|
||||
* Room Create
|
||||
* /api/room/create
|
||||
*/
|
||||
export function postApiRoomCreate(input?: LekeApiRoomV1RoomCreateReq, config?: AxiosRequestConfig) {
|
||||
return request.post<DeepRequired<LekeApiRoomV1RoomCreateRes>>(`/api/room/create`, input, config);
|
||||
}
|
||||
11
Frontend/src/api/controller/Room/putApiRoomUpdate.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import request from "../../http.js";
|
||||
import { type LekeApiRoomV1RoomUpdateRes, type DeepRequired, type LekeApiRoomV1RoomUpdateReq } from "../../interface";
|
||||
import { type AxiosRequestConfig } from "axios";
|
||||
|
||||
/**
|
||||
* Room Update
|
||||
* /api/room/update
|
||||
*/
|
||||
export function putApiRoomUpdate(input?: LekeApiRoomV1RoomUpdateReq, config?: AxiosRequestConfig) {
|
||||
return request.put<DeepRequired<LekeApiRoomV1RoomUpdateRes>>(`/api/room/update`, input, config);
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
import request from "../../http.js";
|
||||
import { type LekeApiUserV1SubscribeDeleteRes, type DeepRequired } from "../../interface";
|
||||
import { type AxiosRequestConfig } from "axios";
|
||||
|
||||
/**
|
||||
* Subscribe Delete
|
||||
* /api/subscribe/delete
|
||||
*/
|
||||
export function deleteApiSubscribeDelete(params: DeleteApiSubscribeDeleteParams, config?: AxiosRequestConfig) {
|
||||
const paramsInput = {
|
||||
id: params.id,
|
||||
};
|
||||
return request.delete<DeepRequired<LekeApiUserV1SubscribeDeleteRes>>(`/api/subscribe/delete`, {
|
||||
params: paramsInput,
|
||||
...config,
|
||||
});
|
||||
}
|
||||
|
||||
export interface DeleteApiSubscribeDeleteParams {
|
||||
id: number;
|
||||
}
|
||||
33
Frontend/src/api/controller/Subscribe/getApiSubscribeList.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
import request from "../../http.js";
|
||||
import { type LekeApiUserV1SubscribeListRes, type DeepRequired } from "../../interface";
|
||||
import { type AxiosRequestConfig } from "axios";
|
||||
|
||||
/**
|
||||
* Subscribe List
|
||||
* /api/subscribe/list
|
||||
*/
|
||||
export function getApiSubscribeList(params: GetApiSubscribeListParams, config?: AxiosRequestConfig) {
|
||||
const paramsInput = {
|
||||
page: params.page,
|
||||
pageSize: params.pageSize,
|
||||
total: params.total,
|
||||
userId: params.userId,
|
||||
status: params.status,
|
||||
followId: params.followId,
|
||||
};
|
||||
return request.get<DeepRequired<LekeApiUserV1SubscribeListRes>>(`/api/subscribe/list`, {
|
||||
params: paramsInput,
|
||||
...config,
|
||||
});
|
||||
}
|
||||
|
||||
export interface GetApiSubscribeListParams {
|
||||
page?: number;
|
||||
pageSize?: number;
|
||||
total?: number;
|
||||
userId: number;
|
||||
/** 状态:1=关注中 0=取消关注 */
|
||||
status?: number;
|
||||
/** 被关注的用户ID */
|
||||
followId?: number;
|
||||
}
|
||||
21
Frontend/src/api/controller/Subscribe/getApiSubscribeView.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import request from "../../http.js";
|
||||
import { type LekeApiUserV1SubscribeViewRes, type DeepRequired } from "../../interface";
|
||||
import { type AxiosRequestConfig } from "axios";
|
||||
|
||||
/**
|
||||
* Subscribe View
|
||||
* /api/subscribe/view
|
||||
*/
|
||||
export function getApiSubscribeView(params: GetApiSubscribeViewParams, config?: AxiosRequestConfig) {
|
||||
const paramsInput = {
|
||||
id: params.id,
|
||||
};
|
||||
return request.get<DeepRequired<LekeApiUserV1SubscribeViewRes>>(`/api/subscribe/view`, {
|
||||
params: paramsInput,
|
||||
...config,
|
||||
});
|
||||
}
|
||||
|
||||
export interface GetApiSubscribeViewParams {
|
||||
id: number;
|
||||
}
|
||||
5
Frontend/src/api/controller/Subscribe/index.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
export * from "./postApiSubscribeCreate";
|
||||
export * from "./deleteApiSubscribeDelete";
|
||||
export * from "./getApiSubscribeList";
|
||||
export * from "./putApiSubscribeUpdate";
|
||||
export * from "./getApiSubscribeView";
|
||||
@@ -0,0 +1,11 @@
|
||||
import request from "../../http.js";
|
||||
import { type LekeApiUserV1SubscribeCreateRes, type DeepRequired, type LekeApiUserV1SubscribeCreateReq } from "../../interface";
|
||||
import { type AxiosRequestConfig } from "axios";
|
||||
|
||||
/**
|
||||
* Subscribe Create
|
||||
* /api/subscribe/create
|
||||
*/
|
||||
export function postApiSubscribeCreate(input?: LekeApiUserV1SubscribeCreateReq, config?: AxiosRequestConfig) {
|
||||
return request.post<DeepRequired<LekeApiUserV1SubscribeCreateRes>>(`/api/subscribe/create`, input, config);
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
import request from "../../http.js";
|
||||
import { type LekeApiUserV1SubscribeUpdateRes, type DeepRequired, type LekeApiUserV1SubscribeUpdateReq } from "../../interface";
|
||||
import { type AxiosRequestConfig } from "axios";
|
||||
|
||||
/**
|
||||
* Subscribe Update
|
||||
* /api/subscribe/update
|
||||
*/
|
||||
export function putApiSubscribeUpdate(input?: LekeApiUserV1SubscribeUpdateReq, config?: AxiosRequestConfig) {
|
||||
return request.put<DeepRequired<LekeApiUserV1SubscribeUpdateRes>>(`/api/subscribe/update`, input, config);
|
||||
}
|
||||
31
Frontend/src/api/controller/Trace/deleteApiTraceReduce.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import request from "../../http.js";
|
||||
import { type LekeApiUserV1TraceReduceRes, type DeepRequired } from "../../interface";
|
||||
import { type AxiosRequestConfig } from "axios";
|
||||
|
||||
/**
|
||||
* Trace Delete
|
||||
* /api/trace/Reduce
|
||||
*/
|
||||
export function deleteApiTraceReduce(params: DeleteApiTraceReduceParams, config?: AxiosRequestConfig) {
|
||||
const paramsInput = {
|
||||
roleId: params.roleId,
|
||||
redTrace: params.redTrace,
|
||||
yellowTrace: params.yellowTrace,
|
||||
blueTrace: params.blueTrace,
|
||||
};
|
||||
return request.delete<DeepRequired<LekeApiUserV1TraceReduceRes>>(`/api/trace/Reduce`, {
|
||||
params: paramsInput,
|
||||
...config,
|
||||
});
|
||||
}
|
||||
|
||||
export interface DeleteApiTraceReduceParams {
|
||||
/** 角色ID */
|
||||
roleId?: number;
|
||||
/** 红轨 */
|
||||
redTrace?: number;
|
||||
/** 黄轨 */
|
||||
yellowTrace?: number;
|
||||
/** 蓝轨 */
|
||||
blueTrace?: number;
|
||||
}
|
||||
43
Frontend/src/api/controller/Trace/getApiTraceList.ts
Normal file
@@ -0,0 +1,43 @@
|
||||
import request from "../../http.js";
|
||||
import { type LekeApiUserV1TraceListRes, type DeepRequired } from "../../interface";
|
||||
import { type AxiosRequestConfig } from "axios";
|
||||
|
||||
/**
|
||||
* Trace List
|
||||
* /api/trace/list
|
||||
*/
|
||||
export function getApiTraceList(params: GetApiTraceListParams, config?: AxiosRequestConfig) {
|
||||
const paramsInput = {
|
||||
page: params.page,
|
||||
pageSize: params.pageSize,
|
||||
total: params.total,
|
||||
userId: params.userId,
|
||||
roleId: params.roleId,
|
||||
departmentId: params.departmentId,
|
||||
redTrace: params.redTrace,
|
||||
yellowTrace: params.yellowTrace,
|
||||
blueTrace: params.blueTrace,
|
||||
};
|
||||
return request.get<DeepRequired<LekeApiUserV1TraceListRes>>(`/api/trace/list`, {
|
||||
params: paramsInput,
|
||||
...config,
|
||||
});
|
||||
}
|
||||
|
||||
export interface GetApiTraceListParams {
|
||||
page?: number;
|
||||
pageSize?: number;
|
||||
total?: number;
|
||||
/** 用户ID */
|
||||
userId?: number;
|
||||
/** 角色ID */
|
||||
roleId?: number;
|
||||
/** 部门ID */
|
||||
departmentId?: number;
|
||||
/** 红轨 */
|
||||
redTrace?: number;
|
||||
/** 黄轨 */
|
||||
yellowTrace?: number;
|
||||
/** 蓝轨 */
|
||||
blueTrace?: number;
|
||||
}
|
||||
31
Frontend/src/api/controller/Trace/getApiTraceView.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import request from "../../http.js";
|
||||
import { type LekeApiUserV1TraceViewRes, type DeepRequired } from "../../interface";
|
||||
import { type AxiosRequestConfig } from "axios";
|
||||
|
||||
/**
|
||||
* Trace View
|
||||
* /api/trace/view
|
||||
*/
|
||||
export function getApiTraceView(params: GetApiTraceViewParams, config?: AxiosRequestConfig) {
|
||||
const paramsInput = {
|
||||
roleId: params.roleId,
|
||||
redTrace: params.redTrace,
|
||||
yellowTrace: params.yellowTrace,
|
||||
blueTrace: params.blueTrace,
|
||||
};
|
||||
return request.get<DeepRequired<LekeApiUserV1TraceViewRes>>(`/api/trace/view`, {
|
||||
params: paramsInput,
|
||||
...config,
|
||||
});
|
||||
}
|
||||
|
||||
export interface GetApiTraceViewParams {
|
||||
/** 角色ID */
|
||||
roleId?: number;
|
||||
/** 红轨 */
|
||||
redTrace?: number;
|
||||
/** 黄轨 */
|
||||
yellowTrace?: number;
|
||||
/** 蓝轨 */
|
||||
blueTrace?: number;
|
||||
}
|
||||