diff --git a/src/api/category.js b/src/api/category.js new file mode 100644 index 0000000..4dea43e --- /dev/null +++ b/src/api/category.js @@ -0,0 +1,28 @@ +import Vue from 'vue'; + +async function saveCategory(title) { + return Vue.axios.post('/category', {title: title, contentIdList: []}); +} + +async function modifyCategory(categoryId, title = null, addContentIdList = [], removeContentIdList = []) { + return Vue.axios.put('/category', { + categoryId: categoryId, + title: title, + addContentIdList: addContentIdList, + removeContentIdList: removeContentIdList + }); +} + +async function deleteCategory(categoryId) { + return Vue.axios.delete('/category/' + categoryId) +} + +async function getCategoryList(creatorId) { + return Vue.axios.get('/category?creatorId=' + creatorId) +} + +async function updateCategoryOrders(ids) { + return Vue.axios.put('/category/orders', {ids: ids}) +} + +export {saveCategory, modifyCategory, deleteCategory, getCategoryList, updateCategoryOrders} diff --git a/src/api/content_category.js b/src/api/content_category.js new file mode 100644 index 0000000..bca957f --- /dev/null +++ b/src/api/content_category.js @@ -0,0 +1,18 @@ +import Vue from "vue"; + +async function getContentInCategory(categoryId, page) { + return Vue.axios.get( + "/creator-admin/content-category?category_id=" + categoryId + + "&page=" + (page - 1) + + "&size=10" + ) +} + +async function searchContentNotInCategory(categoryId, searchWord) { + return Vue.axios.get( + "/creator-admin/content-category/search?category_id=" + categoryId + + "&search_word=" + searchWord + ) +} + +export {getContentInCategory, searchContentNotInCategory} diff --git a/src/router/index.js b/src/router/index.js index 139af9c..5ef7e7e 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -20,6 +20,11 @@ const routes = [ name: 'ContentList', component: () => import(/* webpackChunkName: "content" */ '../views/Content/ContentList.vue') }, + { + path: '/content/category/list', + name: 'ContentCategoryList', + component: () => import(/* webpackChunkName: "content" */ '../views/Content/ContentCategoryList.vue') + }, { path: '/calculate/live', name: 'CalculateLive', diff --git a/src/views/Content/ContentCategoryList.vue b/src/views/Content/ContentCategoryList.vue new file mode 100644 index 0000000..12f54dc --- /dev/null +++ b/src/views/Content/ContentCategoryList.vue @@ -0,0 +1,677 @@ + + + + +