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

const BASE_URL = '/tgUser'
const BASE_URL1 = '/invite/rewards'
export function listUserTg(query: T.UserPageQuery) {
  return http.get<PageRes<T.UserListResp[]>>(`${BASE_URL}/getTgUserList`, query)
}

export function listJiangli(query: T.JiangliPageQuery) {
  return http.get<PageRes<T.JiangliListResp[]>>(`${BASE_URL1}/rules/page`, query)
}
export function jiangliById(id: number) {
  return http.get<T.JiangliListResp[]>(`${BASE_URL1}/rules/${id}`)
}
export function jiangliPost(data: T.JiangliData) {
  return http.post<any>(`${BASE_URL1}/rules`, data)
}

export function jiangliUpdata(id: number, data: T.JiangliData) {
  return http.put<any>(`${BASE_URL1}/rules/${id}`, data)
}
export function jiangliDel(id: number) {
  return http.del<any>(`${BASE_URL1}/rules/${id}`)
}

export function userListUpdata(id: number, data: T.UserListResp) {
  return http.put<any>(`${BASE_URL}/${id}`, data)
}

export function userListDisable(id: number) {
  return http.get<any>(`${BASE_URL}/disable/${id}`)
}

export function listUserDetailTg(query: T.UserPageQuery) {
  return http.get<PageRes<T.UserListResp[]>>(`${BASE_URL}/getMyTeamUserList`, query)
}
