package org.jeecg.modules.dynamicStaticAnalysis.controller;


import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.modules.dynamicStaticAnalysis.entity.ConfigGradeLimit;
import org.jeecg.modules.dynamicStaticAnalysis.entity.ConfigRailVehicleCheck;
import org.jeecg.modules.dynamicStaticAnalysis.service.IConfigGradeLimitService;
import org.springframework.web.bind.annotation.*;

import org.jeecg.common.system.base.controller.JeecgController;

import java.util.List;

/**
 * <p>
 * 动静态分析-配置-单元化管理阈值 前端控制器
 * </p>
 *
 * @author hkl
 * @since 2023-08-01
 */
@RestController
@RequestMapping("/dynamicStaticAnalysis/configGradeLimit")
@Api(tags = "动静态分析-配置参数-单元化管理阈值")
public class ConfigGradeLimitController extends JeecgController<ConfigGradeLimit, IConfigGradeLimitService> {

    @AutoLog(value = "动静态分析-配置参数-单元化管理阈值-获取记录")
    @ApiOperation(value = "动静态分析-配置参数-单元化管理阈值-获取记录", notes = "动静态分析-配置参数-单元化管理阈值-获取记录")
    @GetMapping(value = "/listRecord")
    public Result<List<ConfigGradeLimit>> listRecord() {
        List<ConfigGradeLimit> records = this.service.listRecord();
        return Result.OK(records);
    }

    @AutoLog(value = "动静态分析-配置参数-单元化管理阈值-更新参数")
    @ApiOperation(value = "动静态分析-配置参数-单元化管理阈值-更新参数", notes = "动静态分析-配置参数-单元化管理阈值-更新参数")
    @PostMapping(value = "/updateRecord")
    public Result<String> updateRecord(@RequestBody ConfigGradeLimit record) {

        this.service.updateById(record);

        return Result.OK("操作成功");
    }
}
