随笔分类 - JAVA
JAVA一些常用的方法
    
摘要:ApplicationContext.publishEvent 是Spring提供的解耦的一种方式 (基于内存)。同样可以使用 MQ 组件 / 线程池 代替。 参数类 NotifyEvent.java import lombok.AllArgsConstructor; import lombok.D
        阅读全文
                
摘要:标题 # 一级标题 ## 二级标题 ### 三级标题 备注:一个#代表一级标题,2个#代表二级标题,依次类推支持6级标题,切记#和文字之间有个空格 字体 加粗 内容左右各两个* **我是加粗字体** 斜体 内容左右各一个* *我是斜体* 斜体和加粗 内容左右3个* ***我是加粗的斜体内容*** 删
        阅读全文
                
摘要:没有的话就引入依赖 <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-databind</artifactId> <version>2.10.1</version> </dependency>
        阅读全文
                
摘要:List<JsonDTO> jsonDTOList = gson.fromJson(jsonStr, new TypeToken<List<JsonDTO>>() { }.getType()); JsonDTO:要转换的集合的对象 jsonStr:要转换的json字符串
        阅读全文
                
摘要:/** * 获取的占位符内容:现在是{} * @param str 模板数据 * @return */ public static List<String> getTemplatePlaceholder(String str) { String pattern = "\\{([^}]*)\\}"; 
        阅读全文
                
摘要:es6版本 java取值 long count = search.getHits().getTotalHits(); es7版本 java取值 long count = search.getHits().getTotalHits().value; 如果是使用的jest框架的话 写法是 SearchR
        阅读全文
                
摘要:这里的currentTypePriority 表示当前移动的排序值 nextTypePriority表示移动结束后的后一个排序值 比如 1、2、3、4、5 这对应的排序值也是一样 那么2要移动到5前面 =》1、3、4、2、5 那么这里的 currentTypePriority:2对应的排序值 nex
        阅读全文
                
摘要:语法 "script": { "lang": "", "source": "", "params": { ... } } lang:指定编写脚本的语言。默认为painless.source:source为脚本本身params:指定作为变量传递到脚本中的任何命名参数。 批量修改 POST 索引名称/_
        阅读全文
                
摘要:放到resources/xls/import-template.xls 这个路径可以自己修改 代码同步修改即可 @GetMapping(value = "/downloadXls") @ApiOperation(value = "下载导入模板") public void downloadXls(Ht
        阅读全文
                
摘要:<!--AES加密--> <dependency> <groupId>org.bouncycastle</groupId> <artifactId>bcprov-ext-jdk16</artifactId> <version>1.45</version> </dependency> 工具类 AesU
        阅读全文
                
摘要:依赖,根据需要放入 <dependency> <groupId>org.eclipse.paho</groupId> <artifactId>org.eclipse.paho.client.mqttv3</artifactId> <version>1.2.5</version> </dependen
        阅读全文
                
摘要:distinctFieldName 就是去重字段,这个字段必须是keyword类型 不然会报错 //指定去重字段 CollapseBuilder collapseBuilder = new CollapseBuilder(distinctFieldName); // 查询去重后的结果数量 Cardi
        阅读全文
                
摘要:org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: Cannot deserialize instance of `java.util.ArrayList` out of STAR
        阅读全文
                
摘要:private static Pattern pattern = Pattern.compile("[\u4E00-\u9FA5|\\!|\\,|\\。|\\(|\\)|\\《|\\》|\\“|\\”|\\?|\\:|\\;|\\【|\\】]"); /** * 字符串是否包含中文 * * @para
        阅读全文
                
摘要:An attempt was made to call the method net.sf.jsqlparser.schema.Column.withColumnName(Ljava/lang/String;)Lnet/sf/jsqlparser/schema/Column; but it does
        阅读全文
                
摘要:POST 索引名称/_update_by_query { "query": { "bool": { "must_not": { "exists": { "field": "updateTime" } } } }, "script":"ctx._source.updateTime=ctx._sourc
        阅读全文
                
摘要:ES使用reindex命令从不同服务器之间迁移数据: https://www.cnblogs.com/pxblog/p/17919065.html 用的es版本是6.5.x POST _reindex { "source": { "index": "现有的索引名称", "size":1000, "q
        阅读全文
                
摘要:在Maven打包的时候可以使用YUI Compressor(压缩CSS/JS)文件,使用yuicompressor-maven-plugin插件进行压缩后会减小体积,提高请求速度。 <build> <plugins> <!-- YUI Compressor (CSS/JS压缩) --> <plugi
        阅读全文
                
摘要:引入依赖 <dependency> <!-- this is needed or IntelliJ gives junit.jar or junit-platform-launcher:1.3.2 not found errors --> <groupId>org.junit.platform</g
        阅读全文
                
摘要:一个项目下创建两个模块 在hello-springboot-starter的项目pom.xml引入hello-springboot-starter-autoconfigure的依赖 其他什么都不需要写 hello-springboot-starter-autoconfigure的pom依赖根据自己需
        阅读全文
                
 
                    
                     
                    
                 
                    
                
 
         浙公网安备 33010602011771号
浙公网安备 33010602011771号