tianxiaoliang commented on a change in pull request #129: wip: refactor apis
URL: https://github.com/apache/servicecomb-kie/pull/129#discussion_r398582219
##########
File path: server/resource/v1/history_resource.go
##########
@@ -40,21 +40,21 @@ type HistoryResource struct {
//GetRevisions search key only by label
func (r *HistoryResource) GetRevisions(context *restful.Context) {
var err error
- keyID := context.ReadPathParameter("key_id")
+ kvID := context.ReadPathParameter(common.QueryParamKVID)
offsetStr := context.ReadQueryParameter(common.QueryParamOffset)
limitStr := context.ReadQueryParameter(common.QueryParamLimit)
offset, limit, err := checkPagination(offsetStr, limitStr)
if err != nil {
WriteErrResponse(context, http.StatusBadRequest, err.Error(),
common.ContentTypeText)
return
}
- if keyID == "" {
+ if kvID == "" {
openlogging.Error("key id is nil")
- WriteErrResponse(context, http.StatusForbidden, "key_id must
not be empty", common.ContentTypeText)
+ WriteErrResponse(context, http.StatusForbidden, "kv_id must not
be empty", common.ContentTypeText)
return
}
key := context.ReadQueryParameter("key")
- revisions, err := service.HistoryService.GetHistory(context.Ctx, keyID,
+ revisions, err := service.HistoryService.GetHistory(context.Ctx, kvID,
service.WithKey(key),
Review comment:
service.WithKey(key),这行就可以删掉了
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services