package com.mortals.xhx.module.hik.event.service.impl;

import com.mortals.framework.exception.AppException;
import com.mortals.xhx.common.code.HikEventTypeEnum;
import com.mortals.xhx.module.hik.event.model.req.callback.EventsItem;
import org.apache.poi.ss.formula.functions.T;

/**
 * @author:
 * @date: 2023/4/17 9:22
 */
public abstract class EventTypeAbstract{
    private int type;

    abstract int getType();

    public abstract void saveEventData(EventsItem event);





    public static EventTypeAbstract newType(int type) {

        if (type == HikEventTypeEnum.重点人员识别事件.getValue()) {
            return new BlackPlanRecoginze(type);
        } else if (type == HikEventTypeEnum.陌生人员识别事件.getValue()) {
            return new StrangerRecoginze(type);
        } else {
            throw new AppException(String.format("未知的类型码:%s", type));
        }
    }

    public EventTypeAbstract(int type) {
        this.type = type;
    }

}
