2023-02-24 15:41:50 +08:00
|
|
|
package api2rpc
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"context"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
type Ignore struct{}
|
|
|
|
|
|
|
|
|
|
type ApiBind[A, B any] interface {
|
|
|
|
|
OperationID() string
|
|
|
|
|
OpUserID() (string, error)
|
|
|
|
|
Bind(*A) error
|
|
|
|
|
Context() context.Context
|
|
|
|
|
Resp(resp *B, err error)
|
|
|
|
|
}
|
2023-02-24 19:16:26 +08:00
|
|
|
|
|
|
|
|
type Api interface {
|
|
|
|
|
OperationID() string
|
|
|
|
|
OpUserID() string
|
|
|
|
|
Context() context.Context
|
|
|
|
|
Bind(req any) error
|
|
|
|
|
Resp(resp any, err error)
|
|
|
|
|
}
|