import {
  AuditQueryParam,
  AuditPageResult,
  CheckNotPassForm,
  IdQueryParam,
  AuditDetailResponse
} from '@/types/api/member/audit';
import request from '@/utils/request';
import { AxiosPromise } from 'axios';

/**
 * "会员实名审核"
 * @param data
 */
export function memberRealNameList(data: AuditQueryParam): AxiosPromise<AuditPageResult> {
  return request({
    url: 'admin/member/member-application/page-query',
    method: 'post',
    params: data
  });
}

/**
 * "会员实名审核通过"
 * @param data
 */
export function memberCheckPass(data: any): any {
  return request({
    url: `admin/member/member-application/${data}/pass`,
    method: 'patch',
  });
}

/**
 * 会员实名审核不通过
 * @param url 
 * @param data 
 * @returns 
 */
export function memberCheckNotPass(url: any, data: CheckNotPassForm): any {
  return request({
    url: `admin/member/member-application/${url}/no-pass`,
    method: 'patch',
    params: data
  });
}

/**
 * "会员实名审核详情页"
 * @param data
 */
export function memberRealNameDetail(data: IdQueryParam): AxiosPromise<AuditDetailResponse> {
  return request({
    url: 'admin/member/member-application/detail',
    method: 'post',
    params: data
  });
}
