|
@@ -11,6 +11,7 @@ import com.gccloud.dataroom.core.module.manage.service.IDataRoomPagePreviewServi
|
|
import com.gccloud.dataroom.core.utils.CodeGenerateUtils;
|
|
import com.gccloud.dataroom.core.utils.CodeGenerateUtils;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
+import java.util.Date;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -21,9 +22,6 @@ import java.util.List;
|
|
@Service
|
|
@Service
|
|
public class DataRoomPagePreviewServiceImpl extends ServiceImpl<DataRoomPagePreviewDao, PagePreviewEntity> implements IDataRoomPagePreviewService {
|
|
public class DataRoomPagePreviewServiceImpl extends ServiceImpl<DataRoomPagePreviewDao, PagePreviewEntity> implements IDataRoomPagePreviewService {
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
@Override
|
|
@Override
|
|
public String add(DataRoomPageDTO bigScreenPageDTO) {
|
|
public String add(DataRoomPageDTO bigScreenPageDTO) {
|
|
String code = CodeGenerateUtils.generate(PREVIEW_KEY);
|
|
String code = CodeGenerateUtils.generate(PREVIEW_KEY);
|
|
@@ -43,4 +41,14 @@ public class DataRoomPagePreviewServiceImpl extends ServiceImpl<DataRoomPagePrev
|
|
}
|
|
}
|
|
return list.get(0);
|
|
return list.get(0);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void clear() {
|
|
|
|
+ // 清除创建时间超过一天的预览数据
|
|
|
|
+ Date date = new Date();
|
|
|
|
+ date.setTime(date.getTime() - 24 * 60 * 60 * 1000);
|
|
|
|
+ LambdaQueryWrapper<PagePreviewEntity> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
|
+ queryWrapper.le(PagePreviewEntity::getCreateDate, date);
|
|
|
|
+ this.delete(queryWrapper);
|
|
|
|
+ }
|
|
}
|
|
}
|