⬅️ Back to Layers Overview

Controller Layer

The Controller Layer serves as the HTTP API entry point for all client requests. It handles request routing, validation, authentication/authorization checks, and response formatting.

Location: src/main/java/com/smartsupplypro/inventory/controller/

Responsibility: HTTP protocol handling, request validation, response building, error mapping

Quick Navigation

By Topic

By Role

Architecture Overview

graph TB Client["Client
REST Requests"] Routes["Request Routing
@GetMapping, @PostMapping, etc."] Auth["Authorization
@PreAuthorize"] Validation["Request Validation
@Valid, @NotNull"] Mapping["DTO Conversion
Request → Internal"] Service["Service Layer
Business Logic"] DTOResp["DTO Conversion
Domain → Response"] Response["HTTP Response
JSON Serialization"] Client -->|HTTP| Routes Routes --> Auth Auth -->|Check Roles| Validation Validation -->|Validate DTO| Mapping Mapping -->|Convert| Service Service -->|Execute Business Logic| DTOResp DTOResp -->|Convert| Response Response -->|JSON| Client style Client fill:#e3f2fd style Routes fill:#bbdefb style Auth fill:#90caf9 style Validation fill:#64b5f6 style Mapping fill:#42a5f5 style Service fill:#2196f3 style DTOResp fill:#1976d2 style Response fill:#1565c0

⬅️ Back to Layers Overview