Browse Source

chore(android): replace query apiKey auth by header

pull/8/head
isra el 2 years ago
parent
commit
c31763d1e4
  1. 11
      android/app/src/main/java/com/vernu/sms/services/GatewayApiService.java

11
android/app/src/main/java/com/vernu/sms/services/GatewayApiService.java

@ -1,19 +1,24 @@
package com.vernu.sms.services; package com.vernu.sms.services;
import com.vernu.sms.dtos.SMSDTO;
import com.vernu.sms.dtos.SMSForwardResponseDTO;
import com.vernu.sms.dtos.RegisterDeviceInputDTO; import com.vernu.sms.dtos.RegisterDeviceInputDTO;
import com.vernu.sms.dtos.RegisterDeviceResponseDTO; import com.vernu.sms.dtos.RegisterDeviceResponseDTO;
import retrofit2.Call; import retrofit2.Call;
import retrofit2.http.Body; import retrofit2.http.Body;
import retrofit2.http.Header;
import retrofit2.http.PATCH; import retrofit2.http.PATCH;
import retrofit2.http.POST; import retrofit2.http.POST;
import retrofit2.http.Path; import retrofit2.http.Path;
import retrofit2.http.Query;
public interface GatewayApiService { public interface GatewayApiService {
@POST("gateway/devices") @POST("gateway/devices")
Call<RegisterDeviceResponseDTO> registerDevice(@Query("apiKey") String apiKey, @Body() RegisterDeviceInputDTO body);
Call<RegisterDeviceResponseDTO> registerDevice(@Header("x-api-key") String apiKey, @Body() RegisterDeviceInputDTO body);
@PATCH("gateway/devices/{deviceId}") @PATCH("gateway/devices/{deviceId}")
Call<RegisterDeviceResponseDTO> updateDevice(@Path("deviceId") String deviceId, @Query("apiKey") String apiKey, @Body() RegisterDeviceInputDTO body);
Call<RegisterDeviceResponseDTO> updateDevice(@Path("deviceId") String deviceId, @Header("x-api-key") String apiKey, @Body() RegisterDeviceInputDTO body);
@POST("gateway/devices/{deviceId}/receivedSMS")
Call<SMSForwardResponseDTO> sendReceivedSMS(@Path("deviceId") String deviceId, @Header("x-api-key") String apiKey, @Body() SMSDTO body);
} }
Loading…
Cancel
Save