package com.gyee.wisdom.alarm.sharding.controller;

import com.gyee.wisdom.alarm.sharding.service.AlarmReportService;
import com.gyee.wisdom.alarm.sharding.service.AlarmSnapService;
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.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @description:
 * @auther: Wanghs
 * @date: 2022-03-23
 */

@Slf4j
@RestController
@RequestMapping("/test")
@CrossOrigin
public class TestController {
    @Autowired
    private AlarmReportService reportService;

    @GetMapping(value = "/earlywarnscore")
    public String startCalcEarlyWarnScore(){
        String result="";
        try {
            reportService.startCount();
            result="诊断报告生成成功";


        }catch (Exception ex){
            result=ex.getMessage().toString();
            log.error(ex.getStackTrace().toString());
        }finally {
            return result;
        }


    }
}
