Tencent / APIJSON

🏆 实时 零代码、全功能、强安全 ORM 库 🚀 后端接口和文档零代码,前端(客户端) 定制返回 JSON 的数据和结构 🏆 Real-Time coding-free, powerful and secure ORM 🚀 providing APIs and Docs without coding by Backend, and the returned JSON of API can be customized by Frontend(Client) users
http://apijson.cn
Other
17.32k stars 2.16k forks source link

同表批量插入 和删除报错 #579

Open wahowaho opened 1 year ago

wahowaho commented 1 year ago

APIJSON Version/APIJSON 版本号

6.1.0

Database Type & Version/数据库类型及版本号

5.7mysql

Environment/环境信息

- JDK/基础库: 1.8
- OS/系统:windows

APIAuto Screenshots/APIAuto 请求与结果完整截屏

微信截图_20230613093122

Current Behavior/问题描述

crud 批量插入 和批量删除同一个表 提示错误

Expected Behavior/期望结果

crud 批量插入 和批量删除同一个表 可以执行

Any additional comments?/其它补充说明?

No response

wahowaho commented 1 year ago

111 这是一种解决办法,但是不是理想的

cloudAndMonkey commented 1 year ago

@wahowaho 配置别名进行区分即可

awanghong commented 1 year ago

@wahowaho 配置别名进行区分即可

这个是怎么配置的呀?我一直都试不出来

cloudAndMonkey commented 1 year ago

@awanghong http://localhost:8080/forms/api/crud

{
    "@put": {
        "App_sys_user_1": {
            "tag": "App_sys_user_1"
        }
    },
    "@post": {
        "App_sys_user_post_1[]": {
            "tag": "App_sys_user_post_1[]"
        },
        "App_sys_user_role_1[]": {
            "tag": "App_sys_user_role_1[]"
        }
    },
    "@delete": {
        "App_sys_user_post_1:delUserPost": {
            "tag": "App_sys_user_post_1:delUserPost"
        },
        "App_sys_user_role_1:delUserRole": {
            "tag": "App_sys_user_role_1:delUserRole"
        }
    },
    "format": true,
    "@explain": true,
    "App_sys_user_1": {
        "id": "4732209c-5785-4827-b532-5092f154fd94",
        "nick_name": "1",
        "dept_id": "13d99300-c387-4345-a9df-9dd1ca7a1b28",
        "phonenumber": "1388888888",
        "email": "tt.t@qq.com",
        "user_name": "test",
        "password": "123456",
        "user_type": "00",
        "sex": 0,
        "status": 0,
        "remark": "test"
    },
    "App_sys_user_post_1[]": [
        {
            "user_id@": "App_sys_user_1/id",
            "post_id": "23ad79f3-7724-49be-8b5a-8031e562ee11"
        },
        {
            "user_id@": "App_sys_user_1/id",
            "post_id": "a98f1ea2-f383-4a21-9894-5f02806e9a012"
        }
    ],
    "App_sys_user_role_1[]": [
        {
            "user_id@": "App_sys_user_1/id",
            "role_id": "a824a122-bb8f-4656-b789-9d96d6dfd611"
        }
    ],
    "App_sys_user_post_1:delUserPost": {
        "user_id{}": [
            "4732209c-5785-4827-b532-5092f154fd94"
        ],
        "post_id{}": [
            "266d44e4-b74e-4f2d-a465-271aa5698625"
        ]
    },
    "App_sys_user_role_1:delUserRole": {
        "user_id{}": [
            "4732209c-5785-4827-b532-5092f154fd94"
        ],
        "role_id{}": [
            "a824a122-bb8f-4656-b789-9d96d6dfd611"
        ]
    },
    "@role": "LOGIN,OWNER,ADMIN"
}

Request 数据库需要配置别名(update、delete、put, get不用配置)

image