TencentBlueKing / TencentBlueKing/bk-lesscode

通过数据管理的API查询数据为何总是返回第一条数据

Open
#1,421 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
JavaScript
Stars
63
Forks
70
PR merge metrics
No merged PRs in 30d

Description

版本(The versions used): 最新版本

发生了什么(What happened):
在lesscode中开发应用时,通过数据管理的API查询数据。接口描述为:
/api/data-source/user/tableName/convertserviceportal/detail
{
"[key]": "query 参数,可以填写多个键值对,并使用 AND 关系查询具体的数据,如果匹配到多条数据,则返回第一条。key 可以填写任意字段。value 填写值,可以用 %xx% 的形式进行模糊匹配。示例:'name': 'xxx' 或者 'name': '%xxx%'"
}
配置请求体:
{
"[service]": "NDS2d"
}
使用get方法查询,始终返回表中的第一条数据,而不是期望的查询数据:
{
"code": 0,
"message": "success",
"data": {
"id": 2,
"updateTime": "2024-11-22T08:56:38.000Z",
"createTime": "2024-11-22T08:56:38.000Z",
"createUser": null,
"updateUser": null,
"host": "10.122.66.98",
"service": "NDS3DModelCompare_test_ai",
"path": "E:\3D\test_ai\NDS3DModelCompare\NDSConverterService.exe",
"status": "Stopped"
}
}

期望是什么(What you expected to happen):
应该如何组织 请求体,可以返回期望的查询条件的呢?

如何复现(How to reproduce it):

相关的日志详情和截图等(Log & Screenshot):

备注(Anything else we need to know):

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the GET request against /api/data-source/user/tableName/convertserviceportal/detail with the documented request body and the reported service value. Trace the API's query-parameter and request-body handling to determine why the filter is ignored; done means the endpoint returns the matching record rather than the first table row, with a regression test or reproducible verification.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.