feat: connect to database
This commit is contained in:
24
src/models/sample.js
Normal file
24
src/models/sample.js
Normal file
@@ -0,0 +1,24 @@
|
||||
import { Schema, model } from 'mongoose'
|
||||
|
||||
const sampleSchema = new Schema({
|
||||
// L414-5KR-7-240703
|
||||
|
||||
// 产品名 L414-5KR
|
||||
productName: { type: String },
|
||||
|
||||
// 批次号字符串 L414-5KR-7-240703
|
||||
batchString: { type: String },
|
||||
|
||||
// 样品 ID 01
|
||||
id: { type: String },
|
||||
|
||||
// 送样时间
|
||||
postTime: { type: Date, default: Date.now },
|
||||
|
||||
// 测试项目
|
||||
testItem: { type: Array, default: [] },
|
||||
|
||||
status: { type: Schema.Types.ObjectId, ref: 'Status' }
|
||||
})
|
||||
|
||||
export default model('Sample', sampleSchema)
|
||||
Reference in New Issue
Block a user