51 lines
1.0 KiB
Go
51 lines
1.0 KiB
Go
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,
|
||
},
|
||
}
|