Commit 54993a65 authored by yanzg's avatar yanzg

检测时间类型

parent b16fd61a
......@@ -142,7 +142,7 @@ public final class CheckerHelper {
/**
* 检验IP是否合法
*
* @param paramName
* @param paramName 需要检测的名称
* @param paramVal
* @return
*/
......@@ -158,6 +158,14 @@ public final class CheckerHelper {
return this;
}
/**
* 检测是否符合时间类型
*
* @param paramName
* @param paramVal
* @param queryType
* @return
*/
public CheckerHelper notDateCheck(String paramName, String paramVal, String queryType) {
if (!isValid()) {
return this;
......@@ -219,9 +227,10 @@ public final class CheckerHelper {
* @param length
* @return
*/
public CheckerHelper paramLengthCheck(String paramName, String paramVal, int length) {
if (!isValid())
public CheckerHelper checkLength(String paramName, String paramVal, int length) {
if (!isValid()) {
return this;
}
if (!StringHelper.isEmpty(paramVal) && length < paramVal.length()) {
this.checkResult = String.format(PARAM_OVER_MAX_LENGTH, paramName) + length;
this.setValid(false);
......@@ -229,6 +238,17 @@ public final class CheckerHelper {
return this;
}
/**
* 日期字符串
*
* @param paramName 参数名称
* @param paramVal 参数值
* @return
*/
public CheckerHelper checkDate(String paramName, String paramVal) {
return checkDate(paramName, paramVal, StringHelper.EMPTY);
}
/**
* 日期字符串
*
......@@ -237,7 +257,7 @@ public final class CheckerHelper {
* @param formatStr 日期格式
* @return
*/
public CheckerHelper paramDateCheck(String paramName, String paramVal, String formatStr) {
public CheckerHelper checkDate(String paramName, String paramVal, String formatStr) {
if (!isValid()) {
return this;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment