This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public List<AppResponseVO> findLatestAndSubmittedAppsByAppId() { | |
return appRequestRepository.findAll(this::buildSpecification).stream() | |
.map(AppResponseVO::new) | |
.sorted(Comparator.comparing((AppResponseVO appResponse) -> { | |
switch (AppLifeCycleStatus.valueOf(appResponse.getStatus())) { | |
case IN_REVIEW: | |
return 1; | |
case ONLINE: | |
return 2; | |
case REJECTED: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.mobynote.listener; | |
import com.mobynote.dto.HealthValue; | |
import com.mobynote.entity.DeviceErrorLog; | |
import com.mobynote.listener.event.DeviceErrorLogEvent; | |
import com.mobynote.repository.DeviceErrorLogRepository; | |
import com.mobynote.util.CommonUtils; | |
import org.apache.commons.lang.StringUtils; | |
import org.junit.Before; | |
import org.junit.Test; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.moby.security; | |
import org.apache.commons.codec.binary.Base64; | |
import org.apache.commons.lang3.time.StopWatch; | |
import org.junit.Test; | |
import javax.crypto.BadPaddingException; | |
import javax.crypto.Cipher; | |
import javax.crypto.IllegalBlockSizeException; | |
import java.security.*; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
public void encrypt_decrypt_jdk_rsa() throws NoSuchAlgorithmException, InvalidKeySpecException, InvalidKeyException, NoSuchPaddingException, BadPaddingException, IllegalBlockSizeException { | |
String source = "Hala Madrid!"; | |
// 1. init secureKey | |
KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("RSA"); | |
keyPairGenerator.initialize(512); | |
KeyPair keyPair = keyPairGenerator.generateKeyPair(); | |
RSAPublicKey rsaPublicKey = (RSAPublicKey) keyPair.getPublic(); | |
RSAPrivateKey rsaPrivateKey = (RSAPrivateKey) keyPair.getPrivate(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import javax.crypto.Cipher; | |
import javax.crypto.KeyGenerator; | |
import javax.crypto.SecretKey; | |
import javax.crypto.SecretKeyFactory; | |
import javax.crypto.spec.PBEKeySpec; | |
import javax.crypto.spec.PBEParameterSpec; | |
import javax.crypto.spec.SecretKeySpec; | |
import java.security.Key; | |
import java.security.SecureRandom; | |
import java.security.Security; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.domain; | |
import com.domain.Module; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.data.domain.Page; | |
import org.springframework.data.domain.PageImpl; | |
import org.springframework.data.domain.Pageable; | |
import org.springframework.jdbc.core.JdbcTemplate; | |
import org.springframework.stereotype.Repository; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<input type="checkbox" id="cbtn_all"> 全选/取消全选 | |
<input type="checkbox" name="cbtn_id">A | |
<input type="checkbox" name="cbtn_id">B | |
<input type="checkbox" name="cbtn_id">C | |
// 全选按钮,控制其它复选框 | |
$(function (){ | |
$('#cbtn_all').click(function(){ | |
if(this.checked){ | |
$(':checkbox[name="cbtn_id"]').prop("checked", true); |