Refine the directory structure of this project.

This commit is contained in:
zicla
2019-04-24 19:36:10 +08:00
parent a353ff1303
commit daa5847859
22 changed files with 517 additions and 415 deletions

View File

@ -3,6 +3,7 @@ package rest
import (
"fmt"
"net/http"
"tank/rest/result"
"time"
)
@ -96,7 +97,7 @@ func (this *AlienService) PreviewOrDownload(
tokenUser := this.userDao.CheckByUuid(downloadToken.UserUuid)
if matter.UserUuid != tokenUser.Uuid {
panic(CODE_WRAPPER_UNAUTHORIZED)
panic(result.CODE_WRAPPER_UNAUTHORIZED)
}
//下载之后立即过期掉。如果是分块下载的,必须以最终获取到完整的数据为准。
@ -108,7 +109,7 @@ func (this *AlienService) PreviewOrDownload(
//判断文件的所属人是否正确
operator := this.findUser(writer, request)
if operator == nil || (operator.Role != USER_ROLE_ADMINISTRATOR && matter.UserUuid != operator.Uuid) {
panic(CODE_WRAPPER_UNAUTHORIZED)
panic(result.CODE_WRAPPER_UNAUTHORIZED)
}
}