package com.fizz.business.controller;


import com.fizz.business.service.impl.SegmentService;
import com.fizz.business.vo.SegmentParamVO;
import com.ruoyi.common.annotation.Anonymous;
import com.ruoyi.common.core.domain.R;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@Tag(name ="历史曲线查询接口")
@RestController
@RequestMapping("/api/segment")
@Anonymous
public class SegmentController {


    @Resource
    SegmentService segmentService;

    @GetMapping("/getSegmentHistory")
    @Operation(summary ="根据钢卷号和参数查询历史曲线")
    public R<List<SegmentParamVO>> queryParamByEnCoilId(String enCoilID, String paramField) {
        if (enCoilID == null || paramField == null) {
            return R.fail("参数不能为空");
        }
        return R.ok(segmentService.queryParamByEnCoilId(enCoilID, paramField),"查询历史曲线成功");
    }

}
