OpenAPI-Generator-Setup: - tool/generate_api_client.sh: Direkter Aufruf der openapi-generator-cli.jar (Java-CLI statt Dart-build_runner-Integration — vermeidet die analyzer-/source_gen-Version-Hölle mit json_serializable) - tool/fetch_openapi_generator.sh: lädt die JAR (29 MB) nach (gitignored) - openapi/holzleitner.json: Snapshot der Backend-Spec für reproduzierbare Generation - packages/holzleitner_api/: generiertes Dart-Sub-Package (built_value + dio), per path-dep im Haupt-pubspec eingehängt Netzwerk-Layer (lib/data/network/): - BackendConfig: API- und Keycloak-Endpoints für Local-Dev (localhost wegen Keycloak-iss-Claim). - AuthTokenProvider-Schnittstelle. - DevPasswordGrantTokenProvider: Phase-A-Provider via Keycloak password-grant, Token-Caching mit Expiry-Check (Phase B ersetzt das durch flutter_appauth PKCE). - HolzleitnerAuthInterceptor: dynamischer Bearer-Inject pro Request. - HolzleitnerApiFactory: baut die generierte HolzleitnerApi-Klasse mit unserem Interceptor statt der vier Default-Auth-Interceptors. - network_locator.registerNetworking(): get_it-Setup, in main() vor runApp() aufgerufen. Clean-Arch-Scaffolding (lib/data/, lib/domain/): - Verzeichnisstruktur für Phase C+D angelegt (mapper/, repository/, entity/, repository/) — befüllt sich in den Folge-Phasen. Smoke-Test: - tool/smoke_test_api.dart ruft /health (ungeschützt) und /me/cars (mit Bearer) via generiertem Client — grün gegen lokales Backend.
142 lines
3.9 KiB
Markdown
142 lines
3.9 KiB
Markdown
# holzleitner_api.api.CarsApi
|
|
|
|
## Load the API package
|
|
```dart
|
|
import 'package:holzleitner_api/api.dart';
|
|
```
|
|
|
|
All URIs are relative to *http://localhost*
|
|
|
|
Method | HTTP request | Description
|
|
------------- | ------------- | -------------
|
|
[**createMyCar**](CarsApi.md#createmycar) | **POST** /me/cars | Legt ein neues Fahrzeug für den angemeldeten Fahrer an.
|
|
[**listMyCars**](CarsApi.md#listmycars) | **GET** /me/cars | Listet die Fahrzeuge des angemeldeten Fahrers.
|
|
[**updateMyCar**](CarsApi.md#updatemycar) | **PATCH** /me/cars/{car_id} | Aktualisiert ein Fahrzeug (Kennzeichen ändern / deaktivieren).
|
|
|
|
|
|
# **createMyCar**
|
|
> CarResponse createMyCar(createCarRequest)
|
|
|
|
Legt ein neues Fahrzeug für den angemeldeten Fahrer an.
|
|
|
|
### Example
|
|
```dart
|
|
import 'package:holzleitner_api/api.dart';
|
|
|
|
final api = HolzleitnerApi().getCarsApi();
|
|
final CreateCarRequest createCarRequest = ; // CreateCarRequest |
|
|
|
|
try {
|
|
final response = api.createMyCar(createCarRequest);
|
|
print(response);
|
|
} catch on DioException (e) {
|
|
print('Exception when calling CarsApi->createMyCar: $e\n');
|
|
}
|
|
```
|
|
|
|
### Parameters
|
|
|
|
Name | Type | Description | Notes
|
|
------------- | ------------- | ------------- | -------------
|
|
**createCarRequest** | [**CreateCarRequest**](CreateCarRequest.md)| |
|
|
|
|
### Return type
|
|
|
|
[**CarResponse**](CarResponse.md)
|
|
|
|
### Authorization
|
|
|
|
[bearer_auth](../README.md#bearer_auth)
|
|
|
|
### HTTP request headers
|
|
|
|
- **Content-Type**: application/json
|
|
- **Accept**: application/json
|
|
|
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
|
|
|
# **listMyCars**
|
|
> CarsList listMyCars(includeInactive)
|
|
|
|
Listet die Fahrzeuge des angemeldeten Fahrers.
|
|
|
|
### Example
|
|
```dart
|
|
import 'package:holzleitner_api/api.dart';
|
|
|
|
final api = HolzleitnerApi().getCarsApi();
|
|
final bool includeInactive = true; // bool | Wenn true, werden inaktive Fahrzeuge mitgeliefert (default: false)
|
|
|
|
try {
|
|
final response = api.listMyCars(includeInactive);
|
|
print(response);
|
|
} catch on DioException (e) {
|
|
print('Exception when calling CarsApi->listMyCars: $e\n');
|
|
}
|
|
```
|
|
|
|
### Parameters
|
|
|
|
Name | Type | Description | Notes
|
|
------------- | ------------- | ------------- | -------------
|
|
**includeInactive** | **bool**| Wenn true, werden inaktive Fahrzeuge mitgeliefert (default: false) | [optional]
|
|
|
|
### Return type
|
|
|
|
[**CarsList**](CarsList.md)
|
|
|
|
### Authorization
|
|
|
|
[bearer_auth](../README.md#bearer_auth)
|
|
|
|
### HTTP request headers
|
|
|
|
- **Content-Type**: Not defined
|
|
- **Accept**: application/json
|
|
|
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
|
|
|
# **updateMyCar**
|
|
> CarResponse updateMyCar(carId, updateCarRequest)
|
|
|
|
Aktualisiert ein Fahrzeug (Kennzeichen ändern / deaktivieren).
|
|
|
|
### Example
|
|
```dart
|
|
import 'package:holzleitner_api/api.dart';
|
|
|
|
final api = HolzleitnerApi().getCarsApi();
|
|
final String carId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String |
|
|
final UpdateCarRequest updateCarRequest = ; // UpdateCarRequest |
|
|
|
|
try {
|
|
final response = api.updateMyCar(carId, updateCarRequest);
|
|
print(response);
|
|
} catch on DioException (e) {
|
|
print('Exception when calling CarsApi->updateMyCar: $e\n');
|
|
}
|
|
```
|
|
|
|
### Parameters
|
|
|
|
Name | Type | Description | Notes
|
|
------------- | ------------- | ------------- | -------------
|
|
**carId** | **String**| |
|
|
**updateCarRequest** | [**UpdateCarRequest**](UpdateCarRequest.md)| |
|
|
|
|
### Return type
|
|
|
|
[**CarResponse**](CarResponse.md)
|
|
|
|
### Authorization
|
|
|
|
[bearer_auth](../README.md#bearer_auth)
|
|
|
|
### HTTP request headers
|
|
|
|
- **Content-Type**: application/json
|
|
- **Accept**: application/json
|
|
|
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
|
|