调整
This commit is contained in:
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { LawLegalDocContent, LawLegalDocContentParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询用户填写法律文书内容
|
||||
*/
|
||||
export async function pageLawLegalDocContent(params: LawLegalDocContentParam) {
|
||||
const res = await request.get<ApiResult<PageResult<LawLegalDocContent>>>(
|
||||
MODULES_API_URL + '/law/law-legal-doc-content/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询用户填写法律文书内容列表
|
||||
*/
|
||||
export async function listLawLegalDocContent(params?: LawLegalDocContentParam) {
|
||||
const res = await request.get<ApiResult<LawLegalDocContent[]>>(
|
||||
MODULES_API_URL + '/law/law-legal-doc-content',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加用户填写法律文书内容
|
||||
*/
|
||||
export async function addLawLegalDocContent(data: LawLegalDocContent) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/law/law-legal-doc-content',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户填写法律文书内容
|
||||
*/
|
||||
export async function updateLawLegalDocContent(data: LawLegalDocContent) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/law/law-legal-doc-content',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除用户填写法律文书内容
|
||||
*/
|
||||
export async function removeLawLegalDocContent(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/law/law-legal-doc-content/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除用户填写法律文书内容
|
||||
*/
|
||||
export async function removeBatchLawLegalDocContent(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/law/law-legal-doc-content/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询用户填写法律文书内容
|
||||
*/
|
||||
export async function getLawLegalDocContent(id: number) {
|
||||
const res = await request.get<ApiResult<LawLegalDocContent>>(
|
||||
MODULES_API_URL + '/law/law-legal-doc-content/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
Reference in New Issue
Block a user