-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27 from Work-Plate/develop
Deploy
- Loading branch information
Showing
78 changed files
with
504 additions
and
157 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,3 +22,4 @@ dist-ssr | |
*.njsproj | ||
*.sln | ||
*.sw? | ||
.env |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import axios from "axios"; | ||
|
||
export const aiInstance = axios.create({ | ||
baseURL: import.meta.env.VITE_AI_BASE_URL, | ||
withCredentials: false, | ||
headers: { | ||
"Content-Type": "application/json", | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { aiInstance } from "./aiInstance"; | ||
|
||
/** | ||
* 사용자 메시지를 AI 챗봇 서버로 전송 | ||
* @param {string} userMessage - 사용자 메시지 | ||
* @param {string} memberId - 사용자 ID | ||
* @returns {Promise<Object>} - AI 서버의 응답 데이터 | ||
*/ | ||
export const sendUserMessage = async (userMessage, memberId) => { | ||
try { | ||
const response = await aiInstance.post("/ai/chatbot", { | ||
user_message: userMessage, | ||
username: memberId, | ||
}); | ||
console.log(response.data); | ||
return response.data; // { task_type, text, additional_data } | ||
} catch (error) { | ||
console.error("AI 챗봇 서버와의 통신 오류:", error); | ||
throw error; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import axios from "axios"; | ||
|
||
export const instance = axios.create({ | ||
baseURL: import.meta.env.VITE_BASE_URL, | ||
withCredentials: false, | ||
headers: { | ||
"Content-Type": "application/json", | ||
}, | ||
}); | ||
|
||
// 요청 인터셉터 설정 | ||
instance.interceptors.request.use( | ||
(config) => { | ||
// access_token을 sessionStorage에서 가져와 헤더에 추가 | ||
const token = sessionStorage.getItem("access_token"); | ||
if (token) { | ||
config.headers.Authorization = `Bearer ${token}`; | ||
} | ||
return config; | ||
}, | ||
(error) => { | ||
return Promise.reject(error); | ||
} | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { instance } from "./instance"; | ||
|
||
export const getRestaurants = async () => { | ||
try { | ||
const response = await instance.get("/api/restaurants"); | ||
|
||
if (response.data.success) { | ||
return response.data.data; | ||
} else { | ||
console.error(response.data.message); | ||
return null; | ||
} | ||
} catch (error) { | ||
console.error(error); | ||
return null; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { instance } from "./instance"; | ||
import Cookies from "js-cookie"; | ||
|
||
export const getUUID = async (username) => { | ||
try { | ||
const response = await instance.get(`/user/uuid/${username}`, { | ||
headers: { | ||
Authorization: `Bearer ${sessionStorage.getItem("access_token")}`, | ||
}, | ||
}); | ||
|
||
const uuid = response.data.uuid; | ||
if (uuid) { | ||
// 받은 UUID를 쿠키에 저장 | ||
Cookies.set("uuid", uuid, { | ||
path: "/", | ||
secure: true, | ||
sameSite: "Strict", | ||
}); | ||
} | ||
} catch (err) { | ||
console.error(err); | ||
throw err; | ||
} | ||
}; |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { instance } from "./instance"; | ||
|
||
export const getWorks = async (id) => { | ||
try { | ||
const endpoint = id ? `/api/works/${id}` : "/api/works"; | ||
const response = await instance.get(endpoint); | ||
|
||
if (response.data.success) { | ||
console.log(response.data.data); | ||
return response.data.data; | ||
} else { | ||
console.error(response.data.message); | ||
return null; | ||
} | ||
} catch (error) { | ||
console.error(error); | ||
return null; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
src/components/chatBotPageComponent/chatbotInButton/ChatbotInButton.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { ButtonContainer } from "./ChatbotInButton.styled"; | ||
import { FaMicrophone } from "react-icons/fa"; | ||
import { useNavigate } from "react-router-dom"; | ||
|
||
const ChatbotInButton = () => { | ||
const navigate = useNavigate(); | ||
|
||
const handleClick = () => { | ||
navigate("/chatbot"); | ||
}; | ||
|
||
return ( | ||
<ButtonContainer onClick={handleClick}> | ||
<FaMicrophone /> | ||
</ButtonContainer> | ||
); | ||
}; | ||
|
||
export default ChatbotInButton; |
28 changes: 28 additions & 0 deletions
28
src/components/chatBotPageComponent/chatbotInButton/ChatbotInButton.styled.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import styled from "@emotion/styled"; | ||
|
||
// 버튼 컨테이너 스타일 | ||
export const ButtonContainer = styled.button` | ||
position: fixed; | ||
bottom: 6rem; | ||
right: 1rem; | ||
width: 80px; | ||
height: 80px; | ||
border-radius: 50%; | ||
background-color: #ff854c; | ||
border: none; | ||
box-shadow: 0px 8px 8px rgba(0, 0, 0, 0.1); | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
color: white; | ||
font-size: 30px; | ||
z-index: 1000; | ||
&:active { | ||
background-color: #e66122; | ||
transform: scale(0.95); | ||
} | ||
`; |
Oops, something went wrong.