Skip to content

Commit 60f2399

Browse files
committed
Migration and init stuff basic complete
1 parent ba15375 commit 60f2399

File tree

175 files changed

+57690
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

175 files changed

+57690
-0
lines changed

.vs/VSWorkspaceState.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"ExpandedNodes": [
3+
""
4+
],
5+
"SelectedNode": "\\ChatLife.sln",
6+
"PreviewInSolutionExplorer": false
7+
}

.vs/slnx.sqlite

216 KB
Binary file not shown.
129 KB
Binary file not shown.

ChatLife/.vs/ChatLife/config/applicationhost.config

Lines changed: 998 additions & 0 deletions
Large diffs are not rendered by default.

ChatLife/ChatHub.cs

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
using Microsoft.AspNetCore.SignalR;
2+
using System;
3+
using System.Collections.Concurrent;
4+
using System.Collections.Generic;
5+
using System.Linq;
6+
using System.Threading.Tasks;
7+
8+
namespace ChatLife
9+
{
10+
public class ChatHub : Hub
11+
{
12+
public static ConcurrentDictionary<string, string> users = new ConcurrentDictionary<string, string>();
13+
14+
public string GetConnectionId()
15+
{
16+
return Context.ConnectionId;
17+
}
18+
19+
public override Task OnConnectedAsync()
20+
{
21+
users.TryAdd(Context.ConnectionId, Context.ConnectionId);
22+
return base.OnConnectedAsync();
23+
}
24+
25+
public override Task OnDisconnectedAsync(Exception exception)
26+
{
27+
string user;
28+
users.TryRemove(Context.ConnectionId, out user);
29+
return base.OnDisconnectedAsync(exception);
30+
}
31+
}
32+
}

ChatLife/ChatLife.csproj

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<Project Sdk="Microsoft.NET.Sdk.Web">
2+
3+
<PropertyGroup>
4+
<TargetFramework>netcoreapp3.1</TargetFramework>
5+
<UserSecretsId>aspnet-ChatLife-156FCF84-ECFD-4BCD-B3B2-48CB9EAAFE60</UserSecretsId>
6+
<WebProject_DirectoryAccessLevelKey>0</WebProject_DirectoryAccessLevelKey>
7+
<GenerateRuntimeConfigurationFiles>True</GenerateRuntimeConfigurationFiles>
8+
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
9+
</PropertyGroup>
10+
11+
<ItemGroup>
12+
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="3.1.9" />
13+
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.11" />
14+
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="5.0.11">
15+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
16+
<!--<PrivateAssets>all</PrivateAssets>-->
17+
</PackageReference>
18+
<PackageReference Include="Microsoft.EntityFrameworkCore.Proxies" Version="5.0.11" />
19+
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="3.1.9" />
20+
<PackageReference Include="RestSharp" Version="106.12.0" />
21+
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="5.0.2" />
22+
<PackageReference Include="Swashbuckle.AspNetCore.Swagger" Version="6.2.2" />
23+
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerGen" Version="6.2.2" />
24+
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" Version="6.2.2" />
25+
</ItemGroup>
26+
<ItemGroup>
27+
<Folder Include="Resource\Avatar\" />
28+
<Folder Include="Resource\Attachment\" />
29+
</ItemGroup>
30+
</Project>

ChatLife/ChatLife.sln

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 16
4+
VisualStudioVersion = 16.0.31624.102
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ChatLife", "ChatLife.csproj", "{1B855445-219C-4ABF-9B0B-C01F8FE8B9B5}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{1B855445-219C-4ABF-9B0B-C01F8FE8B9B5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{1B855445-219C-4ABF-9B0B-C01F8FE8B9B5}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{1B855445-219C-4ABF-9B0B-C01F8FE8B9B5}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{1B855445-219C-4ABF-9B0B-C01F8FE8B9B5}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
GlobalSection(ExtensibilityGlobals) = postSolution
23+
SolutionGuid = {34A3B085-DFAF-4E7D-9748-77AEE9978D52}
24+
EndGlobalSection
25+
EndGlobal
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
using Microsoft.AspNetCore.Mvc;
2+
using System;
3+
using System.Collections.Generic;
4+
using System.Linq;
5+
using System.Threading.Tasks;
6+
7+
// For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
8+
9+
namespace ChatLife.Controllers
10+
{
11+
[Route("api/[controller]")]
12+
[ApiController]
13+
public class AuthController : ControllerBase
14+
{
15+
// GET: api/<AuthController>
16+
[HttpGet]
17+
public IEnumerable<string> Get()
18+
{
19+
return new string[] { "value1", "value2" };
20+
}
21+
22+
// GET api/<AuthController>/5
23+
[HttpGet("{id}")]
24+
public string Get(int id)
25+
{
26+
return "value";
27+
}
28+
29+
// POST api/<AuthController>
30+
[HttpPost]
31+
public void Post([FromBody] string value)
32+
{
33+
}
34+
35+
// PUT api/<AuthController>/5
36+
[HttpPut("{id}")]
37+
public void Put(int id, [FromBody] string value)
38+
{
39+
}
40+
41+
// DELETE api/<AuthController>/5
42+
[HttpDelete("{id}")]
43+
public void Delete(int id)
44+
{
45+
}
46+
}
47+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
using Microsoft.AspNetCore.Mvc;
2+
using System;
3+
using System.Collections.Generic;
4+
using System.Linq;
5+
using System.Threading.Tasks;
6+
7+
// For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
8+
9+
namespace ChatLife.Controllers
10+
{
11+
[ApiController]
12+
[Route("[controller]")]
13+
public class TestController : ControllerBase
14+
{
15+
[HttpGet]
16+
public string Get()
17+
{
18+
return "API already";
19+
}
20+
}
21+
}

0 commit comments

Comments
 (0)