|
@@ -17,7 +17,7 @@ type BusinessFunc[I any, O any] func(c *binding_context.Context, inputModel I) (
|
|
type BindingFunc[O any] func(c *binding_context.Context, request any, sendFunc response.SendFunc[O]) bool
|
|
type BindingFunc[O any] func(c *binding_context.Context, request any, sendFunc response.SendFunc[O]) bool
|
|
|
|
|
|
type Binding struct {
|
|
type Binding struct {
|
|
- RouterGroup *gin.RouterGroup
|
|
|
|
|
|
+ routerGroup *gin.RouterGroup
|
|
}
|
|
}
|
|
|
|
|
|
func NewBinding(apiVersion string, middlewares ...middleware.Func) *Binding {
|
|
func NewBinding(apiVersion string, middlewares ...middleware.Func) *Binding {
|
|
@@ -33,31 +33,31 @@ func NewBinding(apiVersion string, middlewares ...middleware.Func) *Binding {
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
|
|
- return &Binding{RouterGroup: routerInstance.Group(apiPrefix, ginMiddlewares...)}
|
|
|
|
|
|
+ return &Binding{routerGroup: routerInstance.Group(apiPrefix, ginMiddlewares...)}
|
|
}
|
|
}
|
|
|
|
|
|
func PostBind[I any, O any](b *Binding, item *SimpleBindItem[I, O], middlewares ...middleware.Func) {
|
|
func PostBind[I any, O any](b *Binding, item *SimpleBindItem[I, O], middlewares ...middleware.Func) {
|
|
- item.bind(b.RouterGroup, http.MethodPost, middlewares...)
|
|
|
|
|
|
+ item.bind(b.routerGroup, http.MethodPost, middlewares...)
|
|
}
|
|
}
|
|
|
|
|
|
func DeleteBind[I any, O any](b *Binding, item *SimpleBindItem[I, O], middlewares ...middleware.Func) {
|
|
func DeleteBind[I any, O any](b *Binding, item *SimpleBindItem[I, O], middlewares ...middleware.Func) {
|
|
- item.bind(b.RouterGroup, http.MethodDelete, middlewares...)
|
|
|
|
|
|
+ item.bind(b.routerGroup, http.MethodDelete, middlewares...)
|
|
}
|
|
}
|
|
|
|
|
|
func PutBind[I any, O any](b *Binding, item *SimpleBindItem[I, O], middlewares ...middleware.Func) {
|
|
func PutBind[I any, O any](b *Binding, item *SimpleBindItem[I, O], middlewares ...middleware.Func) {
|
|
- item.bind(b.RouterGroup, http.MethodPut, middlewares...)
|
|
|
|
|
|
+ item.bind(b.routerGroup, http.MethodPut, middlewares...)
|
|
}
|
|
}
|
|
|
|
|
|
func GetBind[I any, O any](b *Binding, item *SimpleBindItem[I, O], middlewares ...middleware.Func) {
|
|
func GetBind[I any, O any](b *Binding, item *SimpleBindItem[I, O], middlewares ...middleware.Func) {
|
|
- item.bind(b.RouterGroup, http.MethodGet, middlewares...)
|
|
|
|
|
|
+ item.bind(b.routerGroup, http.MethodGet, middlewares...)
|
|
}
|
|
}
|
|
|
|
|
|
func Bind[I any, O any](b *Binding, item *BindItem[I, O], middlewares ...middleware.Func) {
|
|
func Bind[I any, O any](b *Binding, item *BindItem[I, O], middlewares ...middleware.Func) {
|
|
- item.bind(b.RouterGroup, middlewares...)
|
|
|
|
|
|
+ item.bind(b.routerGroup, middlewares...)
|
|
}
|
|
}
|
|
|
|
|
|
func Static(b *Binding, item *StaticBindItem) {
|
|
func Static(b *Binding, item *StaticBindItem) {
|
|
- item.bind(b.RouterGroup)
|
|
|
|
|
|
+ item.bind(b.routerGroup)
|
|
}
|
|
}
|
|
|
|
|
|
type SimpleBindItem[I any, O any] struct {
|
|
type SimpleBindItem[I any, O any] struct {
|