瀏覽代碼

clean code

kaori 4 年之前
父節點
當前提交
14f74cf443

+ 1 - 11
packages/app/src/server/service/activity.ts

@@ -1,14 +1,7 @@
-import {
-  Types,
-} from 'mongoose';
 import Crowi from '../crowi';
 import Crowi from '../crowi';
 
 
-
 import { getModelSafely } from '../util/mongoose-utils';
 import { getModelSafely } from '../util/mongoose-utils';
 
 
-import loggerFactory from '../../utils/logger';
-
-const logger = loggerFactory('growi:service:activity');
 
 
 class ActivityService {
 class ActivityService {
 
 
@@ -16,12 +9,9 @@ class ActivityService {
 
 
   inAppNotificationService!: any;
   inAppNotificationService!: any;
 
 
-  activityEvent!: any;
-
   constructor(crowi: Crowi) {
   constructor(crowi: Crowi) {
     this.crowi = crowi;
     this.crowi = crowi;
     this.inAppNotificationService = crowi.inAppNotificationService;
     this.inAppNotificationService = crowi.inAppNotificationService;
-    this.activityEvent = crowi.event('activity');
   }
   }
 
 
 
 
@@ -29,7 +19,7 @@ class ActivityService {
      * @param {object} parameters
      * @param {object} parameters
      * @return {Promise}
      * @return {Promise}
      */
      */
-  createByParameters = async function(parameters) {
+  createByParameters = function(parameters) {
     const Activity = getModelSafely('Activity') || require('../models/activity')(this.crowi);
     const Activity = getModelSafely('Activity') || require('../models/activity')(this.crowi);
 
 
     return Activity.create(parameters);
     return Activity.create(parameters);

+ 0 - 3
packages/app/src/server/service/comment.ts

@@ -15,14 +15,11 @@ class CommentService {
 
 
   commentEvent!: any;
   commentEvent!: any;
 
 
-  activityEvent!: any;
-
   constructor(crowi: Crowi) {
   constructor(crowi: Crowi) {
     this.crowi = crowi;
     this.crowi = crowi;
     this.inAppNotificationService = crowi.inAppNotificationService;
     this.inAppNotificationService = crowi.inAppNotificationService;
 
 
     this.commentEvent = crowi.event('comment');
     this.commentEvent = crowi.event('comment');
-    this.activityEvent = crowi.event('activity');
 
 
     // init
     // init
     this.initCommentEventListeners();
     this.initCommentEventListeners();

+ 0 - 3
packages/app/src/server/service/in-app-notification.ts

@@ -20,13 +20,10 @@ export default class InAppNotificationService {
 
 
   commentEvent!: any;
   commentEvent!: any;
 
 
-  activityEvent!: any;
-
 
 
   constructor(crowi: Crowi) {
   constructor(crowi: Crowi) {
     this.crowi = crowi;
     this.crowi = crowi;
     this.socketIoService = crowi.socketIoService;
     this.socketIoService = crowi.socketIoService;
-    this.activityEvent = crowi.event('activity');
 
 
     this.getUnreadCountByUser = this.getUnreadCountByUser.bind(this);
     this.getUnreadCountByUser = this.getUnreadCountByUser.bind(this);
   }
   }

+ 0 - 1
packages/app/src/server/service/page.js

@@ -22,7 +22,6 @@ class PageService {
   constructor(crowi) {
   constructor(crowi) {
     this.crowi = crowi;
     this.crowi = crowi;
     this.pageEvent = crowi.event('page');
     this.pageEvent = crowi.event('page');
-    this.activityEvent = crowi.event('activity');
 
 
     // init
     // init
     this.initPageEvent();
     this.initPageEvent();