Skip to content

Commit

Permalink
Merge pull request #278 from team9502/dev
Browse files Browse the repository at this point in the history
배포
  • Loading branch information
daeundada authored Jul 1, 2024
2 parents 6b01865 + a258590 commit 7c82b9a
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import team9502.sinchulgwinong.domain.board.dto.request.BoardRequestDTO;
Expand Down Expand Up @@ -53,7 +54,7 @@ public BoardResponseDTO boardCreate(User user, BoardRequestDTO boardRequestDTO)
@Transactional(readOnly = true)
public BoardListResponseDTO getAllBoard(int page, int size) {

Pageable pageable = PageRequest.of(page, size);
Pageable pageable = PageRequest.of(page, size, Sort.by(Sort.Order.desc("boardId")));

Page<Board> boardPage = boardRepository.findAll(pageable);

Expand Down Expand Up @@ -124,7 +125,7 @@ public void boardDelete(Long boardId, User user) {
@Transactional(readOnly = true)
public BoardListResponseDTO getAllMyBoard(User user, int page, int size) {

Pageable pageable = PageRequest.of(page, size);
Pageable pageable = PageRequest.of(page, size, Sort.by(Sort.Order.desc("boardId")));

Page<Board> boardPage = boardRepository.findByUser_UserId(user.getUserId(), pageable);

Expand All @@ -146,7 +147,7 @@ public BoardListResponseDTO getAllMyBoard(User user, int page, int size) {
@Transactional(readOnly = true)
public BoardListResponseDTO getAllFindBoards(String boardTitle, int page, int size) {

Pageable pageable = PageRequest.of(page, size);
Pageable pageable = PageRequest.of(page, size, Sort.by(Sort.Order.desc("boardId")));

Page<Board> boardPage = boardRepository.findByBoardTitleContaining(
boardTitle, pageable);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import team9502.sinchulgwinong.domain.category.dto.request.JobCategoryRequestDTO;
Expand Down Expand Up @@ -50,7 +51,7 @@ public Set<String> getAllLocalityName(String regionName, String subRegionName) {
public JobBoardListResponseDTO getAllLocalityCategory(
JobLocalityCategoryRequestDTO jobLocalityCategoryRequestDTO, int page, int size) {

Pageable pageable = PageRequest.of(page, size);
Pageable pageable = PageRequest.of(page, size, Sort.by(Sort.Order.desc("jobBoardId")));

Locality locality = localityRepository.findByRegionNameAndSubRegionNameAndLocalityName(
jobLocalityCategoryRequestDTO.getRegionName(),
Expand Down Expand Up @@ -87,7 +88,7 @@ public Set<String> getAllMinorCategoryName(String minorCategoryName){
public JobBoardListResponseDTO getAllJobCategory(
JobCategoryRequestDTO jobCategoryRequestDTO, int page, int size){

Pageable pageable = PageRequest.of(page, size);
Pageable pageable = PageRequest.of(page, size, Sort.by(Sort.Order.desc("jobBoardId")));

JobCategory jobCategory =
jobCategoryRepository.findByMajorCategoryNameAndMinorCategoryName(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
Expand Down Expand Up @@ -166,7 +167,7 @@ public BoardImage saveImageBo(MultipartFile multipartFile, JobBoard jobBoard) {
@Transactional(readOnly = true)
public JobBoardListResponseDTO getAllJobBoards(int page, int size) {

Pageable pageable = PageRequest.of(page, size);
Pageable pageable = PageRequest.of(page, size, Sort.by(Sort.Order.desc("jobBoardId")));

Page<JobBoard> jobBoardPage = jobBoardRepository.findAll(pageable);

Expand Down Expand Up @@ -302,7 +303,7 @@ public void deleteJobBoard(Long cpUserId, Long jobBoardId) {
@Transactional(readOnly = true)
public JobBoardListResponseDTO getAllMyJobBoards(Long cpUserId, int page, int size) {

Pageable pageable = PageRequest.of(page, size);
Pageable pageable = PageRequest.of(page, size, Sort.by(Sort.Order.desc("jobBoardId")));

Page<JobBoard> jobBoardPage = jobBoardRepository.findByCompanyUser_CpUserId(cpUserId, pageable);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import team9502.sinchulgwinong.domain.board.dto.response.BoardListResponseDTO;
Expand Down Expand Up @@ -70,7 +71,7 @@ public boolean scrapCreateBoard(Long boardId, User user) {
@Transactional(readOnly = true)
public BoardListResponseDTO getAllScraps(User user, int page, int size) {

Pageable pageable = PageRequest.of(page, size);
Pageable pageable = PageRequest.of(page, size, Sort.by(Sort.Order.desc("scrapId")));

Page<BoardScrap> boardScrapPage = boardScrapsRepository.findByUser_UserId(user.getUserId(), pageable);

Expand Down Expand Up @@ -120,7 +121,7 @@ public boolean scrapCreateJobBoard(Long jobBoardId, User user) {
@Transactional(readOnly = true)
public JobBoardListResponseDTO getAllJobBoards(User user, int page, int size) {

Pageable pageable = PageRequest.of(page, size);
Pageable pageable = PageRequest.of(page, size, Sort.by(Sort.Order.desc("jobScrapId")));

Page<JobScrap> jobScrapPage = jobScrapRepository.findByUser_UserId(user.getUserId(), pageable);

Expand Down Expand Up @@ -168,7 +169,7 @@ public boolean cpUserScrapCreate(User user, Long cpUserId) {
@Transactional(readOnly = true)
public CpUserScrapListResponseDTO getAllCpUserScrap(User user, int page, int size) {

Pageable pageable = PageRequest.of(page, size);
Pageable pageable = PageRequest.of(page, size, Sort.by(Sort.Order.desc("cpUserScrapId")));

Page<CpUserScrap> cpUserScrapPage = cpUserScrapRepository.findByUser_UserId(user.getUserId(), pageable);

Expand Down

0 comments on commit 7c82b9a

Please sign in to comment.