mirror of
https://github.com/mindoc-org/mindoc.git
synced 2025-12-19 19:57:09 +08:00
add prev&next read (#941)
* add prev&next read * add prev&next in default read.tpl * update prev&next
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
//数据库模型.
|
||||
// 数据库模型.
|
||||
package models
|
||||
|
||||
import (
|
||||
@@ -12,8 +12,15 @@ import (
|
||||
"github.com/beego/beego/v2/core/logs"
|
||||
"github.com/mindoc-org/mindoc/conf"
|
||||
"github.com/mindoc-org/mindoc/utils/filetil"
|
||||
// "gorm.io/driver/sqlite"
|
||||
// "gorm.io/gorm"
|
||||
// "gorm.io/gorm/logger"
|
||||
// "gorm.io/gorm/schema"
|
||||
)
|
||||
|
||||
// 定义全局的db对象,我们执行数据库操作主要通过他实现。
|
||||
// var _db *gorm.DB
|
||||
|
||||
// Attachment struct .
|
||||
type Attachment struct {
|
||||
AttachmentId int `orm:"column(attachment_id);pk;auto;unique" json:"attachment_id"`
|
||||
@@ -83,7 +90,7 @@ func (m *Attachment) Find(id int) (*Attachment, error) {
|
||||
return m, err
|
||||
}
|
||||
|
||||
//查询指定文档的附件列表
|
||||
// 查询指定文档的附件列表
|
||||
func (m *Attachment) FindListByDocumentId(docId int) (attaches []*Attachment, err error) {
|
||||
o := orm.NewOrm()
|
||||
|
||||
@@ -91,7 +98,7 @@ func (m *Attachment) FindListByDocumentId(docId int) (attaches []*Attachment, er
|
||||
return
|
||||
}
|
||||
|
||||
//分页查询附件
|
||||
// 分页查询附件
|
||||
func (m *Attachment) FindToPager(pageIndex, pageSize int) (attachList []*AttachmentResult, totalCount int, err error) {
|
||||
o := orm.NewOrm()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user