-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ce15027
commit 570f58a
Showing
58 changed files
with
311 additions
and
98 deletions.
There are no files selected for viewing
Binary file removed
BIN
-2.01 KB
build/classes/java/main/com/example/teamsync/assembler/EmployeeResourceAssembler.class
Binary file not shown.
Binary file removed
BIN
-359 Bytes
build/classes/java/main/com/example/teamsync/assembler/ProjectResourceAssembler.class
Binary file not shown.
Binary file modified
BIN
+121 Bytes
(100%)
build/classes/java/main/com/example/teamsync/controller/DepartmentController.class
Binary file not shown.
Binary file modified
BIN
+277 Bytes
(100%)
build/classes/java/main/com/example/teamsync/controller/EmployeeController.class
Binary file not shown.
Binary file modified
BIN
+3.03 KB
(180%)
build/classes/java/main/com/example/teamsync/controller/ProjectController.class
Binary file not shown.
Binary file added
BIN
+390 Bytes
...ses/java/main/com/example/teamsync/controller/assembler/DepartmentResourceAssembler.class
Binary file not shown.
Binary file added
BIN
+4.05 KB
...asses/java/main/com/example/teamsync/controller/assembler/EmployeeResourceAssembler.class
Binary file not shown.
Binary file added
BIN
+2.37 KB
...lasses/java/main/com/example/teamsync/controller/assembler/ProjectResourceAssembler.class
Binary file not shown.
Binary file added
BIN
+381 Bytes
...ses/java/main/com/example/teamsync/controller/assembler/resource/DepartmentResource.class
Binary file not shown.
Binary file added
BIN
+2.24 KB
...asses/java/main/com/example/teamsync/controller/assembler/resource/EmployeeResource.class
Binary file not shown.
Binary file added
BIN
+1.46 KB
...lasses/java/main/com/example/teamsync/controller/assembler/resource/ProjectResource.class
Binary file not shown.
Binary file added
BIN
+616 Bytes
build/classes/java/main/com/example/teamsync/controller/dto/DepartmentDto.class
Binary file not shown.
Binary file added
BIN
+2.17 KB
build/classes/java/main/com/example/teamsync/controller/dto/EmployeeDto.class
Binary file not shown.
Binary file added
BIN
+1.22 KB
build/classes/java/main/com/example/teamsync/controller/dto/ProjectDto.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
+595 Bytes
(140%)
build/classes/java/main/com/example/teamsync/model/Employee.class
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
build/classes/java/main/com/example/teamsync/model/Project.class
Binary file not shown.
Binary file modified
BIN
+228 Bytes
(150%)
build/classes/java/main/com/example/teamsync/repository/ProjectRepository.class
Binary file not shown.
Binary file modified
BIN
+132 Bytes
(100%)
build/classes/java/main/com/example/teamsync/service/DepartmentService.class
Binary file not shown.
Binary file modified
BIN
+700 Bytes
(120%)
build/classes/java/main/com/example/teamsync/service/ProjectService.class
Binary file not shown.
Binary file added
BIN
+4.22 KB
build/tmp/compileJava/compileTransaction/stash-dir/DepartmentController.class.uniqueId13
Binary file not shown.
File renamed without changes.
Binary file added
BIN
+339 Bytes
build/tmp/compileJava/compileTransaction/stash-dir/DepartmentResource.class.uniqueId6
Binary file not shown.
File renamed without changes.
Binary file added
BIN
+4.79 KB
build/tmp/compileJava/compileTransaction/stash-dir/DepartmentService.class.uniqueId4
Binary file not shown.
Binary file added
BIN
+6 KB
build/tmp/compileJava/compileTransaction/stash-dir/EmployeeController.class.uniqueId7
Binary file not shown.
Binary file added
BIN
+2.11 KB
build/tmp/compileJava/compileTransaction/stash-dir/EmployeeDto.class.uniqueId2
Binary file not shown.
Binary file added
BIN
+2.12 KB
build/tmp/compileJava/compileTransaction/stash-dir/EmployeeResource.class.uniqueId8
Binary file not shown.
Binary file added
BIN
+3.86 KB
...d/tmp/compileJava/compileTransaction/stash-dir/EmployeeResourceAssembler.class.uniqueId10
Binary file not shown.
Binary file added
BIN
+6.65 KB
build/tmp/compileJava/compileTransaction/stash-dir/ProjectController.class.uniqueId12
Binary file not shown.
Binary file added
BIN
+1.19 KB
build/tmp/compileJava/compileTransaction/stash-dir/ProjectDto.class.uniqueId3
Binary file not shown.
Binary file added
BIN
+1.4 KB
build/tmp/compileJava/compileTransaction/stash-dir/ProjectResource.class.uniqueId9
Binary file not shown.
Binary file added
BIN
+2.27 KB
build/tmp/compileJava/compileTransaction/stash-dir/ProjectResourceAssembler.class.uniqueId5
Binary file not shown.
Binary file added
BIN
+4.83 KB
build/tmp/compileJava/compileTransaction/stash-dir/ProjectService.class.uniqueId1
Binary file not shown.
Binary file not shown.
4 changes: 0 additions & 4 deletions
4
src/main/java/com/example/teamsync/assembler/DepartmentResourceAssembler.java
This file was deleted.
Oops, something went wrong.
31 changes: 0 additions & 31 deletions
31
src/main/java/com/example/teamsync/assembler/EmployeeResourceAssembler.java
This file was deleted.
Oops, something went wrong.
4 changes: 0 additions & 4 deletions
4
src/main/java/com/example/teamsync/assembler/ProjectResourceAssembler.java
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
src/main/java/com/example/teamsync/controller/DepartmentController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
src/main/java/com/example/teamsync/controller/assembler/DepartmentResourceAssembler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package com.example.teamsync.controller.assembler; | ||
|
||
public class DepartmentResourceAssembler { | ||
} |
46 changes: 46 additions & 0 deletions
46
src/main/java/com/example/teamsync/controller/assembler/EmployeeResourceAssembler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package com.example.teamsync.controller.assembler; | ||
|
||
import com.example.teamsync.controller.EmployeeController; | ||
import com.example.teamsync.controller.assembler.resource.EmployeeResource; | ||
import com.example.teamsync.model.Employee; | ||
import com.example.teamsync.controller.assembler.resource.ProjectResource; | ||
import org.springframework.hateoas.server.mvc.RepresentationModelAssemblerSupport; | ||
import org.springframework.stereotype.Component; | ||
|
||
import java.util.List; | ||
import java.util.stream.Collectors; | ||
|
||
import static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.linkTo; | ||
import static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.methodOn; | ||
|
||
@Component | ||
public class EmployeeResourceAssembler extends RepresentationModelAssemblerSupport<Employee, EmployeeResource> { | ||
|
||
private final ProjectResourceAssembler projectResourceAssembler; | ||
|
||
public EmployeeResourceAssembler(ProjectResourceAssembler projectResourceAssembler) { | ||
super(EmployeeController.class, EmployeeResource.class); | ||
this.projectResourceAssembler = projectResourceAssembler; | ||
} | ||
|
||
@Override | ||
public EmployeeResource toModel(Employee employee) { | ||
EmployeeResource resource = new EmployeeResource(); | ||
resource.setId(employee.getId()); | ||
resource.setName(employee.getName()); | ||
resource.setAge(employee.getAge()); | ||
resource.setEmail(employee.getEmail()); | ||
resource.setDepartment(employee.getDepartment()); | ||
|
||
// Populate the projects field | ||
List<ProjectResource> projectResources = employee.getProjects().stream() | ||
.map(projectResourceAssembler::toModel) | ||
.collect(Collectors.toList()); | ||
resource.setProjects(projectResources); | ||
|
||
// Add self link | ||
resource.add(linkTo(methodOn(EmployeeController.class).getEmployeeById(employee.getId())).withSelfRel()); | ||
|
||
return resource; | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
src/main/java/com/example/teamsync/controller/assembler/ProjectResourceAssembler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package com.example.teamsync.controller.assembler; | ||
|
||
import com.example.teamsync.controller.ProjectController; | ||
import com.example.teamsync.model.Project; | ||
import com.example.teamsync.controller.assembler.resource.ProjectResource; | ||
import org.springframework.hateoas.server.RepresentationModelAssembler; | ||
import org.springframework.stereotype.Component; | ||
|
||
import static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.linkTo; | ||
import static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.methodOn; | ||
|
||
@Component | ||
public class ProjectResourceAssembler implements RepresentationModelAssembler<Project, ProjectResource> { | ||
|
||
@Override | ||
public ProjectResource toModel(Project project) { | ||
ProjectResource resource = new ProjectResource(); | ||
resource.setId(project.getId()); | ||
resource.setName(project.getName()); | ||
resource.setDescription(project.getDescription()); | ||
|
||
// Set employeeId if needed | ||
if (project.getEmployee() != null) { | ||
resource.setEmployeeId(project.getEmployee().getId()); | ||
} | ||
|
||
// Add self link | ||
resource.add(linkTo(methodOn(ProjectController.class).getProjectById(project.getId())).withSelfRel()); | ||
|
||
return resource; | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
src/main/java/com/example/teamsync/controller/assembler/resource/DepartmentResource.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package com.example.teamsync.controller.assembler.resource; | ||
|
||
public class DepartmentResource { | ||
} |
63 changes: 63 additions & 0 deletions
63
src/main/java/com/example/teamsync/controller/assembler/resource/EmployeeResource.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
package com.example.teamsync.controller.assembler.resource; | ||
|
||
import org.springframework.hateoas.RepresentationModel; | ||
|
||
import java.util.List; | ||
|
||
public class EmployeeResource extends RepresentationModel<EmployeeResource> { | ||
private Long id; | ||
private String name; | ||
private int age; | ||
private String email; | ||
private String department; | ||
private List<ProjectResource> projects; | ||
|
||
// Getters and Setters | ||
public Long getId() { | ||
return id; | ||
} | ||
|
||
public void setId(Long id) { | ||
this.id = id; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public void setName(String name) { | ||
this.name = name; | ||
} | ||
|
||
public int getAge() { | ||
return age; | ||
} | ||
|
||
public void setAge(int age) { | ||
this.age = age; | ||
} | ||
|
||
public String getEmail() { | ||
return email; | ||
} | ||
|
||
public void setEmail(String email) { | ||
this.email = email; | ||
} | ||
|
||
public String getDepartment() { | ||
return department; | ||
} | ||
|
||
public void setDepartment(String department) { | ||
this.department = department; | ||
} | ||
|
||
public List<ProjectResource> getProjects() { | ||
return projects; | ||
} | ||
|
||
public void setProjects(List<ProjectResource> projects) { | ||
this.projects = projects; | ||
} | ||
} |
Oops, something went wrong.