mirror of
https://github.com/cool-team-official/cool-admin-midway.git
synced 2024-11-01 22:20:30 +08:00
Update rpc.ts
fix: 按照midway规则解析service identifier name,解决MidwayDefinitionNotFoundError
This commit is contained in:
parent
803335fc5d
commit
5b0826aa78
@ -12,6 +12,7 @@ import {
|
||||
import { ServiceBroker } from 'moleculer';
|
||||
import { CoolRpcConfig } from '.';
|
||||
import { CoolCoreException, CoolValidateException } from '@cool-midway/core';
|
||||
import { camelCase } from '@midwayjs/core/dist/util/camelCase';
|
||||
import { v1 as uuid } from 'uuid';
|
||||
import { BaseRpcService } from './service/base';
|
||||
import { CurdOption, MOLECYLER_KEY } from './decorator/rpc';
|
||||
@ -155,7 +156,7 @@ export class CoolRpc {
|
||||
|
||||
const cls = await _this.app
|
||||
.getApplicationContext()
|
||||
.getAsync(_.lowerFirst(service));
|
||||
.getAsync(camelCase(service));
|
||||
const serviceInstance: BaseRpcService = new target();
|
||||
Object.assign(serviceInstance, cls);
|
||||
serviceInstance.setModel(_this.getModel(curdOption));
|
||||
|
Loading…
Reference in New Issue
Block a user