관리자 - 추천 라이브 크리에이터 배너 API 적용
This commit is contained in:
		| @@ -1,27 +1,32 @@ | |||||||
| import Vue from 'vue'; | import Vue from 'vue'; | ||||||
|  |  | ||||||
| async function createRecommendSudaCreator(formData) { | async function createRecommendCreatorBanner(formData) { | ||||||
|     return Vue.axios.post('/admin/suda/recommend-suda-creator', formData, { |     return Vue.axios.post('/admin/live/recommend-creator', formData, { | ||||||
|         headers: { |         headers: { | ||||||
|             "Content-Type": "multipart/form-data", |             "Content-Type": "multipart/form-data", | ||||||
|         }, |         }, | ||||||
|     }); |     }); | ||||||
| } | } | ||||||
|  |  | ||||||
| async function updateRecommendSudaCreator(formData) { | async function updateRecommendCreatorBanner(formData) { | ||||||
|     return Vue.axios.put('/admin/suda/recommend-suda-creator', formData, { |     return Vue.axios.put('/admin/live/recommend-creator', formData, { | ||||||
|         headers: { |         headers: { | ||||||
|             "Content-Type": "multipart/form-data", |             "Content-Type": "multipart/form-data", | ||||||
|         }, |         }, | ||||||
|     }); |     }); | ||||||
| } | } | ||||||
|  |  | ||||||
| async function updateRecommendSudaCreatorOrders(firstOrders, ids) { | async function updateRecommendCreatorBannerOrders(firstOrders, ids) { | ||||||
|     return Vue.axios.put('/admin/suda/recommend-suda-creator/orders', { firstOrders: firstOrders, ids: ids }) |     return Vue.axios.put('/admin/live/recommend-creator/orders', {firstOrders: firstOrders, ids: ids}) | ||||||
| } | } | ||||||
|  |  | ||||||
| async function getRecommendSudaCreator(page) { | async function getRecommendCreatorBanner(page) { | ||||||
|     return Vue.axios.get("/admin/suda/recommend-suda-creator?page=" + (page - 1) + "&size=20"); |     return Vue.axios.get("/admin/live/recommend-creator?page=" + (page - 1) + "&size=20"); | ||||||
| } | } | ||||||
|  |  | ||||||
| export { createRecommendSudaCreator, updateRecommendSudaCreator, updateRecommendSudaCreatorOrders, getRecommendSudaCreator }; | export { | ||||||
|  |     createRecommendCreatorBanner, | ||||||
|  |     updateRecommendCreatorBanner, | ||||||
|  |     updateRecommendCreatorBannerOrders, | ||||||
|  |     getRecommendCreatorBanner | ||||||
|  | }; | ||||||
|   | |||||||
| @@ -2,7 +2,7 @@ | |||||||
|   <div> |   <div> | ||||||
|     <v-toolbar dark> |     <v-toolbar dark> | ||||||
|       <v-spacer /> |       <v-spacer /> | ||||||
|       <v-toolbar-title>추천 요즘라이브</v-toolbar-title> |       <v-toolbar-title>추천 라이브 크리에이터</v-toolbar-title> | ||||||
|       <v-spacer /> |       <v-spacer /> | ||||||
|     </v-toolbar> |     </v-toolbar> | ||||||
|  |  | ||||||
| @@ -19,7 +19,7 @@ | |||||||
|             depressed |             depressed | ||||||
|             @click="showWriteDialog" |             @click="showWriteDialog" | ||||||
|           > |           > | ||||||
|             추천 요즘라이브 등록 |             추천 라이브 크리에이터 등록 | ||||||
|           </v-btn> |           </v-btn> | ||||||
|         </v-col> |         </v-col> | ||||||
|       </v-row> |       </v-row> | ||||||
| @@ -29,7 +29,7 @@ | |||||||
|           <v-data-table |           <v-data-table | ||||||
|             :headers="headers" |             :headers="headers" | ||||||
|             :items="recommendLiveList" |             :items="recommendLiveList" | ||||||
|             :loading="isLoading" |             :loading="is_loading" | ||||||
|             :items-per-page="20" |             :items-per-page="20" | ||||||
|             item-key="id" |             item-key="id" | ||||||
|             class="elevation-1" |             class="elevation-1" | ||||||
| @@ -53,7 +53,7 @@ | |||||||
|                       width="100" |                       width="100" | ||||||
|                     > |                     > | ||||||
|                   </td> |                   </td> | ||||||
|                   <td> <h3>{{ item.creatorNickname }}</h3> </td> |                   <td><h3>{{ item.creatorNickname }}</h3></td> | ||||||
|                   <td> |                   <td> | ||||||
|                     <h3> |                     <h3> | ||||||
|                       {{ item.startDate }} ~ {{ item.endDate }} |                       {{ item.startDate }} ~ {{ item.endDate }} | ||||||
| @@ -69,7 +69,7 @@ | |||||||
|                   </td> |                   </td> | ||||||
|                   <td> |                   <td> | ||||||
|                     <v-btn |                     <v-btn | ||||||
|                       :disabled="isLoading" |                       :disabled="is_loading" | ||||||
|                       @click="showModifyDialog(item)" |                       @click="showModifyDialog(item)" | ||||||
|                     > |                     > | ||||||
|                       수정 |                       수정 | ||||||
| @@ -100,11 +100,11 @@ | |||||||
|         persistent |         persistent | ||||||
|       > |       > | ||||||
|         <v-card> |         <v-card> | ||||||
|           <v-card-title>추천 요즘라이브 등록</v-card-title> |           <v-card-title>추천 라이브 크리에이터 등록</v-card-title> | ||||||
|           <v-card-text> |           <v-card-text> | ||||||
|             <v-row align="center"> |             <v-row align="center"> | ||||||
|               <v-col cols="4"> |               <v-col cols="4"> | ||||||
|                 요즘친구 |                 크리에이터 | ||||||
|               </v-col> |               </v-col> | ||||||
|               <v-col cols="8"> |               <v-col cols="8"> | ||||||
|                 <v-select |                 <v-select | ||||||
| @@ -131,7 +131,7 @@ | |||||||
|                   class="datepicker" |                   class="datepicker" | ||||||
|                   format="YYYY-MM-DD H:i" |                   format="YYYY-MM-DD H:i" | ||||||
|                 /> |                 /> | ||||||
|                 <div> ~ </div> |                 <div> ~</div> | ||||||
|                 <datetime |                 <datetime | ||||||
|                   v-model="end_date" |                   v-model="end_date" | ||||||
|                   class="datepicker" |                   class="datepicker" | ||||||
| @@ -178,7 +178,7 @@ | |||||||
|               </v-col> |               </v-col> | ||||||
|             </v-row> |             </v-row> | ||||||
|           </v-card-text> |           </v-card-text> | ||||||
|           <v-card-actions v-show="!isLoading"> |           <v-card-actions v-show="!is_loading"> | ||||||
|             <v-spacer /> |             <v-spacer /> | ||||||
|             <v-btn |             <v-btn | ||||||
|               color="blue darken-1" |               color="blue darken-1" | ||||||
| @@ -213,15 +213,15 @@ | |||||||
| <script> | <script> | ||||||
| import Draggable from 'vuedraggable'; | import Draggable from 'vuedraggable'; | ||||||
| import datetime from 'vuejs-datetimepicker'; | import datetime from 'vuejs-datetimepicker'; | ||||||
| import * as accountApi from "@/api/member"; | import * as memberApi from "@/api/member"; | ||||||
| import * as api from "@/api/recommend_suda_creator" | import * as api from "@/api/recommend_suda_creator" | ||||||
|  |  | ||||||
| export default { | export default { | ||||||
|   name: "LiveRecommendView", |   name: "LiveRecommendView", | ||||||
|   components: { datetime, Draggable }, |   components: {datetime, Draggable}, | ||||||
|   data() { |   data() { | ||||||
|     return { |     return { | ||||||
|       isLoading: false, |       is_loading: false, | ||||||
|       page: 1, |       page: 1, | ||||||
|       total_page: 0, |       total_page: 0, | ||||||
|       show_write_dialog: false, |       show_write_dialog: false, | ||||||
| @@ -242,7 +242,7 @@ export default { | |||||||
|           value: 'image', |           value: 'image', | ||||||
|         }, |         }, | ||||||
|         { |         { | ||||||
|           text: '요즘친구', |           text: '크리에이터', | ||||||
|           align: 'center', |           align: 'center', | ||||||
|           sortable: false, |           sortable: false, | ||||||
|           value: 'creatorNickname', |           value: 'creatorNickname', | ||||||
| @@ -271,7 +271,7 @@ export default { | |||||||
|  |  | ||||||
|   async created() { |   async created() { | ||||||
|     await this.getCreatorList() |     await this.getCreatorList() | ||||||
|     await this.getRecommendSudaCreator() |     await this.getRecommendCreator() | ||||||
|   }, |   }, | ||||||
|  |  | ||||||
|   methods: { |   methods: { | ||||||
| @@ -284,7 +284,7 @@ export default { | |||||||
|  |  | ||||||
|       const firstOrders = (this.page - 1) * 20 + 1 |       const firstOrders = (this.page - 1) * 20 + 1 | ||||||
|  |  | ||||||
|       const res = await api.updateRecommendSudaCreatorOrders(firstOrders, ids) |       const res = await api.updateRecommendCreatorBannerOrders(firstOrders, ids) | ||||||
|       if (res.status === 200 && res.data.success === true) { |       if (res.status === 200 && res.data.success === true) { | ||||||
|         this.notifySuccess(res.data.message) |         this.notifySuccess(res.data.message) | ||||||
|       } |       } | ||||||
| @@ -306,7 +306,7 @@ export default { | |||||||
|  |  | ||||||
|       try { |       try { | ||||||
|         const formData = new FormData() |         const formData = new FormData() | ||||||
|         formData.append("recommend_suda_creator_id", this.selected_recommend_live.id) |         formData.append("recommend_creator_banner_id", this.selected_recommend_live.id) | ||||||
|  |  | ||||||
|         if (this.image !== null) { |         if (this.image !== null) { | ||||||
|           formData.append("image", this.image) |           formData.append("image", this.image) | ||||||
| @@ -328,12 +328,12 @@ export default { | |||||||
|           formData.append("is_adult", this.is_adult) |           formData.append("is_adult", this.is_adult) | ||||||
|         } |         } | ||||||
|  |  | ||||||
|         const res = await api.updateRecommendSudaCreator(formData) |         const res = await api.updateRecommendCreatorBanner(formData) | ||||||
|         if (res.status === 200 && res.data.success === true) { |         if (res.status === 200 && res.data.success === true) { | ||||||
|           this.cancel() |           this.cancel() | ||||||
|           this.notifySuccess('수정되었습니다.') |           this.notifySuccess('수정되었습니다.') | ||||||
|           this.page = 1 |           this.page = 1 | ||||||
|           await this.getRecommendSudaCreator() |           await this.getRecommendCreator() | ||||||
|         } else { |         } else { | ||||||
|           this.notifyError(res.data.message || '알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.') |           this.notifyError(res.data.message || '알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.') | ||||||
|           this.is_loading = false |           this.is_loading = false | ||||||
| @@ -349,7 +349,7 @@ export default { | |||||||
|     async submit() { |     async submit() { | ||||||
|       if (this.is_loading) return; |       if (this.is_loading) return; | ||||||
|  |  | ||||||
|       this.isLoading = true |       this.is_loading = true | ||||||
|  |  | ||||||
|       try { |       try { | ||||||
|         const formData = new FormData() |         const formData = new FormData() | ||||||
| @@ -359,13 +359,14 @@ export default { | |||||||
|         formData.append("end_date", this.end_date) |         formData.append("end_date", this.end_date) | ||||||
|         formData.append("is_adult", this.is_adult) |         formData.append("is_adult", this.is_adult) | ||||||
|  |  | ||||||
|         const res = await api.createRecommendSudaCreator(formData); |         const res = await api.createRecommendCreatorBanner(formData); | ||||||
|         if (res.status === 200 && res.data.success === true) { |         if (res.status === 200 && res.data.success === true) { | ||||||
|           this.cancel() |           this.cancel() | ||||||
|           this.notifySuccess('등록되었습니다.') |           this.notifySuccess('등록되었습니다.') | ||||||
|           this.page = 1 |           this.page = 1 | ||||||
|           await this.getRecommendSudaCreator() |           await this.getRecommendCreator() | ||||||
|         } else { |         } else { | ||||||
|  |           this.is_loading = false | ||||||
|           this.notifyError(res.data.message || '알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.') |           this.notifyError(res.data.message || '알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.') | ||||||
|           this.is_loading = false |           this.is_loading = false | ||||||
|         } |         } | ||||||
| @@ -408,14 +409,14 @@ export default { | |||||||
|     }, |     }, | ||||||
|  |  | ||||||
|     async next() { |     async next() { | ||||||
|       await this.getRecommendSudaCreator() |       await this.getRecommendCreator() | ||||||
|     }, |     }, | ||||||
|  |  | ||||||
|     async getRecommendSudaCreator() { |     async getRecommendCreator() { | ||||||
|       this.isLoading = true |       this.is_loading = true | ||||||
|  |  | ||||||
|       try { |       try { | ||||||
|         const res = await api.getRecommendSudaCreator(this.page) |         const res = await api.getRecommendCreatorBanner(this.page) | ||||||
|  |  | ||||||
|         if (res.status === 200 && res.data.success === true) { |         if (res.status === 200 && res.data.success === true) { | ||||||
|           const data = res.data.data |           const data = res.data.data | ||||||
| @@ -435,15 +436,15 @@ export default { | |||||||
|         this.notifyError('알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.') |         this.notifyError('알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.') | ||||||
|         this.is_loading = false |         this.is_loading = false | ||||||
|       } finally { |       } finally { | ||||||
|         this.isLoading = false |         this.is_loading = false | ||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|  |  | ||||||
|     async getCreatorList() { |     async getCreatorList() { | ||||||
|       this.isLoading = true |       this.is_loading = true | ||||||
|  |  | ||||||
|       try { |       try { | ||||||
|         const res = await accountApi.getCounselorList() |         const res = await memberApi.getCreatorAllList() | ||||||
|  |  | ||||||
|         if (res.status === 200 && res.data.success === true) { |         if (res.status === 200 && res.data.success === true) { | ||||||
|           this.creatorList = res.data.data.map((item) => { |           this.creatorList = res.data.data.map((item) => { | ||||||
| @@ -457,7 +458,7 @@ export default { | |||||||
|         this.notifyError('알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.') |         this.notifyError('알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.') | ||||||
|         this.is_loading = false |         this.is_loading = false | ||||||
|       } finally { |       } finally { | ||||||
|         this.isLoading = false |         this.is_loading = false | ||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|     imageAdd(payload) { |     imageAdd(payload) { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Yu Sung
					Yu Sung