|
@@ -9,23 +9,72 @@ import (
|
|
|
"net/http"
|
|
|
)
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
func PostBind[O any](binder *Binder, item *SimpleBindItem[O], middlewares ...Middleware) {
|
|
|
item.bind(binder, http.MethodPost, middlewares...)
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
func DeleteBind[O any](binder *Binder, item *SimpleBindItem[O], middlewares ...Middleware) {
|
|
|
item.bind(binder, http.MethodDelete, middlewares...)
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
func PutBind[O any](binder *Binder, item *SimpleBindItem[O], middlewares ...Middleware) {
|
|
|
item.bind(binder, http.MethodPut, middlewares...)
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
func GetBind[O any](binder *Binder, item *SimpleBindItem[O], middlewares ...Middleware) {
|
|
|
item.bind(binder, http.MethodGet, middlewares...)
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
type FormDomainObjectsFunc func(c *api.Context, params request.Params) ([]domain.Object, error)
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
type ServiceFunc[O any] func(c *api.Context, params request.Params, objects []domain.Object, i *infrastructure.Infrastructure) (O, error)
|
|
|
|
|
|
|
|
@@ -49,7 +98,7 @@ type SimpleBindItem[O any] struct {
|
|
|
BindRequestParamsFunc request.BindRequestParamsFunc
|
|
|
|
|
|
|
|
|
-
|
|
|
+
|
|
|
|
|
|
FormDomainObjectsFunc FormDomainObjectsFunc
|
|
|
|