daoyou_manage_web/src/api/manage/scenic/index.ts

84 lines
1.6 KiB
TypeScript
Raw Normal View History

import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { ArticleVO, ArticleForm, ArticleQuery } from '@/api/manage/scenic/types';
/**
*
* @param query
* @returns {*}
*/
export const listArticle = (query?: ArticleQuery): AxiosPromise<ArticleVO[]> => {
return request({
url: '/manage/content/list',
method: 'get',
params: query
});
};
/**
*
* @param id
*/
export const getArticle = (id: string | number): AxiosPromise<ArticleVO> => {
return request({
url: '/manage/content/' + id,
method: 'get'
});
};
/**
*
* @param data
*/
export const addArticle = (data: ArticleForm) => {
return request({
url: '/manage/content',
method: 'post',
data: data
});
};
/**
*
* @param data
*/
export const updateArticle = (data: ArticleForm) => {
return request({
url: '/manage/content',
method: 'put',
data: data
});
};
/**
*
* @param id
*/
export const delArticle = (id: string | number | Array<string | number>) => {
return request({
url: '/manage/content/' + id,
method: 'delete'
});
};
export const geocoder = (address: string) => {
return request({
url: 'https://apis.map.qq.com/ws/geocoder/v1/?address=' + address + '&key=6XFBZ-SAVLT-JGIX2-VOLMK-6S2H3-XUBGO',
method: 'get'
});
};
/**
*
* @param query
* @returns
*/
export const listByTagIdNotebook = (query: any): AxiosPromise<ArticleVO[]> => {
return request({
url: '/manage/notebook/listByTagId',
method: 'get',
params: query
});
};