Commit 70a013a86c2faba161221009748e6e6cf9056053

Authored by Geoffrey PREUD'HOMME
2 parents 19eb4d26 3e3b38c1

Merge branch 'master' of archives.plil.fr:LeClubInfo/etunicorn-server

.idea/dataSources.local.xml 0 → 100644
... ... @@ -0,0 +1,8 @@
  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="" version="" jdbc-version="" driver-name="" driver-version="" />
  6 + </data-source>
  7 + </component>
  8 +</project>
0 9 \ No newline at end of file
... ...
.idea/dataSources.xml
1 1 <?xml version="1.0" encoding="UTF-8"?>
2 2 <project version="4">
3 3 <component name="DataSourceManagerImpl" format="xml" multifile-model="true">
4   - <data-source source="LOCAL" name="bade@localhost" uuid="d63e2d8c-a4c6-4db5-9ff9-2f8eb96100ee">
  4 + <data-source source="LOCAL" name="bade@192.168.0.28" uuid="7e4ff828-d2d1-4752-a033-bfc8d5c3ccd8">
5 5 <driver-ref>mysql</driver-ref>
6 6 <synchronize>true</synchronize>
7 7 <jdbc-driver>com.mysql.jdbc.Driver</jdbc-driver>
8   - <jdbc-url>jdbc:mysql://localhost:3306/bade</jdbc-url>
  8 + <jdbc-url>jdbc:mysql://192.168.0.28:3306/bade</jdbc-url>
9 9 <driver-properties>
10 10 <property name="autoReconnect" value="true" />
11 11 <property name="zeroDateTimeBehavior" value="convertToNull" />
... ...
src/main/java/etunicorn/controller/PersonneController.java
... ... @@ -17,7 +17,8 @@ import org.springframework.web.bind.annotation.RestController;
17 17  
18 18 import javax.validation.Valid;
19 19 import java.math.BigDecimal;
20   -import java.util.Date;
  20 +import java.text.ParseException;
  21 +import java.text.SimpleDateFormat;
21 22 import java.util.LinkedHashMap;
22 23 import java.util.List;
23 24  
... ... @@ -42,8 +43,13 @@ public class PersonneController extends BaseController implements etunicorn.gene
42 43 }
43 44  
44 45 private ResponseEntity<?> mergePersonne(Personne personne, UpdatePersonneRequest updatePersonneRequest) {
  46 + SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
45 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 54 if (updatePersonneRequest.getCarte() != null) {
49 55 personne.setCarte(updatePersonneRequest.getCarte());
... ...