Skip to content
This repository has been archived by the owner on Nov 27, 2024. It is now read-only.

Commit

Permalink
controller 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
ori0o0p committed Jan 25, 2024
1 parent 7031a6c commit f255897
Showing 1 changed file with 39 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package com.example.daemawiki.domain.mail.api;

import com.example.daemawiki.domain.mail.dto.AuthCodeRequest;
import com.example.daemawiki.domain.mail.dto.AuthCodeVerifyRequest;
import com.example.daemawiki.domain.mail.service.MailSend;
import com.example.daemawiki.domain.mail.service.MailVerify;
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;
import reactor.core.publisher.Mono;

@RestController
@RequestMapping("/api/mail")
public class MailController {
private final MailSend mailSend;
private final MailVerify mailVerify;

public MailController(MailSend mailSend, MailVerify mailVerify) {
this.mailSend = mailSend;
this.mailVerify = mailVerify;
}

@PostMapping("/send")
public Mono<Void> send(@RequestBody AuthCodeRequest request) {
return mailSend.execute(request);
}

@PostMapping("/verify")
public Mono<Boolean> verify(@RequestBody AuthCodeVerifyRequest request) {
return mailVerify.execute(request);
}

@PostMapping("/reissue")
public Mono<Void> reissue(@RequestBody AuthCodeRequest request) {
return mailSend.reissue(request);
}

}

0 comments on commit f255897

Please sign in to comment.