1 // Uncomment these imports to begin using these cool features!
3 // import {inject} from '@loopback/context';
17 } from '@loopback/rest';
18 import { inject } from '@loopback/core';
19 import { ResourceDictionaryService } from '../services';
21 export class DataDictionaryController {
23 @inject('services.ResourceDictionaryService')
24 public rdservice: ResourceDictionaryService,
27 @get('/resourcedictionary/{name}', {
30 content: { 'application/json': {} },
34 async getByName(@param.path.string('name') name: string) {
35 return await this.rdservice.getByName(name);
38 @get('/resourcedictionary/search/{tags}', {
41 content: { 'application/json': {} },
45 async getByTags(@param.path.string('tags') tags: string) {
46 return await this.rdservice.getByTags(tags);
49 @get('/resourcedictionary/source-mapping', {
52 content: { 'application/json': {} },
56 async getSourceMapping() {
57 return await this.rdservice.getSourceMapping();
60 @post('/resourcedictionary/save', {
63 content: { 'application/json': {} }
67 async save(@requestBody({
68 content: { 'application/json': { schema: { 'x-ts-type': JSON } } },
69 accepts: { 'application/json': { schema: { 'x-ts-type': JSON } } }
70 }) resourceDictionary: JSON): Promise<any> {
71 return await this.rdservice.save(resourceDictionary);
74 @post('/resourcedictionary/search/by-names', {
77 content: { 'application/json': {} }
81 async searchByNames(@requestBody({
82 content: { 'application/json': { schema: { 'x-ts-type': JSON } } },
83 accepts: { 'application/json': { schema: { 'x-ts-type': JSON } } }
84 }) resourceDictionaryList: JSON): Promise<any> {
85 return await this.rdservice.searchbyNames(resourceDictionaryList);
88 @get('/resourcedictionary/model-type/{source}', {
91 content: { 'application/json': {} },
95 async getmodelType(@param.path.string('source') source: string) {
96 return await this.rdservice.getModelType(source);
100 * @deprecated use getResourceDictionaryByType Instead.
102 @get('/resourcedictionary/model-type/by-definition/data_type', {
105 content: { 'application/json': {} },
109 async getDataTypes() {
110 console.warn("Calling deprecated function!");
111 return await this.rdservice.getDataTypes();
114 @get('/resourcedictionary/model-type/by-definition/{type}', {
117 content: {'application/json': {}},
121 async getResourceDictionaryByType(@param.path.string('type') type: string) {
122 return await this.rdservice.getResourceDictionaryByType(type);