From c537e0086570844ce7b79eccd26e6e3fcc89c3c1 Mon Sep 17 00:00:00 2001 From: Txiaochen Date: Wed, 7 Oct 2026 15:01:10 +0800 Subject: [PATCH] =?UTF-8?q?docs(README):=20=E8=A1=A5=E5=85=85=20isNew*=20?= =?UTF-8?q?=E4=BD=8D=E4=B8=B2=200/1/2=20=E7=9A=84=E5=90=AB=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 依据 VOExtensions.cs:309-364 的 BuildListData(): 0 = 存量更新(旧数据里已有同主键条目)-> UPDATE 1 = 新增(旧数据里没有) -> INSERT 2 = 无变化(只有 userFavoriteList 用) 并写明:对已存在的条目填 1 会导致 HTTP 500(服务端 INSERT 重复记录)。 --- README.md | 21 +++++++++++++++++++++ extra.json | 1 + 2 files changed, 22 insertions(+) create mode 100644 extra.json diff --git a/README.md b/README.md index f08c324..4245d90 100644 --- a/README.md +++ b/README.md @@ -187,6 +187,27 @@ python upsert.py "<二维码>" --send --extra-data extra.json > ⚠️ 在 PowerShell / CMD 里写内联 JSON 很容易被吞掉双引号,**建议一律用文件**。 +### ★ `isNew*` 位串:0 / 1 / 2 的含义 + +每个数组节点都配一条 `isNew*` 位串,**一位对应数组里的一条**(顺序必须一致)。 + +依据 `source/Assembly-CSharp/Net.VO.Mai2/VOExtensions.cs:309-364` 的 `BuildListData()`: + +| 位 | 含义 | 服务端行为 | +|---|---|---| +| `0` | **存量更新** —— 旧数据里**已有**同主键的条目 | UPDATE | +| `1` | **新增** —— 旧数据里**没有**同主键的条目 | INSERT | +| `2` | **无变化** —— 只有 `userFavoriteList` 用,其他节点不会出现 | 跳过 | + +主键见 `api/upsert_user_all.py` 的 `DIFF_PRIMARY_KEYS` +(如 `userKaleidxScopeList` 用 `gateId`、`userMusicDetailList` 用 `musicId`+`level`)。 + +> ⚠️ **对已存在的条目填 `1` 会 HTTP 500** —— 服务端会去 INSERT 一条重复记录。 +> 真机抓包样本里 `isNewFavoriteList = "22212"`,可以直观看到 0/1/2 混用的样子。 + +> **不确定填什么?** 先看 `data/<你的userId>.json` 里对应的节点: +> 主键已存在 → `0`,不存在 → `1`。 + --- ## buy_ticket.py —— 购买功能票 diff --git a/extra.json b/extra.json new file mode 100644 index 0000000..ad76d67 --- /dev/null +++ b/extra.json @@ -0,0 +1 @@ +{"userKaleidxScopeList": [{"gateId": 1, "isGateFound": true, "isKeyFound": true, "isClear": false,"totalRestLife": 0, "totalAchievement": 0, "totalDeluxscore": 0,"bestAchievement": 0, "bestDeluxscore": 0,"bestAchievementDate": "", "bestDeluxscoreDate": "","playCount": 0, "clearDate": "", "lastPlayDate": "", "isInfoWatched": false},{"gateId": 3, "isGateFound": true, "isKeyFound": true, "isClear": false,"totalRestLife": 0, "totalAchievement": 0, "totalDeluxscore": 0,"bestAchievement": 0, "bestDeluxscore": 0,"bestAchievementDate": "", "bestDeluxscoreDate": "","playCount": 0, "clearDate": "", "lastPlayDate": "", "isInfoWatched": false},{"gateId": 4, "isGateFound": true, "isKeyFound": true, "isClear": false,"totalRestLife": 0, "totalAchievement": 0, "totalDeluxscore": 0,"bestAchievement": 0, "bestDeluxscore": 0,"bestAchievementDate": "", "bestDeluxscoreDate": "","playCount": 0, "clearDate": "", "lastPlayDate": "", "isInfoWatched": false},{"gateId": 5, "isGateFound": true, "isKeyFound": true, "isClear": false,"totalRestLife": 0, "totalAchievement": 0, "totalDeluxscore": 0,"bestAchievement": 0, "bestDeluxscore": 0,"bestAchievementDate": "", "bestDeluxscoreDate": "","playCount": 0, "clearDate": "", "lastPlayDate": "", "isInfoWatched": false},{"gateId": 6, "isGateFound": true, "isKeyFound": true, "isClear": false,"totalRestLife": 0, "totalAchievement": 0, "totalDeluxscore": 0,"bestAchievement": 0, "bestDeluxscore": 0,"bestAchievementDate": "", "bestDeluxscoreDate": "","playCount": 0, "clearDate": "", "lastPlayDate": "", "isInfoWatched": false}],"isNewKaleidxScopeList": "11111"} \ No newline at end of file