1
0
forked from s434786/DINO_SCRUM

Merge remote-tracking branch 'starskiRepo/backend'

# Conflicts:
#	README.md
This commit is contained in:
prgres 2019-01-23 21:56:16 +01:00
commit 48f36a188b
2 changed files with 67 additions and 50 deletions

View File

@ -3,9 +3,7 @@
<component name="ChangeListManager">
<list default="true" id="2dc093a7-8382-4e31-b457-ce6c9fd10d13" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/com/dino/scrum/sysmag/model/Product.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/dino/scrum/sysmag/model/Product.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/com/dino/scrum/sysmag/repository/CrudRepositoryImpl.java" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/com/dino/scrum/sysmag/service/ProductServiceImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/dino/scrum/sysmag/service/ProductServiceImpl.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/README.md" beforeDir="false" afterPath="$PROJECT_DIR$/README.md" afterDir="false" />
</list>
<ignored path="$PROJECT_DIR$/target/" />
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
@ -106,7 +104,7 @@
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/main/java/com/dino/scrum/sysmag/controller/ProductController.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="199">
<state relative-caret-position="192">
<caret line="88" selection-start-line="88" selection-end-line="88" />
<folding>
<element signature="imports" expanded="true" />
@ -127,11 +125,11 @@
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<file pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/src/main/java/com/dino/scrum/sysmag/service/ProductServiceImpl.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="378">
<caret line="93" column="63" lean-forward="true" selection-start-line="93" selection-start-column="63" selection-end-line="93" selection-end-column="63" />
<state relative-caret-position="456">
<caret line="123" lean-forward="true" selection-start-line="123" selection-end-line="123" />
<folding>
<element signature="imports" expanded="true" />
</folding>
@ -151,11 +149,11 @@
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="true">
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/main/java/com/dino/scrum/sysmag/model/Product.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="272">
<caret line="41" column="26" selection-start-line="41" selection-start-column="26" selection-end-line="41" selection-end-column="26" />
<state relative-caret-position="62">
<caret line="27" selection-start-line="27" selection-end-line="27" />
<folding>
<element signature="imports" expanded="true" />
</folding>
@ -163,6 +161,15 @@
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="jar://$MAVEN_REPOSITORY$/org/springframework/spring-aop/5.1.4.RELEASE/spring-aop-5.1.4.RELEASE.jar!/org/springframework/aop/framework/JdkDynamicAopProxy.class">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="178">
<caret line="84" selection-start-line="84" selection-end-line="84" />
</state>
</provider>
</entry>
</file>
</leaf>
</component>
<component name="FileTemplateManagerImpl">
@ -210,9 +217,9 @@
<option value="$PROJECT_DIR$/src/main/java/com/dino/scrum/sysmag/service/ProductService.java" />
<option value="$PROJECT_DIR$/src/main/java/com/dino/scrum/sysmag/controller/ProductController.java" />
<option value="$PROJECT_DIR$/src/main/java/com/dino/scrum/sysmag/repository/CrudRepositoryImpl.java" />
<option value="$PROJECT_DIR$/README.md" />
<option value="$PROJECT_DIR$/src/main/java/com/dino/scrum/sysmag/service/ProductServiceImpl.java" />
<option value="$PROJECT_DIR$/src/main/java/com/dino/scrum/sysmag/model/Product.java" />
<option value="$PROJECT_DIR$/README.md" />
</list>
</option>
</component>
@ -429,7 +436,7 @@
<workItem from="1547322960420" duration="21872000" />
<workItem from="1547401179909" duration="33384000" />
<workItem from="1548159944175" duration="16987000" />
<workItem from="1548273577966" duration="2213000" />
<workItem from="1548273577966" duration="2970000" />
</task>
<task id="LOCAL-00001" summary="added quantityChange validation, product validation, checking existing object in db, throwing exeption">
<created>1548121370553</created>
@ -515,11 +522,18 @@
<option name="project" value="LOCAL" />
<updated>1548238865354</updated>
</task>
<option name="localTasksCounter" value="13" />
<task id="LOCAL-00013" summary="fix update product">
<created>1548276405635</created>
<option name="number" value="00013" />
<option name="presentableId" value="LOCAL-00013" />
<option name="project" value="LOCAL" />
<updated>1548276405635</updated>
</task>
<option name="localTasksCounter" value="14" />
<servers />
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="74456000" />
<option name="totallyTimeSpent" value="75213000" />
</component>
<component name="TodoView">
<todo-panel id="selected-file">
@ -532,6 +546,7 @@
</component>
<component name="ToolWindowManager">
<frame x="0" y="23" width="1680" height="1027" extended-state="6" />
<editor active="true" />
<layout>
<window_info content_ui="combo" id="Project" order="0" sideWeight="0.49810606" visible="true" weight="0.18131869" />
<window_info id="Structure" order="1" side_tool="true" weight="0.25" />
@ -542,12 +557,12 @@
<window_info anchor="bottom" id="Message" order="0" />
<window_info anchor="bottom" id="Find" order="1" sideWeight="0.498779" weight="0.32941177" />
<window_info anchor="bottom" id="Run" order="2" sideWeight="0.498779" weight="0.3315508" />
<window_info anchor="bottom" id="Debug" order="3" visible="true" weight="0.46203208" />
<window_info anchor="bottom" id="Debug" order="3" weight="0.46203208" />
<window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
<window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
<window_info anchor="bottom" id="TODO" order="6" weight="0.32941177" />
<window_info anchor="bottom" id="Spring" order="7" sideWeight="0.4993895" weight="0.32941177" />
<window_info anchor="bottom" id="Terminal" order="8" sideWeight="0.497558" weight="0.3657754" />
<window_info active="true" anchor="bottom" id="Terminal" order="8" sideWeight="0.497558" visible="true" weight="0.3657754" />
<window_info anchor="bottom" id="Docker" order="9" show_stripe_button="false" />
<window_info anchor="bottom" id="Event Log" order="10" sideWeight="0.502442" side_tool="true" weight="0.44919786" />
<window_info anchor="bottom" id="Messages" order="11" weight="0.32941177" />
@ -561,7 +576,7 @@
<window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
<window_info anchor="right" id="Maven" order="3" weight="0.32967034" />
<window_info anchor="right" id="Palette" order="4" />
<window_info active="true" anchor="right" id="Database" order="5" visible="true" weight="0.4041514" />
<window_info anchor="right" id="Database" order="5" weight="0.4041514" />
<window_info anchor="right" id="Palette&#9;" order="6" />
<window_info anchor="right" id="Bean Validation" order="7" />
</layout>
@ -625,7 +640,8 @@
<MESSAGE value="update readme.md" />
<MESSAGE value="fix default page size in /get-all" />
<MESSAGE value="fix readme" />
<option name="LAST_COMMIT_MESSAGE" value="fix readme" />
<MESSAGE value="fix update product" />
<option name="LAST_COMMIT_MESSAGE" value="fix update product" />
<option name="OPTIMIZE_IMPORTS_BEFORE_PROJECT_COMMIT" value="true" />
<option name="REFORMAT_BEFORE_PROJECT_COMMIT" value="true" />
<option name="REARRANGE_BEFORE_PROJECT_COMMIT" value="true" />
@ -783,23 +799,6 @@
</state>
</provider>
</entry>
<entry file="jar://$MAVEN_REPOSITORY$/org/springframework/spring-aop/5.1.4.RELEASE/spring-aop-5.1.4.RELEASE.jar!/org/springframework/aop/framework/JdkDynamicAopProxy.class">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="178">
<caret line="84" selection-start-line="84" selection-end-line="84" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/main/java/com/dino/scrum/sysmag/controller/ProductController.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="199">
<caret line="88" selection-start-line="88" selection-end-line="88" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/main/java/com/dino/scrum/sysmag/repository/CrudRepositoryImpl.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="90">
@ -827,20 +826,37 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/main/java/com/dino/scrum/sysmag/service/ProductServiceImpl.java">
<entry file="file://$PROJECT_DIR$/src/main/java/com/dino/scrum/sysmag/model/Product.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="378">
<caret line="93" column="63" lean-forward="true" selection-start-line="93" selection-start-column="63" selection-end-line="93" selection-end-column="63" />
<state relative-caret-position="62">
<caret line="27" selection-start-line="27" selection-end-line="27" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/main/java/com/dino/scrum/sysmag/model/Product.java">
<entry file="jar://$MAVEN_REPOSITORY$/org/springframework/spring-aop/5.1.4.RELEASE/spring-aop-5.1.4.RELEASE.jar!/org/springframework/aop/framework/JdkDynamicAopProxy.class">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="272">
<caret line="41" column="26" selection-start-line="41" selection-start-column="26" selection-end-line="41" selection-end-column="26" />
<state relative-caret-position="178">
<caret line="84" selection-start-line="84" selection-end-line="84" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/main/java/com/dino/scrum/sysmag/controller/ProductController.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="192">
<caret line="88" selection-start-line="88" selection-end-line="88" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/main/java/com/dino/scrum/sysmag/service/ProductServiceImpl.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="456">
<caret line="123" lean-forward="true" selection-start-line="123" selection-end-line="123" />
<folding>
<element signature="imports" expanded="true" />
</folding>

View File

@ -2,7 +2,7 @@
## MODEL
###Product
### Product
```json5
{
"id": Int,
@ -29,7 +29,7 @@ Any of these couldn't be ``null``
## API
###Edit quantity of the product.
### Edit quantity of the product.
The service will handle `POST` requests for `/api/product/change-quantity`, by changing quantity of product in database.
@ -64,7 +64,7 @@ Response `200` with `JSON`:
* * *
###Retrieve a paginated list of products
### Retrieve a paginated list of products
The service will handle `GET` requests for `/api/get-all`, by retreving a paginated list of products. Optionally with a `page`, `size` **or** `page`, `size` and`sort` parameters in the query string.
Page start numbering on `page=0`. Default list is sorted by `id`.
@ -121,7 +121,7 @@ Response `200` with `JSON`:
```
* * *
###Get price of all products.
### Get price of all products.
The service will handle `GET` request on `/api/get-price-of-all` returing `Float` price of all products in the database.
```json
@ -136,8 +136,9 @@ Response `200` with `JSON`:
}
```
* * *
###Create a new product.
### Create a new product.
The service will handle `POST` request `/api/product/add`, by adding `Product` to database.
```json
@ -153,7 +154,7 @@ Content-Type: application/json
"imageLink": String
}
```
Response 201 with JSON
Response `201` with `JSON`
```json
@ -168,7 +169,7 @@ Response 201 with JSON
```
* * *
###Delete product with `id`.
### Delete product with `id`.
The service will handle `DELETE` request `/api/delete-product`, by
```json
@ -185,7 +186,7 @@ Response `200`:
* * *
###Get product with `id`
### Get product with `id`
The service wil handle `GET` request `/api/product/get-by-id`, by returning product with `id`.
```json
@ -212,7 +213,7 @@ Response `200` with `JSON`:
* * *
###Update product
### Update product
The service will handle ``POST`` request `/api/product/update/{id}` with path variable `id`, by updating existing product. In request
`id` is required, fields which won't be modified should be `null`.