Skip to content

Commit

Permalink
Merge pull request #463 from Kernel360/develop
Browse files Browse the repository at this point in the history
backend prod 서버 배포
  • Loading branch information
minson96 authored Mar 8, 2024
2 parents dcec230 + 2d49d0a commit bef3655
Showing 1 changed file with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,17 +1,5 @@
package kr.co.yigil.notice.interfaces.controller;

import kr.co.yigil.global.SortBy;
import kr.co.yigil.global.SortOrder;
import kr.co.yigil.notice.application.NoticeFacade;
import kr.co.yigil.notice.interfaces.dto.NoticeDto.NoticeCreateRequest;
import kr.co.yigil.notice.interfaces.dto.NoticeDto.NoticeCreateResponse;
import kr.co.yigil.notice.interfaces.dto.NoticeDto.NoticeDeleteResponse;
import kr.co.yigil.notice.interfaces.dto.NoticeDto.NoticeDetailResponse;
import kr.co.yigil.notice.interfaces.dto.NoticeDto.NoticeListResponse;
import kr.co.yigil.notice.interfaces.dto.NoticeDto.NoticeUpdateRequest;
import kr.co.yigil.notice.interfaces.dto.NoticeDto.NoticeUpdateResponse;
import kr.co.yigil.notice.interfaces.dto.mapper.NoticeMapper;
import lombok.RequiredArgsConstructor;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
Expand All @@ -20,13 +8,25 @@
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import kr.co.yigil.global.SortBy;
import kr.co.yigil.global.SortOrder;
import kr.co.yigil.notice.application.NoticeFacade;
import kr.co.yigil.notice.interfaces.dto.NoticeDto.NoticeCreateRequest;
import kr.co.yigil.notice.interfaces.dto.NoticeDto.NoticeCreateResponse;
import kr.co.yigil.notice.interfaces.dto.NoticeDto.NoticeDeleteResponse;
import kr.co.yigil.notice.interfaces.dto.NoticeDto.NoticeDetailResponse;
import kr.co.yigil.notice.interfaces.dto.NoticeDto.NoticeListResponse;
import kr.co.yigil.notice.interfaces.dto.NoticeDto.NoticeUpdateRequest;
import kr.co.yigil.notice.interfaces.dto.NoticeDto.NoticeUpdateResponse;
import kr.co.yigil.notice.interfaces.dto.mapper.NoticeMapper;
import lombok.RequiredArgsConstructor;

@Controller
@RequiredArgsConstructor
@RequestMapping("/api/v1/notices")
Expand All @@ -42,7 +42,7 @@ public ResponseEntity<NoticeListResponse> geNoticeList(
@RequestParam(name = "sortOrder", defaultValue = "desc", required = false) SortOrder sortOrder
){
PageRequest pageRequest = PageRequest.of(pageable.getPageNumber()-1, pageable.getPageSize(), Sort.by(
Direction.fromString(sortOrder.getValue()), sortBy.getValue()));
Sort.Direction.fromString(sortOrder.getValue()), sortBy.getValue()));
var notice = noticeFacade.getNoticeList(pageRequest);
var response = noticeMapper.toDto(notice);
return ResponseEntity.ok().body(response);
Expand Down

0 comments on commit bef3655

Please sign in to comment.