feat(distribution): 支持分站发布群固定二维码

主站分销配置可为每个站点绑定可复用企微码,号主在该站上传账号后发到对应发布群,不再消耗主站码池。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
yml2213
2026-09-15 19:02:10 +08:00
co-authored by Cursor
parent 776c33f83c
commit 1c86bef765
9 changed files with 397 additions and 16 deletions
@@ -649,6 +649,23 @@ func TestDistributionBrandingAndMarkup(t *testing.T) {
t.Fatalf("unexpected branding: %+v", updated)
}
qrURL := "/api/files/object?key=qrcode/brand-site.png"
qrUpdated, err := repo.UpdateSite(t.Context(), 0, site.ID, UpdateSiteRequest{ListingQrcodeURL: &qrURL})
if err != nil {
t.Fatalf("UpdateSite listing qrcode failed: %v", err)
}
if qrUpdated.ListingQrcodeURL != qrURL {
t.Fatalf("listing_qrcode_url = %q, want %q", qrUpdated.ListingQrcodeURL, qrURL)
}
cleared := ""
qrCleared, err := repo.UpdateSite(t.Context(), 0, site.ID, UpdateSiteRequest{ListingQrcodeURL: &cleared})
if err != nil {
t.Fatalf("clear listing qrcode failed: %v", err)
}
if qrCleared.ListingQrcodeURL != "" {
t.Fatalf("cleared listing_qrcode_url = %q, want empty", qrCleared.ListingQrcodeURL)
}
// Verify PublicSiteInfo contains branding
pubInfo, err := repo.GetPublicSiteInfo(t.Context(), "brand_site", "")
if err != nil {