package com.xydl.cac.old;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@Api(tags = "旧接口")
@RestController
@RequestMapping("ironCoreJoinClampController")
public class IronCoreJoinClampController  {

    @Resource
    OldService service;

    /**
     * 查询铁芯/夹件表格数据
     *
     * @param ironCoreId
     * @param clampId
     * @return
     */
    @ApiOperation(value = "查询铁芯/夹件表格数据")
    @GetMapping(value = "/queryTableData/{ironCoreId}/{clampId}")
    public AjaxResult queryTableData(@PathVariable("ironCoreId") Integer ironCoreId,
                                     @PathVariable("clampId") Integer clampId) {
        IronCoreJoinClampDto dto = new IronCoreJoinClampDto();
        dto.setIronCoreId(ironCoreId);
        dto.setClampId(clampId);
        // 铁芯/夹件表格取5条进行展示
        return AjaxResult.success(service.queryTableDataList(dto));
    }

    /**
     * 查询铁芯/夹件趋势图数据
     * @param ironCoreId
     * @param clampId
     * @return
     */
    @ApiOperation(value = "查询铁芯/夹件趋势图数据")
    @GetMapping(value = "/queryLineData/{ironCoreId}/{clampId}")
    public AjaxResult queryLineData(@PathVariable("ironCoreId") Integer ironCoreId,
                                    @PathVariable("clampId") Integer clampId) {
        IronCoreJoinClampDto dto = new IronCoreJoinClampDto();
        dto.setIronCoreId(ironCoreId);
        dto.setClampId(clampId);
        return AjaxResult.success(service.queryLineDataList(dto));
    }
}
