GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [Bug] Demo项目多表插入报错 · Issue #512 · APIJSON/APIJSON

[Bug] Demo项目多表插入报错 #512

New issue
Copy link
New issue
Copy link
Closed
Closed
[Bug] Demo项目多表插入报错#512
Copy link
Labels
Bug 漏洞help wanted请求帮助请求帮助

Description

@aldag
aldag
opened on Feb 16, 2023
Issue body actions

APIJSON Version/APIJSON 版本号

6.0.0

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

mysql 5.7.38

Environment/环境信息

- JDK/基础库: 1.8.0_202
- OS/系统: win10

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

Current Behavior/问题描述

6.0.0版APIJSON-Demo项目多表插入报错,如截图中的register用例。
APIJSON-Demo项目除数据库连接外,未做其他代码修改;数据库中的Request表等关键表未做修改。

Expected Behavior/期望结果

No response

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

No response

Activity

  1. TommyLemon
    added
    Bug 漏洞
    on Feb 16, 2023
  2. TommyLemon commented on Feb 16, 2023

    @TommyLemon
    TommyLemon
    on Feb 16, 2023
    Member
    More actions

    是个 bug,我这边复现了,改用 5.4.0 以下试试
    https://github.com/APIJSON/APIJSON-Demo/releases

  3. cloudAndMonkey commented on Feb 17, 2023

    @cloudAndMonkey
    cloudAndMonkey
    on Feb 17, 2023
    Contributor
    More actions

    @aldag
    可以使用APIJSON全能接口 crud, 校验调用远程函数(前置远程函数,可以改变 request 参数), 能实现一样的效果

    crud:
    相同数据源,不同语句 支持事物
    支持apijson校验

    {
        "@post": {
            "User:aa": {
                "@datasource": "db2"
            },
            "User_address[]": {
                "@datasource": "db2"
            }
        },
        "User:aa": {
            "username": "test-3",
            "password": "233223",
            "state": 1
        },
        "ES_blog:a": {
            "@datasource": "elasticSearch",
            "title.keyword": "test-2"
        },
        "User_address[]": [
            {
                "user_id@": "User:aa/id",
                "addr": "ddd",
                "count@": "ES_blog:a/count"
            },
            {
                "user_id@": "User:aa/id",
                "addr": "ddd1",
                "count@": "ES_blog:a/count"
            }
        ],
        "@explain": true,
        "format": true
    }
    Reacted by TommyLemon
  4. TommyLemon commented on Apr 12, 2023

    @TommyLemon
    TommyLemon
    on Apr 12, 2023
    Member
    More actions

    版本6.0.0的APIJSON 您好:这种格式的请求现在不适配了吗 123123123 2222222 我看每个子json都是单独解析的 333331

    这里不应该只 requestItem.put(_key, obj),丢了 "Request":{} 对象导致 objectVerify 抛异常,
    应该把原始请求的所有键值对 put 进去,可以 requestItem.putAll(原来的 request 对象)。

    可以改下源码试试,如果可以麻烦提 PR 贡献下代码哦,开源要大家一起参与贡献才会更美好~
    https://github.com/Tencent/APIJSON/blob/master/CONTRIBUTING.md

    image

  5. TommyLemon
    added
    help wanted请求帮助请求帮助
    on Apr 12, 2023
  6. wahowaho commented on Apr 13, 2023

    @wahowaho
    wahowaho
    on Apr 13, 2023
    Contributor
    More actions

    试了一下联合插入
    6666
    您那边看看这么改可以不。

  7. cloudAndMonkey commented on Apr 13, 2023

    @cloudAndMonkey
    cloudAndMonkey
    on Apr 13, 2023
    Contributor
    More actions

    @wahowaho
    你好, pr已经看到, 感谢贡献
    vertify 方法需要兼容 crud全能接口和 post等method.
    按照@TommyLemon 的意思, 别名不做提前 解析, 通过 Request structure 配置解决
    #468 (comment)
    删除 tag 、JSONObject 别名判断的代码, 或者把crud 和其他 method区别处理, 我晚上测一下, parse里面 会将crud转换为 PUT、DELETE、POST等方法执行, 需要确认是否有影响

  8. wahowaho commented on Apr 14, 2023

    @wahowaho
    wahowaho
    on Apr 14, 2023
    Contributor
    More actions

    @cloudAndMonkey 好滴好滴 ^_^

  9. TommyLemon commented on May 6, 2023

    @TommyLemon
    TommyLemon
    on May 6, 2023
    Member
    More actions

    @cloudAndMonkey @aldag @wahowaho
    6.1.0 已发布,解决了多表同时增删改的 bug 等问题;新增支持 Snowflake,Databricks,Cassandra;增强条件组合、参数校验等:
    https://github.com/Tencent/APIJSON/releases/tag/6.1.0
    https://github.com/APIJSON/apijson-framework/releases/tag/6.1.0
    https://github.com/APIJSON/apijson-router/releases/tag/1.6.0
    https://github.com/APIJSON/apijson-column/releases/tag/1.6.0

  10. TommyLemon
    closed this as completedon Aug 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bug 漏洞help wanted请求帮助请求帮助

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.