package cn.axzo.msg.center.service.pending.request;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.extern.slf4j.Slf4j;

import java.util.HashSet;
import java.util.List;
import java.util.Set;

/**
 * @author haiyangjin
 * @date 2023/11/16
 */
@Data
@Slf4j
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class CompletePendingMessageByIdRequest {
    /**
     * 待办id, id和ids二选一
     */
    private Long id;

    /**
     * 待办id, id和ids二选一
     */
    private List<Long> ids;

    /**
     * 业务扩展参数,JSON字符串格式
     */
    private String bizExtParams;

    /**
     * 模板编码
     */
    private String templateCode;

    public Set<Long> determineIds() {
        HashSet<Long> todoIds = new HashSet<>();
        if (id != null)
            todoIds.add(id);
        if (ids != null)
            todoIds.addAll(ids);
        return todoIds;
    }

}
