Merge branch 'master' of s434805/DINO_SCRUM into backend

This commit is contained in:
s1202077 2019-01-24 00:36:22 +00:00 committed by Gogs
commit 4f92f14092
4 changed files with 201 additions and 91 deletions

View File

@ -4,8 +4,6 @@
<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$/README.md" beforeDir="false" afterPath="$PROJECT_DIR$/README.md" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/com/dino/scrum/sysmag/controller/ProductController.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/dino/scrum/sysmag/controller/ProductController.java" afterDir="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" />
</list>
<ignored path="$PROJECT_DIR$/target/" />
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
@ -75,6 +73,29 @@
<item name="tables" type="d4e8921:DatabaseStructure$FamilyGroup" />
<item name="product: table" type="69fad909:PgImplModel$LocalTable" />
</path>
<path>
<item name="Database" type="3277223f:DatabaseStructure$DbRootGroup" />
<item name="heroku" type="feb32156:DbDataSourceImpl" />
<item name="databases" type="d4e8921:DatabaseStructure$FamilyGroup" />
<item name="d3e1jrm08qe91q: database" type="162271b6:PgImplModel$Database" />
<item name="schemas" type="d4e8921:DatabaseStructure$FamilyGroup" />
<item name="public: schema" type="983ebcf7:PgImplModel$Schema" />
<item name="sequences" type="d4e8921:DatabaseStructure$FamilyGroup" />
</path>
<path>
<item name="Database" type="3277223f:DatabaseStructure$DbRootGroup" />
<item name="heroku" type="feb32156:DbDataSourceImpl" />
<item name="databases" type="d4e8921:DatabaseStructure$FamilyGroup" />
<item name="d3e1jrm08qe91q: database" type="162271b6:PgImplModel$Database" />
<item name="access methods" type="d4e8921:DatabaseStructure$FamilyGroup" />
</path>
<path>
<item name="Database" type="3277223f:DatabaseStructure$DbRootGroup" />
<item name="heroku" type="feb32156:DbDataSourceImpl" />
<item name="databases" type="d4e8921:DatabaseStructure$FamilyGroup" />
<item name="d3e1jrm08qe91q: database" type="162271b6:PgImplModel$Database" />
<item name="extensions" type="d4e8921:DatabaseStructure$FamilyGroup" />
</path>
</expand>
<select />
</component>
@ -83,8 +104,8 @@
<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="627">
<caret line="81" column="37" lean-forward="true" selection-start-line="81" selection-start-column="37" selection-end-line="81" selection-end-column="37" />
<state relative-caret-position="192">
<caret line="88" selection-start-line="88" selection-end-line="88" />
<folding>
<element signature="imports" expanded="true" />
</folding>
@ -93,19 +114,34 @@
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$APPLICATION_CONFIG_DIR$/consoles/db/4eb55351-864c-4d3f-b24d-048a158530c7/console.sql">
<entry file="file://$PROJECT_DIR$/src/main/java/com/dino/scrum/sysmag/service/ProductService.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="229">
<caret line="59" lean-forward="true" selection-start-line="59" selection-end-line="59" />
<state relative-caret-position="345">
<caret line="23" selection-start-line="23" selection-end-line="23" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<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="456">
<caret line="123" lean-forward="true" selection-start-line="123" selection-end-line="123" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<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/validator/ProductValidator.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="333">
<caret line="80" column="19" selection-start-line="80" selection-start-column="19" selection-end-line="80" selection-end-column="19" />
<state relative-caret-position="426">
<caret line="38" column="16" selection-start-line="38" selection-start-column="16" selection-end-line="38" selection-end-column="16" />
<folding>
<element signature="imports" expanded="true" />
</folding>
@ -116,8 +152,8 @@
<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="413">
<caret line="54" column="74" selection-start-line="54" selection-start-column="74" selection-end-line="54" selection-end-column="74" />
<state relative-caret-position="62">
<caret line="27" selection-start-line="27" selection-end-line="27" />
<folding>
<element signature="imports" expanded="true" />
</folding>
@ -125,26 +161,11 @@
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/README.md">
<provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
<state split_layout="SPLIT">
<first_editor relative-caret-position="114">
<caret line="182" column="7" selection-start-line="182" selection-start-column="7" selection-end-line="182" selection-end-column="7" />
</first_editor>
<second_editor />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/main/java/com/dino/scrum/sysmag/validator/ProductValidator.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="295">
<caret line="31" column="40" selection-start-line="31" selection-start-column="40" selection-end-line="31" selection-end-column="40" />
<folding>
<element signature="imports" expanded="true" />
</folding>
<state relative-caret-position="178">
<caret line="84" selection-start-line="84" selection-end-line="84" />
</state>
</provider>
</entry>
@ -154,15 +175,19 @@
<component name="FileTemplateManagerImpl">
<option name="RECENT_TEMPLATES">
<list>
<option value="Class" />
<option value="Interface" />
<option value="Class" />
</list>
</option>
</component>
<component name="FindInProjectRecents">
<findStrings>
<find>asc</find>
<find>Object</find>
</findStrings>
<replaceStrings>
<replace>T</replace>
</replaceStrings>
</component>
<component name="Git.Settings">
<option name="ROOT_SYNC" value="SYNC" />
@ -186,13 +211,14 @@
<option value="$PROJECT_DIR$/src/main/java/com/dino/scrum/sysmag/repository/ProductRepository.java" />
<option value="$PROJECT_DIR$/src/main/resources/application.properties" />
<option value="$APPLICATION_CONFIG_DIR$/consoles/db/4eb55351-864c-4d3f-b24d-048a158530c7/console.sql" />
<option value="$PROJECT_DIR$/src/main/java/com/dino/scrum/sysmag/service/ProductService.java" />
<option value="$PROJECT_DIR$/pom.xml" />
<option value="$PROJECT_DIR$/.gitignore" />
<option value="$PROJECT_DIR$/src/main/java/com/dino/scrum/sysmag/validator/ProductValidator.java" />
<option value="$PROJECT_DIR$/src/main/java/com/dino/scrum/sysmag/model/Product.java" />
<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/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$/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>
@ -233,7 +259,6 @@
<foldersAlwaysOnTop value="true" />
</navigator>
<panes>
<pane id="Scope" />
<pane id="PackagesPane" />
<pane id="ProjectPane">
<subPane>
@ -286,6 +311,24 @@
<item name="sysmag" type="462c0819:PsiDirectoryNode" />
<item name="model" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="sysmag" type="b2602c69:ProjectViewProjectNode" />
<item name="sysmag" type="462c0819:PsiDirectoryNode" />
<item name="src" type="462c0819:PsiDirectoryNode" />
<item name="main" type="462c0819:PsiDirectoryNode" />
<item name="java" type="462c0819:PsiDirectoryNode" />
<item name="sysmag" type="462c0819:PsiDirectoryNode" />
<item name="repository" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="sysmag" type="b2602c69:ProjectViewProjectNode" />
<item name="sysmag" type="462c0819:PsiDirectoryNode" />
<item name="src" type="462c0819:PsiDirectoryNode" />
<item name="main" type="462c0819:PsiDirectoryNode" />
<item name="java" type="462c0819:PsiDirectoryNode" />
<item name="sysmag" type="462c0819:PsiDirectoryNode" />
<item name="service" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="sysmag" type="b2602c69:ProjectViewProjectNode" />
<item name="sysmag" type="462c0819:PsiDirectoryNode" />
@ -306,6 +349,7 @@
<select />
</subPane>
</pane>
<pane id="Scope" />
</panes>
</component>
<component name="PropertiesComponent">
@ -391,7 +435,8 @@
<updated>1547322958782</updated>
<workItem from="1547322960420" duration="21872000" />
<workItem from="1547401179909" duration="33384000" />
<workItem from="1548159944175" duration="9590000" />
<workItem from="1548159944175" duration="16987000" />
<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>
@ -456,11 +501,39 @@
<option name="project" value="LOCAL" />
<updated>1548177602799</updated>
</task>
<option name="localTasksCounter" value="10" />
<task id="LOCAL-00010" summary="update readme.md">
<created>1548180172910</created>
<option name="number" value="00010" />
<option name="presentableId" value="LOCAL-00010" />
<option name="project" value="LOCAL" />
<updated>1548180172910</updated>
</task>
<task id="LOCAL-00011" summary="fix default page size in /get-all">
<created>1548184896657</created>
<option name="number" value="00011" />
<option name="presentableId" value="LOCAL-00011" />
<option name="project" value="LOCAL" />
<updated>1548184896657</updated>
</task>
<task id="LOCAL-00012" summary="fix readme">
<created>1548238865354</created>
<option name="number" value="00012" />
<option name="presentableId" value="LOCAL-00012" />
<option name="project" value="LOCAL" />
<updated>1548238865354</updated>
</task>
<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="64846000" />
<option name="totallyTimeSpent" value="75213000" />
</component>
<component name="TodoView">
<todo-panel id="selected-file">
@ -475,7 +548,7 @@
<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" weight="0.18131869" />
<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" />
<window_info id="Designer" order="2" />
<window_info id="UI Designer" order="3" />
@ -484,18 +557,18 @@
<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" weight="0.4" />
<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.35187167" />
<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" />
<window_info anchor="bottom" id="Java Enterprise" order="12" />
<window_info anchor="bottom" id="Database Changes" order="13" show_stripe_button="false" />
<window_info anchor="bottom" id="Version Control" order="14" sideWeight="0.498779" weight="0.32941177" />
<window_info anchor="bottom" id="Version Control" order="14" sideWeight="0.498779" weight="0.5197861" />
<window_info anchor="bottom" id="SVN Repositories" order="15" weight="0.32941177" />
<window_info anchor="bottom" id="Database Console" order="16" sideWeight="0.498779" weight="0.5893048" />
<window_info anchor="right" id="Commander" order="0" weight="0.4" />
@ -503,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 anchor="right" id="Database" order="5" weight="0.6466165" />
<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>
@ -564,11 +637,27 @@
<MESSAGE value="fix ignore" />
<MESSAGE value="fix exists valid" />
<MESSAGE value="fix changeQuantity" />
<option name="LAST_COMMIT_MESSAGE" value="fix changeQuantity" />
<MESSAGE value="update readme.md" />
<MESSAGE value="fix default page size in /get-all" />
<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" />
</component>
<component name="XDebuggerManager">
<breakpoint-manager>
<breakpoints>
<line-breakpoint enabled="true" type="java-line">
<url>file://$PROJECT_DIR$/src/main/java/com/dino/scrum/sysmag/service/ProductServiceImpl.java</url>
<line>90</line>
<properties />
<option name="timeStamp" value="1" />
</line-breakpoint>
</breakpoints>
</breakpoint-manager>
</component>
<component name="editorHistoryManager">
<entry file="jar://$MAVEN_REPOSITORY$/org/springframework/boot/spring-boot-autoconfigure/2.1.2.RELEASE/spring-boot-autoconfigure-2.1.2.RELEASE.jar!/org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration.class">
<provider selected="true" editor-type-id="text-editor">
@ -638,16 +727,6 @@
<entry file="file://$APPLICATION_CONFIG_DIR$/consoles/db/d0158af3-b28d-407c-b7c8-7331568f6f97/console.sql">
<provider selected="true" editor-type-id="text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/src/main/java/com/dino/scrum/sysmag/service/ProductService.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="300">
<caret line="20" column="43" selection-start-line="20" selection-start-column="43" selection-end-line="20" selection-end-column="43" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/main/java/com/dino/scrum/sysmag/validationGroup/UpdateGroup.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="90">
@ -679,13 +758,6 @@
</state>
</provider>
</entry>
<entry file="file://$APPLICATION_CONFIG_DIR$/consoles/db/4eb55351-864c-4d3f-b24d-048a158530c7/console.sql">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="229">
<caret line="59" lean-forward="true" selection-start-line="59" selection-end-line="59" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/main/java/com/dino/scrum/sysmag/validator/QuantityChangeValidator.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="315">
@ -703,10 +775,51 @@
</state>
</provider>
</entry>
<entry file="jar://$MAVEN_REPOSITORY$/org/springframework/data/spring-data-commons/2.1.4.RELEASE/spring-data-commons-2.1.4.RELEASE.jar!/org/springframework/data/domain/Pageable.class">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="285">
<caret line="29" column="14" selection-start-line="29" selection-start-column="14" selection-end-line="29" selection-end-column="14" />
</state>
</provider>
</entry>
<entry file="file://$APPLICATION_CONFIG_DIR$/consoles/db/4eb55351-864c-4d3f-b24d-048a158530c7/console.sql">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="470">
<caret line="59" lean-forward="true" selection-start-line="59" selection-end-line="59" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/README.md">
<provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
<state split_layout="SPLIT">
<first_editor relative-caret-position="321">
<caret line="114" column="26" selection-start-line="114" selection-start-column="26" selection-end-line="114" selection-end-column="26" />
</first_editor>
<second_editor />
</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">
<caret line="6" column="31" selection-start-line="6" selection-start-column="31" selection-end-line="6" selection-end-column="31" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/main/java/com/dino/scrum/sysmag/service/ProductService.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="345">
<caret line="23" selection-start-line="23" selection-end-line="23" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/main/java/com/dino/scrum/sysmag/validator/ProductValidator.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="295">
<caret line="31" column="40" selection-start-line="31" selection-start-column="40" selection-end-line="31" selection-end-column="40" />
<state relative-caret-position="426">
<caret line="38" column="16" selection-start-line="38" selection-start-column="16" selection-end-line="38" selection-end-column="16" />
<folding>
<element signature="imports" expanded="true" />
</folding>
@ -715,18 +828,25 @@
</entry>
<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="413">
<caret line="54" column="74" selection-start-line="54" selection-start-column="74" selection-end-line="54" selection-end-column="74" />
<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="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="627">
<caret line="81" column="37" lean-forward="true" selection-start-line="81" selection-start-column="37" selection-end-line="81" selection-end-column="37" />
<state relative-caret-position="192">
<caret line="88" selection-start-line="88" selection-end-line="88" />
<folding>
<element signature="imports" expanded="true" />
</folding>
@ -735,24 +855,14 @@
</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="333">
<caret line="80" column="19" selection-start-line="80" selection-start-column="19" selection-end-line="80" selection-end-column="19" />
<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>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/README.md">
<provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
<state split_layout="SPLIT">
<first_editor relative-caret-position="114">
<caret line="182" column="7" selection-start-line="182" selection-start-column="7" selection-end-line="182" selection-end-column="7" />
</first_editor>
<second_editor />
</state>
</provider>
</entry>
</component>
<component name="masterDetails">
<states>

View File

@ -48,7 +48,7 @@ Content-Type: application/json
}
```
Response `200` with ``JSON``:
Response `200` with `JSON`:
```json
{
@ -74,7 +74,8 @@ Page start numbering on `page=0`. Default list is sorted by `id`.
GET /api/get-all?page=0&size=1&sort=id
Content-Type: application/json
```
Response ``200`` with ``JSON`` :
Response `200` with `JSON`:
```json
{
@ -127,7 +128,7 @@ The service will handle `GET` request on `/api/get-price-of-all` returing `Float
GET /api/get-price-of-all
Content-Type: application/json
```
Response `200` with ``JSON``:
Response `200` with `JSON`:
```json
{
@ -180,11 +181,9 @@ Content-Type: application/json
}
```
```json
Response: 200
Response `200`:
```
* * *
### Get product with `id`

View File

@ -40,12 +40,12 @@ public class Product {
@NotNull(message = "quantity cannot be null")
@Min(value = 0, message = "quantity cannot be under 0")
@Column(name = "quantity")
private long quantity;
private Long quantity;
@NotNull(message = "quantityMax cannot be null")
@Min(value = 1, message = "quantityMax cannot be under 1")
@Column(name = "quantityMax")
private long quantityMax;
private Long quantityMax;
@NotNull(message = "image_link cannot be null")
@Column(name = "image_link")

View File

@ -93,16 +93,16 @@ public class ProductServiceImpl implements ProductService {
if (productReceived.getName() != null)
productToChange.setName(productReceived.getName());
if (productReceived.getName() != null)
if (productReceived.getPrice() != null)
productToChange.setPrice(productReceived.getPrice());
if (productReceived.getName() != null)
if (productReceived.getQuantity() != null)
productToChange.setQuantity(productReceived.getQuantity());
if (productReceived.getName() != null)
if (productReceived.getQuantityMax() != null)
productToChange.setQuantityMax(productReceived.getQuantityMax());
if (productReceived.getName() != null)
if (productReceived.getImageLink() != null)
productToChange.setImageLink(productReceived.getImageLink());
productRepository.save(productToChange);
@ -110,6 +110,7 @@ public class ProductServiceImpl implements ProductService {
return productRepository.findById(productToChange.getId().longValue());
}
@Override
public long count() {
return productRepository.count();