package com.zhgd.xmgl.async;

import com.zhgd.xmgl.push.service.UniPushService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

/**
 * @program: wisdomSite
 * @description: 异步通知到前端的代码处理
 * @author: Mr.Peng
 * @create: 2022-04-20 14:09
 **/
@Slf4j
@Component
public class AsyncAiAnalyse {
    @Autowired
    private UniPushService uniPushService;

    @Value("${mqtt-scope}")
    private String scope;


    @Async("taskExecutor")
    public String getTitleByAlarmType(Integer alarmType) {
        //1-烟感、2-明火、3-人员倒地、4-未戴安全帽、5-区域入侵、6-越界入侵、7-人员聚集衣 8-反光衣、9-裸土覆盖,13口罩识别,14徘徊预警,15物体滞留监测,16绊线监测
        String title = "";
        if (alarmType == 1) {
            title = "烟感报警";
        } else if (alarmType == 2) {
            title = "明火报警";
        } else if (alarmType == 3) {
            title = "人员倒地报警";
        } else if (alarmType == 4) {
            title = "未戴安全帽报警";
        } else if (alarmType == 5) {
            title = "区域入侵报警";
        } else if (alarmType == 6) {
            title = "越界入侵报警";
        } else if (alarmType == 7) {
            title = "人员聚集衣报警";
        } else if (alarmType == 8) {
            title = "反光衣报警";
        } else if (alarmType == 9) {
            title = "裸土覆盖报警";
        } else if (alarmType == 13) {
            title = "口罩识别报警";
        } else if (alarmType == 14) {
            title = "徘徊预警";
        } else if (alarmType == 15) {
            title = "物体滞留监测";
        } else if (alarmType == 16) {
            title = "绊线监测";
        }
        return title;
    }


}
