Skip to content

Commit

Permalink
Updated to v8.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
magnuskrona committed Nov 2, 2021
1 parent 8c8a17b commit 54eb7fd
Show file tree
Hide file tree
Showing 22 changed files with 682 additions and 114 deletions.
4 changes: 4 additions & 0 deletions changelog.md
@@ -1,5 +1,9 @@
# Changelog for Weavy

## 8.7.0 (2021-11-02)

* Added Conversations API with functionality for getting, creating and updating Weavy conversations. For more information, check out the api documentation at https://[weavy_url]/api.

## 8.6.8 (2021-09-21)

* Fix for server error when fetching spaces.
Expand Down
Binary file modified lib/Weavy.Bundler.dll
Binary file not shown.
Binary file modified lib/Weavy.Bundler.pdb
Binary file not shown.
Binary file modified lib/Weavy.Core.dll
Binary file not shown.
Binary file modified lib/Weavy.Core.pdb
Binary file not shown.
Binary file modified lib/Weavy.Web.dll
Binary file not shown.
Binary file modified lib/Weavy.Web.pdb
Binary file not shown.
168 changes: 168 additions & 0 deletions lib/Weavy.Web.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified lib/wvy.exe
Binary file not shown.
Binary file modified lib/wvy.pdb
Binary file not shown.
2 changes: 0 additions & 2 deletions src/Areas/Api/Controllers/AppsController.cs
Expand Up @@ -40,7 +40,6 @@ public class AppsController : WeavyApiController {
/// <param name="model">The <see cref="App"/> to insert.</param>
/// <example>
/// POST /api/spaces/1/apps
///
/// {
/// "name": "Files",
/// "guid": "523edd88-4bbf-4547-b60f-2859a6d2ddc1"
Expand Down Expand Up @@ -68,7 +67,6 @@ public class AppsController : WeavyApiController {
/// <param name="model">Contains the new properties for the app.</param>
/// <example>
/// PATCH /api/spaces/527/apps
///
/// {
/// "name": "Files"
/// }
Expand Down
56 changes: 56 additions & 0 deletions src/Areas/Api/Controllers/BlobsController.cs
@@ -0,0 +1,56 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
using System.Web.Http;
using System.Web.Http.Description;
using Weavy.Core;
using Weavy.Core.Models;
using Weavy.Core.Services;
using Weavy.Web.Api.Controllers;
using Weavy.Web.Api.Models;
using Weavy.Web.Api.Streamers;

namespace Weavy.Areas.Api.Controllers {

/// <summary>
/// Api controller for manipulating Blobs.
/// </summary>
[RoutePrefix("api")]
public class BlobsController : WeavyApiController {

/// <summary>
/// Uploads new blob(s). Use multipart/form-data for the request format.
/// After upload the blobs can be used for setting avatars or as references when creating attachments and/or files.
/// </summary>
/// <returns>The uploaded blobs(s).</returns>
[HttpPost]
[Route("blobs")]
public async Task<ScrollableList<Blob>> Upload() {
// check if the request contains multipart/form-data.
if (!Request.Content.IsMimeMultipartContent()) {
throw new HttpResponseException(HttpStatusCode.UnsupportedMediaType);
}

// write uploaded files to local disk cache
var provider = await Request.Content.ReadAsMultipartAsync(new BlobMultipartFormDataRemoteStreamProvider());

// iterate over the uploaded files and store them as blobs in the database
List<Blob> blobs = new List<Blob>();
foreach (var data in provider.FileData) {
var blob = provider.GetBlob(data);
if (blob != null) {
try {
blob = BlobService.Insert(blob, System.IO.File.OpenRead(data.Location));
blobs.Add(blob);
} catch {
ThrowResponseException(HttpStatusCode.InternalServerError, "Failed to upload blobs");
}
}
}
return new ScrollableList<Blob>(blobs, null, null, blobs.Count(), Request.RequestUri);
}
}
}

0 comments on commit 54eb7fd

Please sign in to comment.