File tree Expand file tree Collapse file tree 6 files changed +16
-14
lines changed
java/com/example/easynotes Expand file tree Collapse file tree 6 files changed +16
-14
lines changed Original file line number Diff line number Diff line change 44 <modelVersion >4.0.0</modelVersion >
55
66 <groupId >com.example</groupId >
7- <artifactId >spring-boot-mysql-rest-api-tutorial </artifactId >
7+ <artifactId >easy-notes </artifactId >
88 <version >1.0.0</version >
99 <packaging >jar</packaging >
1010
11- <name >spring-boot-mysql-rest-api-tutorial </name >
12- <description >Building Rest API for a Simple Note taking app with Spring Boot and Mysql </description >
11+ <name >easy-notes </name >
12+ <description >Rest API for a Simple Note Taking Application </description >
1313
1414 <parent >
1515 <groupId >org.springframework.boot</groupId >
Original file line number Diff line number Diff line change 1- package com .notesapp ;
1+ package com .example . easynotes ;
22
33import org .springframework .boot .SpringApplication ;
44import org .springframework .boot .autoconfigure .SpringBootApplication ;
55import org .springframework .data .jpa .repository .config .EnableJpaAuditing ;
66
77@ SpringBootApplication
88@ EnableJpaAuditing
9- public class NotesApplication {
9+ public class EasyNotesApplication {
1010
1111 public static void main (String [] args ) {
12- SpringApplication .run (NotesApplication .class , args );
12+ SpringApplication .run (EasyNotesApplication .class , args );
1313 }
1414}
Original file line number Diff line number Diff line change 1- package com .notesapp .controller ;
1+ package com .example . easynotes .controller ;
22
3- import com .notesapp .model .Note ;
4- import com .notesapp .repository .NoteRepository ;
3+ import com .example . easynotes .model .Note ;
4+ import com .example . easynotes .repository .NoteRepository ;
55import org .springframework .beans .factory .annotation .Autowired ;
66import org .springframework .http .ResponseEntity ;
77import org .springframework .web .bind .annotation .*;
@@ -39,7 +39,8 @@ public Note createNote(@Valid @RequestBody Note note) {
3939 }
4040
4141 @ PutMapping ("/notes/{id}" )
42- public ResponseEntity <Note > updateNote (@ PathVariable (value = "id" ) Long noteId , @ Valid @ RequestBody Note noteDetails ) {
42+ public ResponseEntity <Note > updateNote (@ PathVariable (value = "id" ) Long noteId ,
43+ @ Valid @ RequestBody Note noteDetails ) {
4344 Note note = noteRepository .findOne (noteId );
4445 if (note == null ) {
4546 return ResponseEntity .notFound ().build ();
Original file line number Diff line number Diff line change 1- package com .notesapp .model ;
1+ package com .example . easynotes .model ;
22
33import org .hibernate .validator .constraints .NotBlank ;
44import org .springframework .data .annotation .CreatedDate ;
@@ -19,6 +19,7 @@ public class Note {
1919 @ GeneratedValue (strategy = GenerationType .AUTO )
2020 private Long id ;
2121
22+ @ NotBlank
2223 private String title ;
2324
2425 @ NotBlank
Original file line number Diff line number Diff line change 1- package com .notesapp .repository ;
1+ package com .example . easynotes .repository ;
22
3- import com .notesapp .model .Note ;
3+ import com .example . easynotes .model .Note ;
44import org .springframework .data .jpa .repository .JpaRepository ;
55
66/**
Original file line number Diff line number Diff line change @@ -17,4 +17,4 @@ spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5Dialect
1717spring.jpa.hibernate.ddl-auto = update
1818
1919# # Jackson Properties
20- spring.jackson.date-format = yyyy-MM-dd HH:mm:ss
20+ spring.jackson.date-format = yyyy-MM-dd HH:mm:ss
You can’t perform that action at this time.
0 commit comments