热更新:handler监听热更新
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
import { STATUS } from './../../../consts/statusCode';
|
||||
import { dispatch } from '../../../util/dispatcher';
|
||||
import { Application , BackendSession} from 'pinus';
|
||||
import { Application, BackendSession, HandlerService, } from 'pinus';
|
||||
import { resResult } from '../../../pubUtils/util';
|
||||
|
||||
export default function (app: Application) {
|
||||
new HandlerService(app, {});
|
||||
return new GateHandler(app);
|
||||
}
|
||||
|
||||
@@ -18,7 +19,7 @@ export class GateHandler {
|
||||
* @param {Object} session
|
||||
*
|
||||
*/
|
||||
async queryEntry(msg: {userCode: string}, session: BackendSession) {
|
||||
async queryEntry(msg: { userCode: string }, session: BackendSession) {
|
||||
let { userCode } = msg;
|
||||
if (!userCode) {
|
||||
return resResult(STATUS.WRONG_PARMS);
|
||||
@@ -31,6 +32,6 @@ export class GateHandler {
|
||||
}
|
||||
// select connector
|
||||
let res = dispatch(userCode, connectors);
|
||||
return resResult(STATUS.SUCCESS, {host: res.clientHost, port: res.clientPort});
|
||||
return resResult(STATUS.SUCCESS, { host: res.clientHost, port: res.clientPort });
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user