fusenapi/server_api/ldap-admin.api

334 lines
12 KiB
Plaintext
Raw Normal View History

2023-11-13 09:52:20 +00:00
syntax = "v1"
info (
title: // TODO: add title
desc: // TODO: add description
author: ""
email: ""
)
import "basic.api"
service ldap-admin {
2023-11-17 02:34:13 +00:00
//获取权限组列表
@handler GetLdapGroupsHandler
get /api/ldap-admin/get_ldap_group(GetLdapGroupsReq) returns (response);
//获取权限组详情
@handler GetLdapGroupDetailHandler
get /api/ldap-admin/get_ldap_group_detail(GetLdapGroupDetailReq) returns (response);
2023-11-17 02:34:13 +00:00
//保存权限组
@handler SaveLdapGroupHandler
post /api/ldap-admin/save_ldap_group(SaveLdapGroupReq) returns (response);
//删除权限组
@handler DeleteLdapGroupHandler
post /api/ldap-admin/delete_ldap_group(DeleteLdapGroupReq) returns (response);
//权限组授权
@handler SetLdapGroupAuthHandler
post /api/ldap-admin/set_ldap_group_auth(SetLdapGroupAuthReq) returns (response);
2023-11-17 07:21:45 +00:00
//权限组授权用户
@handler SetLdapGroupUserHandler
post /api/ldap-admin/set_ldap_group_user(SetLdapGroupUserReq) returns (response);
2023-11-14 07:03:01 +00:00
//获取API列表
@handler GetApisHandler
get /api/ldap-admin/get_apis(GetApisReq) returns (response);
//保存API
@handler SaveApiHandler
post /api/ldap-admin/save_api(SaveApiReq) returns (response);
2023-11-17 07:36:17 +00:00
//删除API
@handler DeleteApiHandler
post /api/ldap-admin/delete_api(DeleteApiReq) returns (response);
2023-11-15 07:16:14 +00:00
//保存菜单
@handler SaveMenuHandler
post /api/ldap-admin/save_menu(SaveMenuReq) returns (response);
2023-11-15 07:50:18 +00:00
//删除菜单
@handler DeleteMenuHandler
post /api/ldap-admin/delete_menu(DeleteMenuReq) returns (response);
//获取菜单详情
@handler GetMenuDetailHandler
get /api/ldap-admin/get_menu_detail(GetMenuDetailReq) returns (response);
//获取菜单列表
@handler GetMenusHandler
get /api/ldap-admin/get_menus(GetMenusReq) returns (response);
2023-11-16 06:07:53 +00:00
//获取ldap组织列表
2023-11-17 02:33:40 +00:00
@handler GetLdapOrganizationsHandler
get /api/ldap-admin/get_ldap_organizations(request) returns (response);
2023-11-16 06:07:53 +00:00
//增加ldap组织
2023-11-17 02:33:40 +00:00
@handler CreateLdapOrganizationHandler
post /api/ldap-admin/create_ldap_organization(CreateLdapOrganizationReq) returns (response);
2023-11-16 06:07:53 +00:00
//删除ldap组织
2023-11-17 02:33:40 +00:00
@handler DeleteLdapOrganizationHandler
post /api/ldap-admin/delete_ldap_organization(DeleteLdapOrganizationReq) returns (response);
2023-11-16 08:57:29 +00:00
//修改ldap组织
2023-11-17 02:33:40 +00:00
@handler UpdateLdapOrganizationHandler
post /api/ldap-admin/update_ldap_organization(UpdateLdapOrganizationReq) returns (response);
2023-11-20 04:31:33 +00:00
//添加ldap用户帐号
2023-11-16 08:57:29 +00:00
@handler CreateLdapUserHandler
post /api/ldap-admin/create_ldap_user(CreateLdapUserReq) returns (response);
//修改ldap用户信息
@handler UpdateLdapUserHandler
post /api/ldap-admin/update_ldap_user(UpdateLdapUserReq) returns (response);
2023-11-20 03:54:30 +00:00
//修改ldap用户密码
@handler UpdateLdapUserPwdHandler
post /api/ldap-admin/update_ldap_user_pwd(UpdateLdapUserPwdReq) returns (response);
2023-11-16 08:57:29 +00:00
//删除ldap用户
@handler DeleteLdapUserHandler
post /api/ldap-admin/delete_ldap_user(DeleteLdapUserReq) returns (response);
//获取ldap用户信息
@handler GetLdapUserInfoHandler
get /api/ldap-admin/get_ldap_user_info(GetLdapUserInfoReq) returns (response);
2023-11-17 02:22:23 +00:00
//ldap组织添加成员
2023-11-17 02:33:40 +00:00
@handler AddLdapOrganizationMemberHandler
post /api/ldap-admin/add_ldap_organization_member(AddLdapOrganizationMemberReq) returns (response);
2023-11-17 02:22:23 +00:00
//ldap组织移除成员
2023-11-17 02:33:40 +00:00
@handler RemoveLdapOrganizationMemberHandler
post /api/ldap-admin/remove_ldap_organization_member(RemoveLdapOrganizationMemberReq) returns (response);
2023-11-17 03:24:54 +00:00
//获取ldap组织成员列表
@handler GetLdapOrganizationMembersHandler
get /api/ldap-admin/get_ldap_organization_members(GetLdapOrganizationMembersReq) returns (response);
2023-11-17 08:02:35 +00:00
//创建用户基础组
@handler CreateLdapUserBaseGroupHandler
post /api/ldap-admin/create_ldap_user_base_group(request) returns (response);
2023-11-20 09:16:17 +00:00
//获取基础用户组中成员列表
@handler GetLdapUsersHandler
get /api/ldap-admin/get_ldap_users(GetLdapUsersReq) returns (response);
2023-11-21 09:08:22 +00:00
//登录
@handler LdapUserLoginHandler
post /api/ldap-admin/ldap_user_login(LdapUserLoginReq) returns (response);
2023-11-14 07:03:01 +00:00
}
2023-11-17 03:38:05 +00:00
2023-11-17 02:34:13 +00:00
type (
GetLdapGroupDetailReq {
Id int64 `form:"id"`
}
SetLdapGroupAuthReq {
GroupId int64 `json:"group_id"`
GroupAuth GroupAuth `json:"group_auth"`
}
GroupAuth {
Id int64 `json:"id"`
Name string `json:"name"`
Type string `json:"type"`
Metadata []*GroupAuth `json:"metadata,optional"`
}
2023-11-17 03:38:05 +00:00
GetLdapGroupsReq {
Id int64 `form:"id,optional"` //id
Name string `form:"name,optional"` //名称
Keyword string `form:"keyword,optional"` //关键词
Status int64 `form:"status,optional"` // 1正常, 2禁用
Sort string `form:"sort,optional"`
CurrentPage int `form:"current_page,optional,default=1"`
PerPage int `form:"per_page,optional,default=10"`
}
SaveLdapGroupReq {
Id int64 `json:"id"` //id
2023-11-22 10:15:25 +00:00
Type string `json:"type"` //类型
2023-11-17 03:38:05 +00:00
Name string `json:"name"` //名称
Keyword string `json:"keyword"` //关键词
Remark string `json:"remark"` // 备注
Status int64 `json:"status"` // 1正常, 2禁用
Sort int64 `json:"sort"` // 排序
}
DeleteLdapGroupReq {
2023-11-17 07:36:17 +00:00
Ids []int64 `json:"ids"` //id
}
DeleteApiReq {
Ids []int64 `json:"ids"` //id
2023-11-17 03:38:05 +00:00
}
2023-11-17 06:53:28 +00:00
SetLdapGroupMenusReq {
GroupId int64 `json:"group_id"`
MenuIds []int64 `json:"menu_ids"`
}
SetLdapCasbinRuleReq {
GroupId int64 `json:"group_id"`
ApIds []int64 `json:"api_ids"`
}
2023-11-17 07:21:45 +00:00
SetLdapGroupUserReq {
GroupId int64 `json:"group_id"`
UserId int64 `json:"user_id"`
}
2023-11-17 02:34:13 +00:00
)
2023-11-14 07:03:01 +00:00
type GetApisReq {
Sort string `form:"sort,optional"`
CurrentPage int `form:"current_page,optional,default=1"`
PerPage int `form:"per_page,optional,default=10"`
}
type SaveApiReq {
Id int64 `json:"id"`
Method string `json:"method"`
Path string `json:"path"`
Category string `json:"category"`
Remark string `json:"remark"`
2023-11-13 09:52:20 +00:00
}
2023-11-15 07:16:14 +00:00
//保存菜单
type SaveMenuReq {
2023-11-15 07:50:18 +00:00
Id int64 `json:"id"`
Name string `json:"name"`
Title string `json:"title"`
Icon string `json:"icon"`
Path string `json:"path"`
Sort int64 `json:"sort"`
ParentId int64 `json:"parent_id"`
Status int64 `json:"status,options=0|1"`
}
//删除菜单
type DeleteMenuReq {
Id int64 `json:"id"`
}
//获取菜单详情
type GetMenuDetailReq {
Id int64 `form:"id"`
}
type GetMenuDetailRsp {
Id int64 `json:"id"`
Name string `json:"name"`
Title string `json:"title"`
Icon string `json:"icon"`
Path string `json:"path"`
Sort int64 `json:"sort"`
ParentId int64 `json:"parent_id"`
Status int64 `json:"status"`
}
//获取菜单列表
type GetMenusReq {
2023-11-20 09:33:38 +00:00
CurrentPage int `form:"current_page,optional"`
Name string `form:"name,optional"`
Title string `form:"title,optional"`
Path string `form:"path,optional"`
ParentId *int64 `form:"parent_id,optional"`
2023-11-15 07:50:18 +00:00
}
type GetMenusRsp {
List []MenuItem `json:"list"`
Meta Meta `json:"meta"`
}
type MenuItem {
2023-11-15 07:16:14 +00:00
Id int64 `json:"id"`
Name string `json:"name"`
Title string `json:"title"`
Icon string `json:"icon"`
Path string `json:"path"`
Sort int64 `json:"sort"`
ParentId int64 `json:"parent_id"`
Status int64 `json:"status"`
2023-11-16 06:07:53 +00:00
}
//增加ldap组织
2023-11-17 02:33:40 +00:00
type CreateLdapOrganizationReq {
2023-11-17 07:11:23 +00:00
OrganizationEnName string `json:"organization_en_name"` //组织英文名
2023-11-20 04:31:33 +00:00
BusinessCategory string `json:"business_category"` //组织类别
2023-11-17 02:33:40 +00:00
ParentOrganizationDN string `json:"parent_organization_dn"` //父级dn
2023-11-16 06:07:53 +00:00
}
//删除ldap组织
2023-11-17 02:33:40 +00:00
type DeleteLdapOrganizationReq {
OrganizationDN string `json:"organization_dn"` //组织dn
2023-11-16 06:07:53 +00:00
}
//修改ldap组织
2023-11-17 02:33:40 +00:00
type UpdateLdapOrganizationReq {
OrganizationDN string `json:"organization_dn"` //组织dn
2023-11-16 06:07:53 +00:00
BusinessCategory string `json:"business_category"` //组织分类名称
2023-11-16 08:57:29 +00:00
}
2023-11-20 04:31:33 +00:00
//添加ldap用户帐号
2023-11-16 08:57:29 +00:00
type CreateLdapUserReq {
2023-11-20 04:31:33 +00:00
UserName string `json:"user_name"` //用户名
Email string `json:"email"` //邮箱
Password string `json:"password"` //密码
Mobile string `json:"mobile"` //手机号
Avatar string `json:"avatar"` //头像地址
EmployeeType int64 `json:"employee_type,options=1|2|3"` //1正式 2实习 3外包
2023-11-21 02:13:12 +00:00
GroupId int64 `json:"group_id,optional"` //分组id
2023-11-20 04:31:33 +00:00
Status int64 `json:"status,options=0|1"` //状态 1正常0离职
2023-11-16 08:57:29 +00:00
}
//修改ldap用户信息
type UpdateLdapUserReq {
2023-11-20 04:31:33 +00:00
UserDN string `json:"user_dn"` //用户dn
UserName string `json:"user_name"` //用户名
Mobile string `json:"mobile,optional"` //手机号
Avatar string `json:"avatar,optional"` //头像地址
Status int64 `json:"status,options=0|1"` //状态 1正常0离职
EmployeeType int64 `json:"employee_type,options=1|2|3"` //1正式 2实习 3外包
2023-11-21 02:13:12 +00:00
GroupId int64 `json:"group_id,optional"` //权限分组id
2023-11-16 08:57:29 +00:00
}
2023-11-20 03:54:30 +00:00
//修改用户密码
type UpdateLdapUserPwdReq {
UserDN string `json:"user_dn"` //用户dn
NewPassword string `json:"new_password"`
OldPassword string `json:"old_password"`
}
2023-11-16 08:57:29 +00:00
//删除ldap用户
type DeleteLdapUserReq {
2023-11-16 09:57:25 +00:00
UserDN string `json:"user_dn"` //用户dn
2023-11-16 08:57:29 +00:00
}
//获取ldap用户信息
type GetLdapUserInfoReq {
2023-11-16 10:29:45 +00:00
UserDN string `form:"user_dn"` //用户dn
}
type GetLdapUserInfoRsp {
2023-11-21 02:38:11 +00:00
UserId int64 `json:"user_id"`
2023-11-20 04:08:04 +00:00
UserDN string `json:"user_dn"`
UserName string `json:"user_name"` //用户名
Email string `json:"email"` //邮箱
Mobile string `json:"mobile"` //手机号
Avatar string `json:"avatar"` //头像地址
EmployeeTpye int64 `json:"employee_tpye"` //雇佣类型 1正式 2实习 3外包
Status int64 `json:"status,options=0|1"` //状态 1正常0离职
2023-11-17 02:22:23 +00:00
}
//ldap组织添加成员
2023-11-17 02:33:40 +00:00
type AddLdapOrganizationMemberReq {
OrganizationDN string `json:"organization_dn"` //目标组织DN
UserDN string `json:"user_dn"` //用户DN
2023-11-17 02:22:23 +00:00
}
//ldap组织移除成员
2023-11-17 02:33:40 +00:00
type RemoveLdapOrganizationMemberReq {
OrganizationDN string `json:"organization_dn"` //目标组织DN
UserDN string `json:"user_dn"` //用户DN
2023-11-17 03:24:54 +00:00
}
//获取ldap组织成员列表
type GetLdapOrganizationMembersReq {
2023-11-17 07:06:03 +00:00
OrganizationDN string `form:"organization_dn"`
}
type GetLdapOrganizationMembersRsp {
List []GetLdapOrganizationMembersItem `json:"list"`
}
type GetLdapOrganizationMembersItem {
2023-11-20 09:16:17 +00:00
UserId int64 `json:"userId"`
UserDN string `json:"user_dn"`
UserName string `json:"user_name"` //用户名
Email string `json:"email"` //邮箱
Mobile string `json:"mobile"` //手机号
Avatar string `json:"avatar"` //头像地址
EmployeeType int64 `json:"employee_type"`
Status int64 `json:"status,options=0|1"` //状态 1正常0离职
}
//获取基础用户组中成员列表
type GetLdapUsersReq {
PageCookie string `form:"page_cookie,optional"` //下一页分页游标,传空/不传就是第一页
}
type GetLdapUsersRsp {
List []GetLdapUsersItem `json:"list"`
PagingCookie string `json:"paging_cookie"`
}
type GetLdapUsersItem {
UserId int64 `json:"userId"`
UserDN string `json:"user_dn"`
UserName string `json:"user_name"` //用户名
Email string `json:"email"` //邮箱
Mobile string `json:"mobile"` //手机号
Avatar string `json:"avatar"` //头像地址
EmployeeType int64 `json:"employee_type"`
Status int64 `json:"status,options=0|1"` //状态 1正常0离职
2023-11-21 09:08:22 +00:00
}
//登录
type LdapUserLoginReq {
Email string `json:"email"`
Password string `json:"password"`
}
type LdapUserLoginRsp {
Token string `json:"token"`
2023-11-13 09:52:20 +00:00
}