Finish the first step of i18n.

This commit is contained in:
zicla
2019-05-04 19:20:09 +08:00
parent 2b687331b5
commit 900924d196
19 changed files with 270 additions and 209 deletions

View File

@ -65,12 +65,11 @@ func (this *ShareService) CheckShare(shareUuid string, code string, user *User)
} else {
if !share.ExpireInfinity {
if share.ExpireTime.Before(time.Now()) {
panic(result.BadRequest("分享已过期"))
panic(result.BadRequest("share expired"))
}
}
}
}
return share
}
@ -106,7 +105,7 @@ func (this *ShareService) ValidateMatter(shareUuid string, code string, user *Us
//保证 puuid对应的matter是shareRootMatter的子文件夹。
child := strings.HasPrefix(matter.Path, shareRootMatter.Path)
if !child {
panic(result.Unauthorized("%s 不是 %s 的子文件夹!", matter.Uuid, shareRootUuid))
panic(result.BadRequest("%s is not %s's children", matter.Uuid, shareRootUuid))
}
}