experteam/api-base-bundle

API基础功能包

安装次数: 8,580

依赖项: 2

建议者: 0

安全性: 0

星标: 0

关注者: 2

分支: 0

公开问题: 0

类型:symfony-bundle

3.4.7 2024-09-18 02:52 UTC

README

Symfony 5.1+ 中API的基础服务
包括以下内容

  • 参数客户端:用于获取api-companies中定义的参数值的Service。
  • JSend响应:根据JSEND规范(https://github.com/omniti-labs/jsend)设置JSON响应的格式。
  • 请求工具:请求验证服务。

安装

  1. 运行以下composer命令
composer require experteam/api-base-bundle
  1. 通过以下任一选项创建配置文件

    a. 将包根目录中的示例文件手动复制到config/packages/文件夹。

    b. 将vendor_copy.php文件复制到项目根目录,并在composer.json文件中配置脚本。

    "scripts": {
         "vendor-scripts": [
             "@php vendor_copy.php -s vendor/experteam/api-base-bundle/experteam_api_base.yaml.example -d config/packages/experteam_api_base.yaml --not-overwrite --ignore-no-source"
         ],
         "post-install-cmd": [
             "@vendor-scripts"
         ],
         "post-update-cmd": [
             "@vendor-scripts"
         ]
     },
    
  2. 编辑包配置文件config/packages/experteam_api_base.yaml

experteam_api_base:
    params:
        remote_url: [Remote URL]
        defaults:
            [PARAM NAME]: [Value]
            [PARAM NAME]: [Value]

更新

运行以下composer命令

composer update experteam/api-base-bundle

许可证

MIT许可证.