mirror of
https://github.com/christianselig/apollo-backend
synced 2024-11-13 07:27:43 +00:00
25 lines
593 B
Go
25 lines
593 B
Go
|
package domain
|
||
|
|
||
|
import "context"
|
||
|
|
||
|
type Device struct {
|
||
|
ID int64
|
||
|
APNSToken string
|
||
|
Sandbox bool
|
||
|
LastPingedAt int64
|
||
|
}
|
||
|
|
||
|
type DeviceRepository interface {
|
||
|
GetByAPNSToken(ctx context.Context, token string) (Device, error)
|
||
|
|
||
|
Update(ctx context.Context, dev *Device) error
|
||
|
Create(ctx context.Context, dev *Device) error
|
||
|
Delete(ctx context.Context, token string) error
|
||
|
}
|
||
|
|
||
|
type DeviceUsecase interface {
|
||
|
GetByAPNSToken(ctx context.Context, token string) (Device, error)
|
||
|
CreateOrUpdate(ctx context.Context, dev *Device) error
|
||
|
Delete(ctx context.Context, token string) error
|
||
|
}
|