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 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 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 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 sendSmsCode(@Field("phone") String mobile); /** * 设备注册 */ @POST("/hntt-device/uav/device/api/register-device") Call registerDevice( @Header("Authorization") String authorization, @Body RegisterRequest request ); /** * 检查版本更新 */ @POST("/hntt-system/system/upgrade/app") Call checkUpdate( @Body UpdateInfoRequest request ); }