Skip to content

able to get key by id#127

Closed
tianxiaoliang wants to merge 2 commits intoapache:masterfrom
tianxiaoliang:dev
Closed

able to get key by id#127
tianxiaoliang wants to merge 2 commits intoapache:masterfrom
tianxiaoliang:dev

Conversation

@tianxiaoliang
Copy link
Contributor

@tianxiaoliang tianxiaoliang commented Mar 25, 2020

  • 删除了老的POC代码,已经不会被调用
  • 在list kv记录时,支持根据ID查询并快速返回,wait revision等参数不会生效

@tianxiaoliang tianxiaoliang force-pushed the dev branch 4 times, most recently from 27c7a94 to e91f80c Compare March 26, 2020 02:24
"domain": domain,
},
))
return cursorToOneKV(ctx, cur, opts.Labels)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cursorToOneKV函数应该没有别处调用了吧,没的话就删了吧

var err error
project := rctx.ReadPathParameter(PathParameterProject)
domain := ReadDomain(rctx)
kvID := rctx.ReadQueryParameter(common.QueryParamKeyID)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

URLPatterns和API文档添上这个parameters

if kvID != "" {
kv, err := service.KVService.Get(rctx.Ctx, domain.(string), project, kvID)
if err != nil {
WriteErrResponse(rctx, http.StatusBadRequest, err.Error(), common.ContentTypeText)
Copy link
Contributor

@zhulijian1 zhulijian1 Mar 26, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不一定是BadRequest,可能是数据库内部错误、decode err和没找到

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.

2 participants