mirror of
https://gitee.com/likeadmin/likeadmin_java.git
synced 2026-05-06 23:33:15 +08:00
add:AI编程提示词
This commit is contained in:
152
AI_PROMPT.md
Normal file
152
AI_PROMPT.md
Normal file
@@ -0,0 +1,152 @@
|
||||
# LikeAdmin Java - Project Context & AI Coding Guidelines
|
||||
|
||||
This file provides comprehensive context and guidelines for AI coding assistants working on the LikeAdmin Java project.
|
||||
|
||||
## 1. Project Overview
|
||||
**LikeAdmin Java** is a general-purpose management system with a separated frontend and backend.
|
||||
- **Backend**: Java (Spring Boot)
|
||||
- **Admin Frontend**: Vue 3 + TypeScript + Element Plus
|
||||
- **User Frontend (Mobile/PC)**: UniApp (Vue 3)
|
||||
|
||||
## 2. Technology Stack
|
||||
|
||||
### 2.1 Backend (`server/`)
|
||||
- **Language**: Java 8 (JDK 1.8)
|
||||
- **Framework**: Spring Boot 2.7.5
|
||||
- **Database**: MySQL 5.7+
|
||||
- **ORM**: MyBatis Plus 3.5.2 + MyBatis Plus Join 1.2.4
|
||||
- **Cache**: Redis
|
||||
- **Auth**: Sa-Token 1.32.0 (Role-based access control)
|
||||
- **Tools**: Lombok, FastJson2, Quartz (Scheduling), EasyExcel
|
||||
- **Build Tool**: Maven
|
||||
|
||||
### 2.2 Admin Frontend (`admin/`)
|
||||
- **Framework**: Vue 3 (Composition API)
|
||||
- **Build Tool**: Vite 3.2.10
|
||||
- **Language**: TypeScript ~4.7.4
|
||||
- **UI Component Library**: Element Plus 2.2.27
|
||||
- **State Management**: Pinia 2.2.2
|
||||
- **HTTP Client**: Axios 0.27.2
|
||||
- **CSS Utility**: Tailwind CSS 3.4.10
|
||||
- **Router**: Vue Router 4.4.3
|
||||
|
||||
### 2.3 UniApp Frontend (`uniapp/`)
|
||||
- **Framework**: UniApp (Vue 3)
|
||||
- **Platform Support**: H5, WeChat Mini Program, App (iOS/Android)
|
||||
- **State Management**: Pinia 2.0.20
|
||||
- **CSS Utility**: Tailwind CSS (via `weapp-tailwindcss-webpack-plugin`)
|
||||
- **Router**: uniapp-router-next
|
||||
- **UI Components**: z-paging, native uni-ui
|
||||
|
||||
## 3. Directory Structure
|
||||
|
||||
```
|
||||
/
|
||||
├── server/ # Java Backend Root
|
||||
│ ├── like-admin/ # Admin API Module (Controllers, Services)
|
||||
│ │ ├── src/main/java/com/mdd/admin/
|
||||
│ │ │ ├── controller/ # API Endpoints
|
||||
│ │ │ ├── service/ # Business Logic
|
||||
│ │ │ └── validate/ # Request DTOs & Validation
|
||||
│ ├── like-front/ # Front API Module (User/Mobile Entry)
|
||||
│ ├── like-common/ # Shared Module (Entities, Mappers, Utils)
|
||||
│ │ ├── src/main/java/com/mdd/common/
|
||||
│ │ │ ├── core/ # Core classes (AjaxResult, etc.)
|
||||
│ │ │ ├── entity/ # Database Entities
|
||||
│ │ │ ├── mapper/ # MyBatis Mappers
|
||||
│ │ │ └── util/ # Utility classes
|
||||
│ ├── like-generator/ # Code Generator Module
|
||||
│ └── pom.xml # Root Maven POM
|
||||
│
|
||||
├── admin/ # Admin Management Frontend (Vue3 + TS)
|
||||
│ ├── src/
|
||||
│ │ ├── api/ # API request definitions
|
||||
│ │ ├── assets/ # Static assets
|
||||
│ │ ├── components/ # Global components
|
||||
│ │ ├── layout/ # Layout components
|
||||
│ │ ├── router/ # Routing configuration
|
||||
│ │ ├── stores/ # Pinia stores
|
||||
│ │ ├── views/ # Page views
|
||||
│ │ └── App.vue # Root Component
|
||||
│ └── vite.config.ts # Vite Configuration
|
||||
│
|
||||
└── uniapp/ # Mobile/User Frontend (UniApp)
|
||||
├── src/
|
||||
│ ├── api/ # API requests
|
||||
│ ├── pages/ # Application pages
|
||||
│ ├── static/ # Static files
|
||||
│ └── App.vue # Root Component
|
||||
└── pages.json # UniApp Pages Configuration
|
||||
```
|
||||
|
||||
## 4. Development Guidelines
|
||||
|
||||
### 4.1 Backend (Java)
|
||||
- **Module Separation**:
|
||||
- **Controllers & Services** go in `like-admin` (for admin features) or `like-front` (for user features).
|
||||
- **Entities, Mappers, & Utils** go in `like-common`.
|
||||
- **Controller**:
|
||||
- Located in `controller` package.
|
||||
- Should return `AjaxResult<T>` or `AjaxResult<Map<String, Object>>`.
|
||||
- Use Swagger/Knife4j annotations for documentation.
|
||||
- **Service**:
|
||||
- Interface in `service`, implementation in `service.impl`.
|
||||
- Business logic resides here.
|
||||
- **Entities**:
|
||||
- Located in `like-common/src/main/java/.../entity`.
|
||||
- Use Lombok `@Data`.
|
||||
- Use MyBatis Plus annotations (`@TableName`, `@TableId`).
|
||||
- **Response Format**:
|
||||
- Use `com.mdd.common.core.AjaxResult` for unified responses.
|
||||
- Success: `AjaxResult.success()`
|
||||
- Failure: `AjaxResult.failed()`
|
||||
- **Security**:
|
||||
- Use `Sa-Token` for authentication.
|
||||
- `@SaCheckLogin`: Require login.
|
||||
- `@SaCheckPermission`: Require permission.
|
||||
- **Configuration**:
|
||||
- `application.yml` and `application-dev.yml` in `src/main/resources`.
|
||||
|
||||
### 4.2 Admin Frontend (Vue3)
|
||||
- **API Calls**:
|
||||
- Define API functions in `src/api/`.
|
||||
- Use `request.get`, `request.post` from `utils/request`.
|
||||
- **State**:
|
||||
- Use Pinia stores in `src/stores/`.
|
||||
- **Styling**:
|
||||
- Use Tailwind CSS for utility classes.
|
||||
- SCSS for custom component styles.
|
||||
- **Components**:
|
||||
- Prefer `script setup` syntax.
|
||||
|
||||
### 4.3 UniApp Frontend
|
||||
- **Pages**:
|
||||
- Register new pages in `pages.json`.
|
||||
- **Networking**:
|
||||
- Use `utils/request` for API calls.
|
||||
- Base URL configured in `.env` files.
|
||||
- **Multi-platform**:
|
||||
- Use conditional compilation (`#ifdef MP-WEIXIN`, etc.) if needed.
|
||||
|
||||
## 5. Deployment Info
|
||||
- **Server Ports**:
|
||||
- Admin/Backend: Typically 8082 (or configured in yml)
|
||||
- Front/Mobile API: Typically 8083
|
||||
- **Nginx**:
|
||||
- Requires reverse proxy configuration for `/api/` to backend ports.
|
||||
- Separate domains/subdomains recommended for Admin and H5.
|
||||
|
||||
## 6. Common Tasks & Commands
|
||||
- **Backend Run**: `mvn spring-boot:run` (in sub-modules) or run `LikeAdminApplication` class.
|
||||
- **Admin Dev**: `npm run dev` (in `admin/`)
|
||||
- **Admin Build**: `npm run build`
|
||||
- **UniApp Dev**: `npm run dev:h5` or `npm run dev:mp-weixin` (in `uniapp/`)
|
||||
|
||||
## 7. AI Coding Rules
|
||||
1. **Context Awareness**: Always check which module (`server`, `admin`, `uniapp`) you are working in.
|
||||
2. **Consistency**: Follow existing naming conventions (camelCase for Java/JS, snake_case for DB).
|
||||
3. **Safety**: Do not hardcode credentials. Use configuration files.
|
||||
4. **Verification**: When modifying backend, ensure `like-common` changes are reflected in dependent modules.
|
||||
|
||||
---
|
||||
*Generated by Trae AI to assist in development.*
|
||||
@@ -1,6 +1,5 @@
|
||||
|
||||
<a href="https://www.likeshop.cn"></a><br>
|
||||
<a href="https://www.mddai.cn"></a><br>
|
||||
<a href="https://www.likeshop.cn"></a><br>
|
||||
<a href="https://www.buildingai.cc"></a><br>
|
||||
<h1 align="center">likeadmin通用管理后台(Java)</h1>
|
||||
<h4 align="center">⚡️快速开发、🛠️ 一键生成代码、✅后台多端自适应、📱手机端、🖥️PC(电脑)端前台</h4>
|
||||
<p align="center">
|
||||
|
||||
Reference in New Issue
Block a user