Skip to content

Commit

Permalink
Merge branch 'dev' of github.com:leeeeeyeon/artistack-server into fea…
Browse files Browse the repository at this point in the history
  • Loading branch information
leeeeeyeon committed Aug 24, 2022
2 parents 5a674f0 + 112179e commit 4469a02
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 17 deletions.
19 changes: 13 additions & 6 deletions src/main/java/com/artistack/project/service/ProjectService.java
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public Page<ProjectDto> getMyWithPaging(Pageable pageable) {
// 프로젝트 정보 조회
public ProjectDto getById(Long projectId) {

if(projectRepository.findById(projectId).isEmpty()) {
if (projectRepository.findById(projectId).isEmpty()) {
throw new GeneralException(Code.PROJECT_NOT_FOUND, "프로젝트를 찾을 수 없습니다.");
}

Expand Down Expand Up @@ -242,9 +242,12 @@ public List<UserDto> getPrevStackers(Long projectId, Boolean current, Boolean se
Project project = projectRepository.findById(prevProjectId)
.orElseThrow(() -> new GeneralException(Code.PROJECT_NOT_FOUND, "프로젝트를 찾을 수 없습니다."));

UserDto userDto = getSearchStackResponse(project.getId());
stackers.add(userDto);

if (project.getScope().equals(Scope.DELETED)) {
stackers.add(UserDto.builder().project(ProjectDto.builder().scope(Scope.DELETED).build()).build());
} else {
UserDto userDto = getSearchStackResponse(project.getId());
stackers.add(userDto);
}
prevProjectId = project.getPrevProjectId();
}

Expand All @@ -266,8 +269,12 @@ public List<UserDto> getPrevStackers(Long projectId, Boolean current, Boolean se
Project project = projectRepository.findById(prevProjectId)
.orElseThrow(() -> new GeneralException(Code.PROJECT_NOT_FOUND, "프로젝트를 찾을 수 없습니다."));

UserDto userDto = getStackResponse(project.getId());
stackers.add(userDto);
if (project.getScope().equals(Scope.DELETED)) {
stackers.add(UserDto.builder().project(ProjectDto.builder().scope(Scope.DELETED).build()).build());
} else {
UserDto userDto = getStackResponse(project.getId());
stackers.add(userDto);
}

prevProjectId = project.getPrevProjectId();
}
Expand Down
18 changes: 7 additions & 11 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
server.port=8080

spring.jpa.show-sql=true
# profile
spring.profiles.include=dev

spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL8Dialect
#spring.jpa.properties.hibernate.dialect.storage_engine=innodb
#spring.datasource.hikari.jdbc-url=jdbc:h2:mem://localhost/~/testdb;MODE=MYSQL
#
#spring.h2.console.enabled=true
#spring.datasource.generate-unique-name=false

spring.datasource.driver-class-name=org.h2.Driver
spring.datasource.url=jdbc:h2:mem://localhost/~/testdb
# port
server.port=8080

logging.level.com.artistack=trace
# test
server.servlet.encoding.force-response=true

# aws
cloud.aws.region.static=ap-northeast-2
cloud.aws.s3.bucket=artistack-bucket

Expand Down

0 comments on commit 4469a02

Please sign in to comment.