syntax = "proto3"; // package声明符,用来防止不同的消息类型有命名冲突 package pb_v1; // 用于生成指定语言go的包名称 option go_package = "cp-organization-management/pb/v1"; message InitOrganizationDbRequest{ string organization_code = 1; } message InitOrganizationDbReply{ } message RbacNode { int64 id = 1; string name =2; string router=3; string method=4; string resource=5; string object=6; int64 pid=7; bool is_super = 8; } message CreateManagementUserRequest{ string organization_code = 1; string username = 2; string password = 3; string phone = 4; string email = 5; repeated RbacNode rbac_node_list=6; bool is_supper_user = 7; int64 group_id = 8; string zones = 9; string name = 10; int64 uid = 11; } message CreateManagementUserReply{ int64 uid = 1; } message ManagementSuperUserItem { string organization_code = 1; string username = 2; string phone = 3; string email = 4; int64 id = 5; string created_at = 6; } // 供系统端调用 message ManagementSuperUserListRequest { int64 page = 1; int64 page_size = 2; string organization_code = 3; } message ManagementSuperUserListReply { int64 total = 1; int64 page = 2; repeated ManagementSuperUserItem list = 3; } message ManagementSuperUserUpdateRequest { string organization_code = 1; string username = 2; string phone = 3; string email = 4; int64 id = 5; string password = 6; } message ManagementSuperUserUpdateReply { ManagementSuperUserUpdateRequest origin = 1; } message ManagementSuperUserResetPasswordRequest { string organization_code = 1; int64 id = 2; string password = 3; } message ManagementSuperUserResetPasswordReply { } message ManagementLoginRequest { string key = 1; string username = 2; string password = 3; } message ManagementLoginReply { int64 uid = 1; string organization_code = 2; int64 end_time = 3; string organization_name = 4; repeated string permissions = 5; bool is_super = 6; } //-----------------------------------角色相关---------------------------- // 所有节点列表 message RbacNodeListRequest { string organization_code = 1; bool is_all = 2; } message RbacNodeItem { int64 id = 1; int64 pid = 2; string name = 3; string method = 4; string resource = 5; string object = 6; string router = 7; bool select = 8; repeated RbacNodeItem childs = 9; } message RbacNodeListReply { repeated RbacNodeItem list = 1; } // 所有角色列表 message RbacGroupItem { string name = 1; int64 id = 2; } message RbacGroupListRequest { string organization_code = 1; bool is_super = 2; } message RbacGroupListReply { repeated RbacGroupItem list = 1; } // 添加角色 message RbacGroupAddRequest { string name = 1; string node_list = 2; string organization_code = 3; int64 uid = 4; } message RbacGroupAddReply { int64 id = 1; } // 更新角色 是否super message RbacGroupUpdateRequest { string organization_code = 1; int64 id = 2; string name = 3; string node_list = 4; int64 uid = 5; } message RbacGroupUpdateReply { RbacGroupUpdateRequest origin = 1; } // 删除角色 1.判断是否已绑定角色 2 是否super message RbacGroupDelRequest { string organization_code = 1; int64 id = 2; int64 uid = 3; } message RbacGroupDelReply { RbacGroupUpdateRequest origin = 1; } // 根据角色或用户获取节点 message RbacNodeListByGroupOrUserRequest { string organization_code = 1; int64 group_id = 2; int64 uid = 3; // 仅返回选中的数据 bool select = 4; } message RbacNodeListByGroupOrUserReply { repeated RbacNodeItem list = 1; } //----------------------------区域相关------------------------------- message ZoneAddRequest { string zone_name = 1; string parent_zone_code = 2; string organization_code = 3; int64 uid = 4; } message ZoneAddReply { string zone_code = 1; } message ZoneDelRequest { string zone_code = 1; string organization_code = 2; int64 uid = 4; } message ZoneData { string zone_code = 1; string zone_name = 2; } message ZoneDelReply { repeated ZoneData zones = 1; } message ZoneUpdateRequest { string zone_code = 1; string organization_code = 2; string zone_name = 3; int64 uid = 4; string parent_zone_code = 5; } message ZoneUpdateReply { ZoneUpdateRequest origin = 1; ZoneUpdateRequest target = 2; } message ZoneItem { string zone_code = 1; string parent_zone_code = 2; string zone_name = 3; repeated ZoneItem childs = 4; } message ZoneItemSelect { string zone_code = 1; string parent_zone_code = 2; string zone_name = 3; bool select = 4; repeated ZoneItemSelect childs = 5; } message ZoneListRequest { int64 uid = 1; string organization_code = 2; } message ZoneListReply { repeated ZoneItem list = 1; } //--------------------------用户管理相关------------------- message UserListRequest { string organization = 1; string filter = 2; int64 uid = 3; int64 page = 4; int64 page_size = 5; string zone = 6; } message UserItem { int64 id = 1; string name = 2; string username = 3; string phone = 4; string email = 5; repeated string zones = 6; } message UserListReply { int64 total = 1; int64 page = 2; repeated UserItem list = 3; } message UserInfoRequest { int64 id = 1; int64 uid = 2; string organization_code = 3; } // 权限列表返回uid 所拥有的区域, 对id所拥有的区域进行打勾 // 编辑时不能将非uid区域的数据从id的区域中删除 message UserInfoReply { int64 id = 1; string name = 2; string username = 3; string phone = 4; string email = 5; // 所属角色 int64 group_id = 6; string group_name = 7; // 所拥有的权限 repeated RbacNodeItem node_list = 8; repeated ZoneItemSelect zone_list = 9; } message UserDelRequest { int64 id = 1; int64 uid = 2; string organization_code = 3; } message UserDelReply { int64 id = 1; string name = 2; string username = 3; string phone = 4; string email = 5; } message UserUpdateRequest { int64 id = 1; int64 uid = 2; string organization_code = 3; string username = 4; string password = 5; string phone = 6; string email = 7; int64 group_id = 8; string zones = 9; string name = 10; } message UserUpdateReply { UserUpdateRequest origin = 1; } message ManagementLogAddRequest { string username = 1; int64 uid = 2; string action = 3; string module = 4; int64 created_at = 6; string origin = 7; string target = 8; string organization_code = 9; } message ManagementLogAddReply { } message ManagementLogListRequest { int64 page = 1; int64 page_size = 2; string username = 3; string action = 4; string filter = 5; string module = 6; int64 start = 7; int64 end = 8; string organization_code = 9; } message ManagementLogItem { // 账号名 string username = 1; // 账号id int64 uid = 2; // 行为 string action = 3; // 模块 string module = 4; // 时间 string created_at = 6; // 修改前信息 string origin = 7; // 修改后信息 string target = 8; // 日志id int64 id = 9; } message ManagementLogListReply { int64 total = 1; int64 page = 2; repeated ManagementLogItem list = 3; }