forked from eatvio/eatvio_app
112 lines
3.2 KiB
Dart
112 lines
3.2 KiB
Dart
import 'dart:io';
|
|
|
|
import 'package:dio/dio.dart';
|
|
import 'package:eatvio_app/features/feed/models/feed_blog_post_model.dart';
|
|
import 'package:eatvio_app/features/profile/models/chosen_diets_pagination_model.dart';
|
|
import 'package:eatvio_app/features/profile/models/circumference_model.dart';
|
|
import 'package:eatvio_app/features/profile/models/profile_model.dart';
|
|
import 'package:eatvio_app/features/profile/models/sub_model.dart';
|
|
import 'package:eatvio_app/features/profile/models/weight_model.dart';
|
|
import 'package:retrofit/retrofit.dart';
|
|
|
|
part 'profile_service.g.dart';
|
|
|
|
@RestApi()
|
|
abstract class ProfileService {
|
|
factory ProfileService(Dio dio, {String baseUrl}) = _ProfileService;
|
|
|
|
@GET('/api/profile/show/{slug}')
|
|
Future<ProfileModel> getProfileBySlug({
|
|
@Path() required String slug,
|
|
});
|
|
|
|
@GET('/api/profile/index')
|
|
Future<ProfileModel> getMyProfile();
|
|
|
|
@GET('/api/profile/detailz')
|
|
Future<ProfileDetailsModel> getMyProfileDetails();
|
|
|
|
@GET('/api/profile/detailz/{slug}')
|
|
Future<ProfileDetailsModel> getProfileDetailsBySlug({
|
|
@Path() required String slug,
|
|
});
|
|
|
|
@POST('/api/profile/addCircumference')
|
|
Future<void> addCircumference({
|
|
@Part(name: 'chest_circumference') required int chestCircumference,
|
|
@Part(name: 'waist_circumference') required int waistCircumference,
|
|
@Part(name: 'hip_circumference') required int hipCircumference,
|
|
});
|
|
|
|
@POST('/api/profile/addWeight')
|
|
Future<void> addWeight({
|
|
@Part() required double weight,
|
|
});
|
|
|
|
@GET('/api/blogPosts/search_by_author/{slug}')
|
|
Future<List<FeedBlogPostModel>> getBlogPostByAuthorSlug({
|
|
@Path() required String slug,
|
|
});
|
|
|
|
@GET('/api/profile/measure/weight/{period}')
|
|
Future<List<WeightModel>> getWeight({
|
|
@Path() required String period,
|
|
});
|
|
|
|
@GET('/api/profile/measure/weight/{period}/{slug}')
|
|
Future<List<WeightModel>> getWeightBySlug({
|
|
@Path() required String period,
|
|
@Path() required String slug,
|
|
});
|
|
|
|
@GET('/api/profile/measure/circumferences/{period}')
|
|
Future<List<CircumferenceModel>> getCircumferences({
|
|
@Path() required String period,
|
|
});
|
|
|
|
@GET('/api/profile/measure/circumferences/{period}/{user}')
|
|
Future<List<CircumferenceModel>> getCircumferencesBySlug({
|
|
@Path() required String period,
|
|
@Path() required String slug,
|
|
});
|
|
|
|
@GET('/api/profile/{slug}/subscribers')
|
|
Future<SubPaginationModel> getSubscribers({
|
|
@Path() required String slug,
|
|
@Query('filters[name][\$startsWith]') String? query,
|
|
});
|
|
|
|
@GET('/api/profile/{slug}/subscriptions')
|
|
Future<SubPaginationModel> getSubscriptions({
|
|
@Path() required String slug,
|
|
@Query('filters[name][\$startsWith]') String? query,
|
|
});
|
|
|
|
@POST('/api/profile/subscribe/{slug}')
|
|
Future<void> subscribe({
|
|
@Path() required String slug,
|
|
});
|
|
|
|
@POST('/api/profile/unsubscribe/{slug}')
|
|
Future<void> unsubscribe({
|
|
@Path() required String slug,
|
|
});
|
|
|
|
@POST('/api/profile/photo/upload')
|
|
@MultiPart()
|
|
Future<void> uploadPhoto({
|
|
@Part(name: 'photo') required File photo,
|
|
});
|
|
|
|
@DELETE('/api/profile/photo/delete')
|
|
Future<void> deletePhoto();
|
|
|
|
@GET('/api/profile/chosen_diets')
|
|
Future<ChosenDietsPaginationModel> getChosenDiets();
|
|
|
|
@POST('/api/profile/make_pass_key')
|
|
Future<String> getPassKey({
|
|
@Body() required String json,
|
|
});
|
|
}
|