brand.ts 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. import request from '@/config/axios'
  2. /**
  3. * 商品品牌
  4. */
  5. export interface BrandVO {
  6. /**
  7. * 品牌编号
  8. */
  9. id?: number
  10. /**
  11. * 品牌名称
  12. */
  13. name: string
  14. /**
  15. * 品牌图片
  16. */
  17. picUrl: string
  18. /**
  19. * 品牌排序
  20. */
  21. sort?: number
  22. /**
  23. * 品牌描述
  24. */
  25. description?: string
  26. /**
  27. * 开启状态
  28. */
  29. status: number
  30. }
  31. // 创建商品品牌
  32. export const createBrand = (data: BrandVO) => {
  33. return request.post({ url: '/product/brand/create', data })
  34. }
  35. // 更新商品品牌
  36. export const updateBrand = (data: BrandVO) => {
  37. return request.put({ url: '/product/brand/update', data })
  38. }
  39. // 删除商品品牌
  40. export const deleteBrand = (id: number) => {
  41. return request.delete({ url: `/product/brand/delete?id=${id}` })
  42. }
  43. // 获得商品品牌
  44. export const getBrand = (id: number) => {
  45. return request.get({ url: `/product/brand/get?id=${id}` })
  46. }
  47. // 获得商品品牌列表
  48. export const getBrandParam = (params: PageParam) => {
  49. return request.get({ url: '/product/brand/page', params })
  50. }
  51. // 获得商品品牌精简信息列表
  52. export const getSimpleBrandList = () => {
  53. return request.get({ url: '/product/brand/list-all-simple' })
  54. }