import { request } from '@/service/request';
/**
 * 分页获取
 * @param params
 * @returns
 */
export function fetchTypeList(data: any) {
  return request({
    url: '/smqjh-pms/api/v1/member/type/page',
    method: 'get',
    params: data
  });
}

/**
 *
 * 删除
 * @returns
 */
export function fetchDelType(id: string) {
  return request({
    url: `/smqjh-pms/api/v1/member/type/delete/${id}`,
    method: 'delete'
  });
}

/**
 * 保存
 * @returns
 */
export function fetchAddType(data: any) {
  return request({
    url: '/smqjh-pms/api/v1/member/type/save',
    method: 'post',
    data
  });
}

/**
 * 编辑
 * @returns
 */
export function fetchEditType(data: any) {
  return request({
    url: '/smqjh-pms/api/v1/member/type/update',
    method: 'put',
    data
  });
}

/**
 * 详情
 * @returns
 */
export function fetchTypeDetail(id: any) {
  return request({
    url: `/smqjh-pms/api/v1/member/type/detail/${id}`,
    method: 'get'
  });
}

/**
 * 商品分页
 * @returns
 */
export function fetchGoodsList(data: any) {
  return request({
    url: '/smqjh-pms/api/v1/product/page',
    method: 'post',
    data
  });
}

/**
 * 企业渠道
 * @returns
 */
export function fetchFirstChannel() {
  return request({
    url: `/smqjh-system/api/v1/channel/listFirstChannel`,
    method: 'get'
  });
}

/**
 * 切换状态
 * @returns
 */
export function fetchUpdateStatus(id: any, status: any) {
  return request({
    url: `/smqjh-pms/api/v1/member/type/changeStatus/${id}/${status}`,
    method: 'put'
  });
}
