123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- import request from '@/utils/request';
- import { AxiosPromise } from 'axios';
- import { ArticleVO, ArticleForm, ArticleQuery } from '@/api/system/article/types';
- /**
- * 查询文章(可用于活动预热)列表
- * @param query
- * @returns {*}
- */
- export const listArticle = (query?: ArticleQuery): AxiosPromise<ArticleVO[]> => {
- return request({
- url: '/system/article/list',
- method: 'get',
- params: query
- });
- };
- /**
- * 查询文章(可用于活动预热)详细
- * @param id
- */
- export const getArticle = (id: string | number): AxiosPromise<ArticleVO> => {
- return request({
- url: '/system/article/' + id,
- method: 'get'
- });
- };
- /**
- * 新增文章(可用于活动预热)
- * @param data
- */
- export const addArticle = (data: ArticleForm) => {
- return request({
- url: '/system/article',
- method: 'post',
- data: data
- });
- };
- /**
- * 修改文章(可用于活动预热)
- * @param data
- */
- export const updateArticle = (data: ArticleForm) => {
- return request({
- url: '/system/article',
- method: 'put',
- data: data
- });
- };
- /**
- * 删除文章(可用于活动预热)
- * @param id
- */
- export const delArticle = (id: string | number | Array<string | number>) => {
- return request({
- url: '/system/article/' + id,
- method: 'delete'
- });
- };
- /**
- * 修改文章默认状态
- * @param data - 文章BO对象
- */
- export const changeArticleDefault = (data: ArticleForm): AxiosPromise<void> => {
- return request({
- url: '/system/article/changeArticleDefault',
- method: 'post',
- data: data
- });
- };
- /**
- * 查询赛事项目数量
- * @returns {*}
- */
- export const getArticleCount = () => {
- return request({
- url: '/system/article/count',
- method: 'get'
- });
- };
|