1234567891011121314151617181920212223242526272829303132333435 |
- import { useAxios } from '@/hooks/web/useAxios'
- import { ${simpleClassName}VO,${simpleClassName}PageReqVO,${simpleClassName}ExcelReqVO } from './types'
- const request = useAxios()
- #set ($baseURL = "/${table.moduleName}/${simpleClassName_strikeCase}")
- // 查询${table.classComment}列表
- export const getPostPageApi = async (params: ${simpleClassName}PageReqVO) => {
- return await request.get({ url: '${baseURL}/page', params })
- }
- // 查询${table.classComment}详情
- export const getPostApi = async (id: number) => {
- return await request.get({ url: '${baseURL}/get?id=' + id })
- }
- // 新增${table.classComment}
- export const createPostApi = async (data: ${simpleClassName}VO) => {
- return await request.post({ url: '${baseURL}/create', data })
- }
- // 修改${table.classComment}
- export const updatePostApi = async (data: ${simpleClassName}VO) => {
- return await request.put({ url: '${baseURL}/update', data })
- }
- // 删除${table.classComment}
- export const deletePostApi = async (id: number) => {
- return await request.delete({ url: '${baseURL}/delete?id=' + id })
- }
- // 导出${table.classComment} Excel
- export const exportPostApi = async (params: ${simpleClassName}ExcelReqVO) => {
- return await request.download({ url: '${baseURL}/export-excel', params })
- }
|