95 lines
3.2 KiB
Plaintext
95 lines
3.2 KiB
Plaintext
syntax = "v1"
|
||||
|
|
|
|||
|
|
type (
|
|||
|
|
JobIdPath {
|
|||
|
|
JobId int `path:"jobId"`
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
UploadMeasurementReq {
|
|||
|
|
BottomHoleLeft *float64 `json:"bottomHoleLeft,optional" comment:"左侧底孔 B"`
|
|||
|
|
PistonHoleLarge *float64 `json:"pistonHoleLarge,optional" comment:"变量活塞孔大孔 D"`
|
|||
|
|
PistonHoleSmall *float64 `json:"pistonHoleSmall,optional" comment:"变量活塞孔小孔 E"`
|
|||
|
|
PistonHoleRight *float64 `json:"pistonHoleRight,optional" comment:"右侧变量活塞孔 M"`
|
|||
|
|
Unit string `json:"unit,optional" comment:"单位(约定 mm)"`
|
|||
|
|
Serial uint32 `json:"serial,optional" comment:"设备序列号"`
|
|||
|
|
Timestamp string `json:"timestamp,optional" comment:"测量时间,支持 RFC3339 或 yyyy-MM-dd HH:mm:ss,缺省为当前时间"`
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
UploadMeasurementReply {
|
|||
|
|
Id int `json:"id"`
|
|||
|
|
JobId int `json:"jobId"`
|
|||
|
|
WorkpieceNo string `json:"workpieceNo"`
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
MeasurementReply {
|
|||
|
|
Id int `json:"id"`
|
|||
|
|
JobId int `json:"jobId"`
|
|||
|
|
WorkpieceNo string `json:"workpieceNo"`
|
|||
|
|
WorkOrderNo string `json:"workOrderNo"`
|
|||
|
|
PalletCode string `json:"palletCode"`
|
|||
|
|
Category string `json:"category"`
|
|||
|
|
BottomHoleLeft *float64 `json:"bottomHoleLeft"`
|
|||
|
|
PistonHoleLarge *float64 `json:"pistonHoleLarge"`
|
|||
|
|
PistonHoleSmall *float64 `json:"pistonHoleSmall"`
|
|||
|
|
PistonHoleRight *float64 `json:"pistonHoleRight"`
|
|||
|
|
Timestamp string `json:"timestamp"`
|
|||
|
|
CreatedAt string `json:"createdAt"`
|
|||
|
|
UpdatedAt string `json:"updatedAt"`
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
QueryMeasurementsOfWorkOrderReq {
|
|||
|
|
Id int `path:"id"`
|
|||
|
|
Page int `form:"page,default=1,range=[1:]"`
|
|||
|
|
Limit int `form:"limit,default=20,range=[1:200]"`
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
QueryMeasurementsOfWorkOrderReply {
|
|||
|
|
Data []MeasurementReply `json:"data"`
|
|||
|
|
Total int `json:"total"`
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
QueryMeasurementsReq {
|
|||
|
|
Page int `form:"page,optional,default=1"`
|
|||
|
|
Limit int `form:"limit,optional,default=20"`
|
|||
|
|
StartDate string `form:"startDate,optional"` // YYYY-MM-DD
|
|||
|
|
EndDate string `form:"endDate,optional"` // YYYY-MM-DD
|
|||
|
|
WorkOrderNo string `form:"workOrderNo,optional"`
|
|||
|
|
PalletCode string `form:"palletCode,optional"`
|
|||
|
|
WorkpieceNo string `form:"workpieceNo,optional"`
|
|||
|
|
Category string `form:"category,optional"` // A6VM107 / A6VM160 / A6VM200
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
QueryMeasurementsReply {
|
|||
|
|
Data []MeasurementReply `json:"data"`
|
|||
|
|
Total int `json:"total"`
|
|||
|
|
}
|
|||
|
|
)
|
|||
|
|
|
|||
|
|
@server(
|
|||
|
|
group: measurement
|
|||
|
|
prefix: /api/v1
|
|||
|
|
)
|
|||
|
|
service hougai-api {
|
|||
|
|
@doc "上传抽检测量数据(外部测量软件调用,自动匹配抽检台当前工件,免鉴权)"
|
|||
|
|
@handler uploadMeasurement
|
|||
|
|
post /measurement/upload (UploadMeasurementReq) returns (UploadMeasurementReply)
|
|||
|
|
|
|||
|
|
@doc "查询抽检测量数据列表(报表用,跨工单)"
|
|||
|
|
@handler queryMeasurements
|
|||
|
|
get /measurement/list (QueryMeasurementsReq) returns (QueryMeasurementsReply)
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
@server(
|
|||
|
|
jwt: Auth
|
|||
|
|
group: measurement
|
|||
|
|
prefix: /api/v1
|
|||
|
|
)
|
|||
|
|
service hougai-api {
|
|||
|
|
@doc "查询工件测量数据"
|
|||
|
|
@handler getMeasurement
|
|||
|
|
get /measurement/jobs/:jobId (JobIdPath) returns (MeasurementReply)
|
|||
|
|
|
|||
|
|
@doc "查询工单测量数据列表"
|
|||
|
|
@handler queryMeasurementsOfWorkOrder
|
|||
|
|
get /measurement/work-orders/:id (QueryMeasurementsOfWorkOrderReq) returns (QueryMeasurementsOfWorkOrderReply)
|
|||
|
|
}
|