aboutsummaryrefslogtreecommitdiff
path: root/BackEnd/Timeline/Controllers
diff options
context:
space:
mode:
Diffstat (limited to 'BackEnd/Timeline/Controllers')
-rw-r--r--BackEnd/Timeline/Controllers/BookmarkTimelineController.cs2
-rw-r--r--BackEnd/Timeline/Controllers/HighlightTimelineController.cs2
-rw-r--r--BackEnd/Timeline/Controllers/TimelineController.cs1
-rw-r--r--BackEnd/Timeline/Controllers/TimelinePostController.cs5
-rw-r--r--BackEnd/Timeline/Controllers/TokenController.cs1
-rw-r--r--BackEnd/Timeline/Controllers/UserAvatarController.cs2
-rw-r--r--BackEnd/Timeline/Controllers/UserController.cs5
-rw-r--r--BackEnd/Timeline/Controllers/V2/TimelinePostV2Controller.cs6
8 files changed, 17 insertions, 7 deletions
diff --git a/BackEnd/Timeline/Controllers/BookmarkTimelineController.cs b/BackEnd/Timeline/Controllers/BookmarkTimelineController.cs
index a1fa511c..ba19e67d 100644
--- a/BackEnd/Timeline/Controllers/BookmarkTimelineController.cs
+++ b/BackEnd/Timeline/Controllers/BookmarkTimelineController.cs
@@ -1,5 +1,6 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
+using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Timeline.Entities;
@@ -16,6 +17,7 @@ namespace Timeline.Controllers
/// </summary>
[ApiController]
[ProducesErrorResponseType(typeof(CommonResponse))]
+ [Obsolete("Use v2 api.")]
public class BookmarkTimelineController : MyControllerBase
{
private readonly IBookmarkTimelineService _service;
diff --git a/BackEnd/Timeline/Controllers/HighlightTimelineController.cs b/BackEnd/Timeline/Controllers/HighlightTimelineController.cs
index e30cf720..94fdd01e 100644
--- a/BackEnd/Timeline/Controllers/HighlightTimelineController.cs
+++ b/BackEnd/Timeline/Controllers/HighlightTimelineController.cs
@@ -1,4 +1,5 @@
using Microsoft.AspNetCore.Mvc;
+using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Timeline.Auth;
@@ -17,6 +18,7 @@ namespace Timeline.Controllers
/// </summary>
[ApiController]
[ProducesErrorResponseType(typeof(CommonResponse))]
+ [Obsolete("Use v2 bookmark instead.")]
public class HighlightTimelineController : MyControllerBase
{
private readonly IHighlightTimelineService _service;
diff --git a/BackEnd/Timeline/Controllers/TimelineController.cs b/BackEnd/Timeline/Controllers/TimelineController.cs
index 7aeec02f..4a3bdbe1 100644
--- a/BackEnd/Timeline/Controllers/TimelineController.cs
+++ b/BackEnd/Timeline/Controllers/TimelineController.cs
@@ -23,6 +23,7 @@ namespace Timeline.Controllers
[Route("timelines")]
[CatchMultipleTimelineException]
[ProducesErrorResponseType(typeof(CommonResponse))]
+ [Obsolete("Ues v2 api.")]
public class TimelineController : MyControllerBase
{
private readonly IUserService _userService;
diff --git a/BackEnd/Timeline/Controllers/TimelinePostController.cs b/BackEnd/Timeline/Controllers/TimelinePostController.cs
index fee80adb..ee457a1b 100644
--- a/BackEnd/Timeline/Controllers/TimelinePostController.cs
+++ b/BackEnd/Timeline/Controllers/TimelinePostController.cs
@@ -26,7 +26,8 @@ namespace Timeline.Controllers
[ApiController]
[Route("timelines/{timeline}/posts")]
[CatchMultipleTimelineException]
- [ProducesErrorResponseType(typeof(CommonResponse))]
+ [ProducesErrorResponseType(typeof(CommonResponse))]
+ [Obsolete("Use v2 api.")]
public class TimelinePostController : MyControllerBase
{
private readonly ILogger<TimelinePostController> _logger;
@@ -145,7 +146,7 @@ namespace Timeline.Controllers
[ProducesResponseType(typeof(void), StatusCodes.Status304NotModified)]
[ProducesResponseType(StatusCodes.Status400BadRequest)]
[ProducesResponseType(StatusCodes.Status403Forbidden)]
- [ProducesResponseType(StatusCodes.Status404NotFound)]
+ [ProducesResponseType(StatusCodes.Status404NotFound)]
public async Task<ActionResult> DataGet([FromRoute][GeneralTimelineName] string timeline, [FromRoute] long post, [FromRoute(Name = "data_index")][Range(0, 100)] long dataIndex)
{
var timelineId = await _timelineService.GetTimelineIdByNameAsync(timeline);
diff --git a/BackEnd/Timeline/Controllers/TokenController.cs b/BackEnd/Timeline/Controllers/TokenController.cs
index 7fba0bc5..2078c0ec 100644
--- a/BackEnd/Timeline/Controllers/TokenController.cs
+++ b/BackEnd/Timeline/Controllers/TokenController.cs
@@ -17,6 +17,7 @@ namespace Timeline.Controllers
[Route("token")]
[ApiController]
[ProducesErrorResponseType(typeof(CommonResponse))]
+ [Obsolete("Ues v2 api.")]
public class TokenController : MyControllerBase
{
private readonly IUserService _userService;
diff --git a/BackEnd/Timeline/Controllers/UserAvatarController.cs b/BackEnd/Timeline/Controllers/UserAvatarController.cs
index 072ab621..9e081757 100644
--- a/BackEnd/Timeline/Controllers/UserAvatarController.cs
+++ b/BackEnd/Timeline/Controllers/UserAvatarController.cs
@@ -1,6 +1,7 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
+using System;
using System.Threading.Tasks;
using Timeline.Filters;
using Timeline.Helpers.Cache;
@@ -17,6 +18,7 @@ namespace Timeline.Controllers
/// </summary>
[ApiController]
[ProducesErrorResponseType(typeof(CommonResponse))]
+ [Obsolete("Ues v2 api.")]
public class UserAvatarController : MyControllerBase
{
private readonly IUserService _userService;
diff --git a/BackEnd/Timeline/Controllers/UserController.cs b/BackEnd/Timeline/Controllers/UserController.cs
index 95a99a03..5dbd7016 100644
--- a/BackEnd/Timeline/Controllers/UserController.cs
+++ b/BackEnd/Timeline/Controllers/UserController.cs
@@ -1,13 +1,13 @@
-using Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
+using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Timeline.Auth;
using Timeline.Filters;
using Timeline.Models.Http;
using Timeline.Models.Validation;
-using Timeline.Services;
using Timeline.Services.Mapper;
using Timeline.Services.User;
@@ -18,6 +18,7 @@ namespace Timeline.Controllers
/// </summary>
[ApiController]
[ProducesErrorResponseType(typeof(CommonResponse))]
+ [Obsolete("Ues v2 api.")]
public class UserController : MyControllerBase
{
private readonly IUserService _userService;
diff --git a/BackEnd/Timeline/Controllers/V2/TimelinePostV2Controller.cs b/BackEnd/Timeline/Controllers/V2/TimelinePostV2Controller.cs
index 4d486041..8b7101e4 100644
--- a/BackEnd/Timeline/Controllers/V2/TimelinePostV2Controller.cs
+++ b/BackEnd/Timeline/Controllers/V2/TimelinePostV2Controller.cs
@@ -107,7 +107,7 @@ namespace Timeline.Controllers.V2
var data = await _postService.GetPostDataV2Async(timelineId, post, dataIndex);
if (data.ContentType == MimeTypes.TextMarkdown)
{
- return new ByteData(_markdownProcessor.Process(data.Data, Url, timeline, post), data.ContentType);
+ return new ByteData(_markdownProcessor.Process(data.Data, Url, owner, timeline, post), data.ContentType);
}
return data;
}
@@ -157,8 +157,8 @@ namespace Timeline.Controllers.V2
{
var post = await _postService.CreatePostAsync(timelineId, GetAuthUserId(), createRequest);
- var group = TimelineHub.GenerateTimelinePostChangeListeningGroupName(timeline);
- await _timelineHubContext.Clients.Group(group).SendAsync(nameof(ITimelineClient.OnTimelinePostChanged), timeline);
+ var group = TimelineHub.GenerateTimelinePostChangeListeningGroupName(owner, timeline);
+ await _timelineHubContext.Clients.Group(group).SendAsync(nameof(ITimelineClient.OnTimelinePostChangedV2), timeline);
var result = await MapAsync<HttpTimelinePost>(post);
return CreatedAtAction("Get", new { owner = owner, timeline = timeline, post = post.LocalId }, result);