|
@@ -77,4 +77,23 @@ public class MyController extends BaseController {
|
|
|
}
|
|
|
|
|
|
|
|
|
+ /**手动更新redis缓存表数据
|
|
|
+ * @Description
|
|
|
+ * @author tjf
|
|
|
+ * @Date 2021/3/29
|
|
|
+ */
|
|
|
+ public AjaxResult updateRedisTable(){
|
|
|
+ //获取所有的表和表字段,更新到redis中
|
|
|
+ List<GenTable> tableList = genTableService.selectGenTableList(new GenTable());
|
|
|
+ if (null == tableList || tableList.isEmpty()) {
|
|
|
+ return AjaxResult.error("当前没有可更新数据");
|
|
|
+ }
|
|
|
+ List<Long> tableIdList = tableList.stream().map(GenTable::getTableId).collect(Collectors.toList());
|
|
|
+ List<GenTableColumn> genTableColumns = genTableColumnService.listByTableIdList(tableIdList);
|
|
|
+ if (null == genTableColumns || genTableColumns.isEmpty()) {
|
|
|
+ return AjaxResult.error("当前没有可更新数据");
|
|
|
+ }
|
|
|
+ packTableAndInsertToRedis(tableList, genTableColumns);
|
|
|
+ return AjaxResult.success();
|
|
|
+ }
|
|
|
}
|