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.
75 lines
1.3 KiB
75 lines
1.3 KiB
import request from "@/utils/request"; |
|
import {host} from "@/config/host"; |
|
|
|
/** |
|
* 获取我的宠物列表 |
|
* @param page |
|
* @returns {Promise | Promise<unknown>} |
|
*/ |
|
export function getMyPets(page) { |
|
return request({ |
|
url: `${host}/user/pet-list`, |
|
method: 'post', |
|
data: { |
|
page: page, |
|
limit: 10 |
|
} |
|
}) |
|
} |
|
|
|
/** |
|
* 宠物详情 |
|
* @param id |
|
* @returns {Promise | Promise<unknown>} |
|
*/ |
|
export function getDetail(id){ |
|
return request({ |
|
url:`${host}/user/pet-info`, |
|
method: 'post', |
|
data:{ |
|
id |
|
} |
|
}) |
|
} |
|
|
|
/** |
|
* 喂养档案 |
|
* @param pet_id |
|
* @returns {Promise<unknown>} |
|
*/ |
|
export function feedLog(pet_id){ |
|
return request({ |
|
url:'pet/feed-info', |
|
method:'post', |
|
data:{ |
|
pet_id |
|
} |
|
}) |
|
} |
|
/** |
|
* 新增/修改宠物 |
|
* @param data |
|
* @returns {Promise<unknown>} |
|
*/ |
|
export function editPet(data){ |
|
return request({ |
|
url:'user/pet-upinfo', |
|
method:'post', |
|
data:data |
|
}) |
|
} |
|
|
|
/** |
|
* 删除宠物 |
|
* @param id |
|
* @returns {Promise | Promise<unknown>} |
|
*/ |
|
export function delPet(id){ |
|
return request({ |
|
url:'user/pet-delete', |
|
method:'post', |
|
data:{ |
|
id:id |
|
} |
|
}) |
|
} |