import { defHttp } from '/@/utils/http/axios';

enum Api {
  archivesAccessComplicationQueryList = '/archives/accessComplication/query/list',
  archivesAccessComplicationDetail = '/archives/accessComplication/detail',
  archivesAccessComplicationAdd = '/archives/accessComplication/add',
  archivesAccessComplicationEdit = '/archives/accessComplication/edit',
  archivesAccessComplicationRemove = '/archives/accessComplication/removeByIds',
}

/**
 *
 * @author lf
 * @date  2023/06/17 10:41
 * @description: 根据条件查询血管通路并发症列表,权限 - archives:accessComplication:query
 * @method: GET
 * @param:
 * @return:
 *       {String}  vascularAccessId  血透通路id
 *       {Date}  occurredTime  发生时间
 *       {String}  name  并发症名称
 *       {String}  remark  说明
 *       {String}  creatorName  creator_name
 *       {String}  updatorName  updator_name
 */

export const archivesAccessComplicationQueryList = (accessId: string) => {
  return defHttp.get({ url: Api.archivesAccessComplicationQueryList + '/' + accessId });
};
/**
 *
 * @author lf
 * @date  2023/06/17 10:41
 * @description: 根据id查询血管通路并发症详细信息,权限 - archives:accessComplication:query
 * @method: GET
 * @param:  id 血管通路并发症主键id
 * @return:
 *       {String}  vascularAccessId  血透通路id
 *       {Date}  occurredTime  发生时间
 *       {String}  name  并发症名称
 *       {String}  remark  说明
 *       {String}  creatorName  creator_name
 *       {String}  updatorName  updator_name
 */
export const archivesAccessComplicationDetail = (id: string) => {
  return defHttp.get({ url: Api.archivesAccessComplicationDetail + '/' + id });
};

/**
 *
 * @author lf
 * @date  2023/06/17 10:41
 * @description: 添加血管通路并发症,权限 - archives:accessComplication:add
 * @method: POST
 * @param:
 *       {String}  vascularAccessId  血透通路id
 *       {Date}  occurredTime  发生时间
 *       {String}  name  并发症名称
 *       {String}  remark  说明
 *       {String}  creatorName  creator_name
 *       {String}  updatorName  updator_name
 * @return:
 *       0 添加失败
 *       1 添加成功
 */
export const archivesAccessComplicationAdd = (params?: object) => {
  return defHttp.post({ url: Api.archivesAccessComplicationAdd, params: params });
};

/**
 *
 * @author lf
 * @date  2023/06/17 10:41
 * @description: 通过主键id编辑血管通路并发症,权限 - archives:accessComplication:edit
 * @method: POST
 * @param:
 *       {String}  vascularAccessId  血透通路id
 *       {Date}  occurredTime  发生时间
 *       {String}  name  并发症名称
 *       {String}  remark  说明
 *       {String}  creatorName  creator_name
 *       {String}  updatorName  updator_name
 * @return:
 *       0 编辑失败
 *       1 编辑成功
 */
export const archivesAccessComplicationEdit = (params?: object) => {
  return defHttp.post({ url: Api.archivesAccessComplicationEdit, params: params });
};

/**
 * @description: 删除,权限 - archives:accessComplication:remove
 * @method: POST
 */
export const archivesAccessComplicationRemove = (params: Array<string | number>) => {
  return defHttp.post({ url: Api.archivesAccessComplicationRemove, params: params });
};
