fix(db): 优化私有文件鉴权与清理查询

This commit is contained in:
yml
2026-11-16 23:07:16 +08:00
parent 4f8edce1cf
commit cacf519493
5 changed files with 543 additions and 209 deletions
@@ -71,6 +71,7 @@ func TestPrivateFileAuthorizer(t *testing.T) {
{name: "已审核上架商品中等图变体对任意登录用户开放", userID: 99, key: "misc/2026/09/16/984a80162e94e3b89090d1f8.medium.jpg", allowed: true},
{name: "提现申请人可读取自己的打款凭证", userID: 51, key: "payment-proof/receipt.jpg", allowed: true},
{name: "其他用户不可读取他人的打款凭证", userID: 99, key: "payment-proof/receipt.jpg", allowed: false},
{name: "未知场景默认拒绝", userID: 99, key: "unknown/random.jpg", allowed: false},
}
for _, tc := range cases {
t.Run(tc.name, func(t *testing.T) {