CountUserTokens returns total number of tokens for the given user, used for pagination
(userId int)
| 348 | |
| 349 | // CountUserTokens returns total number of tokens for the given user, used for pagination |
| 350 | func 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 删除指定用户的一组令牌,返回成功删除数量 |
| 357 | func BatchDeleteTokens(ids []int, userId int) (int, error) { |