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