feat(smzdm): require 1:1 cover and surface image fetch failure prompt
Add SMZDM to the cover-required platform list on both client and server, register a 800x800 native cover spec in the admin cover catalog, and normalize the desktop-client `smzdm_image_fetch_failed` adapter error to a user-friendly Chinese prompt across the publisher error pipeline. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -151,7 +151,7 @@ func publishBatchRequiresCover(accounts []platformAccountSeed) bool {
|
||||
|
||||
func publishPlatformRequiresCover(platformID string) bool {
|
||||
switch strings.TrimSpace(platformID) {
|
||||
case "weixin_gzh", "baijiahao", "dongchedi":
|
||||
case "weixin_gzh", "baijiahao", "dongchedi", "smzdm":
|
||||
return true
|
||||
default:
|
||||
return false
|
||||
|
||||
@@ -5,7 +5,7 @@ import "testing"
|
||||
func TestPublishPlatformRequiresCover(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
for _, platformID := range []string{"weixin_gzh", "baijiahao", "dongchedi"} {
|
||||
for _, platformID := range []string{"weixin_gzh", "baijiahao", "dongchedi", "smzdm"} {
|
||||
if !publishPlatformRequiresCover(platformID) {
|
||||
t.Fatalf("publishPlatformRequiresCover(%q) = false, want true", platformID)
|
||||
}
|
||||
@@ -19,12 +19,12 @@ func TestPublishPlatformRequiresCover(t *testing.T) {
|
||||
func TestPublishCoverRequirementCallersIncludeWeixinGzh(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
accounts := []platformAccountSeed{{PlatformID: "weixin_gzh"}}
|
||||
accounts := []platformAccountSeed{{PlatformID: "weixin_gzh"}, {PlatformID: "smzdm"}}
|
||||
if !publishBatchRequiresCover(accounts) {
|
||||
t.Fatal("publishBatchRequiresCover() = false for weixin_gzh, want true")
|
||||
t.Fatal("publishBatchRequiresCover() = false for cover-required platforms, want true")
|
||||
}
|
||||
|
||||
if !schedulePublishPlatformsRequireCover([]string{"weixin_gzh"}) {
|
||||
t.Fatal("schedulePublishPlatformsRequireCover() = false for weixin_gzh, want true")
|
||||
if !schedulePublishPlatformsRequireCover([]string{"weixin_gzh", "smzdm"}) {
|
||||
t.Fatal("schedulePublishPlatformsRequireCover() = false for cover-required platforms, want true")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user