Skip to content

Commit

Permalink
Merge branch 'dev' into feat/clean-up-code
Browse files Browse the repository at this point in the history
  • Loading branch information
donsonioc2010 committed Sep 25, 2023
2 parents 155c100 + 2a183d7 commit 3047ee7
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public class PictureController {
*/
@GetMapping("/new")
public String createForm(HttpSession session, Model model) {
if(session.getAttribute("loginUser") == null){
if (session.getAttribute("loginUser") == null) {
throw NotFoundException.EXCEPTION;
}
model.addAttribute("PictureDTO", new PictureDTO());
Expand All @@ -53,14 +53,14 @@ public String createForm(HttpSession session, Model model) {

/**
* 경매품 등록
*
* @param requestDto
* @param model
* @param session
* @return
*/
@PostMapping
public String add(PictureDTO requestDto, Model model, HttpSession session) {

User sessionUser = (User) session.getAttribute("loginUser");
if (sessionUser == null) {
return "redirect:/auth/login"; //로그인 페이지로
Expand Down Expand Up @@ -98,10 +98,11 @@ public String add(PictureDTO requestDto, Model model, HttpSession session) {

/**
* 게시물 리스트 조회
*
* @param model
* @param page 조회할 페이지 Number
* @param page 조회할 페이지 Number
* @param pageSize 한번에 조회할 Size
* @param status 조회를 희망하는 경매품의 Status
* @param status 조회를 희망하는 경매품의 Status
* @return
*/
@GetMapping("/list")
Expand All @@ -123,13 +124,14 @@ public String imgUrls(Model model,

/**
* 게시물의 상세페이지 조회
*
* @param id
* @param model
* @return
*/
@GetMapping("/{id}")
public String viewPictureDetail(@PathVariable Long id, Model model) {
model.addAttribute("picture", pictureService.getPictureById(id).orElseThrow(()->NotFoundException.EXCEPTION));
model.addAttribute("picture", pictureService.getPictureById(id).orElseThrow(() -> NotFoundException.EXCEPTION));
return "pictures/pictureDetail";
}
}

0 comments on commit 3047ee7

Please sign in to comment.