package com.wisedu.ciap.demo.cas.controller;

import com.wisedu.ciap.demo.cas.bean.UserInfo;
import com.wisedu.ciap.demo.cas.util.CasUtil;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * 功能描述：cas登录后返回的用户信息的demo接口
 * 修改记录:
 * <pre>
 * 修改时间：
 * 修改人：
 * 修改内容：
 * </pre>
 *
 * @title CasDemoController
 * @Author: zhangjian 01116211
 * @Date: 2021-06-03
 */

@RestController
public class CasDemoController {

    @RequestMapping(value = "/getUserInfo",
            produces = { "application/json" },
            method = RequestMethod.GET)
    public UserInfo getLoginUserInfo(HttpServletRequest request){
        return CasUtil.getUserInfoFromCas(request);
    }
}
