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