Create model folder for grant
This commit is contained in:
parent
816d115cc8
commit
bcc64cda96
@ -1,4 +1,4 @@
|
|||||||
package ru.ulstu.grant.model.controller;
|
package ru.ulstu.grant.controller;
|
||||||
|
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.ui.ModelMap;
|
import org.springframework.ui.ModelMap;
|
||||||
@ -7,7 +7,7 @@ import org.springframework.web.bind.annotation.*;
|
|||||||
import ru.ulstu.deadline.model.DeadlineDto;
|
import ru.ulstu.deadline.model.DeadlineDto;
|
||||||
import ru.ulstu.grant.model.Grant;
|
import ru.ulstu.grant.model.Grant;
|
||||||
import ru.ulstu.grant.model.GrantDto;
|
import ru.ulstu.grant.model.GrantDto;
|
||||||
import ru.ulstu.grant.model.service.GrantService;
|
import ru.ulstu.grant.service.GrantService;
|
||||||
|
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonCreator;
|
|||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
import org.hibernate.validator.constraints.NotEmpty;
|
import org.hibernate.validator.constraints.NotEmpty;
|
||||||
import ru.ulstu.deadline.model.DeadlineDto;
|
import ru.ulstu.deadline.model.DeadlineDto;
|
||||||
|
import ru.ulstu.grant.model.Grant;
|
||||||
import ru.ulstu.project.model.ProjectDto;
|
import ru.ulstu.project.model.ProjectDto;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
package ru.ulstu.grant.model;
|
package ru.ulstu.grant.model;
|
||||||
|
|
||||||
|
import ru.ulstu.grant.model.Grant;
|
||||||
|
|
||||||
public class GrantStatusDto {
|
public class GrantStatusDto {
|
||||||
private final String id;
|
private final String id;
|
||||||
private final String name;
|
private final String name;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
package ru.ulstu.grant.model.repository;
|
package ru.ulstu.grant.repository;
|
||||||
|
|
||||||
import org.springframework.data.jpa.repository.JpaRepository;
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
import ru.ulstu.grant.model.Grant;
|
import ru.ulstu.grant.model.Grant;
|
@ -1,4 +1,4 @@
|
|||||||
package ru.ulstu.grant.model.service;
|
package ru.ulstu.grant.service;
|
||||||
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@ -8,10 +8,9 @@ import ru.ulstu.deadline.service.DeadlineService;
|
|||||||
import ru.ulstu.file.service.FileService;
|
import ru.ulstu.file.service.FileService;
|
||||||
import ru.ulstu.grant.model.Grant;
|
import ru.ulstu.grant.model.Grant;
|
||||||
import ru.ulstu.grant.model.GrantDto;
|
import ru.ulstu.grant.model.GrantDto;
|
||||||
import ru.ulstu.grant.model.repository.GrantRepository;
|
import ru.ulstu.grant.repository.GrantRepository;
|
||||||
import ru.ulstu.project.model.Project;
|
import ru.ulstu.project.model.Project;
|
||||||
import ru.ulstu.project.model.ProjectDto;
|
import ru.ulstu.project.model.ProjectDto;
|
||||||
import ru.ulstu.project.repository.ProjectRepository;
|
|
||||||
import ru.ulstu.project.service.ProjectService;
|
import ru.ulstu.project.service.ProjectService;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@ -144,7 +143,7 @@ public class GrantService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public GrantDto findGrant(int id) {
|
public GrantDto findGrant(int id) {
|
||||||
return new ru.ulstu.grant.model.GrantDto(grantRepository.getOne(id));
|
return new GrantDto(grantRepository.getOne(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void closeFailedGrants() {
|
public void closeFailedGrants() {
|
@ -1,7 +1,6 @@
|
|||||||
package ru.ulstu.project.repository;
|
package ru.ulstu.project.repository;
|
||||||
|
|
||||||
import org.springframework.data.jpa.repository.JpaRepository;
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
import ru.ulstu.grant.model.Grant;
|
|
||||||
import ru.ulstu.project.model.Project;
|
import ru.ulstu.project.model.Project;
|
||||||
|
|
||||||
public interface ProjectRepository extends JpaRepository<Project, Integer> {
|
public interface ProjectRepository extends JpaRepository<Project, Integer> {
|
||||||
|
@ -1,28 +1,16 @@
|
|||||||
package ru.ulstu.project.service;
|
package ru.ulstu.project.service;
|
||||||
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import ru.ulstu.deadline.model.Deadline;
|
|
||||||
import ru.ulstu.deadline.service.DeadlineService;
|
import ru.ulstu.deadline.service.DeadlineService;
|
||||||
import ru.ulstu.file.service.FileService;
|
|
||||||
import ru.ulstu.grant.model.Grant;
|
|
||||||
import ru.ulstu.grant.model.GrantDto;
|
|
||||||
import ru.ulstu.grant.model.repository.GrantRepository;
|
|
||||||
import ru.ulstu.project.model.Project;
|
import ru.ulstu.project.model.Project;
|
||||||
import ru.ulstu.project.model.ProjectDto;
|
import ru.ulstu.project.model.ProjectDto;
|
||||||
import ru.ulstu.project.repository.ProjectRepository;
|
import ru.ulstu.project.repository.ProjectRepository;
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
import static org.springframework.util.ObjectUtils.isEmpty;
|
import static org.springframework.util.ObjectUtils.isEmpty;
|
||||||
import static ru.ulstu.core.util.StreamApiUtils.convert;
|
import static ru.ulstu.core.util.StreamApiUtils.convert;
|
||||||
import static ru.ulstu.grant.model.Grant.GrantStatus.APPLICATION;
|
|
||||||
import static ru.ulstu.grant.model.Grant.GrantStatus.IN_WORK;
|
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class ProjectService {
|
public class ProjectService {
|
||||||
|
Loading…
Reference in New Issue
Block a user