|
@@ -0,0 +1,144 @@
|
|
|
+package com.dragoninfo.dcuc.auth.api.vo.securitypolicy.resp;
|
|
|
+
|
|
|
+import java.io.Serializable;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 华为安全策略服务返回值
|
|
|
+ *
|
|
|
+ * @author zq.huang
|
|
|
+ * @date 2020/7/20
|
|
|
+ */
|
|
|
+public class HwSecurityPolicyResp<T> implements Serializable {
|
|
|
+
|
|
|
+ private static final long serialVersionUID = 3962167558303736599L;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 是否成功
|
|
|
+ */
|
|
|
+ private Boolean success;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 数据
|
|
|
+ */
|
|
|
+ private T data;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 错误代码
|
|
|
+ */
|
|
|
+ private String errorCode;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 错误名称
|
|
|
+ */
|
|
|
+ private String errorName;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 错误消息
|
|
|
+ */
|
|
|
+
|
|
|
+ public HwSecurityPolicyResp() {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ private String errorMessage;
|
|
|
+
|
|
|
+ public HwSecurityPolicyResp(Boolean success, T data, String errorCode, String errorName, String errorMessage, ErrorException errorException) {
|
|
|
+ this.success = success;
|
|
|
+ this.data = data;
|
|
|
+ this.errorCode = errorCode;
|
|
|
+ this.errorName = errorName;
|
|
|
+ this.errorMessage = errorMessage;
|
|
|
+ this.errorException = errorException;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 成功的相应结果
|
|
|
+ *
|
|
|
+ * @param <T>
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public static <T> HwSecurityPolicyResp<T> success(T obj) {
|
|
|
+ ErrorException errorException = new ErrorException(null, null, null);
|
|
|
+ return new HwSecurityPolicyResp<T>(true, obj, null, null, null, errorException);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 成功的相应结果
|
|
|
+ *
|
|
|
+ * @param <T>
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public static <T> HwSecurityPolicyResp<T> success() {
|
|
|
+ ErrorException errorException = new ErrorException(null, null, null);
|
|
|
+ return new HwSecurityPolicyResp<T>(true, null, null, null, null, errorException);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 失败的相应结果
|
|
|
+ *
|
|
|
+ * @param <T>
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public static <T> HwSecurityPolicyResp<T> fail(String errName, String errorMessage, ErrorException e) {
|
|
|
+ return new HwSecurityPolicyResp<T>(false, null, "300", errName, errorMessage, e);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 错误异常信息
|
|
|
+ */
|
|
|
+ private ErrorException errorException;
|
|
|
+
|
|
|
+
|
|
|
+ public Boolean getSuccess() {
|
|
|
+ return success;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setSuccess(Boolean success) {
|
|
|
+ this.success = success;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static long getSerialVersionUID() {
|
|
|
+ return serialVersionUID;
|
|
|
+ }
|
|
|
+
|
|
|
+ public T getData() {
|
|
|
+ return data;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setData(T data) {
|
|
|
+ this.data = data;
|
|
|
+ }
|
|
|
+
|
|
|
+ public String getErrorCode() {
|
|
|
+ return errorCode;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setErrorCode(String errorCode) {
|
|
|
+ this.errorCode = errorCode;
|
|
|
+ }
|
|
|
+
|
|
|
+ public String getErrorName() {
|
|
|
+ return errorName;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setErrorName(String errorName) {
|
|
|
+ this.errorName = errorName;
|
|
|
+ }
|
|
|
+
|
|
|
+ public String getErrorMessage() {
|
|
|
+ return errorMessage;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setErrorMessage(String errorMessage) {
|
|
|
+ this.errorMessage = errorMessage;
|
|
|
+ }
|
|
|
+
|
|
|
+ public ErrorException getErrorException() {
|
|
|
+ return errorException;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setErrorException(ErrorException errorException) {
|
|
|
+ this.errorException = errorException;
|
|
|
+ }
|
|
|
+}
|