diff --git a/src/api/agent.js b/src/api/agent.js index b14de7c..d1a19c4 100644 --- a/src/api/agent.js +++ b/src/api/agent.js @@ -39,10 +39,48 @@ async function searchAgentByNickname(query) { } } +// 에이전트 소속 크리에이터 목록 조회 +// GET /admin/partner/agent/{agentId}/creator/list +// params: { page, size } +async function getAgentAssignedCreatorList(agentId, page = 1, size = 20) { + // Spring Pageable은 일반적으로 0-based page index를 사용 + const zeroBasedPage = Math.max(0, Number(page || 1) - 1) + return Vue.axios.get(`/admin/partner/agent/${agentId}/creator/list`, { + params: { page: zeroBasedPage, size } + }) +} + +// 추가 가능한 크리에이터 검색 +// GET /admin/partner/agent/creator/search?search_word=... +async function searchAdminAgentAssignableCreators(search_word) { + return Vue.axios.get('/admin/partner/agent/creator/search', { + params: { search_word } + }) +} + +// 에이전트에 크리에이터 소속 시키기 +// POST /admin/partner/agent/assignment +// payload: { agentId, creatorId, assignedAt } // assignedAt: LocalDateTime string (yyyy-MM-ddTHH:mm:ss) +async function assignAgentCreator(payload) { + return Vue.axios.post('/admin/partner/agent/assignment', payload) +} + +// 크리에이터 소속 해제 +// POST /admin/partner/agent/assignment/remove +// payload: { creatorId, unassignedAt } // unassignedAt: LocalDateTime string +async function removeAgentCreator(payload) { + return Vue.axios.post('/admin/partner/agent/assignment/remove', payload) +} + export { getAgentList, getAgentSettlementRatioList, createAgentSettlementRatio, updateAgentSettlementRatio, searchAgentByNickname, + // 에이전트 상세 - 소속 크리에이터 관리 + getAgentAssignedCreatorList, + searchAdminAgentAssignableCreators, + assignAgentCreator, + removeAgentCreator, } diff --git a/src/views/Agent/AgentDetail.vue b/src/views/Agent/AgentDetail.vue index d5c20ca..fc62204 100644 --- a/src/views/Agent/AgentDetail.vue +++ b/src/views/Agent/AgentDetail.vue @@ -7,21 +7,262 @@ > mdi-arrow-left - 에이전트 상세 + {{ (agentNickname || '-') + ' 소속 크리에이터' }} + + 소속 추가 + + + + + - 에이전트 상세 페이지 (준비중) - Agent ID: {{ agentId }} + + + + + + 닉네임 + + + 소속일 + + + 관리 + + + + + + + 불러오는 중... + + + + + 소속된 크리에이터가 없습니다. + + + + + {{ row.creatorNickname }} + + + {{ formatDateTime(row.assignedAt) }} + + + + 소속 해제 + + + + + + + + + + + + + + + + + 크리에이터 소속 추가 + + + + + + + + + + + + + + 취소 + + + 추가 + + + + + + + + + 소속 해제 + + + 크리에이터: {{ unassignDialog.target && unassignDialog.target.creatorNickname || '-' }} + + + + + + + + + + + + + + + + + + + + 취소 + + + 해제 + + + + - - diff --git a/src/views/Agent/AgentList.vue b/src/views/Agent/AgentList.vue index b47325c..83d45b1 100644 --- a/src/views/Agent/AgentList.vue +++ b/src/views/Agent/AgentList.vue @@ -193,7 +193,7 @@ export default { ) }, goAgentDetail(item) { - this.$router.push({ name: 'AgentDetail', params: { agentId: item.agentId } }) + this.$router.push({ name: 'AgentDetail', params: { agentId: item.agentId }, query: { nickname: item.agentNickname } }) }, goSettlement(item, type) { const id = item.agentId
Agent ID: {{ agentId }}