fix: filter private journal

pull/248/head
golangboy 2 years ago committed by 1379Monitor
parent 2d097e121d
commit 7bec1f6fde

@ -2,6 +2,7 @@ package model
import ( import (
"context" "context"
"github.com/go-sonic/sonic/consts"
"github.com/go-sonic/sonic/model/dto" "github.com/go-sonic/sonic/model/dto"
"github.com/go-sonic/sonic/model/param" "github.com/go-sonic/sonic/model/param"
@ -29,13 +30,14 @@ type JournalModel struct {
func (p *JournalModel) Journals(ctx context.Context, model template.Model, page int) (string, error) { func (p *JournalModel) Journals(ctx context.Context, model template.Model, page int) (string, error) {
pageSize := p.OptionService.GetOrByDefault(ctx, property.JournalPageSize).(int) pageSize := p.OptionService.GetOrByDefault(ctx, property.JournalPageSize).(int)
journals, total, err := p.JournalService.Page(ctx, journalType := consts.JournalTypePublic
param.Page{ journals, total, err := p.JournalService.ListJournal(ctx, param.JournalQuery{
PageNum: page, Page: param.Page{PageNum: page, PageSize: pageSize},
PageSize: pageSize, Sort: &param.Sort{
},
&param.Sort{
Fields: []string{"createTime,desc"}, Fields: []string{"createTime,desc"},
},
Keyword: nil,
JournalType: &journalType,
}) })
if err != nil { if err != nil {
return "", err return "", err

Loading…
Cancel
Save