Skip to content

[问题咨询] 同一个json请求中,同时新增和删除 #809

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
zc0707 opened this issue Apr 9, 2025 · 1 comment
Open

[问题咨询] 同一个json请求中,同时新增和删除 #809

zc0707 opened this issue Apr 9, 2025 · 1 comment

Comments

@zc0707
Copy link

zc0707 commented Apr 9, 2025

Description

请求CURD方法参数:{
"@post": ["MobilizeTaskInfo[]"],
"MobilizeTaskInfo": {
"id{}": ["09a7a740-1935-469a-ab76-ea1ee1f94ddc"]
},
"@delete": ["MobilizeTaskInfo"],
"MobilizeTaskInfo[]": [{
"leading_unit_name": "市交通局",
"serial_number": "GD2025-064",
"task_content": "提前勘察部队过境路线,确保道路具备安全通行条件",
"issue_time": "2025-04-09 15:51:06",
"predict_end_time": "2025年3月31日上午10:00前完成",
"status": 1
}]
}
报错信息:服务器内部错误:getColumnString 不支持 CRUD 等 [GET,GETS,HEAD,HEADS,POST] 外的ReuqestMethod!
版本号:6.3.0

@zc0707 zc0707 changed the title [问题咨询] 同一个josn请求中,同时新增和删除 [问题咨询] 同一个json请求中,同时新增和删除 Apr 9, 2025
@TommyLemon
Copy link
Collaborator

TommyLemon commented Apr 11, 2025

@zc0707 @post, @delete 等对应值只支持 String 和 JSONObject
https://github.com/Tencent/APIJSON/blob/master/README-extend.md

Image

POST http://apijson.cn:8080/crud

{
    "@delete": "Moment:Moment", // 目前 7.0.3+ 有 bug,不支持直接写 Table 来省略 tag,而是必须 Table:tag
    "Moment": { // 目前 7.0.3+ 有 bug,会把要删除的记录查出来返回,而不是删除,改成 6.3.0 等其它版本试试
        "id": 1719226824391
    },
    "@post": "Comment[]",
    "Comment[]": [
        {
            "momentId": 12,
            "content": "test post comment"
        },
        {
            "momentId": 12,
            "content": "test post comment2"
        }
    ]
}

http://apijson.cn/api

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants