QuoteServices Static Fields
API:
GET /quote_services/static_fields.json功能說明
provider 建立 / 編輯服務資料時,前端會讀取這支 API。legacy 原本保留一段靜態欄位定義,但實際程式已全部註解,正式 response 固定回空陣列。
成功 response:
{"StaticFormField":[]}快速結論
- actor:只需有效 REST API key,不需要 session。
- legacy API:
QuoteServicesController::static_fields()。 - legacy path:
/quote_services/static_fields.json。 - new API:已補
Endpoint/V1/QuoteServices.php::static_fields()。 - routing:已補
Mapping.php,支援 legacy path。 - side effect:無;不讀 DB、不寫 DB、不送 queue / notification。
- 正式機流量:2026-06-03 查 legacy access log,
GET200 有 7006 筆,OPTIONS200 有 6632 筆。
正式機 Access Log
2026-06-03 查詢機器:ip-10-5-2-242
| 筆數 | method / path | status |
|---|---|---|
| 7006 | GET /quote_services/static_fields.json | 200 |
| 6632 | OPTIONS /quote_services/static_fields.json | 200 |
caller 包含 web、mobile web、iOS / Android app webview。
Legacy Rule
legacy 檔案:
/Users/mattsu/Documents/Site/get-lancer-php56/app/Plugin/Quotes/Controller/QuoteServicesController.php:3117legacy 實際規則:
- 只在 JSON request 下輸出。
- 讀
Configure::read('site.language'),但目前欄位定義整段被註解,不影響 response。 - 設定
$fields = []。 - 回
{"StaticFormField":[]}。
Side Effect
不做:
- 不讀 DB。
- 不寫
quote_services/quote_service_categories。 - 不建立 activity。
- 不送 event queue / task queue。
- 不讀 mail / SMS / URL / icon / fee threshold config。
New PHP 8.2 對照
| new 檔案 | 對應 legacy | 職責 | 狀態 |
|---|---|---|---|
Lib/Common/RouterRule/Mapping.php | legacy path | 將 /quote_services/static_fields.json route 到 QuoteServices::static_fields()。 | 已補 |
Endpoint/V1/QuoteServices.php::static_fields() | QuoteServicesController::static_fields() | API key guard 與固定 response。 | 已補 |
tests/QuoteServicesStaticFieldsTest.php | success response | 驗證 legacy 空欄位 response。 | 已補 |
測試
docker exec -w /project-data cd63f9147e8d vendor/bin/phpunit tests/QuoteServicesStaticFieldsTest.php測試覆蓋:
- legacy path 可 route 到 new action。
- 有效 API key 回
{"StaticFormField":[]}。