mailHandler.js 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*-----------------------------------------------
  2. *本文件由代码生成器自动生成,
  3. *千万不要修改本文件的任何代码,
  4. *修改的的任何代码都会被覆盖掉!
  5. --------------------------------------------------*/
  6. var async = require('asyncawait/async');
  7. var await = require('asyncawait/await');
  8. var MailHandler = function(socket){
  9. this.socket = socket;
  10. }
  11. MailHandler.prototype.mailGetAllRequest = async(function(){
  12. return await(this.socket.requestAsync('area.mailHandler.mailGetAllRequest',{}));
  13. });
  14. MailHandler.prototype.mailSendMailRequest = async(function(toPlayerId,mailTitle,mailText,mailRead,toPlayerName){
  15. return await(this.socket.requestAsync('area.mailHandler.mailSendMailRequest',{toPlayerId:toPlayerId,mailTitle:mailTitle,mailText:mailText,mailRead:mailRead,toPlayerName:toPlayerName}));
  16. });
  17. MailHandler.prototype.mailDeleteRequest = async(function(c2s_id){
  18. return await(this.socket.requestAsync('area.mailHandler.mailDeleteRequest',{c2s_id:c2s_id}));
  19. });
  20. MailHandler.prototype.mailDeleteOneKeyRequest = async(function(){
  21. return await(this.socket.requestAsync('area.mailHandler.mailDeleteOneKeyRequest',{}));
  22. });
  23. MailHandler.prototype.mailGetAttachmentRequest = async(function(c2s_id){
  24. return await(this.socket.requestAsync('area.mailHandler.mailGetAttachmentRequest',{c2s_id:c2s_id}));
  25. });
  26. MailHandler.prototype.mailGetAttachmentOneKeyRequest = async(function(){
  27. return await(this.socket.requestAsync('area.mailHandler.mailGetAttachmentOneKeyRequest',{}));
  28. });
  29. MailHandler.prototype.mailReadNotify = function(c2s_id){
  30. return this.socket.notify('area.mailHandler.mailReadNotify',{c2s_id:c2s_id});
  31. };
  32. MailHandler.prototype.mailSendTestNotify = function(c2s_mailId,c2s_tcCode){
  33. return this.socket.notify('area.mailHandler.mailSendTestNotify',{c2s_mailId:c2s_mailId,c2s_tcCode:c2s_tcCode});
  34. };
  35. MailHandler.prototype.onOnGetMailPush = function(cb){
  36. this.socket.on('area.mailPush.onGetMailPush',cb);
  37. }
  38. module.exports = MailHandler;