src/api 目录下创建demo目录(模块)的api请求文件:

demoGenClass:

import request from '/@/utils/request'
// 查询分类信息列表
export function listDemoGenClass(query:object) {
    return request({
        url: '/api/v1/demo/demoGenClass/list',
        method: 'get',
        params: query
    })
}
// 查询分类信息详细
export function getDemoGenClass(id:number) {
    return request({
        url: '/api/v1/demo/demoGenClass/get',
        method: 'get',
        params: {
            id: id.toString()
        }
    })
}
// 新增分类信息
export function addDemoGenClass(data:object) {
    return request({
        url: '/api/v1/demo/demoGenClass/add',
        method: 'post',
        data: data
    })
}
// 修改分类信息
export function updateDemoGenClass(data:object) {
    return request({
        url: '/api/v1/demo/demoGenClass/edit',
        method: 'put',
        data: data
    })
}
// 删除分类信息
export function delDemoGenClass(ids:number[]) {
    return request({
        url: '/api/v1/demo/demoGenClass/delete',
        method: 'delete',
        data:{
            id:ids
        }
    })
}

demoGen:

import request from '/@/utils/request'
// 查询代码生成测试列表
export function listDemoGen(query:object) {
    return request({
        url: '/api/v1/demo/demoGen/list',
        method: 'get',
        params: query
    })
}
// 查询代码生成测试详细
export function getDemoGen(id:number) {
    return request({
        url: '/api/v1/demo/demoGen/get',
        method: 'get',
        params: {
            id: id.toString()
        }
    })
}
// 新增代码生成测试
export function addDemoGen(data:object) {
    return request({
        url: '/api/v1/demo/demoGen/add',
        method: 'post',
        data: data
    })
}
// 修改代码生成测试
export function updateDemoGen(data:object) {
    return request({
        url: '/api/v1/demo/demoGen/edit',
        method: 'put',
        data: data
    })
}
// 删除代码生成测试
export function delDemoGen(ids:number[]) {
    return request({
        url: '/api/v1/demo/demoGen/delete',
        method: 'delete',
        data:{
            id:ids
        }
    })
}
// 关联demo_gen_class表选项
export function listDemoGenClass(query:object){
    return request({
        url: '/api/v1/demo/demoGenClass/list',
        method: 'get',
        params: query
    })
}
//获取用户信息列表
export function getUserList(uIds:number[]){
    return request({
        url: '/api/v1/system/user/getUsers',
        method: 'get',
        params: {ids:uIds}
    })
}
作者:管理员  创建时间:2023-01-06 15:40
最后编辑:管理员  更新时间:2024-06-14 15:59