BCSendMail.cs 808 B

1234567891011121314151617181920212223242526
  1. using System.Threading.Tasks;
  2. using BossBase;
  3. using Helper;
  4. using Logger;
  5. namespace BossCommand
  6. {
  7. public class BCSendMail: ABossCommand
  8. {
  9. public BossMail BossMail { get; set; }
  10. public BCSendMail(IMessageChannel iMessageChannel): base(iMessageChannel)
  11. {
  12. }
  13. public override async Task<object> DoAsync()
  14. {
  15. this.CommandString = string.Format("send_mail --json {0} ",
  16. MongoHelper.ToJson(this.BossMail));
  17. Log.Trace(this.CommandString);
  18. this.SendMessage(new CMSG_Boss_Gm { Message = this.CommandString });
  19. var smsgBossCommandResponse = await this.RecvMessage<SMSG_Boss_Command_Response>();
  20. return smsgBossCommandResponse.ErrorCode;
  21. }
  22. }
  23. }