30 lines
1.4 KiB
C++
30 lines
1.4 KiB
C++
#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
|