定制 aaieduhr/aosi-module-rest-server 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

aaieduhr/aosi-module-rest-server

Composer 安装命令:

composer require aaieduhr/aosi-module-rest-server

包简介

AOSI REST Server Module

README 文档

README

Provides pluggable JSON endpoints for AOSI modules.

Installation

composer require aaieduhr/aosi-module-rest-server

Enable aaieduhr/aosi-module-rest-server in the AOSI modules.enabled configuration. AOSI core registers methods returned by each enabled module's getRestServerMethods() manifest method.

Calling a method

Every method is exposed through POST /AOSI.rest/{method} and requires an application/json object body:

POST /AOSI.rest/anonSearch
Content-Type: application/json

{
  "base": "dc=example,dc=org",
  "filter": "(uid=test)",
  "attributes": ["uid", "cn"]
}

Success:

{"data":{"uid=test,dc=example,dc=org":{"uid":["test"]}}}

Errors use RFC 9457-style application/problem+json responses and meaningful HTTP status codes.

Providing methods

Return AaiEduHr\Aosi\RestServer\MethodDescriptor instances from an AOSI module manifest's getRestServerMethods() method. Handlers may be container services such as [ExampleHandler::class, 'example']; request parameters are validated from their SchemaDescriptor definitions before invocation.

For small modules, returning descriptors directly from the manifest or a required config file is usually enough. For larger method sets, prefer an autoloaded provider class and keep the config file as a thin delegation, for example:

use Vendor\ExampleModule\Config\ExampleRestMethods;

return ExampleRestMethods::all();

This module's config/rest_methods.php follows that pattern. Avoid defining shared closures inside config files as the reference style. Generic descriptor helpers are available through AaiEduHr\Aosi\RestServer\DescriptorFactory; module-specific helpers, such as default handler mapping or common parameter groups, should remain in the module provider class.

The generated API descriptions are available at:

  • /rest-server-documentation
  • /rest-server-openapi.json

Licence

This work is published under the European Union Public License v1.2.

统计信息

  • 总下载量: 1
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: EUPL-1.2
  • 更新时间: 2026-07-03

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固