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
Develop a Restful API for creating work order queue for Service Desk employee. The work order can be of four types `normal, priority, VIP, and management override`. Each type of request has it's own implementation for calculating rank. Different types of requests uses different formula to calculate the rank. The priority queue is sorted from highest ranked to lowest ranked ID.
11
19
12
-
At the core the app uses a priority queue interface for creating work order queue. The priority queue is used to solve [many useful problems](https://en.wikipedia.org/wiki/Priority_queue#Applications).
20
+
This project is a Restful API for creating work order queue for Service Desk employee. The work order can be of four types `normal, priority, VIP, and management override`. Different request types have their own implementation for calculating the rank. The priority queue is sorted from highest ranked to lowest ranked requester ID.
13
21
14
22
## GETTING STARTED ##
15
23
This application is a written in java using [Spring Boot][1] and built using Maven.
@@ -20,7 +28,7 @@ This application is a written in java using [Spring Boot][1] and built using Mav
20
28
* Maven 3.0 or later
21
29
22
30
### Quick Start ###
23
-
This would be really quick. To test the application, you just need to do these two things:
31
+
To test the application, just follow the two simple steps mentioned below:
24
32
25
33
1. Download the fat jar of this application from [bin](https://github.com/Govind-jha/springboot-work-order-priority-queue/tree/master/bin,"click here.") folder. Now to start the application server, open command prompt and run the downloaded `jar` file,
26
34
```
@@ -50,7 +58,7 @@ Then you can run the JAR file with
50
58
```
51
59
### Test ###
52
60
53
-
>>Download the postman collection form [postman](https://github.com/Govind-jha/springboot-work-order-priority-queue/tree/master/postman,"click here.") folder. Import the collection in [Postman client](https://github.com/postmanlabs) for smoke testing.
61
+
> Download the postman collection form [postman](https://github.com/Govind-jha/springboot-work-order-priority-queue/tree/master/postman,"click here.") folder. Import the collection in [Postman client](https://github.com/postmanlabs) for smoke testing.
54
62
55
63
You can test these Micro Services using any tool or language that allows you to make a HTTP request. For example, removing an order using [CURL](https://curl.haxx.se/):
56
64
```sh
@@ -108,7 +116,7 @@ There are 4 classes of IDs, normal, priority, VIP, and management override. You
IDs must be sorted in the queue according to a formula that varies based on their class. The table below lists the formula to calculate the rank for different request types.
119
+
The table below lists the formulas for calculating the rank of different request types,
112
120
113
121
114
122
| Request Type | Ranking Function |
@@ -122,7 +130,7 @@ IDs must be sorted in the queue according to a formula that varies based on thei
122
130
123
131
## API Contract ##
124
132
125
-
The WorkOrder Api implements the requirement/rules described in the previous section. It is used to create a work order queue for service request desk employee.
133
+
The WorkOrder Api implements the requirement/rules described in the previous section. It is used to create a work order queue (a #### Priority Queue #### based interface) for service request desk employee.
126
134
127
135
### Response Code And Headers ###
128
136
If response status code is `204 NO CONTENT` or `205 RESET CONTENT`, the response will contain header `x-app-diagnostic`. HTTP status `205 RESET CONTENT` means server successfully processed the request, but is not returning any content. Unlike a `204 NO CONTENT` response, this response requires that the requester reset the document view (as the content might have changed).
@@ -145,13 +153,13 @@ _Response header `x-app-diagnostic` will contain the cause of no content in the
145
153
- Check the requests Method(GET, POST, DELETE) if you get HTTP Status `405`.
146
154
147
155
### API Operation ###
148
-
Resource components can be used in conjunction with identifiers to retrieve the metadata for that identifier.
156
+
The Application will start on port `8080`, you can change this port configuration in application.properties file of the project.
|`/addOrder`| An endpoint for adding a ID to queue (enqueue). This endpoint should accept two parameters, the ID to enqueue(`requesterId`) and the time at which the ID was added to the queue(`timeOfRequest`). |`POST`|
157
165
|`/getPosition/{requesterId}`| An endpoint to get the position of a specific ID in the queue. This endpoint should accept one parameter, the ID to get the position of. It should return the position of the ID in the queue indexed from 0. |`GET`|
@@ -163,6 +171,7 @@ Resource components can be used in conjunction with identifiers to retrieve the
163
171
164
172
165
173
166
-
----------------------------
174
+
## License ##
175
+
The package is Open Source Software released under the [License](https://github.com/Govind-jha/springboot-work-order-priority-queue/blob/master/LICENSE). It's developed by [Govind Jha]("https://github.com/Govind-jha/").
0 commit comments