content: package dev.agitrubard.factory.controller;
  
  import dev.agitrubard.factory.model.request.LoginRequest;
  import dev.agitrubard.factory.model.request.RegisterRequest;
  import dev.agitrubard.factory.service.LoginService;
  import dev.agitrubard.factory.service.RegisterService;
  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;
  
  @RestController
  @RequestMapping("/api/v1/auth")
  class AuthController {
  
      private final RegisterService registerService;
      private final LoginService loginService;
  
      public AuthController(RegisterService registerService, LoginService loginService) {
          this.registerService = registerService;
          this.loginService = loginService;
      }
  
      @PostMapping("/register")
      public String register(@RequestBody RegisterRequest registerRequest) {
          return registerService.register(registerRequest);
      }
  
      @PostMapping("/login")
      public String login(@RequestBody LoginRequest loginRequest) {
          return loginService.login(loginRequest);
      }
  
  }
  