コード例 #1
0
        public IActionResult GetMails()
        {
            var userId = this.GetUserId();
            NotificationService notificationService = new NotificationService();

            notificationService._userID = userId;
            NotificationController notificationController = new NotificationController(notificationService);
            var result = notificationController.GetNotification(userId);
            var mails  = this._userService.GetMails(userId);

            return(new JsonResult(mails));
        }
コード例 #2
0
        public IActionResult PostMail([FromBody] PostMailModel mail)
        {
            NotificationController notificationController = new NotificationController(new NotificationService());
            var userId = this.GetUserId();
            PostNotificationModel postNotificationModel = new PostNotificationModel
            {
                Content         = mail.Text,
                ContentType     = "string",
                RecipientsList  = mail.To,
                WithAttachments = mail.Attachments.Length > 0 ? true : false,
            };
            var result = notificationController.PostNotification(postNotificationModel);

            this._mailService.SendMail(mail, userId);
            return(this.NoContent());
        }