问题:当子任务包含多个任务类型时,updateTaskItemsQuantityAndScore方法 只用第一个任务类型的单价计算总积分,导致积分显示错误。 解决: 1. 先更新typeDetails JSON,再从更新后的typeDetails中重新计算总积分 2. 新增calculateTotalScoreFromTypeDetails方法从JSON中累加所有类型积分 3. 新增calculateTotalQuantityFromTypeDetails方法计算总数量 4. 同时更新平均单价以保持数据一致性
105 lines
3.4 KiB
Markdown
105 lines
3.4 KiB
Markdown
# CLAUDE.md
|
|
|
|
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
|
|
|
## Project Overview
|
|
|
|
DesignHub is a full-stack Designer Task Management Platform (设计师任务抢单管理系统) - a task distribution and management system with a point-based incentive mechanism.
|
|
|
|
**Tech Stack:**
|
|
- **Frontend**: Vue 3 + TypeScript + Ant Design Vue + Pinia + Vite
|
|
- **Backend**: Spring Boot 3.x (Java 17) + MySQL + MyBatis Plus + Redis
|
|
- **Authentication**: JWT tokens with RBAC (7 roles)
|
|
|
|
## Common Commands
|
|
|
|
### Frontend (cd frontend)
|
|
```bash
|
|
pnpm install # Install dependencies
|
|
pnpm dev # Start dev server (port 3000)
|
|
pnpm build # Build for production
|
|
pnpm lint # Lint and fix code
|
|
pnpm format # Format with Prettier
|
|
```
|
|
|
|
### Backend (cd backend)
|
|
```bash
|
|
mvn clean install -DskipTests # Build project
|
|
mvn spring-boot:run # Start dev server (port 8080)
|
|
java -jar target/designhub-backend-*.jar # Run compiled JAR
|
|
```
|
|
|
|
### Database
|
|
```bash
|
|
mysql -u root -p < database/schema.sql
|
|
mysql -u root -p < database/init-data.sql
|
|
```
|
|
|
|
## Architecture
|
|
|
|
### Backend Structure
|
|
```
|
|
backend/src/main/java/com/designhub/
|
|
├── annotation/ # Custom annotations (@RequirePermission, @RequireRole)
|
|
├── common/ # Result wrapper, ResultCode enums
|
|
├── config/ # Spring configs (Cors, MyBatis, Swagger, Web)
|
|
├── controller/ # REST APIs (38 controllers)
|
|
├── dto/ # Request DTOs
|
|
├── entity/ # JPA entities (53 tables)
|
|
├── exception/ # Business exceptions
|
|
├── interceptor/ # Auth interceptor
|
|
├── mapper/ # MyBatis mappers
|
|
├── service/ # Business logic (41 services)
|
|
├── util/ # JwtUtil, ExcelExportUtil, etc.
|
|
└── vo/ # Response View Objects
|
|
```
|
|
|
|
### Frontend Structure
|
|
```
|
|
frontend/src/
|
|
├── api/ # Axios API modules (task.ts, user.ts, auth.ts, etc.)
|
|
├── components/ # Reusable components (TaskCard, Navbar, etc.)
|
|
├── composables/ # Vue composables
|
|
├── layouts/ # Layout wrappers
|
|
├── router/ # Vue Router config
|
|
├── stores/ # Pinia stores (auth, config, siteSettings)
|
|
├── types/ # TypeScript interfaces
|
|
├── utils/ # Utility functions
|
|
└── views/ # Page components (27 views)
|
|
```
|
|
|
|
### API Documentation
|
|
- Swagger UI: http://localhost:8080/doc.html (when backend running)
|
|
- Frontend dev server proxies `/api` to `http://localhost:8080`
|
|
|
|
## Key Conventions
|
|
|
|
### Backend
|
|
- Custom permission annotations: `@RequirePermission`, `@RequireRole` on controller methods
|
|
- Response format: `Result<T>` wrapper with `ResultCode` enum for status codes
|
|
- JWT tokens stored in `Authorization` header (Bearer scheme)
|
|
|
|
### Frontend
|
|
- Auto-imported Vue components via `unplugin-vue-components`
|
|
- API calls use axios with JWT in localStorage
|
|
- Vue Composition API (`<script setup>`)
|
|
|
|
### Git Commit Format
|
|
```
|
|
feat: 新功能
|
|
fix: Bug修复
|
|
docs: 文档更新
|
|
style: 代码格式
|
|
refactor: 重构
|
|
perf: 性能优化
|
|
test: 测试相关
|
|
```
|
|
|
|
## Entry Points
|
|
- Frontend main: `frontend/src/main.ts`
|
|
- Backend main: `backend/src/main/java/com/designhub/DesignHubApplication.java`
|
|
- Dev config: `backend/src/main/resources/application-dev.yml`
|
|
|
|
## Default Credentials
|
|
- Admin: `admin` / `123456`
|