Skip to content

Commit

Permalink
Merge pull request #15 from FC-FINAL-TEAM-1/develop
Browse files Browse the repository at this point in the history
devlop → main 병합
  • Loading branch information
dev-meryoung authored Dec 11, 2024
2 parents 0e69dcf + 2f52238 commit baa0ca0
Show file tree
Hide file tree
Showing 52 changed files with 1,915 additions and 582 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Deploy to AWS EC2

on:
push:
branches:
- main # main 브랜치에 push할 때 실행

jobs:
deploy:
runs-on: ubuntu-latest

steps:
# 1. 리포지토리 체크아웃
- name: Checkout repository
uses: actions/checkout@v3

# 2. Node.js 설치 및 설정
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '18'

# 3. 프로젝트 빌드
- name: Install dependencies and build
env:
VITE_API_URL: ${{ secrets.VITE_API_URL }} # GitHub Secrets에서 API URL 가져오기
run: |
# Vite용 .env 파일 생성
echo "VITE_API_URL=${{ secrets.VITE_API_URL }}" > .env
# 의존성 설치 및 빌드
npm ci
npm run build
# 4. EC2 서버로 배포
- name: Deploy to EC2
env:
SSH_PRIVATE_KEY: ${{ secrets.EC2_SSH_KEY }} # EC2 접속을 위한 SSH Key
USER: ${{ secrets.EC2_USER }} # EC2 사용자 이름
HOST: ${{ secrets.EC2_HOST }} # EC2 서버 호스트
PATH: ${{ secrets.EC2_PATH }} # EC2 서버의 배포 경로
run: |
# SSH 키 설정
mkdir -p ~/.ssh
echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
# 임시 디렉토리 생성 및 빌드 파일 업로드
ssh -i ~/.ssh/id_rsa $USER@$HOST "mkdir -p $PATH-temp"
scp -i ~/.ssh/id_rsa -r dist/* $USER@$HOST:$PATH-temp
# 기존 폴더 백업 및 교체
ssh -i ~/.ssh/id_rsa $USER@$HOST "
mv $PATH $PATH-backup-$(date +%Y%m%d%H%M%S) || true &&
mv $PATH-temp $PATH
"
# 파일 권한 설정
ssh -i ~/.ssh/id_rsa $USER@$HOST "sudo chown -R www-data:www-data $PATH"
# 오래된 백업 삭제
ssh -i ~/.ssh/id_rsa $USER@$HOST "
find $PATH-backup-* -type d -mtime +7 -exec rm -rf {} +
"
18 changes: 16 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!doctype html>
<html lang="en">
<html lang="ko">
<head>
<!-- Google tag (gtag.js) -->
<script
Expand All @@ -16,8 +16,22 @@
</script>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta
name="description"
content="투자 전략 플랫폼, 시스메틱과 함께 하세요."
/>
<meta name="keywords" content="투자, 투자 전략, 금융 플랫폼, 시스메틱" />
<meta name="author" content="시스메틱" />
<meta property="og:title" content="투자 전략 플랫폼, 시스메틱" />
<meta
property="og:description"
content="투자 전략 플랫폼, 시스메틱과 함께 하세요."
/>
<meta property="og:image" content="/thumbnail.png" />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://sysmetic.kr" />
<link rel="icon" href="/favicon.ico" />
<title>Sysmetic</title>
<title>투자 전략 플랫폼, 시스메틱</title>
</head>
<body>
<div id="root"></div>
Expand Down
Binary file added public/thumbnail.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
119 changes: 73 additions & 46 deletions src/api/adminApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,13 @@ export interface StocksPutRequestProps {
file: File;
}

export interface AdminStrategyDtoProps {
openStatus?: string;
approvalStatus?: string;
keyword?: string;
page: number;
}

// 회원 목록 조회 API
export const getAdminUserList = async (userList: AdminUserData) => {
const queryParams = new URLSearchParams();
Expand Down Expand Up @@ -206,26 +213,17 @@ export const getAdminNotice = async (params: GetAdminNoticeData) => {
};

// 공지사항 수정 API
export const updateAdminNotice = async (
formData: FormData,
noticeId: string
) => {
const response = await axiosInstance.put(
`/v1/admin/notice/${noticeId}`,
formData,
{
headers: {
'Content-Type': 'multipart/form-data',
},
}
);
return response.data;
};
export const updateAdminNotice = async (formData: FormData, noticeId: string) =>
axiosInstance.put(`/v1/admin/notice/${noticeId}`, formData, {
headers: {
'Content-Type': 'multipart/form-data',
},
});

// 공지사항 삭제 API
export const deleteAdminNotice = async (noticeId: string) => {
const response = await axiosInstance.delete(`/v1/admin/notice/${noticeId}`); // RESTful 형식에 맞게 수정
return response.data; // 서버에서 반환하는 데이터
const response = await axiosInstance.delete(`/v1/admin/notice/${noticeId}`);
return response.data;
};

// 공지사항 목록에서 개별 공개여부 수정 API
Expand Down Expand Up @@ -264,7 +262,18 @@ export const getAdminNoticeEdit = async (noticeId: string) => {
};

// 전략 목록 조회 API
export const getAdminStrategyList = async () => {};
export const getAdminStrategyList = async (params: AdminStrategyDtoProps) => {
const response = await axiosInstance.get(`/v1/admin/strategy`, {
params: {
openStatus: params.openStatus,
approvalStatus: params.approvalStatus,
keyword: params.keyword,
page: params.page,
},
});

return response.data;
};

// 전략 승인 API
export const approveAdminStrategy = async (approveData: {
Expand Down Expand Up @@ -386,6 +395,34 @@ export const createAdminMethods = async (params: MethodsPostRequestProps) => {
return response.data;
};

//매매방식 삭제 API
export const deleteAdminMethods = async (ids: number[]) => {
const response = await axiosInstance.delete(`/v1/admin/method`, {
data: { methodIdList: ids },
});

return response.data;
};

//매매방식 수정 API
export const updateAdminMethods = async (params: MethodsPutRequestProps) => {
const formData = new FormData();

formData.append(
'methodPutRequestDto',
JSON.stringify(params.methodPutRequestDto)
);
formData.append('file', params.file);

const response = await axiosInstance.put(`/v1/admin/method`, formData, {
headers: {
'Content-Type': 'multipart/form-data',
},
});

return response.data;
};

// 관리자 문의 조회 API
export const getInquiryList = async (
page: number,
Expand Down Expand Up @@ -416,35 +453,18 @@ export const deleteInquiryList = async (
return response.data;
};

//매매방식 삭제 API
export const deleteAdminMethods = async (ids: number[]) => {
const response = await axiosInstance.delete(`/v1/admin/method`, {
data: { methodIdList: ids },
});

return response.data;
};

// 관리자 문의 상세조회 API
export const getAdminInquiryDetail = async (qnaId: number) => {
const response = await axiosInstance.get(`/v1/admin/qna/${qnaId}`);

return response.data;
};

//매매방식 수정 API
export const updateAdminMethods = async (params: MethodsPutRequestProps) => {
const formData = new FormData();

formData.append(
'methodPutRequestDto',
JSON.stringify(params.methodPutRequestDto)
);
formData.append('file', params.file);

const response = await axiosInstance.put(`/v1/admin/method`, formData, {
headers: {
'Content-Type': 'multipart/form-data',
export const getAdminInquiryDetail = async (
qnaId: number,
closed: string,
searchType: string,
searchText: string
) => {
const response = await axiosInstance.get(`/v1/admin/qna/${qnaId}`, {
params: {
closed,
searchType,
searchText,
},
});

Expand All @@ -457,3 +477,10 @@ export const deleteDetailInquiry = async (qnaId: number) => {

return response.data;
};

// 관리자 메인 조회 API
export const getAdminMain = async () => {
const response = await axiosInstance.get(`/v1/admin/main`);

return response.data;
};
2 changes: 1 addition & 1 deletion src/api/authApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ export interface CheckEmailCodeForPasswordData {
}

export interface ResetPasswordData {
emailAuthCode: string;
email: string;
authCode: string;
password: string;
rewritePassword: string;
}
Expand Down
10 changes: 10 additions & 0 deletions src/api/commonApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@ export interface GetInquiryDetailData {
sort?: string;
closed?: string;
page?: number;
traderProfileImage?: string;
methodId?: number;
methodIconPath?: string;
stockIconPath?: string[] | null;
cycle?: string;
stockList?: {
stockIds: number[];
stockNames: string[];
stockIconPath?: string[];
};
}

export interface CreateAnswerData {
Expand Down
8 changes: 3 additions & 5 deletions src/api/userApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export interface UpdatePasswordData {
}

export interface UpdateOptData {
userId: number;
receiveInfoConsent: boolean;
receiveMarketingConsent: boolean;
}
Expand Down Expand Up @@ -49,12 +50,9 @@ export const updatePassword = async (PasswordData: UpdatePasswordData) => {
};

// 회원 정보성 수신동의 변경 API
export const updateOpt = async (
userId: number,
updateOptData: UpdateOptData
) => {
export const updateOpt = async (updateOptData: UpdateOptData) => {
const response = await axiosInstance.patch(
`/v1/member/consent/${userId}`,
`/v1/member/consent/${updateOptData.userId}`,
updateOptData,
{
headers: {
Expand Down
8 changes: 6 additions & 2 deletions src/components/DetailCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,21 @@ const DetailCard: React.FC<DetailCardProps> = ({
return 'GREEN';
};

const valueLength = parseFloat(value.toFixed(2)).toString().length;
const TagSize = valueLength > 6 ? 'h3' : valueLength > 5 ? 'h2' : 'h1';
const RenderTag = TagSize as keyof JSX.IntrinsicElements;

return (
<div css={detailCardStyle(getColor(value, type))}>
<span className='title'>{title}</span>
<div className='value'>
{type === 'DEFAULT' ? (
<>
<h1>{parseFloat(motionValue.toFixed(2))}</h1>
<RenderTag>{parseFloat(motionValue.toFixed(2))}</RenderTag>
<span>%</span>
</>
) : (
<h1>{`${parseFloat(motionValue.toFixed(2))}:1`}</h1>
<RenderTag>{`${parseFloat(motionValue.toFixed(2))}:1`}</RenderTag>
)}
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/StrategyFilter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ const filterContentStyle = css`
.filter-label {
display: block;
width: 80px;
min-width: 80px;
font-weight: ${FONT_WEIGHT.BOLD};
color: ${COLOR.BLACK};
}
Expand Down
6 changes: 5 additions & 1 deletion src/components/TextInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,13 @@ const inputStyle = (
: COLOR.BLACK};
}
&::placeholder {
::placeholder {
color: ${COLOR_OPACITY.BLACK_OPACITY30};
}
::-ms-reveal {
display: none;
}
`;

export default TextInput;
Loading

0 comments on commit baa0ca0

Please sign in to comment.