Commit 3e3b38c1fe8b0c636100060cd12fe31a0546a621
1 parent
7836b1e6
VITE JE SUIS LE PREMIER
Showing
3 changed files
with
42 additions
and
2 deletions
Show diff stats
@@ -0,0 +1,15 @@ | @@ -0,0 +1,15 @@ | ||
1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
2 | +<project version="4"> | ||
3 | + <component name="dataSourceStorageLocal"> | ||
4 | + <data-source name="bade@192.168.0.28" uuid="7e4ff828-d2d1-4752-a033-bfc8d5c3ccd8"> | ||
5 | + <database-info product="MySQL" version="5.5.5-10.1.20-MariaDB" jdbc-version="4.0" driver-name="MySQL Connector Java" driver-version="mysql-connector-java-5.1.35 ( Revision: 5fb9c5849535c13917c2cf9baaece6ef9693ef27 )"> | ||
6 | + <extra-name-characters>#@</extra-name-characters> | ||
7 | + <identifier-quote-string>`</identifier-quote-string> | ||
8 | + </database-info> | ||
9 | + <case-sensitivity plain-identifiers="exact" quoted-identifiers="exact" /> | ||
10 | + <secret-storage>master_key</secret-storage> | ||
11 | + <user-name>bade</user-name> | ||
12 | + <resolve-scope>bade:</resolve-scope> | ||
13 | + </data-source> | ||
14 | + </component> | ||
15 | +</project> | ||
0 | \ No newline at end of file | 16 | \ No newline at end of file |
@@ -0,0 +1,19 @@ | @@ -0,0 +1,19 @@ | ||
1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
2 | +<project version="4"> | ||
3 | + <component name="DataSourceManagerImpl" format="xml" multifile-model="true"> | ||
4 | + <data-source source="LOCAL" name="bade@192.168.0.28" uuid="7e4ff828-d2d1-4752-a033-bfc8d5c3ccd8"> | ||
5 | + <driver-ref>mysql</driver-ref> | ||
6 | + <synchronize>true</synchronize> | ||
7 | + <jdbc-driver>com.mysql.jdbc.Driver</jdbc-driver> | ||
8 | + <jdbc-url>jdbc:mysql://192.168.0.28:3306/bade</jdbc-url> | ||
9 | + <driver-properties> | ||
10 | + <property name="autoReconnect" value="true" /> | ||
11 | + <property name="zeroDateTimeBehavior" value="convertToNull" /> | ||
12 | + <property name="tinyInt1isBit" value="false" /> | ||
13 | + <property name="characterEncoding" value="utf8" /> | ||
14 | + <property name="characterSetResults" value="utf8" /> | ||
15 | + <property name="yearIsDateType" value="false" /> | ||
16 | + </driver-properties> | ||
17 | + </data-source> | ||
18 | + </component> | ||
19 | +</project> | ||
0 | \ No newline at end of file | 20 | \ No newline at end of file |
src/main/java/etunicorn/controller/PersonneController.java
@@ -17,7 +17,8 @@ import org.springframework.web.bind.annotation.RestController; | @@ -17,7 +17,8 @@ import org.springframework.web.bind.annotation.RestController; | ||
17 | 17 | ||
18 | import javax.validation.Valid; | 18 | import javax.validation.Valid; |
19 | import java.math.BigDecimal; | 19 | import java.math.BigDecimal; |
20 | -import java.util.Date; | 20 | +import java.text.ParseException; |
21 | +import java.text.SimpleDateFormat; | ||
21 | import java.util.LinkedHashMap; | 22 | import java.util.LinkedHashMap; |
22 | import java.util.List; | 23 | import java.util.List; |
23 | 24 | ||
@@ -42,8 +43,13 @@ public class PersonneController extends BaseController implements etunicorn.gene | @@ -42,8 +43,13 @@ public class PersonneController extends BaseController implements etunicorn.gene | ||
42 | } | 43 | } |
43 | 44 | ||
44 | private ResponseEntity<?> mergePersonne(Personne personne, UpdatePersonneRequest updatePersonneRequest) { | 45 | private ResponseEntity<?> mergePersonne(Personne personne, UpdatePersonneRequest updatePersonneRequest) { |
46 | + SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); | ||
45 | if (updatePersonneRequest.getNaissance() != null) { | 47 | if (updatePersonneRequest.getNaissance() != null) { |
46 | - personne.setNaissance(new Date(updatePersonneRequest.getNaissance())); | 48 | + try { |
49 | + personne.setNaissance(format.parse(updatePersonneRequest.getNaissance())); | ||
50 | + } catch (ParseException e) { | ||
51 | + e.printStackTrace(); | ||
52 | + } | ||
47 | } | 53 | } |
48 | if (updatePersonneRequest.getCarte() != null) { | 54 | if (updatePersonneRequest.getCarte() != null) { |
49 | personne.setCarte(updatePersonneRequest.getCarte()); | 55 | personne.setCarte(updatePersonneRequest.getCarte()); |