0a952e01a2b4b99f8e4fb8a18d0400e7287ddb89.svn-base 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. package org.jeecg.common.util;
  2. import org.apache.commons.lang3.StringUtils;
  3. public enum DySmsEnum {
  4. LOGIN_TEMPLATE_CODE("SMS_175435174","JEECG","code"),
  5. FORGET_PASSWORD_TEMPLATE_CODE("SMS_175435174","JEECG","code"),
  6. REGISTER_TEMPLATE_CODE("SMS_175430166","JEECG","code"),
  7. /**会议通知*/
  8. MEET_NOTICE_TEMPLATE_CODE("SMS_201480469","H5活动之家","username,title,minute,time"),
  9. /**我的计划通知*/
  10. PLAN_NOTICE_TEMPLATE_CODE("SMS_201470515","H5活动之家","username,title,time");
  11. /**
  12. * 短信模板编码
  13. */
  14. private String templateCode;
  15. /**
  16. * 签名
  17. */
  18. private String signName;
  19. /**
  20. * 短信模板必需的数据名称,多个key以逗号分隔,此处配置作为校验
  21. */
  22. private String keys;
  23. private DySmsEnum(String templateCode,String signName,String keys) {
  24. this.templateCode = templateCode;
  25. this.signName = signName;
  26. this.keys = keys;
  27. }
  28. public String getTemplateCode() {
  29. return templateCode;
  30. }
  31. public void setTemplateCode(String templateCode) {
  32. this.templateCode = templateCode;
  33. }
  34. public String getSignName() {
  35. return signName;
  36. }
  37. public void setSignName(String signName) {
  38. this.signName = signName;
  39. }
  40. public String getKeys() {
  41. return keys;
  42. }
  43. public void setKeys(String keys) {
  44. this.keys = keys;
  45. }
  46. public static DySmsEnum toEnum(String templateCode) {
  47. if(StringUtils.isEmpty(templateCode)){
  48. return null;
  49. }
  50. for(DySmsEnum item : DySmsEnum.values()) {
  51. if(item.getTemplateCode().equals(templateCode)) {
  52. return item;
  53. }
  54. }
  55. return null;
  56. }
  57. }