package com.nbclass.util;

import java.util.List;

import com.nbclass.vo.base.PageResultVo;
import com.nbclass.vo.base.ResponseVo;

/**
 * 
 * @author Leon
 * @datetime 2019年4月1日 下午2:44:52
 */
public class ResultUtil{

	public static ResponseVo<Object> success(){
		return vo(CoreConst.STATUS_SUCCESS,null,null);
	}

	public static ResponseVo<Object> success(String msg){
		return vo(CoreConst.STATUS_SUCCESS, msg,null);
	}

	public static ResponseVo<Object> success(Object data){
		return vo(CoreConst.STATUS_SUCCESS, null, data);
	}

	public static ResponseVo<Object> success(String msg, Object data){
		return vo(CoreConst.STATUS_SUCCESS, msg, data);
	}

	public static ResponseVo<Object> error(){
		return vo(CoreConst.STATUS_ERROR, null, null);
	}

	public static ResponseVo<Object> error(String msg){
		return vo(CoreConst.STATUS_ERROR, msg, null);
	}

	public static ResponseVo<Object> error(String msg, Object data){
		return vo(CoreConst.STATUS_ERROR, msg,data);
	}

	public static PageResultVo table( List<?> list, Long total){
		return new PageResultVo(list, total);
	}

	public static ResponseVo<Object> vo(Integer status, String message, Object data) {
		return new ResponseVo<Object>(status, message, data);
	}



}
