import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { SysShopManagerVO, SysShopManagerQuery } from './types';

/**
 * 查询门店管理员拓展信息列表
 */
export function listShopManager(query?: SysShopManagerQuery): AxiosPromise<SysShopManagerVO[]> {
  return request({
    url: '/system/shopManager/list',
    method: 'get',
    params: query
  });
}

/**
 * 查询门店管理员拓展信息详细
 */
export function getShopManager(userId: string | number): AxiosPromise<SysShopManagerVO> {
  return request({
    url: '/system/shopManager/' + userId,
    method: 'get'
  });
}

/**
 * 新增门店管理员拓展信息
 */
export function addShopManager(data: SysShopManagerVO) {
  return request({
    url: '/system/shopManager',
    method: 'post',
    data: data
  });
}

/**
 * 修改门店管理员拓展信息
 */
export function updateShopManager(data: SysShopManagerVO) {
  return request({
    url: '/system/shopManager',
    method: 'put',
    data: data
  });
}

/**
 * 删除门店管理员拓展信息
 */
export function delShopManager(userId: string | number | Array<string | number>) {
  return request({
    url: '/system/shopManager/' + userId,
    method: 'delete'
  });
}