rbac is added
This commit is contained in:
parent
85956b6fd9
commit
ea970cd9ad
5
build.rs
5
build.rs
|
@ -35,9 +35,12 @@ static TARGETS: Lazy<HashMap<&str, Vec<&str>>> = Lazy::new(|| {
|
||||||
"models",
|
"models",
|
||||||
vec![
|
vec![
|
||||||
"./proto/models/core/network.proto",
|
"./proto/models/core/network.proto",
|
||||||
|
"./proto/models/domain/site.proto",
|
||||||
|
"./proto/models/rbac/resource.proto",
|
||||||
|
"./proto/models/rbac/resource_action.proto",
|
||||||
|
"./proto/models/rbac/role.proto",
|
||||||
"./proto/models/member/member_class.proto",
|
"./proto/models/member/member_class.proto",
|
||||||
"./proto/models/member/member_level.proto",
|
"./proto/models/member/member_level.proto",
|
||||||
"./proto/models/member/member_site.proto",
|
|
||||||
"./proto/models/member/member.proto",
|
"./proto/models/member/member.proto",
|
||||||
"./proto/models/member/member_session.proto",
|
"./proto/models/member/member_session.proto",
|
||||||
],
|
],
|
||||||
|
|
13
proto/models/domain/site.proto
Normal file
13
proto/models/domain/site.proto
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
syntax = "proto3";
|
||||||
|
|
||||||
|
package bet.beteran.domain;
|
||||||
|
|
||||||
|
message Site {
|
||||||
|
string id = 1;
|
||||||
|
string url = 2;
|
||||||
|
bool show = 3;
|
||||||
|
bool can_use = 4;
|
||||||
|
uint64 created_at = 5;
|
||||||
|
uint64 updated_at = 6;
|
||||||
|
optional uint64 deleted_at = 7;
|
||||||
|
}
|
|
@ -2,9 +2,10 @@ syntax = "proto3";
|
||||||
|
|
||||||
package bet.beteran.member;
|
package bet.beteran.member;
|
||||||
|
|
||||||
|
import "models/domain/site.proto";
|
||||||
|
|
||||||
import "models/member/member_class.proto";
|
import "models/member/member_class.proto";
|
||||||
import "models/member/member_level.proto";
|
import "models/member/member_level.proto";
|
||||||
import "models/member/member_site.proto";
|
|
||||||
|
|
||||||
|
|
||||||
enum MemberState {
|
enum MemberState {
|
||||||
|
@ -19,20 +20,19 @@ enum MemberState {
|
||||||
|
|
||||||
message Member {
|
message Member {
|
||||||
string id = 1;
|
string id = 1;
|
||||||
string domain_id = 2;
|
bet.beteran.domain.Site site = 2;
|
||||||
MemberClass member_class = 3;
|
MemberClass member_class = 3;
|
||||||
MemberLevel member_level = 4;
|
MemberLevel member_level = 4;
|
||||||
MemberSite member_site = 5;
|
optional Member referrer = 5;
|
||||||
optional Member referrer = 6;
|
uint64 referred_count = 6;
|
||||||
uint64 referred_count = 7;
|
string username = 7;
|
||||||
string username = 8;
|
string nickname = 8;
|
||||||
string nickname = 9;
|
optional string mobile_phone_number = 9;
|
||||||
optional string mobile_phone_number = 10;
|
MemberState state = 10;
|
||||||
MemberState state = 11;
|
optional uint64 state_changed_at = 11;
|
||||||
optional uint64 state_changed_at = 12;
|
optional string last_signined_ip = 12;
|
||||||
optional string last_signined_ip = 13;
|
optional uint64 last_signined_at = 13;
|
||||||
optional uint64 last_signined_at = 14;
|
uint64 created_at = 14;
|
||||||
uint64 created_at = 15;
|
uint64 updated_at = 15;
|
||||||
uint64 updated_at = 16;
|
optional uint64 deleted_at = 16;
|
||||||
optional uint64 deleted_at = 17;
|
|
||||||
}
|
}
|
||||||
|
|
0
proto/models/member/member_permission.proto
Normal file
0
proto/models/member/member_permission.proto
Normal file
0
proto/models/member/member_role.proto
Normal file
0
proto/models/member/member_role.proto
Normal file
|
@ -1,11 +0,0 @@
|
||||||
syntax = "proto3";
|
|
||||||
|
|
||||||
package bet.beteran.member;
|
|
||||||
|
|
||||||
message MemberSite {
|
|
||||||
string id = 1;
|
|
||||||
string url = 2;
|
|
||||||
uint64 created_at = 3;
|
|
||||||
uint64 updated_at = 4;
|
|
||||||
optional uint64 deleted_at = 5;
|
|
||||||
}
|
|
14
proto/models/rbac/resource.proto
Normal file
14
proto/models/rbac/resource.proto
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
syntax = "proto3";
|
||||||
|
|
||||||
|
package bet.beteran.rbac;
|
||||||
|
|
||||||
|
message Resource {
|
||||||
|
string id = 1;
|
||||||
|
Resource parent = 2;
|
||||||
|
string name = 3;
|
||||||
|
string key = 4;
|
||||||
|
string description = 5;
|
||||||
|
bool can_use = 6;
|
||||||
|
uint64 created_at = 7;
|
||||||
|
uint64 updated_at = 8;
|
||||||
|
}
|
16
proto/models/rbac/resource_action.proto
Normal file
16
proto/models/rbac/resource_action.proto
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
syntax = "proto3";
|
||||||
|
|
||||||
|
package bet.beteran.rbac;
|
||||||
|
|
||||||
|
import "models/rbac/resource.proto";
|
||||||
|
|
||||||
|
message ResourceAction {
|
||||||
|
string id = 1;
|
||||||
|
Resource resource = 2;
|
||||||
|
string name = 3;
|
||||||
|
string key = 4;
|
||||||
|
string description = 5;
|
||||||
|
bool can_use = 6;
|
||||||
|
uint64 created_at = 7;
|
||||||
|
uint64 updated_at = 8;
|
||||||
|
}
|
16
proto/models/rbac/role.proto
Normal file
16
proto/models/rbac/role.proto
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
syntax = "proto3";
|
||||||
|
|
||||||
|
package bet.beteran.rbac;
|
||||||
|
|
||||||
|
import "models/rbac/resource.proto";
|
||||||
|
|
||||||
|
message Role {
|
||||||
|
string id = 1;
|
||||||
|
Role parent = 2;
|
||||||
|
string name = 3;
|
||||||
|
string key = 4;
|
||||||
|
string description = 5;
|
||||||
|
bool can_use = 6;
|
||||||
|
uint64 created_at = 7;
|
||||||
|
uint64 updated_at = 8;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user