mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-06 11:30:13 +08:00
feat: design game file and parse it to mongo
* 取消用 README 來寫關卡說明
This commit is contained in:
1 parent
6204bd0b17
commit
0de4b6ac9d
4 files changed
+61
-20
No files matched your search
@@ -1,12 +1,42 @@
|
||||
import { model, Schema } from 'mongoose'
|
||||
|
||||
const stageSchema = new Schema({
|
||||
name: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
condition: {
|
||||
command: {
|
||||
type: [String],
|
||||
required: false,
|
||||
},
|
||||
output: {
|
||||
type: [String],
|
||||
required: false,
|
||||
},
|
||||
error: {
|
||||
type: [String],
|
||||
required: false,
|
||||
},
|
||||
},
|
||||
responses: {
|
||||
type: [String],
|
||||
required: true,
|
||||
},
|
||||
hint: {
|
||||
type: [String],
|
||||
required: true,
|
||||
},
|
||||
})
|
||||
|
||||
const Quest = model(
|
||||
'Quest',
|
||||
new Schema({
|
||||
_id: String,
|
||||
title: String,
|
||||
order: Number,
|
||||
content: String,
|
||||
introduction: String,
|
||||
stages: [stageSchema],
|
||||
})
|
||||
)
|
||||
|
||||
|
||||
Reference in new issue
Block a user