mirror of
https://gitee.com/durcframework/SOP.git
synced 2025-08-12 07:02:14 +08:00
新增应用授权
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
package com.gitee.sop.sdk.model;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* Oauth2认证参数
|
||||
* @author tanghc
|
||||
*/
|
||||
@Data
|
||||
public class OpenAuthTokenAppModel {
|
||||
|
||||
/**
|
||||
* 授权类型。<br>
|
||||
* 如果使用app_auth_code换取token,则为authorization_code,
|
||||
* 如果使用refresh_token换取新的token,则为refresh_token
|
||||
*/
|
||||
private String grant_type;
|
||||
|
||||
/**
|
||||
* 授权码.与refresh_token二选一,用户对应用授权后得到,即第一步中开发者获取到的app_auth_code值
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 刷新令牌.与code二选一,可为空,刷新令牌时使用
|
||||
*/
|
||||
private String refresh_token;
|
||||
}
|
@@ -0,0 +1,13 @@
|
||||
package com.gitee.sop.sdk.request;
|
||||
|
||||
import com.gitee.sop.sdk.response.OpenAuthTokenAppResponse;
|
||||
|
||||
/**
|
||||
* @author tanghc
|
||||
*/
|
||||
public class OpenAuthTokenAppRequest extends BaseRequest<OpenAuthTokenAppResponse> {
|
||||
@Override
|
||||
protected String method() {
|
||||
return "open.auth.token.app";
|
||||
}
|
||||
}
|
@@ -1,10 +1,12 @@
|
||||
package com.gitee.sop.sdk.response;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class GetStoryResponse extends BaseResponse {
|
||||
private Long id;
|
||||
private String name;
|
||||
|
@@ -0,0 +1,30 @@
|
||||
package com.gitee.sop.sdk.response;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* @author tanghc
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class OpenAuthTokenAppResponse extends BaseResponse {
|
||||
/**
|
||||
* 授权令牌
|
||||
*/
|
||||
private String app_auth_token;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private String user_id;
|
||||
|
||||
/**
|
||||
* 刷新令牌时使用。
|
||||
* 刷新令牌后,我们会保证老的app_auth_token从刷新开始10分钟内可继续使用,请及时替换为最新token
|
||||
*/
|
||||
private String app_refresh_token;
|
||||
|
||||
private String error;
|
||||
private String error_description;
|
||||
}
|
Reference in New Issue
Block a user