import type {
  AuthRoutes,
  UserRoutes,
  RoleRoutes,
  FileRoutes,
  ChannelRoutes,
  CompanyRoutes,
  DisabilityRoutes,
  OrderRoutes,
  PlatformRoutes,
  SalaryRoutes,
  EnterpriseAuthRoutes,
  EnterpriseCompanyRoutes,
  EnterpriseDisabilityRoutes
} from '@d8d/server'
import { rpcClient } from './utils/rpc-client'

// 创建各个模块的RPC客户端
export const authClient = rpcClient<AuthRoutes>().api.v1.auth
export const userClient = rpcClient<UserRoutes>().api.v1.users
export const roleClient = rpcClient<RoleRoutes>().api.v1.roles
export const fileClient = rpcClient<FileRoutes>().api.v1.files

// Allin系统移植模块客户端
export const channelClient = rpcClient<ChannelRoutes>().api.v1.channel
export const companyClient = rpcClient<CompanyRoutes>().api.v1.company
export const disabilityClient = rpcClient<DisabilityRoutes>().api.v1.disability
export const orderClient = rpcClient<OrderRoutes>().api.v1.order
export const platformClient = rpcClient<PlatformRoutes>().api.v1.platform
export const salaryClient = rpcClient<SalaryRoutes>().api.v1.salary

// 用人方小程序专用客户端（史诗012补充API）
export const enterpriseAuthClient = rpcClient<EnterpriseAuthRoutes>().api.v1.yongren.auth
export const enterpriseCompanyClient = rpcClient<EnterpriseCompanyRoutes>().api.v1.yongren.company
export const enterpriseDisabilityClient = rpcClient<EnterpriseDisabilityRoutes>().api.v1.yongren['disability-person']