Class Utils

java.lang.Object
io.springboot.sms.kit.Utils

public class Utils extends Object
工具类,内部使用.
Author:
cn-src
  • Field Details

  • Constructor Details

    • Utils

      public Utils()
  • Method Details

    • randomCode

      public int randomCode()
      生成随机验证码.
      Returns:
      随机数
    • toJsonStr

      public String toJsonStr(Map<String,String> map)
      Map 转 json 字符串的简单实现.
      Parameters:
      map - the map
      Returns:
      the json string
    • checkSmsTemplate

      public void checkSmsTemplate(SmsTemplate template)
      校验 SmsTemplate.
      Parameters:
      template - the SmsTemplate
    • checkSmsResponse

      public void checkSmsResponse(com.aliyuncs.CommonResponse response)
      校验 SendSmsResponse 状态.
      Parameters:
      response - the SendSmsResponse
    • checkPhoneNumber

      public void checkPhoneNumber(String... phoneNumbers)
      校验手机号码(中国).
      Parameters:
      phoneNumbers - the phone numbers
    • checkNotEmpty

      public void checkNotEmpty(String str, String message)
      校验字符串不为空.
      Parameters:
      str - the str
      message - the message
    • checkNotEmpty

      public void checkNotEmpty(Collection coll, String message)
      校验集合不为空.
      Parameters:
      coll - the Collection
      message - the message