Include label votes in ReviewerResource views

In addition to the account information, include all of the verbatim
values as a map of label name to value.

Refactor ReviewerJson to use the same AccountInfo.Loader mechanism as
ChangeJson. This renames the "id" field to "_account_id" for
consistency, and affects all reviewer resources requested. This
compatibility break is ok as the old field was not documented or used.

Example output from /changes/#/reviewers:

[
  {
    "kind": "gerritcodereview#reviewer",
    "approvals": {
      "Verified": "+1",
      "Code-Review": "+1"
    },
    "_account_id": "1000000",
    "name": "User One",
    "email": "user1@gmail.com"
  },
  {
    "kind": "gerritcodereview#reviewer",
    "approvals": {
      "Code-Review": " 0"
    },
    "_account_id": "1000001",
    "name": "User Two",
    "email": "user2@gmail.com"
  }
]

Change-Id: I78523800876d57772d6a5f22692d24e42b515a9a
This commit is contained in:
Dave Borowitz
2013-02-08 15:57:08 -08:00
committed by Edwin Kempin
parent ee7ff53cbb
commit f115ce78c7
7 changed files with 133 additions and 31 deletions

View File

@@ -27,7 +27,7 @@ public class GetReviewer implements RestReadView<ReviewerResource> {
}
@Override
public Object apply(ReviewerResource reviewerResource) throws OrmException {
return json.format(reviewerResource);
public Object apply(ReviewerResource rsrc) throws OrmException {
return json.format(rsrc);
}
}