import type * as T from '@/apis/task/type'
import http from '@/utils/http'

const BASE_URL = '/coin/task'

export function listTask(query: T.TaskPageQuery) {
  return http.get<PageRes<T.TaskListResp[]>>(`${BASE_URL}/info/page`, query)
}
export function taskById(id: number) {
  return http.get<T.TaskListResp[]>(`${BASE_URL}/info/${id}`)
}
export function taskPost(data: T.TaskData) {
  return http.post<any>(`${BASE_URL}/info`, data)
}

export function taskUpdata(id: number, data: T.TaskData) {
  return http.put<any>(`${BASE_URL}/info/${id}`, data)
}
export function taskDel(id: number) {
  return http.del<any>(`${BASE_URL}/info/${id}`)
}
