import type {
  AuthRoutes,
  UserRoutes,
  RoleRoutes,
  FileRoutes,
  GoodsRoutes,
  GoodsCategoryRoutes,
  DeliveryAddressRoutes,
  OrderRoutes,
  OrderGoodsRoutes,
  MerchantRoutes,
  AreaRoutes
} 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

// 电商相关客户端
export const goodsClient = rpcClient<GoodsRoutes>().api.v1.goods
export const goodsCategoryClient = rpcClient<GoodsCategoryRoutes>().api.v1['goods-categories']
export const deliveryAddressClient = rpcClient<DeliveryAddressRoutes>().api.v1['delivery-addresses']
export const orderClient = rpcClient<OrderRoutes>().api.v1.orders
export const orderGoodsClient = rpcClient<OrderGoodsRoutes>().api.v1['orders-goods']
export const merchantClient = rpcClient<MerchantRoutes>().api.v1.merchants

// 系统相关客户端
export const areaClient = rpcClient<AreaRoutes>().api.v1.areas