PAR-116
0
Public ChestShop market REST endpoints (shops/items/stats)
DoneHighUnassignedTreasury API
Expose the public ChestShop market data that economy-explorer renders, as lightweight, cacheable, rate-limited REST endpoints under /api/v1/chestshop/** so external consumers can hit them hard without overloading the DB.
Endpoints (all public — no JWT; anonymous IP rate-limited):
GET /api/v1/chestshop/shops— live shop directory fromchestshop_shop(filters: itemKey, material, firmId, buyable, inStock, search; paged, limit≤100). Single indexed table; in-stock-then-cheapest ordering.GET /api/v1/chestshop/items— item directory with all-time aggregate stats (trade_count, total_quantity, total_volume) fromchestshop_saleGROUP BY item_key; optional search; paged. Cached.GET /api/v1/chestshop/items/{itemKey}— per-item summary: windowed stats + cheapest live shops + daily price points. Cached.GET /api/v1/chestshop/stats— global market totals (sales, volume, distinct items). Cached (longer TTL).
Performance posture (the load constraint):
- Caffeine-backed Spring cache on the aggregate endpoints (compute once per short TTL).
@RateLimit(anonymousPerMinute=…)caps scrapers (callers are anonymous via JwtAuthFilter#shouldNotFilter).- Pagination caps + offset-overflow guard; only indexed filter columns.
- Deliberately EXCLUDES the financial-sensitive drilldowns economy-explorer login-gates (per-customer sales feed, per-seller/per-player money).
Tests:
- treasury-rest-api: through-DAL
EmbeddedDbIT(MariaDB4j) — query/aggregation/pagination/validation, incl. chestshop_sale/chestshop_shop added to the embedded fixture. - integration-tests: E2E
restapi/ChestShopEndpointsTest— real in-game trade via ChestShopFixture, then hit the live endpoints and assert.
Both repos on develop.
Resources
- commitf5c76e2 Release treasury-rest-api 2.1.0 (PAR-39, PAR-102, PAR-116)MCCitiesNetwork/treasury-rest-api
- commitbc37c28 Add public ChestShop market REST endpoints (PAR-116)MCCitiesNetwork/treasury-rest-api
Comments
No comments yet.
Activity
- ParadauxIO linked a commit — Commit f5c76e2 — Release treasury-rest-api 2.1.0 (PAR-39, PAR-102, PAR-116)
- ParadauxIO linked a commit — Commit bc37c28 — Add public ChestShop market REST endpoints (PAR-116)
- ParadauxIO changed status to Status → Done
- ParadauxIO linked a commit — Commit f5c76e2 — Release treasury-rest-api 2.1.0 (PAR-39, PAR-102, PAR-116)
- tesks changed status to Status → Pending Release
- ParadauxIO linked a commit — Commit bc37c28 — Add public ChestShop market REST endpoints (PAR-116)
- tesks created the issue