mirror of
https://gitee.com/yadong.zhang/JustAuth.git
synced 2026-01-07 19:31:48 +08:00
41 lines
703 B
Java
41 lines
703 B
Java
package me.zhyd.oauth.model;
|
|
|
|
import lombok.Builder;
|
|
import lombok.Data;
|
|
import me.zhyd.oauth.request.ResponseStatus;
|
|
|
|
/**
|
|
* JustAuth统一授权响应类
|
|
*
|
|
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
|
|
* @version 1.0
|
|
* @since 1.8
|
|
*/
|
|
@Builder
|
|
@Data
|
|
public class AuthResponse<T> {
|
|
/**
|
|
* 授权响应状态码
|
|
*/
|
|
private int code;
|
|
|
|
/**
|
|
* 授权响应信息
|
|
*/
|
|
private String msg;
|
|
|
|
/**
|
|
* 授权响应数据,当且仅当 code = 2000 时返回
|
|
*/
|
|
private T data;
|
|
|
|
/**
|
|
* 是否请求成功
|
|
*
|
|
* @return true or false
|
|
*/
|
|
public boolean ok() {
|
|
return this.code == ResponseStatus.SUCCESS.getCode();
|
|
}
|
|
}
|