|
|
|
@ -10,6 +10,7 @@ import com.dky.utils.result.ResponseUtil; |
|
|
|
|
|
|
|
|
|
import java.lang.reflect.InvocationTargetException; |
|
|
|
|
import java.lang.reflect.Method; |
|
|
|
|
import java.text.ParseException; |
|
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
|
import java.time.LocalDateTime; |
|
|
|
|
import java.time.format.DateTimeFormatter; |
|
|
|
@ -89,19 +90,25 @@ public class ModelTool { |
|
|
|
|
//创建表日期
|
|
|
|
|
Date createTimeDate = null; |
|
|
|
|
try{ |
|
|
|
|
// 假设 table.get("CREATE_TIME") 返回的是 LocalDateTime 对象
|
|
|
|
|
LocalDateTime createTimeDateTime = (LocalDateTime) table.get("CREATE_TIME"); |
|
|
|
|
// 将 LocalDateTime 转换为字符串
|
|
|
|
|
createTimeDate = formatter.parse(createTimeDateTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); |
|
|
|
|
} catch (NullPointerException e){ |
|
|
|
|
//处理查询出的类型是String
|
|
|
|
|
String createTimeDateStr = (String) table.get("CREATE_TIME"); |
|
|
|
|
createTimeDate = formatter.parse(createTimeDateStr); |
|
|
|
|
} catch (ParseException e){ |
|
|
|
|
try{ |
|
|
|
|
// 假设 table.get("CREATE_TIME") 返回的是 LocalDateTime 对象
|
|
|
|
|
LocalDateTime createTimeDateTime = (LocalDateTime) table.get("create_time"); |
|
|
|
|
LocalDateTime createTimeDateTime = (LocalDateTime) table.get("CREATE_TIME"); |
|
|
|
|
// 将 LocalDateTime 转换为字符串
|
|
|
|
|
createTimeDate = formatter.parse(createTimeDateTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); |
|
|
|
|
} catch (NullPointerException e1){ |
|
|
|
|
e1.printStackTrace(); |
|
|
|
|
return ResponseUtil.createResponse(Code.KEY_UNAUTHORIZED.getCode(), Code.KEY_UNAUTHORIZED.getDesc(), null); |
|
|
|
|
} catch (NullPointerException e2){ |
|
|
|
|
try{ |
|
|
|
|
// 假设 table.get("CREATE_TIME") 返回的是 LocalDateTime 对象
|
|
|
|
|
LocalDateTime createTimeDateTime = (LocalDateTime) table.get("create_time"); |
|
|
|
|
// 将 LocalDateTime 转换为字符串
|
|
|
|
|
createTimeDate = formatter.parse(createTimeDateTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); |
|
|
|
|
} catch (NullPointerException e1){ |
|
|
|
|
e1.printStackTrace(); |
|
|
|
|
return ResponseUtil.createResponse(Code.KEY_UNAUTHORIZED.getCode(), Code.KEY_UNAUTHORIZED.getDesc(), null); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
//key中验证日期
|
|
|
|
|