package com.lantone.qc.kernel.web.controller;

import com.lantone.qc.kernel.analysis.EZAnalysis;
import com.lantone.qc.pub.model.vo.EzAnalysisVO;
import com.lantone.qc.pub.res.EzAnalysisDTO;
import com.lantone.qc.pub.res.Response;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @ClassName : QCController
 * @Description : 质控总入口
 * @Author : 楼辉荣
 * @Date: 2020-03-03 19:57
 */
@Slf4j
@Api(value = "恩泽服务接口")
@RestController
@CrossOrigin(origins = "*", maxAge = 3600)
@RequestMapping(value = "ez")
public class EzController {

    @Autowired
    private EZAnalysis ezAnalysis;

    @ApiOperation(value = "恩泽解析接口")
    @PostMapping("jx")
    public Response<List<EzAnalysisDTO>> ezAnalysis(@RequestBody EzAnalysisVO ezAnalysisVO) throws Exception {
        Response response = new Response();
        response.setData(ezAnalysis.anlysis(ezAnalysisVO));
        return response;
    }

}