Skip to content

Commit

Permalink
Merge pull request #27 from Work-Plate/develop
Browse files Browse the repository at this point in the history
Deploy
  • Loading branch information
sayyyho authored Nov 20, 2024
2 parents ab0ffa8 + 4e94bc8 commit 216b48b
Show file tree
Hide file tree
Showing 78 changed files with 504 additions and 157 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ dist-ssr
*.njsproj
*.sln
*.sw?
.env
91 changes: 91 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"dependencies": {
"@emotion/react": "^11.13.3",
"@emotion/styled": "^11.13.0",
"axios": "^1.7.7",
"jotai": "^2.10.2",
"react": "^18.3.1",
"react-dom": "^18.3.1",
Expand Down
Binary file added public/foodMainImage/Foodlists1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 0 additions & 28 deletions public/foodMainImage/Foodlists1.svg

This file was deleted.

Binary file added public/foodMainImage/Foodlists2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/foodMainImage/Foodlists3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/foodMainImage/Foodlists4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/foodMainImage/aroundFood2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/foodMainImage/aroundFood3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/foodMainImage/aroundFood4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/popularWork/popularWork1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/popularWork/popularWork10.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/popularWork/popularWork11.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/popularWork/popularWork12.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/popularWork/popularWork13.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/popularWork/popularWork14.png
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
Binary file added public/images/popularWork/popularWork16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/popularWork/popularWork2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/popularWork/popularWork3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/popularWork/popularWork4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/popularWork/popularWork5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/popularWork/popularWork6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/popularWork/popularWork7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/popularWork/popularWork8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/popularWork/popularWork9.png
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
Binary file added public/images/recommendWork/recommendWork10.png
Binary file added public/images/recommendWork/recommendWork11.png
Binary file added public/images/recommendWork/recommendWork12.png
Binary file added public/images/recommendWork/recommendWork13.png
Binary file added public/images/recommendWork/recommendWork14.png
Binary file added public/images/recommendWork/recommendWork15.png
Binary file added public/images/recommendWork/recommendWork16.png
Binary file added public/images/recommendWork/recommendWork2.png
Binary file added public/images/recommendWork/recommendWork3.png
Binary file added public/images/recommendWork/recommendWork4.png
Binary file added public/images/recommendWork/recommendWork5.png
Binary file added public/images/recommendWork/recommendWork6.png
Binary file added public/images/recommendWork/recommendWork7.png
Binary file added public/images/recommendWork/recommendWork8.png
Binary file added public/images/recommendWork/recommendWork9.png
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Binary file added public/images/work/work5.png
Binary file added public/images/work/work6.png
Binary file added public/images/work/work7.png
Binary file added public/images/work/work8.png
9 changes: 9 additions & 0 deletions src/apis/aiInstance.js
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",
},
});
21 changes: 21 additions & 0 deletions src/apis/chatbot.js
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;
}
};
24 changes: 24 additions & 0 deletions src/apis/instance.js
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);
}
);
17 changes: 17 additions & 0 deletions src/apis/restaurants.js
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;
}
};
25 changes: 25 additions & 0 deletions src/apis/uuid.js
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 added src/apis/workd.js
Empty file.
19 changes: 19 additions & 0 deletions src/apis/works.js
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;
}
};
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const ChatScrollBox = forwardRef(({ children }, ref) => {
color="#0C0E27"
weight="500"
align="left"
margin="1.6rem 0 0 1rem"
margin="5.3rem 0 0 1rem"
>
안녕하세요! 만나서 반갑습니다. <br />
밥상일터 사용을 도와드릴게요.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import styled from "@emotion/styled";

export const ScrollBoxContainers = styled.div`
width: 100%;
height: 77vh; // Header UserInput의 높이 제외
height: 90vh; // Header UserInput의 높이 제외
padding: 0;
box-sizing: border-box;
overflow-y: auto; // 스크롤 가능
Expand Down
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;
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);
}
`;
Loading

0 comments on commit 216b48b

Please sign in to comment.