| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- package com.paul.drone.network;
- import com.paul.drone.data.OAuth2TokenResponse;
- import com.paul.drone.data.RefreshTokenResponse;
- import com.paul.drone.data.RegisterRequest;
- import com.paul.drone.data.RegisterDeviceResponse;
- import com.paul.drone.data.SmsCodeResponse;
- import com.paul.drone.data.UpdateInfoRequest;
- import com.paul.drone.data.UpdateInfoResponse;
- import retrofit2.Call;
- import retrofit2.http.Body;
- import retrofit2.http.Field;
- import retrofit2.http.FormUrlEncoded;
- import retrofit2.http.GET;
- import retrofit2.http.Header;
- import retrofit2.http.POST;
- import retrofit2.http.Query;
- /**
- * 中国铁塔视联平台API服务接口
- */
- public interface ChinaTowerApiService {
- /**
- * 获取 OAuth2 Token(手机号验证码登录)
- */
- @FormUrlEncoded
- @POST("/hntt-auth/auth/oauth2/token")
- Call<OAuth2TokenResponse> getOAuth2Token(
- @Header("Authorization") String authorization,
- @Field("mobile") String username,
- @Field("grant_type") String grantType,
- @Field("scope") String scope,
- @Field("code") String code
- );
- /**
- * 获取 OAuth2 Token(密码登录)
- */
- @FormUrlEncoded
- @POST("/hntt-auth/auth/oauth2/token")
- Call<OAuth2TokenResponse> getOAuth2TokenByPassword(
- @Header("Authorization") String authorization,
- @Field("username") String username,
- @Field("password") String password,
- @Field("grant_type") String grantType,
- @Field("scope") String clientId
- );
- /**
- * 刷新访问令牌
- */
- @FormUrlEncoded
- @POST("/hntt-auth/auth/oauth2/token")
- Call<RefreshTokenResponse> refreshToken(
- @Header("Authorization") String authorization,
- @Field("grant_type") String grantType,
- @Field("refresh_token") String refreshToken,
- @Field("scope") String clientId
- );
- /**
- * 发送手机验证码
- */
- @FormUrlEncoded
- @POST("/hntt-system/app/code")
- Call<SmsCodeResponse> sendSmsCode(@Field("phone") String mobile);
- /**
- * 设备注册
- */
- @POST("/hntt-device/uav/device/api/register-device")
- Call<RegisterDeviceResponse> registerDevice(
- @Header("Authorization") String authorization,
- @Body RegisterRequest request
- );
- /**
- * 检查版本更新
- */
- @POST("/hntt-system/system/upgrade/app")
- Call<UpdateInfoResponse> checkUpdate(
- @Body UpdateInfoRequest request
- );
- }
|