Exemplo n.º 1
0
 public static User ConvertToUserModel(ChatAppService.User item)
 {
     return new User
     {
         ID = item.ID,
         Name = item.Name,
         Password = item.Password,
         EmailId = item.EmailId
     };
 }
Exemplo n.º 2
0
        public async Task <ActionResult> GetFile(int id, string contentType)
        {
            var message = await ChatAppService.FindMessageAsync(id, AbpSession.GetUserId());

            var jsonMessage = JObject.Parse(message.Message.Substring("[file]".Length));

            using (CurrentUnitOfWork.SetTenantId(null))
            {
                var fileObject = await BinaryObjectManager.GetOrNullAsync(Guid.Parse(((JValue)jsonMessage["id"]).Value.ToString()));

                if (fileObject == null)
                {
                    return(StatusCode((int)HttpStatusCode.NotFound));
                }

                return(File(fileObject.Bytes, contentType));
            }
        }
Exemplo n.º 3
0
 public MessagesController(SimpleBotUser bot, ChatAppService chatAppService)
 {
     _bot            = bot;
     _chatAppService = chatAppService;
 }