Skip to content

Commit

Permalink
[feature/Inhabas#241] 프로젝트 게시판 리뷰 반영
Browse files Browse the repository at this point in the history
  • Loading branch information
skytin1004 committed Mar 15, 2024
1 parent 69e45a2 commit f1bbf7f
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 29 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.inhabas.api.domain.project.domain;
package com.inhabas.api.domain.board.domain;

public enum PinOption {
DISABLED(0),
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
package com.inhabas.api.domain.normalBoard.usecase;

import static com.inhabas.api.domain.board.domain.PinOption.*;
import static com.inhabas.api.domain.normalBoard.domain.NormalBoardType.*;
import static com.inhabas.api.domain.normalBoard.domain.NormalBoardType.EXECUTIVE;
import static com.inhabas.api.domain.normalBoard.domain.NormalBoardType.NOTICE;
import static com.inhabas.api.domain.normalBoard.domain.PinOption.*;

import java.time.LocalDateTime;
import java.util.*;
import java.util.stream.Collectors;

import javax.transaction.Transactional;

import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;

import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.inhabas.api.auth.domain.error.authException.InvalidAuthorityException;
import com.inhabas.api.auth.domain.error.businessException.InvalidInputException;
Expand All @@ -40,7 +39,6 @@

@Service
@Slf4j
@Transactional
@RequiredArgsConstructor
public class NormalBoardServiceImpl implements NormalBoardService {

Expand All @@ -55,6 +53,7 @@ public class NormalBoardServiceImpl implements NormalBoardService {
private static final Integer TEMPORARY_DAYS = 14;

@Override
@Transactional(readOnly = true)
public List<NormalBoardDto> getPinned(NormalBoardType boardType) {
List<NormalBoardDto> normalBoardList = new ArrayList<>();
if (boardType.equals(NOTICE) || boardType.equals(EXECUTIVE)) {
Expand All @@ -64,6 +63,7 @@ public List<NormalBoardDto> getPinned(NormalBoardType boardType) {
}

@Override
@Transactional(readOnly = true)
public List<NormalBoardDto> getPosts(NormalBoardType boardType, String search) {
List<NormalBoardDto> normalBoardList = new ArrayList<>();
if (boardType.equals(SUGGEST)) {
Expand All @@ -80,6 +80,7 @@ public List<NormalBoardDto> getPosts(NormalBoardType boardType, String search) {
}

@Override
@Transactional(readOnly = true)
public NormalBoardDetailDto getPost(Long memberId, NormalBoardType boardType, Long boardId) {
NormalBoard normalBoard;
if (boardType.equals(SUGGEST)) {
Expand Down Expand Up @@ -112,6 +113,7 @@ public NormalBoardDetailDto getPost(Long memberId, NormalBoardType boardType, Lo
}

@Override
@Transactional
public Long write(
Long memberId, NormalBoardType boardType, SaveNormalBoardDto saveNormalBoardDto) {

Expand All @@ -128,6 +130,7 @@ public Long write(
}

@Override
@Transactional
public void update(
Long boardId, NormalBoardType boardType, SaveNormalBoardDto saveNormalBoardDto) {

Expand All @@ -138,6 +141,7 @@ public void update(
}

@Override
@Transactional
public void delete(Long boardId) {
normalBoardRepository.deleteById(boardId);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import com.inhabas.api.domain.menu.domain.Menu;

@Entity
@Table(name = "NORMAL_BOARD")
@Table(name = "PROJECT_BOARD")
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@EntityListeners(AuditingEntityListener.class)
@Inheritance(strategy = InheritanceType.JOINED)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.inhabas.api.domain.project.usecase;

import static com.inhabas.api.domain.project.domain.PinOption.PERMANENT;
import static com.inhabas.api.domain.project.domain.PinOption.TEMPORARY;
import static com.inhabas.api.domain.board.domain.PinOption.PERMANENT;
import static com.inhabas.api.domain.board.domain.PinOption.TEMPORARY;
import static com.inhabas.api.domain.project.domain.ProjectBoardType.ALPHA;
import static com.inhabas.api.domain.project.domain.ProjectBoardType.BETA;

Expand All @@ -13,12 +13,11 @@
import java.util.Set;
import java.util.stream.Collectors;

import javax.transaction.Transactional;

import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.inhabas.api.auth.domain.error.businessException.InvalidInputException;
import com.inhabas.api.auth.domain.error.businessException.NotFoundException;
Expand All @@ -42,7 +41,6 @@

@Service
@Slf4j
@Transactional
@RequiredArgsConstructor
public class ProjectBoardServiceImpl implements ProjectBoardService {

Expand All @@ -57,6 +55,7 @@ public class ProjectBoardServiceImpl implements ProjectBoardService {
private static final Integer TEMPORARY_DAYS = 14;

@Override
@Transactional
public List<ProjectBoardDto> getPinned(ProjectBoardType projectboardType) {
List<ProjectBoardDto> projectBoardList = new ArrayList<>();
if (projectboardType.equals(ALPHA) || projectboardType.equals(BETA)) {
Expand All @@ -66,6 +65,7 @@ public List<ProjectBoardDto> getPinned(ProjectBoardType projectboardType) {
}

@Override
@Transactional(readOnly = true)
public List<ProjectBoardDto> getPosts(ProjectBoardType projectBoardType, String search) {
List<ProjectBoardDto> projectBoardList = new ArrayList<>();
projectBoardList.addAll(
Expand All @@ -74,6 +74,7 @@ public List<ProjectBoardDto> getPosts(ProjectBoardType projectBoardType, String
}

@Override
@Transactional(readOnly = true)
public ProjectBoardDetailDto getPost(
Long memberId, ProjectBoardType projectBoardType, Long boardId) {
ProjectBoard projectBoard;
Expand All @@ -100,6 +101,7 @@ public ProjectBoardDetailDto getPost(
}

@Override
@Transactional
public Long write(
Long memberId, ProjectBoardType projectBoardType, SaveProjectBoardDto saveProjectBoardDto) {

Expand All @@ -117,6 +119,7 @@ public Long write(
}

@Override
@Transactional
public void update(
Long boardId, ProjectBoardType projectBoardType, SaveProjectBoardDto saveProjectBoardDto) {

Expand All @@ -127,6 +130,7 @@ public void update(
}

@Override
@Transactional
public void delete(Long boardId) {
projectBoardRepository.deleteById(boardId);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ private String jsonOf(Object response) throws JsonProcessingException {
return objectMapper.writeValueAsString(response);
}

@DisplayName("게시판 종류 당 글 개수 조회 성공 200")
@DisplayName("프로젝트 게시판 종류 당 글 개수 조회 성공 200")
@Test
void getBoardCount_Success() throws Exception {
// given
Expand Down

0 comments on commit f1bbf7f

Please sign in to comment.