diff --git a/.cursor/rules/usecluade.mdc b/.cursor/rules/usecluade.mdc new file mode 100644 index 0000000..de7be1d --- /dev/null +++ b/.cursor/rules/usecluade.mdc @@ -0,0 +1,9 @@ +--- +name: usecluade +description: This is a new rule +--- + +# Overview + +Insert overview text here. The agent will only see this should they choose to apply the rule. +请使用CLAUDE.md中的规则来回答问题。 \ No newline at end of file diff --git a/.gitignore b/.gitignore index f9b09f0..edbed78 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,13 @@ Thumbs.db .history/ codegen/ +# ========== Deploy ========== +deploy/xlcp-images/ +deploy/data/ +deploy/logs/ +deploy/*/target/ +deploy/*/dist/ + # ========== Frontend (separate repo) ========== frontend/ node_modules/ diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..e6d3718 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,154 @@ +# AGENTS.md + +This file provides guidance for AI agents working on the XL Prison Management System codebase. + +## Project Overview + +XL监狱综合管理平台 - A prison management platform built on the Yudao (芋道) framework. + +**Tech Stack**: Java 17, Spring Boot 3.5.9, MyBatis-Plus, Vue 3.5.12, TypeScript 5.3.3, Element Plus, MySQL 8.0+ + +## Essential Commands + +### Backend (Maven) +```bash +# Build all modules +cd backend && mvn clean install -DskipTests + +# Build prison module only +cd backend/yudao-module-prison && mvn clean package + +# Run dev server (port 48080) +cd backend/yudao-server && mvn spring-boot:run + +# Run all tests +cd backend/yudao-module-prison && mvn test + +# Run single test class +mvn test -Dtest=PrisonAreaControllerTest + +# Force update dependencies +mvn clean install -U +``` + +### Frontend (pnpm) +```bash +cd frontend + +# Install dependencies +pnpm install + +# Dev server (local mode) +pnpm dev + +# TypeScript checking +pnpm ts:check + +# Build for different environments +pnpm build:local # Uses .env.local +pnpm build:dev # Uses .env.dev +pnpm build:prod # Uses .env.prod + +# Linting +pnpm lint:eslint # ESLint check & fix (.js,.ts,.vue) +pnpm lint:format # Prettier format +pnpm lint:style # Stylelint fix +``` + +### Quick Start with Make +```bash +make frontend # Start frontend dev server +make backend # Start backend dev server +make run # Start both +``` + +## Code Style Guidelines + +### Java (Backend) + +**Imports**: Grouped by: Spring → Yudao → Third-party → Java stdlib. No wildcard imports. + +**Naming Conventions**: +- Classes: PascalCase (e.g., `PrisonAreaController`, `ScoreDO`) +- Variables/Methods: camelCase (e.g., `getPage()`, `updateTime`) +- Constants: UPPER_SNAKE_CASE (e.g., `DEFAULT_PAGE_SIZE`) +- Package: `cn.iocoder.yudao.module.prison.{module}` + +**VO Naming**: `SaveReqVO`, `PageReqVO`, `RespVO` suffixes required. + +**Annotations**: Place on separate lines. Order: `@RestController` → `@RequestMapping` → `@Tag` → `@PreAuthorize`. + +**Error Handling**: Use `CommonResult` return type. Throw `ServiceException` for business errors with error codes from `ErrorCodeConstants`. + +**Comments**: No comments unless explaining complex business logic. Javadoc only on public APIs. + +### TypeScript/Vue (Frontend) + +**Imports**: Sorted alphabetically. No unused imports. Use absolute imports (`@/`). + +**Naming**: +- Interfaces: PascalCase (e.g., `Area`, `QuestionnaireRecord`) +- Variables/Props: camelCase +- Components: PascalCase file names, kebab-case usage + +**Types**: Avoid `any`. Use explicit types or `unknown` for union types. + +**Vue Composition API**: Use `