Try to add UserSystem

This commit is contained in:
TheJoKlLa 2021-02-03 19:06:14 +01:00
parent f2783c7f6e
commit 25ea9ed97a
5 changed files with 74 additions and 7 deletions

21
card.capnp Normal file
View File

@ -0,0 +1,21 @@
@0x849f99d8777df6e8;
using Rust = import "programming_language/rust.capnp";
$Rust.parentModule("schema");
using CSharp = import "programming_language/csharp.capnp";
$CSharp.namespace("FabAccessAPI.Schema");
struct Card {
enum CardType {
NXPMifareDESFire_ev2 @0;
}
id @0 :General.UUID;
type @1 :CardType;
manage @2 :Manage;
interface Manage $CSharp.name("ManageInterface") {
}
}

11
cardsystem.capnp Normal file
View File

@ -0,0 +1,11 @@
@0x8c0fcfd5c37fedc5;
using Rust = import "programming_language/rust.capnp";
$Rust.parentModule("schema");
using CSharp = import "programming_language/csharp.capnp";
$CSharp.namespace("FabAccessAPI.Schema");
interface CardSystem {
}

View File

@ -51,9 +51,9 @@ struct Machine {
use @1 :Use;
interface Use $CSharp.name("UseInterface") {
use @0 () -> ();
use @0 ();
reserve @1 () -> ();
reserve @1 ();
reserveto @2 (start :UInt64, end :UInt64);
}
@ -81,7 +81,15 @@ struct Machine {
manage @5 :Manage;
interface Manage $CSharp.name("ManageInterface") {
setProperty @0 (property :General.KeyValuePair);
removeProperty @1(property :General.KeyValuePair);
removeProperty @1 (property :General.KeyValuePair);
forceUse @2 ();
forceFree @3 ();
forceTransfer @4 (user :User);
block @5 ();
disabled @6 ();
}
admin @6 :Admin;
@ -91,6 +99,6 @@ struct Machine {
getAdminPropertyList @2 () -> (propertyList :List(General.KeyValuePair));
setAdminProperty @3 (property :General.KeyValuePair);
removeAdminProperty @4(property :General.KeyValuePair);
removeAdminProperty @4 (property :General.KeyValuePair);
}
}

View File

@ -12,7 +12,17 @@ using Space = import "space.capnp".Space;
interface MachineSystem
{
listMachines @0 () -> ( machines :List(Machine) );
info @0 :Info;
interface Info $CSharp.name("InfoInterface") {
getMachineList @0 () -> ( machines :List(Machine) );
getMachine @1 ( uuid :General.UUID ) -> ( machine :Machine);
getMachine @1 ( uuid :General.UUID ) -> ( machine :Machine);
}
manage @1 :Manage;
interface Manage $CSharp.name("ManageInterface") {
addMachine @0 (machine :Machine);
updateMachine @1 (machine :Machine);
removeMachine @2 (machine :Machine);
}
}

View File

@ -6,7 +6,24 @@ $Rust.parentModule("schema");
using CSharp = import "programming_language/csharp.capnp";
$CSharp.namespace("FabAccessAPI.Schema");
using General = import "general.capnp";
using User = import "user.capnp".User;
interface UserSystem
{
info @0 :Info;
interface Info $CSharp.name("InfoInterface") {
getUserSelf @1 ( ) -> ( user :User);
}
manage @1 :Manage;
interface Manage $CSharp.name("ManageInterface") {
getUserList @0 () -> ( user :List(User) );
getMachine @1 ( uuid :General.UUID ) -> ( user :User);
addUser @2 (user :User);
updateUser @3 (user :User);
removeUser @4 (user :User);
}
}