SetAdminUserCacheInfo set admin user cache info
(ctx context.Context, accessToken string, userInfo *entity.UserCacheInfo)
| 169 | |
| 170 | // SetAdminUserCacheInfo set admin user cache info |
| 171 | func (ar *authRepo) SetAdminUserCacheInfo(ctx context.Context, accessToken string, userInfo *entity.UserCacheInfo) (err error) { |
| 172 | userInfoCache, err := json.Marshal(userInfo) |
| 173 | if err != nil { |
| 174 | return err |
| 175 | } |
| 176 | |
| 177 | err = ar.data.Cache.SetString(ctx, constant.AdminTokenCacheKey+accessToken, string(userInfoCache), |
| 178 | constant.AdminTokenCacheTime) |
| 179 | if err != nil { |
| 180 | return errors.InternalServer(reason.DatabaseError).WithError(err).WithStack() |
| 181 | } |
| 182 | return nil |
| 183 | } |
| 184 | |
| 185 | // RemoveAdminUserCacheInfo remove admin user cache info |
| 186 | func (ar *authRepo) RemoveAdminUserCacheInfo(ctx context.Context, accessToken string) (err error) { |