Mercurial > hg > Members > nobuyasu > Consensus
changeset 22:6506b8742343
modified getUser
author | one |
---|---|
date | Tue, 02 Oct 2012 23:11:50 +0900 |
parents | e113f946c9c1 |
children | cad8e054fe4b |
files | app/controllers/User.java app/models/NodeModel.java app/models/UserModel.java test/RequestTest.java |
diffstat | 4 files changed, 21 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- a/app/controllers/User.java Tue Oct 02 22:55:16 2012 +0900 +++ b/app/controllers/User.java Tue Oct 02 23:11:50 2012 +0900 @@ -40,10 +40,7 @@ return notFound(); } else { UserModel user = new UserModel(v); - HashMap<Object,Object> hash = user.getAllProperty(); - -// HashMap<Object,Object> hash = user.getAllInfo(); - + HashMap<Object, Object[]> hash = user.getUserInfo(); return created(Json.toJson(hash)); } }
--- a/app/models/NodeModel.java Tue Oct 02 22:55:16 2012 +0900 +++ b/app/models/NodeModel.java Tue Oct 02 23:11:50 2012 +0900 @@ -51,7 +51,7 @@ // Use This key Json Data public static final String CLAIMS = "claims"; - public static final String REQUESTS = "REQUESTS"; + public static final String REQUESTS = "requests"; public static final String CONSENSUS = "consensus";
--- a/app/models/UserModel.java Tue Oct 02 22:55:16 2012 +0900 +++ b/app/models/UserModel.java Tue Oct 02 23:11:50 2012 +0900 @@ -1,6 +1,7 @@ package models; import java.util.ArrayList; +import java.util.HashMap; import com.tinkerpop.blueprints.Vertex; import com.tinkerpop.gremlin.java.GremlinPipeline; @@ -34,6 +35,14 @@ public Object[] getUserConsensus() { return null; } + + public HashMap<Object,Object[]> getUserInfo() { + HashMap<Object,Object[]> hash = new HashMap<Object, Object[]>(); + hash.put(NodeModel.REQUESTS, getUserRequests()); + hash.put(NodeModel.CLAIMS, getUserClaims()); + hash.put(NodeModel.CONSENSUS, getUserConsensus()); + return hash; + }
--- a/test/RequestTest.java Tue Oct 02 22:55:16 2012 +0900 +++ b/test/RequestTest.java Tue Oct 02 23:11:50 2012 +0900 @@ -21,21 +21,23 @@ createUser(user1); createUser(user2); createUser(user3); + - /* - getUser("akifumi"); - getUserInfo("akifumi","claims/"); - getUserInfo("akifumi","consensus/"); +/* + getUser(user1); + getUserInfo(user1,"claims/"); + getUserInfo(user1,"consensus/"); */ String[] users = {user2,user3}; -// createClaim(user1, users); -// createClaim(user1, users); + createClaim(user1, users); + createClaim(user1, users); + + getUser(user1); getUserInfo(user2,"requests/"); getUserInfo(user3,"requests/"); - getUserInfo(user1,"claims/"); getUserInfo(user2,"claims/"); getUserInfo(user3,"claims/"); - + }