index.ts 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. import request from '@/utils/request';
  2. import { AxiosPromise } from 'axios';
  3. import {
  4. RecommendCategoryConfigVO,
  5. RecommendCategoryConfigForm,
  6. RecommendCategoryConfigQuery
  7. } from '@/api/enterprisePurchase/recommendCategoryConfig/types';
  8. /**
  9. * 查询为你推荐分类配置列表
  10. * @param query
  11. * @returns {*}
  12. */
  13. export const listRecommendCategoryConfig = (query?: RecommendCategoryConfigQuery): AxiosPromise<RecommendCategoryConfigVO[]> => {
  14. return request({
  15. url: '/mall/recommendCategoryConfig/list',
  16. method: 'get',
  17. params: query
  18. });
  19. };
  20. /**
  21. * 查询为你推荐分类配置详细
  22. * @param id
  23. */
  24. export const getRecommendCategoryConfig = (id: string | number): AxiosPromise<RecommendCategoryConfigVO> => {
  25. return request({
  26. url: '/mall/recommendCategoryConfig/' + id,
  27. method: 'get'
  28. });
  29. };
  30. /**
  31. * 新增为你推荐分类配置
  32. * @param data
  33. */
  34. export const addRecommendCategoryConfig = (data: RecommendCategoryConfigForm) => {
  35. return request({
  36. url: '/mall/recommendCategoryConfig',
  37. method: 'post',
  38. data: data
  39. });
  40. };
  41. /**
  42. * 修改为你推荐分类配置
  43. * @param data
  44. */
  45. export const updateRecommendCategoryConfig = (data: RecommendCategoryConfigForm) => {
  46. return request({
  47. url: '/mall/recommendCategoryConfig',
  48. method: 'put',
  49. data: data
  50. });
  51. };
  52. /**
  53. * 删除为你推荐分类配置
  54. * @param id
  55. */
  56. export const delRecommendCategoryConfig = (id: string | number | Array<string | number>) => {
  57. return request({
  58. url: '/mall/recommendCategoryConfig/' + id,
  59. method: 'delete'
  60. });
  61. };
  62. export function changeStatus(id: string | number, status: number) {
  63. const data = {
  64. id,
  65. status
  66. };
  67. return request({
  68. url: '/mall/recommendCategoryConfig/changeStatus',
  69. method: 'put',
  70. data: data
  71. });
  72. }