31 lines
1.2 KiB
C++
31 lines
1.2 KiB
C++
#pragma once
|
||
#include <vector>
|
||
#include <QJsonArray>
|
||
#include <QJsonObject>
|
||
#include "repo/RepoTypes.hpp"
|
||
|
||
namespace geopro::data::dto {
|
||
|
||
// 工作空间数组(joined/list 的 data["value"])→ 模型。isCurTenant==1 → isCurrent。
|
||
std::vector<Workspace> parseWorkspaces(const QJsonArray& arr);
|
||
|
||
// 项目分页(queryByUser 的 data 对象 {hasNextPage, projectList})→ 模型。
|
||
struct ProjectPage { std::vector<ProjectSummary> projects; bool hasNextPage = false; };
|
||
ProjectPage parseProjects(const QJsonObject& data);
|
||
|
||
// 结构扁平节点数组(queryProjectStruct 的 data["projectStructList"])→ 模型。
|
||
std::vector<StructNode> parseStructNodes(const QJsonArray& arr);
|
||
|
||
// DS 聚合数组(queryDsByTmObjectId 的 data["value"])→ DsNode。ddCode → ddType。
|
||
std::vector<DsNode> parseDatasets(const QJsonArray& arr);
|
||
|
||
// 扁平 StructNode 按 parentId 建树。叶子(无子节点)=TM。处理:项目直挂 TM、孤儿 parentId、空表。
|
||
struct StructTreeNode {
|
||
StructNode node;
|
||
bool isTm = false;
|
||
std::vector<StructTreeNode> children;
|
||
};
|
||
std::vector<StructTreeNode> buildStructTree(const std::vector<StructNode>& flat);
|
||
|
||
} // namespace geopro::data::dto
|