From 2cc0f0c10d4065639efdeaad271d680a0a322e82 Mon Sep 17 00:00:00 2001 From: pixel <303176530@qq.com> Date: Mon, 3 Feb 2020 12:36:49 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=AD=E7=82=B9=E7=BB=AD=E4=BC=A0=E5=89=8D?= =?UTF-8?q?=E7=AB=AF=E9=A1=B5=E9=9D=A2=E5=BC=80=E5=8F=91=E4=B8=AD=EF=BC=88?= =?UTF-8?q?=E5=90=8E=E5=8F=B0=E9=80=BB=E8=BE=91=E5=B7=B2=E5=88=9D=E6=AD=A5?= =?UTF-8?q?=E5=BC=80=E5=8F=91=E5=AE=8C=E6=88=90=EF=BC=89=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E6=9D=A1=E4=BB=B6=E5=88=86=E9=A1=B5=E7=9A=84=E6=80=BB?= =?UTF-8?q?=E6=9D=A1=E7=9B=AE=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- QMPlusServer/model/dbModel/exa_breakpoint_continue.go | 4 ++++ QMPlusServer/model/sysModel/sys_api.go | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/QMPlusServer/model/dbModel/exa_breakpoint_continue.go b/QMPlusServer/model/dbModel/exa_breakpoint_continue.go index 1e15c524..4e952182 100644 --- a/QMPlusServer/model/dbModel/exa_breakpoint_continue.go +++ b/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 diff --git a/QMPlusServer/model/sysModel/sys_api.go b/QMPlusServer/model/sysModel/sys_api.go index 8fee8426..5651670d 100644 --- a/QMPlusServer/model/sysModel/sys_api.go +++ b/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 } }