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