Commit c414de1f authored by yanzg's avatar yanzg

下载视频

parent 97a53b8f
...@@ -257,4 +257,24 @@ public class ResponseResult<T> extends BaseVo { ...@@ -257,4 +257,24 @@ public class ResponseResult<T> extends BaseVo {
ResponseResult ret = new ResponseResult(code, message, null, target); ResponseResult ret = new ResponseResult(code, message, null, target);
return ret; return ret;
} }
/**
* 抛出异常
*
* @param ex 异常信息
* @param cls 返回类型
* @param <T>
* @param <M>
* @return
*/
public static final <T, M extends Exception> T isEmpty(M ex, Class<T> cls) throws M {
if (ex instanceof CodeException) {
CodeException codeException = (CodeException) ex;
if (StringHelper.compare(codeException.getCode(), ResultConstants.RESULT_EMPTY) {
return null;
}
throw ex;
}
throw ex;
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment