mirror of
https://github.com/dataease/dataease.git
synced 2025-02-24 11:32:57 +08:00
Merge pull request #13508 from dataease/pr@dev-v2@perf_community
perf(X-Pack): 官方社区版仅展示游离资源
This commit is contained in:
commit
87a7a1b8bb
@ -222,14 +222,17 @@ public class DatasetGroupManage {
|
||||
}
|
||||
|
||||
|
||||
@XpackInteract(value = "authResourceTree", replace = true)
|
||||
@XpackInteract(value = "authResourceTree", replace = true, invalid = true)
|
||||
public List<BusiNodeVO> tree(BusiNodeRequest request) {
|
||||
|
||||
QueryWrapper<Object> queryWrapper = new QueryWrapper<>();
|
||||
if (ObjectUtils.isNotEmpty(request.getLeaf())) {
|
||||
queryWrapper.eq("node_type", request.getLeaf() ? "dataset" : "folder");
|
||||
}
|
||||
|
||||
String info = CommunityUtils.getInfo();
|
||||
if (StringUtils.isNotBlank(info)) {
|
||||
queryWrapper.notExists(String.format(info, "core_dataset_group.id"));
|
||||
}
|
||||
queryWrapper.orderByDesc("create_time");
|
||||
List<DataSetNodePO> pos = coreDataSetExtMapper.query(queryWrapper);
|
||||
List<DataSetNodeBO> nodes = new ArrayList<>();
|
||||
|
@ -19,6 +19,7 @@ import io.dataease.model.BusiNodeVO;
|
||||
import io.dataease.operation.manage.CoreOptRecentManage;
|
||||
import io.dataease.utils.AuthUtils;
|
||||
import io.dataease.utils.BeanUtils;
|
||||
import io.dataease.utils.CommunityUtils;
|
||||
import io.dataease.utils.TreeUtils;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
@ -56,13 +57,17 @@ public class DataSourceManage {
|
||||
return new DatasourceNodeBO(po.getId(), po.getName(), !StringUtils.equals(po.getType(), "folder"), 7, po.getPid(), extraFlag, dataSourceType.name());
|
||||
}
|
||||
|
||||
@XpackInteract(value = "datasourceResourceTree", replace = true)
|
||||
@XpackInteract(value = "datasourceResourceTree", replace = true, invalid = true)
|
||||
public List<BusiNodeVO> tree(BusiNodeRequest request) {
|
||||
|
||||
QueryWrapper<DataSourceNodePO> queryWrapper = new QueryWrapper<>();
|
||||
if (ObjectUtils.isNotEmpty(request.getLeaf()) && !request.getLeaf()) {
|
||||
queryWrapper.eq("type", "folder");
|
||||
}
|
||||
String info = CommunityUtils.getInfo();
|
||||
if (StringUtils.isNotBlank(info)) {
|
||||
queryWrapper.notExists(String.format(info, "core_datasource.id"));
|
||||
}
|
||||
queryWrapper.orderByDesc("create_time");
|
||||
List<DatasourceNodeBO> nodes = new ArrayList<>();
|
||||
List<DataSourceNodePO> pos = dataSourceExtMapper.selectList(queryWrapper);
|
||||
|
@ -166,6 +166,10 @@ public class XpackShareManage {
|
||||
if (StringUtils.isNotBlank(request.getKeyword())) {
|
||||
queryWrapper.like("v.name", request.getKeyword());
|
||||
}
|
||||
String info = CommunityUtils.getInfo();
|
||||
if (StringUtils.isNotBlank(info)) {
|
||||
queryWrapper.notExists(String.format(info, "s.resource_id"));
|
||||
}
|
||||
queryWrapper.orderBy(true, request.isAsc(), "s.time");
|
||||
Page<XpackSharePO> page = new Page<>(goPage, pageSize);
|
||||
return xpackShareExtMapper.query(page, queryWrapper);
|
||||
@ -179,7 +183,7 @@ public class XpackShareManage {
|
||||
};
|
||||
}
|
||||
|
||||
@XpackInteract(value = "perFilterShareManage", recursion = true)
|
||||
@XpackInteract(value = "perFilterShareManage", recursion = true, invalid = true)
|
||||
public IPage<XpackShareGridVO> query(int pageNum, int pageSize, VisualizationWorkbranchQueryRequest request) {
|
||||
IPage<XpackSharePO> poiPage = proxy().querySharePage(pageNum, pageSize, request);
|
||||
List<XpackShareGridVO> vos = proxy().formatResult(poiPage.getRecords());
|
||||
|
@ -48,7 +48,7 @@ public class CoreVisualizationManage {
|
||||
@Resource
|
||||
private CoreOptRecentManage coreOptRecentManage;
|
||||
|
||||
@XpackInteract(value = "visualizationResourceTree", replace = true)
|
||||
@XpackInteract(value = "visualizationResourceTree", replace = true, invalid = true)
|
||||
public List<BusiNodeVO> tree(BusiNodeRequest request) {
|
||||
List<VisualizationNodeBO> nodes = new ArrayList<>();
|
||||
if (ObjectUtils.isEmpty(request.getLeaf()) || !request.getLeaf()) {
|
||||
@ -59,6 +59,10 @@ public class CoreVisualizationManage {
|
||||
queryWrapper.ne("pid", -1);
|
||||
queryWrapper.eq(ObjectUtils.isNotEmpty(request.getLeaf()), "node_type", ObjectUtils.isNotEmpty(request.getLeaf()) && request.getLeaf() ? "leaf" : "folder");
|
||||
queryWrapper.eq("type", request.getBusiFlag());
|
||||
String info = CommunityUtils.getInfo();
|
||||
if (StringUtils.isNotBlank(info)) {
|
||||
queryWrapper.notExists(String.format(info, "data_visualization_info.id"));
|
||||
}
|
||||
queryWrapper.orderByDesc("create_time");
|
||||
List<VisualizationNodePO> pos = extMapper.queryNodes(queryWrapper);
|
||||
if (CollectionUtils.isNotEmpty(pos)) {
|
||||
@ -158,7 +162,7 @@ public class CoreVisualizationManage {
|
||||
return CommonBeanFactory.getBean(this.getClass());
|
||||
}
|
||||
|
||||
@XpackInteract(value = "perFilterManage", recursion = true)
|
||||
@XpackInteract(value = "perFilterManage", recursion = true, invalid = true)
|
||||
public IPage<VisualizationResourceVO> query(int pageNum, int pageSize, VisualizationWorkbranchQueryRequest request) {
|
||||
IPage<VisualizationResourcePO> visualizationResourcePOPageIPage = proxy().queryVisualizationPage(pageNum, pageSize, request);
|
||||
if (ObjectUtils.isEmpty(visualizationResourcePOPageIPage)) {
|
||||
@ -182,7 +186,7 @@ public class CoreVisualizationManage {
|
||||
new VisualizationResourceVO(
|
||||
po.getId(), po.getResourceId(), po.getName(),
|
||||
po.getType(), String.valueOf(po.getCreator()), String.valueOf(po.getLastEditor()), po.getLastEditTime(),
|
||||
po.getFavorite(), 9,po.getExtFlag())).toList();
|
||||
po.getFavorite(), 9, po.getExtFlag())).toList();
|
||||
}
|
||||
|
||||
public IPage<VisualizationResourcePO> queryVisualizationPage(int goPage, int pageSize, VisualizationWorkbranchQueryRequest request) {
|
||||
@ -198,6 +202,10 @@ public class CoreVisualizationManage {
|
||||
if (StringUtils.isNotBlank(request.getKeyword())) {
|
||||
queryWrapper.like("dvResource.name", request.getKeyword());
|
||||
}
|
||||
String info = CommunityUtils.getInfo();
|
||||
if (StringUtils.isNotBlank(info)) {
|
||||
queryWrapper.notExists(String.format(info, "core_opt_recent.resource_id"));
|
||||
}
|
||||
queryWrapper.orderBy(true, request.isAsc(), "core_opt_recent.time");
|
||||
Page<VisualizationResourcePO> page = new Page<>(goPage, pageSize);
|
||||
return extDataVisualizationMapper.findRecent(page, uid, queryWrapper);
|
||||
|
@ -11,6 +11,7 @@ import io.dataease.exception.DEException;
|
||||
import io.dataease.license.config.XpackInteract;
|
||||
import io.dataease.utils.AuthUtils;
|
||||
import io.dataease.utils.CommonBeanFactory;
|
||||
import io.dataease.utils.CommunityUtils;
|
||||
import io.dataease.utils.IDUtils;
|
||||
import io.dataease.visualization.dao.auto.entity.CoreStore;
|
||||
import io.dataease.visualization.dao.auto.mapper.CoreStoreMapper;
|
||||
@ -65,7 +66,7 @@ public class VisualizationStoreManage {
|
||||
return coreStoreMapper.exists(queryWrapper);
|
||||
}
|
||||
|
||||
@XpackInteract(value = "perFilterManage", recursion = true)
|
||||
@XpackInteract(value = "perFilterManage", recursion = true, invalid = true)
|
||||
public IPage<VisualizationStoreVO> query(int pageNum, int pageSize, VisualizationWorkbranchQueryRequest request) {
|
||||
IPage<StorePO> storePOIPage = proxy().queryStorePage(pageNum, pageSize, request);
|
||||
if (ObjectUtils.isEmpty(storePOIPage)) return null;
|
||||
@ -89,7 +90,7 @@ public class VisualizationStoreManage {
|
||||
new VisualizationStoreVO(
|
||||
po.getStoreId(), po.getResourceId(), po.getName(),
|
||||
po.getType(), String.valueOf(po.getCreator()), ObjectUtils.isEmpty(po.getEditor()) ? null : String.valueOf(po.getEditor()),
|
||||
po.getEditTime(), 9,po.getExtFlag())).toList();
|
||||
po.getEditTime(), 9, po.getExtFlag())).toList();
|
||||
}
|
||||
|
||||
public IPage<StorePO> queryStorePage(int goPage, int pageSize, VisualizationWorkbranchQueryRequest request) {
|
||||
@ -106,6 +107,10 @@ public class VisualizationStoreManage {
|
||||
if (StringUtils.isNotBlank(request.getKeyword())) {
|
||||
queryWrapper.like("v.name", request.getKeyword());
|
||||
}
|
||||
String info = CommunityUtils.getInfo();
|
||||
if (StringUtils.isNotBlank(info)) {
|
||||
queryWrapper.notExists(String.format(info, "s.resource_id"));
|
||||
}
|
||||
queryWrapper.orderBy(true, request.isAsc(), "v.update_time");
|
||||
Page<StorePO> page = new Page<>(goPage, pageSize);
|
||||
return coreStoreExtMapper.query(page, queryWrapper);
|
||||
|
2
de-xpack
2
de-xpack
@ -1 +1 @@
|
||||
Subproject commit 282f497c1f7c79e1db8c6b300d3f13ffe205a38d
|
||||
Subproject commit 1a9dd92832707a6b07bd879aef3a0882e0db8ea7
|
@ -0,0 +1,28 @@
|
||||
package io.dataease.api.free;
|
||||
|
||||
import io.dataease.api.free.dto.FreeBatchSyncRequest;
|
||||
import io.dataease.api.free.dto.FreeQueryRequest;
|
||||
import io.dataease.api.free.dto.FreeSyncRequest;
|
||||
import io.dataease.api.free.vo.FreeVO;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface FreeApi {
|
||||
|
||||
@PostMapping("/query")
|
||||
List<FreeVO> query(@RequestBody FreeQueryRequest request);
|
||||
|
||||
@PostMapping("/syncAll")
|
||||
void syncAll(@RequestBody FreeSyncRequest request);
|
||||
|
||||
@PostMapping("/deleteAll")
|
||||
void deleteAll();
|
||||
|
||||
@PostMapping("/syncBatch")
|
||||
void syncBatch(@RequestBody FreeBatchSyncRequest request);
|
||||
|
||||
@PostMapping("/deleteBatch")
|
||||
void deleteBatch(@RequestBody FreeBatchSyncRequest request);
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package io.dataease.api.free.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class FreeBatchDelRequest implements Serializable {
|
||||
@Serial
|
||||
private static final long serialVersionUID = -296464652281011661L;
|
||||
|
||||
private List<Long> idList;
|
||||
|
||||
private int rtId;
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package io.dataease.api.free.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.util.List;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class FreeBatchSyncRequest extends FreeSyncRequest {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 7068735824164921251L;
|
||||
|
||||
private List<Long> idList;
|
||||
|
||||
private int rtId;
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package io.dataease.api.free.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class FreeQueryRequest implements Serializable {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 7951259501228286914L;
|
||||
|
||||
private int rtId;
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package io.dataease.api.free.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class FreeSyncRequest implements Serializable {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 4845269683316801334L;
|
||||
|
||||
private Long oid;
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package io.dataease.api.free.vo;
|
||||
|
||||
import io.dataease.model.TreeResultModel;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class FreeVO implements Serializable, TreeResultModel<FreeVO> {
|
||||
@Serial
|
||||
private static final long serialVersionUID = -7055936995493939929L;
|
||||
|
||||
private Long id;
|
||||
|
||||
private Long pid;
|
||||
|
||||
private String name;
|
||||
|
||||
private boolean leaf;
|
||||
|
||||
private Long createTime;
|
||||
|
||||
private int rtId;
|
||||
|
||||
private int extraFlag;
|
||||
|
||||
private List<FreeVO> children;
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package io.dataease.utils;
|
||||
|
||||
public class CommunityUtils {
|
||||
|
||||
|
||||
private static final ThreadLocal<String> COMMUNITY_INFO = new ThreadLocal<>();
|
||||
|
||||
public static void setInfo(String info) {
|
||||
COMMUNITY_INFO.set(info);
|
||||
}
|
||||
|
||||
public static String getInfo() {
|
||||
return COMMUNITY_INFO.get();
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user