mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2025-12-20 22:40:23 +08:00
🔥 删除注释
This commit is contained in:
parent
e020bf0d0f
commit
5cbc9329d3
@ -9,8 +9,6 @@ import (
|
|||||||
|
|
||||||
// ======== RSS ========[START]
|
// ======== RSS ========[START]
|
||||||
|
|
||||||
// type SingleFeedItem gofeed.Item
|
|
||||||
|
|
||||||
func genHashForFeedItem(link, guid string) string {
|
func genHashForFeedItem(link, guid string) string {
|
||||||
idString := link + "||" + guid
|
idString := link + "||" + guid
|
||||||
h := fnv.New32()
|
h := fnv.New32()
|
||||||
@ -51,8 +49,6 @@ type RssSource struct {
|
|||||||
Link string `gorm:"column:link" json:"link"`
|
Link string `gorm:"column:link" json:"link"`
|
||||||
// UpdatedParsed RSS页面更新时间
|
// UpdatedParsed RSS页面更新时间
|
||||||
UpdatedParsed time.Time `gorm:"column:updated_parsed" json:"updated_parsed"`
|
UpdatedParsed time.Time `gorm:"column:updated_parsed" json:"updated_parsed"`
|
||||||
//// Ctime create time
|
|
||||||
// Ctime int64 `gorm:"column:ctime;default:current_timestamp" json:"ctime"`
|
|
||||||
// Mtime update time
|
// Mtime update time
|
||||||
Mtime time.Time `gorm:"column:mtime;default:current_timestamp;" json:"mtime"`
|
Mtime time.Time `gorm:"column:mtime;default:current_timestamp;" json:"mtime"`
|
||||||
}
|
}
|
||||||
@ -83,8 +79,6 @@ type RssContent struct {
|
|||||||
Author string `gorm:"column:author" json:"author"`
|
Author string `gorm:"column:author" json:"author"`
|
||||||
Thumbnail string `gorm:"column:thumbnail" json:"thumbnail"`
|
Thumbnail string `gorm:"column:thumbnail" json:"thumbnail"`
|
||||||
Content string `gorm:"column:content" json:"content"`
|
Content string `gorm:"column:content" json:"content"`
|
||||||
//// Ctime create time
|
|
||||||
// Ctime int64 `gorm:"column:ctime;default:current_timestamp" json:"ctime"`
|
|
||||||
// Mtime update time
|
// Mtime update time
|
||||||
Mtime time.Time `gorm:"column:mtime;default:current_timestamp;" json:"mtime"`
|
Mtime time.Time `gorm:"column:mtime;default:current_timestamp;" json:"mtime"`
|
||||||
}
|
}
|
||||||
@ -109,8 +103,6 @@ type RssSubscribe struct {
|
|||||||
GroupID int64 `gorm:"column:group_id;not null;uniqueIndex:uk_sid_gid"`
|
GroupID int64 `gorm:"column:group_id;not null;uniqueIndex:uk_sid_gid"`
|
||||||
// 订阅频道
|
// 订阅频道
|
||||||
RssSourceID int64 `gorm:"column:rss_source_id;not null;uniqueIndex:uk_sid_gid"`
|
RssSourceID int64 `gorm:"column:rss_source_id;not null;uniqueIndex:uk_sid_gid"`
|
||||||
//// Ctime create time
|
|
||||||
// Ctime int64 `gorm:"column:ctime;default:current_timestamp" json:"ctime"`
|
|
||||||
// Mtime update time
|
// Mtime update time
|
||||||
Mtime time.Time `gorm:"column:mtime;default:current_timestamp;" json:"mtime"`
|
Mtime time.Time `gorm:"column:mtime;default:current_timestamp;" json:"mtime"`
|
||||||
}
|
}
|
||||||
|
|||||||
@ -12,11 +12,6 @@ import (
|
|||||||
"github.com/sirupsen/logrus"
|
"github.com/sirupsen/logrus"
|
||||||
)
|
)
|
||||||
|
|
||||||
// const (
|
|
||||||
// acceptHeader = "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9"
|
|
||||||
// userHeader = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.135 Safari/537.36 Edg/84.0.522.63"
|
|
||||||
//)
|
|
||||||
|
|
||||||
var (
|
var (
|
||||||
// RSSHubMirrors RSSHub镜像站地址列表,第一个为默认地址
|
// RSSHubMirrors RSSHub镜像站地址列表,第一个为默认地址
|
||||||
rssHubMirrors = []string{
|
rssHubMirrors = []string{
|
||||||
@ -48,10 +43,6 @@ func (c *RssHubClient) FetchFeed(path string) (feed *gofeed.Feed, err error) {
|
|||||||
logrus.Errorf("[rsshub FetchFeed] fetch feed error: data is empty")
|
logrus.Errorf("[rsshub FetchFeed] fetch feed error: data is empty")
|
||||||
return nil, errors.New("feed data is empty")
|
return nil, errors.New("feed data is empty")
|
||||||
}
|
}
|
||||||
// data, err = web.RequestDataWith(c.Client, domain+path, "GET", "", web.RandUA(), nil)
|
|
||||||
// if err != nil {
|
|
||||||
// return nil, err
|
|
||||||
//}
|
|
||||||
feed, err = gofeed.NewParser().Parse(bytes.NewBuffer(data))
|
feed, err = gofeed.NewParser().Parse(bytes.NewBuffer(data))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
|
|||||||
@ -20,17 +20,6 @@ import (
|
|||||||
var (
|
var (
|
||||||
rssRepo domain.RssDomain
|
rssRepo domain.RssDomain
|
||||||
initErr error
|
initErr error
|
||||||
//// getRssRepo repo 初始化方法,单例
|
|
||||||
// getRssRepo = ctxext.DoOnceOnSuccess(func(ctx *zero.Ctx) bool {
|
|
||||||
// logrus.Infoln("RssHub订阅姬:初始化")
|
|
||||||
// rssRepo, initErr = domain.NewRssDomain(engine.DataFolder() + "rsshub.db")
|
|
||||||
// if initErr != nil {
|
|
||||||
// ctx.SendChain(message.Text("RssHub订阅姬:初始化失败", initErr.Error()))
|
|
||||||
// return false
|
|
||||||
// }
|
|
||||||
// return true
|
|
||||||
// })
|
|
||||||
// regexpForSQL 防注入
|
|
||||||
regexpForSQL = regexp.MustCompile(`[\^<>\[\]%&\*\(\)\{\}\|\=]|(union\s+select|update\s+|delete\s+|drop\s+|truncate\s+|insert\s+|exec\s+|declare\s+)`)
|
regexpForSQL = regexp.MustCompile(`[\^<>\[\]%&\*\(\)\{\}\|\=]|(union\s+select|update\s+|delete\s+|drop\s+|truncate\s+|insert\s+|exec\s+|declare\s+)`)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user