package org.xyzh.common.dto.crontab;

import java.util.List;

/**
 * @description 创建定时任务请求
 * @filename CreateTaskRequest.java
 * @author yslg
 * @copyright xyzh
 * @since 2025-11-18
 */
public class CreateTaskRequest {
    
    /**
     * @description 任务信息
     */
    private TbCrontabTask task;
    
    /**
     * @description 任务元数据ID（用于查找默认接收人配置）
     */
    private String metaId;
    
    /**
     * @description 额外添加的接收人列表（从系统用户中选择，前端传入完整信息避免重复查询）
     */
    private List<RecipientUserInfo> additionalRecipients;

    public TbCrontabTask getTask() {
        return task;
    }

    public void setTask(TbCrontabTask task) {
        this.task = task;
    }

    public String getMetaId() {
        return metaId;
    }

    public void setMetaId(String metaId) {
        this.metaId = metaId;
    }

    public List<RecipientUserInfo> getAdditionalRecipients() {
        return additionalRecipients;
    }

    public void setAdditionalRecipients(List<RecipientUserInfo> additionalRecipients) {
        this.additionalRecipients = additionalRecipients;
    }
    
    /**
     * @description 接收人用户信息（从tb_sys_user选择）
     */
    public static class RecipientUserInfo {
        /**
         * @description 用户ID
         */
        private String userId;
        
        /**
         * @description 用户邮箱
         */
        private String userEmail;
        
        /**
         * @description 用户名称
         */
        private String username;

        public String getUserId() {
            return userId;
        }

        public void setUserId(String userId) {
            this.userId = userId;
        }

        public String getUserEmail() {
            return userEmail;
        }

        public void setUserEmail(String userEmail) {
            this.userEmail = userEmail;
        }

        public String getUsername() {
            return username;
        }

        public void setUsername(String username) {
            this.username = username;
        }

        @Override
        public String toString() {
            return "RecipientUserInfo{" +
                    "userId='" + userId + '\'' +
                    ", userEmail='" + userEmail + '\'' +
                    ", username='" + username + '\'' +
                    '}';
        }
    }

    @Override
    public String toString() {
        return "CreateTaskRequest{" +
                "task=" + task +
                ", metaId='" + metaId + '\'' +
                ", additionalRecipients=" + additionalRecipients +
                '}';
    }
}
