Function
GetAllUserTokens
(userId int, startIdx int, num int)
Source from the content-addressed store, hash-verified
| 66 | } |
| 67 | |
| 68 | func GetAllUserTokens(userId int, startIdx int, num int) ([]*Token, error) { |
| 69 | var tokens []*Token |
| 70 | var err error |
| 71 | err = DB.Where("user_id = ?", userId).Order("id desc").Limit(num).Offset(startIdx).Find(&tokens).Error |
| 72 | return tokens, err |
| 73 | } |
| 74 | |
| 75 | func SearchUserTokens(userId int, keyword string, token string) (tokens []*Token, err error) { |
| 76 | if token != "" { |
Tested by
no test coverage detected