package com.qqchen.deploy.backend.notification.dto;

import com.qqchen.deploy.backend.framework.dto.BaseDTO;
import com.qqchen.deploy.backend.notification.enums.NotificationChannelStatusEnum;
import com.qqchen.deploy.backend.notification.enums.NotificationChannelTypeEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.Map;

/**
 * 通知渠道DTO
 *
 * @author qqchen
 * @since 2025-10-22
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(description = "通知渠道DTO")
public class NotificationChannelDTO extends BaseDTO {
    
    @Schema(description = "渠道名称", example = "研发部企业微信群")
    @NotBlank(message = "渠道名称不能为空")
    private String name;
    
    @Schema(description = "渠道类型", example = "WEWORK")
    @NotNull(message = "渠道类型不能为空")
    private NotificationChannelTypeEnum channelType;
    
    @Schema(description = "渠道配置（JSON格式）", example = "{\"webhookUrl\":\"https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=xxx\"}")
    @NotNull(message = "渠道配置不能为空")
    private Map<String, Object> config;
    
    @Schema(description = "状态", example = "ENABLED")
    private NotificationChannelStatusEnum status;
    
    @Schema(description = "描述", example = "研发部通知群，用于部署通知")
    private String description;
}

