新增支持假删除 by cloudAndMonkey · Pull Request #493 · APIJSON/APIJSON
Repository navigation
新增支持假删除 - #493
Merged
TommyLemon merged 1 commit into APIJSON:master from cloudAndMonkey:master Jan 6, 2023
Merged
新增支持假删除 #493 TommyLemon merged 1 commit into APIJSON:master from cloudAndMonkey:master
Conversation
cloudAndMonkey commented Jan 6, 2023
Copy link Copy Markdown
Contributor
1、新增支持假删除
使用描述,参见framework
2、修改bug
{
"User_address": {
"user_id!": "3123f016-a4cc-455c-aac5-264c1230dcb",
"count": 11,
"count+": 1,
"@combine ": "user_id! | count"
},
"tag": "User_address",
"@Explain ": true
}
条件 修改、删除,@combine 强制指定 "count": "" 为条件
新增支持假删除
5f5300e
1、新增支持假删除
2、修改bug
{
"User_address": {
"user_id!": "3123f016-a4cc-455c-aac5-264c1230dcb",
"count": 11,
"count+": 1,
"@combine": "user_id! | count"
},
"tag": "User_address",
"@Explain": true
}
条件 修改、删除,@combine 强制指定 "count": "" 为条件
TommyLemon
reviewed
Jan 6, 2023
View reviewed changes
TommyLemon left a comment
Copy link Copy Markdown
Member
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more .
GETS/HEADS/PUT/DELETE 不允许前端传 @combine ,目前在这里去掉了校验,需要在 AbstractVerifier 补上,这样就只能通过后端配置 @combine 了,既保证了功能,又保证了安全
#425
297bdac
into
APIJSON : master
Jan 6, 2023
cloudAndMonkey commented Jan 6, 2023
Copy link Copy Markdown
Contributor
Author
|
@TommyLemon |
TommyLemon commented Jan 6, 2023 · edited Loading
Copy link Copy Markdown
Member
|
1.AbstractVerifier.IS_UPDATE_MUST_HAVE_ID_CONDITION = false 但因为 Operation 没有 AT_LEAST_ONE/ANY_ONE 这样的操作, 如果都传了,因为 id 强制作为 AND 条件,所以不能和其它条件 OR, method: DELETE
通过 date 条件删除
如果想只配置一条规则,则 Operation 加上 AT_LEAST_ONE/ANY_ONE ,然后配置
或
|
TommyLemon commented Jan 6, 2023 · edited Loading
Copy link Copy Markdown
Member
|
AT_LEAST_ONE/ANY_ONE 其中一个也可以通过扩展 MUST 来实现 还可以设置更复杂的表达方式 这样的话就不用加 Operation 了,不过 AbstractVerifier 仍然要处理下 REFUSE 和 MUST 的互斥关系 |
cloudAndMonkey commented Jan 6, 2023
Copy link Copy Markdown
Contributor
Author
|
哈哈,我先把 判断条件加啦。 |
TommyLemon commented Jan 6, 2023
Copy link Copy Markdown
Member
|
已加上 |
GETS/HEADS/PUT/DELETE 不允许前端传 @combine
e94c44f
APIJSON#493 GETS/HEADS/PUT/DELETE 不允许前端传 @combine,目前在这里去掉了校验,需要在 AbstractVerifier 补上,这样就只能通过后端配置 @combine 了,既保证了功能,又保证了安全cloudAndMonkey mentioned this pull request Jan 9, 2023 GETS/HEADS/PUT/DELETE 不允许前端传 @combine #494 Merged TommyLemon mentioned this pull request Feb 16, 2023 为什么限制在GETS中使用@combine #425 Closed Sign up for free to join this conversation on GitHub . Already have an account? Sign in to comment