import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { GeoIdentityApplyVO, GeoIdentityApplyForm, GeoIdentityApplyQuery } from '@/api/smarttrace/geoIdentityApply/types';

/**
 * 查询地址标志申报列表
 * @param query
 * @returns {*}
 */

export const listGeoIdentityApply = (query?: GeoIdentityApplyQuery): AxiosPromise<GeoIdentityApplyVO[]> => {
  return request({
    url: '/smarttrace/geoIdentityApply/queryPageList',
    method: 'get',
    params: query
  });
};

/**
 * 查询地址标志申报详细
 * @param id
 */
export const getGeoIdentityApply = (id: string | number): AxiosPromise<GeoIdentityApplyVO> => {
  return request({
    url: '/smarttrace/geoIdentityApply/getInfo/' + id,
    method: 'get'
  });
};

/**
 * 新增地址标志申报
 * @param data
 */
export const addGeoIdentityApply = (data: GeoIdentityApplyForm) => {
  return request({
    url: '/smarttrace/geoIdentityApply/add',
    method: 'post',
    data: data
  });
};

/**
 * 修改地址标志申报
 * @param data
 */
export const updateGeoIdentityApply = (data: GeoIdentityApplyForm) => {
  return request({
    url: '/smarttrace/geoIdentityApply/edit',
    method: 'post',
    data: data
  });
};

/**
 * 删除地址标志申报
 * @param id
 */
export const delGeoIdentityApply = (id: string | number | Array<string | number>) => {
  return request({
    url: '/smarttrace/geoIdentityApply/remove/' + id,
    method: 'get'
  });
};

// 基地申报审批
export const geoApproval = (query?: any): AxiosPromise<any> => {
  return request({
      url: '/smarttrace/geoIdentityApply/approval',
      method: 'post',
      data: query
  });
};
