Added Post system. Notification system

This commit is contained in:
redtea committed 2022-09-01 17:04:25 +03:00
1 parent cc068fc3a8
commit 3ac444931c
29 files changed
+639 -86

No files matched your search

@@ -1,7 +1,5 @@
package site.easystartup.web.project.controller;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.modelmapper.ModelMapper;
import org.springframework.http.ResponseEntity;
@@ -26,7 +24,6 @@ import java.util.stream.Collectors;
@RestController
@RequiredArgsConstructor
@RequestMapping("/api/project")
@Tag(name = "Проекты", description = "контроллер для работы с проектами")
public class ProjectController {
private final ProjectService projectService;
private final ResponseErrorValidation responseErrorValidation;
@@ -35,7 +32,6 @@ public class ProjectController {
private final ParticipantService participantService;
@PostMapping
@Operation(summary = "Создание проекта")
public ResponseEntity<Object> createProject(@Valid @RequestBody ProjectRequest projectRequest,
BindingResult bindingResult,
Principal principal) {
@@ -47,7 +43,6 @@ public class ProjectController {
}
@PutMapping("/{projectId}")
@Operation(summary = "Изменение проекта")
public ResponseEntity<Object> editProject(@Valid @RequestBody ProjectRequest projectRequest,
@PathVariable("projectId") Long projectId,
BindingResult bindingResult,
@@ -60,7 +55,6 @@ public class ProjectController {
}
@PutMapping("/{projectId}/{partId}/part")
@Operation(summary = "Изменение позиции в проекте: Дизайнер/Ui designer")
public ResponseEntity<Object> editPart(@Valid @RequestBody ParticipantDto participantDto,
@PathVariable("projectId") Long projectId,
@PathVariable("partId") Long partId,
@@ -75,7 +69,6 @@ public class ProjectController {
@DeleteMapping("/{projectId}")
@Operation(summary = "Удаление проекта")
public ResponseEntity<Object> deleteProject(@PathVariable("projectId") Long projectId,
Principal principal) {
projectService.deleteProject(projectId, principal);
@@ -83,14 +76,12 @@ public class ProjectController {
}
@GetMapping("/{projectId}")
@Operation(summary = "получение проекта по id")
public ResponseEntity<ProjectDto> getProject(@PathVariable("projectId") Long projectId) {
return ResponseEntity.ok().body(modelMapper.map(projectService.getProjectById(projectId), ProjectDto.class));
}
//
@GetMapping("/{userId}/all")
@Operation(summary = "Получение всех проектов для пользователя")
public ResponseEntity<List<ProjectDto>> getAllProjectsForUser(@PathVariable("userId") Long userId) {
List<ProjectDto> projects = projectService.getAllProjectsForUser(userId)
.stream().map(project -> modelMapper.map(project, ProjectDto.class)).collect(Collectors.toList());
@@ -98,7 +89,6 @@ public class ProjectController {
}
@GetMapping("/{technology}/tech")
@Operation(summary = "Получение всех проектов с опредлененной технологией")
public ResponseEntity<List<ProjectDto>> getAllProjectsWithTechnology(@PathVariable("technology") String technology) {
List<ProjectDto> projects = projectService.getAllProjectsWithTechnology(technology)
.stream().map(project -> modelMapper.map(project, ProjectDto.class)).collect(Collectors.toList());
@@ -106,7 +96,6 @@ public class ProjectController {
}
@GetMapping("/my")
@Operation(summary = "получение всех проектов для текущего пользователя")
public ResponseEntity<List<ProjectDto>> getAllProjectsForCurrentUser(Principal principal) {
List<ProjectDto> projects = projectService.getAllProjectsForCurrentUser(principal)
.stream().map(project -> modelMapper.map(project, ProjectDto.class)).collect(Collectors.toList());
@@ -115,7 +104,6 @@ public class ProjectController {
@GetMapping("/{nameOfPosition}/positions")
@Operation(summary = "Получение всех проектов с указанной позицией : Дизайнер")
public ResponseEntity<List<ProjectDto>> getAllProjectsWithPosition(@PathVariable("nameOfPosition") String nameOfPosition) {
List<ProjectDto> projects = projectService.getAllProjectsWithPosition(nameOfPosition)
.stream().map(project -> modelMapper.map(project, ProjectDto.class)).collect(Collectors.toList());
@@ -123,7 +111,6 @@ public class ProjectController {
}
@GetMapping("/{commercialStatus}/commercial_status")
@Operation(summary = "получение всех проектов по коммерческому статусу")
public ResponseEntity<List<ProjectDto>> getAllProjectsWithCommercialStatus(@PathVariable("commercialStatus") int commercialStatus) {
List<ProjectDto> projects = projectService.getAllProjectsWithCommercialStatus(commercialStatus)
.stream().map(project -> modelMapper.map(project, ProjectDto.class)).collect(Collectors.toList());
@@ -131,7 +118,6 @@ public class ProjectController {
}
@GetMapping("/requests")
@Operation(summary = "получение всех поданных заявок на проект")
public ResponseEntity<List<ParticipantDto>> getAllRequestsForProject(@RequestBody Long projectId) {
List<ParticipantDto> requests = projectService.getAllRequestsForProject(projectId)
.stream().map(project -> modelMapper.map(project, ParticipantDto.class)).collect(Collectors.toList());
@@ -139,7 +125,6 @@ public class ProjectController {
}
@PostMapping("/apply")
@Operation(summary = "подать заявку на участие в проекте")
public ResponseEntity<ProjectDto> applyOnProject(@RequestBody ParticipantRequest participantRequest,
Principal principal) {
Project project = projectService
@@ -148,7 +133,6 @@ public class ProjectController {
}
@PostMapping("/participant")
@Operation(summary = "утвердить участница на проект")
public ResponseEntity<ProjectDto> confirmParticipant(@RequestBody ParticipantRequest participantRequest,
Principal principal) {
Project project = projectService.confirmParticipant(participantRequest.getProjectId(),
@@ -1,6 +1,5 @@
package site.easystartup.web.project.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.NoArgsConstructor;