package com.yh.saas.platform.controller;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.yh.saas.platform.service.IBIService;

/**
 * BI接口
 * 
 * @author gdc
 */
@RequestMapping("/bi")
@RestController
public class BIController {

	@Autowired
	private IBIService biService;

	/**
	 * 获取BI报表路径
	 * 
	 * @param params 请求参数
	 * @return BI报表路径
	 */
	@GetMapping("/query/reportUrl")
	public String getReportUrl(@RequestParam Map<String, String> params) {
		String operation = params.remove("operation");
		String reportName = params.remove("reportName");
		String exportFormat = params.remove("exportFormat");
		if (null == operation || null == reportName) {
			return null;
		}
		return biService.getReportUrl(operation, reportName, exportFormat, params);
	}
}
