geoGo/internal/publisher/interface.go

51 lines
1.0 KiB
Go
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package publisher
import (
"geo/internal/config"
"log"
)
type PublisherInerface interface {
PublishNote() (bool, string)
WaitLogin() (bool, string)
}
type NewPublisher func(
headless bool,
title string,
content string,
tags []string,
tenantID string,
platIndex string,
requestID string,
imagePath string,
wordPath string,
platInfo map[string]interface{},
cfg *config.Config,
logger *log.Logger) PublisherInerface
type PublisherValue struct {
Name string
InitMethod NewPublisher
ContentFormat string //需要的文章格式html,text,markdown
ImgNeed int8 //是否需要图片1需要2非必须3不要
Type int8 //类型1文章2视频
}
var PublisherMap = map[string]*PublisherValue{
"xhs": {
Name: "小红书",
InitMethod: NewXiaohongshuPublisher,
ContentFormat: "text",
ImgNeed: 3,
Type: 1,
},
"bjh": {
Name: "百家号",
InitMethod: NewBaijiahaoPublisher,
ContentFormat: "text",
ImgNeed: 1,
Type: 1,
},
}