You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A microservice for generic units of work (e.g., a challenge)
3
3
4
4
## Getting Started
@@ -8,7 +8,7 @@ This microservice is using [dropwizard](dropwizard.io) as the REST API framework
8
8
We are using Maven 2 to build and building is as simple as `mvn package`. *Make sure you are using Java 8 for build and runtime*
9
9
10
10
### Configuration
11
-
Configuration is managed through a yaml file. The `src/main/resources/work-service.yaml` file should contain the necessary configuration for you to run locally.
11
+
Configuration is managed through a yaml file. The `src/main/resources/review-service.yaml` file should contain the necessary configuration for you to run locally.
12
12
13
13
### Framework Stack
14
14
- dropwizard-core - core REST API
@@ -22,30 +22,28 @@ Configuration is managed through a yaml file. The `src/main/resources/work-servi
22
22
### Database
23
23
We are using mysql RDS for the database. For development use, connect to the topcoder-dev instance. Database access should be limited to the DAO layer. We are using the [JDBI](http://jdbi.org/) framework for database access. Where possible we should use the [SQL Objects API](http://jdbi.org/sql_object_overview/) approach listed in the JDBI documentation.
24
24
25
-
For this service, the DAO is managed by `WorkItemDAO`
25
+
For this service, the DAO is managed by `ReviewDAO`
26
26
27
27
**We need to keep the data model clean and name properties of our representation (model) objects as the column names so we can use the automatic bean mapping facilities instead of needing to manually wire things together. Any deviation requires prior approval.**
28
28
29
29
### API Endpoint
30
-
The API endpoint for this service is `com.appirio.service.work.resources.WorkItemResource` It contains the specific resource paths supported by this service. The root of the service is /v3/workitem. API methods should be annotated with the appropriate jax-rs annotations and the `@Timed` annotation for metrics. An example method is shown below.
30
+
The API endpoint for this service is `com.appirio.service.review.resources.ReviewResource` It contains the specific resource paths supported by this service. The root of the service is /v3/reviews. API methods should be annotated with the appropriate jax-rs annotations and the `@Timed` annotation for metrics. An example method is shown below.
31
31
```
32
32
@GET
33
33
@Timed
34
-
@Path("{id}")
35
-
public WorkItem getWorkItemById(@Auth TCAuth auth, @PathParam("id") LongParam id) {
36
-
logger.debug("get work item for id {}", id);
34
+
public ApiResponse getReviews(@Auth AuthUser auth,
Note the `TCAuth` parameter provided by the `ServiceAuthenticator` class will provide user auth information and is a required parameterfor all secured API calls.
44
+
You must set up `TC_JWT_KEY` environment variable, the sample value is `4WvoZLWhFPZ5jauw2+XCU+p772S4oBN25tNPyjHR`.
44
45
45
46
### Testing
46
47
All API endpoint methods should have unit tests. For this service we are following the dropwizard testing recommendations as described [here](http://dropwizard.io/manual/testing.html)
47
48
48
49
For manual API testing, the [postman chrome app](https://chrome.google.com/webstore/detail/postman-rest-client/fdmmgilgnpjigdojojpjoooidkmcomcm?hl=en) is useful.
49
-
50
-
### Healthcheck
51
-
This service has a healhcheck service located at `com.appirio.service.work.health.ServiceHealthCheck`. If any new dependent services are added, the healthcheck service should be updated to test its availability in order to determine if this service is healthy. This is important for application monitoring and failover.
0 commit comments