Skip to content

Commit b5ac5c5

Browse files
author
gondzo
committed
Merge branch 'dev'
2 parents 0a165ec + 432d215 commit b5ac5c5

File tree

5 files changed

+12
-5
lines changed

5 files changed

+12
-5
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
DRONE SERIES - WEBAPI IMPLEMENT PRODUCER API
22
---
33

4+
5+
46
# Setup
57
- node v7 https://nodejs.org/en/
68
- mongodb 3.2+ https://www.mongodb.com/
@@ -33,4 +35,4 @@ you also can export those values before run(data from forum).
3335
register and social login add role params
3436
default is `consumer` if role is empty
3537
#video
36-
https://youtu.be/rYBDekZ-hik
38+
https://youtu.be/rYBDekZ-hik

models/Drone.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ const Mixed = mongoose.Schema.Types.Mixed;
2020

2121
const DroneSchema = new mongoose.Schema({
2222
name: {type: String, required: true},
23+
description: { type: String, required: false },
2324
status: {type: String, enum: _.values(DroneStatus), required: true},
2425
// realtime coordinate of the drone
2526
currentLocation: {type: [Number]},
@@ -40,7 +41,6 @@ const DroneSchema = new mongoose.Schema({
4041
specificationImageUrl: String,
4142
specificationPDFUrl: String,
4243

43-
4444
minSpeed: Number,
4545
maxSpeed: Number,
4646
maxCargoWeight: Number,

services/DroneService.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ const droneCreateorUpdateEntityJoi = joi.object().keys({
4242
deviceId: joi.string(),
4343
serialNumber: joi.string().required(),
4444
name: joi.string().required(),
45+
description: joi.string(),
4546
type: joi.string().valid(_.values(DroneType)).required(),
4647
minSpeed: joi.number(),
4748
maxSpeed: joi.number(),
@@ -178,8 +179,8 @@ function * _getAll(providerId, entity) {
178179
const docs = yield Drone.find(criteria).sort(sortBy).skip(entity.offset || 0).limit(entity.limit || 1000);
179180
return {
180181
total: yield Drone.find(criteria).count(),
181-
items: _.map(docs, (d) => _.pick(d, 'id', 'imageUrl', 'status', 'thumbnailUrl', 'deviceId', 'serialNumber', 'name', 'type',
182-
'mileage', 'minSpeed', 'maxSpeed', 'maxFlightTime', 'maxCargoWeight', 'currentLocation')),
182+
items: _.map(docs, (d) => _.pick(d, 'id', 'imageUrl', 'status', 'thumbnailUrl', 'deviceId', 'serialNumber', 'name',
183+
'description', 'type', 'mileage', 'minSpeed', 'maxSpeed', 'maxFlightTime', 'maxCargoWeight', 'currentLocation')),
183184
};
184185
}
185186

services/NoFlyZoneService.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ function _assertExists(id, entity) {
4343
* @private
4444
*/
4545
function* _validateMission(values) {
46-
if (!values.mission) {
46+
if (values.mission) {
4747
yield MissionService.getSingle(values.mission);
4848
}
4949
if (values.isPermanent) {

swagger.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1917,6 +1917,8 @@ paths:
19171917
type: string
19181918
name:
19191919
type: string
1920+
description:
1921+
type: string
19201922
type:
19211923
type: string
19221924
mileage:
@@ -2772,6 +2774,8 @@ definitions:
27722774
type: string
27732775
name:
27742776
type: string
2777+
description:
2778+
type: string
27752779
type:
27762780
type: string
27772781
minSpeed:

0 commit comments

Comments
 (0)