Package io.springboot.sms.kit
Class Utils
java.lang.Object
io.springboot.sms.kit.Utils
工具类,内部使用.
- Author:
- cn-src
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcheckNotEmpty(String str, String message) 校验字符串不为空.voidcheckNotEmpty(Collection coll, String message) 校验集合不为空.voidcheckPhoneNumber(String... phoneNumbers) 校验手机号码(中国).voidcheckSmsResponse(com.aliyuncs.CommonResponse response) 校验 SendSmsResponse 状态.voidcheckSmsTemplate(SmsTemplate template) 校验 SmsTemplate.int生成随机验证码.Map 转 json 字符串的简单实现.
-
Field Details
-
SUCCESS_CODE
- See Also:
-
PHONE_NUMBER_REGEX
宽松校验即可.- See Also:
-
-
Constructor Details
-
Utils
public Utils()
-
-
Method Details
-
randomCode
public int randomCode()生成随机验证码.- Returns:
- 随机数
-
toJsonStr
Map 转 json 字符串的简单实现.- Parameters:
map- the map- Returns:
- the json string
-
checkSmsTemplate
校验 SmsTemplate.- Parameters:
template- the SmsTemplate
-
checkSmsResponse
public void checkSmsResponse(com.aliyuncs.CommonResponse response) 校验 SendSmsResponse 状态.- Parameters:
response- the SendSmsResponse
-
checkPhoneNumber
校验手机号码(中国).- Parameters:
phoneNumbers- the phone numbers
-
checkNotEmpty
校验字符串不为空.- Parameters:
str- the strmessage- the message
-
checkNotEmpty
校验集合不为空.- Parameters:
coll- the Collectionmessage- the message
-