Add the keep 0 days feature.
This commit is contained in:
parent
e1e46457e7
commit
847bcd746c
@ -373,7 +373,7 @@ func (this *DavService) HandleDelete(w http.ResponseWriter, r *http.Request, use
|
|||||||
|
|
||||||
matter := this.matterDao.CheckWithRootByPath(subPath, user)
|
matter := this.matterDao.CheckWithRootByPath(subPath, user)
|
||||||
|
|
||||||
this.matterService.AtomicSoftDelete(r, matter, user)
|
this.matterService.AtomicDelete(r, matter, user)
|
||||||
}
|
}
|
||||||
|
|
||||||
//crate a directory
|
//crate a directory
|
||||||
|
@ -79,6 +79,7 @@ func (this *MatterController) RegisterRoutes() map[string]func(writer http.Respo
|
|||||||
routeMap["/api/matter/recovery/batch"] = this.Wrap(this.RecoveryBatch, USER_ROLE_USER)
|
routeMap["/api/matter/recovery/batch"] = this.Wrap(this.RecoveryBatch, USER_ROLE_USER)
|
||||||
routeMap["/api/matter/delete"] = this.Wrap(this.Delete, USER_ROLE_USER)
|
routeMap["/api/matter/delete"] = this.Wrap(this.Delete, USER_ROLE_USER)
|
||||||
routeMap["/api/matter/delete/batch"] = this.Wrap(this.DeleteBatch, USER_ROLE_USER)
|
routeMap["/api/matter/delete/batch"] = this.Wrap(this.DeleteBatch, USER_ROLE_USER)
|
||||||
|
routeMap["/api/matter/clean/expired/deleted/matters"] = this.Wrap(this.CleanExpiredDeletedMatters, USER_ROLE_ADMINISTRATOR)
|
||||||
routeMap["/api/matter/rename"] = this.Wrap(this.Rename, USER_ROLE_USER)
|
routeMap["/api/matter/rename"] = this.Wrap(this.Rename, USER_ROLE_USER)
|
||||||
routeMap["/api/matter/change/privacy"] = this.Wrap(this.ChangePrivacy, USER_ROLE_USER)
|
routeMap["/api/matter/change/privacy"] = this.Wrap(this.ChangePrivacy, USER_ROLE_USER)
|
||||||
routeMap["/api/matter/move"] = this.Wrap(this.Move, USER_ROLE_USER)
|
routeMap["/api/matter/move"] = this.Wrap(this.Move, USER_ROLE_USER)
|
||||||
@ -449,6 +450,14 @@ func (this *MatterController) DeleteBatch(writer http.ResponseWriter, request *h
|
|||||||
return this.Success("OK")
|
return this.Success("OK")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//manual clean expired deleted matters.
|
||||||
|
func (this *MatterController) CleanExpiredDeletedMatters(writer http.ResponseWriter, request *http.Request) *result.WebResult {
|
||||||
|
|
||||||
|
this.matterService.CleanExpiredDeletedMatters()
|
||||||
|
|
||||||
|
return this.Success("OK")
|
||||||
|
}
|
||||||
|
|
||||||
func (this *MatterController) Rename(writer http.ResponseWriter, request *http.Request) *result.WebResult {
|
func (this *MatterController) Rename(writer http.ResponseWriter, request *http.Request) *result.WebResult {
|
||||||
|
|
||||||
uuid := request.FormValue("uuid")
|
uuid := request.FormValue("uuid")
|
||||||
|
@ -1303,7 +1303,9 @@ func (this *MatterService) CleanExpiredDeletedMatters() {
|
|||||||
|
|
||||||
thenDate := time.Now()
|
thenDate := time.Now()
|
||||||
thenDate = thenDate.AddDate(0, 0, int(-preference.DeletedKeepDays))
|
thenDate = thenDate.AddDate(0, 0, int(-preference.DeletedKeepDays))
|
||||||
|
if preference.DeletedKeepDays != 0 {
|
||||||
thenDate = util.FirstSecondOfDay(thenDate)
|
thenDate = util.FirstSecondOfDay(thenDate)
|
||||||
|
}
|
||||||
|
|
||||||
//first remove all the matter(not dir).
|
//first remove all the matter(not dir).
|
||||||
this.matterDao.PageHandle("", "", "", FALSE, TRUE, &thenDate, nil, func(matter *Matter) {
|
this.matterDao.PageHandle("", "", "", FALSE, TRUE, &thenDate, nil, func(matter *Matter) {
|
||||||
|
Loading…
Reference in New Issue
Block a user