package com.erp.notification.client;

import com.erp.notification.dto.NotificationRequest;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * 通知服务Feign客户端
 */
@FeignClient(name = "notification-service", url = "${notification.service.url:}")
public interface NotificationClient {

    /**
     * 发送通知
     */
    @PostMapping("/api/notifications/send")
    void sendNotification(@RequestBody NotificationRequest request);

    /**
     * 发送钉钉通知
     */
    @PostMapping("/api/notifications/dingtalk")
    void sendDingTalk(@RequestBody DingTalkRequest request);

    /**
     * 发送系统通知
     */
    @PostMapping("/api/notifications/system")
    void sendSystemNotice(@RequestBody SystemNoticeRequest request);

    /**
     * 批量发送通知
     */
    @PostMapping("/api/notifications/batch")
    void sendBatch(@RequestBody java.util.List<NotificationRequest> requests);

    // ==================== 内嵌请求DTO ====================

    @lombok.Data
    @lombok.NoArgsConstructor
    @lombok.AllArgsConstructor
    class DingTalkRequest {
        private String title;
        private String content;
    }

    @lombok.Data
    @lombok.NoArgsConstructor
    @lombok.AllArgsConstructor
    class SystemNoticeRequest {
        private Long tenantId;
        private String title;
        private String content;
        private String bizType;
        private String bizId;
    }
}
