Documentation
¶
Index ¶
Constants ¶
View Source
const ( FilterQuery string = "" /* 315-byte string literal not displayed */ ExceptQuery string = "" /* 127-byte string literal not displayed */ )
View Source
const (
DoNotUnmarshal = "--" + doNotUnmarshal
)
View Source
const MagicKey string = "__magic_key__"
Variables ¶
View Source
var MaxTextLength = 18
Functions ¶
This section is empty.
Types ¶
type Api ¶
type Api struct {
Method string `json:"method"`
URL string `json:"url"`
Body string `json:"body"`
Header Header `json:"header"`
Parameter pq.StringArray `json:"parameter" gorm:"type:text[]"`
// contains filtered or unexported fields
}
func (Api) DoWithContext ¶
type Blog ¶
type Blog struct {
ID uint64 `json:"id" gorm:"primaryKey;autoIncrement"`
CreatedAt time.Time `json:"created_at"`
Submitter string `json:"submitter" gorm:"index:idx_blogs_query,priority:2"` // 提交者
Platform string `json:"platform" gorm:"index:idx_blogs_query,priority:5"` // 发布平台
Type string `json:"type" gorm:"index:idx_blogs_query,priority:4"` // 博文类型
UID string `json:"uid" gorm:"index:idx_blogs_query,priority:3"` // 账户序号
MID string `json:"mid" gorm:"index:idx_blogs_query,priority:1;column:mid"` // 博文序号
URL string `json:"url"` // 博文网址
Text string `json:"text"` // 文本内容
Time time.Time `json:"time"` // 发送时间
Source string `json:"source"` // 博文来源
Edited bool `json:"edited"` // 是否编辑
Name string `json:"name"` // 账户昵称
Avatar string `json:"avatar"` // 头像网址
Follower string `json:"follower"` // 粉丝数
Following string `json:"following"` // 关注数
Description string `json:"description"` // 个人简介
ReplyID *uint64 `json:"reply_id"` // 被回复博文序号
Reply *Blog `json:"reply"` // 被回复博文
BlogID *uint64 `json:"comment_id"` // 被评论博文序号
Comments []Blog `json:"comments"` // 本博文的评论
Assets pq.StringArray `json:"assets" gorm:"type:text[]"` // 资源网址
Banner pq.StringArray `json:"banner" gorm:"type:text[]"` // 头图网址
Tags []Tag `json:"tags" gorm:"serializer:json"` // 标签
Extra map[string]any `json:"extra" gorm:"serializer:json"` // 预留项
}
博文
type Filter ¶
type Filter struct {
Submitter pq.StringArray `json:"submitter" gorm:"type:text[]"`
Platform pq.StringArray `json:"platform" gorm:"type:text[]"`
Type pq.StringArray `json:"type" gorm:"type:text[]"`
UID pq.StringArray `json:"uid" gorm:"type:text[]"`
}
type RequestLog ¶
type RequestLog struct {
ID uint64 `json:"id" gorm:"primaryKey;autoIncrement"`
CreatedAt time.Time `json:"created_at"`
TaskID uint64 `json:"task_id" gorm:"index:idx_logs_query"`
BlogID uint64 `json:"blog_id"`
MID string `json:"mid" gorm:"index:idx_logs_query;column:mid"`
Type string `json:"type" gorm:"index:idx_logs_query"`
Platform string `json:"platform" gorm:"index:idx_logs_query"`
Result string `json:"result"`
Error string `json:"error"`
}
请求记录
type Task ¶
type Task struct {
ID uint64 `json:"id" gorm:"primaryKey;autoIncrement"`
CreatedAt time.Time `json:"created_at"`
DeletedAt gorm.DeletedAt `json:"-" gorm:"index"`
Enable bool `json:"enable"`
UserID string `json:"user_id"`
Name string `json:"name"`
Filter Filter `json:"filter" gorm:"embedded"`
Api Api `json:"api" gorm:"embedded"`
RequestOnce bool `json:"request_once"`
RequestLogs []RequestLog `json:"request_logs,omitempty"`
}
任务
type Template ¶
type Template struct {
// contains filtered or unexported fields
}
func NewTemplate ¶
type User ¶
type User struct {
UID string `json:"uid" gorm:"primaryKey"`
CreatedAt time.Time `json:"created_at"`
Ban time.Time `json:"ban"` // 封禁结束时间
Role Role `json:"role"` // 权限等级
Name string `json:"name"`
Nickname string `json:"nickname"` // 权限昵称
Password string `json:"-"`
Tasks []Task `json:"tasks"`
Extra map[string]any `json:"-" gorm:"serializer:json"` // 预留项
}
用户
Click to show internal directories.
Click to hide internal directories.