-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reorganiztion with a Routes => Controllers => Services => ModelManage…
…rs => DataObject structure (Interim commit) [airbug/airbug#89] Airbug. Airbug MVP Part I: Chat Basics
- Loading branch information
Showing
14 changed files
with
267 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
94 changes: 94 additions & 0 deletions
94
projects/airbugserver/js/src/Controllers/RoomsController.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
//------------------------------------------------------------------------------- | ||
// Annotations | ||
//------------------------------------------------------------------------------- | ||
|
||
//@Package('airbugserver') | ||
|
||
//@Export('RoomsController') | ||
|
||
//@Require('Class') | ||
//@Require('Obj') | ||
|
||
//------------------------------------------------------------------------------- | ||
// Common Modules | ||
//------------------------------------------------------------------------------- | ||
|
||
var bugpack = require('bugpack').context(); | ||
|
||
|
||
//------------------------------------------------------------------------------- | ||
// Bugpack Modules | ||
//------------------------------------------------------------------------------- | ||
|
||
var Class = bugpack.require('Class'); | ||
var Obj = bugpack.require('Obj'); | ||
|
||
|
||
//------------------------------------------------------------------------------- | ||
// Declare Class | ||
//------------------------------------------------------------------------------- | ||
|
||
var RoomsController = Class.extend(Obj, { | ||
|
||
_constructor: function(roomService){ | ||
|
||
this._super(); | ||
|
||
this.roomService = roomService; | ||
|
||
}, | ||
|
||
|
||
//------------------------------------------------------------------------------- | ||
// Methods | ||
//------------------------------------------------------------------------------- | ||
|
||
// configure: function(){ | ||
// | ||
// }, | ||
|
||
|
||
/* | ||
* @param {} params | ||
**/ | ||
createRoom: function(params){ | ||
if(currentUser){ | ||
this.roomService.create(params) | ||
} | ||
}, | ||
|
||
/* | ||
* @param {} params | ||
**/ | ||
joinRoom: function(params){ | ||
if(currentUser){ | ||
var roomId = params.roomId || params.room.id; | ||
this.roomService.addUserToRoom(currentUser, roomId); | ||
} | ||
}, | ||
|
||
/* | ||
* @param {} params | ||
**/ | ||
leaveRoom: function(params){ | ||
if(currentUser){ | ||
var roomId = params.roomId || params.room.id; | ||
this.roomService.removeUserFromRoom(currentUser, roomId); | ||
} | ||
}, | ||
|
||
//------------------------------------------------------------------------------- | ||
// Private Methods | ||
//------------------------------------------------------------------------------- | ||
|
||
pre: function(){ | ||
|
||
} | ||
}); | ||
|
||
|
||
//------------------------------------------------------------------------------- | ||
// Exports | ||
//------------------------------------------------------------------------------- | ||
|
||
bugpack.export('airbugserver.RoomsController', RoomsController); |
72 changes: 72 additions & 0 deletions
72
projects/airbugserver/js/src/Controllers/UsersController.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
//------------------------------------------------------------------------------- | ||
// Annotations | ||
//------------------------------------------------------------------------------- | ||
|
||
//@Package('airbugserver') | ||
|
||
//@Export('UsersController') | ||
|
||
//@Require('Class') | ||
//@Require('Obj') | ||
|
||
//------------------------------------------------------------------------------- | ||
// Common Modules | ||
//------------------------------------------------------------------------------- | ||
|
||
var bugpack = require('bugpack').context(); | ||
|
||
|
||
//------------------------------------------------------------------------------- | ||
// Bugpack Modules | ||
//------------------------------------------------------------------------------- | ||
|
||
var Class = bugpack.require('Class'); | ||
var Obj = bugpack.require('Obj'); | ||
|
||
|
||
//------------------------------------------------------------------------------- | ||
// Declare Class | ||
//------------------------------------------------------------------------------- | ||
|
||
var UsersController = Class.extend(Obj, { | ||
|
||
_constructor: function(){ | ||
|
||
this._super(); | ||
|
||
}, | ||
|
||
|
||
//------------------------------------------------------------------------------- | ||
// Methods | ||
//------------------------------------------------------------------------------- | ||
|
||
/* | ||
* @param {} | ||
**/ | ||
establishUser: function(params){ | ||
UserService.establishUser(); | ||
}, | ||
|
||
/* | ||
* @param {} | ||
**/ | ||
getCurrentUser: function(params){ | ||
|
||
}, | ||
|
||
/* | ||
* @param {} | ||
**/ | ||
logoutCurrentUser: function(params){ | ||
|
||
} | ||
|
||
}); | ||
|
||
|
||
//------------------------------------------------------------------------------- | ||
// Exports | ||
//------------------------------------------------------------------------------- | ||
|
||
bugpack.export('airbugserver.UsersController', UsersController); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.