package com.xhkjedu.suser.controller.system;

import com.xhkjedu.suser.model.system.TUser;
import com.xhkjedu.suser.service.system.LoginService;
import com.xhkjedu.suser.vo.system.LoginParams;
import com.xhkjedu.vo.ResultVo;
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 javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

/**
 * @Description：登录
 * @Author: WN
 * @Date: 2024/4/25 14:30:09
 **/
@RestController
@RequestMapping("login")
public class LoginController {
    @Resource
    private LoginService loginService;

    /*
     * @Description 对接管控单点登录
     * @Date 2024/4/25 16:54:04
     * @Author WN
     * @Param [params, request]
     * @Return com.xhkjedu.vo.ResultVo
     **/
    @PostMapping("/single_control")
    public ResultVo singleLogin(@RequestBody LoginParams params, HttpServletRequest request){
        return loginService.singleLogin(params,request);
    }

    /*
     * @Description 单点登录信息--学生平板
     * @Date 2024/7/13 18:07:07
     * @Author WN
     * @Param [tuser, request]
     * @Return com.xhkjedu.vo.ResultVo
     **/
    @PostMapping("/auto_stu")
    public ResultVo autoLogin(@RequestBody TUser tuser, HttpServletRequest request){
        return loginService.autoLogin(tuser,request);
    }
}
