Skip to content
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

修复512 多表 gets bug、别名从代码解析改为数据库配置、支持sql@ update/delete #551

Merged
merged 1 commit into from
Apr 17, 2023

Conversation

cloudAndMonkey
Copy link
Contributor

示例:

Request表配置 Moment:m[], Moment:m, apijson是一层一层解析

{
    "Moment:m[]": [
        {
            "date": "2023-04-01 12:23:34",
          "content": "c1",
          "praiseUserIdList": "[82002, 70793, 38710, 93793]",
            "pictureList": "[\"http://static.oschina.net/uploads/user/1218/2437072_100.jpg?t=1461076033000\", \"http://common.cnblogs.com/images/icon_weibo_24.png\"]"
        },
        {
            "date": "2023-04-02 12:23:34",
          "content": "c2",
          "praiseUserIdList": "[82002, 70793, 38710, 93793]",
            "pictureList": "[\"http://static.oschina.net/uploads/user/1218/2437072_100.jpg?t=1461076033000\", \"http://common.cnblogs.com/images/icon_weibo_24.png\"]"
        }
    ],
    "tag": "Moment:m:[]",
    "format": true,
    "@explain": true
}
INSERT INTO `request` (`id`, `debug`, `version`, `method`, `tag`, `structure`, `detail`, `date`) VALUES (304, 0, 2, 'POST', 'Moment:m:[]', '{\"TYPE\": {\"Moment:m[]\": \"OBJECT[]\"}, \"INSERT\": {\"@role\": \"OWNER,ADMIN\"}, \"Moment:m[]\": []}', NULL, '2020-03-01 13:41:42');

gets 多表

{
    "User:u":{
        "id": "05e5a4a9-4ab1-4a7a-83ff-8d22999c58df"
    },
    "User_address:r":{
        "id@": "/User:u/id"
    },
    "tag": "User:u",
    "format": true,
    "@explain": true
}
INSERT INTO  `request` (`id`, `debug`, `version`, `method`, `tag`, `structure`, `detail`, `date`) VALUES (303, 0, 1, 'GETS', 'User:u', '{\"User:u\":{},\"User_address:r\":{}}', NULL, '2023-04-13 11:00:58');

@Sql update/delete 子查询修改、删除

{
  "sql@": {
        "with": true,
        "from": "User",
        "User": {
            "@column": "username",
            "username": "test2"
        }
    },
    "User:u": {
      "@state": 1,
      "password": "123456",
        "username{}@": "sql"
    },
    "tag": "User:u",
    "format": true,
    "@explain": true
}
INSERT INTO `request` (`id`, `debug`, `version`, `method`, `tag`, `structure`, `detail`, `date`) VALUES (168, 0, 1, 'PUT', 'User:u', '{\"User:u\":{ \"REFUSE\": \"userId\", \"INSERT\": {\"@role\": \"OWNER,ADMIN\",\"pwdEncrypt-()\": \"pwdEncrypt(id,password)\",\"@combine\": \"username{}\"}} }', '修改', '2022-11-04 16:50:57');

@TommyLemon TommyLemon merged commit 26475f6 into Tencent:master Apr 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants