MCPcopy Create free account
hub / github.com/apache/answer / GetUserStatus

Method GetUserStatus

internal/repo/auth/auth.go:133–144  ·  view source on GitHub ↗

GetUserStatus get user status

(ctx context.Context, userID string)

Source from the content-addressed store, hash-verified

131
132// GetUserStatus get user status
133func (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
147func (ar *authRepo) RemoveUserStatus(ctx context.Context, userID string) (err error) {

Callers

nothing calls this directly

Calls 1

GetStringMethod · 0.80

Tested by

no test coverage detected