mirror of
https://github.com/chillzhuang/blade-tool
synced 2024-12-12 12:19:27 +08:00
⚡ 优化格式
This commit is contained in:
parent
3bbc662b39
commit
c39741d45d
@ -115,24 +115,11 @@ public class AliossTemplate {
|
||||
return getOssHost(bucketName).concat(StringPool.SLASH).concat(fileName);
|
||||
}
|
||||
|
||||
/**
|
||||
* 文件对象
|
||||
*
|
||||
* @param file 上传文件类
|
||||
* @return
|
||||
*/
|
||||
|
||||
@SneakyThrows
|
||||
public BladeFile putFile(MultipartFile file) {
|
||||
return putFile(ossProperties.getBucketName(), file.getOriginalFilename(), file);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param fileName 上传文件名
|
||||
* @param file 上传文件类
|
||||
* @return
|
||||
*/
|
||||
|
||||
@SneakyThrows
|
||||
public BladeFile putFile(String fileName, MultipartFile file) {
|
||||
return putFile(ossProperties.getBucketName(), fileName, file);
|
||||
|
@ -134,7 +134,6 @@ public class QiniuTemplate {
|
||||
*
|
||||
* @param fileName 文件名
|
||||
* @return 文件公开链接
|
||||
* @link https://developer.qiniu.com/kodo/1239/java#public-get
|
||||
*/
|
||||
public String publicFileLink(String fileName) {
|
||||
return String.format("%s/%s", ossProperties.getEndpoint(), fileName);
|
||||
@ -146,7 +145,6 @@ public class QiniuTemplate {
|
||||
* @param fileName 文件名
|
||||
* @param expireTime 超时时间
|
||||
* @return 私有文件链接
|
||||
* @link https://developer.qiniu.com/kodo/1239/java#private-get
|
||||
*/
|
||||
@SneakyThrows
|
||||
public String privateFileLink(String fileName, Long expireTime) {
|
||||
|
@ -26,7 +26,7 @@ import org.springblade.core.tool.jackson.JsonUtil;
|
||||
import org.springblade.core.tool.utils.StringUtil;
|
||||
import org.springblade.core.tool.utils.WebUtil;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
|
||||
import org.springframework.web.servlet.AsyncHandlerInterceptor;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
@ -40,7 +40,7 @@ import java.util.Objects;
|
||||
*/
|
||||
@Slf4j
|
||||
@AllArgsConstructor
|
||||
public class ClientInterceptor extends HandlerInterceptorAdapter {
|
||||
public class ClientInterceptor implements AsyncHandlerInterceptor {
|
||||
|
||||
private final String clientId;
|
||||
|
||||
|
@ -24,7 +24,7 @@ import org.springblade.core.tool.constant.BladeConstant;
|
||||
import org.springblade.core.tool.jackson.JsonUtil;
|
||||
import org.springblade.core.tool.utils.WebUtil;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
|
||||
import org.springframework.web.servlet.AsyncHandlerInterceptor;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
@ -38,7 +38,7 @@ import java.util.Objects;
|
||||
*/
|
||||
@Slf4j
|
||||
@AllArgsConstructor
|
||||
public class SecureInterceptor extends HandlerInterceptorAdapter {
|
||||
public class SecureInterceptor implements AsyncHandlerInterceptor {
|
||||
|
||||
@Override
|
||||
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) {
|
||||
|
Loading…
Reference in New Issue
Block a user