mirror of https://gitee.com/stylefeng/roses
parent
ce77a02ec7
commit
b328c3392b
|
@ -35,6 +35,7 @@ import lombok.extern.slf4j.Slf4j;
|
|||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.Charset;
|
||||
|
||||
/**
|
||||
* http响应信息的直接渲染工具
|
||||
|
@ -90,7 +91,7 @@ public class ResponseRenderUtil {
|
|||
*/
|
||||
public static void setRenderFileHeader(HttpServletResponse response, String fileName) {
|
||||
final String charset = ObjectUtil.defaultIfNull(response.getCharacterEncoding(), CharsetUtil.UTF_8);
|
||||
response.setHeader("Content-Disposition", StrUtil.format("attachment;filename={}", URLUtil.encode(fileName, charset)));
|
||||
response.setHeader("Content-Disposition", StrUtil.format("attachment;filename={}", URLUtil.encode(fileName, Charset.forName(charset))));
|
||||
response.setContentType("application/octet-stream; charset=utf-8");
|
||||
}
|
||||
|
||||
|
|
|
@ -27,6 +27,7 @@ package cn.stylefeng.roses.kernel.cache.memory;
|
|||
import cn.hutool.cache.impl.CacheObj;
|
||||
import cn.hutool.cache.impl.TimedCache;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.stylefeng.roses.kernel.cache.api.CacheOperatorApi;
|
||||
|
||||
|
@ -107,7 +108,7 @@ public abstract class AbstractMemoryCacheOperator<T> implements CacheOperatorApi
|
|||
@Override
|
||||
public Map<String, T> getAllKeyValues() {
|
||||
Collection<String> allKeys = this.getAllKeys();
|
||||
HashMap<String, T> results = CollectionUtil.newHashMap();
|
||||
HashMap<String, T> results = MapUtil.newHashMap();
|
||||
for (String key : allKeys) {
|
||||
results.put(key, this.get(key));
|
||||
}
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
package cn.stylefeng.roses.kernel.cache.redis;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.stylefeng.roses.kernel.cache.api.CacheOperatorApi;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
|
@ -33,7 +34,6 @@ import java.util.*;
|
|||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
/**
|
||||
* 基于redis的缓存封装
|
||||
*
|
||||
|
@ -105,7 +105,7 @@ public abstract class AbstractRedisCacheOperator<T> implements CacheOperatorApi<
|
|||
@Override
|
||||
public Map<String, T> getAllKeyValues() {
|
||||
Collection<String> allKeys = this.getAllKeys();
|
||||
HashMap<String, T> results = CollectionUtil.newHashMap();
|
||||
HashMap<String, T> results = MapUtil.newHashMap();
|
||||
for (String key : allKeys) {
|
||||
results.put(key, this.get(key));
|
||||
}
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
package cn.stylefeng.roses.kernel.cache.redis;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.stylefeng.roses.kernel.cache.api.CacheOperatorApi;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
|
||||
|
@ -104,7 +105,7 @@ public abstract class AbstractRedisHashCacheOperator<T> implements CacheOperator
|
|||
@Override
|
||||
public Map<String, T> getAllKeyValues() {
|
||||
Collection<String> allKeys = this.getAllKeys();
|
||||
HashMap<String, T> results = CollectionUtil.newHashMap();
|
||||
HashMap<String, T> results = MapUtil.newHashMap();
|
||||
for (String key : allKeys) {
|
||||
results.put(key, this.get(key));
|
||||
}
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
package cn.stylefeng.roses.kernel.sms.modular.controller;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.util.RandomUtil;
|
||||
import cn.stylefeng.roses.kernel.rule.pojo.response.ResponseData;
|
||||
import cn.stylefeng.roses.kernel.rule.pojo.response.SuccessResponseData;
|
||||
|
@ -79,7 +80,7 @@ public class SmsSenderController {
|
|||
sysSmsSendParam.setParams(null);
|
||||
|
||||
// 设置模板中的参数
|
||||
HashMap<String, Object> paramMap = CollectionUtil.newHashMap();
|
||||
HashMap<String, Object> paramMap = MapUtil.newHashMap();
|
||||
paramMap.put("code", RandomUtil.randomNumbers(6));
|
||||
sysSmsSendParam.setParams(paramMap);
|
||||
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
package cn.stylefeng.roses.kernel.sms.modular.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.RandomUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
|
@ -106,7 +107,7 @@ public class SysSmsInfoServiceImpl extends ServiceImpl<SysSmsMapper, SysSms> imp
|
|||
else {
|
||||
validateCode = RandomUtil.randomNumbers(6);
|
||||
if (params == null) {
|
||||
params = CollectionUtil.newHashMap();
|
||||
params = MapUtil.newHashMap();
|
||||
}
|
||||
params.put(SMS_CODE_PARAM_NAME, validateCode);
|
||||
}
|
||||
|
|
2
pom.xml
2
pom.xml
|
@ -119,7 +119,7 @@
|
|||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<roses.version>7.1.3</roses.version>
|
||||
<hutool.version>5.4.4</hutool.version>
|
||||
<hutool.version>5.7.6</hutool.version>
|
||||
<fastjson.version>1.2.74</fastjson.version>
|
||||
<lombok.versin>1.18.14</lombok.versin>
|
||||
<mp.version>3.4.0</mp.version>
|
||||
|
|
Loading…
Reference in New Issue