import { Injectable , HttpService } from '@nestjs/common' ; import _ from 'lodash' ; import { json2ts } from 'json-ts' ; import { JsonEntity } from '../controller/entities/json.entity' ; @ Injectable ( ) export class ToolsService { constructor ( private readonly httpService ) { } async getJsonToTs ( data ) { return json2ts ( data ) ; } async addJson ( mod , name , content ) { return JsonEntity . addJson ( mod , name , content ) ; } async updateJson ( id , content ) { return JsonEntity . updateJson ( id , content ) ; } async deleteJson ( id ) { return JsonEntity . deleteJson ( id ) ; } async getJson ( id ) { return JsonEntity . getJson ( id ) ; } async getJsonList ( page , size ) { return JsonEntity . getJsonList ( page , size ) ; } }