rebuilt sample

This commit is contained in:
Tony Tam
2016-04-05 07:08:46 -07:00
parent 03adae8e36
commit be5eae6583
8 changed files with 368 additions and 428 deletions

View File

@@ -1,18 +1,27 @@
'use strict';
exports.deleteOrder = function(args, res, next) {
/**
* parameters expected in the args:
* orderId (Long)
**/
// no response value expected for this operation
res.end();
}
exports.getInventory = function(args, res, next) {
/**
* parameters expected in the args:
**/
var examples = {};
**/
var examples = {};
examples['application/json'] = {
"key" : 123
};
if(Object.keys(examples).length > 0) {
res.setHeader('Content-Type', 'application/json');
res.end(JSON.stringify(examples[Object.keys(examples)[0]] || {}, null, 2));
@@ -23,54 +32,24 @@ var examples = {};
}
exports.placeOrder = function(args, res, next) {
/**
* parameters expected in the args:
* body (Order)
**/
var examples = {};
examples['application/json'] = {
"id" : 123456789,
"petId" : 123456789,
"complete" : true,
"status" : "aeiou",
"quantity" : 123,
"shipDate" : "2016-01-24T14:07:57.768+0000"
};
if(Object.keys(examples).length > 0) {
res.setHeader('Content-Type', 'application/json');
res.end(JSON.stringify(examples[Object.keys(examples)[0]] || {}, null, 2));
}
else {
res.end();
}
}
exports.getOrderById = function(args, res, next) {
/**
* parameters expected in the args:
* orderId (String)
**/
var examples = {};
* orderId (Long)
**/
var examples = {};
examples['application/json'] = {
"id" : 123456789,
"petId" : 123456789,
"complete" : true,
"status" : "aeiou",
"quantity" : 123,
"shipDate" : "2016-01-24T14:07:57.780+0000"
"shipDate" : "2000-01-23T04:56:07.000+0000"
};
if(Object.keys(examples).length > 0) {
res.setHeader('Content-Type', 'application/json');
res.end(JSON.stringify(examples[Object.keys(examples)[0]] || {}, null, 2));
@@ -81,15 +60,32 @@ var examples = {};
}
exports.deleteOrder = function(args, res, next) {
exports.placeOrder = function(args, res, next) {
/**
* parameters expected in the args:
* orderId (String)
**/
var examples = {};
* body (Order)
**/
var examples = {};
examples['application/json'] = {
"id" : 123456789,
"petId" : 123456789,
"complete" : true,
"status" : "aeiou",
"quantity" : 123,
"shipDate" : "2000-01-23T04:56:07.000+0000"
};
if(Object.keys(examples).length > 0) {
res.setHeader('Content-Type', 'application/json');
res.end(JSON.stringify(examples[Object.keys(examples)[0]] || {}, null, 2));
}
else {
res.end();
}
res.end();
}