package org.springblade.device.entity;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.springblade.common.constant.Instruct;

import java.util.List;

/**
 *
 *
 * description: 推送任务
 */
@Getter
@NoArgsConstructor
@AllArgsConstructor
public class PublishTask {

    /**
     * 任务Id
     */
    private Long taskId;

    /**
     * 推送指令
     */
    private Instruct instruct;

    /**
     * 推送内容
     */
    private Object body;

    /**
     * 设备Id列表
     */
    private List<Long> deviceIdList;

    /**
     * 回调地址
     */
    @Setter
    private String callBackUrl;

    /**
     * 任务类型：{ 1：广告，2：策略，3：公告 }
     */
    @Setter
    private Integer taskType;

    /**
     * 是否过滤阈值：{ 1：启用阈值配置，2：禁用阈值配置 }
     */
    @Setter
    private Integer enableThreshold;

    @Setter
    private Long orgId;

    /**
     *
     * @param taskId 任务Id
     * @param instruct 推送指令
     * @param body 推送内容
     * @param deviceIdList 设备Id列表
     */
    public PublishTask(Long taskId, Instruct instruct, Object body, List<Long> deviceIdList) {
        this.taskId = taskId;
        this.instruct = instruct;
        this.body = body;
        this.deviceIdList = deviceIdList;
    }
}
