API Migration Overview

來源專案:get-lancer-php56
目標專案:pro360_api_82
用途:追蹤 legacy JSON/API endpoint 在新專案的對應狀態。

完整導覽見 README.md

範圍

本批文件整理 legacy 專案中非 admin_* 且明確具有 JSON/API 行為的 endpoint。判斷依據包含:

  • $this->RequestHandler->prefers('json')
  • RestApiHelper
  • json_encode()$this->response->body(json_encode(...))
  • AJAX 分支回傳 JSON 或類 JSON 資料

CakePHP 舊專案有 Router::parseExtensions(..., 'json', ...),多數 endpoint 可用 /{controller}/{action}.json 存取。Quotes plugin 的公開 API 實際以 top-level /quote_* 路徑為主,例如 /quote_requests/search_add.json/quote_bids/view_ext/...

認證模型

legacy JSON API 主要由 app/Controller/AppController.php 控制:

  • 一般 .json request 需要 X-PRO360-Rest-Api-Key
  • 需要登入的 API 會再驗證 X-PRO360-User-Session-Token
  • session 驗證成功後,user id 會寫入 request param X-PRO360-User-Id
  • 全域 API key 例外包含 quote_requests/search_add.json 與部分 webhook。

狀態定義

狀態意義
未找到新專案尚未找到同名或明確 replacement action
同路徑已存在新專案有同 path/action,但仍可能需要驗 payload/side effect
已補 action已完成本次 migration 實作
PHPUnit 已覆蓋已有自動測試覆蓋主要路徑
待實測已實作或已存在,但還需要 staging/manual 驗證
不需搬移legacy helper 或非獨立 API
可能需改路徑新專案有語意相近 endpoint,但 path/action 不一致

Module Index

模組Endpoint inventoryDetail index
QuoteRequestsquote_requests.mddetails/quote_requests/README.md
QuoteBidsquote_bids.mddetails/quote_bids/README.md
QuoteServicesquote_services.mddetails/quote_services/README.md
QuoteCategoriesquote_categories.md尚未建立 detail index
Usersusers.mddetails/users/README.md
Otherother.md尚未建立 detail index

目前優先順序

  1. quote_bids/change_status
  2. quote_bids 報價 / narrow match / contact provider
  3. quote_requests

維護方式

  • 新增一支 API 調查結果時,先更新對應 module index,再新增或更新 details/**
  • 若只是 path 是否存在,留在 module index。
  • 若已確認 DB side effect、queue/log、付款、測試或正式流量,寫進 detail 文件。
  • 不要在 overview.md 放長表格;這裡只放規則、入口與優先順序。