first commit

This commit is contained in:
npc0-hue
2026-07-11 14:56:10 +08:00
commit 7e05d0a4e7
660 changed files with 78119 additions and 0 deletions
@@ -0,0 +1,30 @@
## Why
The platform backend has typed core resources and service workflows, but clients still cannot exercise them through HTTP. This change adds the first platform API surface so later frontend, run, and plugin work can depend on stable handler behavior instead of calling services directly.
## What Changes
- Add HTTP route handlers for core platform resources using the existing domain, DTO, validator, repository, and service packages.
- Support create, list, and detail workflows for users, AI providers, game management plugins, server instances, run endpoints, jobs, artifacts, log streams, and audit events.
- Return JSON error responses for malformed requests, validation failures, duplicates, and missing resources.
- Preserve AI provider redaction by returning only API key references and never raw provider keys.
- Wire the platform router to an in-memory service instance for local development while keeping handlers injectable for tests and future persistence.
- Update route catalog documentation to reflect the implemented API paths.
## Capabilities
### New Capabilities
- `platform-api-surface`: HTTP API handlers, route wiring, request decoding, response encoding, and error behavior for core platform resources.
### Modified Capabilities
- None.
## Impact
- Affects `platform/` only.
- Adds platform API handler code and focused handler tests.
- Extends DTO helpers for request-to-domain conversion and JSON error response contracts.
- Uses only Go standard library HTTP routing and the existing in-memory core service.
- Does not add authentication, authorization, SQL persistence, frontend behavior, run executor behavior, billing, cloud host sales, or direct plugin/run access.