ValidateTelComponent.java 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. package com.java110.web.components;
  2. import com.java110.core.context.IPageData;
  3. import com.java110.web.smo.IRegisterServiceSMO;
  4. import org.springframework.beans.factory.annotation.Autowired;
  5. import org.springframework.http.HttpStatus;
  6. import org.springframework.http.ResponseEntity;
  7. import org.springframework.stereotype.Component;
  8. /**
  9. * 手机验证码校验组件
  10. * Created by wuxw on 2019/3/23.
  11. */
  12. @Component("validate-tel")
  13. public class ValidateTelComponent {
  14. @Autowired
  15. IRegisterServiceSMO registerServiceSMOImpl;
  16. /**
  17. * 手机发送验证码
  18. * @param pd
  19. * @return
  20. */
  21. public ResponseEntity<String> sendTelMessageCode(IPageData pd){
  22. ResponseEntity<String> responseEntity = null;
  23. try{
  24. responseEntity = registerServiceSMOImpl.sendTelMessageCode(pd);
  25. }catch (Exception e){
  26. responseEntity = new ResponseEntity<String>(e.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR);
  27. }finally {
  28. return responseEntity;
  29. }
  30. }
  31. public IRegisterServiceSMO getRegisterServiceSMOImpl() {
  32. return registerServiceSMOImpl;
  33. }
  34. public void setRegisterServiceSMOImpl(IRegisterServiceSMO registerServiceSMOImpl) {
  35. this.registerServiceSMOImpl = registerServiceSMOImpl;
  36. }
  37. }