import request from '@/sheep/request';

const TrendApi = {
  // 发布动态
  createTrend: (data) => {
    return request({
      url: '/worker/trend/create',
      method: 'POST',
      data,
      custom: {
		auth: true,
  		showSuccess: true,
  		successMsg: '发布成功，请等待管理员审核'
      },
    });
  },
  // 动态点赞
  createTrendLike: (data) => {
    return request({
      url: '/worker/trend-like/create',
      method: 'POST',
      data,
      custom: {
  		auth: true,
  		showSuccess: false,
		showLoading: false,
  		successMsg: '点赞成功'
      },
    });
  },
  // 删除动态
  deleteTrendLike: (id) => {
	return request({
		url: '/worker/trend/delete',
		method: 'DELETE',
		params: {
		  id,
		},
		custom: {
		  	auth: true,
		  	showSuccess: true,
			showLoading: false,
			successMsg: '删除成功'
		},
	});
  },
  // 获得动态详情
  getTrend: (id) => {
    return request({
      url: '/worker/trend/get',
      method: 'GET',
      params: { id },
  	  custom: {
  	    auth: false,
  	    showLoading: false,
  	  },
    });
  },
  // 店员关注
  createClerkFans: (data) => {
    return request({
      url: '/worker/clerk-fans/create',
      method: 'POST',
      data,
      custom: {
  		auth: true,
  		showSuccess: false,
		showLoading: false,
  		successMsg: '关注成功'
      },
    });
  },
  // 获得动态分页
  getTrendPage: (params) => {
    return request({
      url: '/worker/trend/page',
      method: 'GET',
      params,
      custom: {
        auth: false,
        showLoading: false,
      },
    });
  },
  // 获得动态分页
  getMyTrendPage: (params) => {
    return request({
      url: '/worker/trend/myPage',
      method: 'GET',
      params,
      custom: {
        auth: true,
        showLoading: false,
      },
    });
  },
 
};

export default TrendApi;
