Skip to content

Commit

Permalink
traceapi++ / db/id endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
YoussefDahi committed May 23, 2024
1 parent 6818e2c commit b959096
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
<dependency>
<groupId>io.github.oneteme.traceapi</groupId>
<artifactId>traceapi-core</artifactId>
<version>0.0.20</version>
<version>0.0.21</version>
</dependency>
<dependency>
<groupId>io.github.oneteme</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,19 +124,14 @@ public ResponseEntity<Map<String,String>> getParentIdByChildId(@PathVariable Str
.orElseGet(()->ResponseEntity.status(HttpStatus.NOT_FOUND).body(null));
}

@GetMapping("db/{id}")
@GetMapping("session/db/{id}")
public ResponseEntity<DatabaseRequestWrapper> getDatabaseRequestById(@PathVariable long id){
return Optional.ofNullable(requireSingle(jqueryRequestService.getDatabaseRequests(DBQUERY.column(ID).equal(id),true)))
.map(object -> ResponseEntity.ok().cacheControl(CacheControl.maxAge(1,TimeUnit.DAYS))
.body(object))
.orElseGet(() ->ResponseEntity.status(HttpStatus.NOT_FOUND).cacheControl(CacheControl.noCache()).body(null));
}

/*@GetMapping("session/api/{id}")
public ResponseEntity<Session> getApiSessionParentByChildId(@PathVariable String id){
}*/

@GetMapping("session/request/{id}/tree")
public Session getTreebyId(@PathVariable String id){
return jqueryRequestService.getTreeById(id);
Expand Down

0 comments on commit b959096

Please sign in to comment.