feat(enterprise-site): add WordPress support and scheduled auto-publish to sites
Add WordPress as an enterprise-site CMS type alongside pbootcms, and let schedule tasks auto-publish generated articles to enterprise sites. - WordPress connection/publisher service and tests; register wordpress media platform and relax cms_type CHECK constraint - New publish_enterprise_site_targets JSONB column on schedule_tasks with array type constraint; thread targets through scheduler dispatch, prompt/KOL generation, and worker - Admin UI: enterprise-site targets in generate/schedule/publish flows, KOL package form, MediaView, and i18n strings Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -66,10 +66,34 @@ type pbootCMSRequestError struct {
|
||||
routeUnavailable bool
|
||||
}
|
||||
|
||||
type unsupportedCMSPublisher struct {
|
||||
cmsType string
|
||||
}
|
||||
|
||||
func (err *pbootCMSRequestError) Error() string {
|
||||
return err.message
|
||||
}
|
||||
|
||||
func (p unsupportedCMSPublisher) Ping(context.Context, enterpriseSiteCredential) (*EnterpriseSiteCapability, map[string]any, error) {
|
||||
return nil, nil, p.err()
|
||||
}
|
||||
|
||||
func (p unsupportedCMSPublisher) Categories(context.Context, enterpriseSiteCredential) ([]EnterpriseSiteCategoryItem, []map[string]any, error) {
|
||||
return nil, nil, p.err()
|
||||
}
|
||||
|
||||
func (p unsupportedCMSPublisher) Publish(context.Context, enterpriseSiteCredential, cmsPublishRequest) (*cmsPublishResult, map[string]any, error) {
|
||||
return nil, nil, p.err()
|
||||
}
|
||||
|
||||
func (p unsupportedCMSPublisher) err() error {
|
||||
cmsType := strings.TrimSpace(p.cmsType)
|
||||
if cmsType == "" {
|
||||
cmsType = "CMS"
|
||||
}
|
||||
return fmt.Errorf("unsupported cms type: %s", cmsType)
|
||||
}
|
||||
|
||||
func newPBootCMSPublisher(client *http.Client) *pbootCMSPublisher {
|
||||
if client == nil {
|
||||
client = &http.Client{Timeout: 20 * time.Second}
|
||||
|
||||
Reference in New Issue
Block a user