feat(frontend): X 봇 API 클라이언트 함수 추가
- getXBot, lookupXProfile, createXBot, updateXBot, deleteXBot Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
86769f1edc
commit
ec0e587434
1 changed files with 55 additions and 0 deletions
|
|
@ -66,6 +66,61 @@ export async function deleteYouTubeBot(id) {
|
||||||
return fetchAuthApi(`/admin/youtube-bots/${id}`, { method: 'DELETE' });
|
return fetchAuthApi(`/admin/youtube-bots/${id}`, { method: 'DELETE' });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* X 봇 상세 조회
|
||||||
|
* @param {number} id - X 봇 DB ID
|
||||||
|
* @returns {Promise<object>}
|
||||||
|
*/
|
||||||
|
export async function getXBot(id) {
|
||||||
|
return fetchAuthApi(`/admin/x-bots/${id}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* X username으로 프로필 정보 조회
|
||||||
|
* @param {string} username - X username (@ 없이)
|
||||||
|
* @returns {Promise<object>}
|
||||||
|
*/
|
||||||
|
export async function lookupXProfile(username) {
|
||||||
|
return fetchAuthApi('/admin/x-bots/lookup', {
|
||||||
|
method: 'POST',
|
||||||
|
body: JSON.stringify({ username }),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* X 봇 추가
|
||||||
|
* @param {object} data - 봇 데이터
|
||||||
|
* @returns {Promise<object>}
|
||||||
|
*/
|
||||||
|
export async function createXBot(data) {
|
||||||
|
return fetchAuthApi('/admin/x-bots', {
|
||||||
|
method: 'POST',
|
||||||
|
body: JSON.stringify(data),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* X 봇 수정
|
||||||
|
* @param {number} id - X 봇 DB ID
|
||||||
|
* @param {object} data - 업데이트할 데이터
|
||||||
|
* @returns {Promise<object>}
|
||||||
|
*/
|
||||||
|
export async function updateXBot(id, data) {
|
||||||
|
return fetchAuthApi(`/admin/x-bots/${id}`, {
|
||||||
|
method: 'PUT',
|
||||||
|
body: JSON.stringify(data),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* X 봇 삭제
|
||||||
|
* @param {number} id - X 봇 DB ID
|
||||||
|
* @returns {Promise<object>}
|
||||||
|
*/
|
||||||
|
export async function deleteXBot(id) {
|
||||||
|
return fetchAuthApi(`/admin/x-bots/${id}`, { method: 'DELETE' });
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 봇 시작
|
* 봇 시작
|
||||||
* @param {string} id - 봇 ID
|
* @param {string} id - 봇 ID
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue