Prechádzať zdrojové kódy

✨ feat(payment): 为支付路由添加404错误响应

- 在支付路由的API文档中添加订单不存在的404错误响应定义

📦 build(data-overview): 调整模块构建配置

- 将package.json中的主入口和类型定义从dist目录改为直接指向src目录下的TypeScript源文件
- 调整所有子模块导出的路径配置,以支持开发时的直接TypeScript引用

🐛 fix(feie-printer): 修正模拟API响应数据结构

- 在Feie打印机服务的模拟响应中,将data字段从对象结构改为空字符串
- 添加serverExecutedTime字段以匹配实际API响应格式

♻️ refactor(goods): 优化Zod模式类型定义

- 为AdminGoodsSchema和PublicGoodsSchema明确指定ZodObject<any>类型
- 将children字段中的惰性引用从箭头函数改为显式返回ZodType<any>的函数声明,以解决类型推断问题
yourname 3 týždňov pred
rodič
commit
903830d12f

+ 8 - 0
packages/credit-balance-module-mt/src/routes/payment.mt.ts

@@ -53,6 +53,14 @@ const paymentRoute = createRoute({
         }
       }
     },
+    404: {
+      description: '订单不存在',
+      content: {
+        'application/json': {
+          schema: ErrorSchema
+        }
+      }
+    },
     500: {
       description: '服务器内部错误',
       content: {

+ 17 - 17
packages/data-overview-module-mt/package.json

@@ -3,33 +3,33 @@
   "version": "1.0.0",
   "description": "多租户数据概览统计模块 - 提供数据概览统计服务,支持时间筛选、多租户数据隔离和缓存优化",
   "type": "module",
-  "main": "dist/src/index.js",
-  "types": "dist/src/index.d.ts",
+  "main": "src/index.ts",
+  "types": "src/index.ts",
   "exports": {
     ".": {
-      "types": "./dist/src/index.d.ts",
-      "import": "./dist/src/index.js",
-      "require": "./dist/src/index.js"
+      "types": "./src/index.ts",
+      "import": "./src/index.ts",
+      "require": "./src/index.ts"
     },
     "./services": {
-      "types": "./dist/src/services/index.d.ts",
-      "import": "./dist/src/services/index.js",
-      "require": "./dist/src/services/index.js"
+      "types": "./src/services/index.ts",
+      "import": "./src/services/index.ts",
+      "require": "./src/services/index.ts"
     },
     "./schemas": {
-      "types": "./dist/src/schemas/index.d.ts",
-      "import": "./dist/src/schemas/index.js",
-      "require": "./dist/src/schemas/index.js"
+      "types": "./src/schemas/index.ts",
+      "import": "./src/schemas/index.ts",
+      "require": "./src/schemas/index.ts"
     },
     "./routes": {
-      "types": "./dist/src/routes/index.d.ts",
-      "import": "./dist/src/routes/index.js",
-      "require": "./dist/src/routes/index.js"
+      "types": "./src/routes/index.ts",
+      "import": "./src/routes/index.ts",
+      "require": "./src/routes/index.ts"
     },
     "./types": {
-      "types": "./dist/src/types/index.d.ts",
-      "import": "./dist/src/types/index.js",
-      "require": "./dist/src/types/index.js"
+      "types": "./src/types/index.ts",
+      "import": "./src/types/index.ts",
+      "require": "./src/types/index.ts"
     }
   },
   "files": [

+ 2 - 4
packages/feie-printer-module-mt/src/services/feie-api.service.ts

@@ -329,10 +329,8 @@ export class FeieApiService {
       return {
         ret: 0,
         msg: 'ok',
-        data: {
-          ok: [sn],
-          no: []
-        }
+        data: '',
+        serverExecutedTime: 0
       };
     }
 

+ 2 - 2
packages/goods-module-mt/src/schemas/admin-goods.schema.mt.ts

@@ -6,7 +6,7 @@ import { MerchantSchemaMt } from '@d8d/merchant-module-mt/schemas';
 import { ParentGoodsSchema } from './parent-goods.schema.mt';
 
 // 管理员专用商品Schema - 保留完整权限字段
-export const AdminGoodsSchema = z.object({
+export const AdminGoodsSchema: z.ZodObject<any> = z.object({
   id: z.number().int().positive().openapi({ description: '商品ID' }),
   name: z.string().min(1, '商品名称不能为空').max(255, '商品名称最多255个字符').openapi({
     description: '商品名称',
@@ -117,7 +117,7 @@ export const AdminGoodsSchema = z.object({
     description: '商品主图信息'
   }),
   // 父子商品关系字段
-  children: z.array(z.lazy(() => AdminGoodsSchema)).nullable().optional().openapi({
+  children: z.array(z.lazy((): z.ZodType<any> => AdminGoodsSchema)).nullable().optional().openapi({
     description: '子商品列表(仅父商品返回)',
     example: []
   }),

+ 2 - 2
packages/goods-module-mt/src/schemas/public-goods.schema.mt.ts

@@ -8,7 +8,7 @@ import { ParentGoodsSchema } from './parent-goods.schema.mt';
 // 公开商品Schema - 只读查询,仅包含可用状态的商品
 // 响应schema保持完整字段,但只支持查询操作
 
-export const PublicGoodsSchema = z.object({
+export const PublicGoodsSchema: z.ZodObject<any> = z.object({
   id: z.number().int().positive().openapi({ description: '商品ID' }),
   name: z.string().min(1, '商品名称不能为空').max(255, '商品名称最多255个字符').openapi({
     description: '商品名称',
@@ -115,7 +115,7 @@ export const PublicGoodsSchema = z.object({
     description: '商品主图信息'
   }),
   // 父子商品关系字段
-  children: z.array(z.lazy(() => PublicGoodsSchema)).nullable().optional().openapi({
+  children: z.array(z.lazy((): z.ZodType<any> => PublicGoodsSchema)).nullable().optional().openapi({
     description: '子商品列表(仅父商品返回)',
     example: []
   }),