添加nas部署配置
优化md
This commit is contained in:
@@ -108,7 +108,11 @@
|
|||||||
"Skill(mcp-mysql-correct-db)",
|
"Skill(mcp-mysql-correct-db)",
|
||||||
"Bash(git diff:*)",
|
"Bash(git diff:*)",
|
||||||
"Bash(git pull:*)",
|
"Bash(git pull:*)",
|
||||||
"Bash(git merge:*)"
|
"Bash(git merge:*)",
|
||||||
|
"mcp__chrome-devtools-mcp__take_snapshot",
|
||||||
|
"mcp__chrome-devtools-mcp__fill",
|
||||||
|
"mcp__chrome-devtools-mcp__click",
|
||||||
|
"mcp__chrome-devtools-mcp__take_screenshot"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"enabledMcpjsonServers": [
|
"enabledMcpjsonServers": [
|
||||||
|
|||||||
533
CLAUDE.md
533
CLAUDE.md
@@ -1,327 +1,362 @@
|
|||||||
# CLAUDE.md
|
# CLAUDE.md
|
||||||
## 分析
|
|
||||||
- 在进行需求分析类型的任务时,自动开启深度思考模式,输入 “think more”、“think a lot”、“think harder” 或 “think longer” 触发更深层的思考
|
|
||||||
- 在进行需求分析与分解任务时,按照不同的模块分为不同的文件,创建模块名的文件夹并将对应文件保存在文件夹中,然后对模块的功能文件进行继续分解
|
|
||||||
- 在使用/openspec:proposal时,自动开启深度思考模式,输入 “think more”、“think a lot”、“think harder” 或 “think longer” 触发更深层的思考
|
|
||||||
- 在执行/openspec:apply后,使用code-simplifier 进行代码精简
|
|
||||||
- 在分析生成需求文档时,每次都需要在doc目录下新建文件夹并以需求内容为命名
|
|
||||||
|
|
||||||
## Communication
|
|
||||||
- 永远使用简体中文进行思考和对话
|
|
||||||
|
|
||||||
## Documentation
|
|
||||||
- 编写 .md 文档时,也要用中文
|
|
||||||
- 所有生成的文档都放在项目根目录下的doc文件中。
|
|
||||||
|
|
||||||
## 数据库规范
|
|
||||||
- 新建表时,需要加上项目英文名首字母集合
|
|
||||||
|
|
||||||
|
|
||||||
## Coding
|
|
||||||
### Java Code Style
|
|
||||||
- 新建模块命名方式为项目英文名首字母集合+主要功能
|
|
||||||
- 新的功能代码与若依框架自带的代码分离,新建模块,controller层也要放在新建模块中
|
|
||||||
- 使用 `@Data` 注解保证代码的简洁
|
|
||||||
- 尽量使用 MyBatis Plus 进行 CRUD 操作(版本 3.5.10,Spring Boot 3 适配版)
|
|
||||||
- 服务层中的使用@Resource注释,替代@Autowired
|
|
||||||
- 实体类不继承BaseEntity,单独添加审计字段
|
|
||||||
- 完成后端代码controller层代码生成测试后,在项目文件目录下生成API文档
|
|
||||||
- 接口传参需要使用单独的DTO,不可以与entity混用
|
|
||||||
- 需要单独的VO类,不可以与entity混用
|
|
||||||
- 审计字段通过添加注释的方式实现自动插入
|
|
||||||
- 简单的crud操作通过mybatis plus的方法实现,复杂的操作通过xml中写sql和mapper映射实现
|
|
||||||
- 控制层所有接口需要正确的添加注释,确保在swagger-ui中正确展示。控制层中任何接口发生变动,及时同步到doc中的接口文档中
|
|
||||||
- 控制层分页接口使用mybatis plus page,不要使用若依框架的分页
|
|
||||||
|
|
||||||
|
|
||||||
### 前端代码
|
|
||||||
- 在添加页面和组件后,注意与数据库中菜单表进行联动修改
|
|
||||||
- 前端组件代码需要组件化,复杂的组件需要进行拆分为单独的文件
|
|
||||||
|
|
||||||
|
|
||||||
## 运行
|
|
||||||
- 使用mcp:ccdi_intermediary_blacklist进行数据库相关操作
|
|
||||||
- 不要在命令行中启动后端进行测试
|
|
||||||
- 测试方式为生成可执行的测试脚本
|
|
||||||
- 测试脚本在运行完成后需要保存所有接口输出并生成测试用例报告
|
|
||||||
- /login/test接口可以传入username和password获取token,用于测试验证接口的功能。
|
|
||||||
用于测试的账号:username: admin password admin123
|
|
||||||
- swagger-ui的地址为/swagger-ui/index.html
|
|
||||||
- 在向doc文件夹添加文件时需要分门别类添加,根据
|
|
||||||
|
|
||||||
|
|
||||||
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
||||||
|
|
||||||
## Project Overview
|
## 项目概述
|
||||||
|
|
||||||
This is a **discipline preliminary check system** built on the **RuoYi (若依) v3.9.1** rapid development framework. It is an enterprise-grade management system using a front-end/back-end separated architecture.
|
**纪检初核系统** - 基于 **若依管理系统 v3.9.1** 构建的企业级前后端分离管理系统,用于员工异常行为风险识别。
|
||||||
|
|
||||||
### Technology Stack
|
### 技术栈版本
|
||||||
|
|
||||||
**Backend:**
|
| 后端技术 | 版本 | 前端技术 | 版本 |
|
||||||
- Spring Boot 3.5.8
|
|-----------------------------|--------|------------|---------|
|
||||||
- Spring Security + JWT (authentication)
|
| Spring Boot | 3.5.8 | Vue.js | 2.6.12 |
|
||||||
- MyBatis 3.0.5 (ORM)
|
| Java | 17 | Element UI | 2.15.14 |
|
||||||
- MySQL 8.2.0
|
| MyBatis Spring Boot Starter | 3.0.5 | Vuex | 3.6.0 |
|
||||||
- Redis (caching)
|
| MySQL Connector | 8.2.0 | Vue Router | 3.4.9 |
|
||||||
- Quartz 2.5.2 (scheduled tasks)
|
| SpringDoc OpenAPI | 2.8.14 | Axios | 0.28.1 |
|
||||||
- SpringDoc 2.8.14 (API documentation)
|
| EasyExcel | 3.3.4 | ECharts | 5.4.0 |
|
||||||
- Java 17
|
| Quartz | 2.5.2 | Sass | 1.32.13 |
|
||||||
|
|
||||||
**Frontend:**
|
---
|
||||||
- Vue 2.6.12
|
|
||||||
- Element UI 2.15.14
|
|
||||||
- Vuex 3.6.0 (state management)
|
|
||||||
- Vue Router 3.4.9
|
|
||||||
- Axios 0.28.1
|
|
||||||
|
|
||||||
## Common Commands
|
## 常用命令
|
||||||
|
|
||||||
### Backend (Maven)
|
### 后端 (Maven)
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Compile the project
|
# 编译项目
|
||||||
mvn clean compile
|
mvn clean compile
|
||||||
|
|
||||||
# Run the application (development)
|
# 运行应用 (开发环境)
|
||||||
mvn spring-boot:run
|
mvn spring-boot:run
|
||||||
|
|
||||||
# Package for deployment
|
# 打包部署
|
||||||
mvn clean package
|
mvn clean package
|
||||||
|
|
||||||
# Run using startup scripts
|
# Windows 启动
|
||||||
./ry.bat # Windows
|
ry.bat
|
||||||
./ry.sh start # Linux/Mac
|
|
||||||
|
# Linux/Mac 启动
|
||||||
|
./ry.sh start
|
||||||
```
|
```
|
||||||
|
|
||||||
### Frontend (npm)
|
### 前端 (npm)
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd ruoyi-ui
|
cd ruoyi-ui
|
||||||
|
|
||||||
# Install dependencies
|
# 安装依赖 (推荐使用国内镜像)
|
||||||
npm install
|
npm install --registry=https://registry.npmmirror.com
|
||||||
|
|
||||||
# Development server (runs on port 80 by default)
|
# 开发服务器 (端口 80)
|
||||||
npm run dev
|
npm run dev
|
||||||
|
|
||||||
# Production build
|
# 生产构建
|
||||||
npm run build:prod
|
npm run build:prod
|
||||||
|
|
||||||
# Staging build
|
# 预览生产构建
|
||||||
npm run build:stage
|
|
||||||
|
|
||||||
# Preview production build
|
|
||||||
npm run preview
|
npm run preview
|
||||||
```
|
```
|
||||||
|
|
||||||
### Database Initialization
|
### 数据库初始化
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Main database schema
|
|
||||||
mysql -u root -p < sql/ry_20250522.sql
|
mysql -u root -p < sql/ry_20250522.sql
|
||||||
|
|
||||||
# Quartz scheduler tables
|
|
||||||
mysql -u root -p < sql/quartz.sql
|
mysql -u root -p < sql/quartz.sql
|
||||||
```
|
```
|
||||||
|
|
||||||
## Project Architecture
|
---
|
||||||
|
|
||||||
### Module Structure
|
## 模块架构
|
||||||
|
|
||||||
```
|
```
|
||||||
discipline-prelim-check/
|
ccdi/
|
||||||
├── ruoyi-admin/ # Main application entry point
|
├── ruoyi-admin/ # 主应用入口 (Spring Boot 启动类)
|
||||||
├── ruoyi-framework/ # Core framework (Security, config, filters)
|
├── ruoyi-framework/ # 核心框架 (Security, Config, Filters)
|
||||||
├── ruoyi-system/ # System management (Users, Roles, Menus, Depts)
|
├── ruoyi-system/ # 系统管理 (Users, Roles, Menus, Depts)
|
||||||
├── ruoyi-common/ # Common utilities (annotations, utils, constants)
|
├── ruoyi-common/ # 通用工具 (annotations, utils, constants)
|
||||||
├── ruoyi-quartz/ # Scheduled task management
|
├── ruoyi-quartz/ # 定时任务
|
||||||
├── ruoyi-generator/ # Code generator (CRUD scaffolding)
|
├── ruoyi-generator/ # 代码生成器
|
||||||
├── ruoyi-ui/ # Frontend Vue application
|
├── ruoyi-ccdi/ # 【核心业务模块】纪检初核业务
|
||||||
├── sql/ # Database scripts
|
├── ruoyi-ui/ # 前端 Vue 应用
|
||||||
├── bin/ # Startup scripts
|
├── sql/ # 数据库脚本
|
||||||
└── openspec/ # OpenSpec specification workflow
|
├── bin/ # 启动脚本
|
||||||
|
└── doc/ # 项目文档
|
||||||
```
|
```
|
||||||
|
|
||||||
### Backend Architecture: MVC + Modular Design
|
### 模块依赖关系
|
||||||
|
|
||||||
The backend follows a standard MVC pattern with modular separation:
|
|
||||||
|
|
||||||
```
|
```
|
||||||
Controller Layer (ruoyi-admin/web/controller/)
|
ruoyi-admin (启动模块)
|
||||||
├── common/ # Common controllers (captcha, file upload)
|
├── ruoyi-framework (核心安全配置)
|
||||||
├── monitor/ # Monitoring controllers (cache, server, logs)
|
├── ruoyi-system (系统核心业务)
|
||||||
├── system/ # System management (users, roles, menus)
|
├── ruoyi-common (共享工具)
|
||||||
└── tool/ # Tools (code generator, swagger)
|
├── ruoyi-quartz (定时任务)
|
||||||
|
├── ruoyi-generator (代码生成)
|
||||||
Service Layer (ruoyi-system/service/)
|
└── ruoyi-ccdi (纪检业务模块)
|
||||||
├── ISysUserService.java
|
|
||||||
├── ISysRoleService.java
|
|
||||||
└── ...
|
|
||||||
|
|
||||||
Mapper Layer (ruoyi-system/mapper/)
|
|
||||||
├── SysUserMapper.java
|
|
||||||
├── SysRoleMapper.java
|
|
||||||
└── ...
|
|
||||||
|
|
||||||
Domain Layer (ruoyi-system/domain/)
|
|
||||||
├── SysUser.java # Entity
|
|
||||||
├── vo/ # Value objects
|
|
||||||
└── ...
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Frontend Architecture: Vue SPA
|
### ruoyi-ccdi 业务模块 (核心)
|
||||||
|
|
||||||
|
自定义业务模块,包含以下核心功能:
|
||||||
|
|
||||||
|
| 功能 | Controller | 实体类 |
|
||||||
|
|----------|---------------------------------------|-----------------------------|
|
||||||
|
| 员工基础信息 | CcdiBaseStaffController | CcdiBaseStaff |
|
||||||
|
| 中介黑名单 | CcdiIntermediaryController | CcdiBizIntermediary |
|
||||||
|
| 员工家庭关系 | CcdiStaffFmyRelationController | CcdiStaffFmyRelation |
|
||||||
|
| 员工企业关系 | CcdiStaffEnterpriseRelationController | CcdiStaffEnterpriseRelation |
|
||||||
|
| 信贷客户家庭关系 | CcdiCustFmyRelationController | CcdiCustFmyRelation |
|
||||||
|
| 信贷客户企业关系 | CcdiCustEnterpriseRelationController | CcdiCustEnterpriseRelation |
|
||||||
|
| 员工调动记录 | CcdiStaffTransferController | CcdiStaffTransfer |
|
||||||
|
| 员工招聘记录 | CcdiStaffRecruitmentController | CcdiStaffRecruitment |
|
||||||
|
| 采购交易 | CcdiPurchaseTransactionController | CcdiPurchaseTransaction |
|
||||||
|
|
||||||
|
**分层结构:**
|
||||||
|
|
||||||
|
- Controller: `ruoyi-ccdi/src/main/java/com/ruoyi/ccdi/controller/`
|
||||||
|
- Service: `ruoyi-ccdi/src/main/java/com/ruoyi/ccdi/service/`
|
||||||
|
- Mapper: `ruoyi-ccdi/src/main/java/com/ruoyi/ccdi/mapper/`
|
||||||
|
- Domain: `ruoyi-ccdi/src/main/java/com/ruoyi/ccdi/domain/`
|
||||||
|
- dto/: 数据传输对象
|
||||||
|
- vo/: 视图对象
|
||||||
|
- excel/: Excel导入导出实体
|
||||||
|
- XML映射: `ruoyi-ccdi/src/main/resources/mapper/ccdi/`
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 后端开发规范
|
||||||
|
|
||||||
|
### 通用规范
|
||||||
|
|
||||||
|
- **新模块命名**: 项目英文名首字母集合 + 主要功能 (如 `ruoyi-ccdi`)
|
||||||
|
- **代码分离**: 新功能代码与若依框架自带代码分离,Controller 放在新模块中
|
||||||
|
- **审计字段**: 实体类不继承 BaseEntity,单独添加审计字段,通过注释实现自动插入
|
||||||
|
|
||||||
|
### Java 代码风格
|
||||||
|
|
||||||
|
```java
|
||||||
|
// 使用 @Data 注解
|
||||||
|
@Data
|
||||||
|
public class CcdiBaseStaff {
|
||||||
|
// 审计字段通过注释实现自动插入
|
||||||
|
/** 创建者 */
|
||||||
|
private String createBy;
|
||||||
|
/** 创建时间 */
|
||||||
|
private Date createTime;
|
||||||
|
/** 更新者 */
|
||||||
|
private String updateBy;
|
||||||
|
/** 更新时间 */
|
||||||
|
private Date updateTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 服务层使用 @Resource 注入
|
||||||
|
@Resource
|
||||||
|
private ICcdiBaseStaffService baseStaffService;
|
||||||
|
```
|
||||||
|
|
||||||
|
### 分层规范
|
||||||
|
|
||||||
|
- **Controller**: 所有接口添加 Swagger 注释,分页使用 MyBatis Plus Page
|
||||||
|
- **Service**: 简单 CRUD 用 MyBatis Plus 方法,复杂操作在 XML 写 SQL
|
||||||
|
- **DTO/VO**: 接口传参使用独立 DTO,返回使用独立 VO,不与 entity 混用
|
||||||
|
|
||||||
|
### API 响应格式
|
||||||
|
|
||||||
|
```java
|
||||||
|
// 成功
|
||||||
|
AjaxResult.success("操作成功", data);
|
||||||
|
|
||||||
|
// 错误
|
||||||
|
AjaxResult.error("操作失败");
|
||||||
|
|
||||||
|
// 分页
|
||||||
|
Page<CcdiBaseStaff> page = new Page<>(pageNum, pageSize);
|
||||||
|
IPage<CcdiBaseStaff> result = baseStaffMapper.selectPage(page, queryWrapper);
|
||||||
|
return AjaxResult.success(result);
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 前端开发规范
|
||||||
|
|
||||||
|
### 目录结构
|
||||||
|
|
||||||
```
|
```
|
||||||
ruoyi-ui/src/
|
ruoyi-ui/src/
|
||||||
├── api/ # API request definitions
|
├── api/ # API 请求定义 (与后端 Controller 对应)
|
||||||
├── assets/ # Static resources (images, styles)
|
├── views/ # 页面组件 (按功能模块组织)
|
||||||
├── components/ # Reusable components
|
│ ├── ccdiBaseStaff/
|
||||||
├── layout/ # Main layout (Sidebar, Navbar, TagsView)
|
│ ├── ccdiIntermediary/
|
||||||
├── router/ # Vue Router configuration
|
│ └── ...
|
||||||
├── store/ # Vuex state management
|
├── components/ # 可复用组件 (复杂组件需拆分)
|
||||||
├── utils/ # Utility functions
|
├── router/ # 路由配置
|
||||||
├── views/ # Page components organized by feature
|
└── store/ # Vuex 状态管理
|
||||||
│ ├── dashboard/
|
|
||||||
│ ├── monitor/
|
|
||||||
│ ├── system/
|
|
||||||
│ └── tool/
|
|
||||||
└── permission.js # Permission directives
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Module Dependencies
|
### API 调用示例
|
||||||
|
|
||||||
```
|
|
||||||
ruoyi-admin (startup module)
|
|
||||||
↓ depends on
|
|
||||||
ruoyi-framework (core security & config)
|
|
||||||
ruoyi-system (system core business)
|
|
||||||
ruoyi-common (shared utilities)
|
|
||||||
ruoyi-quartz (scheduled tasks)
|
|
||||||
ruoyi-generator (code generation)
|
|
||||||
```
|
|
||||||
|
|
||||||
## Key Development Patterns
|
|
||||||
|
|
||||||
### Code Generation Workflow
|
|
||||||
|
|
||||||
RuoYi provides a powerful code generator for rapid CRUD development:
|
|
||||||
|
|
||||||
1. **Create database table** - Design your table schema
|
|
||||||
2. **Import table** - Use System Tools → Code Generation → Import
|
|
||||||
3. **Configure** - Edit table info, generate info (module, function name, etc.)
|
|
||||||
4. **Generate code** - Download the generated zip
|
|
||||||
5. **Copy files** - Extract to appropriate directories:
|
|
||||||
- Backend: `ruoyi-admin/web/controller/`, service, mapper files
|
|
||||||
- Frontend: `ruoyi-ui/src/views/`, `ruoyi-ui/src/api/`
|
|
||||||
|
|
||||||
### Permission System
|
|
||||||
|
|
||||||
The permission system uses **Role-Menu-Button** hierarchy:
|
|
||||||
|
|
||||||
- **Menus**: Define navigation items and route permissions
|
|
||||||
- **Roles**: Assign menu permissions to roles
|
|
||||||
- **Users**: Assign roles to users
|
|
||||||
- **Data Permissions**: Control data scope (all, custom, department, etc.)
|
|
||||||
|
|
||||||
Permission keys in code use format: `system:user:edit`, `system:user:remove`, etc.
|
|
||||||
|
|
||||||
### API Response Format
|
|
||||||
|
|
||||||
All API responses use `AjaxResult` wrapper:
|
|
||||||
|
|
||||||
```java
|
|
||||||
// Success
|
|
||||||
AjaxResult.success("操作成功", data);
|
|
||||||
|
|
||||||
// Error
|
|
||||||
AjaxResult.error("操作失败");
|
|
||||||
|
|
||||||
// Custom
|
|
||||||
AjaxResult.put("key", value);
|
|
||||||
```
|
|
||||||
|
|
||||||
### Frontend API Calls
|
|
||||||
|
|
||||||
API calls are defined in `ruoyi-ui/src/api/`:
|
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
|
|
||||||
export function listUser(query) {
|
export function listStaff(query) {
|
||||||
return request({
|
return request({
|
||||||
url: '/system/user/list',
|
url: '/ccdi/baseStaff/list',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: query
|
params: query
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
```
|
||||||
|
|
||||||
export function addUser(data) {
|
### 菜单联动
|
||||||
return request({
|
|
||||||
url: '/system/user',
|
添加页面和组件后,需要同步修改数据库中的菜单表 (`sys_menu`)。
|
||||||
method: 'post',
|
|
||||||
data: data
|
---
|
||||||
})
|
|
||||||
|
## 特殊功能
|
||||||
|
|
||||||
|
### 异步导入
|
||||||
|
|
||||||
|
支持大数据量异步 Excel 导入,通过 taskId 查询导入状态:
|
||||||
|
|
||||||
|
```java
|
||||||
|
@PostMapping("/import")
|
||||||
|
public AjaxResult asyncImport(@RequestParam("file") MultipartFile file) {
|
||||||
|
String taskId = asyncImportService.startImport(file);
|
||||||
|
return AjaxResult.success("导入任务已启动", taskId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/import/status/{taskId}")
|
||||||
|
public AjaxResult getImportStatus(@PathVariable String taskId) {
|
||||||
|
return AjaxResult.success(asyncImportService.getStatus(taskId));
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
## OpenSpec Workflow
|
### EasyExcel 字典下拉框
|
||||||
|
|
||||||
This project uses **OpenSpec** for specification-driven development. Always reference `openspec/AGENTS.md` when:
|
导入模板支持字典下拉框配置,提升数据录入准确性。
|
||||||
|
|
||||||
- Planning or proposing new features
|
### 权限控制
|
||||||
- Making breaking changes
|
|
||||||
- Modifying architecture
|
|
||||||
- Handling ambiguous requirements
|
|
||||||
|
|
||||||
### Key OpenSpec Commands
|
基于 Spring Security + JWT 的角色菜单权限系统:
|
||||||
|
|
||||||
|
- 权限格式: `system:user:edit`, `ccdi:staff:list`
|
||||||
|
- 数据权限: 支持全部、自定义、部门等范围
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 测试与验证
|
||||||
|
|
||||||
|
### 测试账号
|
||||||
|
|
||||||
|
- **用户名**: `admin`
|
||||||
|
- **密码**: `admin123`
|
||||||
|
|
||||||
|
### 登录获取 Token
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# List active changes
|
# 登录接口
|
||||||
openspec list
|
POST /login/test?username=admin&password=admin123
|
||||||
|
|
||||||
# List all specifications
|
|
||||||
openspec list --specs
|
|
||||||
|
|
||||||
# View details
|
|
||||||
openspec show [change-id or spec-id]
|
|
||||||
|
|
||||||
# Validate changes
|
|
||||||
openspec validate [change-id] --strict --no-interactive
|
|
||||||
|
|
||||||
# Archive completed changes
|
|
||||||
openspec archive <change-id>
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### When to Create Proposals
|
### API 文档
|
||||||
|
|
||||||
**Create proposal for:**
|
- **Swagger UI**: `/swagger-ui/index.html`
|
||||||
- New features or capabilities
|
- **API Docs**: `/v3/api-docs`
|
||||||
- Breaking changes (API, schema)
|
|
||||||
- Architecture changes
|
|
||||||
- Performance optimizations that change behavior
|
|
||||||
|
|
||||||
**Skip proposal for:**
|
### 测试规范
|
||||||
- Bug fixes (restoring intended behavior)
|
|
||||||
- Typos, formatting, comments
|
|
||||||
- Non-breaking dependency updates
|
|
||||||
- Configuration changes
|
|
||||||
|
|
||||||
## Configuration Notes
|
- 不在命令行启动后端进行测试
|
||||||
|
- 生成可执行的测试脚本进行验证
|
||||||
|
- 测试完成后保存接口输出并生成测试用例报告
|
||||||
|
|
||||||
- **Default Admin**: `admin/admin123`
|
---
|
||||||
- **Backend Port**: 8080
|
|
||||||
- **Frontend Dev Port**: 80
|
|
||||||
- **API Base Path**: Configured in `ruoyi-ui/vue.config.js` proxy
|
|
||||||
- **Database Config**: `ruoyi-admin/src/main/resources/application.yml`
|
|
||||||
|
|
||||||
## Important File Locations
|
## 配置说明
|
||||||
|
|
||||||
| Purpose | Location |
|
| 配置项 | 值 |
|
||||||
|---------|----------|
|
|---------|-------------------|
|
||||||
| Main application entry | [ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java](ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java) |
|
| 后端端口 | 8080 |
|
||||||
| Security configuration | [ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java](ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java) |
|
| 前端开发端口 | 80 |
|
||||||
| Database config | [ruoyi-admin/src/main/resources/application.yml](ruoyi-admin/src/main/resources/application.yml) |
|
| 默认管理员 | admin/admin123 |
|
||||||
| MyBatis mappers | [ruoyi-system/src/main/resources/mapper/system/](ruoyi-system/src/main/resources/mapper/system/) |
|
| JWT 有效期 | 30 分钟 |
|
||||||
| Vue router | [ruoyi-ui/src/router/index.js](ruoyi-ui/src/router/index.js) |
|
| 文件上传限制 | 单文件 10MB, 总计 20MB |
|
||||||
| Vuex store | [ruoyi-ui/src/store/](ruoyi-ui/src/store/) |
|
|
||||||
|
### 配置文件位置
|
||||||
|
|
||||||
|
| 配置 | 路径 |
|
||||||
|
|----------|------------------------------------------------------|
|
||||||
|
| 主配置 | `ruoyi-admin/src/main/resources/application.yml` |
|
||||||
|
| 开发环境 | `ruoyi-admin/src/main/resources/application-dev.yml` |
|
||||||
|
| 数据库连接 | `application-dev.yml` |
|
||||||
|
| Redis 配置 | `application-dev.yml` |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 重要文件路径
|
||||||
|
|
||||||
|
| 用途 | 路径 |
|
||||||
|
|---------------|--------------------------------------------------------------------------------|
|
||||||
|
| 应用入口 | `ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java` |
|
||||||
|
| 安全配置 | `ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java` |
|
||||||
|
| 业务 Controller | `ruoyi-ccdi/src/main/java/com/ruoyi/ccdi/controller/` |
|
||||||
|
| 业务 Mapper XML | `ruoyi-ccdi/src/main/resources/mapper/ccdi/` |
|
||||||
|
| Vue 路由 | `ruoyi-ui/src/router/index.js` |
|
||||||
|
| Vuex Store | `ruoyi-ui/src/store/` |
|
||||||
|
| 前端 API | `ruoyi-ui/src/api/` |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 数据库规范
|
||||||
|
|
||||||
|
- **新建表名**: 需要加上项目英文名首字母集合前缀 (如 `ccdi_base_staff`)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 文档管理
|
||||||
|
|
||||||
|
- **文档语言**: 使用简体中文编写 .md 文档
|
||||||
|
- **文档目录**: 所有生成的文档放在 `doc/` 目录下,按类型分类
|
||||||
|
- **需求分析**: 在 `doc/` 目录下新建文件夹,以需求内容命名
|
||||||
|
|
||||||
|
### doc 目录结构
|
||||||
|
|
||||||
|
```
|
||||||
|
doc/
|
||||||
|
├── api-docs/ # API 文档
|
||||||
|
├── database/ # 数据库相关
|
||||||
|
├── design/ # 设计文档
|
||||||
|
├── implementation/ # 实施文档
|
||||||
|
├── requirements/ # 需求文档
|
||||||
|
└── test-scripts/ # 测试脚本
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## OpenSpec 工作流
|
||||||
|
|
||||||
|
项目使用 OpenSpec 进行规范驱动开发,参考 `openspec/AGENTS.md`。
|
||||||
|
|
||||||
|
### 何时创建 Proposal
|
||||||
|
|
||||||
|
**需要创建:**
|
||||||
|
|
||||||
|
- 新功能或能力
|
||||||
|
- 破坏性变更 (API, 数据库结构)
|
||||||
|
- 架构变更
|
||||||
|
- 改变行为的性能优化
|
||||||
|
|
||||||
|
**无需创建:**
|
||||||
|
|
||||||
|
- Bug 修复 (恢复预期行为)
|
||||||
|
- 拼写错误、格式、注释
|
||||||
|
- 非破坏性依赖更新
|
||||||
|
- 配置变更
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 沟通规范
|
||||||
|
|
||||||
|
- 永远使用简体中文进行思考和对话
|
||||||
|
|||||||
103
ruoyi-admin/src/main/resources/application-local.yml
Normal file
103
ruoyi-admin/src/main/resources/application-local.yml
Normal file
@@ -0,0 +1,103 @@
|
|||||||
|
# 开发环境配置
|
||||||
|
server:
|
||||||
|
# 服务器的HTTP端口,默认为8080
|
||||||
|
port: 8080
|
||||||
|
servlet:
|
||||||
|
# 应用的访问路径
|
||||||
|
context-path: /
|
||||||
|
tomcat:
|
||||||
|
# tomcat的URI编码
|
||||||
|
uri-encoding: UTF-8
|
||||||
|
# 连接数满后的排队数,默认为100
|
||||||
|
accept-count: 1000
|
||||||
|
threads:
|
||||||
|
# tomcat最大线程数,默认为200
|
||||||
|
max: 800
|
||||||
|
# Tomcat启动初始化的线程数,默认值10
|
||||||
|
min-spare: 100
|
||||||
|
|
||||||
|
|
||||||
|
# 数据源配置
|
||||||
|
spring:
|
||||||
|
datasource:
|
||||||
|
type: com.alibaba.druid.pool.DruidDataSource
|
||||||
|
driverClassName: com.mysql.cj.jdbc.Driver
|
||||||
|
druid:
|
||||||
|
# 主库数据源
|
||||||
|
master:
|
||||||
|
url: jdbc:mysql://192.168.0.111:40627/ccdi?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||||
|
username: root
|
||||||
|
password: Kfcx@1234
|
||||||
|
# 从库数据源
|
||||||
|
slave:
|
||||||
|
# 从数据源开关/默认关闭
|
||||||
|
enabled: false
|
||||||
|
url:
|
||||||
|
username:
|
||||||
|
password:
|
||||||
|
# 初始连接数
|
||||||
|
initialSize: 5
|
||||||
|
# 最小连接池数量
|
||||||
|
minIdle: 10
|
||||||
|
# 最大连接池数量
|
||||||
|
maxActive: 20
|
||||||
|
# 配置获取连接等待超时的时间
|
||||||
|
maxWait: 60000
|
||||||
|
# 配置连接超时时间
|
||||||
|
connectTimeout: 30000
|
||||||
|
# 配置网络超时时间
|
||||||
|
socketTimeout: 60000
|
||||||
|
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
|
||||||
|
timeBetweenEvictionRunsMillis: 60000
|
||||||
|
# 配置一个连接在池中最小生存的时间,单位是毫秒
|
||||||
|
minEvictableIdleTimeMillis: 300000
|
||||||
|
# 配置一个连接在池中最大生存的时间,单位是毫秒
|
||||||
|
maxEvictableIdleTimeMillis: 900000
|
||||||
|
# 配置检测连接是否有效
|
||||||
|
validationQuery: SELECT 1 FROM DUAL
|
||||||
|
testWhileIdle: true
|
||||||
|
testOnBorrow: false
|
||||||
|
testOnReturn: false
|
||||||
|
webStatFilter:
|
||||||
|
enabled: true
|
||||||
|
statViewServlet:
|
||||||
|
enabled: true
|
||||||
|
# 设置白名单,不填则允许所有访问
|
||||||
|
allow:
|
||||||
|
url-pattern: /druid/*
|
||||||
|
# 控制台管理用户名和密码
|
||||||
|
login-username: ruoyi
|
||||||
|
login-password: 123456
|
||||||
|
filter:
|
||||||
|
stat:
|
||||||
|
enabled: true
|
||||||
|
# 慢SQL记录
|
||||||
|
log-slow-sql: true
|
||||||
|
slow-sql-millis: 1000
|
||||||
|
merge-sql: true
|
||||||
|
wall:
|
||||||
|
config:
|
||||||
|
multi-statement-allow: true
|
||||||
|
data:
|
||||||
|
# redis 配置
|
||||||
|
redis:
|
||||||
|
# 地址
|
||||||
|
host: 192.168.0.111
|
||||||
|
# 端口,默认为6379
|
||||||
|
port: 44565
|
||||||
|
# 数据库索引
|
||||||
|
database: 0
|
||||||
|
# 密码
|
||||||
|
password: Kfcx@1234
|
||||||
|
# 连接超时时间
|
||||||
|
timeout: 10s
|
||||||
|
lettuce:
|
||||||
|
pool:
|
||||||
|
# 连接池中的最小空闲连接
|
||||||
|
min-idle: 0
|
||||||
|
# 连接池中的最大空闲连接
|
||||||
|
max-idle: 8
|
||||||
|
# 连接池的最大数据库连接数
|
||||||
|
max-active: 8
|
||||||
|
# #连接池最大阻塞等待时间(使用负值表示没有限制)
|
||||||
|
max-wait: -1ms
|
||||||
@@ -83,11 +83,6 @@ springdoc:
|
|||||||
enabled: true
|
enabled: true
|
||||||
path: /swagger-ui.html
|
path: /swagger-ui.html
|
||||||
tags-sorter: alpha
|
tags-sorter: alpha
|
||||||
group-configs:
|
|
||||||
- group: 'default'
|
|
||||||
display-name: '纪检模块'
|
|
||||||
paths-to-match: '/**'
|
|
||||||
packages-to-scan: com.ruoyi.dpc.controller
|
|
||||||
|
|
||||||
# 防盗链配置
|
# 防盗链配置
|
||||||
referer:
|
referer:
|
||||||
|
|||||||
@@ -36,7 +36,8 @@ module.exports = {
|
|||||||
proxy: {
|
proxy: {
|
||||||
// detail: https://cli.vuejs.org/config/#devserver-proxy
|
// detail: https://cli.vuejs.org/config/#devserver-proxy
|
||||||
[process.env.VUE_APP_BASE_API]: {
|
[process.env.VUE_APP_BASE_API]: {
|
||||||
target: baseUrl,
|
// target: baseUrl,
|
||||||
|
target: "http://116.62.17.81:20202",
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
pathRewrite: {
|
pathRewrite: {
|
||||||
['^' + process.env.VUE_APP_BASE_API]: ''
|
['^' + process.env.VUE_APP_BASE_API]: ''
|
||||||
|
|||||||
Reference in New Issue
Block a user