src.dualinventive.com/dinet/libdipp/include/di/rpc/class/Project.h

71 lines
1.7 KiB
C++

#ifndef INCLUDE_DI_RPC_CLASS_PROJECT_H_
#define INCLUDE_DI_RPC_CLASS_PROJECT_H_
#include <vector>
#include <string>
#include <di/types.h>
#include <di/rpc/Msg.h>
namespace Di {
namespace Rpc {
class Project : public Msg {
public:
struct Device {
std::string deviceUid;
std::string role;
uint32_t groupId;
std::shared_ptr<Json> option;
};
struct User {
uint32_t userId;
uint64_t from;
uint64_t to;
};
struct Group {
uint32_t groupId;
std::string name;
std::vector<struct User> operators;
};
struct RoleAction {
std::string name;
std::vector<uint32_t> users;
};
struct Role {
std::string name;
std::vector<struct RoleAction> actions;
};
std::string type;
std::vector<struct Role> projectRoles;
std::vector<struct Device> projectPlanningDevices;
std::vector<struct Group> projectPlanningGroups;
std::vector<struct Device> projectDesignDevices;
uint8_t waSelection;
std::vector<struct Device> projectDevices;
std::vector<uint32_t> projectGroups;
explicit Project(std::shared_ptr<Msg> msg);
private:
void __decodeRequest(const std::shared_ptr<Json> &message);
void __decodeSetup(const std::shared_ptr<Json> &message);
void __decodePlanning(const std::shared_ptr<Json> &message);
void __decodeDesign(const std::shared_ptr<Json> &message);
struct Role __decodeRole(std::string name, const std::shared_ptr<Json> &actions);
struct RoleAction __decodeRoleAction(std::string name, const std::shared_ptr<Json> &users);
struct Device __decodeDevice(const std::shared_ptr<Json> &message);
struct Group __decodeGroup(const std::shared_ptr<Json> &message);
struct User __decodeUser(const std::shared_ptr<Json> &message);
};
} // namespace Rpc
} // namespace Di
#endif // INCLUDE_DI_RPC_CLASS_PROJECT_H_