From 833fd9d46d7f548447efe05f816592c7a2abd565 Mon Sep 17 00:00:00 2001 From: 啊鑫 <t2856754968@163.com> Date: 星期三, 17 九月 2025 00:33:40 +0800 Subject: [PATCH] 11 --- CLAUDE.md | 78 +++++++++++++++++++++++++++++++++++++++ 1 files changed, 78 insertions(+), 0 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..4df719f --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,78 @@ +# CLAUDE.md + +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. + +## Project Overview + +LB_PdaService (钃濆疂PDA鍚庡彴) is a .NET 8 Web API service designed for PDA (Personal Digital Assistant) backend operations in a MES (Manufacturing Execution System). The service provides REST APIs for warehouse management, production order management, quality control, and ERP integration. + +## Build and Run Commands + +```bash +# Build the project +dotnet build + +# Run the project in development +dotnet run + +# Publish for production +dotnet publish -c Release +``` + +The application runs on ASP.NET Core 8.0 and exposes Swagger documentation at `/swagger` in development mode. + +## Architecture and Code Structure + +### Core Components + +- **Controllers/**: REST API endpoints organized by functional domains + - `BaseController.cs`: Base class providing RequestInfo injection for all controllers + - Domain-specific folders: `Warehouse/`, `QC/`, `Wom/`, `JJGZ/`, `Kingdee/` + - `LoginController.cs` and `AuthController.cs`: Authentication endpoints + +- **service/**: Business logic managers following a manager pattern + - Organized by functional domains matching controller structure + - Each manager handles specific entity operations and business rules + - Names follow pattern `Mes[Entity]Manager.cs` + +- **entity/**: Data models and DTOs + - Domain entities for database mapping + - Extensive collection of MES-related entities (inventory, production, quality control) + - `Base/`: Shared base entities like `RequestInfo` + +- **util/**: Utility classes and helpers + - `DbHelperSQL.cs`: Database access abstraction layer + - `AppsettingsUtility.cs`: Configuration management + - Various helpers for logging, string operations, and API communication + +### Data Access Pattern + +The application uses a custom database access layer (`DbHelperSQL`) rather than Entity Framework. Database connections are managed through the `AppSettings.DataBaseConn` configuration value. + +### Configuration + +- `appsettings.json`: Contains database connection strings and ERP service URLs +- Configuration is injected through `AppsettingsUtility` and accessed via `AppSettings` class +- Database connection string format: SQL Server with encryption enabled + +### Key Architectural Patterns + +1. **Manager Pattern**: Business logic is encapsulated in manager classes in the `service/` directory +2. **Base Controller Pattern**: Common functionality shared through `BaseController` +3. **Custom Data Access**: Direct SQL execution through `DbHelperSQL` utility +4. **Configuration Injection**: Settings injected through custom utility class +5. **Domain Separation**: Code organized by business domains (Warehouse, Production, QC, etc.) + +### Integration Points + +- **ERP Integration**: Service communicates with external ERP systems via configured URLs +- **Database**: SQL Server database with MES schema +- **CORS**: Configured to allow cross-origin requests for API consumers + +### Development Notes + +- The codebase uses Chinese comments and naming conventions +- Swagger is enabled in development for API documentation +- JSON responses use camelCase naming convention +- DateTime format: "yyyy-MM-dd HH:mm:ss" +- No built-in test framework detected in the project structure \ No newline at end of file -- Gitblit v1.9.3