feat: connect to database

This commit is contained in:
2024-10-02 22:24:10 +08:00
parent ad0a91150e
commit d3a40a04ab
11 changed files with 199 additions and 45 deletions

24
src/models/sample.js Normal file
View 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)