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

Commit

Permalink
컨트롤러 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
ori0o0p committed Jan 30, 2024
1 parent 07f2bbb commit 3a0bb1f
Showing 1 changed file with 35 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package com.example.daemawiki.domain.auth.api;

import com.example.daemawiki.domain.auth.dto.LoginRequest;
import com.example.daemawiki.domain.auth.dto.LoginResponse;
import com.example.daemawiki.domain.auth.dto.SignupRequest;
import com.example.daemawiki.domain.auth.service.Login;
import com.example.daemawiki.domain.auth.service.Signup;
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/auth")
public class AuthController {
private final Login loginService;
private final Signup signupService;

public AuthController(Login loginService, Signup signupService) {
this.loginService = loginService;
this.signupService = signupService;
}

@PostMapping("/login")
public Mono<LoginResponse> login(@RequestBody LoginRequest request) {
return loginService.execute(request);
}

@PostMapping("/signup")
public Mono<Void> signup(@RequestBody SignupRequest request) {
return signupService.execute(request);
}

}

0 comments on commit 3a0bb1f

Please sign in to comment.