package com.its.web.controller.login;

import com.its.web.dto.message.ResultDto;
import com.its.web.service.admin.LoginService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

@Slf4j
@RequiredArgsConstructor
@RestController
@RequestMapping("/api/login")
@Api(tags = "06.로그인")
public class LoginController {

    private final LoginService service;

    @ApiOperation(value = "01.회원등록 여부 확인")
    @PostMapping("/loginCheck")
    @ResponseBody
    public ResultDto loginCheck(@ApiParam(value = "로그인 ID", example = "asd", required = true)
                                @RequestParam(defaultValue = "") String id,
                                @ApiParam(value = "로그인 비밀번호", required = true)
                                @RequestParam(defaultValue = "")
                                String pwd) {
        return this.service.loginCheck(id, pwd);
    }
}
