Setting up basic API Structure
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
import 'package:ac_web/Api/Dtos/AgentDto.dart';
|
||||
import 'package:ac_web/Api/Services/ApiServiceBase.dart';
|
||||
|
||||
/// Access to the backend `AgentsController` (`/agents`).
|
||||
class AgentsService extends ApiServiceBase {
|
||||
const AgentsService(super.client);
|
||||
|
||||
@override
|
||||
String get controllerRoute => 'agents';
|
||||
|
||||
/// `GET /agents` - all known agents including their current tasks.
|
||||
Future<List<AgentDto>> getAgents() {
|
||||
return client.getList(route(), AgentDto.fromJson);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user