package com.micer.easyball.controller;

import com.micer.easyball.ApiVersion;

import com.micer.easyball.enums.ResultCode;
import com.micer.easyball.pojo.ResponseResult;
import com.micer.easyball.pojo.User;
import com.micer.easyball.service.LoginService;
import com.mysql.cj.log.Log;
import org.springframework.beans.factory.annotation.Autowired;
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(ApiVersion.V1)
public class LoginController{

    @Autowired
    private LoginService loginService;

    @PostMapping ("/user/login")
    public ResponseResult login(@RequestBody User user)
    {
        return loginService.login(user);
    }

    @RequestMapping("/user/logout")
    public ResponseResult logout()
    {
        return loginService.logout();
    }

}
