feat(distribution): 支持分站发布群固定二维码
主站分销配置可为每个站点绑定可复用企微码,号主在该站上传账号后发到对应发布群,不再消耗主站码池。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user