GetUserStatus get user status
(ctx context.Context, userID string)
| 131 | |
| 132 | // GetUserStatus get user status |
| 133 | func (ar *authRepo) GetUserStatus(ctx context.Context, userID string) (userInfo *entity.UserCacheInfo, err error) { |
| 134 | userInfoCache, exist, err := ar.data.Cache.GetString(ctx, constant.UserStatusChangedCacheKey+userID) |
| 135 | if err != nil { |
| 136 | return nil, errors.InternalServer(reason.DatabaseError).WithError(err).WithStack() |
| 137 | } |
| 138 | if !exist { |
| 139 | return nil, nil |
| 140 | } |
| 141 | userInfo = &entity.UserCacheInfo{} |
| 142 | _ = json.Unmarshal([]byte(userInfoCache), userInfo) |
| 143 | return userInfo, nil |
| 144 | } |
| 145 | |
| 146 | // RemoveUserStatus remove user status |
| 147 | func (ar *authRepo) RemoveUserStatus(ctx context.Context, userID string) (err error) { |