
com.github.fosin.cdp.mvc.result.ResultUtils Maven / Gradle / Ivy
The newest version!
package com.github.fosin.cdp.mvc.result;
import java.util.Collection;
/**
* @author fosin
*/
public class ResultUtils {
public static ListResult success(long total, Collection rows){
return new ListResult(ResultCode.SUCCESS,total,rows);
}
public static ListResult listFailure(String msg){
return new ListResult(ResultCode.FAILURE.getCode(),msg);
}
public static ModelResult success(Object data){
return new ModelResult(ResultCode.SUCCESS,data);
}
public static Result success(){
return new Result(ResultCode.SUCCESS);
}
public static Result failure(){
return new Result(ResultCode.FAILURE);
}
public static Result failure(String msg){
return new Result(ResultCode.FAILURE.getCode(),msg);
}
public static Result failure(int code, String msg){
return new Result(code,msg);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy