proto/service/ldap.proto

306 lines
10 KiB
Protocol Buffer
Raw Normal View History

2024-01-12 07:55:04 +00:00
syntax = "proto3"; //版本声明使用v3版本
package ldap;
option go_package = "gitlab.fusenpack.com/backend/ldap;service";
2024-01-15 07:53:42 +00:00
2024-01-12 07:55:04 +00:00
// 导入google/api/annotations.proto 注释依赖
import "google/api/annotations.proto";
import "service/basic.proto";
import "google/protobuf/struct.proto";
import "google/protobuf/any.proto";
import "google/protobuf/empty.proto";
import "google/api/httpbody.proto";
import "google/protobuf/timestamp.proto";
//定义服务
service ldap {
// 心跳
rpc Ping(basic.Request) returns (basic.Response) {}
//获取ldap部门列表
rpc GetLdapOrganizations(basic.Request) returns(GetLdapOrganizationsRsp){}
//添加ldap部门
rpc CreateLdapOrganization(CreateLdapOrganizationReq)returns(basic.Response){}
//删除ldap部门
rpc DeleteLdapOrganization(DeleteLdapOrganizationReq) returns(basic.Response){}
//修改ldap部门
rpc UpdateLdapOrganization(UpdateLdapOrganizationReq) returns(basic.Response){}
//添加ldap用户帐号
rpc CreateLdapUser(CreateLdapUserReq) returns(basic.Response){}
//修改ldap用户信息
rpc UpdateLdapUser(UpdateLdapUserReq) returns(basic.Response){}
//修改ldap用户密码
rpc UpdateLdapUserPwd(UpdateLdapUserPwdReq) returns(basic.Response){}
//禁用ldap用户帐号
rpc DisableLdapUser(DisableLdapUserReq) returns(basic.Response){}
//获取用户信息
rpc GetLdapUserInfo(GetLdapUserInfoReq) returns(GetLdapUserInfoRsp){}
//ldap部门添加成员
rpc AddLdapOrganizationMember(AddLdapOrganizationMemberReq) returns(basic.Response){}
//ldap部门移除成员
rpc RemoveLdapOrganizationMember(RemoveLdapOrganizationMemberReq) returns(basic.Response){}
//获取ldap组织成员列表
rpc GetLdapOrganizationMembers(GetLdapOrganizationMembersReq) returns(GetLdapOrganizationMembersRsp){}
//创建用户基础组
rpc CreateLdapUserBaseGroup(basic.Request) returns (basic.Response) {}
//获取基础用户组中成员列表
rpc GetLdapUsers(GetLdapUsersReq) returns (GetLdapUsersRsp) {}
//登录
rpc LdapUserLogin(LdapUserLoginReq) returns (LdapUserLoginRsp) {}
2024-01-15 07:53:42 +00:00
//获取权限组列表
rpc GetLdapGroups(GetLdapGroupsReq) returns (GetLdapGroupsRsp);
//获取权限组详情
rpc GetLdapGroupDetail(GetLdapGroupDetailReq) returns (GetLdapGroupDetailRsp);
//保存权限组
rpc SaveLdapGroup(SaveLdapGroupReq) returns (SaveLdapGroupRsp);
//删除权限组
rpc DeleteLdapGroup(DeleteLdapGroupReq) returns (DeleteLdapGroupRsp);
//权限组授权--新增
rpc SetLdapGroupAuth(SetLdapGroupAuthReq) returns (SetLdapGroupAuthRsp);
//权限组授权--移除
rpc RemoveLdapGroupAuth(RemoveLdapGroupAuthReq) returns (RemoveLdapGroupAuthRsp);
}
message GetLdapGroupsReq {
optional LdapGroupFilter filter = 1;
optional int64 current_page = 101;
optional int64 per_page = 102;
optional string order_by = 103;
2024-01-12 07:55:04 +00:00
}
2024-01-15 07:53:42 +00:00
message GetLdapGroupsRsp {
repeated LdapGroup list = 1;
basic.Meta meta = 2;
}
message GetLdapGroupDetailReq {
optional LdapGroupFilter filter = 1;
}
message GetLdapGroupDetailRsp {
optional LdapGroup info = 1;
}
message SaveLdapGroupReq {
optional LdapGroupFilter filter = 1;
optional LdapGroupFilter save = 2;
}
message SaveLdapGroupRsp {
LdapGroup info = 1;
}
message DeleteLdapGroupReq {
optional LdapGroupFilter filter = 1;
}
message DeleteLdapGroupRsp {
}
message SetLdapGroupAuthReq {
int64 group_id = 1;
GroupAuth group_auth = 2;
}
message SetLdapGroupAuthRsp {
int64 group_id = 1;
}
message RemoveLdapGroupAuthReq {
int64 group_id = 1;
GroupAuth group_auth = 2;
}
message RemoveLdapGroupAuthRsp {
int64 group_id = 1;
}
message GroupAuth {
int64 id = 1;
string name = 2;
string type = 3;
}
message LdapGroup {
int64 id = 1;
string type = 2;
string name = 3;
string keyword = 4;
string remark = 5;
int64 status = 6;
int64 sort = 7;
google.protobuf.Struct metadata = 101;
string ctime = 102;
string utime = 103;
}
message LdapGroupFilter {
optional int64 id = 1;
optional string type = 2;
optional string name = 3;
optional string keyword = 4;
optional string remark = 5;
optional int64 status = 6;
optional int64 sort = 7;
optional google.protobuf.Struct other_filter = 101; // 其他过滤条件
optional LdapGroupIds ldap_grouop_ids = 102; // 资源ID列表
optional string metadata = 103;
}
message LdapGroupIds {
repeated int64 ldap_grouop_ids = 1;
}
2024-01-12 07:55:04 +00:00
//获取ldap部门列表
message GetLdapOrganizationsRsp{
repeated LdapOrganization list = 1;
}
message LdapOrganization {
int32 member_count = 1; //成员数
string organization_name = 2; //部分名字
string organization_dn = 3; //部门dn
string owner_name = 4; //负责人名字
string owner_dn = 5; //负责人dn
int32 level = 6; //层级
string parent_organization_dn = 7;//父级部门dn
int32 sort = 8; //序号
repeated LdapOrganization child = 9;//子部门
}
//添加ldap部门
message CreateLdapOrganizationReq{
string organization_name = 1; //部门名
string parent_organization_dn = 2; //父级部门dn
string owner_dn = 3 ; //负责人dn
}
//删除ldap部门
message DeleteLdapOrganizationReq{
repeated string organization_dns = 1;//要删除的部门dn集合
}
//修改ldap部门
message UpdateLdapOrganizationReq{
string organization_dn = 1; //组织dn
string organization_name = 2; //组织分类名称
string organization_owner_dn = 3; //负责人dn
}
//添加ldap用户帐号
message CreateLdapUserReq{
string user_name = 1; //用户名
string email = 2; //邮箱
string password = 3; //密码
string mobile = 4; //手机号
string avatar = 5; //头像地址
int64 employee_type = 6; //1正式 2实习 3外包
int64 group_id = 7; //授权分组id
int64 gender = 8; //性别 1男 2女 3未知
string birthday = 9; //生日
int64 status = 10; //状态 1正常0离职
}
//修改ldap用户信息
message UpdateLdapUserReq{
string user_dn = 1; //用户dn
string user_name = 2; //用户名
string mobile = 3; //手机号
string avatar = 4; //头像地址
int64 status = 5; //状态 1正常0离职
int64 employee_type = 6; //1正式 2实习 3外包
int64 group_id = 7; //权限分组id
int64 gender = 8; //性别 1男 2女 3未知
string birthday = 9; //生日
}
//修改ldap用户密码
message UpdateLdapUserPwdReq{
string user_dn = 1; //用户dn
string new_password = 2;//新密码
string old_password = 3;//旧密码
}
//禁用ldap用户帐号
message DisableLdapUserReq{
string user_dn = 1;//用户dn
}
//获取用户信息
message GetLdapUserInfoReq{
string user_dn = 1;//用户dn
}
message GetLdapUserInfoRsp{
int64 user_id = 1; //用户id
string user_dn = 2; //用户dn
string user_name = 3; //用户名
string email = 4; //邮箱
string mobile = 5; //手机号
string avatar = 6; //头像地址
int64 employee_type = 7;//雇佣类型 1正式 2实习 3外包
int64 gender = 8; //性别 1男 2女 3未知
string birthday = 9; //生日
repeated string belong_organization = 10;//属于哪些部门
repeated string manage_organization = 11; //负责哪些部门
int64 status = 12 ; //状态 1正常0离职
}
//ldap部门添加成员
message AddLdapOrganizationMemberReq{
string organization_dn = 1 ; //目标组织DN
string user_dn = 2; //用户DN
}
//ldap部门移除成员
message RemoveLdapOrganizationMemberReq{
string organization_dn = 1; //目标组织DN
string user_dn = 2; //用户DN
}
//获取ldap组织成员列表
message GetLdapOrganizationMembersReq{
string organization_dn = 1; //组织dn
string user_name = 2; //用户名(模糊搜索)
}
message GetLdapOrganizationMembersRsp {
repeated GetLdapOrganizationMembersItem list = 1;
}
message GetLdapOrganizationMembersItem {
int64 userId = 1; //用户id
string user_dn = 2 ; //用户dn
string user_name = 3 ; //用户名
string email = 4 ; //邮箱
string mobile = 5; //手机号
string avatar = 6; //头像地址
int64 employee_type = 7 ; //雇佣类型
int64 gender = 8 ; //性别 1男 2女 3未知
string birthday = 9 ; //生日
repeated string belong_organizations = 10; //属于哪些部门
repeated string manage_organizations = 11 ;//管理哪些部门
int64 status = 12 ; //状态 1正常0离职
int64 group_id = 13; //权限分组id
}
//获取基础用户组中成员列表
message GetLdapUsersReq{
string page_cookie = 1; //下一页分页游标,传空/不传就是第一页
string user_name = 2 ; //用户名用于模糊搜索
int64 gender = 3; //性别 0所有 1男 2女 3未知
int64 employee_type = 4;//员工类型0所有 1正式 2实习 3外包
}
message GetLdapUsersRsp{
repeated GetLdapUsersItem list = 1;
string paging_cookie = 2;
}
message GetLdapUsersItem {
int64 user_id = 1; //用户id
string user_dn = 2; //用户dn
string user_name = 3; //用户名
string email = 4; //邮箱
string mobile = 5; //手机号
string avatar = 6; //头像地址
int64 employee_type = 7; //雇佣类型 1正式 2实习 3外包
int64 gender = 8; //性别 1男 2女 3未知
string birthday = 9; //生日
repeated string belong_organizations = 10 ;//属于哪些部门
repeated string manage_organizations = 11 ;//管理哪些部门
int64 status = 12 ; //状态 1正常0离职
int64 group_id = 13; //权限分组id
}
//登录
message LdapUserLoginReq{
string email = 1; //邮箱
string password = 2;//密码
}
message LdapUserLoginRsp{
string token = 1;
}