Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/176/swagger #179

Merged
merged 43 commits into from
Aug 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
411f1b7
chore: private 일정 조회 요청 url 수정
kanghaeun Jul 24, 2024
6a9af5b
feat: 최상위컴포넌트로 일정조회 데이터 이동
kanghaeun Jul 24, 2024
a1dbfc3
feat: 현재 필터링 된 이벤트 목록 저장 및 현재 활성화된 필터들 추적
kanghaeun Jul 24, 2024
e7339ca
feat: 일정 생성 시 filterId 값 전달
mlnwns Jul 24, 2024
7bf16d1
Merge pull request #155 from JNU-econovation/BE
capDoYeonLee Jul 24, 2024
c143f1e
Merge pull request #156 from JNU-econovation/feat/153/create-schedule
mlnwns Jul 24, 2024
664d10a
Merge pull request #157 from JNU-econovation/FE
mlnwns Jul 24, 2024
b476587
feat: 필터링에 따른 일정 조회 기능 추가
kanghaeun Jul 24, 2024
025f3a7
feat: 로그인 시 배포링크로 이동하게끔 코드 수정
kanghaeun Jul 24, 2024
7b15216
Merge pull request #158 from JNU-econovation/feat/148/filtering-view
kanghaeun Jul 24, 2024
ab3015f
Merge pull request #159 from JNU-econovation/FE
kanghaeun Jul 24, 2024
68e532f
Merge pull request #161 from JNU-econovation/BE
capDoYeonLee Jul 25, 2024
56c3f46
feat: 일정 조회 모달 이전 데이터 불러와지는 문제 해결
mlnwns Jul 25, 2024
286658b
fix: 시간 선택 오후도 가능하도록 수정
mlnwns Jul 25, 2024
e8d5ede
Merge pull request #163 from JNU-econovation/BE
capDoYeonLee Jul 25, 2024
6c0a5f4
feat: 퍼블릭 필터에도 filterList 추가
kanghaeun Jul 25, 2024
4325fb9
Merge pull request #165 from JNU-econovation/BE
capDoYeonLee Jul 25, 2024
8d44b24
feat: 일정 생성 바로 반영되도록 새로고침 코드 추가
mlnwns Jul 25, 2024
d9d4cea
feat: 로딩 시 공룡 이미지 업로드
mlnwns Jul 25, 2024
efe1a91
chore: 공룡 이미지 추가
mlnwns Jul 25, 2024
dec5e8a
style: 필터 색상 변경
mlnwns Jul 25, 2024
50ac87e
feat: 로그아웃 시 새로고침
mlnwns Jul 25, 2024
628494f
style: hover시 색상 변경
mlnwns Jul 25, 2024
ea2aa4e
Merge pull request #167 from JNU-econovation/FE
mlnwns Jul 25, 2024
c918ed7
feat: 필터 삭제 기능
kanghaeun Jul 25, 2024
f1b7cc9
style: s-dot 적용
kanghaeun Jul 25, 2024
e163347
Merge branch 'FE' of https://github.com/JNU-econovation/econo-error i…
kanghaeun Jul 25, 2024
148683e
Merge pull request #168 from JNU-econovation/FE
kanghaeun Jul 25, 2024
ebf55b8
chore: 파일 이름 변경
mlnwns Jul 26, 2024
2ba1e11
Merge branch 'FE' of https://github.com/JNU-econovation/econo-error i…
mlnwns Jul 26, 2024
79c0704
Merge pull request #169 from JNU-econovation/FE
mlnwns Jul 26, 2024
a20dd87
chore: 로그인 페이지로 이동하는 코드 추가
mlnwns Jul 26, 2024
9cba606
feat: 로그인 경로 수정
kanghaeun Jul 26, 2024
3c091b6
Merge branch 'FE' of https://github.com/JNU-econovation/econo-error i…
kanghaeun Jul 26, 2024
8240d14
Merge pull request #170 from JNU-econovation/FE
kanghaeun Jul 26, 2024
ad1622a
style: 필터 색상 변경
mlnwns Jul 26, 2024
de0698d
Merge branch 'FE' of https://github.com/JNU-econovation/econo-error i…
mlnwns Jul 26, 2024
1fa97d4
Merge pull request #171 from JNU-econovation/FE
mlnwns Jul 26, 2024
822b5ae
feat: 필터 수정 기능 연동
mlnwns Jul 26, 2024
75bdc62
Merge pull request #172 from JNU-econovation/FE
mlnwns Jul 26, 2024
00fdd24
Merge pull request #174 from JNU-econovation/BE
capDoYeonLee Jul 26, 2024
4a5d086
feat: 아키텍처 amd64로 수정 후 빌드 스크립트 작성
capDoYeonLee Aug 10, 2024
cdfd3e2
feat: swagger config 작성
capDoYeonLee Aug 10, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions BE/error/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM openjdk:17-oracle
#FROM openjdk:17-oracle
FROM --platform=linux/amd64 openjdk:17-oracle
RUN mkdir -p /logs

ENV PROFILE defaultgi
Expand All @@ -11,4 +12,4 @@ ENV DD_VERSION=${RELEASE_VERSION}

ARG JAR_FILE="./build/libs/*.jar"
COPY ${JAR_FILE} app.jar
ENTRYPOINT ["java", "-jar", "/app.jar"]
ENTRYPOINT ["java", "-jar", "/app.jar"]
21 changes: 21 additions & 0 deletions BE/error/src/main/java/com/example/demo/config/SwaggerConfig.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package com.example.demo.config;


import io.swagger.v3.oas.models.Components;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Info;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class SwaggerConfig {

@Bean
public OpenAPI openAPI() {
return new OpenAPI().components(new Components()).info(apiInfo());
}

private Info apiInfo() {
return new Info().title("ERROR API").description("ERROR Swagger").version("2.0.0");
}
}
Binary file added FE/error/public/image80.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
43 changes: 10 additions & 33 deletions FE/error/src/components/EconoCalendar.jsx
Original file line number Diff line number Diff line change
@@ -1,48 +1,23 @@
import { useEffect, useState } from "react";
import { useState } from "react";
import toast, { Toaster } from "react-hot-toast";
import FullCalendar from "@fullcalendar/react";
import dayGridPlugin from "@fullcalendar/daygrid";
import styled from "styled-components";
import interactionPlugin from "@fullcalendar/interaction";
import axios from "axios";
import CreateModal from "./scheduleCreate/CreateModal";
import CheckCalendar from "./scheduleCheck/CheckCalendar";

const EconoCalendar = ({ isLoggedIn, setIsLoggedIn }) => {
const [events, setEvents] = useState([]);
const EconoCalendar = ({
isLoggedIn,
setIsLoggedIn,
setEvents,
events,
setToken,
}) => {
const [selectID, setSelectID] = useState("");
const [checkModalIsOpen, setCheckModalIsOpen] = useState(false);
const [createModalIsOpen, setCreateModalIsOpen] = useState(false);
const [selectedDate, setSelectedDate] = useState("");
const [token, setToken] = useState(null);

useEffect(() => {
const storedToken = localStorage.getItem("slackToken");
setToken(storedToken);

const isUserLoggedIn = !!storedToken;
setIsLoggedIn(isUserLoggedIn);

const uri = isUserLoggedIn
? "/api/calendar/all"
: "/api/calendar/all/public";

axios
.get(uri, { headers: { Authorization: `Bearer ${storedToken}` } })
.then((res) => {
const fetchedEvents = res.data.data.map((event) => ({
title: event.eventName,
id: event.eventId,
start: event.eventStartDate.split("T")[0],
end: event.eventEndDate.split("T")[0],
color: "#FFC0CB",
}));
setEvents(fetchedEvents);
})
.catch((error) => {
console.error("Error fetching events:", error);
});
}, []);

const handleDelete = () => {
toast("일정이 삭제되었습니다", {
Expand Down Expand Up @@ -86,13 +61,15 @@ const EconoCalendar = ({ isLoggedIn, setIsLoggedIn }) => {
localStorage.removeItem("slackToken");
setIsLoggedIn(false);
setToken(null);
window.location.reload();
// } else {
// const newToken = "dummyToken" + Math.random().toString(36).substr(2, 9); // 임의의 토큰 생성
// localStorage.setItem("slackToken", newToken);
// setToken(newToken);
// setIsLoggedIn(true);
// }
//TODO: 추후 아래 코드로 변경
//}
} else {
window.location.href = "/login";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const IndividualFilter = ({
filterLists,
addNewFilter,
updateDeleteFilter,
onFilterChange,
}) => {
const [individualFilterIsOpen, setindividualFilterIsOpen] = useState(false);
const [filterListsIsOpen, setFilterListsIsOpen] = useState(true);
Expand Down Expand Up @@ -69,6 +70,7 @@ const IndividualFilter = ({
<FilterList
filterLists={filterLists}
updateDeleteFilter={updateDeleteFilter}
onFilterChange={onFilterChange}
/>
)}
</>
Expand Down
4 changes: 2 additions & 2 deletions FE/error/src/components/SideBar/publicFilter/PublicFilter.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ const PublicFilter = () => {
<div style={{ fontSize: "1.1rem" }}>에코노 캘린더</div>
</div>
<StyledSceduleType>
<ScheduleToggle color={"#ff5b5b"} />
<ScheduleToggle color={"#FF968A"} />
공식행사
</StyledSceduleType>
<StyledSceduleType>
<ScheduleToggle color={"#63ABFF"} />
<ScheduleToggle color={"#ffd4b5"} />
주간발표
</StyledSceduleType>
</StyledPublicFilterFrame>
Expand Down
53 changes: 28 additions & 25 deletions FE/error/src/components/scheduleCheck/CheckCalendar.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useEffect, useState, useRef } from "react";
import { useEffect, useState } from "react";
import { GoPencil } from "react-icons/go";
import { IoClose } from "react-icons/io5";
import { MdOutlineLocationOn } from "react-icons/md";
Expand Down Expand Up @@ -36,29 +36,27 @@ const CheckCalendar = ({
setEvent(specificEvent);
}

const isMount = useRef(false);
useEffect(() => {
if (!isMount.current) {
isMount.current = true;
return;
}
if (isOpen && selectID) {
setEvent({}); // 새로운 데이터 로딩 전에 event 상태 초기화

axios
.get("/api/calendar/" + selectID, {
headers: { Authorization: `Bearer ${storedToken}` },
})
.then((res) => {
createDate(
res.data.data.eventName,
res.data.data.eventStartDate,
res.data.data.eventEndDate,
res.data.data.eventPlace,
res.data.data.eventInfo,
res.data.data.eventType,
res.data.data.filterColor
);
});
}, [selectID]);
axios
.get("/api/calendar/" + selectID, {
headers: { Authorization: `Bearer ${storedToken}` },
})
.then((res) => {
createDate(
res.data.data.eventName,
res.data.data.eventStartDate,
res.data.data.eventEndDate,
res.data.data.eventPlace,
res.data.data.eventInfo,
res.data.data.eventType,
res.data.data.filterColor
);
});
}
}, [selectID, isOpen, storedToken]);

function date(startDate, endDate) {
if (!startDate && !endDate) return "날짜 정보 없음";
Expand All @@ -75,15 +73,20 @@ const CheckCalendar = ({
} ${endDate.split("T")[1]}`;
}

const handleRequestClose = () => {
setEvent({});
onRequestClose();
};

return (
<Modal
isOpen={isOpen}
onRequestClose={onRequestClose}
onRequestClose={handleRequestClose}
className="CheckModal"
overlayClassName="overlay"
>
<ModalBar>
<button onClick={onRequestClose}>
<button onClick={handleRequestClose}>
<IoClose size="2rem" color="rgb(95, 99, 104)" />
</button>
<StyledModifyIcon>
Expand All @@ -97,7 +100,7 @@ const CheckCalendar = ({
events={events}
selectID={selectID}
handleDelete={handleDelete}
onRequestClose={onRequestClose}
onRequestClose={handleRequestClose}
handleUpdateDeleteData={handleUpdateDeleteData}
/>
</ModalBar>
Expand Down
58 changes: 38 additions & 20 deletions FE/error/src/components/scheduleCreate/CreateModal.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useState, useEffect } from "react";
import { format, addDays, compareAsc, parseISO } from "date-fns";
import { format, addDays } from "date-fns";
import axios from "axios";
import Modal from "react-modal";
import styled from "styled-components";
Expand Down Expand Up @@ -66,7 +66,7 @@ const CreateModal = ({
};

const isFilterSelected = () => {
return selectedFilter && selectedFilter.category && selectedFilter.filter;
return selectedFilter && selectedFilter.category && selectedFilter.filterId;
};

const handleTitleChange = (event) => {
Expand Down Expand Up @@ -128,13 +128,13 @@ const CreateModal = ({
};

const handleFilterSelect = (category, filter) => {
setSelectedFilter({ category, filter });
setSelectedFilter({ category, ...filter });
setActiveDropdown(null);
};

const getButtonContent = (category) => {
if (selectedFilter && selectedFilter.category === category) {
return selectedFilter.filter;
return selectedFilter.filterName;
}
switch (category) {
case "public":
Expand Down Expand Up @@ -170,18 +170,16 @@ const CreateModal = ({
eventEndDate: eventEndDate,
eventPlace: eventPlace,
eventInfo: eventMemo,
scheduleType: selectedFilter.category,
filterName: selectedFilter.filter,
scheduleType: selectedFilter.category.toUpperCase(),
filter: {
filterId: selectedFilter.filterId,
},
};

axios
.post(
"/api/calendar",
{
headers: { Authorization: `Bearer ${storedToken}` },
},
data
)
.post("/api/calendar", data, {
headers: { Authorization: `Bearer ${storedToken}` },
})
.then((res) => {
createDate(
eventName,
Expand All @@ -190,6 +188,7 @@ const CreateModal = ({
eventEndDate
);
onRequestClose();
window.location.reload();
});
};

Expand Down Expand Up @@ -227,12 +226,22 @@ const CreateModal = ({
{category === "public" && (
<>
<DropdownItem
onClick={() => handleFilterSelect(category, "공식행사")}
onClick={() =>
handleFilterSelect(category, {
filterId: "public1",
filterName: "공식행사",
})
}
>
공식행사
</DropdownItem>
<DropdownItem
onClick={() => handleFilterSelect(category, "주간발표")}
onClick={() =>
handleFilterSelect(category, {
filterId: "public2",
filterName: "주간발표",
})
}
>
주간발표
</DropdownItem>
Expand All @@ -242,13 +251,21 @@ const CreateModal = ({
<>
<DropdownItem
onClick={() =>
handleFilterSelect(category, "28기 신입모집 TF")
handleFilterSelect(category, {
filterId: "group1",
filterName: "28기 신입모집 TF",
})
}
>
28기 신입모집 TF
</DropdownItem>
<DropdownItem
onClick={() => handleFilterSelect(category, "행사부")}
onClick={() =>
handleFilterSelect(category, {
filterId: "group2",
filterName: "행사부",
})
}
>
행사부
</DropdownItem>
Expand All @@ -258,9 +275,7 @@ const CreateModal = ({
privateFilters.map((filter) => (
<DropdownItem
key={filter.filterId}
onClick={() =>
handleFilterSelect(category, filter.filterName)
}
onClick={() => handleFilterSelect(category, filter)}
>
{filter.filterName}
</DropdownItem>
Expand Down Expand Up @@ -355,6 +370,9 @@ const SaveButton = styled.button`
&:disabled {
cursor: default;
}
&:hover {
background-color: #f5f5f5;
}
`;

const EditorBox = styled.div`
Expand Down
23 changes: 22 additions & 1 deletion FE/error/src/pages/LoginPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@ const LoginPage = () => {
};

if (isLoading) {
return <div>로그인 중...</div>;
return (
<LoadingContainer>
<LoadingImage src="/image80.png" alt="Loading" />
</LoadingContainer>
);
}

return (
Expand Down Expand Up @@ -128,3 +132,20 @@ const StyledCharacter = styled.img`
top: 25%;
left: 60%;
`;

const LoadingContainer = styled.div`
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
background-color: rgba(255, 255, 255, 0.8);
`;

const LoadingImage = styled.img`
width: 100px;
height: auto;
`;
Loading