Skip to content

Commit

Permalink
Merge pull request #31 from siwonKH/main
Browse files Browse the repository at this point in the history
Refactor: separate api and web
  • Loading branch information
siwonkh authored Jun 28, 2023
2 parents 58fb62b + 24c7cdb commit 9bfbfd4
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.khpt.projectkim.controller;
package com.khpt.projectkim.controller.api;

import com.khpt.projectkim.dto.ChatData;
import org.springframework.web.bind.annotation.*;
Expand All @@ -9,7 +9,7 @@

@RestController
@RequestMapping("/chat")
public class ChatApiController {
public class ChatRestController {
@PostMapping
public ChatData sendChat(HttpSession session, @RequestBody List<ChatData> chatDataList) {
// TODO API 요청으로 responseChat 가져오기
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.khpt.projectkim.controller;
package com.khpt.projectkim.controller.api;

import com.khpt.projectkim.dto.ResultDto;
import org.springframework.web.bind.annotation.GetMapping;
Expand All @@ -11,9 +11,9 @@

@RestController
@RequestMapping("/result")
public class ResultApiController {
public class ResultRestController {
@GetMapping
public List<ResultDto> getChats(HttpSession session) {
public List<ResultDto> getResult_test(HttpSession session) {
ResultDto responseChat1 = new ResultDto("https://google.com", "comp", "제목", "지역", "대충급여", "대충형태", "대충시간", "몰?루", "경력");
ResultDto responseChat2 = new ResultDto("https://google.com", "comp2", "제목2", "지역2", "대충급여2", "대충형태22", "대충시간22", "몰?루22", "경력22");
ResultDto responseChat3 = new ResultDto("https://google.com", "comp3", "제목3", "지역3", "대충급여3", "대충형태33", "대충시간33", "몰?루33", "경력33");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package com.khpt.projectkim.controller;
package com.khpt.projectkim.controller.web;

import com.khpt.projectkim.dto.ExtractListFromUserDto;
import com.khpt.projectkim.entity.User;
import com.khpt.projectkim.service.ChatService;
import com.khpt.projectkim.service.UserService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
Expand All @@ -18,8 +17,6 @@ public class ChatController {

private final ChatService chatService;

private final UserService userService;

@ModelAttribute
public void addAttributes(HttpServletRequest request, Model model) {
model.addAttribute("current_url", request.getRequestURL().toString());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.khpt.projectkim.controller;
package com.khpt.projectkim.controller.web;
import java.io.IOException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.khpt.projectkim.controller;
package com.khpt.projectkim.controller.web;

import com.khpt.projectkim.entity.User;
import org.springframework.stereotype.Controller;
Expand All @@ -23,6 +23,6 @@ public String index(HttpSession session, Model model) {
public String test(Model model) {
Date date = new Date();
model.addAttribute("date", date);
return "chatTest.mustache";
return "chatTest";
}
}

0 comments on commit 9bfbfd4

Please sign in to comment.