package com.yeejoin.amos.jpush.util;

import com.yeejoin.amos.jpush.common.entity.CommonResponse;
import com.yeejoin.amos.jpush.common.entity.Constants;

public class CommonResponseUtil
{
	public static CommonResponse success()
	{
		CommonResponse response = new CommonResponse();
		response.setResult(Constants.RESULT_SUCCESS);
		return response;
	}

	public static CommonResponse success(Object obj)
	{
		CommonResponse response = new CommonResponse();
		response.setResult(Constants.RESULT_SUCCESS);
		response.setDataList(obj);
		return response;
	}

	public static CommonResponse success(Object obj, String message)
	{
		CommonResponse response = new CommonResponse();
		response.setResult(Constants.RESULT_SUCCESS);
		response.setDataList(obj);
		response.setMessage(message);
		return response;
	}

	public static CommonResponse failure()
	{
		CommonResponse response = new CommonResponse();
		response.setResult(Constants.RESULT_FAILURE);
		return response;
	}

	public static CommonResponse failure(String message)
	{
		CommonResponse response = new CommonResponse();
		response.setResult(Constants.RESULT_FAILURE);
		response.setMessage(message);
		return response;
	}

	public static CommonResponse failure(Object obj, String message)
	{
		CommonResponse response = new CommonResponse();
		response.setResult(Constants.RESULT_FAILURE);
		response.setDataList(obj);
		response.setMessage(message);
		return response;
	}
}
