package com.dbs.mplus.controller.admin;

import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.ui.Model;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.dbs.mplus.exception.admin.AdminControllerException;
import com.dbs.mplus.framework.exception.MPlusServiceException;
import com.dbs.mplus.framework.service.admin.agreement.AgreementService;
import com.dbs.mplus.framework.service.admin.agreement.repository.dao.Agreement;
import com.dbs.mplus.framework.service.admin.log.LogService;


/**
 * 로그 Controller
 * @author 
 *
 */
@Controller
@RequestMapping("/admin/log")
public class LogController {
	private final Logger logger = LoggerFactory.getLogger(this.getClass()); 
	
	@Autowired 
	private LogService logService; 

	@RequestMapping(value = "/view.page", method = RequestMethod.GET)
	public Model agreement(Model model) throws AdminControllerException {
		return model; 
	}
	
	@RequestMapping(value="/getList.json", method = RequestMethod.POST)
	@ResponseBody 
	public Map<String, Object> getLogList(@RequestBody Map<String, Object> map) throws AdminControllerException {
		try {
			return this.logService.getPagingData(map);
		}
		catch(final MPlusServiceException ex) {
			throw new AdminControllerException(ex); 
		}
	}

}
