package dev.rheinsw.server.mail.controller;

import dev.rheinsw.server.mail.usecase.SendMailUseCase;
import dev.rheinsw.server.mail.domain.MailRequest;
import lombok.RequiredArgsConstructor;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Thatsaphorn Atchariyaphap
 * @since 04.05.25
 */
@RestController
@RequestMapping("/mail")
@RequiredArgsConstructor
public class MailController {

    private final SendMailUseCase sendMailUseCase;

    @PostMapping("/send")
    public ResponseEntity<String> sendEmail(@RequestBody MailRequest request) {
        return sendMailUseCase.execute(request);
    }
}
