This commit is contained in:
2025-02-12 18:29:27 +09:00
commit 513ea114cc
290 changed files with 84274 additions and 0 deletions

100
src/apis/Admin.js Normal file
View File

@@ -0,0 +1,100 @@
//사용자 관리 - 사용자 조회 api 연결
import { Axios } from '../utils';
// 운영자 조회
export const AdminViewList = async (token, searchType, searchKey, groupType, joinCheck, orderBy, size, currentPage) => {
try {
const res = await Axios.get(
`/api/v1/admin/list?search_type=${searchType ? searchType : 'NAME'}&search_key=${searchKey ? searchKey : ''}&group_id=${groupType ? groupType : ''}&join_check=${joinCheck}&orderby=${
orderBy ? orderBy : 'DESC'
}&page_no=${currentPage}&page_size=${size}`,
{
headers: { Authorization: `Bearer ${token}` },
},
);
return res.data.data;
} catch (e) {
if (e instanceof Error) {
throw new Error('AdminViewList Error', e);
}
}
};
export const AdminViewGroupList = async token => {
try {
const res = await Axios.get('/api/v1/admin/group-list', {
headers: { Authorization: `Bearer ${token}` },
});
return res.data.data.group_list;
} catch (e) {
if (e instanceof Error) {
throw new Error('AdminViewGroupList Error', e);
}
}
};
export const AdminLoginApprove = async (token, params) => {
try {
const res = await Axios.patch(
'/api/v1/admin',
{ list: params },
{
headers: { Authorization: `Bearer ${token}` },
},
);
return res;
} catch (e) {
if (e instanceof Error) {
throw new Error('AdminLoginApprove Error', e);
}
}
};
export const AdminChangeGroup = async (token, params) => {
try {
const res = await Axios.put(
'/api/v1/admin',
{ list: params },
{
headers: { Authorization: `Bearer ${token}` },
},
);
return res;
} catch (e) {
if (e instanceof Error) {
throw new Error('AdminChangeGroup Error', e);
}
}
};
export const AdminDeleteUser = async (token, params) => {
try {
const res = await Axios.delete('/api/v1/admin', {
headers: { Authorization: `Bearer ${token}` },
data: { list: params },
});
return res;
} catch (e) {
if (e instanceof Error) {
throw new Error('AdminDeleteUser Error', e);
}
}
};
export const AdminChangePw = async (token, params) => {
try {
const res = await Axios.post('/api/v1/admin/init-password', params, {
headers: { Authorization: `Bearer ${token}` },
});
return res.data;
} catch (e) {
if (e instanceof Error) {
throw new Error('AdminChangePw Error', e);
}
}
};

79
src/apis/Auth.js Normal file
View File

@@ -0,0 +1,79 @@
//인증 관련 api 연결
import { Axios } from '../utils';
export const AuthInfo = async token => {
try {
const res = await Axios.get('/api/v1/admin/info', {
headers: { Authorization: `Bearer ${token}` },
});
return res.data.data;
} catch (e) {
if (e instanceof Error) {
throw new Error('AuthInfo', e);
}
}
};
export const AuthLogin = async params => {
try {
const res = await Axios.post('/api/v1/auth/login', params);
return res.data;
} catch (e) {
if (e instanceof Error) {
throw new Error('AuthLogin Error', e);
}
}
};
export const AuthRegist = async data => {
try {
const res = await Axios.post('/api/v1/auth/register', {
email: data.userid,
name: data.username,
password: data.password,
});
return res.data;
} catch (e) {
if (e instanceof Error) {
e.response.data.message.map(message => alert(message));
}
}
};
export const AuthLogout = async token => {
try {
const res = await Axios.post('/api/v1/auth/logout', {
headers: { Authorization: `Bearer ${token}` },
});
return res;
} catch (e) {
if (e instanceof Error) {
throw new Error('AuthLogout Error', e);
}
}
};
export const AuthEdit = async (data, token) => {
try {
const res = await Axios.patch(
'/api/v1/admin/change-password',
{
password: data.password,
new_password: data.newPassword,
},
{
headers: { Authorization: `Bearer ${token}` },
},
);
return res;
} catch (e) {
if (e instanceof Error) {
throw new Error('AuthEdit Error', e);
}
}
};

117
src/apis/Battle.js Normal file
View File

@@ -0,0 +1,117 @@
//운영서비스 관리 - 전투시스템 api 연결
import { Axios } from '../utils';
// 전투시스템 리스트 조회
export const BattleEventView = async (token, landType, landData, userType, userData, landSize, status, startDate, endDate, order, size, currentPage) => {
try {
const res = await Axios.get(
`/api/v1/battle/event/list?land_type=${landType}&land_data=${landData}&user_type=${userType}&user_data=${userData}&land_size=${landSize}&status=${status}&start_dt=${startDate}&end_dt=${endDate}&orderby=${order}&page_no=${currentPage}
&page_size=${size}`,
{
headers: { Authorization: `Bearer ${token}` },
},
);
return res.data.data;
} catch (e) {
if (e instanceof Error) {
throw new Error('BattleEventView Error', e);
}
}
};
// 전투시스템 상세보기
export const BattleEventDetailView = async (token, id) => {
try {
const res = await Axios.get(`/api/v1/battle/event/detail/${id}`, {
headers: { Authorization: `Bearer ${token}` },
});
return res.data.data;
} catch (e) {
if (e instanceof Error) {
throw new Error('BattleEventDetailView Error', e);
}
}
};
// 전투시스템 등록
export const BattleEventSingleRegist = async (token, params) => {
try {
const res = await Axios.post(`/api/v1/battle/event`, params, {
headers: { Authorization: `Bearer ${token}` },
});
return res.data;
} catch (e) {
if (e instanceof Error) {
throw new Error('BattleEventSingleRegist Error', e);
}
}
};
// 전투시스템 수정
export const BattleEventModify = async (token, id, params) => {
try {
const res = await Axios.put(`/api/v1/battle/event/${id}`, params, {
headers: { Authorization: `Bearer ${token}` },
});
return res.data;
} catch (e) {
if (e instanceof Error) {
throw new Error('BattleEventModify Error', e);
}
}
};
// 전투시스템 삭제
export const BattleEventDelete = async (token, params, id) => {
try {
const res = await Axios.delete(`/api/v1/battle/event/delete`, {
headers: { Authorization: `Bearer ${token}` },
data: { list: params },
});
return res.data;
} catch (e) {
if (e instanceof Error) {
throw new Error('BattleEventDelete Error', e);
}
}
};
export const BattleConfigView = async (token) => {
try {
const res = await Axios.get(
`/api/v1/battle/config/list`,
{
headers: { Authorization: `Bearer ${token}` },
},
);
return res.data.data.battle_config_list;
} catch (e) {
if (e instanceof Error) {
throw new Error('BattleConfigView Error', e);
}
}
};
export const BattleRewardView = async (token) => {
try {
const res = await Axios.get(
`/api/v1/battle/reward/list`,
{
headers: { Authorization: `Bearer ${token}` },
},
);
return res.data.data.battle_reward_list;
} catch (e) {
if (e instanceof Error) {
throw new Error('BattleRewardView Error', e);
}
}
};

121
src/apis/BlackList.js Normal file
View File

@@ -0,0 +1,121 @@
//운영서비스 관리 - 이용자 제재 리스트 api 연결
import { Axios } from '../utils';
// 블랙리스트 조회
export const BlackListView = async (token, searchType, data, email, status, sanctions, period, order, size, currentPage) => {
try {
const res = await Axios.get(
`/api/v1/black-list/list?search_type=${searchType ? searchType : ''}
&search_key=${data ? data : ''}
&email=${email ? email : ''}
&status=${status ? status : ''}
&sanctions=${sanctions ? sanctions : ''}
&period=${period ? period : ''}
&orderby=${order}
&page_no=${currentPage}
&page_size=${size}
`,
{
headers: { Authorization: `Bearer ${token}` },
},
);
return res.data.data;
} catch (e) {
if (e instanceof Error) {
}
}
};
// 블랙 리스트 상세 조회
export const BlackListDetail = async (token, id) => {
try {
const res = await Axios.get(`api/v1/black-list/detail/${id}`, {
headers: { Authorization: `Bearer ${token}` },
});
return res.data.data.detail;
} catch (e) {
if (e instanceof Error) {
throw new Error('BlackListDetail', e);
}
}
};
// 제재 삭제
export const BlackListDelete = async (token, params) => {
try {
const res = await Axios.delete(`api/v1/black-list`, {
headers: { Authorization: `Bearer ${token}` },
data: { list: params },
});
return res;
} catch (e) {
if (e instanceof Error) {
throw new Error('BlackListDelete', e);
}
}
};
// 제재 등록
export const BlackListRegist = async (token, params) => {
try {
const res = await Axios.post(`/api/v1/black-list`, params, {
headers: { Authorization: `Bearer ${token}` },
});
return res;
} catch (e) {
if (e instanceof Error) {
throw new Error('BlacklistRegist', e);
}
}
};
// 엑셀 업로드
export const BlackListMultipleUpload = async (token, file) => {
const exelFile = new FormData()
exelFile.append('file', file)
try {
const res = await Axios.post(`/api/v1/black-list/excel-upload`, exelFile, {
headers: {
"Content-Type": "multipart/form-data",
Authorization: `Bearer ${token}`
},
});
return res.data.data.list;
} catch (e) {
if (e instanceof Error) {
throw new Error('BlacklistRegist', e);
}
}
}
export const BlackListExcelDown = async (token, filename) => {
try {
await Axios.get(`/api/v1/black-list/excel-down?file=${filename}`, {
headers: { Authorization: `Bearer ${token}` },
responseType: 'blob',
}).then(response => {
const href = URL.createObjectURL(response.data);
const link = document.createElement('a');
link.href = href;
link.setAttribute('download', `${filename}`);
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
URL.revokeObjectURL(href);
});
} catch (e) {
if (e instanceof Error) {
throw new Error('BlacklistExcelDown Error', e);
}
}
};

82
src/apis/Calium.js Normal file
View File

@@ -0,0 +1,82 @@
//운영자 관리 - 칼리움 api 연결
import { Axios } from '../utils';
// 칼리움 요청 리스트 조회
export const CaliumRequestView = async (token, content, status, startDate, endDate, order, size, currentPage) => {
try {
const res = await Axios.get(
`/api/v1/calium/list?content=${content}&status=${status}&start_dt=${startDate}&end_dt=${endDate}&orderby=${order}&page_no=${currentPage}
&page_size=${size}`,
{
headers: { Authorization: `Bearer ${token}` },
},
);
return res.data.data;
} catch (e) {
if (e instanceof Error) {
throw new Error('CaliumRequestView Error', e);
}
}
};
// 칼리움 상세보기
export const CaliumDetailView = async (token, id) => {
try {
const res = await Axios.get(`/api/v1/calium/detail/${id}`, {
headers: { Authorization: `Bearer ${token}` },
});
return res.data.data.detail;
} catch (e) {
if (e instanceof Error) {
throw new Error('CaliumDetailView Error', e);
}
}
};
// 칼리움 요청 등록
export const CaliumRequestRegist = async (token, params) => {
try {
const res = await Axios.post(`/api/v1/calium`, params, {
headers: { Authorization: `Bearer ${token}` },
});
return res;
} catch (e) {
if (e instanceof Error) {
throw new Error('CaliumRequestRegist Error', e);
}
}
};
// 칼리움 충적
export const CaliumCharge = async (token, params) => {
try {
const res = await Axios.post(`/api/v1/calium/charge`, params, {
headers: { Authorization: `Bearer ${token}` },
});
return res.data;
} catch (e) {
if (e instanceof Error) {
throw new Error('CaliumCharge Error', e);
}
}
};
// 칼리움 인출 가능 수량
export const CaliumLimitCount = async (token) => {
try {
const res = await Axios.get(`/api/v1/calium/limit`, {
headers: { Authorization: `Bearer ${token}` },
});
return res.data.data.withdrawable_info;
} catch (e) {
if (e instanceof Error) {
throw new Error('CaliumLimitCount Error', e);
}
}
};

98
src/apis/Event.js Normal file
View File

@@ -0,0 +1,98 @@
//운영서비스 관리 - 이벤트 api 연결
import { Axios } from '../utils';
// 이벤트 리스트 조회
export const EventView = async (token, title, content, status, startDate, endDate, order, size, currentPage) => {
try {
const res = await Axios.get(
`/api/v1/event/list?title=${title}&content=${content}&status=${status}&start_dt=${startDate}&end_dt=${endDate}&orderby=${order}&page_no=${currentPage}
&page_size=${size}`,
{
headers: { Authorization: `Bearer ${token}` },
},
);
return res.data.data;
} catch (e) {
if (e instanceof Error) {
throw new Error('EventView Error', e);
}
}
};
// 이벤트 상세보기
export const EventDetailView = async (token, id) => {
try {
const res = await Axios.get(`/api/v1/event/detail/${id}`, {
headers: { Authorization: `Bearer ${token}` },
});
return res.data.data.detail;
} catch (e) {
if (e instanceof Error) {
throw new Error('EventDetailView Error', e);
}
}
};
// 이벤트 등록
export const EventSingleRegist = async (token, params) => {
try {
const res = await Axios.post(`/api/v1/event`, params, {
headers: { Authorization: `Bearer ${token}` },
});
return res;
} catch (e) {
if (e instanceof Error) {
throw new Error('EventSingleRegist Error', e);
}
}
};
// 우편 수정
export const EventModify = async (token, id, params) => {
try {
const res = await Axios.put(`/api/v1/event/${id}`, params, {
headers: { Authorization: `Bearer ${token}` },
});
return res.data.data.list;
} catch (e) {
if (e instanceof Error) {
throw new Error('EventModify Error', e);
}
}
};
// 우편 삭제
export const EventDelete = async (token, params, id) => {
try {
const res = await Axios.delete(`/api/v1/event/delete`, {
headers: { Authorization: `Bearer ${token}` },
data: { list: params },
});
return res.data.data.list;
} catch (e) {
if (e instanceof Error) {
throw new Error('EventDelete Error', e);
}
}
};
// 이벤트 우편 아이템 확인
export const EventIsItem = async (token, params) => {
try {
const res = await Axios.post(`/api/v1/event/item`, params, {
headers: { Authorization: `Bearer ${token}` },
});
return res;
} catch (e) {
if (e instanceof Error) {
throw new Error('EventIsItem Error', e);
}
}
};

82
src/apis/Group.js Normal file
View File

@@ -0,0 +1,82 @@
//사용자 관리 - 그룹 조회 api 연결
import { Axios } from '../utils';
// 그룹 권한 조회
export const GroupViewList = async (token, orderBy, size, currentPage) => {
try {
const res = await Axios.get(`/api/v1/groups/list?orderby=${orderBy ? orderBy : 'DESC'}
&page_no=${size}&page_size=${currentPage}`, {
headers: { Authorization: `Bearer ${token}` },
});
return res.data.data;
} catch (e) {
if (e instanceof Error) {
throw new Error('GroupViewList Error', e);
}
}
};
// 그룹 상세 권한 조회
export const GroupDetailViewList = async (token, id) => {
try {
const res = await Axios.get(`/api/v1/groups/detail/${id}`, {
headers: { Authorization: `Bearer ${token}` },
});
return res.data.data;
} catch (e) {
if (e instanceof Error) {
throw new Error('GroupViewList Error', e);
}
}
};
// 권한 그룹 등록
export const GroupRegist = async (token, params) => {
try {
const res = await Axios.post(`/api/v1/groups`, params, {
headers: { Authorization: `Bearer ${token}` },
});
return res;
} catch (e) {
if (e instanceof Error) {
// e.response.data.message.map(message => alert(message));
}
}
};
// 권한 그룹 선택 삭제
export const GroupDelete = async (token, params) => {
try {
const res = await Axios.delete('/api/v1/groups', {
headers: { Authorization: `Bearer ${token}` },
data: { list: params },
});
return res;
} catch (e) {
if (e instanceof Error) {
throw new Error('GroupDelete', e);
}
}
};
// 권한 수정
export const GroupModify = async (token, id, params) => {
try {
const res = await Axios.put(
`/api/v1/groups/${id}`,
{ list: params },
{
headers: { Authorization: `Bearer ${token}` },
},
);
return res;
} catch (e) {
if (e instanceof Error) {
throw new Error('GroupModify Error', e);
}
}
};

36
src/apis/History.js Normal file
View File

@@ -0,0 +1,36 @@
//사용자 관리 - 로그조회 api 연결
import { Axios } from '../utils';
export const LogViewList = async (token, searchType, searchKey, historyType, startDt, endDt, orderBy, size, currentPage) => {
try {
const res = await Axios.get(
`/api/v1/history/list?search_type=${searchType ? searchType : 'NAME'}&search_key=${searchKey ? searchKey : ''}&history_type=${historyType ? historyType : ''}&start_dt=${
startDt ? startDt : ''
}&end_dt=${endDt ? endDt : ''}&orderby=${orderBy ? orderBy : 'DESC'}&page_no=${currentPage}&page_size=${size}`,
{
headers: { Authorization: `Bearer ${token}` },
},
);
return res.data.data;
} catch (e) {
if (e instanceof Error) {
throw new Error('LogViewList Error', e);
}
}
};
export const LogviewDetail = async (token, id) => {
try {
const res = await Axios.get(`/api/v1/history/detail/${id}`, {
headers: { Authorization: `Bearer ${token}` },
});
return res.data.data.content;
} catch (e) {
if (e instanceof Error) {
throw new Error('LogViewDetail', e);
}
}
};

456
src/apis/Indicators.js Normal file
View File

@@ -0,0 +1,456 @@
//지표 관리 - 유저 지표, 경제 지표 api
import { Axios } from '../utils';
// 1. 유저 지표
// 2. 경제 지표
// 1. 유저 지표
// 이용자 지표 조회
export const userIndexView = async (token, sendDate, endDate) => {
try {
const res = await Axios.get(`/api/v1/indicators/user/list?start_dt=${sendDate}&end_dt=${endDate}`, {
headers: { Authorization: `Bearer ${token}` },
});
return res.data.data.user_statistics_list;
} catch (e) {
if (e instanceof Error) {
throw new Error('MailView Error', e);
}
}
};
// 이용자 지표 총계
export const userTotalIndex = async token => {
try {
const res = await Axios.get(`/api/v1/indicators/user/total`, {
headers: { Authorization: `Bearer ${token}` },
});
return res.data.data;
} catch (e) {
if (e instanceof Error) {
throw new Error('userTotalIndex', e);
}
}
};
// 유저 지표 다운로드
export const userIndexExport = async (token, filename, sendDate, endDate) => {
try {
await Axios.get(`/api/v1/indicators/user/excel-down?file=${filename}&start_dt=${sendDate}&end_dt=${endDate}`, {
headers: { Authorization: `Bearer ${token}` },
responseType: 'blob',
}).then(response => {
const href = URL.createObjectURL(response.data);
const link = document.createElement('a');
link.href = href;
link.setAttribute('download', `${filename}`);
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
URL.revokeObjectURL(href);
});
} catch (e) {
if (e instanceof Error) {
throw new Error('userIndexExport Error', e);
}
}
};
// Retention
export const RetentionIndexView = async (token, start_dt, end_dt) => {
try {
const res = await Axios.get(`/api/v1/indicators/retention/list?start_dt=${start_dt}&end_dt=${end_dt}`, {
headers: { Authorization: `Bearer ${token}` },
});
return res.data.data;
} catch (e) {
if (e instanceof Error) {
throw new Error('RetentionIndexView Error', e);
}
}
};
// Retention 다운로드
export const RetentionIndexExport = async (token, filename, sendDate, endDate) => {
try {
await Axios.get(`/api/v1/indicators/retention/excel-down?${filename}&start_dt=${sendDate}&end_dt=${endDate}`, {
headers: { Authorization: `Bearer ${token}` },
responseType: 'blob',
}).then(response => {
const href = URL.createObjectURL(response.data);
const link = document.createElement('a');
link.href = href;
link.setAttribute('download', `${filename}`);
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
URL.revokeObjectURL(href);
});
} catch (e) {
if (e instanceof Error) {
throw new Error('RetentionIndexExport Error', e);
}
}
};
// Segment
export const SegmentIndexView = async (token, search_dt) => {
try {
const res = await Axios.get(`/api/v1/indicators/segment/list?search_dt=${search_dt}`, {
headers: { Authorization: `Bearer ${token}` },
});
return res.data.data;
} catch (e) {
if (e instanceof Error) {
throw new Error('SegmentIndexView Error', e);
}
}
};
// Segment 다운로드
export const SegmentIndexExport = async (token, filename, endDate) => {
try {
await Axios.get(`/api/v1/indicators/segment/excel-down?${filename}&search_dt=${endDate}`, {
headers: { Authorization: `Bearer ${token}` },
responseType: 'blob',
}).then(response => {
const href = URL.createObjectURL(response.data);
const link = document.createElement('a');
link.href = href;
link.setAttribute('download', `${filename}`);
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
URL.revokeObjectURL(href);
});
} catch (e) {
if (e instanceof Error) {
throw new Error('SegmentIndexExport Error', e);
}
}
};
// Playtime
export const PlaytimeIndexView = async (token, start_dt, end_dt) => {
try {
const res = await Axios.get(`/api/v1/indicators/playtime/list?start_dt=${start_dt}&end_dt=${end_dt}`, {
headers: { Authorization: `Bearer ${token}` },
});
return res.data.data;
} catch (e) {
if (e instanceof Error) {
throw new Error('PlaytimeIndexView Error', e);
}
}
};
// Playtime 다운로드
export const PlaytimeIndexExport = async (token, filename, sendDate, endDate) => {
try {
await Axios.get(`/api/v1/indicators/playtime/excel-down?file=${filename}&start_dt=${sendDate}&end_dt=${endDate}`, {
headers: { Authorization: `Bearer ${token}` },
responseType: 'blob',
}).then(response => {
const href = URL.createObjectURL(response.data);
const link = document.createElement('a');
link.href = href;
link.setAttribute('download', `${filename}`);
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
URL.revokeObjectURL(href);
});
} catch (e) {
if (e instanceof Error) {
throw new Error('PlaytimeIndexExport Error', e);
}
}
};
// 2. 경제 지표
// 재화 조회 (currency)
export const CurrencyIndexView = async (token, start_dt, end_dt, currency_type) => {
try {
const res = await Axios.get(`/api/v1/indicators/currency/use?start_dt=${start_dt}&end_dt=${end_dt}&currency_type=${currency_type}`, {
headers: { Authorization: `Bearer ${token}` },
});
return res.data.data;
} catch (e) {
if (e instanceof Error) {
throw new Error('currencyIndexView Error', e);
}
}
};
// 재화 지표 다운로드
export const CurrencyIndexExport = async (token, filename, sendDate, endDate, currencyType) => {
try {
await Axios.get(`/api/v1/indicators/currency/excel-down?file=${filename}&start_dt=${sendDate}&end_dt=${endDate}&currency_type=${currencyType}`, {
headers: { Authorization: `Bearer ${token}` },
responseType: 'blob',
}).then(response => {
const href = URL.createObjectURL(response.data);
const link = document.createElement('a');
link.href = href;
link.setAttribute('download', `${filename}`);
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
URL.revokeObjectURL(href);
});
} catch (e) {
if (e instanceof Error) {
throw new Error('CurrencyIndexExport Error', e);
}
}
};
// VBP
export const VbpIndexView = async (token, start_dt, end_dt) => {
try {
const res = await Axios.get(`/api/v1/indicators/currency/vbp?start_dt=${start_dt}&end_dt=${end_dt}`, {
headers: { Authorization: `Bearer ${token}` },
});
return res.data.data;
} catch (e) {
if (e instanceof Error) {
throw new Error('VbpIndexView Error', e);
}
}
};
// VBP 다운로드
export const VBPIndexExport = async (token, filename, sendDate, endDate) => {
try {
await Axios.get(`/api/v1/indicators/currency/excel-down?file=${filename}&start_dt=${sendDate}&end_dt=${endDate}`, {
headers: { Authorization: `Bearer ${token}` },
responseType: 'blob',
}).then(response => {
const href = URL.createObjectURL(response.data);
const link = document.createElement('a');
link.href = href;
link.setAttribute('download', `${filename}`);
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
URL.revokeObjectURL(href);
});
} catch (e) {
if (e instanceof Error) {
throw new Error('VBPIndexExport Error', e);
}
}
};
// Item
export const ItemIndexView = async (token, start_dt, end_dt) => {
try {
const res = await Axios.get(`/api/v1/indicators/currency/item?start_dt=${start_dt}&end_dt=${end_dt}`, {
headers: { Authorization: `Bearer ${token}` },
});
return res.data.data;
} catch (e) {
if (e instanceof Error) {
throw new Error('ItemIndexView Error', e);
}
}
};
// Item 다운로드
export const ItemIndexExport = async (token, filename, sendDate, endDate) => {
try {
await Axios.get(`/api/v1/indicators/currency/excel-down?file=${filename}&start_dt=${sendDate}&end_dt=${endDate}`, {
headers: { Authorization: `Bearer ${token}` },
responseType: 'blob',
}).then(response => {
const href = URL.createObjectURL(response.data);
const link = document.createElement('a');
link.href = href;
link.setAttribute('download', `${filename}`);
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
URL.revokeObjectURL(href);
});
} catch (e) {
if (e instanceof Error) {
throw new Error('ItemIndexExport Error', e);
}
}
};
// Instance
export const InstanceIndexView = async (token, data, start_dt, end_dt) => {
try {
const res = await Axios.get(
`/api/v1/indicators/currency/instance?search_key=${data ? data : ''}
&start_dt=${start_dt}&end_dt=${end_dt}`,
{
headers: { Authorization: `Bearer ${token}` },
},
);
return res.data.data;
} catch (e) {
if (e instanceof Error) {
throw new Error('InstanceIndexView Error', e);
}
}
};
// Instance 다운로드
export const InstanceIndexExport = async (token, filename, data, sendDate, endDate) => {
try {
await Axios.get(
`/api/v1/indicators/currency/excel-down?file=${filename}&search_key=${data ? data : ''}
&start_dt=${sendDate}&end_dt=${endDate}`,
{
headers: { Authorization: `Bearer ${token}` },
responseType: 'blob',
},
).then(response => {
const href = URL.createObjectURL(response.data);
const link = document.createElement('a');
link.href = href;
link.setAttribute('download', `${filename}`);
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
URL.revokeObjectURL(href);
});
} catch (e) {
if (e instanceof Error) {
throw new Error('InstanceIndexExport Error', e);
}
}
};
// Clothes
export const ClothesIndexView = async (token, data, start_dt, end_dt) => {
try {
const res = await Axios.get(`/api/v1/indicators/currency/clothes?search_key=${data ? data : ''}&start_dt=${start_dt}&end_dt=${end_dt}`, {
headers: { Authorization: `Bearer ${token}` },
});
return res.data.data;
} catch (e) {
if (e instanceof Error) {
throw new Error('ClothesIndexView Error', e);
}
}
};
// Clothes 다운로드
export const ClothesIndexExport = async (token, filename, data, sendDate, endDate) => {
try {
await Axios.get(
`/api/v1/indicators/currency/excel-down?file=${filename}&search_key=${data ? data : ''}
&start_dt=${sendDate}&end_dt=${endDate}`,
{
headers: { Authorization: `Bearer ${token}` },
responseType: 'blob',
},
).then(response => {
const href = URL.createObjectURL(response.data);
const link = document.createElement('a');
link.href = href;
link.setAttribute('download', `${filename}`);
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
URL.revokeObjectURL(href);
});
} catch (e) {
if (e instanceof Error) {
throw new Error('ClothesIndexExport Error', e);
}
}
};
// DAU
export const DailyActiveUserView = async (token, start_dt, end_dt) => {
try {
const res = await Axios.get(`/api/v1/indicators/dau/list?start_dt=${start_dt}&end_dt=${end_dt}`, {
headers: { Authorization: `Bearer ${token}` },
});
return res.data.data.dau_list;
} catch (e) {
if (e instanceof Error) {
throw new Error('DailyActiveUserView Error', e);
}
}
};
// DAU 다운로드
export const DailyActiveUserExport = async (token, filename, sendDate, endDate) => {
try {
await Axios.get(`/api/v1/indicators/dau/excel-down?file=${filename}&start_dt=${sendDate}&end_dt=${endDate}`, {
headers: { Authorization: `Bearer ${token}` },
responseType: 'blob',
}).then(response => {
const href = URL.createObjectURL(response.data);
const link = document.createElement('a');
link.href = href;
link.setAttribute('download', `${filename}`);
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
URL.revokeObjectURL(href);
});
} catch (e) {
if (e instanceof Error) {
throw new Error('PlaytimeIndexExport Error', e);
}
}
};
// Daily Medal
export const DailyMedalView = async (token, start_dt, end_dt) => {
try {
const res = await Axios.get(`/api/v1/indicators/daily-medal/list?start_dt=${start_dt}&end_dt=${end_dt}`, {
headers: { Authorization: `Bearer ${token}` },
});
return res.data.data.daily_medal_list;
} catch (e) {
if (e instanceof Error) {
throw new Error('DailyMedalView Error', e);
}
}
};

27
src/apis/Item.js Normal file
View File

@@ -0,0 +1,27 @@
//운영서비스 관리 - 아이템 리스트 api 연결
import { Axios } from '../utils';
//아이템 리스트 조회
export const ItemListView = async (token, searchType, data, status, restore, order, size, currentPage) => {
try {
const res = await Axios.get(
`/api/v1/items/list?search_type=${searchType ? searchType : ''}
&search_key=${data ? data : ''}
&orderby=${order}
&page_no=${currentPage}
&page_size=${size}
`,
{
headers: { Authorization: `Bearer ${token}` },
},
);
// console.log(res.data.data);
return res.data.data;
} catch (e) {
if (e instanceof Error) {
}
}
};

131
src/apis/Land.js Normal file
View File

@@ -0,0 +1,131 @@
//운영서비스 관리 - 랜드 경매 api 연결
import { Axios } from '../utils';
// 랜드 경매 리스트 조회
export const LandAuctionView = async (token, landType, landData, userType, userData, landSize, status, startDate, endDate, order, size, currentPage) => {
try {
const res = await Axios.get(
`/api/v1/land/auction/list?land_type=${landType}&land_data=${landData}&user_type=${userType}&user_data=${userData}&land_size=${landSize}&status=${status}&start_dt=${startDate}&end_dt=${endDate}&orderby=${order}&page_no=${currentPage}
&page_size=${size}`,
{
headers: { Authorization: `Bearer ${token}` },
},
);
return res.data.data;
} catch (e) {
if (e instanceof Error) {
throw new Error('LandAuctionView Error', e);
}
}
};
// 랜드 경매 상세보기
export const LandAuctionDetailView = async (token, id) => {
try {
const res = await Axios.get(`/api/v1/land/auction/detail/${id}`, {
headers: { Authorization: `Bearer ${token}` },
});
return res.data.data;
} catch (e) {
if (e instanceof Error) {
throw new Error('LandAuctionDetailView Error', e);
}
}
};
// 랜드 경매 등록
export const LandAuctionSingleRegist = async (token, params) => {
try {
const res = await Axios.post(`/api/v1/land/auction`, params, {
headers: { Authorization: `Bearer ${token}` },
});
return res.data;
} catch (e) {
if (e instanceof Error) {
throw new Error('LandAuctionSingleRegist Error', e);
}
}
};
// 랜드 경매 수정
export const LandAuctionModify = async (token, id, params) => {
try {
const res = await Axios.put(`/api/v1/land/auction/${id}`, params, {
headers: { Authorization: `Bearer ${token}` },
});
return res.data;
} catch (e) {
if (e instanceof Error) {
throw new Error('LandAuctionModify Error', e);
}
}
};
// 랜드 경매 삭제
export const LandAuctionDelete = async (token, params, id) => {
try {
const res = await Axios.delete(`/api/v1/land/auction/delete`, {
headers: { Authorization: `Bearer ${token}` },
data: { list: params },
});
return res.data;
} catch (e) {
if (e instanceof Error) {
throw new Error('LandAuctionDelete Error', e);
}
}
};
export const LandView = async (token) => {
try {
const res = await Axios.get(
`/api/v1/land/list`,
{
headers: { Authorization: `Bearer ${token}` },
},
);
return res.data.data.land_list;
} catch (e) {
if (e instanceof Error) {
throw new Error('LandView Error', e);
}
}
};
export const BuildingView = async (token) => {
try {
const res = await Axios.get(
`/api/v1/land/building/list`,
{
headers: { Authorization: `Bearer ${token}` },
},
);
return res.data.data.building_list;
} catch (e) {
if (e instanceof Error) {
throw new Error('LandView Error', e);
}
}
};
export const LandDetailView = async (token, id) => {
try {
const res = await Axios.get(`/api/v1/land/detail/${id}`, {
headers: { Authorization: `Bearer ${token}` },
});
return res.data.data.detail;
} catch (e) {
if (e instanceof Error) {
throw new Error('LandDetailView Error', e);
}
}
};

142
src/apis/Mail.js Normal file
View File

@@ -0,0 +1,142 @@
//운영서비스 관리 - 메일 api 연결
import { Axios } from '../utils';
// 메일 리스트 조회
export const MailView = async (token, mailTitle, content, sendType, sendStatus, mailType, receiveType, sendDate, endDate, order, size, currentPage) => {
try {
const res = await Axios.get(
`/api/v1/mail/list?mail_title=${mailTitle}&content=${content}&send_type=${sendType}&send_status=${sendStatus}&mail_type=${mailType}&receive_type=${receiveType}&start_dt=${sendDate}&end_dt=${endDate}&orderby=${order}&page_no=${currentPage}
&page_size=${size}`,
{
headers: { Authorization: `Bearer ${token}` },
},
);
return res.data.data;
} catch (e) {
if (e instanceof Error) {
throw new Error('MailView Error', e);
}
}
};
// 메일 상세보기
export const MailDetailView = async (token, id) => {
try {
const res = await Axios.get(`/api/v1/mail/detail/${id}`, {
headers: { Authorization: `Bearer ${token}` },
});
return res.data.data.detail;
} catch (e) {
if (e instanceof Error) {
throw new Error('MailDetailView Error', e);
}
}
};
// 우편 단일 등록
export const MailSingleRegist = async (token, params) => {
try {
const res = await Axios.post(`/api/v1/mail`, params, {
headers: { Authorization: `Bearer ${token}` },
});
return res;
} catch (e) {
if (e instanceof Error) {
throw new Error('MailRegist Error', e);
}
}
};
// 우편 수정
export const MailModify = async (token, id, params) => {
try {
const res = await Axios.put(`/api/v1/mail/${id}`, params, {
headers: { Authorization: `Bearer ${token}` },
});
return res.data.data.list;
} catch (e) {
if (e instanceof Error) {
throw new Error('MailModify Error', e);
}
}
};
// 우편 삭제
export const MailDelete = async (token, params, id) => {
try {
const res = await Axios.delete(`/api/v1/mail/delete`, {
headers: { Authorization: `Bearer ${token}` },
data: { list: params },
});
return res.data.data.list;
} catch (e) {
if (e instanceof Error) {
throw new Error('MailDelete Error', e);
}
}
};
// 우편 다운로드
export const MailExcelDown = async (token, filename) => {
try {
await Axios.get(`/api/v1/mail/excel-down?file=${filename}`, {
headers: { Authorization: `Bearer ${token}` },
responseType: 'blob',
}).then(response => {
const href = URL.createObjectURL(response.data);
const link = document.createElement('a');
link.href = href;
link.setAttribute('download', `${filename}`);
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
URL.revokeObjectURL(href);
});
} catch (e) {
if (e instanceof Error) {
throw new Error('MailExcelDown Error', e);
}
}
};
// 우편 업로드
export const MailMultiRegsit = async (token, file) => {
const exelFile = new FormData();
exelFile.append('file', file);
try {
const res = await Axios.post(`/api/v1/mail/excel-upload`, exelFile, {
headers: {
'Content-Type': 'multipart/form-data',
Authorization: `Bearer ${token}`,
},
});
return res;
} catch (e) {
if (e instanceof Error) {
throw new Error('MailMultiRegsit', e);
}
}
};
// 우편 아이템 확인
export const MailIsItem = async (token, params) => {
try {
const res = await Axios.post(`/api/v1/mail/item`, params, {
headers: { Authorization: `Bearer ${token}` },
});
return res;
} catch (e) {
if (e instanceof Error) {
throw new Error('MailItemCheck Error', e);
}
}
};

69
src/apis/Notice.js Normal file
View File

@@ -0,0 +1,69 @@
//운영 서비스 관리 - 인게임 메세지 api 연결
import { Axios } from '../utils';
export const NoticeListView = async token => {
try {
const res = await Axios.get(`/api/v1/notice/list`, {
headers: { Authorization: `Bearer ${token}` },
});
return res.data.data.list;
} catch (e) {
if (e instanceof Error) {
throw new Error('NoticeList', e);
}
}
};
export const NoticeDetailView = async (token, id) => {
try {
const res = await Axios.get(`/api/v1/notice/detail/${id}`, {
headers: { Authorization: `Bearer ${token}` },
});
return res.data.data;
} catch (e) {
if (e instanceof Error) {
throw new Error('NoticeDetailView Error', e);
}
}
};
export const NoticeRegist = async (token, params) => {
try {
const res = await Axios.post('/api/v1/notice', params, {
headers: { Authorization: `Bearer ${token}` },
});
return res;
} catch (e) {
if (e instanceof Error) {
throw new Error('NoticeRegist Error', e);
}
}
};
export const NoticeModify = async (token, id, params) => {
try {
const res = await Axios.put(`/api/v1/notice/${id}`, params, {
headers: { Authorization: `Bearer ${token}` },
});
return res;
} catch (e) {
if (e instanceof Error) {
throw new Error('NoticeModify Error', e);
}
}
};
export const NoticeDelete = async (token, params) => {
try {
const res = await Axios.delete('/api/v1/notice', {
headers: { Authorization: `Bearer ${token}` },
data: { list: params },
});
return res;
} catch (e) {
if (e instanceof Error) {
throw new Error('NoticeDelete Error', e);
}
}
};

75
src/apis/Report.js Normal file
View File

@@ -0,0 +1,75 @@
//운영 서비스 관리 - 신고내역 api 연결
import { Axios } from '../utils';
// 신고내역 전체 조회
export const ReportTotalView = async (token, startDate, endDate) => {
try {
const res = await Axios.get(`/api/v1/report/total?start_dt=${startDate}&end_dt=${endDate}`, {
headers: { Authorization: `Bearer ${token}` },
});
return res.data.data;
} catch (e) {
if (e instanceof Error) {
throw new Error('ReportTotalView', e);
}
}
};
// 신고내역 리스트 조회
export const ReportListView = async (token, startDate, endDate, reportType, status, searchType, searchKey, order, size, currentPage) => {
try {
const res = await Axios.get(
`/api/v1/report/list?start_dt=${startDate}&end_dt=${endDate}&report_type=${reportType}&orderby=${order}&page_no=${currentPage}&page_size=${size}&status=${status}&search_type=${searchType}&search_key=${searchKey}`,
{
headers: { Authorization: `Bearer ${token}` },
},
);
return res.data.data;
} catch (e) {
if (e instanceof Error) {
throw new Error('ReportListView', e);
}
}
};
// 신고내역 상세조회
export const ReportListDetailView = async (token, pk, sk) => {
try {
const res = await Axios.get(`/api/v1/report/report-detail?pk=${pk}&sk=${sk}`, {
headers: { Authorization: `Bearer ${token}` },
});
return res.data.data.report;
} catch (e) {
if (e instanceof Error) {
throw new Error('ReportListDetailView', e);
}
}
};
// 신고내역 답변 작성
export const RepostReplyMessage = async (token, params) => {
try {
const res = await Axios.post('/api/v1/report/reply', params, {
headers: { Authorization: `Bearer ${token}` },
});
return res;
} catch (e) {
if (e instanceof Error) {
throw new Error('RepostReplyMessage Error', e);
}
}
};
// 신고내역 답변 조회
export const ReportReplyDetail = async (token, pk, sk) => {
try {
const res = await Axios.get(`/api/v1/report/reply-detail?pk=${pk}&sk=${sk}`, {
headers: { Authorization: `Bearer ${token}` },
});
return res.data.data.reply;
} catch (e) {
if (e instanceof Error) {
throw new Error('ReportReplyDetail', e);
}
}
};

264
src/apis/Users.js Normal file
View File

@@ -0,0 +1,264 @@
//운영 정보 관리 - 유저 조회 api 연결
import { Axios } from '../utils';
// 유저 조회
export const UserView = async (token, searchType, searchKey) => {
try {
const res = await Axios.get(
`/api/v1/users/find-users?
search_type=${searchType ? searchType : 'NAME'}
&search_key=${searchKey ? searchKey : ''}`,
{ headers: { Authorization: `Bearer ${token}` } },
);
return res.data.data.result;
} catch (e) {
if (e instanceof Error) {
throw new Error('UserView Error', e);
}
}
};
// 기본 정보 조회
export const UserInfoView = async (token, guid) => {
try {
const res = await Axios.get(`/api/v1/users/basicinfo?guid=${guid}`, {
headers: { Authorization: `Bearer ${token}` },
});
return res.data.data;
} catch (e) {
if (e instanceof Error) {
throw new Error('UserInfoView Error', e);
}
}
};
// 닉네임 변경
export const UserChangeNickName = async (token, params) => {
try {
const res = await Axios.put('/api/v1/users/change-nickname', params, {
headers: { Authorization: `Bearer ${token}` },
});
return res;
} catch (e) {
if (e instanceof Error) {
throw new Error('UserChangeNickName Error', e);
}
}
};
// GM 권한 변경
export const UserChangeAdminLevel = async (token, params) => {
try {
const res = await Axios.put('/api/v1/users/change-level', params, {
headers: { Authorization: `Bearer ${token}` },
});
return res;
} catch (e) {
if (e instanceof Error) {
throw new Error('UserChangeGMType Error', e);
}
}
};
// 아바타 조회
export const UserAvatarView = async (token, guid) => {
try {
const res = await Axios.get(`/api/v1/users/avatarinfo?guid=${guid}`, {
headers: { Authorization: `Bearer ${token}` },
});
return res.data.data;
} catch (e) {
if (e instanceof Error) {
throw new Error('UserAvatarView Error', e);
}
}
};
// 의상 조회
export const UserClothView = async (token, guid) => {
try {
const res = await Axios.get(`/api/v1/users/clothinfo?guid=${guid}`, {
headers: { Authorization: `Bearer ${token}` },
});
return res.data.data;
} catch (e) {
if (e instanceof Error) {
throw new Error('UserClothView Error', e);
}
}
};
// 도구 조회
export const UserToolView = async (token, guid) => {
try {
const res = await Axios.get(`/api/v1/users/toolslot?guid=${guid}`, {
headers: { Authorization: `Bearer ${token}` },
});
return res.data.data;
} catch (e) {
if (e instanceof Error) {
throw new Error('UserToolView Error', e);
}
}
};
// 인벤토리 조회
export const UserInventoryView = async (token, guid) => {
try {
const res = await Axios.get(`/api/v1/users/inventory?guid=${guid}`, {
headers: { Authorization: `Bearer ${token}` },
});
return res.data.data;
} catch (e) {
if (e instanceof Error) {
throw new Error('UserInventoryView Error', e);
}
}
};
// 인벤토리 아이템 삭제
export const UserInventoryItemDelete = async (token, params) => {
try {
const res = await Axios.delete(`/api/v1/users/inventory/delete/item`, {
headers: { Authorization: `Bearer ${token}` },
data: params,
});
return res.data;
} catch (e) {
if (e instanceof Error) {
throw new Error('UserInventoryItemDelete Error', e);
}
}
};
// 타투 조회
export const UserTattooView = async (token, guid) => {
try {
const res = await Axios.get(`/api/v1/users/tattoo?guid=${guid}`, {
headers: { Authorization: `Bearer ${token}` },
});
return res.data.data;
} catch (e) {
if (e instanceof Error) {
throw new Error('UserTattooView Error', e);
}
}
};
// 퀘스트 조회
export const UserQuestView = async (token, guid) => {
try {
const res = await Axios.get(`/api/v1/users/quest?guid=${guid}`, {
headers: { Authorization: `Bearer ${token}` },
});
return res.data.data;
} catch (e) {
if (e instanceof Error) {
throw new Error('UserQuestView Error', e);
}
}
};
// 친구목록 조회
export const UserFriendListView = async (token, guid) => {
try {
const res = await Axios.get(`/api/v1/users/friendlist?guid=${guid}`, {
headers: { Authorization: `Bearer ${token}` },
});
return res.data.data;
} catch (e) {
if (e instanceof Error) {
throw new Error('UserFriendListView Error', e);
}
}
};
// 우편 조회
export const UserMailView = async (token, guid, option) => {
try {
const res = await Axios.get(`/api/v1/users/mail?guid=${guid}&type=${option}`, {
headers: { Authorization: `Bearer ${token}` },
});
return res.data.data;
} catch (e) {
if (e instanceof Error) {
throw new Error('UserMailView Error', e);
}
}
};
// 우편 삭제
export const UserMailDelete = async (token, params) => {
try {
const res = await Axios.delete(`/api/v1/users/mail/delete`, {
headers: { Authorization: `Bearer ${token}` },
data: params,
});
return res.data;
} catch (e) {
if (e instanceof Error) {
throw new Error('UserMailView Error', e);
}
}
};
// 우편 아이템 삭제
export const UserMailItemDelete = async (token, params) => {
try {
const res = await Axios.delete(`/api/v1/users/mail/delete/item`, {
headers: { Authorization: `Bearer ${token}` },
data: params,
});
return res.data;
} catch (e) {
if (e instanceof Error) {
throw new Error('UserMailItemDelete Error', e);
}
}
};
// 유저 우편 상세 정보 조회
export const UserMailDetailView = async (token, id) => {
try {
const res = await Axios.get(`/api/v1/users/mail/${id}}`, {
headers: { Authorization: `Bearer ${token}` },
});
return res.data.data;
} catch (e) {
if (e instanceof Error) {
throw new Error('UserMailDetailView Error', e);
}
}
};
// 마이홈 조회
export const UserMyhomeView = async (token, guid) => {
try {
const res = await Axios.get(`/api/v1/users/myhome?guid=${guid}`, {
headers: { Authorization: `Bearer ${token}` },
});
return res.data.data;
} catch (e) {
if (e instanceof Error) {
throw new Error('UserMyhomeView Error', e);
}
}
};

134
src/apis/WhiteList.js Normal file
View File

@@ -0,0 +1,134 @@
//운영서비스 관리 - 화이트 리스트 api 연결
import { Axios } from '../utils';
export const WhiteListData = async token => {
try {
const res = await Axios.get(`/api/v1/white-list/list`, {
headers: { Authorization: `Bearer ${token}` },
});
return res.data.data.list;
} catch (e) {
if (e instanceof Error) {
throw new Error('whiteList Error', e);
}
}
};
// 선택 삭제
export const WhiteListDelete = async (token, params) => {
try {
const res = await Axios.delete(`/api/v1/white-list`, {
headers: { Authorization: `Bearer ${token}` },
data: { list: params },
});
return res;
} catch (e) {
if (e instanceof Error) {
throw new Error('WhiteListDelete', e);
}
}
};
// 선택 승인
export const WhiteListAllow = async (token, params) => {
try {
const res = await Axios.patch(
`/api/v1/white-list`,
{ list: params },
{
headers: { Authorization: `Bearer ${token}` },
},
);
return res;
} catch (e) {
if (e instanceof Error) {
throw new Error('WhiteListAllow', e);
}
}
};
// 화이트 리스트 등록 (단일)
export const WhiteListRegist = async (token, params) => {
try {
const res = await Axios.post(`/api/v1/white-list`, params, {
headers: { Authorization: `Bearer ${token}` },
});
return res;
} catch (e) {
if (e instanceof Error) {
throw new Error('WhiteListRegist', e);
}
}
};
// 화이트리스트 엑셀 업로더
export const WhiteListExelUpload = async (token, file) => {
const exelFile = new FormData();
exelFile.append('file', file);
try {
const res = await Axios.post(`/api/v1/white-list/excel-upload`, exelFile, {
headers: {
'Content-Type': 'multipart/form-data',
Authorization: `Bearer ${token}`,
},
});
return res;
} catch (e) {
if (e instanceof Error) {
throw new Error('WhiteListExelUpload', e);
}
}
};
// 화이트 리스트 등록(복수) -> 등록하는 것임
export const WhiteListMultiRegsit = async (token, file) => {
const exelFile = new FormData();
exelFile.append('file', file);
try {
const res = await Axios.post(`/api/v1/white-list/multiPost`, exelFile, {
headers: {
'Content-Type': 'multipart/form-data',
Authorization: `Bearer ${token}`,
},
});
return res;
} catch (e) {
if (e instanceof Error) {
throw new Error('WhiteListMultiRegsit', e);
}
}
};
// 엑셀 다운로드
export const WhiteListExport = async (token, fileName) => {
try{
await Axios.get(`/api/v1/white-list/excelDownLoad`, {
headers: { Authorization: `Bearer ${token}` },
responseType: 'blob',
}).then(response => {
const href = URL.createObjectURL(response.data);
const link = document.createElement('a');
const fileName = 'Caliverse_whitelist.xlsx';
link.href = href;
link.setAttribute('download', `${fileName}`);
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
URL.revokeObjectURL(href);
})
}catch(e) {
if(e instanceof Error) {
throw new Error('WhiteListExport Error', e);
}
}
};

14
src/apis/index.js Normal file
View File

@@ -0,0 +1,14 @@
export * from './Admin';
export * from './Auth';
export * from './Group';
export * from './History';
export * from './Mail';
export * from './Notice';
export * from './WhiteList';
export * from './BlackList';
export * from './Users';
export * from './Indicators';
export * from './Item';
export * from './Event';
export * from './Calium';
export * from './Land';