package com.uas.platform.b2b.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.uas.platform.b2b.service.ReportConfigService;

/**
 * 报表请求
 * 
 * @author suntg
 * @date 2015年3月9日19:58:22
 * 
 */
@Controller
@RequestMapping(value = "/report")
public class ReportController {

	@Autowired
	private ReportConfigService reportConfigService;

	/**
	 * 根据企业UU号和页面名称获取报表名称
	 * @return
	 */
	@RequestMapping(value = "/getName", method = RequestMethod.GET)
	public ResponseEntity<String> getReportNameByEnuuAndPagename(Long enuu,
			String pagename) {
		HttpHeaders headers = new HttpHeaders();
		headers.add("Content-Type", "application/text; charset=utf-8");
		return new ResponseEntity<String>(
				reportConfigService.getReportNameByEnuuAndPageName(enuu,
						pagename), headers, HttpStatus.OK);
	}

}
