|
RestLink 2.2.0
Powerfull Rest Client for Qt
|
Provides a base interface for RESTful resource controllers. More...
#include <resourcecontroller.h>
Inherits RestLink::AbstractController.
Public Member Functions | |
| virtual | ~AbstractResourceController ()=default |
| Virtual destructor for cleanup in derived classes. | |
| virtual void | index (const ServerRequest &request, ServerResponse *response)=0 |
| Handles the listing of resources. | |
| virtual void | show (const ServerRequest &request, ServerResponse *response)=0 |
| Handles showing a single resource. | |
| virtual void | update (const ServerRequest &request, ServerResponse *response)=0 |
| Handles updating a resource. | |
| virtual void | store (const ServerRequest &request, ServerResponse *response)=0 |
| Handles creating a new resource. | |
| virtual void | destroy (const ServerRequest &request, ServerResponse *response)=0 |
| Handles deleting a resource. | |
| bool | canProcessRequest (const ServerRequest &request) const override |
| Checks whether the controller can process the given request. | |
| void | processRequest (const ServerRequest &request, ServerResponse *response) override |
| Processes the incoming request and dispatches it to the appropriate handler method. | |
Public Member Functions inherited from RestLink::AbstractController | |
| AbstractController () | |
| virtual | ~AbstractController () |
| virtual QString | endpoint () const =0 |
| Returns the base endpoint this controller is responsible for. | |
| void * | dataSource () const |
| Returns the data source associated with this controller. | |
| void | setDataSource (void *source) |
| Sets the data source for the controller. | |
Provides a base interface for RESTful resource controllers.
This abstract class defines standard CRUD operations (index, show, update, store, destroy) to be implemented by subclasses for handling requests in a RESTful manner. It also overrides request processing logic to dispatch requests to the appropriate method.
|
virtualdefault |
Virtual destructor for cleanup in derived classes.
|
pure virtual |
Handles the listing of resources.
This method should be implemented to respond to a GET request on a collection route.
|
pure virtual |
Handles showing a single resource.
This method should be implemented to respond to a GET request on a single item route.
|
pure virtual |
Handles updating a resource.
This method should be implemented to respond to a PUT or PATCH request on a single item route.
|
pure virtual |
Handles creating a new resource.
This method should be implemented to respond to a POST request on a collection route.
|
pure virtual |
Handles deleting a resource.
This method should be implemented to respond to a DELETE request on a single item route.
|
overridevirtual |
Checks whether the controller can process the given request.
Typically used to determine if the controller supports the request method and route.
Reimplemented from RestLink::AbstractController.
|
overridevirtual |
Processes the incoming request and dispatches it to the appropriate handler method.
Dispatch logic typically maps request methods to controller actions like index, show, update, etc.
Implements RestLink::AbstractController.