|
|
@@ -3,6 +3,7 @@ package gwtools
|
|
|
import (
|
|
|
"git.sxidc.com/go-framework/baize/framework/core/api"
|
|
|
"git.sxidc.com/go-framework/baize/framework/gateway"
|
|
|
+ "git.sxidc.com/go-tools/utils/http_client"
|
|
|
"git.sxidc.com/go-tools/utils/template"
|
|
|
"github.com/iancoleman/strcase"
|
|
|
"net/http"
|
|
|
@@ -77,37 +78,45 @@ func (params *EntityCRUDParams) crud(builder *gateway.Builder) {
|
|
|
|
|
|
copyBuilder := builder.Url(http.MethodPost, domainPath+"/create")
|
|
|
|
|
|
- postRequest := gateway.NewPostRequest(params.ServiceVersionedUrl+domainPath+"/create",
|
|
|
- gateway.PostRequestWithBodyForm(func(c *api.Context, historyRequest []gateway.BuilderRequest, resultMap map[string]any) (any, error) {
|
|
|
- _, err := gateway.FormJsonBodyWithTenantIDAndUserIDFunc("tenantId", "createUserId")(c, historyRequest, resultMap)
|
|
|
+ var postRequestCallback gateway.RequestResponseCallback
|
|
|
+ if createOptions.afterBuilderCallback != nil {
|
|
|
+ postRequestCallback = func(c *api.Context, response *http_client.Response, historyRequests []gateway.BuilderRequest, resultMap map[string]any) error {
|
|
|
+ innerBuilder, err := createOptions.afterBuilderCallback(copyBuilder, c)
|
|
|
if err != nil {
|
|
|
- return nil, err
|
|
|
+ return err
|
|
|
}
|
|
|
|
|
|
- if createOptions.beforeBuilderCallback != nil {
|
|
|
- innerBuilder, err := createOptions.beforeBuilderCallback(copyBuilder, c)
|
|
|
+ copyBuilder = innerBuilder
|
|
|
+
|
|
|
+ return nil
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ copyBuilder.
|
|
|
+ Post(gateway.NewPostRequest(params.ServiceVersionedUrl+domainPath+"/create",
|
|
|
+ gateway.PostRequestWithBodyForm(func(c *api.Context, historyRequest []gateway.BuilderRequest, resultMap map[string]any) (any, error) {
|
|
|
+ _, err := gateway.FormJsonBodyWithTenantIDAndUserIDFunc("tenantId", "createUserId")(c, historyRequest, resultMap)
|
|
|
if err != nil {
|
|
|
return nil, err
|
|
|
}
|
|
|
|
|
|
- copyBuilder = innerBuilder
|
|
|
- }
|
|
|
-
|
|
|
- jsonBody, err := c.GetJsonBody()
|
|
|
- if err != nil {
|
|
|
- return nil, err
|
|
|
- }
|
|
|
+ if createOptions.beforeBuilderCallback != nil {
|
|
|
+ innerBuilder, err := createOptions.beforeBuilderCallback(copyBuilder, c)
|
|
|
+ if err != nil {
|
|
|
+ return nil, err
|
|
|
+ }
|
|
|
|
|
|
- return jsonBody.Map(), nil
|
|
|
- }))
|
|
|
-
|
|
|
- copyBuilder = copyBuilder.Post(postRequest, createOptions.requestResponseCallback)
|
|
|
+ copyBuilder = innerBuilder
|
|
|
+ }
|
|
|
|
|
|
- if createOptions.afterBuilderCallback != nil {
|
|
|
- copyBuilder = createOptions.afterBuilderCallback(copyBuilder)
|
|
|
- }
|
|
|
+ jsonBody, err := c.GetJsonBody()
|
|
|
+ if err != nil {
|
|
|
+ return nil, err
|
|
|
+ }
|
|
|
|
|
|
- copyBuilder.Build(createMiddlewares...)
|
|
|
+ return jsonBody.Map(), nil
|
|
|
+ })), postRequestCallback).
|
|
|
+ Build(createMiddlewares...)
|
|
|
}
|
|
|
|
|
|
// 删除
|
|
|
@@ -116,27 +125,38 @@ func (params *EntityCRUDParams) crud(builder *gateway.Builder) {
|
|
|
|
|
|
copyBuilder := builder.Url(http.MethodDelete, domainPath+"/delete")
|
|
|
|
|
|
- deleteRequest := gateway.NewDeleteRequest(params.ServiceVersionedUrl+domainPath+"/delete",
|
|
|
- gateway.DeleteRequestWithQueryParamsForm(func(c *api.Context, historyRequest []gateway.BuilderRequest, resultMap map[string]any) (map[string]string, error) {
|
|
|
- if deleteOptions.beforeBuilderCallback != nil {
|
|
|
+ var queryParamsFormOption gateway.DeleteRequestOption
|
|
|
+ if deleteOptions.beforeBuilderCallback != nil {
|
|
|
+ queryParamsFormOption = gateway.DeleteRequestWithQueryParamsForm(
|
|
|
+ func(c *api.Context, historyRequest []gateway.BuilderRequest, resultMap map[string]any) (map[string]string, error) {
|
|
|
innerBuilder, err := deleteOptions.beforeBuilderCallback(copyBuilder, c)
|
|
|
if err != nil {
|
|
|
return nil, err
|
|
|
}
|
|
|
|
|
|
copyBuilder = innerBuilder
|
|
|
- }
|
|
|
-
|
|
|
- return c.GetQueryParams().Map(), nil
|
|
|
- }))
|
|
|
|
|
|
- copyBuilder = copyBuilder.Delete(deleteRequest, deleteOptions.requestResponseCallback)
|
|
|
+ return c.GetQueryParams().Map(), nil
|
|
|
+ })
|
|
|
+ }
|
|
|
|
|
|
+ var deleteRequestCallback gateway.RequestResponseCallback
|
|
|
if deleteOptions.afterBuilderCallback != nil {
|
|
|
- copyBuilder = deleteOptions.afterBuilderCallback(copyBuilder)
|
|
|
+ deleteRequestCallback = func(c *api.Context, response *http_client.Response, historyRequests []gateway.BuilderRequest, resultMap map[string]any) error {
|
|
|
+ innerBuilder, err := deleteOptions.afterBuilderCallback(copyBuilder, c)
|
|
|
+ if err != nil {
|
|
|
+ return err
|
|
|
+ }
|
|
|
+
|
|
|
+ copyBuilder = innerBuilder
|
|
|
+
|
|
|
+ return nil
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
- copyBuilder.Build(deleteMiddlewares...)
|
|
|
+ copyBuilder.
|
|
|
+ Delete(gateway.NewDeleteRequest(params.ServiceVersionedUrl+domainPath+"/delete", queryParamsFormOption), deleteRequestCallback).
|
|
|
+ Build(deleteMiddlewares...)
|
|
|
}
|
|
|
|
|
|
// 修改
|
|
|
@@ -145,7 +165,21 @@ func (params *EntityCRUDParams) crud(builder *gateway.Builder) {
|
|
|
|
|
|
copyBuilder := builder.Url(http.MethodPut, domainPath+"/update")
|
|
|
|
|
|
- putRequest := gateway.NewPutRequest(params.ServiceVersionedUrl+domainPath+"/update",
|
|
|
+ var putRequestCallback gateway.RequestResponseCallback
|
|
|
+ if updateOptions.afterBuilderCallback != nil {
|
|
|
+ putRequestCallback = func(c *api.Context, response *http_client.Response, historyRequests []gateway.BuilderRequest, resultMap map[string]any) error {
|
|
|
+ innerBuilder, err := updateOptions.afterBuilderCallback(copyBuilder, c)
|
|
|
+ if err != nil {
|
|
|
+ return err
|
|
|
+ }
|
|
|
+
|
|
|
+ copyBuilder = innerBuilder
|
|
|
+
|
|
|
+ return nil
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ copyBuilder.Put(gateway.NewPutRequest(params.ServiceVersionedUrl+domainPath+"/update",
|
|
|
gateway.PutRequestWithBodyForm(func(c *api.Context, historyRequest []gateway.BuilderRequest, resultMap map[string]any) (any, error) {
|
|
|
_, err := gateway.FormJsonBodyWithTenantIDAndUserIDFunc("", "updateUserId")(c, historyRequest, resultMap)
|
|
|
if err != nil {
|
|
|
@@ -167,15 +201,8 @@ func (params *EntityCRUDParams) crud(builder *gateway.Builder) {
|
|
|
}
|
|
|
|
|
|
return jsonBody.Map(), nil
|
|
|
- }))
|
|
|
-
|
|
|
- copyBuilder = copyBuilder.Put(putRequest, updateOptions.requestResponseCallback)
|
|
|
-
|
|
|
- if updateOptions.afterBuilderCallback != nil {
|
|
|
- copyBuilder = updateOptions.afterBuilderCallback(copyBuilder)
|
|
|
- }
|
|
|
-
|
|
|
- copyBuilder.Build(updateMiddlewares...)
|
|
|
+ })), putRequestCallback).
|
|
|
+ Build(updateMiddlewares...)
|
|
|
}
|
|
|
|
|
|
// 查询
|
|
|
@@ -184,7 +211,21 @@ func (params *EntityCRUDParams) crud(builder *gateway.Builder) {
|
|
|
|
|
|
copyBuilder := builder.Url(http.MethodGet, domainPath+"/query")
|
|
|
|
|
|
- getRequest := gateway.NewGetRequest(params.ServiceVersionedUrl+domainPath+"/query",
|
|
|
+ var getRequestCallback gateway.RequestResponseCallback
|
|
|
+ if queryOptions.afterBuilderCallback != nil {
|
|
|
+ getRequestCallback = func(c *api.Context, response *http_client.Response, historyRequests []gateway.BuilderRequest, resultMap map[string]any) error {
|
|
|
+ innerBuilder, err := queryOptions.afterBuilderCallback(copyBuilder, c)
|
|
|
+ if err != nil {
|
|
|
+ return err
|
|
|
+ }
|
|
|
+
|
|
|
+ copyBuilder = innerBuilder
|
|
|
+
|
|
|
+ return nil
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ copyBuilder.Get(gateway.NewGetRequest(params.ServiceVersionedUrl+domainPath+"/query",
|
|
|
gateway.GetRequestWithQueryParamsForm(func(c *api.Context, historyRequest []gateway.BuilderRequest, resultMap map[string]any) (map[string]string, error) {
|
|
|
_, err := gateway.FormQueryParamsWithTenantIDAndUserIDFunc("tenantId", "")(c, historyRequest, resultMap)
|
|
|
if err != nil {
|
|
|
@@ -201,15 +242,8 @@ func (params *EntityCRUDParams) crud(builder *gateway.Builder) {
|
|
|
}
|
|
|
|
|
|
return c.GetQueryParams().Map(), nil
|
|
|
- }))
|
|
|
-
|
|
|
- copyBuilder = copyBuilder.Get(getRequest, queryOptions.requestResponseCallback)
|
|
|
-
|
|
|
- if queryOptions.afterBuilderCallback != nil {
|
|
|
- copyBuilder = queryOptions.afterBuilderCallback(copyBuilder)
|
|
|
- }
|
|
|
-
|
|
|
- copyBuilder.Build(queryMiddlewares...)
|
|
|
+ })), getRequestCallback).
|
|
|
+ Build(queryMiddlewares...)
|
|
|
}
|
|
|
|
|
|
// 通过ID获取
|
|
|
@@ -218,32 +252,41 @@ func (params *EntityCRUDParams) crud(builder *gateway.Builder) {
|
|
|
|
|
|
copyBuilder := builder.Url(http.MethodGet, domainPath+"/get")
|
|
|
|
|
|
- getRequest := gateway.NewGetRequest(params.ServiceVersionedUrl+domainPath+"/get",
|
|
|
- gateway.GetRequestWithQueryParamsForm(func(c *api.Context, historyRequest []gateway.BuilderRequest, resultMap map[string]any) (map[string]string, error) {
|
|
|
- if getByIDOptions.beforeBuilderCallback != nil {
|
|
|
- innerBuilder, err := getByIDOptions.beforeBuilderCallback(copyBuilder, c)
|
|
|
- if err != nil {
|
|
|
- return nil, err
|
|
|
- }
|
|
|
-
|
|
|
- copyBuilder = innerBuilder
|
|
|
+ var formQueryParamsOption gateway.GetRequestOption
|
|
|
+ if getByIDOptions.beforeBuilderCallback != nil {
|
|
|
+ formQueryParamsOption = gateway.GetRequestWithQueryParamsForm(func(c *api.Context, historyRequest []gateway.BuilderRequest, resultMap map[string]any) (map[string]string, error) {
|
|
|
+ innerBuilder, err := getByIDOptions.beforeBuilderCallback(copyBuilder, c)
|
|
|
+ if err != nil {
|
|
|
+ return nil, err
|
|
|
}
|
|
|
|
|
|
- return c.GetQueryParams().Map(), nil
|
|
|
- }))
|
|
|
+ copyBuilder = innerBuilder
|
|
|
|
|
|
- copyBuilder = copyBuilder.Get(getRequest, getByIDOptions.requestResponseCallback)
|
|
|
+ return c.GetQueryParams().Map(), nil
|
|
|
+ })
|
|
|
+ }
|
|
|
|
|
|
+ var getRequestCallback gateway.RequestResponseCallback
|
|
|
if getByIDOptions.afterBuilderCallback != nil {
|
|
|
- copyBuilder = getByIDOptions.afterBuilderCallback(copyBuilder)
|
|
|
+ getRequestCallback = func(c *api.Context, response *http_client.Response, historyRequests []gateway.BuilderRequest, resultMap map[string]any) error {
|
|
|
+ innerBuilder, err := getByIDOptions.afterBuilderCallback(copyBuilder, c)
|
|
|
+ if err != nil {
|
|
|
+ return err
|
|
|
+ }
|
|
|
+
|
|
|
+ copyBuilder = innerBuilder
|
|
|
+
|
|
|
+ return nil
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
- copyBuilder.Build(getByIDMiddlewares...)
|
|
|
+ copyBuilder.
|
|
|
+ Get(gateway.NewGetRequest(params.ServiceVersionedUrl+domainPath+"/get", formQueryParamsOption), getRequestCallback).
|
|
|
+ Build(getByIDMiddlewares...)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-type EntityCRUDBeforeCallback func(builder *gateway.Builder, c *api.Context) (*gateway.Builder, error)
|
|
|
-type EntityCRUDAfterCallback func(builder *gateway.Builder) *gateway.Builder
|
|
|
+type EntityCRUDBuilderCallback func(builder *gateway.Builder, c *api.Context) (*gateway.Builder, error)
|
|
|
|
|
|
type EntityCRUDGlobalOption func(options *EntityCRUDGlobalOptions)
|
|
|
type EntityCRUDCreateOption func(options *EntityCRUDCreateOptions)
|
|
|
@@ -261,13 +304,10 @@ type EntityCRUDCreateOptions struct {
|
|
|
disable bool
|
|
|
|
|
|
// 创建请求前回调
|
|
|
- beforeBuilderCallback EntityCRUDBeforeCallback
|
|
|
-
|
|
|
- // 创建请求响应回调
|
|
|
- requestResponseCallback gateway.RequestResponseCallback
|
|
|
+ beforeBuilderCallback EntityCRUDBuilderCallback
|
|
|
|
|
|
// 创建请求后回调
|
|
|
- afterBuilderCallback EntityCRUDAfterCallback
|
|
|
+ afterBuilderCallback EntityCRUDBuilderCallback
|
|
|
|
|
|
// 创建中间件
|
|
|
middlewares []api.Handler
|
|
|
@@ -278,13 +318,10 @@ type EntityCRUDDeleteOptions struct {
|
|
|
disable bool
|
|
|
|
|
|
// 删除请求前回调
|
|
|
- beforeBuilderCallback EntityCRUDBeforeCallback
|
|
|
-
|
|
|
- // 删除请求响应回调
|
|
|
- requestResponseCallback gateway.RequestResponseCallback
|
|
|
+ beforeBuilderCallback EntityCRUDBuilderCallback
|
|
|
|
|
|
// 删除请求后回调
|
|
|
- afterBuilderCallback EntityCRUDAfterCallback
|
|
|
+ afterBuilderCallback EntityCRUDBuilderCallback
|
|
|
|
|
|
// 删除中间件
|
|
|
middlewares []api.Handler
|
|
|
@@ -295,13 +332,10 @@ type EntityCRUDUpdateOptions struct {
|
|
|
disable bool
|
|
|
|
|
|
// 更新请求前回调
|
|
|
- beforeBuilderCallback EntityCRUDBeforeCallback
|
|
|
-
|
|
|
- // 更新请求响应回调
|
|
|
- requestResponseCallback gateway.RequestResponseCallback
|
|
|
+ beforeBuilderCallback EntityCRUDBuilderCallback
|
|
|
|
|
|
// 更新请求后回调
|
|
|
- afterBuilderCallback EntityCRUDAfterCallback
|
|
|
+ afterBuilderCallback EntityCRUDBuilderCallback
|
|
|
|
|
|
// 更新中间件
|
|
|
middlewares []api.Handler
|
|
|
@@ -312,13 +346,10 @@ type EntityCRUDQueryOptions struct {
|
|
|
disable bool
|
|
|
|
|
|
// 查询请求前回调
|
|
|
- beforeBuilderCallback EntityCRUDBeforeCallback
|
|
|
-
|
|
|
- // 查询请求响应回调
|
|
|
- requestResponseCallback gateway.RequestResponseCallback
|
|
|
+ beforeBuilderCallback EntityCRUDBuilderCallback
|
|
|
|
|
|
// 查询请求后回调
|
|
|
- afterBuilderCallback EntityCRUDAfterCallback
|
|
|
+ afterBuilderCallback EntityCRUDBuilderCallback
|
|
|
|
|
|
// 查询中间件
|
|
|
middlewares []api.Handler
|
|
|
@@ -329,13 +360,10 @@ type EntityCRUDGetByIDOptions struct {
|
|
|
disable bool
|
|
|
|
|
|
// 根据ID请求前回调
|
|
|
- beforeBuilderCallback EntityCRUDBeforeCallback
|
|
|
-
|
|
|
- // 根据ID请求响应回调
|
|
|
- requestResponseCallback gateway.RequestResponseCallback
|
|
|
+ beforeBuilderCallback EntityCRUDBuilderCallback
|
|
|
|
|
|
// 根据ID请求后回调
|
|
|
- afterBuilderCallback EntityCRUDAfterCallback
|
|
|
+ afterBuilderCallback EntityCRUDBuilderCallback
|
|
|
|
|
|
// 根据ID查询中间件
|
|
|
middlewares []api.Handler
|
|
|
@@ -347,19 +375,13 @@ func WithEntityCRUDGlobalMiddlewares(middlewares ...api.Handler) EntityCRUDGloba
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-func WithEntityCRUDBeforeCreateBuilderCallback(callbacks EntityCRUDBeforeCallback) EntityCRUDCreateOption {
|
|
|
+func WithEntityCRUDBeforeCreateBuilderCallback(callbacks EntityCRUDBuilderCallback) EntityCRUDCreateOption {
|
|
|
return func(options *EntityCRUDCreateOptions) {
|
|
|
options.beforeBuilderCallback = callbacks
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-func WithEntityCRUDCreateCallbacks(callbacks gateway.RequestResponseCallback) EntityCRUDCreateOption {
|
|
|
- return func(options *EntityCRUDCreateOptions) {
|
|
|
- options.requestResponseCallback = callbacks
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-func WithEntityCRUDAfterCreateBuilderCallback(callbacks EntityCRUDAfterCallback) EntityCRUDCreateOption {
|
|
|
+func WithEntityCRUDAfterCreateBuilderCallback(callbacks EntityCRUDBuilderCallback) EntityCRUDCreateOption {
|
|
|
return func(options *EntityCRUDCreateOptions) {
|
|
|
options.afterBuilderCallback = callbacks
|
|
|
}
|
|
|
@@ -377,19 +399,13 @@ func WithEntityCRUDDisableDelete() EntityCRUDDeleteOption {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-func WithEntityCRUDBeforeDeleteBuilderCallback(callbacks EntityCRUDBeforeCallback) EntityCRUDDeleteOption {
|
|
|
+func WithEntityCRUDBeforeDeleteBuilderCallback(callbacks EntityCRUDBuilderCallback) EntityCRUDDeleteOption {
|
|
|
return func(options *EntityCRUDDeleteOptions) {
|
|
|
options.beforeBuilderCallback = callbacks
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-func WithEntityCRUDDeleteCallbacks(callbacks gateway.RequestResponseCallback) EntityCRUDDeleteOption {
|
|
|
- return func(options *EntityCRUDDeleteOptions) {
|
|
|
- options.requestResponseCallback = callbacks
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-func WithEntityCRUDAfterDeleteBuilderCallback(callbacks EntityCRUDAfterCallback) EntityCRUDDeleteOption {
|
|
|
+func WithEntityCRUDAfterDeleteBuilderCallback(callbacks EntityCRUDBuilderCallback) EntityCRUDDeleteOption {
|
|
|
return func(options *EntityCRUDDeleteOptions) {
|
|
|
options.afterBuilderCallback = callbacks
|
|
|
}
|
|
|
@@ -407,19 +423,13 @@ func WithEntityCRUDDisableUpdate() EntityCRUDUpdateOption {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-func WithEntityCRUDBeforeUpdateBuilderCallback(callbacks EntityCRUDBeforeCallback) EntityCRUDUpdateOption {
|
|
|
+func WithEntityCRUDBeforeUpdateBuilderCallback(callbacks EntityCRUDBuilderCallback) EntityCRUDUpdateOption {
|
|
|
return func(options *EntityCRUDUpdateOptions) {
|
|
|
options.beforeBuilderCallback = callbacks
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-func WithEntityCRUDUpdateCallbacks(callbacks gateway.RequestResponseCallback) EntityCRUDUpdateOption {
|
|
|
- return func(options *EntityCRUDUpdateOptions) {
|
|
|
- options.requestResponseCallback = callbacks
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-func WithEntityCRUDAfterUpdateBuilderCallback(callbacks EntityCRUDAfterCallback) EntityCRUDUpdateOption {
|
|
|
+func WithEntityCRUDAfterUpdateBuilderCallback(callbacks EntityCRUDBuilderCallback) EntityCRUDUpdateOption {
|
|
|
return func(options *EntityCRUDUpdateOptions) {
|
|
|
options.afterBuilderCallback = callbacks
|
|
|
}
|
|
|
@@ -437,19 +447,13 @@ func WithEntityCRUDDisableQuery() EntityCRUDQueryOption {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-func WithEntityCRUDBeforeQueryBuilderCallback(callbacks EntityCRUDBeforeCallback) EntityCRUDQueryOption {
|
|
|
+func WithEntityCRUDBeforeQueryBuilderCallback(callbacks EntityCRUDBuilderCallback) EntityCRUDQueryOption {
|
|
|
return func(options *EntityCRUDQueryOptions) {
|
|
|
options.beforeBuilderCallback = callbacks
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-func WithEntityCRUDQueryCallbacks(callbacks gateway.RequestResponseCallback) EntityCRUDQueryOption {
|
|
|
- return func(options *EntityCRUDQueryOptions) {
|
|
|
- options.requestResponseCallback = callbacks
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-func WithEntityCRUDAfterQueryBuilderCallback(callbacks EntityCRUDAfterCallback) EntityCRUDQueryOption {
|
|
|
+func WithEntityCRUDAfterQueryBuilderCallback(callbacks EntityCRUDBuilderCallback) EntityCRUDQueryOption {
|
|
|
return func(options *EntityCRUDQueryOptions) {
|
|
|
options.afterBuilderCallback = callbacks
|
|
|
}
|
|
|
@@ -467,19 +471,13 @@ func WithEntityCRUDDisableGetByID() EntityCRUDGetByIDOption {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-func WithEntityCRUDBeforeGetByIDBuilderCallback(callbacks EntityCRUDBeforeCallback) EntityCRUDGetByIDOption {
|
|
|
+func WithEntityCRUDBeforeGetByIDBuilderCallback(callbacks EntityCRUDBuilderCallback) EntityCRUDGetByIDOption {
|
|
|
return func(options *EntityCRUDGetByIDOptions) {
|
|
|
options.beforeBuilderCallback = callbacks
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-func WithEntityCRUDGetByIDCallbacks(callbacks gateway.RequestResponseCallback) EntityCRUDGetByIDOption {
|
|
|
- return func(options *EntityCRUDGetByIDOptions) {
|
|
|
- options.requestResponseCallback = callbacks
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-func WithEntityCRUDAfterGetByIDBuilderCallback(callbacks EntityCRUDAfterCallback) EntityCRUDGetByIDOption {
|
|
|
+func WithEntityCRUDAfterGetByIDBuilderCallback(callbacks EntityCRUDBuilderCallback) EntityCRUDGetByIDOption {
|
|
|
return func(options *EntityCRUDGetByIDOptions) {
|
|
|
options.afterBuilderCallback = callbacks
|
|
|
}
|