import api from "./core/api";
import request from "./core/request";

/**
 * @description: 事件上报、事件列表、事件详情
 */

//ai识别
export async function postPhotoAcquisitionCategory(data: {
  img: string;
}): Promise<Resp<API.PhotoAcquisitionCategoryDto>> {
  return request(
    api.eventUrl + "/preprocessing/event-info/problemPhotoAcquisitionCategory",
    { method: "POST", data }
  );
}

//上报事件信息
export async function postReportEventSourceInfo(
  data: API.ReportEventSourceInfoReq
): Promise<Resp<API.EventMembers | boolean>> {
  return request(api.eventUrl + "/preprocessing/event-info/reportSourceInfo", {
    method: "POST",
    data,
  });
}

//事件列表
export async function postEventList(
  params: API.EventListReq
): Promise<Resp<API.EventListDto>> {
  return request(api.reportUrl + "/citizenServices/getMyHandlingList", {
    method: "POST",
    params,
  });
}

//获取事件基本信息
export async function getEventInfo(
  eventId: string
): Promise<Resp<API.CaseInfoDto>> {
  return request(
    api.eventUrl +
      "/cgtfoperation/operation/event-info-details/event-info/" +
      eventId,
    {
      method: "GET",
    }
  );
}

//获取事件附件
export async function getEventAttachmentInfo(
  eventId: string
): Promise<Resp<API.CaseAttachment>> {
  return request(
    api.eventUrl +
      "/cgtfoperation/operation/event-info-details/list-event-attachment-info/" +
      eventId,
    {
      method: "GET",
    }
  );
}

//获取事件流转记录
export async function getEventCirculation(
  eventId: string
): Promise<Resp<API.CulationType[]>> {
  return request(
    api.eventUrl +
      "/cgtfoperation/operation/event-info-details/list-event-circulation-record/" +
      eventId,
    {
      method: "GET",
    }
  );
}
