录音管理功能联调
This commit is contained in:
@@ -4,7 +4,7 @@ package com.rj.common;
|
||||
/**
|
||||
* 返回值的标准格式
|
||||
*/
|
||||
public class Result {
|
||||
public class Result<T> {
|
||||
/**
|
||||
* 状态码
|
||||
*/
|
||||
@@ -22,29 +22,29 @@ public class Result {
|
||||
/**
|
||||
* 成功 不返回数据
|
||||
*/
|
||||
public static Result ok(){
|
||||
return new Result();
|
||||
public static <T> Result<T> ok(){
|
||||
return new Result<T>();
|
||||
}
|
||||
|
||||
/**
|
||||
* 失败返回自定义消息
|
||||
*/
|
||||
public static Result error(String msg){
|
||||
return new Result(-1,msg);
|
||||
public static <T> Result<T> error(String msg){
|
||||
return new Result<T>(-1,msg);
|
||||
}
|
||||
|
||||
/**
|
||||
* 失败返回系统异常消息
|
||||
*/
|
||||
public static Result error(){
|
||||
return new Result(-1,"系统异常");
|
||||
public static <T> Result<T> error(){
|
||||
return new Result<T>(-1,"系统异常");
|
||||
}
|
||||
|
||||
/**
|
||||
* 成功返回数据
|
||||
*/
|
||||
public static Result ok(Object data){
|
||||
return new Result(data);
|
||||
public static <T> Result<T> ok(Object data){
|
||||
return new Result<T>(data);
|
||||
}
|
||||
|
||||
public Result(int code, String msg) {
|
||||
|
||||
Reference in New Issue
Block a user