package com.itsol.quantrivanphong.access.login.controller;

import com.itsol.quantrivanphong.access.login.bussiness.LoginBussiness;
import com.itsol.quantrivanphong.report.issue.common.WrapperResultObject;
import org.springframework.beans.factory.annotation.Autowired;
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.RestController;

@RestController
public class LoginControllers {

    @Autowired
    private LoginBussiness loginBussiness;

    @PostMapping(value = "qtvp/login")
    public ResponseEntity Login(@RequestBody LoginDTO loginDTO){
        WrapperResultObject wrapperResult = loginBussiness.checkUserAndPass(loginDTO.getUsername(),loginDTO.getPassworld());
        return ResponseEntity.ok(wrapperResult);
    }
}
