MCPcopy Create free account
hub / github.com/aiprodcoder/MIXAPI / CountUserTokens

Function CountUserTokens

model/token.go:350–354  ·  view source on GitHub ↗

CountUserTokens returns total number of tokens for the given user, used for pagination

(userId int)

Source from the content-addressed store, hash-verified

348
349// CountUserTokens returns total number of tokens for the given user, used for pagination
350func CountUserTokens(userId int) (int64, error) {
351 var total int64
352 err := DB.Model(&Token{}).Where("user_id = ?", userId).Count(&total).Error
353 return total, err
354}
355
356// BatchDeleteTokens 删除指定用户的一组令牌,返回成功删除数量
357func BatchDeleteTokens(ids []int, userId int) (int, error) {

Callers 1

GetAllTokensFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected