Commit 07c311c0 authored by alex yao's avatar alex yao

feat:getVariableList 按字母排序

parent 4935dfe7
......@@ -33,12 +33,15 @@ import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
import java.text.Collator;
import java.util.*;
import java.util.stream.Collectors;
@Component
public class AgentApplicationInfoRestImpl implements AgentApplicationInfoRest {
private final Collator collator = Collator.getInstance(Locale.CHINA);
@Resource
private BizAgentApplicationInfoService bizAgentApplicationInfoService;
......@@ -367,7 +370,7 @@ public class AgentApplicationInfoRestImpl implements AgentApplicationInfoRest {
result.add(valueMemoryDto);
}
}
return result.stream().sorted(Comparator.comparing(AgentApplicationValueMemoryDto::getKey)).collect(Collectors.toList());
return result.stream().sorted(Comparator.comparing(AgentApplicationValueMemoryDto::getKey, collator)).collect(Collectors.toList());
}
@Override
......
......@@ -24,7 +24,10 @@ import java.util.Map;
@Service
public class SetLongMemoryFunction extends AbstractLargeModelFunction {
private String desc = "该方法仅用来保存用户想记录的内容,不能通过该方法进行查询。";
private final String desc = "该方法仅用来保存用户想记录的内容,不能通过该方法进行查询。";
private final Long expireTime = 30 * 60 * 24L; // 30天有效期
@Resource
private RedisService redisService;
......@@ -48,7 +51,7 @@ public class SetLongMemoryFunction extends AbstractLargeModelFunction {
// 提取 content
String contents = jsonObject.getStr("content");
String contentKey = SetLongMemoryConstants.REDIS_PREFIX + key + ":" + BlContext.getCurrentUserNotException().getUserId().toString();
redisService.hset(contentKey, DateUtils.getCurrTime(), contents);
redisService.hset(contentKey, DateUtils.getCurrTime(), contents, expireTime);
return "SUCCESS";
}
......
......@@ -20,7 +20,10 @@ import java.util.Map;
@Service
public class SetValueMemoryFunction extends AbstractLargeModelFunction {
private String desc = "该方法仅用enum给定的内容名来保存用户想记录的内容值,不可使用该方法进行查询";
private final String desc = "该方法仅用enum给定的内容名来保存用户想记录的内容值,不可使用该方法进行查询";
private final Long expireTime = 30 * 60 * 24L; // 30天有效期
@Resource
private RedisService redisService;
......@@ -49,7 +52,7 @@ public class SetValueMemoryFunction extends AbstractLargeModelFunction {
}
}
result.put(contentName, contentValue);
redisService.hmset(contentKey, result);
redisService.hmset(contentKey, result, expireTime);
return "SUCCESS";
}
......
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 to comment