diff --git a/example/schema.json b/example/schema.json index 0ef0f74..84debfc 100644 --- a/example/schema.json +++ b/example/schema.json @@ -1 +1 @@ -{"Result":{"success":{"type":"boolean","comment":",","optional":true,"data":true},"data":{"type":"WorkOrderView","comment":",","optional":true},"msg":{"type":"string","comment":",","optional":true,"data":"这是默认的string"},"code":{"type":"string","comment":",","optional":true,"data":"这是默认的string"},"traceId":{"type":"string","comment":"","optional":true,"data":"这是默认的string"}},"WorkOrderView":{"id":{"type":"string","comment":" 工单信息: 工单id,","optional":true,"data":"这是默认的string"},"cityCode":{"type":"string","comment":" 工单信息: 城市code,","optional":true,"data":"这是默认的string"},"cityName":{"type":"string","comment":" 工单信息: 城市名称,","optional":true,"data":"这是默认的string"},"province":{"type":"string","comment":" 工单信息: 省份名称,","optional":true,"data":"这是默认的string"},"type":{"type":"string","comment":" 工单信息: 工单类型,","optional":true,"data":"这是默认的string"},"number":{"type":"string","comment":" 工单信息: 工单编号,","optional":true,"data":"这是默认的string"},"dateCreate":{"type":"string","comment":" 工单信息: 创建时间,","optional":true,"data":"这是默认的string"},"dateUpdate":{"type":"string","comment":" 工单信息: 最后更新时间,","optional":true,"data":"这是默认的string"},"transactor":{"type":"string","comment":" 工单信息: 处理人id,","optional":true,"data":"这是默认的string"},"transactorName":{"type":"string","comment":" 工单信息: 处理人name,","optional":true,"data":"这是默认的string"},"status":{"type":"number","comment":" 工单信息: 工单状态 0:待处理 1:处理中 2:已解决,","optional":true,"data":123},"description":{"type":"string","comment":" 工单信息: 问题描述,","optional":true,"data":"这是默认的string"},"creatorId":{"type":"string","comment":" 工单信息: 创建人id,","optional":true,"data":"这是默认的string"},"creatorName":{"type":"string","comment":" 工单信息: 创建人名称,","optional":true,"data":"这是默认的string"},"source":{"type":"string","comment":" 工单信息: 工单来源,","optional":true,"data":"这是默认的string"},"newlyReply":{"type":"string","comment":" 工单信息: 最近回复,","optional":true,"data":"这是默认的string"},"customerName":{"type":"string","comment":" 工单信息:客户姓名,","optional":true,"data":"这是默认的string"},"orderType":{"type":"string","comment":" 订单信息: 订单类型,","optional":true,"data":"这是默认的string"},"modelName":{"type":"string","comment":" 订单信息: 车型,","optional":true,"data":"这是默认的string"},"orderNo":{"type":"string","comment":" 订单信息: 订单编号,","optional":true,"data":"这是默认的string"},"orderStatus":{"type":"string","comment":" 订单信息: 订单状态,","optional":true,"data":"这是默认的string"},"vin":{"type":"string","comment":" 订单信息: vin码,","optional":true,"data":"这是默认的string"},"overTimeDay":{"type":"number","comment":" 订单信息: 超时天数,","optional":true,"data":123},"saleDealerCode":{"type":"string","comment":" 订单信息: 销售车商code,","optional":true,"data":"这是默认的string"},"saleDealerName":{"type":"string","comment":" 订单信息: 销售车商名称,","optional":true,"data":"这是默认的string"},"downPaymentDate":{"type":"string","comment":" 订单信息: 首付支付日期,","optional":true,"data":"这是默认的string"},"returnCarDate":{"type":"string","comment":" 订单信息: 应交车日期,","optional":true,"data":"这是默认的string"},"leaseOrderDetail":{"type":"string","comment":" 订单信息: 订单详情链接,","optional":true,"data":"这是默认的string"},"leaseOrderMonitor":{"type":"string","comment":" 订单信息: 订单监控链接,","optional":true,"data":"这是默认的string"},"phone":{"type":"string","comment":" 工单信息: 手机号,","optional":true,"data":"这是默认的string"},"carType":{"type":"string","comment":" 订单信息: 车型,","optional":true,"data":"这是默认的string"},"belong":{"type":"number","comment":" 问题归属,","optional":true,"data":123},"belongString":{"type":"string","comment":" 问题归属字符串,","optional":true,"data":"这是默认的string"},"orderTypeString":{"type":"string","comment":" 订单类型字符串,","optional":true,"data":"这是默认的string"},"typeString":{"type":"string","comment":" 工单类型字符串,","optional":true,"data":"这是默认的string"},"orderStatusString":{"type":"string","comment":" 订单状态中文,","optional":true,"data":"这是默认的string"},"allowSend2SF":{"type":"boolean","comment":" 是否允许转交SF,","optional":true,"data":true},"feedbackDos":{"type":"array[FeedbackDo]","comment":" 回复记录列表(工单反馈列表),","optional":true},"otherFeedbacks":{"type":"array[FeedbackDo]","comment":",","optional":true},"workOrders":{"type":"array[WorkOrderDo]","comment":" 订单相关的工单列表,","optional":true},"statusString":{"type":"string","comment":",","optional":true,"data":"这是默认的string"},"sourceString":{"type":"string","comment":"","optional":true,"data":"这是默认的string"}},"FeedbackDo":{"id":{"type":"string","comment":",","optional":true,"data":"这是默认的string"},"dateCreate":{"type":"string","comment":",","optional":true,"data":"这是默认的string"},"dateUpdate":{"type":"string","comment":",","optional":true,"data":"这是默认的string"},"dateDelete":{"type":"string","comment":",","optional":true,"data":"这是默认的string"},"userCode":{"type":"string","comment":" 人员code,","optional":true,"data":"这是默认的string"},"userName":{"type":"string","comment":" 人员名字,","optional":true,"data":"这是默认的string"},"type":{"type":"string","comment":" 对应工单类型,","optional":true,"data":"这是默认的string"},"number":{"type":"string","comment":" 工单code,","optional":false,"data":"这是默认的string"},"orderCode":{"type":"string","comment":" 订单code,","optional":true,"data":"这是默认的string"},"question":{"type":"string","comment":" 问题分类,","optional":true,"data":"这是默认的string"},"feedback":{"type":"string","comment":" 工单反馈,","optional":false,"data":"这是默认的string"},"picture":{"type":"string","comment":" 图片,","optional":true,"data":"这是默认的string"},"memo":{"type":"string","comment":" 备注,","optional":true,"data":"这是默认的string"},"source":{"type":"string","comment":" 反馈来源,","optional":true,"data":"这是默认的string"},"portrait":{"type":"string","comment":" 头像,","optional":true,"data":"这是默认的string"},"expectFinishTime":{"type":"string","comment":" 预计完成时间,","optional":true,"data":"这是默认的string"},"count":{"type":"number","comment":" 统计值,","optional":true,"data":123},"inc":{"type":"number","comment":" 0-公开,1-内部,","optional":false,"data":123},"action":{"type":"number","comment":" 0-回复,1-创建,2-认领,3-内部备注,4-转交,5-关闭,","optional":true,"data":123},"file":{"type":"string","comment":" 文件地址,","optional":true,"data":"这是默认的string"},"fileName":{"type":"string","comment":" 文件名称,","optional":true,"data":"这是默认的string"},"pictures":{"type":"array[string]","comment":"","optional":true}},"WorkOrderDo":{"id":{"type":"string","comment":",","optional":true,"data":"这是默认的string"},"dateCreate":{"type":"string","comment":",","optional":true,"data":"这是默认的string"},"dateUpdate":{"type":"string","comment":",","optional":true,"data":"这是默认的string"},"dateDelete":{"type":"string","comment":",","optional":true,"data":"这是默认的string"},"cityCode":{"type":"string","comment":" 城市code,","optional":true,"data":"这是默认的string"},"overTime":{"type":"string","comment":" 超时日期,","optional":true,"data":"这是默认的string"},"type":{"type":"string","comment":" 工单类型,","optional":true,"data":"这是默认的string"},"orderType":{"type":"string","comment":" 订单类型,","optional":true,"data":"这是默认的string"},"feedback":{"type":"number","comment":" 0未反馈,1已反馈,","optional":true,"data":123},"extra":{"type":"string","comment":" 扩展字段,","optional":true,"data":"这是默认的string"},"number":{"type":"string","comment":" 工单编号,","optional":true,"data":"这是默认的string"},"vin":{"type":"string","comment":" vin码,","optional":true,"data":"这是默认的string"},"shopCode":{"type":"string","comment":" 店铺code,","optional":true,"data":"这是默认的string"},"shopName":{"type":"string","comment":" 店铺名称,","optional":true,"data":"这是默认的string"},"cityName":{"type":"string","comment":" 城市名称,","optional":true,"data":"这是默认的string"},"overTimeDay":{"type":"number","comment":" 超时天数,","optional":true,"data":123},"dateFinish":{"type":"string","comment":" 结束时间,","optional":true,"data":"这是默认的string"},"orderNo":{"type":"string","comment":" 订单编号,","optional":true,"data":"这是默认的string"},"transactor":{"type":"string","comment":" 处理人,","optional":true,"data":"这是默认的string"},"transactorName":{"type":"string","comment":" 处理人name,","optional":true,"data":"这是默认的string"},"status":{"type":"number","comment":" 工单状态 0:待处理(如果处理人为空则为待认领) 1:处理中 2:已解决 3:处理中(SF),","optional":true,"data":123},"source":{"type":"string","comment":" 工单来源,","optional":true,"data":"这是默认的string"},"description":{"type":"string","comment":" 问题描述,","optional":true,"data":"这是默认的string"},"creatorId":{"type":"string","comment":" 创建人id,","optional":true,"data":"这是默认的string"},"creatorName":{"type":"string","comment":" 创建人名称,","optional":true,"data":"这是默认的string"},"questionType":{"type":"string","comment":" 问题分类,","optional":true,"data":"这是默认的string"},"pic":{"type":"string","comment":" 上传图片,","optional":true,"data":"这是默认的string"},"orderTypeString":{"type":"string","comment":" 订单类型,","optional":true,"data":"这是默认的string"},"typeString":{"type":"string","comment":" 工单类型,","optional":true,"data":"这是默认的string"},"orderExtra":{"type":"string","comment":" 订单额外字段类型,","optional":true,"data":"这是默认的string"},"carExtra":{"type":"string","comment":" 车辆类型,","optional":true,"data":"这是默认的string"},"dealerExtra":{"type":"string","comment":" 车商类型,","optional":true,"data":"这是默认的string"},"dateLastReply":{"type":"string","comment":" 最后回复日期,","optional":true,"data":"这是默认的string"},"portrait":{"type":"string","comment":" 头像<来源弹B>,","optional":true,"data":"这是默认的string"},"phone":{"type":"string","comment":" 手机,","optional":true,"data":"这是默认的string"},"customerName":{"type":"string","comment":" 客户姓名,","optional":true,"data":"这是默认的string"},"lastReply":{"type":"string","comment":" 最后回复内容,","optional":true,"data":"这是默认的string"},"appReplyNumber":{"type":"number","comment":" 客户端回复次数,","optional":true,"data":123},"webReplyNumber":{"type":"number","comment":" web端回复次数,","optional":true,"data":123},"belong":{"type":"number","comment":" 问题归属,","optional":true,"data":123},"belongString":{"type":"string","comment":" 问题归属文字,","optional":true,"data":"这是默认的string"},"firstReplyDate":{"type":"string","comment":" 最初回复日期,","optional":true,"data":"这是默认的string"},"send2SFDate":{"type":"string","comment":" 最初回复日期,","optional":true,"data":"这是默认的string"},"allowSend2SF":{"type":"boolean","comment":" 是否允许转交SF,","optional":true,"data":true},"feedbacks":{"type":"array[FeedbackDo]","comment":" 回复列表,","optional":true},"leaseConsiceOrderView":{"type":"LeaseConsiceOrderView","comment":" 订单信息,","optional":true},"file":{"type":"string","comment":" 文件地址,","optional":true,"data":"这是默认的string"},"provinceCode":{"type":"string","comment":" 省份code,","optional":true,"data":"这是默认的string"},"statusString":{"type":"string","comment":",","optional":true,"data":"这是默认的string"},"sourceString":{"type":"string","comment":"","optional":true,"data":"这是默认的string"}},"LeaseConsiceOrderView":{"orderNo":{"type":"string","comment":" 订单编号,","optional":true,"data":"这是默认的string"},"orderType":{"type":"string","comment":" 订单类型,","optional":true,"data":"这是默认的string"},"orderStatus":{"type":"string","comment":" 订单状态,","optional":true,"data":"这是默认的string"},"orderStatusString":{"type":"string","comment":" 订单状态中文,","optional":true,"data":"这是默认的string"},"name":{"type":"string","comment":" 用户姓名,","optional":true,"data":"这是默认的string"},"mobile":{"type":"string","comment":" 用户手机号,","optional":true,"data":"这是默认的string"},"modelName":{"type":"string","comment":" 车型,","optional":true,"data":"这是默认的string"},"vin":{"type":"string","comment":" VIN码,","optional":true,"data":"这是默认的string"},"saleDealerName":{"type":"string","comment":" 销售车商名称,","optional":true,"data":"这是默认的string"},"downPaymentDate":{"type":"string","comment":" 首付支付日期,","optional":true,"data":"这是默认的string"},"returnCarDate":{"type":"string","comment":" 应交车日期,","optional":true,"data":"这是默认的string"},"leaseOrderDetail":{"type":"string","comment":" 订单详情链接,","optional":true,"data":"这是默认的string"},"leaseOrderMonitor":{"type":"string","comment":" 订单监控链接","optional":true,"data":"这是默认的string"}}} \ No newline at end of file +{"Result":{"success":{"type":"boolean","comment":",","optional":true,"data":true},"data":{"type":"WorkOrderView","comment":",","optional":true},"msg":{"type":"string","comment":",","optional":true,"data":"这是默认的string"},"code":{"type":"string","comment":",","optional":true,"data":"这是默认的string"},"traceId":{"type":"string","comment":"","optional":true,"data":"这是默认的string"}},"WorkOrderView":{"id":{"type":"string","comment":" 工单信息: 工单id,","optional":true,"data":"这是默认的string"},"cityCode":{"type":"string","comment":" 工单信息: 城市code,","optional":true,"data":"这是默认的string"},"cityName":{"type":"string","comment":" 工单信息: 城市名称,","optional":true,"data":"这是默认的string"},"province":{"type":"string","comment":" 工单信息: 省份名称,","optional":true,"data":"这是默认的string"},"type":{"type":"string","comment":" 工单信息: 工单类型,","optional":true,"data":"这是默认的string"},"number":{"type":"string","comment":" 工单信息: 工单编号,","optional":true,"data":"这是默认的string"},"dateCreate":{"type":"string","comment":" 工单信息: 创建时间,","optional":true,"data":"这是默认的string"},"dateUpdate":{"type":"string","comment":" 工单信息: 最后更新时间,","optional":true,"data":"这是默认的string"},"transactor":{"type":"string","comment":" 工单信息: 处理人id,","optional":true,"data":"这是默认的string"},"transactorName":{"type":"string","comment":" 工单信息: 处理人name,","optional":true,"data":"这是默认的string"},"status":{"type":"number","comment":" 工单信息: 工单状态 0:待处理 1:处理中 2:已解决,","optional":true,"data":123},"description":{"type":"string","comment":" 工单信息: 问题描述,","optional":true,"data":"这是默认的string"},"creatorId":{"type":"string","comment":" 工单信息: 创建人id,","optional":true,"data":"这是默认的string"},"creatorName":{"type":"string","comment":" 工单信息: 创建人名称,","optional":true,"data":"这是默认的string"},"source":{"type":"string","comment":" 工单信息: 工单来源,","optional":true,"data":"这是默认的string"},"newlyReply":{"type":"string","comment":" 工单信息: 最近回复,","optional":true,"data":"这是默认的string"},"customerName":{"type":"string","comment":" 工单信息:客户姓名,","optional":true,"data":"这是默认的string"},"orderType":{"type":"string","comment":" 订单信息: 订单类型,","optional":true,"data":"这是默认的string"},"modelName":{"type":"string","comment":" 订单信息: 车型,","optional":true,"data":"这是默认的string"},"orderNo":{"type":"string","comment":" 订单信息: 订单编号,","optional":true,"data":"这是默认的string"},"orderStatus":{"type":"string","comment":" 订单信息: 订单状态,","optional":true,"data":"这是默认的string"},"vin":{"type":"string","comment":" 订单信息: vin码,","optional":true,"data":"这是默认的string"},"overTimeDay":{"type":"number","comment":" 订单信息: 超时天数,","optional":true,"data":123},"saleDealerCode":{"type":"string","comment":" 订单信息: 销售车商code,","optional":true,"data":"这是默认的string"},"saleDealerName":{"type":"string","comment":" 订单信息: 销售车商名称,","optional":true,"data":"这是默认的string"},"downPaymentDate":{"type":"string","comment":" 订单信息: 首付支付日期,","optional":true,"data":"这是默认的string"},"returnCarDate":{"type":"string","comment":" 订单信息: 应交车日期,","optional":true,"data":"这是默认的string"},"leaseOrderDetail":{"type":"string","comment":" 订单信息: 订单详情链接,","optional":true,"data":"这是默认的string"},"leaseOrderMonitor":{"type":"string","comment":" 订单信息: 订单监控链接,","optional":true,"data":"这是默认的string"},"phone":{"type":"string","comment":" 工单信息: 手机号,","optional":true,"data":"这是默认的string"},"carType":{"type":"string","comment":" 订单信息: 车型,","optional":true,"data":"这是默认的string"},"belong":{"type":"number","comment":" 问题归属,","optional":true,"data":123},"belongString":{"type":"string","comment":" 问题归属字符串,","optional":true,"data":"这是默认的string"},"orderTypeString":{"type":"string","comment":" 订单类型字符串,","optional":true,"data":"这是默认的string"},"typeString":{"type":"string","comment":" 工单类型字符串,","optional":true,"data":"这是默认的string"},"orderStatusString":{"type":"string","comment":" 订单状态中文,","optional":true,"data":"这是默认的string"},"allowSend2SF":{"type":"boolean","comment":" 是否允许转交SF,","optional":true,"data":true},"feedbackDos":{"type":"array","comment":" 回复记录列表(工单反馈列表),","optional":true,"length":1,"generics":"FeedbackDo"},"otherFeedbacks":{"type":"array","comment":",","optional":true,"length":1,"generics":"FeedbackDo"},"workOrders":{"type":"array","comment":" 订单相关的工单列表,","optional":true,"length":1,"generics":"WorkOrderDo"},"statusString":{"type":"string","comment":",","optional":true,"data":"这是默认的string"},"sourceString":{"type":"string","comment":"","optional":true,"data":"这是默认的string"}},"FeedbackDo":{"id":{"type":"string","comment":",","optional":true,"data":"这是默认的string"},"dateCreate":{"type":"string","comment":",","optional":true,"data":"这是默认的string"},"dateUpdate":{"type":"string","comment":",","optional":true,"data":"这是默认的string"},"dateDelete":{"type":"string","comment":",","optional":true,"data":"这是默认的string"},"userCode":{"type":"string","comment":" 人员code,","optional":true,"data":"这是默认的string"},"userName":{"type":"string","comment":" 人员名字,","optional":true,"data":"这是默认的string"},"type":{"type":"string","comment":" 对应工单类型,","optional":true,"data":"这是默认的string"},"number":{"type":"string","comment":" 工单code,","optional":false,"data":"这是默认的string"},"orderCode":{"type":"string","comment":" 订单code,","optional":true,"data":"这是默认的string"},"question":{"type":"string","comment":" 问题分类,","optional":true,"data":"这是默认的string"},"feedback":{"type":"string","comment":" 工单反馈,","optional":false,"data":"这是默认的string"},"picture":{"type":"string","comment":" 图片,","optional":true,"data":"这是默认的string"},"memo":{"type":"string","comment":" 备注,","optional":true,"data":"这是默认的string"},"source":{"type":"string","comment":" 反馈来源,","optional":true,"data":"这是默认的string"},"portrait":{"type":"string","comment":" 头像,","optional":true,"data":"这是默认的string"},"expectFinishTime":{"type":"string","comment":" 预计完成时间,","optional":true,"data":"这是默认的string"},"count":{"type":"number","comment":" 统计值,","optional":true,"data":123},"inc":{"type":"number","comment":" 0-公开,1-内部,","optional":false,"data":123},"action":{"type":"number","comment":" 0-回复,1-创建,2-认领,3-内部备注,4-转交,5-关闭,","optional":true,"data":123},"file":{"type":"string","comment":" 文件地址,","optional":true,"data":"这是默认的string"},"fileName":{"type":"string","comment":" 文件名称,","optional":true,"data":"这是默认的string"},"pictures":{"type":"array","comment":"","optional":true,"length":1,"generics":"string"}},"WorkOrderDo":{"id":{"type":"string","comment":",","optional":true,"data":"这是默认的string"},"dateCreate":{"type":"string","comment":",","optional":true,"data":"这是默认的string"},"dateUpdate":{"type":"string","comment":",","optional":true,"data":"这是默认的string"},"dateDelete":{"type":"string","comment":",","optional":true,"data":"这是默认的string"},"cityCode":{"type":"string","comment":" 城市code,","optional":true,"data":"这是默认的string"},"overTime":{"type":"string","comment":" 超时日期,","optional":true,"data":"这是默认的string"},"type":{"type":"string","comment":" 工单类型,","optional":true,"data":"这是默认的string"},"orderType":{"type":"string","comment":" 订单类型,","optional":true,"data":"这是默认的string"},"feedback":{"type":"number","comment":" 0未反馈,1已反馈,","optional":true,"data":123},"extra":{"type":"string","comment":" 扩展字段,","optional":true,"data":"这是默认的string"},"number":{"type":"string","comment":" 工单编号,","optional":true,"data":"这是默认的string"},"vin":{"type":"string","comment":" vin码,","optional":true,"data":"这是默认的string"},"shopCode":{"type":"string","comment":" 店铺code,","optional":true,"data":"这是默认的string"},"shopName":{"type":"string","comment":" 店铺名称,","optional":true,"data":"这是默认的string"},"cityName":{"type":"string","comment":" 城市名称,","optional":true,"data":"这是默认的string"},"overTimeDay":{"type":"number","comment":" 超时天数,","optional":true,"data":123},"dateFinish":{"type":"string","comment":" 结束时间,","optional":true,"data":"这是默认的string"},"orderNo":{"type":"string","comment":" 订单编号,","optional":true,"data":"这是默认的string"},"transactor":{"type":"string","comment":" 处理人,","optional":true,"data":"这是默认的string"},"transactorName":{"type":"string","comment":" 处理人name,","optional":true,"data":"这是默认的string"},"status":{"type":"number","comment":" 工单状态 0:待处理(如果处理人为空则为待认领) 1:处理中 2:已解决 3:处理中(SF),","optional":true,"data":123},"source":{"type":"string","comment":" 工单来源,","optional":true,"data":"这是默认的string"},"description":{"type":"string","comment":" 问题描述,","optional":true,"data":"这是默认的string"},"creatorId":{"type":"string","comment":" 创建人id,","optional":true,"data":"这是默认的string"},"creatorName":{"type":"string","comment":" 创建人名称,","optional":true,"data":"这是默认的string"},"questionType":{"type":"string","comment":" 问题分类,","optional":true,"data":"这是默认的string"},"pic":{"type":"string","comment":" 上传图片,","optional":true,"data":"这是默认的string"},"orderTypeString":{"type":"string","comment":" 订单类型,","optional":true,"data":"这是默认的string"},"typeString":{"type":"string","comment":" 工单类型,","optional":true,"data":"这是默认的string"},"orderExtra":{"type":"string","comment":" 订单额外字段类型,","optional":true,"data":"这是默认的string"},"carExtra":{"type":"string","comment":" 车辆类型,","optional":true,"data":"这是默认的string"},"dealerExtra":{"type":"string","comment":" 车商类型,","optional":true,"data":"这是默认的string"},"dateLastReply":{"type":"string","comment":" 最后回复日期,","optional":true,"data":"这是默认的string"},"portrait":{"type":"string","comment":" 头像<来源弹B>,","optional":true,"data":"这是默认的string"},"phone":{"type":"string","comment":" 手机,","optional":true,"data":"这是默认的string"},"customerName":{"type":"string","comment":" 客户姓名,","optional":true,"data":"这是默认的string"},"lastReply":{"type":"string","comment":" 最后回复内容,","optional":true,"data":"这是默认的string"},"appReplyNumber":{"type":"number","comment":" 客户端回复次数,","optional":true,"data":123},"webReplyNumber":{"type":"number","comment":" web端回复次数,","optional":true,"data":123},"belong":{"type":"number","comment":" 问题归属,","optional":true,"data":123},"belongString":{"type":"string","comment":" 问题归属文字,","optional":true,"data":"这是默认的string"},"firstReplyDate":{"type":"string","comment":" 最初回复日期,","optional":true,"data":"这是默认的string"},"send2SFDate":{"type":"string","comment":" 最初回复日期,","optional":true,"data":"这是默认的string"},"allowSend2SF":{"type":"boolean","comment":" 是否允许转交SF,","optional":true,"data":true},"feedbacks":{"type":"array","comment":" 回复列表,","optional":true,"length":1,"generics":"FeedbackDo"},"leaseConsiceOrderView":{"type":"LeaseConsiceOrderView","comment":" 订单信息,","optional":true},"file":{"type":"string","comment":" 文件地址,","optional":true,"data":"这是默认的string"},"provinceCode":{"type":"string","comment":" 省份code,","optional":true,"data":"这是默认的string"},"statusString":{"type":"string","comment":",","optional":true,"data":"这是默认的string"},"sourceString":{"type":"string","comment":"","optional":true,"data":"这是默认的string"}},"LeaseConsiceOrderView":{"orderNo":{"type":"string","comment":" 订单编号,","optional":true,"data":"这是默认的string"},"orderType":{"type":"string","comment":" 订单类型,","optional":true,"data":"这是默认的string"},"orderStatus":{"type":"string","comment":" 订单状态,","optional":true,"data":"这是默认的string"},"orderStatusString":{"type":"string","comment":" 订单状态中文,","optional":true,"data":"这是默认的string"},"name":{"type":"string","comment":" 用户姓名,","optional":true,"data":"这是默认的string"},"mobile":{"type":"string","comment":" 用户手机号,","optional":true,"data":"这是默认的string"},"modelName":{"type":"string","comment":" 车型,","optional":true,"data":"这是默认的string"},"vin":{"type":"string","comment":" VIN码,","optional":true,"data":"这是默认的string"},"saleDealerName":{"type":"string","comment":" 销售车商名称,","optional":true,"data":"这是默认的string"},"downPaymentDate":{"type":"string","comment":" 首付支付日期,","optional":true,"data":"这是默认的string"},"returnCarDate":{"type":"string","comment":" 应交车日期,","optional":true,"data":"这是默认的string"},"leaseOrderDetail":{"type":"string","comment":" 订单详情链接,","optional":true,"data":"这是默认的string"},"leaseOrderMonitor":{"type":"string","comment":" 订单监控链接","optional":true,"data":"这是默认的string"}}} \ No newline at end of file diff --git a/src/resolver.ts b/src/resolver.ts index f8eac1b..ed039d4 100644 --- a/src/resolver.ts +++ b/src/resolver.ts @@ -21,7 +21,9 @@ export interface Ischema { type?: string, optional?: boolean, comment?: string, - data?: any + data?: any, + length?: number, + generics?: string } export class Resolver { @@ -43,22 +45,34 @@ export class Resolver { keys.forEach(key => { this.schemaJson[key] = this.source[key].reduce((accu: {[propName: string]: Ischema}, current: Iline) => { const {name, comment, optional, type} = current - const {transformType, builtin, defaultValue} = this.getType(type || '') + const {transformType, builtin, defaultValue, length, generics} = this.getType(type || '') accu[name] = { type: transformType, comment, optional, } if (builtin) { - accu[name]['data'] = defaultValue + accu[name].data = defaultValue + } + if (transformType === 'array') { + accu[name].length = length + accu[name].generics = generics } return accu }, {}) }) } - getType (type: string): {transformType: string, builtin: boolean, defaultValue?: any} { - let result: {transformType:string, builtin: boolean, defaultValue?: any} = {transformType: type, builtin: false} + getType (type: string): {transformType: string, builtin: boolean, defaultValue?: any, length?: number, generics?: string} { + let result: {transformType:string, builtin: boolean, defaultValue?: any, length?: number, generics?: string} = {transformType: type, builtin: false} + if (arrReg.test(type)) { + return { + builtin: false, + transformType: 'array', + length: 1, + generics: this.resolveArray(type) + } + } switch (type) { case 'string': result.builtin = true @@ -81,6 +95,15 @@ export class Resolver { return result } + resolveArray (str: string): string { + let result: string = '' + str.replace(arrReg, (_, generics) => { + result = generics + return str + }) + return result + } + getSchemaJson (): {[propName: string]: Ischema} { return this.schemaJson } @@ -148,10 +171,6 @@ export class Receiver { return lineResult } - getResult(): Iresult { - return this.result - } - getSchemaJson (): {[propName: string]: Ischema} { const resolver = new Resolver(this.result) try { @@ -163,10 +182,6 @@ export class Receiver { return resolver.getSchemaJson() } - getParsedResult () { - return new Resolver(this.result) - } - static instance (): Receiver { return new Receiver() } diff --git a/src/tasks/generateData.ts b/src/tasks/generateData.ts index a1a0829..ea3e0bc 100644 --- a/src/tasks/generateData.ts +++ b/src/tasks/generateData.ts @@ -1,5 +1,8 @@ import { readJsonFile } from '../util' +const ENTRY = 'Result' +const DATA = 'data' + export function generateData (schemaPath: string) { return Promise.resolve() .then(() => readJsonFile(schemaPath))