From 194e84c258eadd071fd0c6488e7a6b02ca1f752b Mon Sep 17 00:00:00 2001 From: nite Date: Sun, 6 Apr 2025 03:33:02 +1000 Subject: [PATCH] u --- endpoint/base.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/endpoint/base.go b/endpoint/base.go index 16b90a5..5379cb6 100644 --- a/endpoint/base.go +++ b/endpoint/base.go @@ -68,3 +68,12 @@ func (b *BaseEndpoint[T]) GetLastOneId() (uint64, error) { func (b *BaseEndpoint[T]) Paginated(offset, limit uint64) ([]*T, error) { return b.Query(fmt.Sprintf("offset %d; limit %d; fields *; sort id asc;", offset, limit)) } + +type EntityEndpoint[T any] interface { + GetEndpointName() EndpointName + Query(string) ([]*T, error) + GetByID(uint64) (*T, error) + GetByIDs([]uint64) ([]*T, error) + GetLastOneId() (uint64, error) + Paginated(uint64, uint64) ([]*T, error) +}