Fix the error of copy.

This commit is contained in:
zicla
2020-03-12 01:29:22 +08:00
parent bea9a0a56d
commit eb89807cf1
2 changed files with 6 additions and 1 deletions

View File

@ -671,6 +671,8 @@ func (this *MatterService) AtomicMoveBatch(request *http.Request, srcMatters []*
//copy srcMatter to destMatter. invoker must handled the overwrite and lock.
func (this *MatterService) copy(request *http.Request, srcMatter *Matter, destDirMatter *Matter, name string) {
this.logger.Info("copy srcPath = %s destPath = %s/%s", srcMatter.Path, destDirMatter.Path, name)
if srcMatter.Dir {
newMatter := &Matter{
@ -687,6 +689,9 @@ func (this *MatterService) copy(request *http.Request, srcMatter *Matter, destDi
newMatter = this.matterDao.Create(newMatter)
//make the dir
util.MakeDirAll(newMatter.AbsolutePath())
//copy children
matters := this.matterDao.FindByPuuidAndUserUuid(srcMatter.Uuid, srcMatter.UserUuid, nil)
for _, m := range matters {