Commit 033a4a34 by 钟明宏

测试docker镜像部署

parent a5ee3756
......@@ -14,7 +14,7 @@
<artifactId>document-server</artifactId>
<properties>
<docker.registry>127.0.0.1:5000</docker.registry>
<docker.registry>docker.99boliyuan.com</docker.registry>
<docker.repository>${project.artifactId}</docker.repository>
<maven.build.timestamp.format>yyyyMMddHHmmss</maven.build.timestamp.format>
<skipDocker>false</skipDocker>
......@@ -198,7 +198,7 @@
<skipDocker>true</skipDocker>
</properties>
<activation>
<activeByDefault>true</activeByDefault>
<activeByDefault>false</activeByDefault>
</activation>
</profile>
<profile>
......
package cn.yunmaozj.configuration;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.AsyncHandlerInterceptor;
import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* 文档上传拦截器,这里会对判断是否是登录的用户
*
* @author zhongminghong
* @email zhongmh@yunmaozj.com
* @create 2019-11-21 10:40
*/
@Component
public class DocumentUploadInterceptor implements HandlerInterceptor {
private final Logger logger = LoggerFactory.getLogger(DocumentUploadInterceptor.class);
@Override
public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {
logger.info("DocumentUploadInterceptor.postHandle[{}]",request.getRequestURL());
}
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
logger.info("DocumentUploadInterceptor.postHandle[{}]",request.getRequestURL());
return true;
}
}
......@@ -18,6 +18,8 @@ public class SiteServierMvcConfiguration implements WebMvcConfigurer {
private SystemFile systemFile;
@Autowired
private StaticResourcesHandlerInterceptor interceptor;
@Autowired
private DocumentUploadInterceptor documentUploadInterceptor;
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
......@@ -34,5 +36,6 @@ public class SiteServierMvcConfiguration implements WebMvcConfigurer {
@Override
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(interceptor).addPathPatterns("/**/**html");
registry.addInterceptor(documentUploadInterceptor).addPathPatterns("/site-upload");
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment