A controller defines an interface boundary: it receives an HTTP request, coordinates application behavior through a service, and returns a response. Keep business logic behind a service contract so the REST layer does not become coupled to an LLM provider or implementation choice. section 6.1.2
A disciplined controller should:
- Delegate generation to a service and return its response rather than embedding provider-specific logic. section 6.1.2
Isolated SQL-generation endpoint
A controller receives a request asking for total sales by customer, passes it to SqlGeneratorService, and returns generated SQL. A web-layer test supplies sales and customers tables while mocking the service response. section 6.1.2












