68 lines
1.8 KiB
Plaintext
68 lines
1.8 KiB
Plaintext
syntax = "v1"
|
|
|
|
info (
|
|
title: // TODO: add title
|
|
desc: // TODO: add description
|
|
author: ""
|
|
email: ""
|
|
)
|
|
|
|
import "basic.api"
|
|
|
|
service ldap-admin {
|
|
//获取部门列表
|
|
@handler GetDepartmentsHandler
|
|
get /api/ldap-admin/get_departments(request) returns (response);
|
|
//保存部门信息
|
|
@handler SaveDepartmentHandler
|
|
post /api/ldap-admin/save_department(SaveDepartmentReq) returns (response);
|
|
|
|
//获取API列表
|
|
@handler GetApisHandler
|
|
get /api/ldap-admin/get_apis(GetApisReq) returns (response);
|
|
|
|
//保存API
|
|
@handler SaveApiHandler
|
|
post /api/ldap-admin/save_api(SaveApiReq) returns (response);
|
|
}
|
|
|
|
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"`
|
|
Creator string `json:"creator"`
|
|
}
|
|
|
|
//获取部门列表
|
|
type GetDepartmentsRsp {
|
|
List []*DepartmentsItem `json:"list"`
|
|
}
|
|
type DepartmentsItem {
|
|
Id int64 `json:"id"`
|
|
Name string `json:"name"`
|
|
Remark string `json:"remark"`
|
|
Type string `json:"type"`
|
|
ParentId int64 `json:"parent_id"`
|
|
Dn string `json:"dn"`
|
|
SyncState int64 `json:"sync_state"`
|
|
Sort int64 `json:"sort"`
|
|
Child []*DepartmentsItem `json:"child"`
|
|
}
|
|
//保存部门信息
|
|
type SaveDepartmentReq {
|
|
Id int64 `json:"id"`
|
|
Name string `json:"name"`
|
|
Remark string `json:"remark"`
|
|
Type string `json:"type"`
|
|
ParentId int64 `json:"parent_id"`
|
|
Dn string `json:"dn"`
|
|
Sort int64 `json:"sort"`
|
|
} |