/*
 * Copyright (c) 2017-2018.  放牛极客<l_iupeiyu@qq.com>
 * <p>
 * Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *      http://www.apache.org/licenses/LICENSE-2.0
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 * </p>
 *
 */

package com.geekcattle.core.Interceptor;

import com.geekcattle.util.IpUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@Component
public class ResourceInterceptor extends HandlerInterceptorAdapter {

    private static final String USER_AGENT = "user-agent";
    private Logger logger = LoggerFactory.getLogger(this.getClass());

    @Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
            throws Exception {
        if(logger.isDebugEnabled()){
            String uri = request.getRequestURI();
            logger.info(uri);
            logger.info("UserAgent: {}", request.getHeader(USER_AGENT));
            logger.info("用户访问地址: {}, 来路地址: {}", uri, IpUtil.getIpAddr(request));
        }
        return true;
    }

}

@@ -1,653 +1,4 @@
-/*%0A * Copyright (c) 2017-2018.  %E6%94%BE%E7%89%9B%E6%9E%81%E5%AE%A2%3Cl_iupeiyu@qq.com%3E%0A * %3Cp%3E%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A *    you may not use this file except in compliance with the License.%0A *    You may obtain a copy of the License at%0A *      http://www.apache.org/licenses/LICENSE-2.0%0A *    Unless required by applicable law or agreed to in writing, software%0A *    distributed under the License is distributed on an %22AS IS%22 BASIS,%0A *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A *    See the License for the specific language governing permissions and%0A *    limitations under the License.%0A * %3C/p%3E%0A *%0A */%0A%0A
 pack
@@ -21,17 +21,17 @@
 le.core.
-I
+i
 ntercept

升级springboot为2.1.2.RELEASE版本 移除j2cache支持，移除原因为简化新手用户部署系统配置 更改后台登录为单realm，不再支持多realm 优化日期时间工具类，使用Instant、LocalDateTime、LocalDate实现线性安全 修复Java开发规约中级警告及部分低级警告 增加debug日志输出开关 修复其它已知BUG