Skip to content

Commit

Permalink
Merge branch 'dev' of github.com:kdvalin/MYR-backend-1 into keith-team
Browse files Browse the repository at this point in the history
  • Loading branch information
kdvalin committed Mar 11, 2021
2 parents 28c06bb + 27ff4da commit e7656a5
Show file tree
Hide file tree
Showing 30 changed files with 2,183 additions and 1,175 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ jobs: # a collection of steps
build: # runs not using Workflows must have a `build` job as entry point
working_directory: ~/mern-starter # directory where steps will run
docker: # run the steps with Docker
- image: circleci/node:10.9
- image: circleci/node:10.13
- image: mongo:3.6.7-stretch
steps: # a collection of executable commands
- checkout # special step to check out source code to working directory
- run:
name: install-mongo-cli
command: 'sudo apt-get install mongodb-clients'
command: 'sudo apt update && sudo apt-get install mongodb-clients'
- run:
name: mongo-test-db
command: 'mongorestore -d ecg-myr __tests__/mongo'
Expand Down
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2

updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "daily"
target-branch: "dev"
reviewers:
- "engaging-computing/myr-leadership-team"
2 changes: 1 addition & 1 deletion apiv1/controllers/CollectionController.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
let CollectSchema = require("../models/CollectionModel");
let SceneSchema = require("../models/SceneModel");
let { SceneSchema }= require("../models/SceneModel");
let {verifyGoogleToken, isAdmin} = require('../authorization/verifyAuth.js');
const ObjectId = require('mongoose').Types.ObjectId;

Expand Down
2 changes: 1 addition & 1 deletion apiv1/controllers/ImageController.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
let { verifyGoogleToken, isAdmin } = require("../authorization/verifyAuth");
let SceneSchema = require('../models/SceneModel');
let { SceneSchema } = require('../models/SceneModel');
let fs = require("fs");

const JPG = ["FFD8FFDB", "FFD8FFE0"];
Expand Down
2 changes: 1 addition & 1 deletion apiv1/controllers/SceneController.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
let { verifyGoogleToken, isAdmin } = require('../authorization/verifyAuth.js');
const { deleteImage, destFolder } = require('./ImageController');
let SceneSchema = require('../models/SceneModel');
let { SceneSchema } = require('../models/SceneModel');

const ObjectId = require('mongoose').Types.ObjectId;
const fs = require('fs');
Expand Down
4 changes: 3 additions & 1 deletion apiv1/models/CourseModel.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
let mongoose = require('mongoose');
let Schema = mongoose.Schema;
let { Settings } = require('./SceneModel')

let LessonSchema = new Schema({
'name': { type: String, required: true },
'prompt': String,
'code': { type: String, required: true }
'code': { type: String, required: true },
'settings': Settings,
}, {_id : false});

let CourseSchema = new Schema({
Expand Down
32 changes: 20 additions & 12 deletions apiv1/models/SceneModel.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,32 @@
let mongoose = require('mongoose');
let Schema = mongoose.Schema;

const Settings = {
'skyColor': String,
'showFloor': Boolean,
'floorColor': String,
'showCoordHelper': Boolean,
'camPositon': String,
'camConfig': Number,
'canFly': Boolean,
'viewOnly': Boolean,
'collectionID': String,
'defaultLight': Boolean,
'castShadow': Boolean,
'lightIndicator': Boolean
};

let SceneSchema = new Schema({
'name': String,
'uid': mongoose.Types.ObjectId | String,
'code': String,
'desc': String,
'settings': {
'skyColor': String,
'showFloor': Boolean,
'floorColor': String,
'showCoordHelper': Boolean,
'camPositon': String,
'camConfig': Number,
'canFly': Boolean,
'viewOnly': Boolean,
'collectionID': String
},
'settings': Settings,
'createTime': Date,
'updateTime': Date
});

module.exports = mongoose.model('Scene', SceneSchema);
module.exports = {
"SceneSchema": mongoose.model('Scene', SceneSchema),
"Settings": Settings
}
1 change: 1 addition & 0 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ app.use('/about/', express.static(path.join(__dirname, 'public/about')));
app.use('/img/', express.static(path.join(__dirname, 'public/img')));
app.use('/.well-known/', express.static(path.join(__dirname, 'public/.well-known')));
app.use(express.static(path.join(__dirname, 'public/myr')));
app.use('/docs/', express.static(path.join(__dirname, 'public/docs')));

//sets the relative paths for the routers
app.use('/apiv1/', apiv1);
Expand Down
Loading

0 comments on commit e7656a5

Please sign in to comment.