摘要: public class Controller { final List<Service> services; private final Map<Enum, Service> enumMap = new EnumMap<>(TaxSiteEnum.class); @PostConstruct pu 阅读全文
posted @ 2023-02-08 09:29 createcoc 阅读(11) 评论(0) 推荐(0) 编辑
摘要: 方式一 1 /** 2 * 全局异常处理类,能够处理到controller、filter、interceptro所抛出的异常 3 * 不使用HandlerExceptionResolver、结合两者使用(ControllerAdvice|ErrorController) 4 */ 5 @RestCo 阅读全文
posted @ 2023-02-07 16:49 createcoc 阅读(45) 评论(0) 推荐(0) 编辑
摘要: idea重置试用插件 https://plugins.zhile.io IDE Eval Reset 具体操作https://blog.csdn.net/zzztimes/article/details/117550423 驼峰、下划线等互转插件 CamelCase 快捷键alt+shift+u m 阅读全文
posted @ 2021-09-02 09:45 createcoc 阅读(101) 评论(0) 推荐(0) 编辑
摘要: 1.调出services窗口 2.选中要运行的项目,copy Configuration.. 3.编辑弹出窗口edit configuration(指定端口的命令 --server.port=6004,最前面是两个短横岗 3. 运行新实例就完了发现报错,端口冲突,启动类上打断点 4,修改启动类,将运 阅读全文
posted @ 2020-05-20 10:42 createcoc 阅读(2944) 评论(0) 推荐(0) 编辑
摘要: 缓存穿透、击穿、雪崩 原文:https://mp.weixin.qq.com/s/_sqGyTvMphOLPpbSCLh0Yw 总结,请求绕过redis,直接作用到mysql上 雪崩:key大面积失效(定时任务刷新缓存,key的过期时间相同,某个时间点全部失效) 解决方案:失效时间都加个随机值避免同 阅读全文
posted @ 2020-05-04 09:56 createcoc 阅读(281) 评论(0) 推荐(0) 编辑
摘要: hotool工具类包 引入maven <dependency> <groupId>cn.hutool</groupId> <artifactId>hutool-http</artifactId> <version>${hutool.version}</version> </dependency> < 阅读全文
posted @ 2020-04-22 17:26 createcoc 阅读(318) 评论(0) 推荐(0) 编辑
摘要: 可以破解jwt的网址:http://jwt.calebb.net/ 上代码 public static void main(String[] args) { //用户登录,获取数据库用户表的信息 //假如用户id:1 JwtBuilder builder = Jwts.builder() //设置用 阅读全文
posted @ 2020-04-22 14:55 createcoc 阅读(1155) 评论(0) 推荐(1) 编辑
摘要: 目的:项目接口的权限设置(springBoot) 在Controller的类上和方法上打注解(项目运行时,使用反射获取注解的值),然后将方法的访问权限放入数据库表,用户发起请求时,在拦截器里面查询数据库验证是否有权限 代码 定义两个注解 /** * 定义一个用于类上的注解,并且可以使用反射获取 */ 阅读全文
posted @ 2020-04-21 18:09 createcoc 阅读(299) 评论(0) 推荐(0) 编辑
摘要: 目的:理解属性拷贝工具类(根据类的class对象获取类的对象:利用反射获取类的对象) /** * @description: 对象属性拷贝 转化 * @param source * @param destinationClass * @return T */ public static <T> T 阅读全文
posted @ 2020-04-21 17:16 createcoc 阅读(192) 评论(0) 推荐(0) 编辑
摘要: nacos文档https://nacos.io/zh-cn/docs/what-is-nacos.html 官方文档demo: 服务注册发现:https://github.com/alibaba/spring-cloud-alibaba/blob/master/spring-cloud-alibab 阅读全文
posted @ 2020-04-15 11:34 createcoc 阅读(343) 评论(0) 推荐(0) 编辑