zahmis 5 лет назад
Родитель
Сommit
b8e331c707

+ 16 - 0
packages/slack/src/services/index.ts

@@ -0,0 +1,16 @@
+import { parse } from '../utils/slash-command-parser';
+
+
+export class IndexService {
+
+  // constructor(crowi) {
+  //   this.crowi = crowi;
+  // }
+  receiveBody(parseBody) {
+    const body = parse(parseBody);
+
+    console.log(body);
+  }
+
+
+}

+ 3 - 5
packages/slackbot-proxy/src/controllers/slack.ts

@@ -6,9 +6,7 @@ import { InstallationRepository } from '~/repositories/installation';
 
 import { InstallerService } from '~/services/InstallerService';
 
-// import { supportedSlackCommands } from '../../../slack/src/index';
-import { parse } from '../../../slack/src/utils/slash-command-parser';
-
+import { IndexService } from '../../../slack/src/services/index';
 @Controller('/slack')
 export class SlackCtrl {
 
@@ -62,8 +60,8 @@ export class SlackCtrl {
     // See https://api.slack.com/apis/connections/events-api#the-events-api__responding-to-events
     res.send();
     // console.log(body.text);
-    const parseBody = parse(body);
-    console.log(parseBody);
+    const index = new IndexService();
+    index.receiveBody(body);
     // console.log('body', body);
 
     return 'This action will be handled by bolt service.';