123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111 |
- import 'dart:io';
- import 'package:dio/dio.dart' hide Headers;
- import 'package:retrofit/retrofit.dart';
- import 'package:sport/bean/achievement_detail_info.dart';
- import 'package:sport/bean/achievement_info.dart';
- import 'package:sport/bean/achievement_rule.dart';
- import 'package:sport/bean/bind_info.dart';
- import 'package:sport/bean/feed_back.dart';
- import 'package:sport/bean/login.dart';
- import 'package:sport/services/api/resp.dart';
- part 'login_api.g.dart';
- //@RestApi(baseUrl: "https://local.moodrain.cn")
- @RestApi()
- abstract class LoginApi {
- factory LoginApi(Dio dio, {String baseUrl}) = _LoginApi;
- @POST("/user/loginByPhone")
- Future<LoginInfo> getLoginInfo(@Query("phone") String phone, {@Query("password") String? password, @Query("captcha") String? captcha});
- @POST("/user/sendCaptcha")
- Future getCaptcha(@Query("phone") String phone);
- @POST("/user/loginByQQ")
- Future<LoginInfo> loginQQ(@Query("openid") String openid, @Query("name") String name, {@Query("unionid") String? unionid, @Query("avatar") String? avatar, @Query("gender") int? gender});
- @POST("/user/loginByWx")
- Future<LoginInfo> loginByWx(@Query("code") String code);
- @POST("/user/loginByApple")
- Future<LoginInfo> loginByApple(@Query("apple_id") String appleId, @Query("identity_token") String identityToken, @Query("name") String name);
- @POST("/user/registerByPhone")
- Future<LoginInfo> registerByPhone(@Query("phone") String phone, @Query("password") String password, @Query("captcha") String captcha);
- @POST("/user/clientConfig")
- Future clientConfig(@Query("custom_json") String json);
- @POST("/user/updateInfo")
- Future<RespData<User>> updateInfo(
- @Query("name") String name,
- @Query("gender") int gender, {
- @Query("age") int? age,
- @Query("province_id") int? province_id,
- @Query("city_id") int? city_id,
- @Query("district_id") int? district_id,
- @Query("weight") double? weight,
- @Query("ignore_name_card") int? ignore_name_card,
- });
- @POST("/user/verifyCaptcha")
- Future verifyCaptcha(
- @Query("phone") String phone,
- @Query("captcha") String captcha,
- );
- @POST("/user/resetPasswordByCaptcha")
- Future resetPasswordByCaptcha(
- @Query("phone") String? phone,
- @Query("captcha") String? captcha,
- @Query("password") String? password,
- );
- @GET("/achievement/info")
- Future<AchievementInfo> getAchievementInfo();
- @GET('/achievement/show')
- Future<AchieveDetailInfo> getAchieveDetailInfo(@Query("id") int id, {@Query("user_id") String? userId});
- @GET("/achievement/rule")
- Future<RespData<AchievementRule>> getAchievementRule();
- @GET('/user/bindInfo')
- Future<BindInfo> getBindInfo();
- @GET('/user/bindPhone')
- Future bindPhone(@Query("phone") String phone, @Query("captcha") String captcha);
- @GET('/user/bindWx')
- Future bindWx(@Query("code") String code);
- @GET("/user/bindQQ")
- Future bindQQ(@Query("openid") String openid, {@Query("unionid") String? unionid});
- @POST("/user/resetPasswordByOld")
- Future resetPasswordByOld(@Query("old_password") String? old_password, @Query("new_password") String? new_password);
- @GET("/feedback/types")
- Future<FeedTypeInfo> getFeedBackTypes();
- @POST("/feedback/myChats")
- Future<FeedBackInfo> getFeedBackChats({
- @Query("typeId") int? typeId,
- @Query("groupId") int? groupId,
- @Query("limit") int? limit,
- });
- @POST("/feedback/post")
- Future postFeedBack(@Query("typeId") int typeId, @Query("content") String content, {@Query("images") String? images});
- @POST("/user/setAvatar")
- @Headers(<String, dynamic>{
- "content-type": "multipart/form-data",
- })
- Future<RespData<String>> setAvatar(@Part(name: "file") File file);
- @POST("/user/DeleteSelf")
- Future deleteUser();
- }
|