feat: 统一api风格

pull/2/head
xingyuv 2023-02-09 14:47:50 +08:00
parent 4923c3b163
commit 5df6addb78
9 changed files with 34 additions and 34 deletions

View File

@ -1,7 +1,7 @@
import request from '@/config/axios' import request from '@/config/axios'
// 创建公众号的自动回复 // 创建公众号的自动回复
export function createAutoReply(data) { export const createAutoReply = (data) => {
return request.post({ return request.post({
url: '/mp/auto-reply/create', url: '/mp/auto-reply/create',
data: data data: data
@ -9,7 +9,7 @@ export function createAutoReply(data) {
} }
// 更新公众号的自动回复 // 更新公众号的自动回复
export function updateAutoReply(data) { export const updateAutoReply = (data) => {
return request.put({ return request.put({
url: '/mp/auto-reply/update', url: '/mp/auto-reply/update',
data: data data: data
@ -17,21 +17,21 @@ export function updateAutoReply(data) {
} }
// 删除公众号的自动回复 // 删除公众号的自动回复
export function deleteAutoReply(id) { export const deleteAutoReply = (id) => {
return request.delete({ return request.delete({
url: '/mp/auto-reply/delete?id=' + id url: '/mp/auto-reply/delete?id=' + id
}) })
} }
// 获得公众号的自动回复 // 获得公众号的自动回复
export function getAutoReply(id) { export const getAutoReply = (id) => {
return request.get({ return request.get({
url: '/mp/auto-reply/get?id=' + id url: '/mp/auto-reply/get?id=' + id
}) })
} }
// 获得公众号的自动回复分页 // 获得公众号的自动回复分页
export function getAutoReplyPage(query) { export const getAutoReplyPage = (query) => {
return request.get({ return request.get({
url: '/mp/auto-reply/page', url: '/mp/auto-reply/page',
params: query params: query

View File

@ -1,7 +1,7 @@
import request from '@/config/axios' import request from '@/config/axios'
// 获得公众号草稿分页 // 获得公众号草稿分页
export function getDraftPage(query) { export const getDraftPage = (query) => {
return request.get({ return request.get({
url: '/mp/draft/page', url: '/mp/draft/page',
params: query params: query
@ -9,7 +9,7 @@ export function getDraftPage(query) {
} }
// 创建公众号草稿 // 创建公众号草稿
export function createDraft(accountId, articles) { export const createDraft = (accountId, articles) => {
return request.post({ return request.post({
url: '/mp/draft/create?accountId=' + accountId, url: '/mp/draft/create?accountId=' + accountId,
data: { data: {
@ -19,7 +19,7 @@ export function createDraft(accountId, articles) {
} }
// 更新公众号草稿 // 更新公众号草稿
export function updateDraft(accountId, mediaId, articles) { export const updateDraft = (accountId, mediaId, articles) => {
return request.put({ return request.put({
url: '/mp/draft/update?accountId=' + accountId + '&mediaId=' + mediaId, url: '/mp/draft/update?accountId=' + accountId + '&mediaId=' + mediaId,
method: 'put', method: 'put',
@ -28,7 +28,7 @@ export function updateDraft(accountId, mediaId, articles) {
} }
// 删除公众号草稿 // 删除公众号草稿
export function deleteDraft(accountId, mediaId) { export const deleteDraft = (accountId, mediaId) => {
return request.delete({ return request.delete({
url: '/mp/draft/delete?accountId=' + accountId + '&mediaId=' + mediaId url: '/mp/draft/delete?accountId=' + accountId + '&mediaId=' + mediaId
}) })

View File

@ -1,7 +1,7 @@
import request from '@/config/axios' import request from '@/config/axios'
// 获得公众号素材分页 // 获得公众号素材分页
export function getFreePublishPage(query) { export const getFreePublishPage = (query) => {
return request.get({ return request.get({
url: '/mp/free-publish/page', url: '/mp/free-publish/page',
params: query params: query
@ -9,14 +9,14 @@ export function getFreePublishPage(query) {
} }
// 删除公众号素材 // 删除公众号素材
export function deleteFreePublish(accountId, articleId) { export const deleteFreePublish = (accountId, articleId) => {
return request.delete({ return request.delete({
url: '/mp/free-publish/delete?accountId=' + accountId + '&articleId=' + articleId url: '/mp/free-publish/delete?accountId=' + accountId + '&articleId=' + articleId
}) })
} }
// 发布公众号素材 // 发布公众号素材
export function submitFreePublish(accountId, mediaId) { export const submitFreePublish = (accountId, mediaId) => {
return request.post({ return request.post({
url: '/mp/free-publish/submit?accountId=' + accountId + '&mediaId=' + mediaId url: '/mp/free-publish/submit?accountId=' + accountId + '&mediaId=' + mediaId
}) })

View File

@ -1,7 +1,7 @@
import request from '@/config/axios' import request from '@/config/axios'
// 获得公众号素材分页 // 获得公众号素材分页
export function getMaterialPage(query) { export const getMaterialPage = (query) => {
return request.get({ return request.get({
url: '/mp/material/page', url: '/mp/material/page',
params: query params: query
@ -9,7 +9,7 @@ export function getMaterialPage(query) {
} }
// 删除公众号永久素材 // 删除公众号永久素材
export function deletePermanentMaterial(id) { export const deletePermanentMaterial = (id) => {
return request.delete({ return request.delete({
url: '/mp/material/delete-permanent?id=' + id url: '/mp/material/delete-permanent?id=' + id
}) })

View File

@ -1,14 +1,14 @@
import request from '@/config/axios' import request from '@/config/axios'
// 获得公众号菜单列表 // 获得公众号菜单列表
export function getMenuList(accountId) { export const getMenuList = (accountId) => {
return request.get({ return request.get({
url: '/mp/menu/list?accountId=' + accountId url: '/mp/menu/list?accountId=' + accountId
}) })
} }
// 保存公众号菜单 // 保存公众号菜单
export function saveMenu(accountId, menus) { export const saveMenu = (accountId, menus) => {
return request.post({ return request.post({
url: '/mp/menu/save', url: '/mp/menu/save',
data: { data: {
@ -19,7 +19,7 @@ export function saveMenu(accountId, menus) {
} }
// 删除公众号菜单 // 删除公众号菜单
export function deleteMenu(accountId) { export const deleteMenu = (accountId) => {
return request.delete({ return request.delete({
url: '/mp/menu/delete?accountId=' + accountId url: '/mp/menu/delete?accountId=' + accountId
}) })

View File

@ -1,7 +1,7 @@
import request from '@/config/axios' import request from '@/config/axios'
// 获得公众号消息分页 // 获得公众号消息分页
export function getMessagePage(query) { export const getMessagePage = (query) => {
return request.get({ return request.get({
url: '/mp/message/page', url: '/mp/message/page',
params: query params: query
@ -9,7 +9,7 @@ export function getMessagePage(query) {
} }
// 给粉丝发送消息 // 给粉丝发送消息
export function sendMessage(data) { export const sendMessage = (data) => {
return request.post({ return request.post({
url: '/mp/message/send', url: '/mp/message/send',
data: data data: data

View File

@ -1,7 +1,7 @@
import request from '@/config/axios' import request from '@/config/axios'
// 更新公众号粉丝 // 更新公众号粉丝
export function updateUser(data) { export const updateUser = (data) => {
return request.put({ return request.put({
url: '/mp/user/update', url: '/mp/user/update',
data: data data: data
@ -9,14 +9,14 @@ export function updateUser(data) {
} }
// 获得公众号粉丝 // 获得公众号粉丝
export function getUser(id) { export const getUser = (id) => {
return request.get({ return request.get({
url: '/mp/user/get?id=' + id url: '/mp/user/get?id=' + id
}) })
} }
// 获得公众号粉丝分页 // 获得公众号粉丝分页
export function getUserPage(query) { export const getUserPage = (query) => {
return request.get({ return request.get({
url: '/mp/user/page', url: '/mp/user/page',
params: query params: query
@ -24,7 +24,7 @@ export function getUserPage(query) {
} }
// 同步公众号粉丝 // 同步公众号粉丝
export function syncUser(accountId) { export const syncUser = (accountId) => {
return request.post({ return request.post({
url: '/mp/tag/sync?accountId=' + accountId url: '/mp/tag/sync?accountId=' + accountId
}) })

View File

@ -1,7 +1,7 @@
import request from '@/config/axios' import request from '@/config/axios'
// 获取消息发送概况数据 // 获取消息发送概况数据
export function getUpstreamMessage(query) { export const getUpstreamMessage = (query) => {
return request.get({ return request.get({
url: '/mp/statistics/upstream-message', url: '/mp/statistics/upstream-message',
params: query params: query
@ -9,7 +9,7 @@ export function getUpstreamMessage(query) {
} }
// 用户增减数据 // 用户增减数据
export function getUserSummary(query) { export const getUserSummary = (query) => {
return request.get({ return request.get({
url: '/mp/statistics/user-summary', url: '/mp/statistics/user-summary',
params: query params: query
@ -17,7 +17,7 @@ export function getUserSummary(query) {
} }
// 获得用户累计数据 // 获得用户累计数据
export function getUserCumulate(query) { export const getUserCumulate = (query) => {
return request.get({ return request.get({
url: '/mp/statistics/user-cumulate', url: '/mp/statistics/user-cumulate',
params: query params: query
@ -25,7 +25,7 @@ export function getUserCumulate(query) {
} }
// 获得接口分析数据 // 获得接口分析数据
export function getInterfaceSummary(query) { export const getInterfaceSummary = (query) => {
return request.get({ return request.get({
url: '/mp/statistics/interface-summary', url: '/mp/statistics/interface-summary',
params: query params: query

View File

@ -1,7 +1,7 @@
import request from '@/config/axios' import request from '@/config/axios'
// 创建公众号标签 // 创建公众号标签
export function createTag(data) { export const createTag = (data) => {
return request.post({ return request.post({
url: '/mp/tag/create', url: '/mp/tag/create',
data: data data: data
@ -9,7 +9,7 @@ export function createTag(data) {
} }
// 更新公众号标签 // 更新公众号标签
export function updateTag(data) { export const updateTag = (data) => {
return request.put({ return request.put({
url: '/mp/tag/update', url: '/mp/tag/update',
data: data data: data
@ -17,21 +17,21 @@ export function updateTag(data) {
} }
// 删除公众号标签 // 删除公众号标签
export function deleteTag(id) { export const deleteTag = (id) => {
return request.delete({ return request.delete({
url: '/mp/tag/delete?id=' + id url: '/mp/tag/delete?id=' + id
}) })
} }
// 获得公众号标签 // 获得公众号标签
export function getTag(id) { export const getTag = (id) => {
return request.get({ return request.get({
url: '/mp/tag/get?id=' + id url: '/mp/tag/get?id=' + id
}) })
} }
// 获得公众号标签分页 // 获得公众号标签分页
export function getTagPage(query) { export const getTagPage = (query) => {
return request.get({ return request.get({
url: '/mp/tag/page', url: '/mp/tag/page',
params: query params: query
@ -39,14 +39,14 @@ export function getTagPage(query) {
} }
// 获取公众号标签精简信息列表 // 获取公众号标签精简信息列表
export function getSimpleTags() { export const getSimpleTags = () => {
return request.get({ return request.get({
url: '/mp/tag/list-all-simple' url: '/mp/tag/list-all-simple'
}) })
} }
// 同步公众号标签 // 同步公众号标签
export function syncTag(accountId) { export const syncTag = (accountId) => {
return request.post({ return request.post({
url: '/mp/tag/sync?accountId=' + accountId url: '/mp/tag/sync?accountId=' + accountId
}) })