OSDN Git Service

Change endpoint from /api/optionControlFile/:command to v0.3.0p0042
authorhimetani_cafe <fumifumi@yasunaga-lab.bio.kyutech.ac.jp>
Mon, 8 Feb 2016 07:34:47 +0000 (16:34 +0900)
committerhimetani_cafe <fumifumi@yasunaga-lab.bio.kyutech.ac.jp>
Mon, 8 Feb 2016 07:34:47 +0000 (16:34 +0900)
/api/v1/optionControlFile/:command

front-end/app/scripts/controllers/Execution.ts
front-end/app/scripts/services/APIEndPoint.ts
front-end/dist/bundle.js
server/api/v1/optionControlFile/index.js [new file with mode: 0644]
server/routes.js

index 9f8a37e..e9d866a 100644 (file)
@@ -16,7 +16,7 @@ namespace app.controllers {
             this.$scope.$broadcast('close');
             
             // add <command> directive
-            this.MyModal.selectCommand();
+            //this.MyModal.selectCommand();
             this.commandInfoList.push(new declares.CommandInfo('mrcImageNoiseAdd'));
         }
 
index 7b3cc16..27b546e 100644 (file)
@@ -28,7 +28,7 @@ namespace app.services {
         }
 
         public getOptionControlFile(command: string): ng.resource.IResource<declares.IResponse> {
-            var endPoint = '/api/optionControlFile/' + command;
+            var endPoint = '/api/v1/optionControlFile/' + command;
             return <declares.IResponseOption>this.resource(endPoint, {}).get();
         }
 
index 8e7e8c4..a897fd6 100644 (file)
                        return this.$resource(endPoint, {}, { execute: execute });
                    };
                    APIEndPoint.prototype.getOptionControlFile = function (command) {
-                       var endPoint = '/api/optionControlFile/' + command;
+                       var endPoint = '/api/v1/optionControlFile/' + command;
                        return this.resource(endPoint, {}).get();
                    };
                    APIEndPoint.prototype.getFiles = function (fileId) {
                    ;
                    Execution.prototype.add = function () {
                        this.$scope.$broadcast('close');
-                       this.MyModal.selectCommand();
                        this.commandInfoList.push(new app.declares.CommandInfo('mrcImageNoiseAdd'));
                    };
                    Execution.prototype.open = function () {
                        return this.$resource(endPoint, {}, { execute: execute });
                    };
                    APIEndPoint.prototype.getOptionControlFile = function (command) {
-                       var endPoint = '/api/optionControlFile/' + command;
+                       var endPoint = '/api/v1/optionControlFile/' + command;
                        return this.resource(endPoint, {}).get();
                    };
                    APIEndPoint.prototype.getFiles = function (fileId) {
                    ;
                    Execution.prototype.add = function () {
                        this.$scope.$broadcast('close');
-                       this.MyModal.selectCommand();
                        this.commandInfoList.push(new app.declares.CommandInfo('mrcImageNoiseAdd'));
                    };
                    Execution.prototype.open = function () {
                        return this.$resource(endPoint, {}, { execute: execute });
                    };
                    APIEndPoint.prototype.getOptionControlFile = function (command) {
-                       var endPoint = '/api/optionControlFile/' + command;
+                       var endPoint = '/api/v1/optionControlFile/' + command;
                        return this.resource(endPoint, {}).get();
                    };
                    APIEndPoint.prototype.getFiles = function (fileId) {
                    ;
                    Execution.prototype.add = function () {
                        this.$scope.$broadcast('close');
-                       this.MyModal.selectCommand();
                        this.commandInfoList.push(new app.declares.CommandInfo('mrcImageNoiseAdd'));
                    };
                    Execution.prototype.open = function () {
                        return this.$resource(endPoint, {}, { execute: execute });
                    };
                    APIEndPoint.prototype.getOptionControlFile = function (command) {
-                       var endPoint = '/api/optionControlFile/' + command;
+                       var endPoint = '/api/v1/optionControlFile/' + command;
                        return this.resource(endPoint, {}).get();
                    };
                    APIEndPoint.prototype.getFiles = function (fileId) {
                    ;
                    Execution.prototype.add = function () {
                        this.$scope.$broadcast('close');
-                       this.MyModal.selectCommand();
                        this.commandInfoList.push(new app.declares.CommandInfo('mrcImageNoiseAdd'));
                    };
                    Execution.prototype.open = function () {
                        return this.$resource(endPoint, {}, { execute: execute });
                    };
                    APIEndPoint.prototype.getOptionControlFile = function (command) {
-                       var endPoint = '/api/optionControlFile/' + command;
+                       var endPoint = '/api/v1/optionControlFile/' + command;
                        return this.resource(endPoint, {}).get();
                    };
                    APIEndPoint.prototype.getFiles = function (fileId) {
                    ;
                    Execution.prototype.add = function () {
                        this.$scope.$broadcast('close');
-                       this.MyModal.selectCommand();
                        this.commandInfoList.push(new app.declares.CommandInfo('mrcImageNoiseAdd'));
                    };
                    Execution.prototype.open = function () {
                        return this.$resource(endPoint, {}, { execute: execute });
                    };
                    APIEndPoint.prototype.getOptionControlFile = function (command) {
-                       var endPoint = '/api/optionControlFile/' + command;
+                       var endPoint = '/api/v1/optionControlFile/' + command;
                        return this.resource(endPoint, {}).get();
                    };
                    APIEndPoint.prototype.getFiles = function (fileId) {
                    ;
                    Execution.prototype.add = function () {
                        this.$scope.$broadcast('close');
-                       this.MyModal.selectCommand();
                        this.commandInfoList.push(new app.declares.CommandInfo('mrcImageNoiseAdd'));
                    };
                    Execution.prototype.open = function () {
                        return this.$resource(endPoint, {}, { execute: execute });
                    };
                    APIEndPoint.prototype.getOptionControlFile = function (command) {
-                       var endPoint = '/api/optionControlFile/' + command;
+                       var endPoint = '/api/v1/optionControlFile/' + command;
                        return this.resource(endPoint, {}).get();
                    };
                    APIEndPoint.prototype.getFiles = function (fileId) {
                    ;
                    Execution.prototype.add = function () {
                        this.$scope.$broadcast('close');
-                       this.MyModal.selectCommand();
                        this.commandInfoList.push(new app.declares.CommandInfo('mrcImageNoiseAdd'));
                    };
                    Execution.prototype.open = function () {
                        return this.$resource(endPoint, {}, { execute: execute });
                    };
                    APIEndPoint.prototype.getOptionControlFile = function (command) {
-                       var endPoint = '/api/optionControlFile/' + command;
+                       var endPoint = '/api/v1/optionControlFile/' + command;
                        return this.resource(endPoint, {}).get();
                    };
                    APIEndPoint.prototype.getFiles = function (fileId) {
                    ;
                    Execution.prototype.add = function () {
                        this.$scope.$broadcast('close');
-                       this.MyModal.selectCommand();
                        this.commandInfoList.push(new app.declares.CommandInfo('mrcImageNoiseAdd'));
                    };
                    Execution.prototype.open = function () {
                        return this.$resource(endPoint, {}, { execute: execute });
                    };
                    APIEndPoint.prototype.getOptionControlFile = function (command) {
-                       var endPoint = '/api/optionControlFile/' + command;
+                       var endPoint = '/api/v1/optionControlFile/' + command;
                        return this.resource(endPoint, {}).get();
                    };
                    APIEndPoint.prototype.getFiles = function (fileId) {
                    ;
                    Execution.prototype.add = function () {
                        this.$scope.$broadcast('close');
-                       this.MyModal.selectCommand();
                        this.commandInfoList.push(new app.declares.CommandInfo('mrcImageNoiseAdd'));
                    };
                    Execution.prototype.open = function () {
                        return this.$resource(endPoint, {}, { execute: execute });
                    };
                    APIEndPoint.prototype.getOptionControlFile = function (command) {
-                       var endPoint = '/api/optionControlFile/' + command;
+                       var endPoint = '/api/v1/optionControlFile/' + command;
                        return this.resource(endPoint, {}).get();
                    };
                    APIEndPoint.prototype.getFiles = function (fileId) {
                    ;
                    Execution.prototype.add = function () {
                        this.$scope.$broadcast('close');
-                       this.MyModal.selectCommand();
                        this.commandInfoList.push(new app.declares.CommandInfo('mrcImageNoiseAdd'));
                    };
                    Execution.prototype.open = function () {
                        return this.$resource(endPoint, {}, { execute: execute });
                    };
                    APIEndPoint.prototype.getOptionControlFile = function (command) {
-                       var endPoint = '/api/optionControlFile/' + command;
+                       var endPoint = '/api/v1/optionControlFile/' + command;
                        return this.resource(endPoint, {}).get();
                    };
                    APIEndPoint.prototype.getFiles = function (fileId) {
                    ;
                    Execution.prototype.add = function () {
                        this.$scope.$broadcast('close');
-                       this.MyModal.selectCommand();
                        this.commandInfoList.push(new app.declares.CommandInfo('mrcImageNoiseAdd'));
                    };
                    Execution.prototype.open = function () {
                        return this.$resource(endPoint, {}, { execute: execute });
                    };
                    APIEndPoint.prototype.getOptionControlFile = function (command) {
-                       var endPoint = '/api/optionControlFile/' + command;
+                       var endPoint = '/api/v1/optionControlFile/' + command;
                        return this.resource(endPoint, {}).get();
                    };
                    APIEndPoint.prototype.getFiles = function (fileId) {
                    ;
                    Execution.prototype.add = function () {
                        this.$scope.$broadcast('close');
-                       this.MyModal.selectCommand();
                        this.commandInfoList.push(new app.declares.CommandInfo('mrcImageNoiseAdd'));
                    };
                    Execution.prototype.open = function () {
diff --git a/server/api/v1/optionControlFile/index.js b/server/api/v1/optionControlFile/index.js
new file mode 100644 (file)
index 0000000..39ae2f7
--- /dev/null
@@ -0,0 +1,15 @@
+'use strict';
+
+var express = require('express');
+var router  = express.Router();
+
+router.get('/:commandName', function(req, res) {
+   var optionJSON = require(__dirname + '/../../../../user-specific-files/OptionControlFile/commands/' + req.params.commandName);
+   var info = {
+       status: 'success',
+       info: optionJSON
+   };
+   res.send(info);
+});
+
+module.exports = router;
index d40a915..a8d8917 100644 (file)
@@ -6,7 +6,7 @@ var config = require('./config');
 module.exports = function(app) {
 
     // Routing
-    app.use('/api/optionControlFile', require('./api/optionControlFile'))
+    //app.use('/api/optionControlFile', require('./api/optionControlFile'))
     /*
     app.use('/api/commandList', require('./api/commandList'))
     app.use('/api/tagList', require('./api/tagList'))
@@ -21,6 +21,7 @@ module.exports = function(app) {
     app.use('/api/v1/execution', require(__dirname + '/api/v1/execution'));
     app.use('/api/v1/workspace/', require(__dirname + '/api/v1/workspace'));
     app.use('/api/v1/all/workspace/directory', require(__dirname + '/api/v1/all/workspace/directory'));
+    app.use('/api/v1/optionControlFile', require(__dirname + '/api/v1/optionControlFile'));
 
     app.route('/*')
     .get(function(req, res) {