aboutsummaryrefslogtreecommitdiff
path: root/Timeline
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2019-11-17 23:04:21 +0800
committercrupest <crupest@outlook.com>2019-11-17 23:04:21 +0800
commit5b5bb69c3ba2150816f120860be46d49c5bc37aa (patch)
tree46282455cd6bdf43bf2215d3918f5803b2a31674 /Timeline
parent05f334fba5ac87c24938ac02094da72db9388d26 (diff)
downloadtimeline-5b5bb69c3ba2150816f120860be46d49c5bc37aa.tar.gz
timeline-5b5bb69c3ba2150816f120860be46d49c5bc37aa.tar.bz2
timeline-5b5bb69c3ba2150816f120860be46d49c5bc37aa.zip
Fix typo in path of personal timeline controller actions. Add timeline permission test.
Diffstat (limited to 'Timeline')
-rw-r--r--Timeline/Controllers/PersonalTimelineController.cs8
-rw-r--r--Timeline/Startup.cs2
-rw-r--r--Timeline/Timeline.csproj10
3 files changed, 12 insertions, 8 deletions
diff --git a/Timeline/Controllers/PersonalTimelineController.cs b/Timeline/Controllers/PersonalTimelineController.cs
index af6a70f8..88f5ba00 100644
--- a/Timeline/Controllers/PersonalTimelineController.cs
+++ b/Timeline/Controllers/PersonalTimelineController.cs
@@ -87,7 +87,7 @@ namespace Timeline.Controllers
return await _service.GetPosts(username);
}
- [HttpPost("user/{username}/timeline/postop/create")]
+ [HttpPost("users/{username}/timeline/postop/create")]
[Authorize]
[CatchTimelineNotExistException]
public async Task<ActionResult<TimelinePostCreateResponse>> PostOperationCreate([FromRoute][Username] string username, [FromBody] TimelinePostCreateRequest body)
@@ -102,7 +102,7 @@ namespace Timeline.Controllers
return res;
}
- [HttpPost("user/{username}/timeline/postop/delete")]
+ [HttpPost("users/{username}/timeline/postop/delete")]
[Authorize]
[CatchTimelineNotExistException]
public async Task<ActionResult> PostOperationDelete([FromRoute][Username] string username, [FromBody] TimelinePostDeleteRequest body)
@@ -126,7 +126,7 @@ namespace Timeline.Controllers
return Ok();
}
- [HttpPost("user/{username}/timeline/op/property")]
+ [HttpPost("users/{username}/timeline/op/property")]
[Authorize]
[SelfOrAdmin]
[CatchTimelineNotExistException]
@@ -136,7 +136,7 @@ namespace Timeline.Controllers
return Ok();
}
- [HttpPost("user/{username}/timeline/op/member")]
+ [HttpPost("users/{username}/timeline/op/member")]
[Authorize]
[SelfOrAdmin]
[CatchTimelineNotExistException]
diff --git a/Timeline/Startup.cs b/Timeline/Startup.cs
index f6abf36d..b2e958f9 100644
--- a/Timeline/Startup.cs
+++ b/Timeline/Startup.cs
@@ -71,6 +71,8 @@ namespace Timeline
services.AddUserAvatarService();
services.AddScoped<IUserDetailService, UserDetailService>();
+ services.AddScoped<IPersonalTimelineService, PersonalTimelineService>();
+
var databaseConfig = Configuration.GetSection(nameof(DatabaseConfig)).Get<DatabaseConfig>();
services.AddDbContext<DatabaseContext>(options =>
diff --git a/Timeline/Timeline.csproj b/Timeline/Timeline.csproj
index 7e1dd4ef..6b4a2d6e 100644
--- a/Timeline/Timeline.csproj
+++ b/Timeline/Timeline.csproj
@@ -8,6 +8,12 @@
<LangVersion>8.0</LangVersion>
<Nullable>enable</Nullable>
</PropertyGroup>
+ <ItemGroup>
+ <Compile Remove="Resources\Filters\**" />
+ <Content Remove="Resources\Filters\**" />
+ <EmbeddedResource Remove="Resources\Filters\**" />
+ <None Remove="Resources\Filters\**" />
+ </ItemGroup>
<ItemGroup>
<Content Include="default-avatar.png">
@@ -174,8 +180,4 @@
<LastGenOutput>UserService.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
-
- <ItemGroup>
- <Folder Include="Resources\Filters\" />
- </ItemGroup>
</Project>