Przeglądaj źródła

fix register.ts

zahmis 5 lat temu
rodzic
commit
33c2a95c37

+ 0 - 13
packages/slack/src/services/register.js

@@ -1,13 +0,0 @@
-class RegisterService {
-
-  constructor(crowi) {
-    this.crowi = crowi;
-  }
-
-  hogeFunction(body) {
-    console.log(body);
-  }
-
-}
-
-module.exports = RegisterService;

+ 12 - 0
packages/slack/src/services/register.ts

@@ -0,0 +1,12 @@
+export class RegisterService {
+
+  // constructor(crowi) {
+  //   this.crowi = crowi;
+  // }
+
+  hogeFunction(body) {
+    console.log(body);
+    console.log('waimatu');
+  }
+
+}

+ 4 - 1
packages/slackbot-proxy/src/controllers/slack.ts

@@ -7,6 +7,7 @@ import { InstallationRepository } from '~/repositories/installation';
 import { InstallerService } from '~/services/InstallerService';
 
 import { supportedSlackCommands } from '../../../slack/src/index';
+import { RegisterService } from '../../../slack/src/services/register';
 
 @Controller('/slack')
 export class SlackCtrl {
@@ -61,7 +62,9 @@ export class SlackCtrl {
     // See https://api.slack.com/apis/connections/events-api#the-events-api__responding-to-events
     res.send();
     // console.log(supportedSlackCommands);
-    console.log('body', body);
+    const hoge = new RegisterService();
+    console.log(hoge.hogeFunction(body));
+    // console.log('body', body);
 
     return 'This action will be handled by bolt service.';
   }