定制 tangent/rest-api-bundle 二次开发

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

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

tangent/rest-api-bundle

Composer 安装命令:

composer require tangent/rest-api-bundle

包简介

Simple REST API to expose CRUD operations

README 文档

README

Simple rest api bundle to expose CRUD(Create, Read, Update and Delete) operations for each of its entities.

Installation

  • Add to composer.json
    #!json
    

"require": {

        "tangent/rest-api-bundle": "dev-master"
}
*   Register bundle in app/AppKernel.php

!php

$bundles = [

        new Tangent\Bundle\ApiBundle\TangentApiBundle(),
   ];

*  To update schema, run the following command in console:

!php

$ php bin/console doctrine:schema:update --force


*  Open  http://127.0.0.1:8000/tangent/product/list - Read all product details

*  Open  http://127.0.0.1:8000/tangent/product/list/{id} - Read one item details

*  Send POST request to create new entity with the json below & Endpoint url:http://127.0.0.1:8000/tangent/product/create

!json

[

  {
    "name": "Bread",
    "price": 1.99,
    "description": "Super great"
  },
  {
    "name": "Butter",
    "price": 2.99,
    "description": "Discounted item"
  }
]

*  Send POST request to update existing entity with the json below
Endpoint url: http://127.0.0.1:8000/tangent/product/update/{id}

!json

{

  "name": "White Bread",
  "price": 2.99,
  "description": "Nice for breakfast"

}

*  Send GET request to delete existing entity with the json below
End point url http://127.0.0.1:8000/tangent/product/delete/{id}

*  To run unit tests type in the console
phpunit -v tests/ApiBundle

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-06-14

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固