Browse Source

断点续传前端页面开发中(后台逻辑已初步开发完成) 修复条件分页的总条目问题

main
pixel 5 years ago
parent
commit
2cc0f0c10d
  1. 4
      QMPlusServer/model/dbModel/exa_breakpoint_continue.go
  2. 2
      QMPlusServer/model/sysModel/sys_api.go

4
QMPlusServer/model/dbModel/exa_breakpoint_continue.go

@ -5,6 +5,7 @@ import (
"github.com/jinzhu/gorm"
)
//文件结构体
type ExaFile struct {
gorm.Model
FileName string
@ -15,6 +16,7 @@ type ExaFile struct {
IsFinish bool
}
//切片结构体
type ExaFileChunk struct {
gorm.Model
ExaFileId uint
@ -22,6 +24,7 @@ type ExaFileChunk struct {
FileChunkPath string
}
//文件合成完成
func (f *ExaFile) FileCreateComplete(FileMd5 string, FileName string, FilePath string) error {
var file ExaFile
upDateFile := make(map[string]interface{})
@ -31,6 +34,7 @@ func (f *ExaFile) FileCreateComplete(FileMd5 string, FileName string, FilePath s
return err
}
//第一次上传或者断点续传时候检测当前文件属性,没有则创建,有则返回文件的当前切片
func (f *ExaFile) FindOrCreateFile(FileMd5 string, FileName string, ChunkTotal int) (err error, file ExaFile) {
var cfile ExaFile
cfile.FileMd5 = FileMd5

2
QMPlusServer/model/sysModel/sys_api.go

@ -67,7 +67,7 @@ func (a *SysApi) GetInfoList(info modelInterface.PageInfo) (err error, list inte
return
} else {
var apiList []SysApi
err = db.Order("group", true).Where("path LIKE ?", "%"+a.Path+"%").Find(&apiList).Error
err = db.Order("group", true).Where("path LIKE ?", "%"+a.Path+"%").Find(&apiList).Count(&total).Error
return err, apiList, total
}
}
Loading…
Cancel
Save