package com.steerinfo.ems.emscordas.controller;

import com.steerinfo.framework.controller.BaseRESTfulController;
import com.steerinfo.framework.controller.RESTfulResult;
import com.steerinfo.framework.service.pagehelper.PageList;
import com.steerinfo.ems.emscordas.model.EmsCordas;
import com.steerinfo.ems.emscordas.service.IEmsCordasService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * EmsEAiHourSumTab1 RESTful接口：
 * @author generator
 * @version 1.0-SNAPSHORT 2019-11-23 05:10
 * 类描述
 * 修订历史：
 * 日期：2019-11-23
 * 作者：generator
 * 参考：
 * 描述：EmsEAiHourSumTab1 RESTful接口
 * @see null
 * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
 */
@RestController
@RequestMapping("/${api.version}/emscordass")
public class EmsCordasController extends BaseRESTfulController {

    @Autowired
    IEmsCordasService emsCordasService;

    @ApiOperation(value="获取cordas的实时数据", notes="根据url的id来获取详细信息")
    @ApiImplicitParam(paramType = "path", name = "id", value = "ID", required = true, dataType = "String")
    //@RequiresPermissions("trmactvalue:view")
    @PostMapping(value = "/gettabledata", produces  = "application/json;charset=UTF-8")
    public RESTfulResult gettabledata(@RequestBody Map<String, Object> model){
    	HashMap<String, Object> m = new HashMap<String, Object>();
    	m.put("cordasDataNames", model.get("cordasDataNames"));
        List<Map<String, Object>> tableData = emsCordasService.getTableData(m);
        return success(tableData);
    }
}
