import baseAxios from '../index'
import { eAQRStatus } from '@/types/chat'
import { FAQItem } from './type'
export default class FAQService {
  static instance: FAQService
  static getInstance() {
    if (!FAQService.instance) {
      FAQService.instance = new FAQService()
    }
    return FAQService.instance
  }
  AddQueAns(data:{answer:string;question: string }){
    return baseAxios({
      url:'/faq/admin/add',
      method:'POST',
      data,
    })
  }
  DeleteQueAns(data:{id:string}){
    return baseAxios({
      url:'faq/admin/delete',
      method:'DELETE',
      // data
      params: data,
    })
  }
  CheckQueAnsList(data:{
    end_time: number
    limit: number
    faq_status: number
    offset: number
    start_time: number
    }){
      return baseAxios({
        url:'faq/admin/list',
        method:'POST',
        data
      })
  }
  ModifyQueAns(data:{faq_status: eAQRStatus,id: number}){
    return baseAxios({
      url:'faq/admin/modify/status',
      method:'POST',
      data,
    })
  }
  CheckMsg(data:{question:string}){
    return baseAxios({
      url:'faq/query/answer',
      method:'GET',
      data:data,
    })
  }
  CheckList(){
    return baseAxios({
      url:'faq/query/list',
      method:'GET',
    })
  }

}

