// Class for the custom service `users1` on path `/users-1`. (Can be re-generated.) /* tslint:disable no-unused-variable */ import { App } from '../../app.interface'; import { Id, NullableId, Paginated, Params, ServiceMethods, SetupMethod } from '@feathersjs/feathers'; // !code: imports // !end // !code: init // !end // ! code: interface // tslint:disable-next-line:no-empty-interface interface ServiceOptions {} // !end export class Service implements Partial>, SetupMethod { // ! code: properties public app!: App; // !end constructor (private options: ServiceOptions = {}) { // !code: constructor1 // !end } // ! code: setup public setup (app: App, path: string): void { this.app = app; } // !end // ! code: find public async find(params?: Params): Promise> { return []; } // !end // ! code: get public async get (id: Id, params?: Params): Promise { return { id, text: `A new message with ID: ${id}!` }; } // !end // ! code: create public async create (data: Partial | Array>, params?: Params): Promise { if (Array.isArray(data)) { return Promise.all(data.map(current => this.create(current, params))); } return data; } // !end // ! code: update public async update (id: NullableId, data: any, params?: Params): Promise { return data; } // !end // ! code: patch public async patch (id: NullableId, data: Partial, params?: Params): Promise { return data; } // !end // ! code: remove public async remove (id: NullableId, params?: Params): Promise { return { id }; } // !end // !code: more // !end } export default function (options: ServiceOptions) { return new Service(options); } // !code: funcs // !end // !code: end // !end