package org.bench4q.web.api;

import java.util.HashMap;
import java.util.Map;

import org.apache.log4j.Logger;



public  class BaseController {
	private final String SUCCESS = "success";
	private final String FAILMESSAGE = "failedMessage";
	protected final String SERVER_ERROR = "server error";
	private Logger logger=Logger.getLogger(BaseController.class);
	protected Map<String, Object> fail(Map<String, Object> map, String message) {
		if (map == null)
			map = new HashMap<String, Object>();
		map.put(SUCCESS, new Boolean(false));
		map.put(FAILMESSAGE, message);
		logger.info(message);
		return map;
	}

	protected Map<String, Object> success(Map<String, Object> map) {
		if (map == null)
			map = new HashMap<String, Object>();
		map.put(SUCCESS, new Boolean(true));
		return map;
	}
}
