parent
167593e65f
commit
108e9ad206
|
@ -34,3 +34,5 @@ build/
|
|||
*.db
|
||||
*.log
|
||||
*.exe
|
||||
*.sum
|
||||
blog
|
|
@ -13,6 +13,7 @@ type AdminArticle struct {
|
|||
Content string `json:"content" gorm:"-"`
|
||||
ContentType string `json:"contentType"`
|
||||
Tags string `json:"tags"`
|
||||
View int `json:"view" gorm:"-"`
|
||||
PublishTime int64 `json:"publishTime"`
|
||||
CreateBy string `json:"createBy"`
|
||||
CreateTime int64 `json:"createTime"`
|
||||
|
|
|
@ -70,6 +70,7 @@ func (*articleService) GetAdminArticle(id string) admin.AdminArticle {
|
|||
func (*articleService) PageAdminArticle(page int, itemsPerPage int) vo.Page[admin.AdminArticle] {
|
||||
var content []admin.AdminArticle
|
||||
var totalElements int64
|
||||
ctx := context.Background()
|
||||
database.GormTemplate.Table("blog_articles").Count(&totalElements)
|
||||
database.GormTemplate.Table("blog_articles").
|
||||
Where("del != ?", 1).
|
||||
|
@ -78,6 +79,12 @@ func (*articleService) PageAdminArticle(page int, itemsPerPage int) vo.Page[admi
|
|||
Order("create_time DESC").
|
||||
Find(&content)
|
||||
|
||||
for i, v := range content {
|
||||
id := v.Id
|
||||
view, _ := database.RedisTemplate.HGet(ctx, consts.REDIS_BLOG_VIEW_RECORD, id).Int()
|
||||
content[i].View = view
|
||||
}
|
||||
|
||||
pre := int(totalElements) % itemsPerPage
|
||||
if pre > 0 {
|
||||
pre = 1
|
||||
|
|
|
@ -75,7 +75,7 @@
|
|||
<v-card :color="item.milestone==1?'primary':''">
|
||||
<v-card-title class="text-h6">{{item.version}}</v-card-title>
|
||||
<v-card-text class="white text--primary">
|
||||
<p style="font-size: 16px;">{{item.description}}</p>
|
||||
<p style="font-size: 16px;white-space: pre-wrap;">{{item.description}}</p>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</v-timeline-item>
|
||||
|
|
Loading…
Reference in New Issue