Compare commits

..

10 Commits

Author SHA1 Message Date
henry.chen
27bc610a31 chore(release): 2.2.14 2024-10-10 13:39:32 +08:00
henry.chen
b53fc91ce7 fix: 1. bei_an cannot update error
2. CleanArticles deleted all article error in rdbms, fixed #43,fixed #44
2024-10-10 13:38:38 +08:00
henry.chen
720387ecd5 chore: update 2024-05-28 13:09:10 +08:00
henry.chen
88f23bd1a0 fix(serie): update serie did not rerender 2024-01-23 09:43:17 +08:00
henry.chen
6a2d720d36 chore(release): 2.2.13 2024-01-02 21:40:39 +08:00
henry.chen
95e55ee13c fix: load more comments 2024-01-02 21:39:36 +08:00
henry.chen
ca293a4933 chore(release): 2.2.12 2024-01-02 20:01:16 +08:00
henry.chen
c82d73ca34 chore: downgrade mongodb driver 2024-01-02 20:01:14 +08:00
henry.chen
433064de00 chore(release): 2.2.11 2024-01-02 19:09:40 +08:00
henry.chen
9d71ca8198 fix(disqus): fix returned posts list not have parent post 2024-01-02 19:09:37 +08:00
9 changed files with 132 additions and 2744 deletions

View File

@@ -2,6 +2,30 @@
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
### [2.2.14](https://github.com/eiblog/eiblog/compare/v2.2.13...v2.2.14) (2024-10-10)
### Bug Fixes
* 1. bei_an cannot update error ([b53fc91](https://github.com/eiblog/eiblog/commit/b53fc91ce7b67c3811c232ad6236898f84bc391b)), closes [#43](https://github.com/eiblog/eiblog/issues/43) [#44](https://github.com/eiblog/eiblog/issues/44)
* **serie:** update serie did not rerender ([88f23bd](https://github.com/eiblog/eiblog/commit/88f23bd1a0d6183d6de484cb79303506f0506d15))
### [2.2.13](https://github.com/eiblog/eiblog/compare/v2.2.12...v2.2.13) (2024-01-02)
### Bug Fixes
* load more comments ([95e55ee](https://github.com/eiblog/eiblog/commit/95e55ee13c1af13e2bb2149ccbe60013c93e4e69))
### [2.2.12](https://github.com/eiblog/eiblog/compare/v2.2.11...v2.2.12) (2024-01-02)
### [2.2.11](https://github.com/eiblog/eiblog/compare/v2.2.10...v2.2.11) (2024-01-02)
### Bug Fixes
* **disqus:** fix returned posts list not have parent post ([9d71ca8](https://github.com/eiblog/eiblog/commit/9d71ca81988bfc614d13fcb02079f0dba9ef43cc))
### [2.2.10](https://github.com/eiblog/eiblog/compare/v2.2.9...v2.2.10) (2023-12-22)
### [2.2.9](https://github.com/eiblog/eiblog/compare/v2.2.8...v2.2.9) (2023-09-25)

6
go.mod
View File

@@ -4,7 +4,7 @@ go 1.15
require (
github.com/eiblog/blackfriday v0.0.0-20161010144836-c0ec111761ae
github.com/gin-contrib/sessions v0.0.5
github.com/gin-contrib/sessions v0.0.4
github.com/gin-gonic/gin v1.9.1
github.com/lib/pq v1.10.9
github.com/qiniu/go-sdk/v7 v7.11.0
@@ -13,9 +13,9 @@ require (
github.com/swaggo/files v0.0.0-20190704085106-630677cd5c14
github.com/swaggo/gin-swagger v1.3.3
github.com/swaggo/swag v1.7.4
go.mongodb.org/mongo-driver v1.11.4
go.mongodb.org/mongo-driver v1.5.4
gopkg.in/yaml.v3 v3.0.1
gorm.io/driver/clickhouse v0.6.0
gorm.io/driver/clickhouse v0.4.2
gorm.io/driver/mysql v1.5.2
gorm.io/driver/postgres v1.5.4
gorm.io/driver/sqlite v1.5.4

2814
go.sum

File diff suppressed because it is too large Load Diff

View File

@@ -144,7 +144,7 @@ func (db *rdbms) RemoveArticle(ctx context.Context, id int) error {
// CleanArticles 清理回收站文章
func (db *rdbms) CleanArticles(ctx context.Context, exp time.Time) error {
return db.Where("deleted_at BETWEEN ? AND ?", time.Time{}, exp).Delete(model.Article{}).Error
return db.Where("deleted_at > ? AND deleted_at < ?", time.Time{}, exp).Delete(model.Article{}).Error
}
// UpdateArticle 更新文章

View File

@@ -94,6 +94,7 @@ func handleAPIBlogger(c *gin.Context) {
err := cache.Ei.UpdateBlogger(context.Background(), map[string]interface{}{
"blog_name": bn,
"b_title": bt,
"bei_an": ba,
"sub_title": st,
"series_say": ss,
"archives_say": as,
@@ -398,6 +399,7 @@ func handleAPISerieCreate(c *gin.Context) {
serie.Slug = slug
serie.Name = name
serie.Desc = desc
cache.PagesCh <- cache.PageSeries
} else {
err = cache.Ei.AddSerie(&model.Serie{
Slug: slug,

View File

@@ -204,7 +204,7 @@ func handleDisqusList(c *gin.Context) {
if artc != nil {
dcs.Data.Thread = artc.Thread
}
postsList, err := internal.PostsList(slug, cursor)
postsList, err := internal.PostsList(artc, cursor)
if err != nil {
logrus.Error("hadnleDisqusList.PostsList: ", err)
dcs.ErrNo = 0

View File

@@ -17,11 +17,13 @@ import (
// disqus api
const (
apiPostsCount = "https://disqus.com/api/3.0/threads/set.json"
apiPostsList = "https://disqus.com/api/3.0/threads/listPosts.json"
apiPostsList = "https://disqus.com/api/3.0/threads/listPostsThreaded"
apiPostCreate = "https://disqus.com/api/3.0/posts/create.json"
apiPostApprove = "https://disqus.com/api/3.0/posts/approve.json"
apiThreadCreate = "https://disqus.com/api/3.0/threads/create.json"
apiThreadDetails = "https://disqus.com/api/3.0/threads/details.json"
disqusAPIKey = "E8Uh5l5fHZ6gD8U3KycjAIAk46f68Zw7C6eW8WSjZvCLXebZ7p0r1yrYDrLilk2F"
)
func checkDisqusConfig() error {
@@ -123,16 +125,17 @@ type postDetail struct {
}
// PostsList 评论列表
func PostsList(slug, cursor string) (*PostsListResp, error) {
func PostsList(article *model.Article, cursor string) (*PostsListResp, error) {
if err := checkDisqusConfig(); err != nil {
return nil, err
}
vals := url.Values{}
vals.Set("api_key", config.Conf.EiBlogApp.Disqus.PublicKey)
vals.Set("api_key", disqusAPIKey)
vals.Set("forum", config.Conf.EiBlogApp.Disqus.ShortName)
vals.Set("thread:ident", "post-"+slug)
vals.Set("thread", article.Thread)
vals.Set("cursor", cursor)
vals.Set("order", "popular")
vals.Set("limit", "50")
resp, err := httpGet(apiPostsList + "?" + vals.Encode())
@@ -181,7 +184,7 @@ func PostCreate(pc *PostComment) (*PostCreateResp, error) {
return nil, err
}
vals := url.Values{}
vals.Set("api_key", "E8Uh5l5fHZ6gD8U3KycjAIAk46f68Zw7C6eW8WSjZvCLXebZ7p0r1yrYDrLilk2F")
vals.Set("api_key", disqusAPIKey)
vals.Set("message", pc.Message)
vals.Set("parent", pc.Parent)
vals.Set("thread", pc.Thread)

View File

@@ -43,10 +43,11 @@ var feedrPingFunc = func(btitle, slug string) error {
// rpcPingParam ping to rpc, eg. google baidu
// params:
// BlogName string `xml:"param>value>string"`
// HomePage string `xml:"param>value>string"`
// Article string `xml:"param>value>string"`
// RSS_URL string `xml:"param>value>string"`
//
// BlogName string `xml:"param>value>string"`
// HomePage string `xml:"param>value>string"`
// Article string `xml:"param>value>string"`
// RSS_URL string `xml:"param>value>string"`
type rpcPingParam struct {
XMLName xml.Name `xml:"methodCall"`
MethodName string `xml:"methodName"`
@@ -93,7 +94,7 @@ var rpcPingFunc = func(btitle, slug string) error {
continue
}
if resp.StatusCode != 200 {
logrus.Error("rpcPingFunc.failed: ", string(data))
logrus.Error("rpcPingFunc.failed: ", string(data), resp.StatusCode)
}
}
return nil

File diff suppressed because one or more lines are too long