forked from eatvio/eatvio_app
28 lines
833 B
Dart
28 lines
833 B
Dart
import 'package:dio/dio.dart';
|
|
import 'package:eatvio_app/features/feed/models/plan_pagination_model.dart';
|
|
import 'package:retrofit/retrofit.dart';
|
|
|
|
part 'my_plans_service.g.dart';
|
|
|
|
@RestApi()
|
|
abstract class MyPlansService {
|
|
|
|
factory MyPlansService(Dio dio, {String baseUrl}) = _MyPlansService;
|
|
|
|
@GET('/api/plans/index')
|
|
Future<PlanPaginationModel> getPlans({
|
|
@Query('page') required int page,
|
|
@Query('filters[name][\$startsWith]') String? query,
|
|
@Query('filters[type][\$contains]') String? types,
|
|
@Query('filters[duration][\$eq]') int? duration,
|
|
@Query('filters[min_price_of_options][\$between][0]') int? minPrice,
|
|
@Query('filters[min_price_of_options][\$between][1]') int? maxPrice,
|
|
});
|
|
|
|
@POST('/api/plans/delete/{slug}')
|
|
Future<void> deletePlan({
|
|
@Path() required String slug,
|
|
});
|
|
|
|
|
|
} |