package cn.cecep.talroad.controller.analysis;

import cn.cecep.talroad.common.core.web.domain.AjaxResults;
import cn.cecep.talroad.domain.BasModelAnalyse;
import cn.cecep.talroad.service.impl.analysis.BasModelAnalyseServiceImpl;
import cn.cecep.talroad.vo.analysis.BasModelAnalyseQuery;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController("/analysis/basModelAnalyse")
@RequestMapping("/analysis/basModelAnalyse")
@Api(description = "模型分析参数", tags = "模型分析参数",value = "模型分析参数")

public class BasModelAnalyseController {

    @Autowired
    private BasModelAnalyseServiceImpl basModelAnalyseService;
    @GetMapping("/list")
    @ApiOperation(value = "模型分析参数列表")
    private AjaxResults<IPage<BasModelAnalyse>> selectList(BasModelAnalyseQuery query) {
        Page<BasModelAnalyse> page = new Page<>(query.getPageNum(), query.getPageSize());
        return AjaxResults.success(basModelAnalyseService.page(page, BasModelAnalyseQuery.createWrpper(query)));
    }
    @PostMapping("/insert")
    @ApiOperation(value = "模型分析参数新增")
    private AjaxResults<Boolean> insert(@RequestBody BasModelAnalyse basModelAnalyse) {
        basModelAnalyse.setDeleteStatus("0");
        return AjaxResults.success(basModelAnalyseService.save(basModelAnalyse));
    }
    @PostMapping("/update")
    @ApiOperation(value = "模型分析参数修改")
    private AjaxResults<Boolean> update(@RequestBody BasModelAnalyse basModelAnalyse) {
        return AjaxResults.success(basModelAnalyseService.updateById(basModelAnalyse));
    }
}
