import request from '@/sheep/request';

const ClerkApi = {
  // 创建店员申请
  createClerkApply: (data) => {
    return request({
      url: '/worker/clerk-apply/create',
      method: 'POST',
      data,
      custom: {
  		showSuccess: true,
  		successMsg: '提交成功'
      },
    });
  },
  // 更新店员申请
  updateClerkApply: (data) => {
    return request({
      url: '/worker/clerk-apply/update',
      method: 'PUT',
      data,
      custom: {
  		showSuccess: true,
  		successMsg: '提交成功'
      },
    });
  },
  // 更新店员在线状态
  updateOnlineStatus: (data) => {
    return request({
      url: '/worker/clerk-apply/updateOnlineStatus',
      method: 'PUT',
      data,
      custom: {
  		showSuccess: true,
  		successMsg: '提交成功'
      },
    });
  },
  // 获得店员申请
  getClerkApply: (id) => {
    return request({
      url: '/worker/clerk-apply/get',
      method: 'GET',
      params: { id },
  	  custom: {
  	    auth: true,
  	    showLoading: false,
  	  },
    });
  },
  // 获得店员等级
  getClerkLevel: (id) => {
    return request({
      url: '/worker/clerk-apply/getClerkLevel',
      method: 'GET',
      params: { id },
  	  custom: {
  	    auth: true,
  	    showLoading: false,
  	  },
    });
  },
  // 获得店员申请
  getClerk: (params) => {
    return request({
      url: '/worker/clerk/get',
      method: 'GET',
	  params, 
  	  custom: {
  	    auth: false,
  	    showLoading: false,
  	  },
    });
  },
  // 获得店员盲盒
  getClerkBlind: () => {
    return request({
      url: '/worker/clerk/getClerkBlind',
      method: 'GET',
  	  custom: {
  	    auth: false,
  	    showLoading: false,
  	  },
    });
  },
  // 获得商品分类列表
  getCategoryListByParentId: (parentId) => {
    return request({
      url: '/worker/category/getCategoryListByParentId',
      method: 'GET',
      params: { parentId },
  	  custom: {
  	    auth: false,
  	    showLoading: false,
  	  },
    });
  },
  
  // 保存技能管理
  saveGoodsList: (data) => {
    return request({
      url: '/worker/clerk-apply/save',
      method: 'PUT',
      data,
      custom: {
  		showSuccess: true,
  		successMsg: '保存成功'
      },
    });
  },
  // 获得店员列表
  getClerkPage: (params) => {
    return request({
      url: '/worker/clerk/page',
      method: 'GET',
      params,
      custom: {
        auth: false,
        showLoading: false,
      },
    });
  },
  // 获得店员关注列表
  getClerkFansPage: (params) => {
    return request({
      url: '/worker/clerk-fans/page',
      method: 'GET',
      params,
      custom: {
        auth: false,
        showLoading: false,
      },
    });
  },
  // 获得首页信息
  getHomeData: () => {
    return request({
      url: '/worker/clerk/getHomeData',
      method: 'GET',
      custom: {
        auth: false,
        showLoading: false,
      },
    });
  },
  // 获得首页信息
  getClerkList: () => {
    return request({
      url: '/worker/clerk/getClerkList',
      method: 'GET',
      custom: {
        auth: true,
        showLoading: false,
      },
    });
  },
  // 获得榜单信息
  getWeekTopList: () => {
    return request({
      url: '/worker/clerk/getWeekTopList',
      method: 'GET',
      custom: {
        auth: false,
        showLoading: false,
      },
    });
  },
  // 获得店员申请列表
  getClerkApplyPage: (params) => {
    return request({
      url: '/worker/clerk-apply/page',
      method: 'GET',
      params,
      custom: {
        auth: true,
        showLoading: false,
      },
    });
  },
  // 获得商品列表
  getGoodsList: (id) => {
    return request({
      url: '/worker/clerk-apply/list',
      method: 'GET',
      params: { id },
  	  custom: {
  	    auth: true,
  	    showLoading: false,
  	  },
    });
  },
};

export default ClerkApi;
