/*
 * @Author: wj 1454560336@qq.com
 * @Date: 2023-09-18 10:57:47
 * @LastEditors: wenjie 1454560336@qq.com
 * @LastEditTime: 2024-03-18 14:40:05
 * @FilePath: \admin-manage\src\api\appConfig.js
 * @Description: 
 * 
 * Copyright (c) 2023 by ${git_name_email}, All Rights Reserved. 
 */
import request from '@/utils/request'
import { isLocal } from '@/utils'

//替换为开发服务名
const service = isLocal() ? '/zswl-cloud-shop' : '/zswl-cloud-shop'

// 菜单列表
export function getMenu(params) {
  return request({
    url: service+'/menu/list',
    method: 'get',
    params
  })
}

// 删除菜单
export function del(params) {
  return request({
    url: '/zswl-cloud-shop/menu/del',
    method: 'get',
    params
  })
}

// 新增、编辑菜单
export function addOrUpdate(data) {
  return request({
    url: '/zswl-cloud-shop/menu/addOrUpdate',
    method: 'post',
    data
  })
}

// 获取1级下拉菜单列表
export function getMenuName(params) {
  return request({
    url: '/zswl-cloud-shop/menu/menuNameAndId',
    method: 'get',
    params
  })
}

// 获取所有下拉菜单列表
export function getMenuData(params) {
  return request({
    url: '/zswl-cloud-shop/menu/data',
    method: 'get',
    params
  })
}

// banner列表
export function bannerList(params) {
  return request({
    url: '/zswl-cloud-shop/banner/list',
    method: 'get',
    params
  })
}

// 删除banner
export function delBanner(params) {
  return request({
    url: '/zswl-cloud-shop/banner/del',
    method: 'get',
    params
  })
}

// 新增、编辑banner
export function addOrUpdateBanner(data) {
  return request({
    url: '/zswl-cloud-shop/banner/addOrUpdate',
    method: 'post',
    data
  })
}

// banner列表
export function advList(params) {
  return request({
    url: service+'/advertsInfo/search',
    method: 'get',
    params
  })
}

// 删除banner
export function delAdv(params) {
  return request({
    url: '/zswl-cloud-shop/advertsInfo/del',
    method: 'get',
    params
  })
}

// 新增、编辑banner
export function addOrUpdateAdv(data) {
  return request({
    url: service+'/advertsInfo/addOrUpdate',
    method: 'post',
    data
  })
}