You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
package CheckHandler
import (
"dsBaseWeb/Utils/CommonUtil"
"github.com/gin-gonic/gin"
)
/**
功能:检查字符串是否是日期格式
作者:黄海
时间: 2020-03-17
*/
func datetimeLimitIsLegal ( c * gin . Context , interName string , n int ) ( bool , ResultStruct ) {
//1、调用通用检查器
success , resultStruct , httpType , arr := commonIsLegal ( c , interName , n )
if ! success {
return success , resultStruct
}
//2、如果通过了常规检查, 那么进行业务专用检查
for i := 0 ; i < len ( arr ) ; i ++ {
paraStruct := arr [ i ]
//是否合法时间格式
if ! CommonUtil . IsDate ( paraStruct . inputParameterValue ) {
resultStruct . HttpType = httpType
resultStruct . Message = "不是合法的时间格式!"
return false , resultStruct
}
}
return true , resultStruct
}