This commit is contained in:
2025-04-06 00:28:00 +11:00
parent 7f5a09098a
commit d550f859a7
81 changed files with 1264 additions and 544 deletions

38
endpoint/base.go Normal file
View File

@@ -0,0 +1,38 @@
package endpoint
import (
"github.com/go-resty/resty/v2"
)
type BaseEndpoint struct {
request func(URL string, dataBody any) (*resty.Response, error)
endpointName EndpointName
}
func NewBaseEndpoint(request func(URL string, dataBody any) (*resty.Response, error), endpointName EndpointName) *BaseEndpoint {
return &BaseEndpoint{
request: request,
endpointName: endpointName,
}
}
func (b *BaseEndpoint) GetEndpointName() EndpointName {
return b.endpointName
}
func (b *BaseEndpoint) Query(query string) (any, error) {
return nil, nil
}
func (b *BaseEndpoint) QueryAny(query string) (any, error) {
return b.Query(query)
}
type Endpoint interface {
GetEndpointName() EndpointName
}
type EntityEndpoint interface {
QueryAny(query string) (any, error)
GetEndpointName() EndpointName
}