ShiShiYiBan/yudao-ui-admin-vue3/src/api/system/notice/index.ts

30 lines
782 B
TypeScript
Raw Normal View History

2022-07-19 22:33:54 +08:00
import { useAxios } from '@/hooks/web/useAxios'
2022-07-18 19:06:37 +08:00
import type { NoticeVO } from './types'
2022-07-19 22:33:54 +08:00
const request = useAxios()
2022-07-18 19:06:37 +08:00
// 查询公告列表
2022-07-19 22:33:54 +08:00
export const getNoticePageApi = (params) => {
return request.get({ url: '/system/notice/page', params })
2022-07-18 19:06:37 +08:00
}
// 查询公告详情
export const getNoticeApi = (id: number) => {
2022-07-19 22:33:54 +08:00
return request.get({ url: '/system/notice/get?id=' + id })
2022-07-18 19:06:37 +08:00
}
// 新增公告
2022-07-19 22:33:54 +08:00
export const createNoticeApi = (data: NoticeVO) => {
return request.post({ url: '/system/notice/create', data })
2022-07-18 19:06:37 +08:00
}
// 修改公告
2022-07-19 22:33:54 +08:00
export const updateNoticeApi = (data: NoticeVO) => {
return request.put({ url: '/system/notice/update', data })
2022-07-18 19:06:37 +08:00
}
// 删除公告
export const deleteNoticeApi = (id: number) => {
2022-07-19 22:33:54 +08:00
return request.delete({ url: '/system/notice/delete?id=' + id })
2022-07-18 19:06:37 +08:00
}