File tree 6 files changed +16
-14
lines changed
java/com/example/easynotes
6 files changed +16
-14
lines changed Original file line number Diff line number Diff line change 4
4
<modelVersion >4.0.0</modelVersion >
5
5
6
6
<groupId >com.example</groupId >
7
- <artifactId >spring-boot-mysql-rest-api-tutorial </artifactId >
7
+ <artifactId >easy-notes </artifactId >
8
8
<version >1.0.0</version >
9
9
<packaging >jar</packaging >
10
10
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 >
13
13
14
14
<parent >
15
15
<groupId >org.springframework.boot</groupId >
Original file line number Diff line number Diff line change 1
- package com .notesapp ;
1
+ package com .example . easynotes ;
2
2
3
3
import org .springframework .boot .SpringApplication ;
4
4
import org .springframework .boot .autoconfigure .SpringBootApplication ;
5
5
import org .springframework .data .jpa .repository .config .EnableJpaAuditing ;
6
6
7
7
@ SpringBootApplication
8
8
@ EnableJpaAuditing
9
- public class NotesApplication {
9
+ public class EasyNotesApplication {
10
10
11
11
public static void main (String [] args ) {
12
- SpringApplication .run (NotesApplication .class , args );
12
+ SpringApplication .run (EasyNotesApplication .class , args );
13
13
}
14
14
}
Original file line number Diff line number Diff line change 1
- package com .notesapp .controller ;
1
+ package com .example . easynotes .controller ;
2
2
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 ;
5
5
import org .springframework .beans .factory .annotation .Autowired ;
6
6
import org .springframework .http .ResponseEntity ;
7
7
import org .springframework .web .bind .annotation .*;
@@ -39,7 +39,8 @@ public Note createNote(@Valid @RequestBody Note note) {
39
39
}
40
40
41
41
@ 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 ) {
43
44
Note note = noteRepository .findOne (noteId );
44
45
if (note == null ) {
45
46
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 ;
2
2
3
3
import org .hibernate .validator .constraints .NotBlank ;
4
4
import org .springframework .data .annotation .CreatedDate ;
@@ -19,6 +19,7 @@ public class Note {
19
19
@ GeneratedValue (strategy = GenerationType .AUTO )
20
20
private Long id ;
21
21
22
+ @ NotBlank
22
23
private String title ;
23
24
24
25
@ NotBlank
Original file line number Diff line number Diff line change 1
- package com .notesapp .repository ;
1
+ package com .example . easynotes .repository ;
2
2
3
- import com .notesapp .model .Note ;
3
+ import com .example . easynotes .model .Note ;
4
4
import org .springframework .data .jpa .repository .JpaRepository ;
5
5
6
6
/**
Original file line number Diff line number Diff line change @@ -17,4 +17,4 @@ spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5Dialect
17
17
spring.jpa.hibernate.ddl-auto = update
18
18
19
19
# # 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