Skip to content

Commit

Permalink
docs: synced via GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
nop-cao committed May 2, 2024
1 parent b608c4d commit b2056cb
Showing 1 changed file with 34 additions and 16 deletions.
50 changes: 34 additions & 16 deletions src/dev-guide/graphql/crud.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ CrudBizModel提供了标准的增删改查操作,以NopAuthUser为例:
## 新增

```
# REST
# REST
POST /r/NopAuthUser__save?@selection=name,status
{
Expand All @@ -26,7 +26,7 @@ mutation{
## 修改

```
# REST
# REST
POST /r/NopAuthUser__update?@selection=name,status
{
Expand All @@ -50,7 +50,7 @@ mutation{
如果提交的data中包含主键,则认为是修改,否则是新建。

```
# REST
# REST
POST /r/NopAuthUser__save_update?@selection=name,status
{
Expand All @@ -72,7 +72,7 @@ mutation{
## 删除

```
# REST
# REST
POST /r/NopAuthUser__delete?@selection=name,status
{
Expand All @@ -91,7 +91,7 @@ mutation{
## 批量删除

```
# REST
# REST
POST /r/NopAuthUser__bathDelete?@selection=name,status
{
Expand All @@ -112,7 +112,7 @@ mutation{
批量更新指定记录的指定字段

```
# REST
# REST
POST /r/NopAuthUser__batchUpdate
{
Expand All @@ -133,7 +133,7 @@ mutation{
一次请求包含增加、删除、修改等多个操作

```
# REST
# REST
POST /r/NopAuthUser__batchModify
{
Expand All @@ -155,7 +155,7 @@ mutation{
## 单条读取

```
# REST
# REST
GET /r/NopAuthUser__get?id=xxx@selection=name,status
# GraphQL
Expand All @@ -170,14 +170,14 @@ query{
## 分页读取

```
# REST
# REST
POST /r/NopAuthUser__findPage?@selection=total,items{name,status}
{
"query": {
"offset": 2,
"limit": 10,
"filter": {
},
"orderBy":[
Expand All @@ -202,12 +202,12 @@ query{
## 查询返回列表

```
# REST
# REST
POST /r/NopAuthUser__findList?@selection=name,status
{
"query": {
"filter": {
},
"orderBy":[
Expand All @@ -229,12 +229,12 @@ query{
findFirst返回满足条件的第一条记录

```
# REST
# REST
POST /r/NopAuthUser__findFirst?@selection=name,status
{
"query": {
"filter": {
"$type": "eq",
"name": "status",
Expand All @@ -257,12 +257,12 @@ query{
## 查询返回列表的长度

```
# REST
# REST
POST /r/NopAuthUser__findCount
{
"query": {
"filter": {
}
}
Expand Down Expand Up @@ -408,3 +408,21 @@ POST /r/NopAuthUser__removeManyToManyRelations
```

id参数指定当前实体,propName参数指定要操作的多对多关联集合属性的名称,relValues对应于多对多关联表中的关联属性值。

## 根据条件查找到一批实体,更新它们的指定属性

```
POST /r/NopAuthUser__updateByQuery
{
“query": {
"$type": "eq",
"name": "status",
"value": 10
},
"data": {
"fldA": "aaa"
}
}
```

0 comments on commit b2056cb

Please sign in to comment.