原创 支付寶:驗簽出錯,建議檢查簽名字符串或簽名私鑰與應用公鑰是否匹配

springboot項目,公鑰證書方式,進行支付寶退款時,支付寶返回:“驗簽出錯,建議檢查簽名字符串或簽名私鑰與應用公鑰是否匹配”。返回值裏面,sub_code值是isv.invalid-signature。 使用AlipayClient

原创 ElasticSearch流水賬

一: ElasticSearch 基本概念INDEX:這是ES存儲數據的地方,類似於關係數據庫的DATABASE。Document TYPE:嗯,類似關係數據庫的表,主要功能是將完全不同SCHEMA(這個概念以後會講到,不急)的數據分開,

原创 js正則限制 input 只能輸入小數、整數

只能輸入小數、整數: function num(obj){ if(obj.value=='0.00'){ obj.value = ''; } obj.value = obj.value.replac

原创 Java異常: Found interface … but class was expected

This happens when your runtime classpath is different than your compile time classpath. 這個異常是由於你的運行時classpath和編譯時cla

原创 Java多線程-併發工具類(三)控制併發線程數的Semaphore

參考:http://ifeve.com/concurrency-semaphore/https://www.cnblogs.com/feijishuo/p/4538814.htmlhttps://zhuanlan.zhihu.com/p/

原创 Mybatis Mapper.xml繼承機制

文章來源:https://segmentfault.com/a/1190000012470056Mapper.xml繼承機制github地址Mybatis實際上隱藏了一個功能:Mapper.xml可以繼承,這個在官方文檔中並沒有提到過,不

原创 elasticsearch 嵌套對象查詢

// 創建嵌套對象mapping PUT /earth_index { "mappings": { "earthblog": { "properties": { "title":{ "type":

原创 spring-data-elasticsearch嵌套對象

spring-data-elasticsearch支持嵌套對象創建,實體類:@Document(indexName = "xxxx", type = "ttt") public class Employee { @Id priv

原创 Spring @Value("${property:xxx}") 缺省值

參考:http://www.mkyong.com/spring3/spring-value-default-value/1. @Value ExamplesTo set a default value in Spring expressi

原创 什麼是CAS機制

參考:https://www.cnblogs.com/myopensource/p/8177074.htmlhttps://www.jianshu.com/p/e2179c74a2e4CAS是英文單詞Compare And Swap的縮寫

原创 spring-data-elasticSearch聚合sum查詢

有時需要統計一段時間內,訂單的總金額。類似於sql的sum,針對某一字段求和。這就涉及到es的聚合查詢,來看看用spring-data-elasticSearch怎麼寫: QueryBuilder queryBuilder

原创 spring-data-elasticsearch動態indexName

spring配置: <!-- 加載es配置 --> <!-- 獲取properties中的值 --> <bean id="configProperties" class="org.springframework.beans.facto

原创 Spring使用SpEL表達式讀取properties配置文件的兩種方式

第一種:config.properties:index.version=v1spring配置文件,加載config.properties: <!-- 獲取properties中的值 --> <bean id="configPropert

原创 spring5+spring-data-elasticsearch集成

一、搞定依賴 <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <spring.version>5.0.0.RELEASE<

原创 java.lang.Integer IntegerCache源碼分析

1、給Integer賦值時,例如:Integer a = 127;Integer會初始化一個IntegerCache.cache的數組,數組裏面存儲-128 到 127之間的數字。初始化源碼:2、調用valueOf(int i)方法,如果