增加 ldap proto

This commit is contained in:
laodaming@fusen.cn
2024-01-12 15:55:04 +08:00
parent ebf1be84e6
commit a8e75109b7

200
service/ldap.proto Normal file
View File

@@ -0,0 +1,200 @@
syntax = "proto3"; //版本声明使用v3版本
package ldap;
option go_package = "gitlab.fusenpack.com/backend/ldap;service";
// 导入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) {}
}
//获取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;
}