| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- import { defHttp } from '/@/utils/http/axios';
- import {
- GetNewsListModel,
- DeleteBatchesParams,
- NewsIdParams,
- AddNewsParams,
- EditNewsParams,
- GetNewsModel,
- } from './model/newsModel';
- enum Api {
- NewsUrl = '/news/',
- }
- /**
- * @description: GetNewsList
- */
- export function getNewsList(params) {
- return defHttp.request<GetNewsListModel>({
- url: Api.NewsUrl,
- method: 'GET',
- params,
- });
- }
- /**
- * @description: addNews
- */
- export function addNews(params: AddNewsParams) {
- return defHttp.request<GetNewsListModel>({
- url: Api.NewsUrl,
- method: 'POST',
- params,
- });
- }
- /**
- * @description: 批量删除新闻
- */
- export function deleteBatchesNews(params: DeleteBatchesParams) {
- return defHttp.request<GetNewsListModel>({
- url: Api.NewsUrl,
- method: 'DELETE',
- params,
- });
- }
- /**
- * @description: 获取单个新闻
- */
- export function getNews(params: NewsIdParams) {
- return defHttp.request<GetNewsModel>({
- url: Api.NewsUrl + params.id,
- method: 'GET',
- });
- }
- /**
- * @description: 修改单个新闻
- */
- export function editNews(params: EditNewsParams) {
- return defHttp.request<GetNewsListModel>({
- url: Api.NewsUrl + params.id,
- method: 'PUT',
- params,
- });
- }
- /**
- * @description: 删除单个新闻
- */
- export function deleteNews(params: NewsIdParams) {
- return defHttp.request<GetNewsListModel>({
- url: Api.NewsUrl + params.id,
- method: 'DELETE',
- });
- }
|