import { BaseService, Service } from '@/cool';

@Service('category')
export class CategoryService extends BaseService {
	page(params) {
		return this.request({
			url: '/list',
			params: {
				...params
			}
		}).then(res => {
			return {
				list: res
			};
		});
	}

	updateStatus(data) {
		return this.request({
			url: '/change-status',
			params: data
		});
	}

	delete(params) {
		return this.request({
			url: '/delete',
			params
		});
	}

	sort(params) {
		return this.request({
			url: '/sort',
			params
		});
	}
}

export default new CategoryService();
