comparison app/controllers/Claim.java @ 42:4321d97da830

modified updateUserConsensusStatus
author one
date Thu, 04 Oct 2012 04:15:14 +0900
parents f78442777849
children 9645bfb49603
comparison
equal deleted inserted replaced
41:f78442777849 42:4321d97da830
108 UserModel user = new UserModel(graph.getVertex(name)); 108 UserModel user = new UserModel(graph.getVertex(name));
109 if (user.getVertex() == null) { 109 if (user.getVertex() == null) {
110 return badRequest("User "+name+" does not exist"); 110 return badRequest("User "+name+" does not exist");
111 } 111 }
112 claim.updateUserRequestStatus(claim, user, status); 112 claim.updateUserRequestStatus(claim, user, status);
113 claim.computeAndUpdateStatus();
113 return created(); 114 return created();
114 } 115 }
115 116
116 @BodyParser.Of(BodyParser.Json.class) 117 @BodyParser.Of(BodyParser.Json.class)
117 public static Result createMention(String mentionType, String id) { 118 public static Result createMention(String mentionType, String id) {
144 tpGraph.setLabelToRootClaim(newClaim); 145 tpGraph.setLabelToRootClaim(newClaim);
145 ClaimModel mentionV = new ClaimModel(graph.getVertex(id)); 146 ClaimModel mentionV = new ClaimModel(graph.getVertex(id));
146 tpGraph.setLabelMention(mentionV, newClaim, mentionType); 147 tpGraph.setLabelMention(mentionV, newClaim, mentionType);
147 return created(); 148 return created();
148 } 149 }
149 150
150 public static Result getClaimInfo(String id) { 151 public static Result getClaimInfo(String id) {
151 TPGraph tpGraph = TPGraph.getInstance(); 152 TPGraph tpGraph = TPGraph.getInstance();
152 Graph graph = tpGraph.getGraph(); 153 Graph graph = tpGraph.getGraph();
153 Vertex claimV = graph.getVertex(id); 154 Vertex claimV = graph.getVertex(id);
154 if (claimV == null) { 155 if (claimV == null) {