Neopric-Inc / NeoApps.AI-CodeGenerator

World's first no-code low-code app builder focuses on a data-first approach, allowing users to create applications from scratch. The code generator builds a drag-and-drop React application along with a .NET Core API and a MySQL database.
https://neoapps.ai/
BSD 3-Clause "New" or "Revised" License
18 stars 6 forks source link

Master API Endpoint #9

Open NeoAppsAI opened 1 month ago

NeoAppsAI commented 1 month ago

Feature: Create a Master API Endpoint for Dynamic View Data Retrieval

Description:

Implement a master API endpoint that dynamically retrieves data from database views based on a view name provided in the API request. This API should support querying multiple predefined views and return data in JSON format. Tasks:

Create a new API controller (MasterReportsController) in the backend. Implement a method (GetReport) that accepts a view name as a parameter and retrieves data from the corresponding database view. Ensure security by whitelisting allowed views and preventing SQL injection. Serialize the retrieved data into JSON and return it in the API response. Add unit tests to validate the API’s behavior with various view names and edge cases. Expected Outcome:

A single API endpoint that can serve data from multiple database views dynamically based on the view name provided in the request.