コード例 #1
0
 public boolean ifAlreadyExists(Merchant merchant, Wallets wallet) {
   String merchantId =
       template
           .opsForValue()
           .get("merchant." + merchant.getName() + wallet.getRedisMerchantIdKey());
   return merchantId == null ? false : true;
 }
コード例 #2
0
  public Merchant getDetails(String merchantName) {
    String baseKey = "merchant." + merchantName;

    Merchant merchant = new Merchant();

    // or use template directly
    merchant.setName(template.opsForValue().get(baseKey + ".name"));
    merchant.setPhoneNumber(template.opsForValue().get(baseKey + ".phone"));
    merchant.setEmail(template.opsForValue().get(baseKey + ".email"));
    merchant
        .getWalletMerchantId()
        .put(
            Wallets.PAYTM,
            template.opsForValue().get(baseKey + Wallets.PAYTM.getRedisMerchantIdKey()));
    merchant
        .getWalletMerchantId()
        .put(
            Wallets.PAYUMONEY,
            template.opsForValue().get(baseKey + Wallets.PAYUMONEY.getRedisMerchantIdKey()));
    merchant
        .getWalletMerchantId()
        .put(
            Wallets.CITRUS,
            template.opsForValue().get(baseKey + Wallets.CITRUS.getRedisMerchantIdKey()));

    return merchant;
  }