Skip to content

Commit

Permalink
!76 [Bugfix] 调整文档格式,补充缺失逻辑
Browse files Browse the repository at this point in the history
Merge pull request !76 from flytreeleft/bugfixes
  • Loading branch information
entropy-cloud authored and gitee-org committed Aug 12, 2024
2 parents 92bdfb6 + 6cec4b3 commit f7ca6fe
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion docs/dev-guide/xlang/xmeta.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ NopGraphQL引擎返回的对象信息完全由XMeta来定义。如果一个属

实体模型中的关联对象生成到XMeta模型中体现为如下配置

```
```xml
<props>
<prop name="parent">
<schema bizObjName="NopAuthDepartment" />
Expand Down
4 changes: 2 additions & 2 deletions docs/tutorial/simple/4-complex-query.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ query($filter1:Map, $filter2: Map){
可以在XMeta中增加一个自定义字段,然后通过`graphql:transFilter`将自定义字段条件翻译为子表查询条件所对应的SQL语句。
具体实现原理是利用QueryBean提供的transformFilter函数,对前台提交的查询条件进行结构变换,

例如对于`/r/NopAuthSite__findPage?filter__myCustomFilter=main`这种自定义查询条件,
例如对于`/r/NopAuthSite__findPage?filter__myCustomFilter=1`这种自定义查询条件,
我们在XMeta中通过prop节点的`graphql:transFilter`子节点配置来定义转换逻辑。

```xml
Expand All @@ -236,7 +236,7 @@ select o
from NopAuthSite o
where
exists( select o2 from NopAuthResource o2 where o2.siteId= o.id
and o2.status >= 'main'
and o2.status >= 1
)
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,10 @@ private void doCheckAuth(String objTypeName, IObjPropMeta propMeta, ActionAuthMe
if (authChecker == null || auth == null)
return;

// 如果是公开方法,则不检查用户权限
if (auth.isPublicAccess())
return;

if (auth.getRoles() != null && !auth.getRoles().isEmpty()) {
if (this.context.getUserContext().isUserInAnyRole(auth.getRoles()))
return;
Expand Down Expand Up @@ -416,4 +420,4 @@ public Map<String, Object> validateForSelection(Map<String, Object> data, String
return validateAndConvert(data, selectionMeta.getMapping(),
(propMeta, sel, subTable) -> sel.hasField(propMeta.getName()));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@
ui:editGrid="string" ui:viewGrid="string" ui:maskPattern="string" ui:shortcuts="string"
orm:manyToManyRefProp="string"
xml:mapper="string" graphql:mapper="string" biz:codeRule="string" graphql:datePattern="string"
graphql:type="string" graphql:jsonComponentProp="string" graphql:dictValueProp="prop-path"
graphql:type="string" graphql:jsonComponentProp="string"
graphql:dictName="string" graphql:dictValueProp="prop-path"
graphql:joinLeftProps="word-set" graphql:joinRightProps="word-set"
graphql:connectionProp="prop-name" graphql:maxFetchSize="int"
graphql:queryMethod="dict:core/std-query-method" graphql:authObjName="string"
Expand Down Expand Up @@ -128,4 +129,4 @@
<unknownTag xdef:ref="schema.xdef" xdef:bean-prop="unknownTagSchema"/>

<unknownAttr xdef:ref="schema.xdef" xdef:bean-prop="unknownAttrSchema"/>
</schema>
</schema>
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@
ui:editGrid="string" ui:viewGrid="string" ui:maskPattern="string"
orm:manyToManyRefProp="string"
xml:mapper="string" graphql:mapper="string" biz:codeRule="string" graphql:datePattern="string"
graphql:type="string" graphql:jsonComponentProp="string" graphql:dictValueProp="prop-path"
graphql:type="string" graphql:jsonComponentProp="string"
graphql:dictName="string" graphql:dictValueProp="prop-path"
graphql:joinLeftProps="word-set" graphql:joinRightProps="word-set"
graphql:connectionProp="prop-name" graphql:maxFetchSize="int"
graphql:queryMethod="dict:core/std-query-method" graphql:authObjName="string"
Expand Down Expand Up @@ -143,4 +144,4 @@
<unknownTag xdef:ref="ISchema" xdef:bean-prop="unknownTagSchema"/>

<unknownAttr xdef:ref="ISchema" xdef:bean-prop="unknownAttrSchema"/>
</schema>
</schema>
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ options:

- value: conf-name
label: 配置变量名
description: 配置变量名,由英文字母、数字、下划线、字符-和.构成,不包含下划线、$等特殊字符
description: 配置变量名,由英文字母、数字、下划线、字符-和.构成,不包含$等特殊字符

- value: url
label: 网页URL
Expand Down

0 comments on commit f7ca6fe

Please sign in to comment.