Skip to content

Commit

Permalink
Merge 4780784 into 344aa82
Browse files Browse the repository at this point in the history
  • Loading branch information
wwelling committed Aug 10, 2018
2 parents 344aa82 + 4780784 commit 9813fe8
Show file tree
Hide file tree
Showing 31 changed files with 1,119 additions and 196 deletions.
231 changes: 231 additions & 0 deletions README.md
Expand Up @@ -13,4 +13,235 @@ $ mvn clean spring-boot:run
### Production
```bash
$ mvn clean package -DskipTests -Dproduction
```

## Rest API

| **Title** | **Projects** |
| :------------------- | :------------------------------------------------------------------------------------------ |
| **Description** | Returns a list of all projects. |
| **URL** | ```/projects``` |
| **Method** | **GET** |
| **URL Parameters** | |
| **Success Response** | **Code:** 200 OK<br/>**Content Type:** application/json<br/> |
| **Sample Request** | ```/projects``` |
| **Notes** | These are managed projects for this service and not projects from a remote project manager. |

```json
{
"meta": {
"status": "SUCCESS",
"action": null,
"message": "Your request was successful",
"id": null
},
"payload": {
"ArrayList<Project>": [
{
"id": 1,
"name": "Legacy DSpace",
"scopeId": "1934",
"remoteProjectManager": {
"id": 1,
"name": "VersionOne",
"type": "VERSION_ONE"
}
},
{
"id": 2,
"name": "Code Management - Maps",
"scopeId": "3781",
"remoteProjectManager": {
"id": 1,
"name": "VersionOne",
"type": "VERSION_ONE"
}
},
{
"id": 3,
"name": "CORAL - Electronic Resource Management",
"scopeId": "3783",
"remoteProjectManager": {
"id": 1,
"name": "VersionOne",
"type": "VERSION_ONE"
}
},
{
"id": 4,
"name": "Piper - Automated Ingest",
"scopeId": "3786",
"remoteProjectManager": {
"id": 1,
"name": "VersionOne",
"type": "VERSION_ONE"
}
}
]
}
}
```

<hr />

| **Title** | **Active Sprints** |
| :------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Description** | Returns a list of all active sprints based on associated remote project manager projects. |
| **URL** | ```/sprints/active``` |
| **Method** | **GET** |
| **URL Parameters** | |
| **Success Response** | **Code:** 200 OK<br/>**Content Type:** application/json<br/>**Schema:** |
| **Sample Request** | ```/sprints/active``` |
| **Notes** | Currently, only remote project manager implemented is VersionOne. VersionOne sprints are based on a timebox which is a spring schedule in the UI. Projects can share the same sprint schedule and will appear to be the same sprint in this response. |

```json
{
"meta": {
"status": "SUCCESS",
"action": null,
"message": "Your request was successful",
"id": null
},
"payload": {
"ArrayList<Sprint>": [
{
"id": "8416",
"name": "Sprint 14",
"project": "CORAL - Electronic Resource Management",
"cards": [
{
"id": "8234",
"number": "B-03467",
"type": "Feature",
"status": "Accepted",
"name": "Update new feedback and purchase forms to incorporate all fields from the existing feedback form",
"description": "<p>Needs to have the new styling and needs to pass WAVE ADA check.</p>\n<p> </p>\n<p>All the key/value information will go right into the Notes field.</p>\n<p> </p>\n<p>We will be finishing out and fully styling the feedback form, the request a purchase form, and ideally the https://coral.library.tamu.edu/resourcelink.php?resource=1440 link resolver while we're at it.</p>",
"assignees": [
{
"id": "20",
"name": "Jeremy Huff",
"avatar": "1706"
},
{
"id": "3483",
"name": "Jason Savell",
"avatar": "no_avatar.png"
},
{
"id": "7888",
"name": "Kevin Day",
"avatar": "no_avatar.png"
}
]
},
{
"id": "8417",
"number": "B-03578",
"type": "Feature",
"status": "Done",
"name": "Sort by title by default when viewing resource list with trial/purchase requests hidden",
"assignees": [
{
"id": "3483",
"name": "Jason Savell",
"avatar": "no_avatar.png"
}
]
}
]
},
{
"id": "8435",
"name": "Weaver Upgrades/Auth2 Retirement",
"project": "DI Internal",
"cards": [
{
"id": "8436",
"number": "B-03587",
"type": "Feature",
"status": "Done",
"name": "Upgrade My Library UI to weaver-ui 2",
"estimate": 3,
"assignees": [
{
"id": "6616",
"name": "Ryan Laddusaw",
"avatar": "no_avatar.png"
}
]
},
{
"id": "8437",
"number": "B-03588",
"type": "Feature",
"status": "Done",
"name": "Update My Library Service to Weaver 2",
"estimate": 2,
"assignees": [
{
"id": "6616",
"name": "Ryan Laddusaw",
"avatar": "no_avatar.png"
}
]
}
]
}
]
}
}
```

<hr />

| **Title** | **Projects Stats** |
| :------------------- | :------------------------------------------------------------------------------------------------------------------ |
| **Description** | Returns a list of all projects and there statistics gathered from their associated remote project manager projects. |
| **URL** | ```/projects/stats``` |
| **Method** | **GET** |
| **URL Parameters** | |
| **Success Response** | **Code:** 200 OK<br/>**Content Type:** application/json |
| **Sample Request** | ```/projects/stats``` |
| **Notes** | |

```json
{
"meta": {
"status": "SUCCESS",
"action": null,
"message": "Your request was successful",
"id": null
},
"payload": {
"ArrayList<ProjectStats>": [
{
"id": "1",
"name": "Legacy DSpace",
"requestCount": 22,
"issueCount": 41,
"featureCount": 32,
"defectCount": 0,
"backlogItemCount": 32
},
{
"id": "2",
"name": "Code Management - Maps",
"requestCount": 0,
"issueCount": 0,
"featureCount": 5,
"defectCount": 0,
"backlogItemCount": 5
},
{
"id": "3",
"name": "CORAL - Electronic Resource Management",
"requestCount": 2,
"issueCount": 0,
"featureCount": 12,
"defectCount": 8,
"backlogItemCount": 20
}
]
}
}
```
14 changes: 14 additions & 0 deletions src/main/java/edu/tamu/app/cache/ProjectsStatsCache.java
@@ -0,0 +1,14 @@
package edu.tamu.app.cache;

import java.util.ArrayList;
import java.util.List;

import edu.tamu.app.cache.model.ProjectStats;

public class ProjectsStatsCache extends AbstractCache<List<ProjectStats>> {

public ProjectsStatsCache() {
set(new ArrayList<ProjectStats>());
}

}
Expand Up @@ -6,7 +6,7 @@
import edu.tamu.app.cache.service.ActiveSprintsScheduledCacheService;

@RestController
@RequestMapping("/active-sprints")
@RequestMapping("/sprints/active")
public class ActiveSprintsCacheController extends AbstractCacheController<ActiveSprintsScheduledCacheService> {

}
@@ -0,0 +1,12 @@
package edu.tamu.app.cache.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import edu.tamu.app.cache.service.ProjectsStatsScheduledCacheService;

@RestController
@RequestMapping("/projects/stats")
public class ProjectsStatsCacheController extends AbstractCacheController<ProjectsStatsScheduledCacheService> {

}
Expand Up @@ -6,7 +6,7 @@
import edu.tamu.app.cache.service.RemoteProjectsScheduledCacheService;

@RestController
@RequestMapping("/remote-projects")
@RequestMapping("/projects/remote")
public class RemoteProjectsCacheController extends AbstractCacheController<RemoteProjectsScheduledCacheService> {

}
69 changes: 69 additions & 0 deletions src/main/java/edu/tamu/app/cache/model/ProjectStats.java
@@ -0,0 +1,69 @@
package edu.tamu.app.cache.model;

import java.io.Serializable;

public class ProjectStats implements Serializable {

private static final long serialVersionUID = -1622544796949909087L;

private final String id;

private final String name;

private final int requestCount;

private final int issueCount;

private final int featureCount;

private final int defectCount;

public ProjectStats() {
super();
id = "";
name = "";
requestCount = 0;
issueCount = 0;
featureCount = 0;
defectCount = 0;
}

public ProjectStats(String id, String name, int requestCount, int issueCount, int featureCount, int defectCount) {
super();
this.id = id;
this.name = name;
this.requestCount = requestCount;
this.issueCount = issueCount;
this.featureCount = featureCount;
this.defectCount = defectCount;
}

public String getId() {
return id;
}

public String getName() {
return name;
}

public int getRequestCount() {
return requestCount;
}

public int getIssueCount() {
return issueCount;
}

public int getFeatureCount() {
return featureCount;
}

public int getDefectCount() {
return defectCount;
}

public int getBacklogItemCount() {
return featureCount + defectCount;
}

}

0 comments on commit 9813fe8

Please sign in to comment.