承接 aaron-lin/internal-api 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

aaron-lin/internal-api

Composer 安装命令:

composer require aaron-lin/internal-api

包简介

README 文档

README

Introduction

This document describes the internal API of the application. The internal API is used in communication of backend. The internal API is not exposed to the public and is only used by the backend.

Authorization

The followinig API are authorized with Bearer-type tokens. Remote servers must send API key through HTTP header Authorization with Bearer-type token. The API key is generated by backend and is unique for each remote server. The API key is used to identify the remote server. Hashed API keys are stored in file system. The API key is generated by the following command:

$NewApiKey = random_bytes(40);
$HashedApiKey = crypt($newApiKey, 'salt');  //server only stores hashed API key

And the API keys storage file example is here.

1. Client Cache

1.1 Create Cache on Client

POST /iapi/cache

Remote server request server to create cache on server file system.

Request: String in HTTP Header, Parameter(s) in HTTP Body

Header

Name Type Description
Authorization string (Required) Bearer type token,token content is API Key
Authorization: Bearer b01fd1c05d93e77a887fa6c8c91088bb7f053fb220eaf87d51e5efa30fea9d25

Body

Name Type Description
fromDB string (Required) source database table and column name
storePath string (Required) the path of directory storing caches
keys string (Required) the primary keys of caching data, splited by comma, the number of keys must be identical with the number of filenames
filenames string (Required) the filename of caches, splited by comma, the number of filenames must be identical with the number of keys
fromDB: user_info.intro_json
storePath: ./cache/user-intro
keys: id001,id002,id003
filenames: about-us.json,contact-us.json,privacy-policy.json

Success Response: String in HTTP Header

Status: 200 OK
[
    "/var/www/cache/user-intro/about-us.json",
    "/var/www/cache/user-intro/contact-us.json",
    "/var/www/cache/user-intro/privacy-policy.json"
]

Error Response

Status: 400 Bad Request
{
    "status": "error",
    "message": "keys and filenames count not match"
}

2. File Transfer

2.1 Download File

GET /iapi/file

Remote server download file from server.

Request: String in HTTP Header, Parameter(s) in Query String

Header

Name Type Description
Authorization string (Required) Bearer type token,token content is API Key
Authorization: Bearer b01fd1c05d93e77a887fa6c8c91088bb7f053fb220eaf87d51e5efa30fea9d25

Query String

Name Type Description
filename string (Required) path and filename of downloading file
https://example.com/iapi/file?filename=public/images/1.jpg

Success Response: String in HTTP Header

Status: 200 OK
Content-Type: image/jpg

Error Response

Status: 400 Bad Request
{
    "status": "error",
    "message": "keys and filenames count not match"
}

2.2 Upload File

POST /iapi/file

Remote server upload file to server.

Request: String in HTTP Header, Parameter(s) in HTTP Body

Header

Name Type Description
Authorization string (Required) Bearer type token,token content is API Key
Authorization: Bearer b01fd1c05d93e77a887fa6c8c91088bb7f053fb220eaf87d51e5efa30fea9d25

Body

Name Type Description
content binary (Required) uploading file
filename string (Required) path and filename of uploading file
content: (binary)
filename: ./public/images/1.jpg

Success Response: String in HTTP Header

Status: 204 No Content

Error Response

Status: 400 Bad Request
{
    "status": "error",
    "message": "keys and filenames count not match"
}

aaron-lin/internal-api 适用场景与选型建议

aaron-lin/internal-api 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 0 次下载、GitHub Stars 达 0, 最近一次更新时间为 2023 年 05 月 26 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 aaron-lin/internal-api 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 aaron-lin/internal-api 我们能提供哪些服务?
定制开发 / 二次开发

基于 aaron-lin/internal-api 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2023-05-26