mirror of
https://gitee.com/hhyykk/ipms-sjy-ui.git
synced 2025-07-15 19:35:07 +08:00
代码生成:增加 crud 单表示例
This commit is contained in:
40
src/api/infra/demo/demo01/index.ts
Normal file
40
src/api/infra/demo/demo01/index.ts
Normal file
@ -0,0 +1,40 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface Demo01ContactVO {
|
||||
id: number
|
||||
name: string
|
||||
sex: number
|
||||
birthday: Date
|
||||
description: string
|
||||
avatar: string
|
||||
}
|
||||
|
||||
// 查询示例联系人分页
|
||||
export const getDemo01ContactPage = async (params) => {
|
||||
return await request.get({ url: `/infra/demo01-contact/page`, params })
|
||||
}
|
||||
|
||||
// 查询示例联系人详情
|
||||
export const getDemo01Contact = async (id: number) => {
|
||||
return await request.get({ url: `/infra/demo01-contact/get?id=` + id })
|
||||
}
|
||||
|
||||
// 新增示例联系人
|
||||
export const createDemo01Contact = async (data: Demo01ContactVO) => {
|
||||
return await request.post({ url: `/infra/demo01-contact/create`, data })
|
||||
}
|
||||
|
||||
// 修改示例联系人
|
||||
export const updateDemo01Contact = async (data: Demo01ContactVO) => {
|
||||
return await request.put({ url: `/infra/demo01-contact/update`, data })
|
||||
}
|
||||
|
||||
// 删除示例联系人
|
||||
export const deleteDemo01Contact = async (id: number) => {
|
||||
return await request.delete({ url: `/infra/demo01-contact/delete?id=` + id })
|
||||
}
|
||||
|
||||
// 导出示例联系人 Excel
|
||||
export const exportDemo01Contact = async (params) => {
|
||||
return await request.download({ url: `/infra/demo01-contact/export-excel`, params })
|
||||
}
|
@ -1,43 +0,0 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface Demo01StudentVO {
|
||||
id: number
|
||||
name: string
|
||||
description: string
|
||||
birthday: Date
|
||||
sex: number
|
||||
enabled: boolean
|
||||
avatar: string
|
||||
video: string
|
||||
memo: string
|
||||
}
|
||||
|
||||
// 查询学生列表
|
||||
export const getDemo01StudentPage = async (params) => {
|
||||
return await request.get({ url: `/infra/demo01-student/page`, params })
|
||||
}
|
||||
|
||||
// 查询学生详情
|
||||
export const getDemo01Student = async (id: number) => {
|
||||
return await request.get({ url: `/infra/demo01-student/get?id=` + id })
|
||||
}
|
||||
|
||||
// 新增学生
|
||||
export const createDemo01Student = async (data: Demo01StudentVO) => {
|
||||
return await request.post({ url: `/infra/demo01-student/create`, data })
|
||||
}
|
||||
|
||||
// 修改学生
|
||||
export const updateDemo01Student = async (data: Demo01StudentVO) => {
|
||||
return await request.put({ url: `/infra/demo01-student/update`, data })
|
||||
}
|
||||
|
||||
// 删除学生
|
||||
export const deleteDemo01Student = async (id: number) => {
|
||||
return await request.delete({ url: `/infra/demo01-student/delete?id=` + id })
|
||||
}
|
||||
|
||||
// 导出学生 Excel
|
||||
export const exportDemo01Student = async (params) => {
|
||||
return await request.download({ url: `/infra/demo01-student/export-excel`, params })
|
||||
}
|
Reference in New Issue
Block a user