started to add the service and model for notes. service will be put on hold until i do the JPA class
This commit is contained in:
43
src/main/java/org/zaine/app/model/Notes.java
Normal file
43
src/main/java/org/zaine/app/model/Notes.java
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
package org.zaine.app.model;
|
||||||
|
|
||||||
|
import java.sql.Date;
|
||||||
|
|
||||||
|
public class Notes {
|
||||||
|
private String content;
|
||||||
|
private String authorName;
|
||||||
|
private Date createdAt;
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
public Notes() {
|
||||||
|
this.createdAt = new Date(System.currentTimeMillis());
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getContent() {
|
||||||
|
return content;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setContent(String content) {
|
||||||
|
this.content = content;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAuthorName() {
|
||||||
|
return authorName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAuthorName(String authorName) {
|
||||||
|
this.authorName = authorName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getCreatedAt() {
|
||||||
|
return createdAt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(Long id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
17
src/main/java/org/zaine/app/service/NotesService.java
Normal file
17
src/main/java/org/zaine/app/service/NotesService.java
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
package org.zaine.app.service;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.zaine.app.model.Notes;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class NotesService {
|
||||||
|
|
||||||
|
private static List<Notes> notesList = new ArrayList<>();
|
||||||
|
|
||||||
|
public List<Notes> getAllNotes() {
|
||||||
|
return notesList;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user