Merge remote-tracking branch 'origin/master' into feat/pricing-plan
Project CI / Backend tests (pull_request) Failing after 48s
Project CI / Native shell tests (pull_request) Failing after 3m50s
Project CI / AI game creator shell Rust crates (pull_request) Successful in 5m21s
Project CI / Frontend tests (pull_request) Failing after 47s
Project CI / AI game creator shell web tests (pull_request) Failing after 39s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 6m6s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 7m23s
Project CI / Repository checks (pull_request) Successful in 6m31s

# Conflicts:
#	docs/project-memory/shared-memory/decision-log.md
This commit is contained in:
2026-10-05 10:50:30 +08:00
165 changed files with 13827 additions and 1670 deletions
+50 -10
View File
@@ -1101,6 +1101,7 @@ function route(pathname, method, url, requestBody = '') {
publicationRevision: versions[0]?.versionNumber ?? 0,
createdAt: iso(60 * 24 * 20),
updatedAt: iso(60 * 3),
deletedAt: null,
versions,
});
const version = (versionId, versionNumber, status, bytes) => ({
@@ -1115,17 +1116,56 @@ function route(pathname, method, url, requestBody = '') {
reviewReason: null,
entryUrl: `https://games.example.com/${versionId}/index.html`,
});
const allGames = [
game('game_1001', '陶泥小世界', '阿陶', 'published', 345, [
version('ver_1001_7', 7, 'published', 18_400_000),
version('ver_1001_6', 6, 'published', 17_900_000),
]),
game('game_1002', '纸片拼图计划', '小满', 'suspended', 96, [
version('ver_1002_3', 3, 'suspended', 5_120_004),
]),
game('game_1003', '三消工坊', '老周', 'unpublished', 12, []),
{
...game('game_1004', '已删除的试作', '阿陶', 'unpublished', 4, []),
status: 'deleted',
deletedAt: iso(60 * 2),
},
];
const limit = Math.min(
Math.max(Number(url.searchParams.get('limit') ?? 50) || 50, 1),
200,
);
const keyword = (url.searchParams.get('keyword') ?? '')
.trim()
.toLowerCase();
const owner = (url.searchParams.get('owner') ?? '').trim();
const status = (url.searchParams.get('status') ?? '').trim();
const offset = Number(url.searchParams.get('cursor') ?? 0) || 0;
// 状态/关键词/作者过滤与游标语义跟服务端保持一致:默认排除已删除作品。
const filtered = allGames.filter((entry) => {
if (status === 'deleted') {
if (entry.status !== 'deleted') return false;
} else if (status) {
if (entry.status !== status || entry.deletedAt) return false;
} else if (entry.deletedAt) {
return false;
}
if (owner && entry.author.id !== owner) return false;
if (
keyword &&
!entry.title.toLowerCase().includes(keyword) &&
!entry.gameId.toLowerCase().includes(keyword) &&
!entry.author.id.toLowerCase().includes(keyword)
) {
return false;
}
return true;
});
const page = filtered.slice(offset, offset + limit);
const nextOffset = offset + page.length;
return {
games: [
game('game_1001', '陶泥小世界', '阿陶', 'published', 345, [
version('ver_1001_7', 7, 'published', 18_400_000),
version('ver_1001_6', 6, 'published', 17_900_000),
]),
game('game_1002', '纸片拼图计划', '小满', 'suspended', 96, [
version('ver_1002_3', 3, 'suspended', 5_120_004),
]),
game('game_1003', '三消工坊', '老周', 'unpublished', 12, []),
],
games: page,
nextCursor: nextOffset < filtered.length ? String(nextOffset) : null,
};
}
if (pathname === '/admin/api/editor-assets') {