Mercurial > hg > Members > nobuyasu > Consensus
comparison app/models/ClaimModel.java @ 39:870553e92e3e
create getUserConsensusStatus action
author | one |
---|---|
date | Thu, 04 Oct 2012 01:39:44 +0900 |
parents | a2abe67d7c7a |
children | f78442777849 |
comparison
equal
deleted
inserted
replaced
38:a2abe67d7c7a | 39:870553e92e3e |
---|---|
76 | 76 |
77 public Object[] getUsersId() { | 77 public Object[] getUsersId() { |
78 return getInfoArray(L_REQUEST); | 78 return getInfoArray(L_REQUEST); |
79 } | 79 } |
80 | 80 |
81 public ObjectNode getUserRequestStatus(UserModel user) { | |
82 GremlinPipeline<Vertex,Edge> pipeEdge = new GremlinPipeline<Vertex,Edge>(); | |
83 pipeEdge.start(vertex).outE(L_REQUEST); | |
84 ObjectNode info = Json.newObject(); | |
85 for (Edge e : pipeEdge) { | |
86 GremlinPipeline<Edge,Vertex> pipeChildVertex = new GremlinPipeline<Edge,Vertex>(); | |
87 pipeChildVertex.start(e).inV(); | |
88 Vertex childVertex = pipeChildVertex.next(); | |
89 if (childVertex.getId() == user.getId()) { | |
90 info.put(STATUS, Json.toJson(e.getProperty(STATUS))); | |
91 break; | |
92 } | |
93 } | |
94 return info; | |
95 } | |
96 | |
81 public Object[] getUsersIdAndStatus() { | 97 public Object[] getUsersIdAndStatus() { |
82 GremlinPipeline<Vertex,Edge> pipeEdge = new GremlinPipeline<Vertex,Edge>(); | 98 GremlinPipeline<Vertex,Edge> pipeEdge = new GremlinPipeline<Vertex,Edge>(); |
83 pipeEdge.start(vertex).outE(L_REQUEST); | 99 pipeEdge.start(vertex).outE(L_REQUEST); |
84 ArrayList<Object> array = new ArrayList<Object>(); | 100 ArrayList<Object> array = new ArrayList<Object>(); |
85 for (Edge e : pipeEdge) { | 101 for (Edge e : pipeEdge) { |