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.3 KiB
59 lines
1.3 KiB
1 year ago
|
import type { GetModelAttributeListParams, ModelAttribute, ModelAttributeWithForm, ModelService } from './types'
|
||
|
import { defHttp } from '@/utils/http/axios'
|
||
|
|
||
|
export function getAllModelServices(productId: string) {
|
||
|
return defHttp.get<ModelService[]>({
|
||
|
url: '/thingModel/select',
|
||
|
params: {
|
||
|
productId,
|
||
|
},
|
||
|
})
|
||
|
}
|
||
|
|
||
|
export function createModelService(data: Partial<ModelService>) {
|
||
|
return defHttp.post({
|
||
|
url: '/thingModel/save',
|
||
|
data,
|
||
|
})
|
||
|
}
|
||
|
|
||
|
export function updateModelService(data: Partial<ModelService>) {
|
||
|
return defHttp.post({
|
||
|
url: '/thingModel/update',
|
||
|
data,
|
||
|
})
|
||
|
}
|
||
|
|
||
|
export function deleteModelService(id: string) {
|
||
|
return defHttp.post({
|
||
|
url: `/thingModel/remove?id=${id}`,
|
||
|
})
|
||
|
}
|
||
|
|
||
|
export function getModelAttributeList(params: GetModelAttributeListParams) {
|
||
|
return defHttp.get<PageResult<ModelAttribute>>({
|
||
|
url: '/thingModel/item/page',
|
||
|
params,
|
||
|
})
|
||
|
}
|
||
|
|
||
|
export function createModelAttribute(data: ModelAttributeWithForm) {
|
||
|
return defHttp.post({
|
||
|
url: '/thingModel/item/save',
|
||
|
data,
|
||
|
})
|
||
|
}
|
||
|
|
||
|
export function updateModelAttribute(data: ModelAttributeWithForm) {
|
||
|
return defHttp.post({
|
||
|
url: '/thingModel/item/update',
|
||
|
data,
|
||
|
})
|
||
|
}
|
||
|
|
||
|
export function deleteModelAttribute(id: string) {
|
||
|
return defHttp.post({
|
||
|
url: `/thingModel/item/remove?id=${id}`,
|
||
|
})
|
||
|
}
|