Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/Project-Module-Feb-2022.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

68 changes: 68 additions & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions .idea/jarRepositories.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

124 changes: 124 additions & 0 deletions .idea/uiDesigner.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions taskmanager/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ task manager + notes support
API Endpoints (REST URLs)

GET /tasks get all tasks ✅
GET /tasks/{id} get a task by id
DELETE /tasks/{id} delete task by id
PATCH /tasks/{id} update details of a task
GET /tasks/{id} get a task by id
DELETE /tasks/{id} delete task by id
PATCH /tasks/{id} update details of a task
POST /tasks create a new task ✅

GET /tasks/{id}/notes show all notes of a task
POST /tasks/{id}/notes add notes to a task
DELETE /tasks/{id}/notes/{nid} delete a note from a task
GET /tasks/{id}/notes show all notes of a task
POST /tasks/{id}/notes add notes to a task
DELETE /tasks/{id}/notes/{nid} delete a note from a task

---- "idempotent"

Expand Down
3 changes: 2 additions & 1 deletion taskmanager/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins {

group = 'com.scaler'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '17'
//sourceCompatibility = '17'

configurations {
compileOnly {
Expand All @@ -21,6 +21,7 @@ repositories {
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.12.5'
compileOnly 'org.projectlombok:lombok'
developmentOnly 'org.springframework.boot:spring-boot-devtools'
runtimeOnly 'com.h2database:h2'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package com.scaler.taskmanager;


public final class QueryConstants {
public static final String FETCH_NOTES_BY_TASKID = "SELECT new com.scaler.taskmanager.notes.dto.NoteResponseBody(" +
"notes.id, notes.body,notes.task.id) FROM NoteEntity notes WHERE notes.task.id = :taskId";

public static final String DELETE_NOTES_BY_TASKID = "DELETE FROM NoteEntity notes "+
"WHERE notes.task.id = :taskId";
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class TaskmanagerApplication {
public class TaskManagerApplication {

public static void main(String[] args) {
SpringApplication.run(TaskmanagerApplication.class, args);
SpringApplication.run(TaskManagerApplication.class, args);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
@AllArgsConstructor
@NoArgsConstructor
@Getter
@Entity(name = "notes")
@Entity
@Table(name = "notes")
public class NoteEntity {
@Id @GeneratedValue(strategy = GenerationType.SEQUENCE)
Long id;
Expand All @@ -20,4 +21,9 @@ public class NoteEntity {

@ManyToOne
TaskEntity task;

public NoteEntity(String body, TaskEntity task) {
this.body = body;
this.task = task;
}
}
Loading