Skip to content

Commit 5cbc932

Browse files
committed
🔥 删除注释
1 parent e020bf0 commit 5cbc932

File tree

3 files changed

+2
-30
lines changed

3 files changed

+2
-30
lines changed

plugin/rsshub/domain/model.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ import (
99

1010
// ======== RSS ========[START]
1111

12-
// type SingleFeedItem gofeed.Item
13-
1412
func genHashForFeedItem(link, guid string) string {
1513
idString := link + "||" + guid
1614
h := fnv.New32()
@@ -51,8 +49,6 @@ type RssSource struct {
5149
Link string `gorm:"column:link" json:"link"`
5250
// UpdatedParsed RSS页面更新时间
5351
UpdatedParsed time.Time `gorm:"column:updated_parsed" json:"updated_parsed"`
54-
//// Ctime create time
55-
// Ctime int64 `gorm:"column:ctime;default:current_timestamp" json:"ctime"`
5652
// Mtime update time
5753
Mtime time.Time `gorm:"column:mtime;default:current_timestamp;" json:"mtime"`
5854
}
@@ -83,8 +79,6 @@ type RssContent struct {
8379
Author string `gorm:"column:author" json:"author"`
8480
Thumbnail string `gorm:"column:thumbnail" json:"thumbnail"`
8581
Content string `gorm:"column:content" json:"content"`
86-
//// Ctime create time
87-
// Ctime int64 `gorm:"column:ctime;default:current_timestamp" json:"ctime"`
8882
// Mtime update time
8983
Mtime time.Time `gorm:"column:mtime;default:current_timestamp;" json:"mtime"`
9084
}
@@ -109,8 +103,6 @@ type RssSubscribe struct {
109103
GroupID int64 `gorm:"column:group_id;not null;uniqueIndex:uk_sid_gid"`
110104
// 订阅频道
111105
RssSourceID int64 `gorm:"column:rss_source_id;not null;uniqueIndex:uk_sid_gid"`
112-
//// Ctime create time
113-
// Ctime int64 `gorm:"column:ctime;default:current_timestamp" json:"ctime"`
114106
// Mtime update time
115107
Mtime time.Time `gorm:"column:mtime;default:current_timestamp;" json:"mtime"`
116108
}

plugin/rsshub/domain/rawFeed.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,6 @@ import (
1212
"github.com/sirupsen/logrus"
1313
)
1414

15-
// const (
16-
// 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"
17-
// 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"
18-
//)
19-
2015
var (
2116
// RSSHubMirrors RSSHub镜像站地址列表,第一个为默认地址
2217
rssHubMirrors = []string{
@@ -48,10 +43,6 @@ func (c *RssHubClient) FetchFeed(path string) (feed *gofeed.Feed, err error) {
4843
logrus.Errorf("[rsshub FetchFeed] fetch feed error: data is empty")
4944
return nil, errors.New("feed data is empty")
5045
}
51-
// data, err = web.RequestDataWith(c.Client, domain+path, "GET", "", web.RandUA(), nil)
52-
// if err != nil {
53-
// return nil, err
54-
//}
5546
feed, err = gofeed.NewParser().Parse(bytes.NewBuffer(data))
5647
if err != nil {
5748
return

plugin/rsshub/main.go

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,8 @@ import (
1818

1919
// 初始化 repo
2020
var (
21-
rssRepo domain.RssDomain
22-
initErr error
23-
//// getRssRepo repo 初始化方法,单例
24-
// getRssRepo = ctxext.DoOnceOnSuccess(func(ctx *zero.Ctx) bool {
25-
// logrus.Infoln("RssHub订阅姬:初始化")
26-
// rssRepo, initErr = domain.NewRssDomain(engine.DataFolder() + "rsshub.db")
27-
// if initErr != nil {
28-
// ctx.SendChain(message.Text("RssHub订阅姬:初始化失败", initErr.Error()))
29-
// return false
30-
// }
31-
// return true
32-
// })
33-
// regexpForSQL 防注入
21+
rssRepo domain.RssDomain
22+
initErr error
3423
regexpForSQL = regexp.MustCompile(`[\^<>\[\]%&\*\(\)\{\}\|\=]|(union\s+select|update\s+|delete\s+|drop\s+|truncate\s+|insert\s+|exec\s+|declare\s+)`)
3524
)
3625

0 commit comments

Comments
 (0)