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

import com.qqchen.deploy.backend.framework.api.Response;
import com.qqchen.deploy.backend.notification.dto.SendNotificationRequest;
import com.qqchen.deploy.backend.notification.service.INotificationService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import jakarta.validation.Valid;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * 通知发送API控制器
 *
 * @author qqchen
 * @since 2025-11-12
 */
@Slf4j
@RestController
@RequestMapping("/api/v1/notification")
@Tag(name = "通知发送", description = "通知发送相关接口")
@Validated
public class NotificationApiController {

    @Resource
    private INotificationService notificationService;

    @Operation(summary = "发送通知消息")
    @PostMapping("/send")
    public Response<Void> send(@Valid @RequestBody SendNotificationRequest request) {
        notificationService.send(request);
        return Response.success();
    }
}
