import 'package:dio/dio.dart' hide Headers; import 'package:eitc_erm_dental_flutter/entity/clinic_info.dart'; import 'package:eitc_erm_dental_flutter/entity/dict_info.dart'; import 'package:eitc_erm_dental_flutter/entity/login_info.dart'; import 'package:eitc_erm_dental_flutter/entity/patient_info.dart'; import 'package:eitc_erm_dental_flutter/entity/version_info.dart'; import 'package:eitc_erm_dental_flutter/http/api_response.dart'; import 'package:retrofit/retrofit.dart'; part 'api_service.g.dart'; @RestApi() abstract class ApiService { factory ApiService(Dio dio, {String? baseUrl}) = _ApiService; ///登录 /// /// [phoneNumber] 手机号 @POST("/app/login") @Headers({ 'Content-Type': 'application/json', }) Future> login( @Field("phoneNumber") String phoneNumber); ///登出 @GET("/app/logout") Future> logout(@Header("token") String token); ///发送验证码 /// ///[phoneNumber] 手机号 @POST("/app/sendCaptchaCode") @Headers({ 'Content-Type': 'application/json', }) Future> sendCaptchaCode( @Field("phoneNumber") String phoneNumber); ///检查验证码 /// /// [captchaCode] 验证码 /// /// [phoneNumber] 手机号 @POST("/app/checkCaptchaCode") @Headers({ 'Content-Type': 'application/json', }) Future> checkCaptchaCode( @Field("captchaCode") String captchaCode, @Field("phoneNumber") String phoneNumber); ///获取字典列表 /// /// [dictType] 字典类型,关系:erm_personal_relationship @GET("/app/api/type/{dictType}") Future>> dictList( @Path("dictType") String dictType); ///获取版本信息 /// /// [type] 类型,android,ios @GET("/app/api/findVersion") Future> getVersion(@Query("type") String type); ///获取咨询人列表 @GET("/app/user/list") Future>> getPatientList(); ///获取诊所列表 @GET("/app/api/clinicList") Future>> getClinicList(); ///添加咨询人 /// /// [name] 名字 /// [idCard] 身份证号 /// [relation] 关系 @POST("/app/user") @Headers({ 'Content-Type': 'application/json', }) Future> addPatient( @Field("patientName") String name, @Field("identificationCard") String idCard, @Field("relationship") String relation); ///隐私政策 @GET("/app/api/privacyPolicy") Future> getPrivacyPolicy(); ///用户协议 @GET("/app/api/userAgreement") @ResponseType.bytes Future> getUserAgreement(); ///权限说明 /// /// [type] 类型,android,ios @GET("/app/api/permissionDescription") @ResponseType.bytes Future> getPermissionDescription( @Query("type") String type); }