摘要: 问题1 用RedisTemplate存入map值的时候,用rdm可视化打开,看到的是转码之后的数据,如图: 存入的方法为: public boolean hmset(String key, Map<String, Object> map) { try { redisTemplate.opsForHa 阅读全文
posted @ 2020-12-07 12:21 码农记事本 阅读(973) 评论(0) 推荐(0)
摘要: 前言 关于引入gateway的好处我网上找了下: 性能:API高可用,负载均衡,容错机制。 安全:权限身份认证、脱敏,流量清洗,后端签名(保证全链路可信调用),黑名单(非法调用的限制)。 日志:日志记录(spainid,traceid)一旦涉及分布式,全链路跟踪必不可少。 缓存:数据缓存。监控:记录 阅读全文
posted @ 2020-12-06 12:14 码农记事本 阅读(7341) 评论(2) 推荐(0)
摘要: 子模块配置 buildscript { repositories { mavenLocal() maven { url "http://maven.aliyun.com/nexus/content/groups/public/" } maven { url "${nexusUrl}" credent 阅读全文
posted @ 2020-12-05 10:35 码农记事本 阅读(1325) 评论(0) 推荐(1)
摘要: public class BeanUtil { public static <T> List<T> copyProp(List<?> fromList, Class<T> toC, String... filterProp) { List<T> ts = new ArrayList<>(); for 阅读全文
posted @ 2020-12-05 10:21 码农记事本 阅读(89) 评论(0) 推荐(0)
摘要: 问题 最近在写博客浏览量的时候,设计了这么一个逻辑:同一个IP浏览一遍文章,5分钟内不刷新次数。就需要在服务器端得到用户的真实IP,我代码是这样写的(从网上找的方法): public static String getRealIp(HttpServletRequest request) { Stri 阅读全文
posted @ 2020-12-05 10:16 码农记事本 阅读(671) 评论(0) 推荐(0)
摘要: LIST public class LambdaTest { @Getter @Setter @AllArgsConstructor static class Student{ private Long id; private String name; private Integer age; } 阅读全文
posted @ 2020-12-04 23:48 码农记事本 阅读(223) 评论(0) 推荐(0)