package com.YuyeTech.TPlat.controller;

import com.YuyeTech.TPlat.constant.CookieConstant;
import com.YuyeTech.TPlat.constant.RedisConstant;
import com.YuyeTech.TPlat.dataobject.AdminInfo;
import com.YuyeTech.TPlat.dataobject.UserInfo;
import com.YuyeTech.TPlat.enums.ResultEnum;
import com.YuyeTech.TPlat.form.AdminForm;
import com.YuyeTech.TPlat.service.AdminInfoService;
import com.YuyeTech.TPlat.service.MainInfoService;
import com.YuyeTech.TPlat.service.UserInfoService;
import com.YuyeTech.TPlat.utils.AliyunOSSUtil;
import com.YuyeTech.TPlat.utils.CookieUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;
import java.util.UUID;
import java.util.concurrent.TimeUnit;

/**
 * @author:slambb
 * @date:2020/9/10
 */
@Controller
@RequestMapping("/backstage_log")
@Slf4j
public class BackstageLogController {

    /***
     * 日志页面
     * @param map
     * @return
     */
    @GetMapping("/client")
    public ModelAndView clientLog(
            HttpServletRequest request,
            Map<String, Object> map) {

        String url = "http://" + request.getServerName() //服务器地址
                + ":"
                + request.getServerPort()           //端口号
                + request.getRequestURI();
        log.info("adminLogin url={}", url);

        return new ModelAndView("log/client", map);
    }

}
