geopro/src/data/api/ApiProjectRepository.hpp

30 lines
1.4 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#pragma once
#include "repo/IProjectRepository.hpp"
namespace geopro::net { class ApiClient; }
namespace geopro::data {
// 用共享会话 ApiClient 实现导航仓储同步阻塞。token 由调用方注入 ApiClient。
class ApiProjectRepository : public IProjectRepository {
public:
explicit ApiProjectRepository(net::ApiClient& api);
RepoResult<std::vector<Workspace>> listWorkspaces() override;
RepoResult<bool> switchWorkspace(const std::string& tenantId) override;
RepoResult<ProjectListPage> pageProjects(const std::string& nameFilter, const std::string& typeId,
int pageNo, int pageSize) override;
RepoResult<std::vector<ProjectType>> listProjectTypes() override;
RepoResult<std::vector<StructNode>> loadStructure(const std::string& projectId) override;
RepoResult<DsPage> loadRows(const std::string& projectId, const std::string& parentId,
int parentConfType, int classifyType, int pageNo) override;
RepoResult<DynamicForm> loadObjectDetail(const std::string& objectId, int confType) override;
RepoResult<DynamicForm> loadDatasetForm(const std::string& dsObjectId) override;
RepoResult<std::vector<ExceptionRow>> loadExceptionsByTm(const std::string& tmObjectId) override;
private:
net::ApiClient& api_;
};
} // namespace geopro::data