-
Notifications
You must be signed in to change notification settings - Fork 559
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
115 additions
and
5 deletions.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
lib_fly_api/src/main/java/com/fly/tour/api/CommonService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,19 @@ | ||
package com.fly.tour.api; | ||
|
||
import com.fly.tour.api.dto.RespDTO; | ||
import com.fly.tour.api.security.Token; | ||
import com.fly.tour.api.user.LoginDTO; | ||
|
||
import io.reactivex.Observable; | ||
import retrofit2.http.Header; | ||
import retrofit2.http.POST; | ||
import retrofit2.http.Query; | ||
|
||
public interface CommonService { | ||
@POST("/userapi/user/login") | ||
Observable<RespDTO<LoginDTO>> login(@Query("username") String name, @Query("password") String pwd); | ||
|
||
@POST("/oauth/token") | ||
Observable<Token> getToken(@Header(value = "Authorization") String authorization, @Query("grant_type") String type, | ||
@Query("username") String username, @Query("password") String password); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
lib_fly_api/src/main/java/com/fly/tour/api/security/Token.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
package com.fly.tour.api.security; | ||
|
||
/** | ||
* Description: <Token><br> | ||
* Author: mxdl<br> | ||
* Date: 2020/3/19<br> | ||
* Version: V1.0.0<br> | ||
* Update: <br> | ||
*/ | ||
public class Token { | ||
private String access_token; | ||
private String token_type; | ||
private String refresh_token; | ||
private String expires_in; | ||
private String scope; | ||
|
||
public String getAccess_token() { | ||
return access_token; | ||
} | ||
|
||
public void setAccess_token(String access_token) { | ||
this.access_token = access_token; | ||
} | ||
|
||
public String getToken_type() { | ||
return token_type; | ||
} | ||
|
||
public void setToken_type(String token_type) { | ||
this.token_type = token_type; | ||
} | ||
|
||
public String getRefresh_token() { | ||
return refresh_token; | ||
} | ||
|
||
public void setRefresh_token(String refresh_token) { | ||
this.refresh_token = refresh_token; | ||
} | ||
|
||
public String getExpires_in() { | ||
return expires_in; | ||
} | ||
|
||
public void setExpires_in(String expires_in) { | ||
this.expires_in = expires_in; | ||
} | ||
|
||
public String getScope() { | ||
return scope; | ||
} | ||
|
||
public void setScope(String scope) { | ||
this.scope = scope; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters