-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4061177
commit 43d89bd
Showing
10 changed files
with
206 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,142 @@ | ||
Result«WorkOrderView» { | ||
success (boolean, optional), | ||
data (WorkOrderView, optional), | ||
msg (string, optional), | ||
code (string, optional), | ||
traceId (string, optional) | ||
} | ||
WorkOrderView { | ||
id (string, optional): 工单信息: 工单id, | ||
cityCode (string, optional): 工单信息: 城市code, | ||
cityName (string, optional): 工单信息: 城市名称, | ||
province (string, optional): 工单信息: 省份名称, | ||
type (string, optional): 工单信息: 工单类型, | ||
number (string, optional): 工单信息: 工单编号, | ||
dateCreate (string, optional): 工单信息: 创建时间, | ||
dateUpdate (string, optional): 工单信息: 最后更新时间, | ||
transactor (string, optional): 工单信息: 处理人id, | ||
transactorName (string, optional): 工单信息: 处理人name, | ||
status (integer, optional): 工单信息: 工单状态 0:待处理 1:处理中 2:已解决, | ||
description (string, optional): 工单信息: 问题描述, | ||
creatorId (string, optional): 工单信息: 创建人id, | ||
creatorName (string, optional): 工单信息: 创建人名称, | ||
source (string, optional): 工单信息: 工单来源, | ||
newlyReply (string, optional): 工单信息: 最近回复, | ||
customerName (string, optional): 工单信息:客户姓名, | ||
orderType (string, optional): 订单信息: 订单类型, | ||
modelName (string, optional): 订单信息: 车型, | ||
orderNo (string, optional): 订单信息: 订单编号, | ||
orderStatus (string, optional): 订单信息: 订单状态, | ||
vin (string, optional): 订单信息: vin码, | ||
overTimeDay (integer, optional): 订单信息: 超时天数, | ||
saleDealerCode (string, optional): 订单信息: 销售车商code, | ||
saleDealerName (string, optional): 订单信息: 销售车商名称, | ||
downPaymentDate (string, optional): 订单信息: 首付支付日期, | ||
returnCarDate (string, optional): 订单信息: 应交车日期, | ||
leaseOrderDetail (string, optional): 订单信息: 订单详情链接, | ||
leaseOrderMonitor (string, optional): 订单信息: 订单监控链接, | ||
phone (string, optional): 工单信息: 手机号, | ||
carType (string, optional): 订单信息: 车型, | ||
belong (integer, optional): 问题归属, | ||
belongString (string, optional): 问题归属字符串, | ||
orderTypeString (string, optional): 订单类型字符串, | ||
typeString (string, optional): 工单类型字符串, | ||
orderStatusString (string, optional): 订单状态中文, | ||
allowSend2SF (boolean, optional): 是否允许转交SF, | ||
feedbackDos (array[FeedbackDo], optional): 回复记录列表(工单反馈列表), | ||
otherFeedbacks (array[FeedbackDo], optional), | ||
workOrders (array[WorkOrderDo], optional): 订单相关的工单列表, | ||
statusString (string, optional), | ||
sourceString (string, optional) | ||
} | ||
FeedbackDo { | ||
id (string, optional), | ||
dateCreate (string, optional), | ||
dateUpdate (string, optional), | ||
dateDelete (string, optional), | ||
userCode (string, optional): 人员code, | ||
userName (string, optional): 人员名字, | ||
type (string, optional): 对应工单类型, | ||
number (string): 工单code, | ||
orderCode (string, optional): 订单code, | ||
question (string, optional): 问题分类, | ||
feedback (string): 工单反馈, | ||
picture (string, optional): 图片, | ||
memo (string, optional): 备注, | ||
source (string, optional): 反馈来源, | ||
portrait (string, optional): 头像, | ||
expectFinishTime (string, optional): 预计完成时间, | ||
count (integer, optional): 统计值, | ||
inc (integer): 0-公开,1-内部, | ||
action (integer, optional): 0-回复,1-创建,2-认领,3-内部备注,4-转交,5-关闭, | ||
file (string, optional): 文件地址, | ||
fileName (string, optional): 文件名称, | ||
pictures (array[string], optional) | ||
} | ||
WorkOrderDo { | ||
id (string, optional), | ||
dateCreate (string, optional), | ||
dateUpdate (string, optional), | ||
dateDelete (string, optional), | ||
cityCode (string, optional): 城市code, | ||
overTime (string, optional): 超时日期, | ||
type (string, optional): 工单类型, | ||
orderType (string, optional): 订单类型, | ||
feedback (integer, optional): 0未反馈,1已反馈, | ||
extra (string, optional): 扩展字段, | ||
number (string, optional): 工单编号, | ||
vin (string, optional): vin码, | ||
shopCode (string, optional): 店铺code, | ||
shopName (string, optional): 店铺名称, | ||
cityName (string, optional): 城市名称, | ||
overTimeDay (integer, optional): 超时天数, | ||
dateFinish (string, optional): 结束时间, | ||
orderNo (string, optional): 订单编号, | ||
transactor (string, optional): 处理人, | ||
transactorName (string, optional): 处理人name, | ||
status (integer, optional): 工单状态 0:待处理(如果处理人为空则为待认领) 1:处理中 2:已解决 3:处理中(SF), | ||
source (string, optional): 工单来源, | ||
description (string, optional): 问题描述, | ||
creatorId (string, optional): 创建人id, | ||
creatorName (string, optional): 创建人名称, | ||
questionType (string, optional): 问题分类, | ||
pic (string, optional): 上传图片, | ||
orderTypeString (string, optional): 订单类型, | ||
typeString (string, optional): 工单类型, | ||
orderExtra (string, optional): 订单额外字段类型, | ||
carExtra (string, optional): 车辆类型, | ||
dealerExtra (string, optional): 车商类型, | ||
dateLastReply (string, optional): 最后回复日期, | ||
portrait (string, optional): 头像<来源弹B>, | ||
phone (string, optional): 手机, | ||
customerName (string, optional): 客户姓名, | ||
lastReply (string, optional): 最后回复内容, | ||
appReplyNumber (integer, optional): 客户端回复次数, | ||
webReplyNumber (integer, optional): web端回复次数, | ||
belong (integer, optional): 问题归属, | ||
belongString (string, optional): 问题归属文字, | ||
firstReplyDate (string, optional): 最初回复日期, | ||
send2SFDate (string, optional): 最初回复日期, | ||
allowSend2SF (boolean, optional): 是否允许转交SF, | ||
feedbacks (array[FeedbackDo], optional): 回复列表, | ||
leaseConsiceOrderView (LeaseConsiceOrderView, optional): 订单信息, | ||
file (string, optional): 文件地址, | ||
provinceCode (string, optional): 省份code, | ||
statusString (string, optional), | ||
sourceString (string, optional) | ||
} | ||
LeaseConsiceOrderView { | ||
orderNo (string, optional): 订单编号, | ||
orderType (string, optional): 订单类型, | ||
orderStatus (string, optional): 订单状态, | ||
orderStatusString (string, optional): 订单状态中文, | ||
name (string, optional): 用户姓名, | ||
mobile (string, optional): 用户手机号, | ||
modelName (string, optional): 车型, | ||
vin (string, optional): VIN码, | ||
saleDealerName (string, optional): 销售车商名称, | ||
downPaymentDate (string, optional): 首付支付日期, | ||
returnCarDate (string, optional): 应交车日期, | ||
leaseOrderDetail (string, optional): 订单详情链接, | ||
leaseOrderMonitor (string, optional): 订单监控链接 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,36 @@ | ||
import * as fs from 'fs' | ||
import * as path from 'path' | ||
import {optionTuple} from '../index' | ||
import { mkdir, readdir } from '../util/fsUtil' | ||
|
||
const SWAGGER_PATH = './swagger' | ||
const SCHEMA_PATH = './schema' | ||
|
||
export function loadDir([option]: optionTuple): Promise<optionTuple> { | ||
|
||
export function loadDir([option]: optionTuple<undefined>): Promise<optionTuple<[string[], string[]]>> { | ||
const { baseOption } = option | ||
const { mockPath } = baseOption! | ||
const mockRealPath = path.join(process.cwd(), mockPath!) | ||
const swaggerDirPath = path.resolve(mockRealPath, SWAGGER_PATH) | ||
const schemaDirPath = path.resolve(mockRealPath, SCHEMA_PATH) | ||
return Promise.resolve() | ||
.then(() => { | ||
fs.mkdirSync(path.join(process.cwd(), mockPath!)) | ||
// 尝试去创建一下目录 | ||
const mkSwaggerDirPromise = mkdir(swaggerDirPath) | ||
const mkSchemaDirPromise = mkdir(schemaDirPath) | ||
return Promise.all([mkSwaggerDirPromise, mkSchemaDirPromise]) | ||
}) | ||
.then(() => { | ||
return [option, undefined] | ||
// 不管这个文件夹到底有没有创建成功,直接去看里面有没有内容 | ||
const swaggerFilePromise = readdir(swaggerDirPath) | ||
const schemaFilePromise = readdir(schemaDirPath) | ||
return Promise.all([swaggerFilePromise, schemaFilePromise]) | ||
}) | ||
.then(([swaggerFiles, schemaFiles]) => { | ||
if (!schemaFiles.length && !swaggerFiles.length) { | ||
// 两个文件都没有 | ||
throw new Error(`${schemaDirPath}目录下没有schema文件,并且${swaggerDirPath}目录下也没有 swagger 文件,尝试在${swaggerDirPath}目录下添加swagger文件之后重试`) | ||
} else { | ||
return [option, [swaggerFiles, schemaFiles]] | ||
} | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters