APIJSON icon indicating copy to clipboard operation
APIJSON copied to clipboard

同表批量插入 和删除报错

Open wahowaho opened this issue 2 years ago • 4 comments

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 avatar Jun 13 '23 01:06 wahowaho

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

wahowaho avatar Jun 14 '23 01:06 wahowaho

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

cloudAndMonkey avatar Jun 19 '23 07:06 cloudAndMonkey

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

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

awanghong avatar Aug 04 '23 02:08 awanghong

@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": "[email protected]",
        "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

cloudAndMonkey avatar Aug 10 '23 13:08 cloudAndMonkey