SetUserStatus set user status
(ctx context.Context, userID string, userInfo *entity.UserCacheInfo)
| 117 | |
| 118 | // SetUserStatus set user status |
| 119 | func (ar *authRepo) SetUserStatus(ctx context.Context, userID string, userInfo *entity.UserCacheInfo) (err error) { |
| 120 | userInfoCache, err := json.Marshal(userInfo) |
| 121 | if err != nil { |
| 122 | return err |
| 123 | } |
| 124 | err = ar.data.Cache.SetString(ctx, constant.UserStatusChangedCacheKey+userID, |
| 125 | string(userInfoCache), constant.UserStatusChangedCacheTime) |
| 126 | if err != nil { |
| 127 | return errors.InternalServer(reason.DatabaseError).WithError(err).WithStack() |
| 128 | } |
| 129 | return nil |
| 130 | } |
| 131 | |
| 132 | // GetUserStatus get user status |
| 133 | func (ar *authRepo) GetUserStatus(ctx context.Context, userID string) (userInfo *entity.UserCacheInfo, err error) { |