private void downFileLimit(FileDownloadManage fileDownloadManage,
Long limitStartTime, Long limitEndTime) {
Long nowTime = System.currentTimeMillis();
if (limitStartTime != null && limitEndTime != null) {
if (nowTime > limitStartTime && nowTime < limitEndTime) {
fileDownloadManage.setSuccess(1);
}else {
fileDownloadManage.setSuccess(0);
}
}
if (limitStartTime != null && limitEndTime == null) {
if (nowTime > limitStartTime) {
fileDownloadManage.setSuccess(1);
}
}
if (limitEndTime != null && limitStartTime == null) {
if (nowTime < limitEndTime) {
fileDownloadManage.setSuccess(1);
}
}
}
这段代码还能如何优化