How dji-sdk/dji-cloud-api-demo works
Main Components
a. Cloud SDK Module (found under “cloud-sdk”): This module is the core library. It houses the majority of Java source code and is organized by domain (for example, device, control, debug, flightarea, firmware, hms, interconnection, livestream, log, map, media, organization, property, storage, tsa, wayline, and more). It has configuration packages (including Spring configurations and MQTT related services) that define the main architectural patterns which drive the cloud API.
b. Sample Application Module (found under “sample”): This is a demonstrative, end-to-end implementation built on top of the cloud SDK. It contains controllers, service implementations, DAOs, and configuration files that illustrate the integration of the API in a full-stack Spring (or Spring Boot) application.
c. API Documentation and Tools (found under “api”): There are Postman collections and environments provided, which serve as testing and documentation tools to interact with the API.
d. SQL Scripts (in “sql” folder): Contains the SQL schema or sample data, indicating that a relational database plays a role in data persistence.
e. Docker Support: Hinted by the README (with a downloadable docker image), this shows that the project can be containerized for deployment.
Architectural Patterns & Interactions
• The cloud-sdk module is organized by functionality, which suggests a modular layered architecture. Each domain (e.g., device, control, media, etc.) likely represents a bounded context or sub-service, implemented as separate service classes (often with abstract base classes indicating common patterns).
• Communication with external systems is integrated through multiple mechanisms: HTTP/REST endpoints (as seen in sample controllers), MQTT for messaging (with a dedicated “mqtt” package tree), and WebSocket communication (evident from the “websocket” packages).
• There is clear use of configuration layers (Spring based) to wire together components like interceptors (for authentication, CORS), message queues, and database integrations (using Mybatis and Redis).
• The sample module provides a full-stack view of how the API is consumed by the front-facing services (controllers), business logic (services), persistence layers (DAO or repositories), and even media, wayline, and map management functionalities.
Technologies and Frameworks
– Java with Maven (pom.xml files at various levels)
– Spring / Spring Boot framework, given the numerous configuration and component classes
– Mybatis for ORM (sample has “mybatis” packages)
– MQTT and WebSocket integrations for real‐time messaging
– Docker containerization for deployment
– Database operations (SQL scripts provided) and possibly Redis for caching (noted by the “redis” component)
– Usage of Postman as documented in the “api” folder for testing/consuming the cloud API
– OSS integration (a specialized “oss” package) to work with various cloud storage solutions