摘要: 1、request_time 官网描述:request processing time in seconds with a milliseconds resolution; time elapsed between the first bytes were read from the client 阅读全文
posted @ 2021-04-12 15:01 KoMiles 阅读(935) 评论(0) 推荐(0) 编辑
摘要: 1.解析接口返回的数据时,失败了。 feign.codec.DecodeException: Could not extract response: no suitable HttpMessageConverter found for response type [java.util.List<co 阅读全文
posted @ 2020-09-10 15:25 KoMiles 阅读(17695) 评论(1) 推荐(0) 编辑
摘要: 1)微服务为什么要使用服务发现与注册? 前文中提到,微服务独立部署、具有清晰的边界,服务之间通过远程调用来构建复杂的业务功能。那为什么要引用服务注册与发现呢?服务注册与发现具体要解决什么问题? 服务注册与发现主要解决了如下两个重要问题: 1)屏蔽,解耦服务之间相互依赖的细节 我们知道服务之间的远程调 阅读全文
posted @ 2020-09-07 14:58 KoMiles 阅读(3010) 评论(0) 推荐(0) 编辑
摘要: 在类的声明中,可以包含多个初始化块,当创建类的实例时,就会依次执行这些代码块。如果使用 static 修饰初始化块,就称为静态初始化块。 需要特别注意:静态初始化块只在类加载时执行,且只会执行一次,同时静态初始化块只能给静态变量赋值,不能初始化普通的成员变量。 package com.komiles 阅读全文
posted @ 2020-06-14 18:02 KoMiles 阅读(531) 评论(0) 推荐(0) 编辑
摘要: 1. 使用 stream 将一个数组放进 stream 里面,然后直接调用 stream 里的 min 或 max 函数得到最大值。 @Test public void index2(){ int ages[] = {18 ,23 ,21 ,19 ,25 ,29 ,17}; int maxNum = 阅读全文
posted @ 2020-06-10 15:57 KoMiles 阅读(16582) 评论(0) 推荐(1) 编辑
摘要: java中对数组进行排序 使用Array.sort() 这个默认是升序 @Test public void index4(){ int scores[] = new int[]{1,2,3,89,4}; Arrays.sort(scores); for (int i:scores ) { Syste 阅读全文
posted @ 2020-06-07 18:25 KoMiles 阅读(25903) 评论(1) 推荐(1) 编辑
摘要: 如何在spring-boot中使用Redis工具类 修改pom.xml文件 新增spring-boot-starter-data-redis配置 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-b 阅读全文
posted @ 2020-05-22 17:58 KoMiles 阅读(806) 评论(0) 推荐(0) 编辑
摘要: Java初始化List的5种方法 第一种 /** * 第一种方式 * 常规方式 */ @Test public void one(){ List<String> languages = new ArrayList<>(); languages.add("Java"); languages.add(" 阅读全文
posted @ 2020-05-21 18:47 KoMiles 阅读(3497) 评论(0) 推荐(0) 编辑
摘要: 背景 如何使用druid 连接池配置多个数据源 参考文档:https://www.cnblogs.com/qdhxhz/p/10192041.html 目录结构 为了更好的区分,我把不同的数据库,新建在不同的目录下面 先看目录结构: 修改配置 pom.xml <dependency> <groupI 阅读全文
posted @ 2020-05-12 19:44 KoMiles 阅读(19809) 评论(1) 推荐(0) 编辑
摘要: 添加配置 修改pom.xml文件 <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> </dependency> <dependency> <groupId>com.alibaba</ 阅读全文
posted @ 2020-05-11 17:47 KoMiles 阅读(362) 评论(0) 推荐(0) 编辑
摘要: 修改配置文件 pom.xml中新增数据库配置 <?xml version="1.0" encoding="UTF-8"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLS 阅读全文
posted @ 2020-05-11 14:17 KoMiles 阅读(549) 评论(0) 推荐(0) 编辑
摘要: 文章背景 本文介绍如果在spring boot中接入apollo 官方文档:https://github.com/ctripcorp/apollo/wiki#%E4%B8%80%E6%99%AE%E9%80%9A%E5%BA%94%E7%94%A8%E6%8E%A5%E5%85%A5%E6%8C%8 阅读全文
posted @ 2020-05-06 19:44 KoMiles 阅读(1233) 评论(0) 推荐(0) 编辑
摘要: 官方文档 https://github.com/pagehelper/Mybatis-PageHelper/blob/master/wikis/zh/HowToUse.md 引入分页类 pom.xml中 <dependency> <groupId>com.github.pagehelper</gro 阅读全文
posted @ 2020-05-06 11:32 KoMiles 阅读(919) 评论(1) 推荐(0) 编辑
摘要: 背景 我发现上传到github上的项目,有的有Example类,有的没有Example类,怎么回事呢? 过程 对比项目,发现/src/main/resources/mybatis/generatorConfig.xml 类不一样。 原因 targetRuntime="Mybatis" 和 targe 阅读全文
posted @ 2020-04-30 18:40 KoMiles 阅读(8327) 评论(0) 推荐(1) 编辑
摘要: 在pom.xml中添加依赖 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-redis</artifactId> <version>2.2.1.RELEASE< 阅读全文
posted @ 2020-04-02 14:20 KoMiles 阅读(629) 评论(0) 推荐(0) 编辑
摘要: mac下运行php文件,如何操作呢。 访问127.0.0.1 第一部分:it's works 从哪里来的? 浏览器显示 it's works 。第一反应是去Nginx的默认文件夹里修改这个文件,看能否生效。 mac 下Nginx的默认目录为:/usr/local/var/www 修改html文件,但 阅读全文
posted @ 2020-03-31 14:04 KoMiles 阅读(238) 评论(0) 推荐(0) 编辑
摘要: 如题,当SQL语句中使用Like查询,且期望匹配的结果中含有"\"的,应当把"\"替换为"\\\\"。 比如数据库中text字段有以下三行: id text1 au1224 su5b9e1u9a8c2 \24\a su5b9e1u9a8c3 \24\\a su5b9e1u9a8c 当我们使用下面这三 阅读全文
posted @ 2020-03-25 21:08 KoMiles 阅读(2213) 评论(0) 推荐(0) 编辑
摘要: 在做项目时,发现项目中 加载类时,有的地方使用@Autowired,有的地方使用@Resource 在网上搜集了资料 共同点 @Resource和@Autowired都可以作为注入属性的修饰,在接口仅有单一实现类时,两个注解的修饰效果相同,可以互相替换,不影响使用。 不同点 @Resource是Ja 阅读全文
posted @ 2020-03-23 14:34 KoMiles 阅读(766) 评论(0) 推荐(0) 编辑
摘要: 初始化项目 com.example.mybatisgeneratordemo 最终的文件目录结构 配置pom.xml文件 <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" 阅读全文
posted @ 2020-03-22 23:21 KoMiles 阅读(1251) 评论(0) 推荐(0) 编辑
摘要: 新建项目 设置项目名称 设置为Web项目 工程初始化 目录结构 相关配置文件修改 配置pom.xml文件 1.修改pom.xml文件,添加mybatis配置 <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java< 阅读全文
posted @ 2020-03-22 22:25 KoMiles 阅读(1775) 评论(0) 推荐(0) 编辑