1234567891011121314151617181920212223242526272829303132333435363738 |
- package definition
- import (
- "git.sxidc.com/go-framework/baize/framework/binding"
- "git.sxidc.com/go-framework/baize/framework/core/api"
- "git.sxidc.com/go-framework/baize/framework/core/api/request"
- "git.sxidc.com/go-framework/baize/framework/core/api/response"
- "git.sxidc.com/go-framework/baize/framework/core/domain"
- "git.sxidc.com/go-framework/baize/framework/core/infrastructure"
- )
- // Simple Bind参数
- type Simple struct {
- // schema
- Schema string
- }
- func (simple *Simple) Bind(binder *binding.Binder) {
- binding.GetBind(binder, &binding.SimpleBindItem[map[string]any]{
- Path: "/queryRuleDefinition/get",
- SendResponseFunc: response.SendMapResponse,
- RequestParams: &GetQueryRuleDefinitionQueryParams{},
- ServiceFunc: func(c *api.Context, params request.Params, objects []domain.Object, i *infrastructure.Infrastructure) (map[string]any, error) {
- errResponse := map[string]any{
- "definition": make([]Info, 0),
- }
- queryParams, err := request.ToConcrete[*GetQueryRuleDefinitionQueryParams](params)
- if err != nil {
- return errResponse, err
- }
- return map[string]any{
- "definition": formInfoBatch(GetQueryRuleDefinitions(queryParams.DomainName)),
- }, nil
- },
- })
- }
|