Finish the cache refresh things.

This commit is contained in:
lishuang
2020-06-20 22:17:01 +08:00
parent d052f75a1c
commit 601c60fca7
2 changed files with 34 additions and 5 deletions

View File

@ -287,6 +287,9 @@ func (this *UserController) Edit(writer http.ResponseWriter, request *http.Reque
currentUser = this.userDao.Save(currentUser)
//remove cache user.
this.userService.RemoveCacheUserByUuid(currentUser.Uuid)
return this.Success(currentUser)
}
@ -400,11 +403,8 @@ func (this *UserController) ToggleStatus(writer http.ResponseWriter, request *ht
currentUser = this.userDao.Save(currentUser)
cacheUsers := this.userService.FindCacheUsersByUuid(currentUser.Uuid)
this.logger.Info("find %d cache users", len(cacheUsers))
for _, u := range cacheUsers {
u.Status = currentUser.Status
}
//remove cache user.
this.userService.RemoveCacheUserByUuid(currentUser.Uuid)
return this.Success(currentUser)