Skip to content

Add new controllers to custom apismaster#186

Open
eduardocordova21 wants to merge 9 commits into
GridProtectionAlliance:masterfrom
eduardocordova21:add-new-controllers-to-custom-apismaster
Open

Add new controllers to custom apismaster#186
eduardocordova21 wants to merge 9 commits into
GridProtectionAlliance:masterfrom
eduardocordova21:add-new-controllers-to-custom-apismaster

Conversation

@eduardocordova21
Copy link
Copy Markdown

This pull request introduces a new API controller for device operations and makes supporting changes to enable and register this controller in the openPDC application. The most significant update is the addition of the DeviceController, PhasorController and DevicePhasorController, which provides REST API endpoints for querying device information. Supporting changes include registering the new controller in the web application startup and introducing a constants class for string values used in the adapter layer.

New API Functionality

  • Added a new DeviceController, DevicePhasorController and PhasorController classes in openPDC.Adapters that exposes several REST API endpoints for querying device data, such as retrieving all devices, querying by acronym, company, protocol, and enabled status. The controller includes logging and error handling for each endpoint.
  • Introduced a new internal static class StringConstant in openPDC.Adapters.Constants to centralize string constants used throughout the adapter and controller code.

Application Startup and Registration

  • Registered the new DeviceController, DevicePhasorController and PhasorController in the web API configuration within Startup.cs, ensuring its endpoints are available as part of the application's API surface.
  • Updated and reorganized using statements in Startup.cs for clarity and to include necessary namespaces for the new controller and API functionality. [1] [2]

Code Quality and Maintenance

  • Improved code comments and formatting in Startup.cs for better readability, especially around JSON serialization settings, CORS policy, and assembly loading. [1] [2] [3]
  • Moved the static AuthenticationOptions property to the top of the Startup class for better organization. [1] [2]

Eduardo MO. de Córdova and others added 9 commits May 21, 2026 23:46
Reorganized imports, included PhasorWebUI namespaces, and improved comments. The AuthenticationOptions property was moved to the beginning of the class with documentation. Added instances of the DeviceController, PhasorController, and DevicePhasorController controllers. Adjusted formatting, removed duplicates, and improved organization of static members.
Includes DeviceController, PhasorController, and DevicePhasorController for querying devices (PMUs), phasors, and their relationships, with endpoints for filters and CSV export. Adds StringConstant.cs to standardize field names. Updates the project to include the new files and implements structured logging in all controllers.
Includes the DeviceWithPhasors class as a DTO to represent a Device (PMU) with its list of associated Phasors. Adds the new DeviceWithPhasors.cs file to the openPDC.Model.csproj project.
Comments for the DeviceWithPhasors class have been translated from Portuguese to English, improving documentation and making it easier to understand for international developers.
The driver's XML comment has been reformatted for better readability. In the GetDeviceWithPhasorsByAcronym method, the phasor query has been simplified by removing sorting, limit, and offset parameters, using only the acronym filter.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant