feat: add AccountPins
This commit is contained in:
parent
cf422aef0e
commit
cc61a090b6
|
@ -111,3 +111,15 @@ func (s AccountServiceImpl) LoginPubkey(pubkey string) (string, error) {
|
||||||
|
|
||||||
return token, nil
|
return token, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s AccountServiceImpl) AccountPins(id uint64, createdAfter uint64) ([]models.Pin, error) {
|
||||||
|
var pins []models.Pin
|
||||||
|
|
||||||
|
result := s.portal.Database().Model(&models.Pin{}).Where(&models.Pin{UserID: uint(id)}).Where("created_at > ?", createdAfter).Order("created_at desc").Find(&pins)
|
||||||
|
|
||||||
|
if result.Error != nil {
|
||||||
|
return nil, result.Error
|
||||||
|
}
|
||||||
|
|
||||||
|
return pins, nil
|
||||||
|
}
|
||||||
|
|
|
@ -10,4 +10,5 @@ type AccountService interface {
|
||||||
AddPubkeyToAccount(user models.User, pubkey string) error
|
AddPubkeyToAccount(user models.User, pubkey string) error
|
||||||
LoginPassword(email string, password string) (string, error)
|
LoginPassword(email string, password string) (string, error)
|
||||||
LoginPubkey(pubkey string) (string, error)
|
LoginPubkey(pubkey string) (string, error)
|
||||||
|
AccountPins(id uint64, createdAfter uint64) ([]models.Pin, error)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue