package com.huatek.busi.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.huatek.busi.service.ICalculateBasicDataService;
import com.huatek.busi.vo.CalculateBasicDataVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@Api(tags = { "验算算法基础数据管理接口" })
@RestController
@RequestMapping("/api/calculateBasicData")
public class CalculateBasicDataController {

    @Reference(check = false)
    ICalculateBasicDataService calculateBasicDataService;

    @ApiOperation(value = "清空验算算法基础数据", httpMethod="POST", notes= "清空验算算法基础数据", produces = "application/json;charset=utf-8",response= Map.class)
    @PostMapping(value = "/delete", produces = { "application/json;charset=utf-8" })
    public Map<String, Object> delete(){
        return calculateBasicDataService.delete();
    }

    @ApiOperation(value = "初始化验算算法基础数据", httpMethod="POST", notes= "初始化验算算法基础数据", produces = "application/json;charset=utf-8",response= Map.class)
    @PostMapping(value = "/init", produces = { "application/json;charset=utf-8" })
    public Map<String, Object> init(){
        return calculateBasicDataService.init();
    }

    @ApiOperation(value = "根据条件查询文件夹及文件名", httpMethod="POST", notes= "根据条件查询文件夹及文件名", produces = "application/json;charset=utf-8",response= Map.class)
    @PostMapping(value = "/findList", produces = { "application/json;charset=utf-8" })
    public Map<String, Object> findList(@RequestBody CalculateBasicDataVo calculateBasicDataVo){
        return calculateBasicDataService.findList(calculateBasicDataVo);
    }
}
