import { defHttp } from '@/utils/http/axios';
import { ID, IDS, commonExport } from '@/api/base';
import { BehaviorMessageVO, BehaviorMessageForm, BehaviorMessageQuery } from './model';

/**
 * 查询行为消息;列表
 * @param params
 * @returns
 */
export function behaviorMessageList(params?: BehaviorMessageQuery) {
  return defHttp.get<BehaviorMessageVO[]>({ url: '/behavior/behaviorMessage/list', params });
}

/**
 * 导出行为消息;列表
 * @param params
 * @returns
 */
export function behaviorMessageExport(params?: BehaviorMessageQuery) {
  return commonExport('/behavior/behaviorMessage/export', params ?? {});
}
/**
 * 确认故障消息
 * @param id id
 * @returns
 */
export function confirmMessageInfo(data) {
  return defHttp.putWithMsg({ url: '/behavior/behaviorMessage/confirm', data });
}
/**
 * 查询行为消息;详细
 * @param id id
 * @returns
 */
export function behaviorMessageInfo(id: ID) {
  return defHttp.get<BehaviorMessageVO>({ url: '/fault/faultMessage/' + id });
}

/**
 * 新增行为消息;
 * @param data
 * @returns
 */
export function behaviorMessageAdd(data: BehaviorMessageForm) {
  return defHttp.postWithMsg<void>({ url: '/behavior/behaviorMessage', data });
}

/**
 * 更新行为消息;
 * @param data
 * @returns
 */
export function behaviorMessageUpdate(data: BehaviorMessageForm) {
  return defHttp.putWithMsg<void>({ url: '/behavior/behaviorMessage', data });
}

/**
 * 删除行为消息;
 * @param id id
 * @returns
 */
export function behaviorMessageRemove(id: ID | IDS) {
  return defHttp.deleteWithMsg<void>({ url: '/behavior/behaviorMessage/' + id });
}
