--- /dev/null
+// Uncomment these imports to begin using these cool features!
+
+// import {inject} from '@loopback/context';
+import {
+ post,
+ param,
+ get,
+ getFilterSchemaFor,
+ getWhereSchemaFor,
+ patch,
+ put,
+ del,
+ requestBody,
+ Request,
+ Response,
+ RestBindings,
+} from '@loopback/rest';
+import { inject } from '@loopback/core';
+import { ControllerCatalogService } from '../services';
+
+export class ControllerCatalogController {
+ constructor(
+ @inject('services.ControllerCatalogService')
+ public Ccservice: ControllerCatalogService,
+ ){ }
+
+ @get('/controllercatalog/search/{tags}', {
+ responses: {
+ '200': {
+ content: { 'application/json': {} },
+ },
+ },
+ })
+ async getByTags(@param.path.string('tags') tags: string) {
+ return await this.Ccservice.getByTags(tags);
+ }
+
+ @post('/controllercatalog/save', {
+ responses: {
+ '200': {
+ content: { 'application/json': {} }
+ }
+ },
+ })
+ async save(@requestBody({
+ content: { 'application/json': { schema: { 'x-ts-type': JSON } } },
+ accepts: { 'application/json': { schema: { 'x-ts-type': JSON } } }
+ }) controllerCatalog: JSON): Promise<any> {
+ return await this.Ccservice.save(controllerCatalog);
+ }
+
+ @get('/controllercatalog/model-type/by-definition/{definitionType}', {
+ responses: {
+ '200': {
+ content: { 'application/json': {} },
+ },
+ },
+ })
+ async getDataTypes(@param.path.string('definitionType') definitionType: string) {
+ return await this.Ccservice.getDefinitionTypes(definitionType);
+ }
+
+ @del('/controllercatalog/model-type/{name}', {
+ responses: {
+ '200': {
+ content: { 'application/json': {} }
+ }
+ },
+ })
+ async delete(@param.path.string('name') name: string): Promise<JSON> {
+ return await this.Ccservice.deleteCatalog(name);
+ }
+}
export * from './ping.controller';
export * from './blueprint-rest.controller';
export * from './data-dictionary.controller';
+export * from './controller-catalog.controller';
--- /dev/null
+import {processorApiConfig} from '../config/app-config';\r
+\r
+export default {\r
+ "name": "controllerCatalog",\r
+ "connector": "rest",\r
+ "baseURL": processorApiConfig.http.url + "/model-type",\r
+ "crud": false,\r
+ "debug": true,\r
+ "operations": [\r
+\r
+ {\r
+ "template": {\r
+ "method": "GET",\r
+ "url": processorApiConfig.http.url + "/model-type/search/{tags}",\r
+ "headers": {\r
+ "accepts": "application/json",\r
+ "content-type": "application/json",\r
+ "authorization": processorApiConfig.http.authToken\r
+ },\r
+ "responsePath": "$.*"\r
+ },\r
+ "functions": {\r
+ "getByTags": ["tags"]\r
+\r
+ }\r
+ },\r
+ {\r
+ "template": {\r
+ "method": "POST",\r
+ "url": processorApiConfig.http.url + "/model-type",\r
+ "headers": {\r
+ "accepts": "application/json",\r
+ "content-type": "application/json",\r
+ "authorization": processorApiConfig.http.authToken\r
+ },\r
+ "body": "{controllerCatalog}",\r
+ "responsePath": "$.*"\r
+ },\r
+ "functions": {\r
+ "save": ["controllerCatalog"]\r
+\r
+ }\r
+ },\r
+ {\r
+ "template": {\r
+ "method": "GET",\r
+ "url": processorApiConfig.http.url + "/model-type/by-definition/{definitionType}",\r
+ "headers": {\r
+ "accepts": "application/json",\r
+ "content-type": "application/json",\r
+ "authorization": processorApiConfig.http.authToken\r
+ },\r
+ "responsePath": "$.*"\r
+ },\r
+ "functions": {\r
+ "getDefinitionTypes": ["definitionType"]\r
+\r
+ }\r
+ },\r
+ {\r
+ "template": {\r
+ "method": "DEL",\r
+ "url": processorApiConfig.http.url + "/model-type/{name}",\r
+ "headers": {\r
+ "accepts": "application/json",\r
+ "content-type": "application/json",\r
+ "authorization": processorApiConfig.http.authToken\r
+ },\r
+ "responsePath": "$.*"\r
+ },\r
+ "functions": {\r
+ "delete": ["name"]\r
+ }\r
+ }\r
+ ]\r
+};
\ No newline at end of file
--- /dev/null
+import {inject} from '@loopback/core';\r
+import {juggler} from '@loopback/repository';\r
+import config from './controller-catalog.datasource-template';\r
+\r
+export class ControllerCatalogDataSource extends juggler.DataSource {\r
+ static dataSourceName = 'controllerCatalog';\r
+\r
+ constructor(\r
+ @inject('datasources.config.controllerCatalog', {optional: true})\r
+ dsConfig: object = config,\r
+ ) {\r
+ super(dsConfig);\r
+ }\r
+}\r
export * from './db.datasource';
export * from './blueprint.datasource';
export * from './resource-dictionary.datasource';
+export * from './controller-catalog.datasource';
--- /dev/null
+import {getService} from '@loopback/service-proxy';\r
+import {inject, Provider} from '@loopback/core';\r
+import {ControllerCatalogDataSource} from '../datasources';\r
+\r
+export interface ControllerCatalogService {\r
+ getByTags(tags: string): Promise<JSON>;\r
+ save(controllerCatalog: JSON): Promise<JSON>;\r
+ getDefinitionTypes(definitionType: string): Promise<JSON>;\r
+ deleteCatalog(name: string): Promise<JSON>;\r
+}\r
+\r
+export class ControllerCatalogServiceProvider implements Provider<ControllerCatalogService> {\r
+ constructor(\r
+ // controllerCatalog must match the name property in the datasource json file\r
+ @inject('datasources.controllerCatalog')\r
+ protected dataSource: ControllerCatalogDataSource = new ControllerCatalogDataSource(),\r
+ ) {}\r
+\r
+ value(): Promise<ControllerCatalogService> {\r
+ return getService(this.dataSource);\r
+ }\r
+}\r
export * from './blueprint.service';
export * from './resource-dictionary.service';
+export * from './controller-catalog.service';