import service from '../axios'

// 修改用户信息
export function userInfoEdit(param) {
  return service.put('info_edit', param );
}

/**
 * 获取用户图片库
 * @param {string} uuid 
 * @param {{}} params {category:string}
 * @returns 
 */
export function fetchUserImages(uuid, params = {}) {
  return service.get(`/images/${uuid}`, {params} );
}

/**
 * 用户上传图片库
 * @param {string} uuid 
 * @param {{}} param {file: File}
 * @returns 
 */
export function uploadUserImages(uuid, param) {
  return service.post(`/images/${uuid}`, param );
}

/**
 * 删除用户图片库
 * @param {string} uuid 
 * @param {int} id 
 * @returns 
 */
export function deleteUserImages(uuid, id) {
  return service.delete(`/images/${uuid}/${id}`);
}

/**
 * 收藏图片
 * @param {string} uuid 
 * @param {{}} param {image: string}
 * @returns 
 */
export function collectUserImages(uuid, param) {
  return service.post(`/images/${uuid}/list`, param );
}