POS_node/models/Endpoint.js

68 lines
1.1 KiB
JavaScript
Raw Normal View History

2024-08-27 17:49:07 +08:00
import mongoose from "mongoose";
const EndpointSchema = mongoose.Schema(
{
endpoint: {
type: String,
// required: true,
},
name: {
2024-08-30 16:35:49 +08:00
type: String,
2024-08-27 17:49:07 +08:00
// required: true,
},
method: {
type: String,
// required: true,
},
collection_id: {
type: mongoose.Schema.Types.ObjectId,
ref: "Collection",
},
2024-08-30 16:35:49 +08:00
// created_by: {
// type: mongoose.Schema.Types.ObjectId,
// ref: "User",
// },
2024-08-27 17:49:07 +08:00
body_json: {
2024-08-30 16:35:49 +08:00
type: Array,
2024-08-27 17:49:07 +08:00
},
form_data: [
{
key: {
type: String,
},
value: {
type: String,
},
//required: true,
},
],
header: [
{
key: {
type: String,
},
value: {
type: String,
},
//required: true,
},
],
params: [
{
key: {
type: String,
},
value: {
type: String,
},
//required: true,
},
],
},
{ timestamps: true }
);
const Endpoint = mongoose.model("Endpoint", EndpointSchema);
export default Endpoint;