From fd74bf0e22aeb06a8e1d8fd5fcfb10dcca0c3627 Mon Sep 17 00:00:00 2001 From: wangning <164851225@qq.com> Date: Thu, 24 May 2018 11:53:07 +0800 Subject: [PATCH 1/6] update --- .../impls/SimpleClientApplyServiceImpl.java | 4 +- .../web/SimpleClientApplyController.java | 3 +- .../templates/mail/register_application.html | 26 ++++++--- .../resources/templates/mail/verify_mail.html | 41 ++----------- .../SimpleClientApplyServiceImplTest.java | 58 +++++++++++++++++++ 5 files changed, 87 insertions(+), 45 deletions(-) create mode 100644 src/test/java/au/com/royalpay/payment/manage/application/core/impls/SimpleClientApplyServiceImplTest.java diff --git a/src/main/java/au/com/royalpay/payment/manage/application/core/impls/SimpleClientApplyServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/application/core/impls/SimpleClientApplyServiceImpl.java index 52f322a93..994be043e 100644 --- a/src/main/java/au/com/royalpay/payment/manage/application/core/impls/SimpleClientApplyServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/application/core/impls/SimpleClientApplyServiceImpl.java @@ -17,6 +17,7 @@ import org.apache.commons.lang3.RandomStringUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Value; import org.springframework.data.redis.core.StringRedisTemplate; +import org.springframework.stereotype.Service; import org.springframework.util.Assert; import org.thymeleaf.context.Context; import org.thymeleaf.spring4.SpringTemplateEngine; @@ -30,6 +31,7 @@ import java.util.concurrent.TimeUnit; import javax.annotation.PostConstruct; import javax.annotation.Resource; +@Service public class SimpleClientApplyServiceImpl implements SimpleClientApplyService { @Value("${royalpay.sms.appid}") @@ -157,7 +159,7 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService { } } String key = RandomStringUtils.random(10, true, false); - stringRedisTemplate.boundValueOps(getRegisterClientProcessRedisKey(key)).set(address,1,TimeUnit.HOURS); + stringRedisTemplate.boundValueOps(getVerifyMailRedisKey(key)).set(address,1,TimeUnit.HOURS); return key; } diff --git a/src/main/java/au/com/royalpay/payment/manage/application/web/SimpleClientApplyController.java b/src/main/java/au/com/royalpay/payment/manage/application/web/SimpleClientApplyController.java index 2d666d8ce..15736eea2 100644 --- a/src/main/java/au/com/royalpay/payment/manage/application/web/SimpleClientApplyController.java +++ b/src/main/java/au/com/royalpay/payment/manage/application/web/SimpleClientApplyController.java @@ -45,7 +45,7 @@ public class SimpleClientApplyController { @RequestMapping(value = "/account/mail/{address}/verify/{codeKey}/jump", method = RequestMethod.GET) public ModelAndView jumpVerifyMail(@PathVariable String codeKey, @PathVariable String address){ simpleClientApplyService.checkOrGenerateVerifyMailKey(address,codeKey); - ModelAndView view = new ModelAndView("verify_mail"); + ModelAndView view = new ModelAndView("mail/register_application"); view.addObject("codeKey", codeKey); view.addObject("address", address); return view; @@ -61,4 +61,5 @@ public class SimpleClientApplyController { signInAccountService.accountCheck(loginInfo); simpleClientApplyService.deleteVerifyMailKey(codeKey); } + } diff --git a/src/main/resources/templates/mail/register_application.html b/src/main/resources/templates/mail/register_application.html index a3e88d8fd..c0ffe09f0 100644 --- a/src/main/resources/templates/mail/register_application.html +++ b/src/main/resources/templates/mail/register_application.html @@ -19,17 +19,14 @@
Dear Partner,
-Thank you for registering an account with us!
-This is a system verification email from RoyalPay. RoyalPay is an exciting platform that makes international payments as easy as local ones. - To get started, click on the button below:
+Before you can use RoyalPay Cross-border Payment, you need to verify your email address.
- Register your account right now! + |
Once you're ready ro start integrating RoyalPay, we recommend taking a look at our + docs +
if you have any question please contact us
+ Email: info@royalpay.com.au