feat: Phase 1 — core game loop complete
New endpoints: - GET /cards/:card_id single card lookup - POST /packs/buy purchase pack with coins - POST /objectives/claim claim completed objective reward - GET /matches match history (limit/mode query params) - GET /sbc/:sbc_id single SBC lookup Card pool expanded: - Bronze: 11 → 30 cards (19 nations) - Silver: 0 → 20 cards (20 nations) - Rare Gold: 0 → 10 cards (10 nations) SBC pool expanded: - Added 5 new SBCs (tri_nations, silver_to_gold, league_loyalty, african_stars, gold_standard) Infrastructure: - SQLite WAL mode enabled on pool init - Foreign key enforcement enabled Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+17
-2
@@ -1,9 +1,12 @@
|
||||
use axum::{extract::State, Json};
|
||||
use axum::{
|
||||
extract::{Path, State},
|
||||
Json,
|
||||
};
|
||||
use serde_json::{json, Value};
|
||||
|
||||
use crate::{
|
||||
app::AppState,
|
||||
error::AppResult,
|
||||
error::{AppError, AppResult},
|
||||
models::sbc::{SbcResult, SubmitSbcRequest},
|
||||
services::{club as club_svc, profile as profile_svc, sbc as sbc_svc},
|
||||
};
|
||||
@@ -12,6 +15,18 @@ pub async fn get_sbcs(State(state): State<AppState>) -> AppResult<Json<Value>> {
|
||||
Ok(Json(json!({ "sbcs": state.sbc_defs })))
|
||||
}
|
||||
|
||||
pub async fn get_sbc(
|
||||
State(state): State<AppState>,
|
||||
Path(sbc_id): Path<String>,
|
||||
) -> AppResult<Json<Value>> {
|
||||
let sbc = state
|
||||
.sbc_defs
|
||||
.iter()
|
||||
.find(|s| s.id == sbc_id)
|
||||
.ok_or_else(|| AppError::NotFound(format!("SBC '{sbc_id}' not found")))?;
|
||||
Ok(Json(json!({ "sbc": sbc })))
|
||||
}
|
||||
|
||||
pub async fn post_sbc_submit(
|
||||
State(state): State<AppState>,
|
||||
Json(req): Json<SubmitSbcRequest>,
|
||||
|
||||
Reference in New Issue
Block a user