declare interface Resp<T> {
  code: number;
  msg?: string;
  data: T;
}
declare namespace API {
  interface LoginRespDto {
    access_token: string;
    user_info: {
      nickname: string | null;
    };
  }
  interface UserInfoRespDto {
    appUser: {
      id: string;
      nickname: string;
      avatar: string;
      mobile: string;
    };
  }

  interface TypeOfLegalPerson {
    id: string;
    name: string;
  }

  interface PropsWithPagination<
    T extends Record<string, any> = Record<string, any>
  > {
    nextPage: number;
    pageNum: number;
    pageSize: number;
    pages: number;
    prePage: number;
    size: number;
    startRow: number;
    total: number;
    list: T[];
    hasNextPage: boolean;
  }

  interface Pagination<T extends Record<string, any> = Record<string, any>> {
    pages: number;
    page: number;
    total: number;
    items: T[];
    hasNext: boolean;
  }

  interface StatisticsDto {
    collectionTotal: string;
    signTotal: string;
    weightSum: string;
  }

  interface RecommendDto {
    businessId: string;
    businessName: string;
    type: string;
  }

  interface CarListDot {
    label: string;
    value: string;
  }

  interface MerchantsListDot {
    name: string;
    value: string;
  }

  interface SignListDto {
    businessId: string;
    businessName: string;
    signTime: string;
  }

  interface CollectionListDto {
    businessId: string;
    businessName: string;
    carNum: string;
    collectionId: string;
    collectionName: string;
    collectionTime: string;
    createdBy: string;
    createdTime: string;
    id: string;
    isDeleted: string;
    personnelName: string;
    updatedTime: string;
    updayedBy: string;
    weight: string;
  }

  /** 记录详情 */
  interface ReportRecordDto {
    handlingStatus: string;
    createTime: string;
    id: string;
    type: string;
    content: string;
    handlingDeptName?: string;
    handleReply?: string;
    handleTime?: string;
    /** 类型文字  */
    typeText: string;
    /** 附件图片1 */
    annex1?: string;
    annex2?: string;
    annex3?: string;
  }
  /** 个人中心统计 */
  interface PersonalCenterStatisticsDto {
    name: string;
    processingNum: number;
    totalNum: number;
    type: string;
  }
  /** 政策法规后台数据dto */
  interface LawDto {
    coverImage: string;
    createTime: string;
    description: string;
    digestText: string;
    filePath?: string;
    id: string;
    title: string;
  }
  /** 便民服务点位信息 */
  interface LocationTypeDto {
    categoryName: string;
    categoryType: string;
    delFlag: string;
    enableFlag: string;
    icons: string;
    id: string;
    managementDeptId: string;
    managementDeptName?: string;
  }
  /** 地图上点位基本信息 */
  interface PointInfoDto {
    address: string;
    createTime: string;
    description: string;
    distance: string;
    id: string;
    images: string;
    latitude: string;
    locationTitle: string;
    longitude: string;
    status: string;
    visitCount: 0;
    workTime: string;
    workTypeId: string;
    workTypeText: string;
  }

  interface ReportEventSourceInfoReq {
    standardEventTitle?: string; //标题 //极简上报的描述就传入此字段
    standardEventContent?: string; //描述
    collectionMode: string; //事件采集方式
    handlingMethod: string; //办理方式  1:派遣处置，2:自查自处，3:通知商户整改
    eventReportInfoExtend: {
      articleCode: string;
      sourceSystemCode: "XD-CITIZEN"; //固定传
      sourceSystem: "市民之声"; //固定传巡查通
      newInstCondCode: string;
      newInstCondName: string;
      cityCode: string;
      cityName: string;
      districtCode: string;
      districtName: string;
      streetCode: string;
      streetName: string;
      eventIndustryCode: string; //行业code
      eventIndustryName: string; //行业name
      communityCode: string;
      communityName: string;
      lon: string; //事件经度
      lat: string; //事件纬度
      coordinateType: string; //坐标类型
      address: string;
      aiFlag: "0"; //是否ai识别分类0
      roadName: string;
    };
    beforeFilePath: string[];
    afterFilePath?: string[];
  }

  interface RegisterCondsDto {
    id: string;
    aiProblemDescription: string;
    registeredCondCode: string;
    registeredCondName: string;
    resolutionCond: string;
    thirdTypeCode: string;
  }

  interface DetectedInfoItem {
    class_name: string;
    rubbish_id: string;
    score: string;
    x_left: number;
    x_right: number;
    y_left: number;
    y_right: number;
    classifyRegisterConds: RegisterCondsDto[];
    eventCategoryInfo: {
      componentCode: string;
      componentName: string;
      mainTypeCode: string;
      mainTypeName: string;
      subTypeCode: string;
      subTypeName: string;
      thirdTypeCode: string;
      thirdTypeName: string;
      classifyRegisterConds: RegisterCondsDto[];
    };
  }

  interface PhotoAcquisitionCategoryDto {
    code: number;
    data: {
      algorithmIcon: string;
      algorithmName: string;
      detectedInfo: DetectedInfoItem[];
    }[];
  }

  interface UserMembersDto {
    centerPoint: {
      lat: string;
      lng: string;
    };
    department: string;
    eventGroupExName: string;
    gridId: string;
    gridName: string;
    memberId: string;
    memberName: string;
    phone: string;
    photoUrl: string;
    position: string;
    responsibilityConfigId: string;
    responsibilitySystemId: string;
    responsibilitySystemName: string;
    responsibilityType: string;
    shape: string;
    workScheduleName: string;
  }

  interface EventMembers {
    disposeMembers: UserMembersDto[];
    superviseMembers: UserMembersDto[];
    disposeNum: number;
    patrolMembers: UserMembersDto[];
    patrolNum: number;
    superviseNum: number;
  }

  interface CaseStatus {
    jointStatusName: string;
    concatenatedJointStatusNames: string;
    customSort: number;
  }

  interface ListDto<T> {
    page: number;
    hasNext?: boolean;
    count?: number;
    total: number;
    pages: number;
    noMoreText?: string;
    items: T[];
  }

  interface EventListDto extends ListDto<any> {
    items: EventDto[];
  }

  interface EventDto {
    address: string;
    caseStatus: string;
    caseStatusText:string;
    id: string;
    reportTime: string;
    standardEventContent:string;
    standardEventTitle: string;
    caseStatusColor:string;
  }

  interface EventListReq {
    page: number;
    count: number;
    eventType: 1 | 2;//1随手拍 2举手之劳
  }

  interface CaseInfoDto {
    handlingMethod: any;
    standardEventTitle: string;
    address: string;
    aiFlag: string;
    cityCode: string;
    cityName: string;
    communityCode: string;
    eventCollectionModeName: string;
    componentCode: string;
    componentName: string;
    extendAddress: string;
    extendClass: string;
    informantId: string;
    informantName: string;
    standardEventNumber: string;
    newInstCondName: string;
    lat: string;
    lon: string;
    jointStatusName: string;
    eventStatusName: string;
    eventStatus: string;
    standardEventContent: string;
  }

  interface AttachmentInfo {
    attachmentId: string;
    attachmentPath: string;
    attachmentType: string;
    circulationRecordId: string;
    createTime: string;
    eventId: string;
    fileType: string;
  }

  interface CaseAttachment {
    handledAttachmentInfos: AttachmentInfo[];
    preHandleAttachmentInfos: AttachmentInfo[];
  }

  //案件流转
  interface CulationType {
    caseStatus: string;
    caseStatusName: string;
    remainingTimeText: string;
    circulationRecordId: string; //流转记录ID
    consumptionTimeText: string;
    createTime: string;
    eventId: string; //事件ID
    operationType: string; //节点办理内容（上报、受理、立案等）
    circulationPersonName: string; //流转人员（设备）名称
    circulationPersonId: string; //流转人员（设备）ID
    personRoles: string; //人员岗位
    personHeadPic: string; //人员头像
    personRolesCode: string; //人员岗位代码
    processingCenter: string; //办理中心
    processingCenterId: string; //办理中心ID
    contactNumber: string; //联系方式
    recordTime: string; //记录时间
    signStatus: string; //签收状态（0不需要签收，1待签收，2已签收）
    remarks: string;
  }
}
