mirror of
https://github.com/APIParkLab/APIPark.git
synced 2026-06-14 20:41:15 +08:00
52 lines
2.0 KiB
Go
52 lines
2.0 KiB
Go
package api
|
|
|
|
import (
|
|
"context"
|
|
"reflect"
|
|
|
|
"github.com/APIParkLab/APIPark/service/universally/commit"
|
|
|
|
"github.com/APIParkLab/APIPark/service/universally"
|
|
"github.com/eolinker/go-common/autowire"
|
|
)
|
|
|
|
type IAPIService interface {
|
|
universally.IServiceGet[API]
|
|
universally.IServiceDelete
|
|
CountByService(ctx context.Context, service string) (int64, error)
|
|
CountMapByService(ctx context.Context, service ...string) (map[string]int64, error)
|
|
Exist(ctx context.Context, aid string, api *Exist) error
|
|
ListForService(ctx context.Context, serviceId string) ([]*API, error)
|
|
GetInfo(ctx context.Context, aid string) (*Info, error)
|
|
ListInfo(ctx context.Context, aids ...string) ([]*Info, error)
|
|
ListInfoForService(ctx context.Context, serviceId string) ([]*Info, error)
|
|
ListLatestCommitRequest(ctx context.Context, aid ...string) ([]*commit.Commit[Request], error)
|
|
ListLatestCommitProxy(ctx context.Context, aid ...string) ([]*commit.Commit[Proxy], error)
|
|
LatestRequest(ctx context.Context, aid string) (*commit.Commit[Request], error)
|
|
LatestProxy(ctx context.Context, aid string) (*commit.Commit[Proxy], error)
|
|
GetProxyCommit(ctx context.Context, commitId string) (*commit.Commit[Proxy], error)
|
|
ListProxyCommit(ctx context.Context, commitId ...string) ([]*commit.Commit[Proxy], error)
|
|
SaveProxy(ctx context.Context, aid string, data *Proxy) error
|
|
|
|
GetRequestCommit(ctx context.Context, commitId string) (*commit.Commit[Request], error)
|
|
ListRequestCommit(ctx context.Context, commitId ...string) ([]*commit.Commit[Request], error)
|
|
SaveRequest(ctx context.Context, aid string, data *Request) error
|
|
|
|
Save(ctx context.Context, id string, model *Edit) error
|
|
Create(ctx context.Context, input *Create) (err error)
|
|
}
|
|
|
|
var (
|
|
_ IAPIService = (*imlAPIService)(nil)
|
|
)
|
|
|
|
func init() {
|
|
autowire.Auto[IAPIService](func() reflect.Value {
|
|
return reflect.ValueOf(new(imlAPIService))
|
|
})
|
|
|
|
commit.InitCommitWithKeyService[Proxy]("api", string(HistoryProxy))
|
|
commit.InitCommitWithKeyService[Request]("api", string(HistoryRequest))
|
|
|
|
}
|