import { hc } from 'hono/client'
import type {
  AuthRoutes, UserRoutes, RoleRoutes, FileRoutes,
  ClassroomDataRoutes, SubmissionRecordsRoutes,
  StockDataRoutes, StockXunlianCodesRoutes, DateNotesRoutes, AliyunRoutes,
  WechatAuthRoutes, ChatMessageRoutes, VodRoutes, VodVideoRoutes
} from '@/server/api';
import { axiosFetch } from './utils/axios-fetch';

export const authClient = hc<AuthRoutes>('/', {
  fetch: axiosFetch,
}).api.v1.auth;

export const userClient = hc<UserRoutes>('/', {
  fetch: axiosFetch,
}).api.v1.users;

export const roleClient = hc<RoleRoutes>('/', {
  fetch: axiosFetch,
}).api.v1.roles;

export const fileClient = hc<FileRoutes>('/', {
  fetch: axiosFetch,
}).api.v1.files;

export const classroomDataClient = hc<ClassroomDataRoutes>('/', {
  fetch: axiosFetch,
}).api.v1['classroom-data'];

export const submissionRecordsClient = hc<SubmissionRecordsRoutes>('/', {
  fetch: axiosFetch,
}).api.v1['submission-records'];

export const stockDataClient = hc<StockDataRoutes>('/', {
  fetch: axiosFetch,
}).api.v1['stock-data'];

export const stockXunlianCodesClient = hc<StockXunlianCodesRoutes>('/', {
  fetch: axiosFetch,
}).api.v1['stock-xunlian-codes'];

export const dateNotesClient = hc<DateNotesRoutes>('/', {
  fetch: axiosFetch,
}).api.v1['date-notes'];

export const aliyunClient = hc<AliyunRoutes>('/', {
  fetch: axiosFetch,
}).api.v1.aliyun;

export const wechatAuthClient = hc<WechatAuthRoutes>('/', {
  fetch: axiosFetch,
}).api.v1.auth.wechat;

export const chatMessageClient = hc<ChatMessageRoutes>('/', {
  fetch: axiosFetch,
}).api.v1['chat-messages'];

export const vodClient = hc<VodRoutes>('/', {
  fetch: axiosFetch,
}).api.v1.vod;

export const vodVideoClient = hc<VodVideoRoutes>('/', {
  fetch: axiosFetch,
}).api.v1['vod-videos'];
