64 lines
1.3 KiB
TypeScript
64 lines
1.3 KiB
TypeScript
import request from '@/utils/request';
|
|
import { AxiosPromise } from 'axios';
|
|
import { UserRelationVO, UserRelationForm, UserRelationQuery } from '@/api/fishery/userRelation/types';
|
|
|
|
/**
|
|
* 查询养殖用户子账号列表
|
|
* @param query
|
|
* @returns {*}
|
|
*/
|
|
|
|
export const listUserRelation = (query?: UserRelationQuery): AxiosPromise<UserRelationVO[]> => {
|
|
return request({
|
|
url: '/fishery/userRelation/list',
|
|
method: 'get',
|
|
params: query
|
|
});
|
|
};
|
|
|
|
/**
|
|
* 查询养殖用户子账号详细
|
|
* @param id
|
|
*/
|
|
export const getUserRelation = (id: string | number): AxiosPromise<UserRelationVO> => {
|
|
return request({
|
|
url: '/fishery/userRelation/' + id,
|
|
method: 'get'
|
|
});
|
|
};
|
|
|
|
/**
|
|
* 新增养殖用户子账号
|
|
* @param data
|
|
*/
|
|
export const addUserRelation = (data: UserRelationForm) => {
|
|
return request({
|
|
url: '/fishery/userRelation',
|
|
method: 'post',
|
|
data: data
|
|
});
|
|
};
|
|
|
|
/**
|
|
* 修改养殖用户子账号
|
|
* @param data
|
|
*/
|
|
export const updateUserRelation = (data: UserRelationForm) => {
|
|
return request({
|
|
url: '/fishery/userRelation',
|
|
method: 'put',
|
|
data: data
|
|
});
|
|
};
|
|
|
|
/**
|
|
* 删除养殖用户子账号
|
|
* @param id
|
|
*/
|
|
export const delUserRelation = (id: string | number | Array<string | number>) => {
|
|
return request({
|
|
url: '/fishery/userRelation/' + id,
|
|
method: 'delete'
|
|
});
|
|
};
|