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.common.system.base.controller.JeecgController;
import org.jeecg.modules.dynamicStaticAnalysis.entity.ConfigRailVehicleTqi;
import org.jeecg.modules.dynamicStaticAnalysis.service.IConfigRailVehicleTqiService;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 动静态分析-配置-轨检车TQI超限权值 前端控制器
 * </p>
 *
 * @author hkl
 * @since 2023-08-01
 */
@RestController
@RequestMapping("/dynamicStaticAnalysis/configRailVehicleTql")
@Api(tags = "动静态分析-配置参数-轨检车TQI超限权值")
public class ConfigRailVehicleTqiController extends JeecgController<ConfigRailVehicleTqi, IConfigRailVehicleTqiService> {

    @AutoLog(value = "动静态分析-配置参数-轨检车TQI超限权值-获取记录")
    @ApiOperation(value = "动静态分析-配置参数-轨检车TQI超限权值-获取记录", notes = "动静态分析-配置参数-轨检车TQI超限权值-获取记录")
    @GetMapping(value = "/listRecord")
    public Result<List<ConfigRailVehicleTqi>> listRecord() {
        List<ConfigRailVehicleTqi> records = this.service.listRecord();
        return Result.OK(records);
    }

    @AutoLog(value = "动静态分析-配置参数-轨检车TQI超限权值-更新参数")
    @ApiOperation(value = "动静态分析-配置参数-轨检车TQI超限权值-更新参数", notes = "动静态分析-配置参数-轨检车TQI超限权值-更新参数")
    @PostMapping(value = "/updateRecord")
    public Result<String> updateRecord(@RequestBody ConfigRailVehicleTqi record) {

        this.service.updateById(record);

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