修复 OpenAPI 导出的相应接口缺失 stream 字段

This commit is contained in:
pohgxz 2026-01-29 14:14:11 +08:00
parent 73fcfb5900
commit b958e9e803

View File

@ -105,7 +105,8 @@ export function generateOpenAPI () {
retcode: 0,
data: schemas.returnExample || {},
message: '',
wording: ''
wording: '',
stream: 'normal-action'
}
}
};
@ -119,7 +120,8 @@ export function generateOpenAPI () {
retcode: error.code,
data: null,
message: error.description,
wording: error.description
wording: error.description,
stream: 'normal-action'
}
};
});
@ -132,7 +134,8 @@ export function generateOpenAPI () {
retcode: 1400,
data: null,
message: '请求参数错误或业务逻辑执行失败',
wording: '请求参数错误或业务逻辑执行失败'
wording: '请求参数错误或业务逻辑执行失败',
stream: 'normal-action'
}
};
}
@ -171,7 +174,8 @@ export function generateOpenAPI () {
retcode: { type: 'number', description: '返回码' },
data: { ...cleanReturn, description: '数据' },
message: { type: 'string', description: '消息' },
wording: { type: 'string', description: '提示' }
wording: { type: 'string', description: '提示' },
stream: { type: 'string', description: '流式响应', enum: ['stream-action', 'normal-action'] }
},
required: ['status', 'retcode', 'data']
},