File tree 2 files changed +15
-18
lines changed
Chapter3-1-7/src/main/java/com/didispace
2 files changed +15
-18
lines changed Original file line number Diff line number Diff line change 1
1
package com .didispace ;
2
2
3
- import com .didispace .dto .UserDto ;
4
3
import com .fasterxml .jackson .databind .ObjectMapper ;
5
4
import com .fasterxml .jackson .databind .SerializationFeature ;
6
5
import com .fasterxml .jackson .datatype .jsr310 .JavaTimeModule ;
6
+ import lombok .AllArgsConstructor ;
7
+ import lombok .Data ;
8
+ import lombok .NoArgsConstructor ;
7
9
import org .springframework .boot .SpringApplication ;
8
10
import org .springframework .boot .autoconfigure .SpringBootApplication ;
9
11
import org .springframework .context .annotation .Bean ;
10
12
import org .springframework .web .bind .annotation .PostMapping ;
11
13
import org .springframework .web .bind .annotation .RequestBody ;
12
14
import org .springframework .web .bind .annotation .RestController ;
13
15
16
+ import java .time .LocalDate ;
17
+
14
18
/**
15
19
* @author 程序猿DD
16
20
* @version 1.0.0
@@ -33,6 +37,16 @@ public UserDto user(@RequestBody UserDto userDto) throws Exception {
33
37
34
38
}
35
39
40
+ @ Data
41
+ @ NoArgsConstructor
42
+ @ AllArgsConstructor
43
+ static class UserDto {
44
+
45
+ private String userName ;
46
+ private LocalDate birthday ;
47
+
48
+ }
49
+
36
50
@ Bean
37
51
public ObjectMapper serializingObjectMapper () {
38
52
ObjectMapper objectMapper = new ObjectMapper ();
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments