67 lines
1.6 KiB
JavaScript
67 lines
1.6 KiB
JavaScript
import mongoose from 'mongoose'
|
|
const { Schema } = mongoose
|
|
|
|
export const PlayerSchema = new Schema({
|
|
username: String, // 有符号 UUID
|
|
password: String,
|
|
email: String,
|
|
uuid: String,
|
|
textures: {
|
|
skin: String,
|
|
cape: String,
|
|
},
|
|
registerDate: Number,
|
|
permissions: [{ node: String, allowed: Boolean, duration: Number, startDate: Number, highPriority: Boolean }], // ban -> true
|
|
})
|
|
|
|
export const PlayerSeriliazationSchema = {
|
|
"type": "object",
|
|
"properties": {
|
|
"id": {
|
|
"type": "string"
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"properties": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"properties": {
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"value": {
|
|
"type": "string"
|
|
},
|
|
"signature": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
export const PlayerAccountSerializationSchema = {
|
|
"type": "object",
|
|
"properties": {
|
|
"id": {
|
|
"type": "string"
|
|
},
|
|
"properties": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"properties": {
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"value": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |