package com.fufan.mtsaas.modules.sysmgr.error.controller;

import com.fufan.mtsaas.tools.AESTool;
import com.alibaba.fastjson.JSONObject;
import com.fufan.mtsaas.tools.AESTool;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 错误页面
 *
 * @version 1.0
 * @auther Liby
 * @create 2018/5/2
 **/
@Api(tags = "Error异常对象接口")
@RestController
@RequestMapping("/ERROR")
@Slf4j
public class ErrorCtrl {


    @ApiOperation(value = "自动退出接口",response = String.class)
    @GetMapping("session")
    public String Session(){
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("code","E2004");
        jsonObject.put("content","长时间离开，登录信息失效！");
        String error="";
        try {
            error = AESTool.encrypt(jsonObject.toString());
        } catch (Exception e) {
            log.error("ErrorCtrl中加密错误:",e);
        }
        return error;
    }
}
