You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
59 lines
1.8 KiB
59 lines
1.8 KiB
/**
|
|
* 自动生成 API
|
|
* 负责调用后端接口
|
|
*/
|
|
|
|
import { requestClient } from '#/api/request';
|
|
import { useAppConfig } from '@vben/hooks';
|
|
|
|
export namespace {{entity}}Api {
|
|
|
|
const applicationConfig = useAppConfig(import.meta.env, import.meta.env.PROD);
|
|
console.log('=== 接口域名 ===', applicationConfig.javaURL)
|
|
|
|
/**
|
|
* 分页查询
|
|
*/
|
|
export function page(params: any) {
|
|
return requestClient.post(applicationConfig.javaURL+'/{{old_table}}/page', params,
|
|
{ headers: {'Content-Type': 'application/json', Token: '917e9898-8a0a-4079-a16a-e456457e070c', version: '1.0.1', familyId: 0}});
|
|
}
|
|
|
|
/**
|
|
* 获取详情
|
|
*/
|
|
export function get(id: number) {
|
|
return requestClient.get(applicationConfig.javaURL+'/{{old_table}}/' + id);
|
|
}
|
|
|
|
/**
|
|
* 新增
|
|
*/
|
|
export function add(data: any) {
|
|
return requestClient.post(applicationConfig.javaURL+'/{{old_table}}/add', data,
|
|
{ headers: {'Content-Type': 'application/json', Token: '917e9898-8a0a-4079-a16a-e456457e070c', version: '1.0.1', familyId: 0}});
|
|
}
|
|
|
|
/**
|
|
* 修改
|
|
*/
|
|
export function save(data: any) {
|
|
return requestClient.post(applicationConfig.javaURL+'/{{old_table}}/modify', data,
|
|
{ headers: {'Content-Type': 'application/json', Token: '917e9898-8a0a-4079-a16a-e456457e070c', version: '1.0.1', familyId: 0}});
|
|
}
|
|
|
|
/**
|
|
* 删除
|
|
*/
|
|
export function remove(id: number) {
|
|
return requestClient.delete(applicationConfig.javaURL+'/{{old_table}}/' + id);
|
|
}
|
|
|
|
/**
|
|
* 枚举列表
|
|
*/
|
|
export function enumList(params: any) {
|
|
return requestClient.post(applicationConfig.javaURL+'/health-enums/optionList', params,{ headers: {'Content-Type': 'application/json', Token: '917e9898-8a0a-4079-a16a-e456457e070c', version: '1.0.1'}});
|
|
}
|
|
|
|
}
|