*/
@Override
public Integer timestampValidDate (Long timestamp){
String timestampTmp = timestamp.toString();
//timestamp精确到秒,长度是10位
if(timestampTmp.length() != 10){
logger.error("ERROR->CommonServiceImpl-->timestampValidDate|ERROR = timestamp length error|param:timestamp = "+timestamp);
return ConstantConfig.TIMESTAMP_VALIDDATE_FORMAT_ERROR;
}
Long nowTimestamp = System.currentTimeMillis()/1000;
Long startTimestamp = nowTimestamp - 300;
Long endTimestamp = nowTimestamp + 300;
if(startTimestamp == null || endTimestamp == null){
logger.error("ERROR->CommonServiceImpl-->timestampValidDate|ERROR = startTimestamp or endTimestamp is null|"
+"param:"+"startTimestamp="+startTimestamp+"|endTimestamp="+endTimestamp);
return ConstantConfig.TIMESTAMP_VALIDDATE_SYSTEM_ERROR;
}
if(timestamp > startTimestamp && timestamp < endTimestamp){
return ConstantConfig.TIMESTAMP_VALIDDATE_SUCCESS;
}
return ConstantConfig.TIMESTAMP_VALIDDATE_TIME_OUT;
}