# Conflicts: # src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientManagerImpl.java # src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerManageController.java # src/main/resources/application-rpay.properties # src/main/ui/static/payment/partner/partner-manage.js # src/main/ui/static/payment/partner/templates/sub_merchant_id_apply.htmlmaster
commit
98332d95a5
@ -0,0 +1,35 @@
|
||||
package au.com.royalpay.payment.manage.task;
|
||||
|
||||
import au.com.royalpay.payment.manage.dev.core.MerchantLocationService;
|
||||
import au.com.royalpay.payment.tools.scheduler.SynchronizedScheduler;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* Created by wangning on 2018/1/2.
|
||||
*/
|
||||
@Component
|
||||
@ConditionalOnProperty(value = "app.run-tasks", havingValue = "true")
|
||||
public class initClientLocationTask {
|
||||
@Resource
|
||||
private MerchantLocationService merchantLocationService;
|
||||
@Resource
|
||||
private SynchronizedScheduler synchronizedScheduler;
|
||||
|
||||
@Scheduled(cron = "0 0 5 * * *")
|
||||
public void checkBillOrderCheck() {
|
||||
synchronizedScheduler.executeProcess("manage_task:initClientLocation", 120_000, () -> {
|
||||
try {
|
||||
merchantLocationService.initClientLocations();
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
package au.com.royalpay.payment.manage.process.aes;
|
||||
|
||||
import au.com.royalpay.payment.tools.codec.AESCrypt;
|
||||
import org.apache.commons.net.util.Base64;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.security.Key;
|
||||
|
||||
/**
|
||||
* Create by yixian at 2018-09-17 12:55
|
||||
*/
|
||||
public class AESTest {
|
||||
@Test
|
||||
public void initAESKey() {
|
||||
System.out.println(Base64.encodeBase64String(AESCrypt.randomKey().getEncoded()));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testEncrypt() {
|
||||
String keyStr = "EPrfsM2JE69ZPR7BhXn34g==";
|
||||
String source = "123456";
|
||||
Key key = AESCrypt.fromKeyString(Base64.decodeBase64(keyStr));
|
||||
byte[] encrypted = AESCrypt.encrypt(source.getBytes(StandardCharsets.UTF_8), key);
|
||||
System.out.println("encrypted: " + Base64.encodeBase64String(encrypted));
|
||||
System.out.println("validate: " + new String(AESCrypt.decrypt(encrypted, key), StandardCharsets.UTF_8));
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in new issue